vcl-ut #25 P5c (step 1): certified OctadSchema wire codec + cross-language conformance#30
Merged
Merged
Conversation
…guage conformance The recompute-PCC tier (see the two-tier boundary model in VERIFICATION-STANCE.adoc) ships the OctadSchema alongside the Statement so the consumer can re-run the certified decider. This adds the schema half of the marshalling, certified and conformance-proven — and closes the previously-OWED "C-ABI Statement/OctadSchema marshalling" item for the decode/schema direction. Wire format (WIRE-FORMAT.adoc): - New `VqlType` discriminants (16, STABLE/append-only) — recursive, so its decoder is fuel-bounded exactly like `Expr`. - `FieldDef`/`ModalitySchema` composites; `OctadSchema` = 8 modality schemas in Schema.idr record order (fixed arity, no count). - Distinct `VCLS` magic so a schema/statement mix-up is a hard `BadMagic`, never a silent mis-parse. Rust (trusted encoder, src/interface/parse): - New `schema` module — faithful mirror of Schema.idr `OctadSchema` + Grammar.idr `VqlType`. Documented why `VqlType` lives here, not in `ast` (a schema *is* type declarations; the parser's "syntax only" honesty is preserved by the module split). - `wire.rs`: `to_wire_schema`/`from_wire_schema`, same SPARK-grade posture (total, bounds-checked, no panic). clippy `-D warnings` clean, fmt clean. Idris (certified decoder, corpus): - `WireDecode`: `decVqlType` (fuel-bounded mutual block with the recursive `TRecord` field-list inlined so size-change sees the decreasing edge), `decFieldDef`/`decModalitySchema`, `fromWireSchema`. `%default total`, ZERO proof-escape. - `WireConformance`: `conformS1 : fromWireSchema goldenS1 = Right expectedS1` by `Refl` — the schema decoder is proven byte-for-byte conformant with the Rust `to_wire_schema` encoder at compile time. Fixture S1 exercises all 8 modality slots, empty + non-empty field lists, bools, `TVector(Nat)`, and recursive `VqlType` (`TList TString`). - Regeneration oracle `conformance_emit.rs` extended (schema fixture + round-trip self-check); golden bytes injected verbatim. Verified: corpus `idris2 --build` exit 0 (12 modules; WireDecode 4/12, WireConformance 5/12); CI proof-escape audit OK (the new code is in the audited file list); parse-gate equivalent (clippy/test/fmt) clean. Stacked on #29 (P5b step 2) — `WireDecode`/`WIRE-FORMAT.adoc` are not on `main` yet; rebase to `main` once #29 merges. Refs #25. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
An error occurred while trying to automatically change base from
reinforce/vclut-25-phase5b-idris-decoder
to
main
May 19, 2026 16:52
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.
P5c (step 1) — certified
OctadSchemawire codec + cross-language conformanceThe recompute-PCC tier (the typed-wasm objective, per the two-tier
boundary model in
VERIFICATION-STANCE.adoc) ships theOctadSchemaalongside the
Statementso the consumer can re-run the certifieddecider. This adds the schema half of the marshalling — certified
and conformance-proven — and closes the previously-OWED "C-ABI
Statement/OctadSchemamarshalling" item for the decode/schemadirection.
Wire format (
WIRE-FORMAT.adoc)VqlTypediscriminants (STABLE, append-only) — recursive, so thedecoder is fuel-bounded exactly like
Expr.FieldDef/ModalitySchemacomposites;OctadSchema= 8 modalityschemas in
Schema.idrrecord order (fixed arity, no count).VCLSmagic ⇒ schema/statement mix-up is a hardBadMagic, never a silent mis-parse.Rust (trusted encoder)
schemamodule: faithful mirror ofSchema.idrOctadSchema+Grammar.idrVqlType, with a documented note on whyVqlTypelives here and not in
ast(a schema is type declarations; theparser's "syntax only" honesty is preserved by the module split).
to_wire_schema/from_wire_schema— same SPARK posture (total,bounds-checked, no panic).
Idris (certified decoder, in the CI-gated corpus)
WireDecode:decVqlType(fuel-boundedmutualblock, recursiveTRecordfield-list inlined so size-change sees the decreasingedge),
decFieldDef/decModalitySchema,fromWireSchema.%default total, ZERO proof-escape.WireConformance:conformS1 : fromWireSchema goldenS1 = Right expectedS1byRefl— the schema decoder is provenbyte-for-byte conformant with the Rust
to_wire_schemaencoder atcompile time. S1 exercises all 8 modality slots, empty + non-empty
field lists, bools,
TVector(Nat), and recursiveVqlType(
TList TString).conformance_emit.rsregeneration oracle extended (schema fixture +round-trip self-check); golden bytes injected verbatim, never
hand-transcribed.
Verified locally
idris2 0.8.0 --buildexit 0 — 12 modules (WireDecode4/12, WireConformance 5/12).
OK: zero proof-escape symbols outside comments(the new code is in the audited file list).cargo clippy --all-targets --locked -D warningsclean,cargo test --lockedgreen (incl. schemaround-trip self-check),
cargo fmt --checkclean.Where this sits in P5c
P5c = recompute-certified-decider over typed-wasm. This is step 1
(schema marshalling, the data both tiers need). Next: AffineScript
wire decoder + decision-core port → typed-wasm, the three-way
conformance harness (Idris-decider verdict == typed-wasm-decider
verdict), transport plumbing with the C/Zig fail-closed attestation
fallback, and the stance flip + ADR.
Refs #25.
🤖 Generated with Claude Code