Add conformance vector suite - #6
Merged
Merged
Conversation
Each vector's message is authored as plain JS data matching a spec/*.cddl rule's fields; wire_hex is derived mechanically by canonically CBOR-encoding it via cbor2's CDE mode, never hand-typed. verify.mjs confirms both directions independently for every vector: decoding wire_hex reproduces message, and re-encoding message reproduces wire_hex. Covers handshake-frame, every other $frame-variant in spec/frame.cddl, capability-token (including a delegation chain), and handle-record. Signature and public-key bytes are clearly-synthetic filler, freezing the wire-exact envelope shape rather than a working signature.
Regenerates conformance/*.v1.json and diffs against the committed files (the same drift check cddl-validate already runs for protocol.cddl), then runs npm run verify so every vector round-trips through cbor2. Feeds the required-checks aggregator alongside cddl-validate.
Previously a no-op placeholder waiting for rust/ and ts/ to exist. Regenerates and verifies conformance/'s vectors first, then still falls through to each language implementation's own conformance-check once those subtrees exist.
The Implementations section previously said only the schema existed; conformance/'s golden vector suite is real now too, ahead of either language implementation.
spec/ defines the structures; conformance/ is what actually proves an implementation's encoding matches them. Point readers of one at the other.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Builds conformance/, the golden test vector directory the README's own repository structure already named but never had content: a hand-authored, mechanically-derived vector for every $frame-variant in spec/frame.cddl, plus capability-token (including a delegation chain) and handle-record.
Each vector's message is plain JS data matching the relevant CDDL rule's fields; wire_hex comes from canonically CBOR-encoding it via cbor2's CDE mode, never hand-typed. A verifier confirms both directions independently for every vector.
Wired into CI (a new conformance-verify job alongside cddl-validate) and into the justfile's previously-no-op conformance recipe.