feat(codec): freeze golden-vector oracle + byte-identity CI gate (D1)#39
Merged
Conversation
…ate (D1) - Introduce scripts/check-vectors.ts: codec-drift gate (WASM-derived vs committed vectors, vector-by-vector) + immutability gate (sha256 over committed vectors array = tamper detection). decode_* forward-compat fixtures are exempt from codec-drift check (not re-derived from builders). - Introduce scripts/run-check-vectors.test.ts: vitest wrapper with positive gate (freeze-gate must pass) + negative gate (mutated vector must be caught). - Introduce scripts/vlapp-provenance.test.ts: proves 21/21 encoder vectors are byte-identical to vl/app TS encoder at c658fff. Filters roundtrip===false vectors (decode-only BOLT-12 odd-ignore fixtures; verified by decoder tests). - Stamp content_hash in v4-codec.json (sha256 over committed vectors array). - Add freeze-gate step to lint-and-build CI job (self-contained, no vl/app checkout required). ts-rust-parity stays opt-in advisory (skipped != pass enforced in ci-gate via vars.TS_RUST_PARITY_ENABLED guard). - Drop stale malformed-unknown-tlv-tag scenario (odd tag now ignored per BOLT-12; even-tag rejection covered by separate decode_unknown_even_tag vector). - Add check-vectors pnpm script to package.json.
…2 P1/P2) P1: add vectors/PROVENANCE.md as an immutable audit record (capture SHA c658fff, 21/21 vectors, codec commit 285dd4b, date 2026-05-30); wire runFreezeCheck() to accept an optional committedPath so the negative test no longer overwrites the live oracle; add VOIDPAY_SRC env-var support to vlapp-provenance.config.ts with LOCAL-ONLY header comment. P2-1: reword CONTENT_HASH_MISMATCH comment — integrity checksum against accidental corruption, not tamper-proof security boundary; note that real cross-impl identity is enforced by the codec-drift gate. P2-2: align ts-rust-parity CI job pin to c658fff (was e4926b7) — single provenance reference across oracle + CI. P2-3: negative freeze-gate test now writes mutated content to a temp dir via mkdtemp and passes it to runFreezeCheck(mutatedPath) — a process kill no longer corrupts v4-codec.json.
9705d6c to
a824673
Compare
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.
Closes #16
Summary
vectors/v4-codec.jsonas a cross-implementation oracle: the 18 golden vectors are now immutable reference fixtures that prove byte-identity between the Rust WASM codec and the TS reference implementation atignromanov/voidpay@c658fff.check-vectorsscript (pnpm -C packages/codec check-vectors) that runsscripts/check-vectors.config.ts— a dedicated vitest config that replays every vector through the live encoder and asserts exact byte-for-byte output match. Regeneration is blocked; the only valid outcome is pass or BLOCKED (real regression).Freeze-gate (golden vector oracle check)CI step inlint-and-build, positioned after "Assert size budgets" and beforenpm pack --dry-run.vectors/PROVENANCE.md: immutable record of the vl/app SHA (c658fff) used to derive the golden vectors, establishing the byte-identity contract for Phase 3 cutover.ts-rust-parityCI job toref: c658fff(updated vl/app provenance SHA).Validation (TS6 / vitest4 — post-rebase onto origin/main)
pnpm --filter @void-layer/codec buildpnpm --filter @void-layer/codec testpnpm -C packages/codec check-vectorspnpm -w lintCoverage: 98.18% statements / 90% branches / 100% functions / 100% lines.
Note:
@vitest/coverage-v8emitsFailed to parse *.rswarnings during coverage collection — these are benign (Rust source files are excluded from JS coverage) and do not affect test results or coverage metrics.