Repository navigation
Conversation
Implements #9128 design §6 in id-core (new freshness module): - FreshnessToken: view_id (hash of the canonical view definition), frontier, issued_at, server identity, ed25519 signature over the canonical-CBOR encoding of the signed fields, with a fixed domain-prefixed signature preimage per the Part A conventions. Full canonical encode/decode; every field critical on decode. - Frontier: per-input high-water marks — list inputs carry the accepted head sequence (#9127 §4) plus the tombstone-set revision (#9130); relation inputs carry the projection checkpoint (#9125). Component-wise product partial order: unchanged iff every component equals; diverged or kind-changed components are incomparable. - check_freshness: the §6.3 verdict as a pure function — NoToken (absent, or signature/view/server verification failed; §6.5: treated as no token, never an error), NothingNew, Delta naming exactly the advanced inputs with the token's per-input after positions, Resync when the token's frontier is unreachable (below the server's retention floor, beyond current, diverged, or a changed input set). Tests: 18 unit tests walking the §6.3 check table row by row plus 4 proptest properties (order reflexivity, transitive consistency, the §6.3 verdict oracle over generated frontier pairs, and the retention-floor resync). The Frontier/FreshnessToken types are the seam #13095/#13096 build on.
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. |
|
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 49 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. |
This branch has not been deployed
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 #13094
Implements §6 of the #9128 design record (
doc/2026-11-23_design_id9128_social_app_reference_model.md) as pure logic in id-core — new modulecrates/id-core/src/freshness.rs, no I/O, no store access, no clock:FreshnessToken(§6.1):view_id(BLAKE3 hash of the canonical view definition),frontier,issued_at(informational only — tokens do not expire by time, §8.5),serveridentity, and an ed25519 signature. Signing follows the Part A conventions: fixed domain-prefixed preimage (id/freshness-token/v1\0) over the canonical-CBOR encoding of the signed fields. Full canonical encode/decode; every field is critical on decode, so an unknown or malformed field is a rejection, never a silent drop.Frontier(§6.2): per-input high-water marks. List inputs carry the accepted head sequence (design(id): append-list user-attribute protocol — signed submission, server order, pending queue #9127 §4) plus the tombstone-set revision (design(id): true-delete + moderation pipeline #9130) that filters the list; relation inputs carry the projection checkpoint (research(id): triple encoding bake-off — compressed binary vs JSONB vs normalized byte-key maps #9125). Comparison is the component-wise product partial order — a frontier is unchanged iff every component equals; components that diverged or changed kind are incomparable.check_freshness(§6.3): the verdict as a pure function of the presented token, the expected view/server, the current frontier, and the server's retention floor (oldest_reachable):NoToken— absent, or signature/view/server verification failed. Per §6.5 a forged or foreign token is treated as no token (full view fetch), never as an error.NothingNew— frontier unchanged; the server re-issues with a freshissued_at.Delta— names exactly the advanced inputs, each with the token's per-input after position (the append-readafter-seqfor list inputs, design(id): append-list user-attribute protocol — signed submission, server order, pending queue #9127 §3). A since-date token is just an old token on this path (§6.4).Resync— the token's frontier is unreachable: below the retention floor, beyond the current frontier, diverged from it, or covering a changed input set.The before-date form (§6.4) renders against a pinned frontier — that is the view builder's job (#13096); the
Frontier/FreshnessTokentypes here are the seam #13095 and #13096 build on.Tests
18 unit tests walking the §6.3 check table row by row (nothing-new at the current frontier; delta naming exactly the advanced inputs, including a tombstone-revision-only advance; resync below the floor / beyond current / diverged / changed input set; forged signature, wrong view, and foreign server all yielding
NoToken; canonical encode/decode round-trip with critical-field rejection) plus 4 proptest properties: frontier comparison reflexivity, transitive consistency, the §6.3 verdict oracle over generated frontier pairs, and the retention-floor resync.Verification
cargo test --manifest-path pkgs/id/Cargo.toml -p id-core --libon this branch, dispatch handlefp_b28e233d8fae833289d8bed22f8981f1. At the time of this PR the job is still queued — every placement tier reported exhausted at submission (GitHub-hosted surfaces full/standby, Blacksmith budget spent) and the job is recorded, never dropped; track it withfleet queue session status fp_b28e233d8fae833289d8bed22f8981f1(run URL appears there once a run correlates).cargo clippy -p id-core --all-targetsreports no warnings infreshness.rs;check-rust-module-reach.shshows no new unreached files (the 12 pre-existing ones in id-config/id-core/id-store are untouched by this change).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.