Repository navigation
feat(id-store): ordered lifecycle hooks around the fixed admission gate (#10192, slice 9110-06) - #13156
Merged
Conversation
…te (#10192, slice 9110-06) Add id_store::admission: the lifecycle pipeline the versioned design mandates around the fixed signed/validated gate — a replay/idempotency ledger binding each operation ID to exactly one envelope, deterministically ordered prepare hooks (priority, then stable registration ID) over immutable validated input with namespaced, budgeted annotations, commit-time reauthorization against current policy, resumable commit outcomes (an unknown outcome stays Admitted, never reported rolled back), and at-least-once outbox delivery journaled by stable event ID. Same-operation reentrancy is rejected; hooks request follow-ups as new queued operations instead of recursing. Export id_core::admission_gate at the crate root — the export the gate module's own doc assigns to slice 9110-02 — and re-export both modules at the id facade. Model oracle in pkgs/id/tests/admission_hooks.rs: gate refusals (forged signature, tampered payload, unknown signer, oversized payload, wrong tenant) never reach hooks or commit; replays never double-commit; revoked policy blocks commit and retry; the happy-path trace matches the design order gate, prepare, reauthorize, commit, outbox.
|
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 47 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 23, 2026
Open
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.
What this is
The first implementation slice of #10192 (slice 9110-06): the ordered lifecycle the versioned design mandates around the fixed admission gate, landed as an engine in
id-store(the crateid-eventsandid-syncalready depend on), plus the model-oracle suite the issue names as its evidence.The fixed gate itself already exists in
id_core::admission_gate(#10275) — signature, validation, signer binding, tenant authorization, policy — but it was not exported from the crate root; its own doc assigns that export to slice 9110-02. This PR adds the export, the facade re-exports, and everything the design wraps around the gate:OperationLedgerbinds each operation ID to exactly one envelope. A committed operation re-presented resolves asAlreadyCommitted(caller resolves by readback); rebinding the ID to a different envelope is a replay rejection.Admitted(unknown outcome, resumable at its prepare cursor), never reported as rolled back.Files
pkgs/id/crates/id-store/src/admission.rs(new) — the pipeline, ledger/journal seams with in-memory implementations, typedLifecycleRejection(stage + stable class), and unit tests for the lifecycle mechanics.pkgs/id/tests/admission_hooks.rs(new) — the issue's named test file: the model oracle over the gate-refusal classes, replay, revocation, and the exact design trace.pkgs/id/crates/id-core/src/lib.rs—pub mod admission_gate;pkgs/id/crates/id-store/src/lib.rs—pub mod admission;pkgs/id/src/lib.rs— facade re-exports.Verification
Run on the laptop in
nix develop(pkgs/id), 2026-11-23:cargo test -p id-store admission— 11 passed, 0 failed (lifecycle mechanics: ordering, veto, revocation, replay binding, reentrancy, annotation contract, resumable commit, outbox retry, follow-ups).cargo test --test admission_hooks— 6 passed, 0 failed (the model oracle above).cargo test -p id-core --test admission_gate— 6 passed, 0 failed (the existing gate suite, unchanged, against the new crate-root export).rustfmt --edition 2024 --checkon both new files — clean;cargo clippyon the touched targets — no warnings in the new files.What remains on #10192 (named, not hidden)
id-eventsingress paths through the pipeline (crates/id-events/src/admission.rs), against the path inventory intests/admission_path_coverage.rs.id-sync(crates/id-sync/src/admission.rs), composing with the federation slices' replay guard and key revocation.Reauthorizerseam, and durable ledger/journal implementations for the hosted adapters.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.