Elamur GroupantsโŒ•
โ˜ฐ

wasi-cli-effects

The groupant beside wasi-host/src/main.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

Facts

Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

Components

componentlabelwhere
approximantpartialapproximant
astpartial../syntax.json
costsymbolic source derivedinvariant
descriptantpresentdescriptant
invariantpartialinvariant
testsexecuted bounded checkstests

Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
import_failureimport_failurepartial source derived modelimport_failure
basename_argvbasename_argvpartial source derived modelbasename_argv
export_orderexport_orderpartial source derived modelexport_order
status_clampstatus_clamppartial source derived modelstatus_clamp

Model text

descriptant

wasi-cli-effects

Construct limited Vfs, sequentially import each real->virtual pair, derive basename argv and append suffix, apply seed/mem/echo, run; exports gated on code0+no trap. Journal/stat occur after export loop.

Epoch 2026-10-31

Prospective review recorded before edits. Source review found late output FAULT effects and weaker-than-capability rights metadata; these are modeled as current behavior rather than silently repaired. Only bounded new test blocks were added; production code remains unchanged. Actual finite results and exact restoration receipts live under $MOVA_DATA/runs/octopus-wave31-wasi-2026-10-31. No full mlab guest, frozen suite, GPU or corpus run. This node retains its scoped observations for future refinement.

approximant

Forward relation

Construct limited Vfs, sequentially import each real->virtual pair, derive basename argv and append suffix, apply seed/mem/echo, run; exports gated on code0+no trap. Journal/stat occur after export loop.

Scope: wasi-cli-effects. State and transitions follow the authoritative source, including partial effects before errors. No executable approximate replacement is attached: categorical errno/effects and module execution lack a useful validated percentage metric; future numerical profiles may only use1/2/5/10% caps after domain/reference evidence.

invariant

Invariant and cost

Construct limited Vfs, sequentially import each real->virtual pair, derive basename argv and append suffix, apply seed/mem/echo, run; exports gated on code0+no trap. Journal/stat occur after export loop.

The invariant is conditional on the admitted transition: Once import fails, guest execution and exports are absent; once export fails, later exports/journal/stats are absent. Earlier exports need not be undone.

Cost: O(import+export traversal bytes)+Host run; journal serializes all records; stats scans distinct calls.

No wall-time gain, universal resource bound or atomic rollback is inferred. External Vfs/wasmi/native-mlab work remains separately charged.

models

Typed model catalog

behavior_complement

Subject: wasi-host/src/main.rs at SHA-256 2200229297d1dde6d9f8477a577a7320c854d0db4fb3ea450b457a9858107122, scope wasi-cli-effects. Domain: the source transition and bounded fixtures described in approximant.md; readable valid host resources where required. Observation: returned values, byte coordinates, state/effect order, not total-system semantics. Operator/relation: Once import fails, guest execution and exports are absent; once export fails, later exports/journal/stats are absent. Earlier exports need not be undone.

Status: partial source-derived relation; complement is a scoped exclusion hypothesis, reverse preserves all compatible antecedents described rather than a chosen inverse. Assumptions: production branch order, declared coordinate/resource premises; no completeness claim for untested inputs. Evidence: tests.md distinguishes actual execution from source review; finite observations can falsify but not prove the relation.

reverse_reconstruction

Subject: wasi-host/src/main.rs at SHA-256 2200229297d1dde6d9f8477a577a7320c854d0db4fb3ea450b457a9858107122, scope wasi-cli-effects. Domain: the source transition and bounded fixtures described in approximant.md; readable valid host resources where required. Observation: returned values, byte coordinates, state/effect order, not total-system semantics. Operator/relation: Successful exit with journal absent admits no request or failed journal write. Export tree loses guest descriptor/call history.

Status: partial source-derived relation; complement is a scoped exclusion hypothesis, reverse preserves all compatible antecedents described rather than a chosen inverse. Assumptions: production branch order, declared coordinate/resource premises; no completeness claim for untested inputs. Evidence: tests.md distinguishes actual execution from source review; finite observations can falsify but not prove the relation.

import_failure

