Skip to content

feat(id): canonical CBOR profile with cross-language golden vectors (A9114-cbor-profile, #10181) - #10338

Merged
dezren39 merged 1 commit into
mainfrom
queue/17148-10181-cbor-profile
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/17148-10181-cbor-profile

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Slice A9114-cbor-profile (#10181): the deterministic CBOR profile for signed ID/Atlas records, implemented identically in Rust and the hosted TypeScript worker. Gate verified clear first: the slice's sole native blocker, 9110-02 (#10160), closed today via PR #10327; this PR adds the one-line pub mod canonical_cbor; root declaration that 9110-02's root ownership anticipated for this consumer module.

Profile (design A-9114.3), narrower than general CBOR so no signed encoding is ambiguous:

  • Shortest-form integers/lengths; definite lengths only; map keys unique and sorted by encoded bytes.
  • Closed value model: null, bool, integers, byte strings, UTF-8 text, arrays, maps (text/integer keys). Floats, tags and all other forms reject.
  • Strict decoder: non-shortest forms, indefinite lengths, duplicate or out-of-order keys, invalid UTF-8, out-of-range integers and trailing bytes are typed errors (CborError in Rust, CborError with matching codes in TS).
  • Unknown critical fields reject: validate_record / validateRecord check a decoded record against a field spec — a critical field the reader does not know is a typed rejection; unknown non-critical fields are tolerated.

Files: crates/id-core/src/canonical_cbor.rs, crates/id-core/tests/canonical_cbor_vectors.rs, hosted-worker/src/canonical-cbor.ts, hosted-worker/test/canonical-cbor.test.ts, plus the lib.rs declaration.

Evidence (golden oracle)

Both suites assert the same fixed golden table (26 encode/decode vectors + 11 typed rejections + critical-field cases), so byte equality across Rust and TypeScript is checked against one oracle:

  • cargo test -p id-core --test canonical_cbor_vectors — 3 passed / 0 failed.
  • bun test test/canonical-cbor.test.ts (hosted-worker) — 3 passed / 0 failed.
  • bunx tsc --noEmit (hosted-worker) — clean.

Closes #10181.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 14, 2026 18:35
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T18:35:37.862849Z
We couldn’t complete this review. Comment @codex review to try again.
d23b336 PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 9366ecb into main Nov 14, 2026
1 check failed
@dezren39
dezren39 deleted the queue/17148-10181-cbor-profile branch November 14, 2026 18:37
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.

Specify canonical CBOR profile and byte-level vectors for new signed records

1 participant