Repository navigation
feat(id): durable file operation ledger for admission (#17179 slice 2) - #17207
Open
developing-today-fleet[bot] wants to merge 4 commits into
Open
developing-today-fleet[bot] wants to merge 4 commits into
developing-today-fleet[bot] wants to merge 4 commits into
Conversation
…onstitution (issue #17179 slice 2)
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
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.
Slice 2 of #17179 (parent #10192): the ledger adapter — a durable, append-only operation ledger for admission decisions, following slice 1's policy-epoch adapter (PR #17187, same module / test pattern).
What lands
FileOperationLedger(pkgs/id/crates/id-store/src/admission.rs) implements the existingOperationLedgertrait over one append-only log file. Everyrecord()appends one full entry snapshot as a single line and fsyncs before returning;entry()folds the log last-record-wins per operation. Records are never edited or deleted — a state transition is a new line — so the log doubles as the audit trail of admission decisions (envelope binding, gate receipt fields, prepare cursor, annotations, follow-up envelopes as canonical bytes, lifecycle state).ledger_fail_closedpanic. The trait has no error channel, and returningNonefor a committed operation would let a replay re-run its commit step — the double-apply the Implement ordered lifecycle hooks and fixed acceptance gate #10192 oracle forbids. A corrupt ledger is an operator incident, never improvised state.AdmissionReceipt::from_recorded(id-core): reconstitutes a receipt from a durable ledger record of a gate-minted receipt. It records a past admission, it does not mint a new one — the pipeline runs the gate first on every run and surfaces a ledger receipt only as theAlreadyCommittedreadback in the same call. The struct doc is updated to stay truthful about the two constructors.PayloadId::from_content_id(id-core): the symmetric counterpart of the existingEnvelopeId::from_content_id, so payload IDs read back from the record wrap the same way envelope IDs already did.Gate ordering and existing trait signatures are unchanged.
Tests
pkgs/id/tests/admission_ledger.rs(model oracle, id admission: durable policy-epoch / ledger / outbox adapters (slice of #10192) #17179 extension): committed operation replays asAlreadyCommittedafter restart with the identical receipt and no second commit; a different envelope under the committed operation ID is replay-rejected after restart; anAdmittedoperation resumes at its recorded prepare cursor after restart (completed hook does not re-run, its annotation reaches the commit step).ledger_tests: record round-trip across reopen (receipt, annotations, follow-up envelope), missing file = empty ledger, last-record-wins state transitions over an append-only 2-line log, corrupt record fails closed.Verification: fleet Actions exec on the exact head (run id + counts posted on #17179 and #10192 after the run).
The outbox adapter remains the follow-on slice of #17179; this PR does not close the issue.
Lane 0707-G (charlie ADVANCE 2026-11-30).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.