Skip to content

Add conformance vector suite - #6

Merged
Mearman merged 5 commits into
mainfrom
feat/conformance-vectors
Sep 10, 2026
Merged

Add conformance vector suite#6
Mearman merged 5 commits into
mainfrom
feat/conformance-vectors

Conversation

@Mearman

@Mearman Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member

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.

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.
@Mearman
Mearman marked this pull request as ready for review September 10, 2026 01:42
@Mearman
Mearman merged commit 58bbe1c into main Sep 10, 2026
3 checks passed
@Mearman
Mearman deleted the feat/conformance-vectors branch September 10, 2026 01:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-10T01:51:08.453304Z f4a6477 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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