Subject: wasi-host/src/main.rs at SHA-256 2200229297d1dde6d9f8477a577a7320c854d0db4fb3ea450b457a9858107122, scope wasi-cli-effects. Domain: the source transition and bounded fixtures described in approximant.md; readable valid host resources where required. Observation: returned values, byte coordinates, state/effect order, not total-system semantics. Operator/relation: First import failure returns2 before guest, preserving any earlier host reads but no exports.

Status: partial source-derived relation; complement is a scoped exclusion hypothesis, reverse preserves all compatible antecedents described rather than a chosen inverse. Assumptions: production branch order, declared coordinate/resource premises; no completeness claim for untested inputs. Evidence: tests.md distinguishes actual execution from source review; finite observations can falsify but not prove the relation.

basename_argv

Subject: wasi-host/src/main.rs at SHA-256 2200229297d1dde6d9f8477a577a7320c854d0db4fb3ea450b457a9858107122, scope wasi-cli-effects. Domain: the source transition and bounded fixtures described in approximant.md; readable valid host resources where required. Observation: returned values, byte coordinates, state/effect order, not total-system semantics. Operator/relation: argv0 is module basename or fallback module; directory path erased from guest argv0.

Status: partial source-derived relation; complement is a scoped exclusion hypothesis, reverse preserves all compatible antecedents described rather than a chosen inverse. Assumptions: production branch order, declared coordinate/resource premises; no completeness claim for untested inputs. Evidence: tests.md distinguishes actual execution from source review; finite observations can falsify but not prove the relation.

export_order

Subject: wasi-host/src/main.rs at SHA-256 2200229297d1dde6d9f8477a577a7320c854d0db4fb3ea450b457a9858107122, scope wasi-cli-effects. Domain: the source transition and bounded fixtures described in approximant.md; readable valid host resources where required. Observation: returned values, byte coordinates, state/effect order, not total-system semantics. Operator/relation: Exports are sequential and no rollback; first write failure returns2, later exports and journal skipped.

Status: partial source-derived relation; complement is a scoped exclusion hypothesis, reverse preserves all compatible antecedents described rather than a chosen inverse. Assumptions: production branch order, declared coordinate/resource premises; no completeness claim for untested inputs. Evidence: tests.md distinguishes actual execution from source review; finite observations can falsify but not prove the relation.

status_clamp

Subject: wasi-host/src/main.rs at SHA-256 2200229297d1dde6d9f8477a577a7320c854d0db4fb3ea450b457a9858107122, scope wasi-cli-effects. Domain: the source transition and bounded fixtures described in approximant.md; readable valid host resources where required. Observation: returned values, byte coordinates, state/effect order, not total-system semantics. Operator/relation: Returned code is clamp(out.exit_code,0,255); trap normally134 but printed trap alone is not return code logic.

Status: partial source-derived relation; complement is a scoped exclusion hypothesis, reverse preserves all compatible antecedents described rather than a chosen inverse. Assumptions: production branch order, declared coordinate/resource premises; no completeness claim for untested inputs. Evidence: tests.md distinguishes actual execution from source review; finite observations can falsify but not prove the relation.

tests

Checks and limits

Named actual-source tests run twice per debug/release; exact commands and numeric statuses retained externally. Test success is finite evidence only.

Exact names: wave31_cli_tiny_guest_isolated_effects.

wave31_cli_tiny_guest_isolated_effects invokes actual wasi-run with one tiny empty guest and one unreachable guest, root-local import/export/journal and two usage failures.

Five compiled production/helper-source controls: append offset, virtual clock advance, trap status, CLI export gate and newest-mtime max. Each compiles, fails its selected assertion, restores exact original bytes and passes again. These controls cover their target relations, not every node. No assertion-only mutants. See external source-test-map.json, native-commands.json, verify.rs and numeric/raw receipts in $MOVA_DATA/runs/octopus-wave31-wasi-2026-10-31. The example main and frozen mlab paths are never executed.

This page in Markdown โ†’ https://md.groupants.elamur.ai/free/en/mova/wasi-host/src/main.rs.groupant/wasi-cli-effects.groupant/