Repository navigation
id-store: resumable stream subscription + completed target resolution (A9123-stream-subscribe, #10282) - #12995
Merged
Merged
Conversation
… (A9123-stream-subscribe, #10282) New module stream_subscribe.rs: the read side of addressable live streams (S4.79-S4.82). Resume cursor is sequence + chain-record ID, validated against the lifecycle's accepted chain (mismatch / ahead / below-retention-floor are distinct typed rejections). Paged delivery under a max-items cap with heartbeat at the live head, observable cancellation, and terminal outcomes delivered only after the full retained replay. Completed streams resolve via the typed ResolutionView::Completed — no redirect type exists — and only under the current authorization result, re-checked on subscribe, resume, every poll and resolve. Retained records are folded against the accepted chain (record ID, prev link, stream and tenant-scope binding, signature) before anything is delivered. Model test stream_subscribe.rs: independent prefix/suffix + authorization reference model; 3 seeds x 140 generated operations compared after every step, plus fixed tests for exact-suffix resume, backpressure paging, cancellation, completion recheck, abort/expiry claiming no final content, scope/fold validation and cursor rejections. Oracle: cargo test -p id-store --test stream_subscribe — 11 passed / 0 failed. Crate-root export stays with 9110-02; the test includes the module and its dependencies by path, per the stream-records pattern.
|
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 5 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 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.
Implements ID/Atlas slice A9123-stream-subscribe (issue #10282): the read side of addressable live streams (design part A §#9123, A-9123.1, S4.79–S4.82). The mandatory preflight gate cleared today — all four native blockers (#9083, #10160, #10246, #10274) are closed.
New files only (the slice's two owned files; crate-root export stays with 9110-02, the test includes the module and its dependencies by path):
pkgs/id/crates/id-store/src/stream_subscribe.rs— resume cursor = sequence + chain-record ID (never a timestamp), validated against the lifecycle's accepted chain:cursor_mismatch/cursor_ahead/cursor_expiredare distinct typed rejections. Paged delivery under a max-items cap (A9119 discipline) withtruncated+ next cursor, heartbeat at the live head, observable cancellation as a terminal page, and terminal outcomes delivered only after the full retained replay. Completed streams resolve via the typedResolutionView::Completed { final_id }— there is no redirect type, so no implicit redirect can exist — and only under the current authorization result, re-checked on subscribe, resume, every poll and resolve. Retained records fold against the accepted chain (record ID, prev link, stream + tenant-scope binding, signature re-verified) before anything is delivered.pkgs/id/crates/id-store/tests/stream_subscribe.rs— the declared model oracle: an independent chain prefix/suffix + current-authorization reference model; 3 seeds × 140 generated operations compared after every step, plus fixed tests for exact-suffix resume, backpressure paging of one, cancellation, completion recheck under revoked authorization, abort/expiry claiming no final content, scope/fold validation, pruning expiry and cursor canonical round-trips/rejections.Verification (laptop worktree off origin/main,
nix developin pkgs/id):cargo test -p id-store --test stream_subscribe— 11 passed / 0 failed, run post-rustfmt. Both files rustfmt-clean; no warnings in the new files.Closes #10282.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.