Skip to content

feat(l13): region-imports carrier — proposal 0003 accepted, codec + link-graph verifier + producer emission (#140)#198

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/140-region-imports
Jul 7, 2026
Merged

feat(l13): region-imports carrier — proposal 0003 accepted, codec + link-graph verifier + producer emission (#140)#198
hyperpolymath merged 1 commit into
mainfrom
feat/140-region-imports

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Increment 1 of 3 on the independence construction path (owner-ratified sequence).

Closes the L13 positive-form gap: typedwasm.region-imports now exists end-to-end — codec + module-local pass + verify_link_graph cross-module SchemaSub certification in typed-wasm-verify (behind unstable-l13-imports), and producer emission from real .twasm source (import region Entity from "physics" { … }) in typed-wasm-codegen. The examples/02 killer feature — one module exports a schema, others import subsets, agreement certified before anything runs — round-trips in-process for the first time.

  • Proposal 0003: [draft][accepted] (2026-07-07) → ADR-0007; wire format as specced (LEB128 + u16le version), with an implementation note pinning sibling-codec conventions.
  • target_region v1.1 high-bit value-space extension implemented (TARGET_REGION_IMPORT_BIT), non-breaking for v1 consumers.
  • Full RegionImportsError taxonomy from the proposal's §Consumer obligations; 15 new L13 tests + 5 codec tests; 162 workspace tests, 0 failures.
  • Union-merge rule for repeated (producer, region) imports in one file (examples/02 holds three conceptual modules) — keeps the carrier's uniqueness obligation.
  • Cross-repo adoption issues for affinescript + ephapax drafted in docs/developer/cross-repo-issues-proposal-0003-adoption.adoc (automated filing was permission-blocked — ready to paste).
  • Parser module header rewritten per ADR-0006 (still said "stopgap until the AffineScript front-end").

Part of #140 (remaining there: producer-emitted c5_real differential fixture pair; per-module split of multi-file sources).

🤖 Generated with Claude Code

…ink-graph verifier + producer emission (#140)

L13 positive form on emitted bytes: one module exports a region schema,
others import subsets, and agreement is certified at link time — the
examples/02 killer feature, previously spec-only (noSpoofing fired only
in Idris2, never on wire).

typed-wasm-verify (new `unstable-l13-imports` feature, implies l2):
- section.rs: RegionImportEntry + parse/build for
  typedwasm.region-imports (u16le version, LEB128 lengths, UTF-8;
  expected fields reuse FieldEntry, scalar-only v1). 5 codec tests
  incl. UTF-8 + truncation-leniency sweeps.
- verify.rs: verify_region_imports_from_module (dependent-regions
  presence, unique (producer,region) pairs, v1 pointer restriction,
  high-bit target_region FKs in import-table bounds;
  TARGET_REGION_IMPORT_BIT) + verify_link_graph (SchemaSub expected
  vs actual per import, subset semantics -> CompatCertificate per
  MultiModule.idr; full RegionImportsError taxonomy).
- tests/link_graph.rs: 11 tests mirroring example-02's physics/ai/
  render trio + every error variant.

typed-wasm-codegen:
- parser: `import region X from "mod" { fields }` -> expected-schema
  entries; repeated imports of one (producer, region) pair union-merge
  (a single .twasm file holds several conceptual modules); conflicting
  field types are a source error. Pointer-typed expected fields
  rejected (v1).
- emit(): writes the carrier via the verifier's own encoder; always
  emits the dependent typedwasm.regions section alongside.
- tests/example02.rs: 4 tests — union-merged import table, emitted
  carrier + self-link certificate, mutated-expectation rejection,
  absent-producer rejection.

Docs: proposal 0003 draft->accepted (impl note: sibling-codec
conventions); promoted to ADR-0007; LEVEL-STATUS L13 positive form ->
YES (import-bound); spec carrier table + target_region v1.1 high-bit
note; codegen README; parser header rewritten per ADR-0006 (was still
"stopgap until AffineScript front-end"). Cross-repo adoption issue
drafts in docs/developer/cross-repo-issues-proposal-0003-adoption.adoc
(automated filing permission-blocked).

Workspace: 162 tests, 0 failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit c0b8b71 into main Jul 7, 2026
28 checks passed
@hyperpolymath
hyperpolymath deleted the feat/140-region-imports branch July 7, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant