Skip to content

id-store: durable policy-epoch adapter for admission reauthorization (#17179 slice 1) - #17187

Merged
developing-today-fleet[bot] merged 2 commits into
mainfrom
archer/17179-policy-epoch-adapter
Nov 30, 2026
Merged

developing-today-fleet[bot] merged 2 commits into
mainfrom
archer/17179-policy-epoch-adapter

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Slice 1 of #17179 (parent #10192): the policy-epoch durable adapter.

What lands

  • PolicyEpochSource — the durable seam for the current policy epoch: current_epoch() / advance_to() (monotone), every failure a typed PolicyEpochError (Missing / Corrupt / Regression / Io).
  • FilePolicyEpochSource — one small file holding canonical decimal epoch text. Atomic writes (sibling tmp file + fsync + rename + read-back verification), so a crash mid-advance leaves the old epoch or the new one, never a torn record. A missing record is fail-closed Missing, never an implicit epoch 0; a corrupt record is refused and never clobbered by an advance.
  • DurableEpochReauthorizer — binds the existing Reauthorizer trait to the durable source: reauthorize() reads the durable epoch first and refuses the commit with AdmissionRejection::Policy when the record is missing/corrupt/unreadable (fail-closed, per the id admission: durable policy-epoch / ledger / outbox adapters (slice of #10192) #17179 oracle); policy_epoch() reports the durable epoch, or the POLICY_EPOCH_UNREADABLE sentinel when unreadable (audit-only accessor — the pipeline reads it only after reauthorization succeeds, so the sentinel can never be recorded for a committed outcome). Gate ordering unchanged: no trait signatures touched.

Tests

  • In-crate unit tests (admission::epoch_tests): missing fail-closed, advance-survives-reopen + monotonicity, corrupt refused and never clobbered (incl. u64 overflow), wrapper delegation.
  • New integration suite pkgs/id/tests/admission_epoch.rs: pipeline commits record the durable epoch; restart (fresh pipeline + source over the same record) commits at the same epoch; missing and corrupt records block the commit at reauthorization with the commit step never run and the ledger entry resting Rejected.

Verification: fleet-command run dispatched against this head (id in the #17179 evidence comment). Ledger and outbox durable adapters remain as follow-on slices of #17179.

Refs #17179, #10192. Lane 0607-G (charlie ADVANCE).


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

developing-today-fleet Bot and others added 2 commits November 30, 2026 12:30
…17179 slice 1)

FilePolicyEpochSource (atomic file-backed epoch record, monotone advance, fail-closed parse) + PolicyEpochSource seam + DurableEpochReauthorizer binding commit-time reauthorization to the durable epoch. In-crate unit tests included.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96dda4ec-5b64-435b-acfc-1598efa60d6f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant