Repository navigation
id-core: typed-byte graph terms and signed graph records - #11975
Merged
Merged
Conversation
Adds graph/term.rs (typed-byte terms, content and envelope references, triples, one canonical CBOR encoding each) and graph/record.rs (graph records signed in a signed envelope, opened with domain, signature, graph and self-reference checks, yielding assertions with provenance). Known-answer vectors are pinned against an independent Python encoder. Module wiring into graph/mod.rs is left to slice 9110-09. Refs #10196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis 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 was referenced Nov 22, 2026
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.
Refs #10196
Before: id-core had no graph term or triple type. Nothing defined how a subject, predicate or object is encoded, how a term points at another object, or how a signed graph record is built and opened.
After:
graph/term.rsdefines typed-byte terms and object references (content or signed envelope) with one deterministic CBOR encoding each, andgraph/record.rssigns and opens a graph record ({v, graph, triples, source_record?}) inside a signed envelope and yields its assertions with their provenance.Terms are a general foundation, not RDF: equality is exact
(type_tag, bytes), bytes are never normalized, and a reference is its own kind of term, never a string. Unknown kinds, unknown hash profiles, wrong digest sizes, unknown record fields, an unknown schema version, a wrong envelope domain, a graph mismatch and self-references are all rejected.How:
[0, type_tag, bytes],[1, profile, digest32],[2, profile, digest32]; a triple is[s, p, o].open()checks the domain, verifies the signature, decodes the payload, checks that the envelope's graph matches the record's, and rejects any reference to the record's own envelope ID or payload content ID.tests/graph_term_codec.rs(12 tests) pins known-answer bytes, IDs and the signature against an independent Python encoder (blake3 + Ed25519 + a hand-written CBOR encoder), checks an independent signature verify, that no ID appears in its own preimage, open round-trips with provenance, and a proptest against a reference encoder.open(), which no honestly hashed envelope can reach (it would need a payload that contains its own hash); the check itself is covered by direct tests.graph/mod.rsor the crate root yet; slice 9110-09 owns that, so the test includes these files by path.Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.