feat(frontend): parsed .twasm emits the typedwasm.ownership carrier + ADR-0006 (Rust front-end canonical)#197
Merged
Merged
Conversation
…p carrier + ADR-0006 (Rust front-end canonical) The parsed path emitted NO ownership carrier: Parser.ownership was initialised empty and never pushed, so L7/L10 verified vacuously on every parsed .twasm source (the 6/6 corpus was weaker than it looked). - parse_param_type now returns the ownership kind a qualifier denotes (own -> Linear, &mut -> ExclBorrow, & -> SharedBorrow; bare region<T> and scalars stay Unrestricted) and parse_function records a Module::ownership entry for any function whose signature asks for discipline. - Module::ownership tuples gain a ret_kind slot (the wire format always had one; emit() hardcoded Unrestricted) so 'own' returns like spawn_particle's land on the wire. - tests/example03.rs: placeholder replaced with 3 real tests — parser records the expected kinds for every example-03 function, the emitted wasm carries the decodable carrier and verifies, and a double-free mutant of despawn_particle is REJECTED (the carrier has teeth). - ADR-0006: the Rust front-end is the canonical .twasm parser (owner direction 2026-07-07 — independence as a compile target); supersedes ADR-0004 section-2's 'no Rust parser' pin; AffineScript front-end demoted to reference; JSON-IR seam repurposed as the external-producer seam. - Stale '#127 / no in-process parser' comments + README matrix refreshed. Workspace: 142 tests, 0 failures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hyperpolymath
enabled auto-merge (squash)
July 6, 2026 23:21
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



First construction increment on the independence path (owner-ratified 2026-07-07).
The defect this closes
The parsed path emitted no ownership carrier at all:
Parser.ownershipwas initialised empty and never pushed to, soverify_from_modulepassed vacuously on every parsed.twasmsource — the 6/6 example round-trip was weaker than it looked. L7/L10 discipline declared in source (own,&mut,&) simply vanished before the wire.Changes
parse_param_typereturns the kind a qualifier denotes (own→Linear,&mut→ExclBorrow,&→SharedBorrow; bareregion<T>/scalars stay Unrestricted);parse_functionrecords aModule::ownershipentry for any disciplined signature.Module::ownershiptuples gain aret_kindslot (the wire format always had one;emit()hardcoded Unrestricted) —spawn_particle -> own region<Particle>now lands as a Linear return.tests/example03.rs: placeholder → 3 real tests. Parser kinds asserted for every example-03 function; emitted wasm carries the decodable carrier and verifies; a double-free mutant ofdespawn_particleis rejected (the carrier has teeth)..twasmfront-end; supersedes ADR-0004 §2's "no Rust parser" pin; the AffineScript front-end (src/parser/*.affine) is demoted to reference implementation; the JSON-IR seam is repurposed as the external-producer seam. ADR-0004 §1/§3 stand.Verification
cargo test --workspace: 142 tests, 0 failures — including the six-example parse→emit→verify corpus now carrying real (non-vacuous) ownership sections.🤖 Generated with Claude Code