---
title: "wasi-linker — Mova code model"
description: "Mova code model of wasi-host/src/lib.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/wasi-host/src/lib.rs.groupant/wasi-linker.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/wasi-host/src/lib.rs.groupant/wasi-linker.groupant/>

# wasi-linker

The groupant beside wasi-host/src/lib.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

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`wasi-host/src/lib.rs`](https://github.com/ElamurAI/mova-free/blob/main/wasi-host/src/lib.rs)
- **source SHA-256:** `91213ce903810791…`
- **covers:** add_wasi registers46 named functions. Wrappers require memory, increment calls then evaluate helper, return errno. proc_exit increments and traps with status without requiring memory. Socket/link/process-raise unsupported. fd rights intersect metadata; renumber clones source to existing target then clears source. (bytes 21901–30226)
- **part of:** [wasi-runtime](https://md.groupants.elamur.ai/free/en/mova/wasi-host/src/lib.rs.groupant/)
- **repository folder:** [`wasi-host/src/lib.rs.groupant/wasi-linker.groupant`](https://github.com/ElamurAI/mova-free/tree/main/wasi-host/src/lib.rs.groupant/wasi-linker.groupant)
- **repository commit:** `48f2e6f74146`

> **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

| component | label | where |
|---|---|---|
| **approximant** | partial | [approximant](#approximant) |
| **ast** | partial | `../syntax.json` |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | compile and source review | [tests](#tests) |

## 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.

| id | type | label | where |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial source derived model | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `memory_gate` | memory_gate | partial source derived model | [memory_gate](#memory-gate) |
| `rights_projection` | rights_projection | partial source derived model | [rights_projection](#rights-projection) |
| `renumber_alias` | renumber_alias | partial source derived model | [renumber_alias](#renumber-alias) |
| `unsupported_effects` | unsupported_effects | partial source derived model | [unsupported_effects](#unsupported-effects) |

## Model text


### descriptant

#### wasi-linker

add_wasi registers46 named functions. Wrappers require memory, increment calls then evaluate helper, return errno. proc_exit increments and traps with status without requiring memory. Socket/link/process-raise unsupported. fd rights intersect metadata; renumber clones source to existing target then clears source.

##### 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

add_wasi registers46 named functions. Wrappers require memory, increment calls then evaluate helper, return errno. proc_exit increments and traps with status without requiring memory. Socket/link/process-raise unsupported. fd rights intersect metadata; renumber clones source to existing target then clears source.

Scope: `wasi-linker`. 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

add_wasi registers46 named functions. Wrappers require memory, increment calls then evaluate helper, return errno. proc_exit increments and traps with status without requiring memory. Socket/link/process-raise unsupported. fd rights intersect metadata; renumber clones source to existing target then clears source.

The invariant is conditional on the admitted transition: With memory present, sock_send cannot succeed or access network; absent memory, normal macro wrapper cannot increment its counter. proc_exit is explicitly excepted.

Cost: O(46) registrations; per-call map O(log distinct names) plus helper cost. Unsupported operations O(1) after memory lookup.

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/lib.rs` at SHA-256 `91213ce9038107912c2dd707c3a6639a2d723cdfceb02981a166a6853800248e`, scope `wasi-linker`. 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: With memory present, sock_send cannot succeed or access network; absent memory, normal macro wrapper cannot increment its counter. proc_exit is explicitly excepted.

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/lib.rs` at SHA-256 `91213ce9038107912c2dd707c3a6639a2d723cdfceb02981a166a6853800248e`, scope `wasi-linker`. 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: Call counters omit memoryless wrapper attempts but count helper errors; equal counts permit many call orderings and arguments. proc_exit status may identify final call but not preceding effects.

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.

### memory_gate

Subject: `wasi-host/src/lib.rs` at SHA-256 `91213ce9038107912c2dd707c3a6639a2d723cdfceb02981a166a6853800248e`, scope `wasi-linker`. 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: Even no-memory helpers sched_yield and sock_* return FAULT when memory export missing; proc_exit does not.

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.

### rights_projection

Subject: `wasi-host/src/lib.rs` at SHA-256 `91213ce9038107912c2dd707c3a6639a2d723cdfceb02981a166a6853800248e`, scope `wasi-linker`. 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: fd_fdstat_set_rights intersects metadata without updating cached read/write booleans; do not infer capability revocation from fdstat alone.

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.

### renumber_alias

Subject: `wasi-host/src/lib.rs` at SHA-256 `91213ce9038107912c2dd707c3a6639a2d723cdfceb02981a166a6853800248e`, scope `wasi-linker`. 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: from==to passes both lookups, writes clone then clears same slot; no identity-law assertion is justified.

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.

### unsupported_effects

Subject: `wasi-host/src/lib.rs` at SHA-256 `91213ce9038107912c2dd707c3a6639a2d723cdfceb02981a166a6853800248e`, scope `wasi-linker`. 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: Socket operations return NOTSUP after memory check without network traffic; path_link does not create hard links.

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

Source review and compilation only for this scope; no runtime branch-coverage claim.

Exact names: .

Memory tests bypass linker ABI; tiny empty/unreachable guests exercise engine outcomes only. The CLI test uses isolated import/export/journal fixtures.

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.
