Persist trusted clock ordering beside the policy grant fence
Merged
AG
3d ago+148+148+012345678901234567890123456789-0-0-0123456789
Unmounted T264 source, stacked on #401. Disposable PostgreSQL 15 test passed with synthetic verifier output and a fresh client pool. Focused strict TypeScript check passed. No trusted time source is configured; deployment, restored-cluster continuity and physical commit or HTTP expiry guarantees remain open.
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Persists trusted clock ordering beside the policy grant fence in PostgreSQL so surviving process restarts cannot reorder or replay responses.
- Adds
checkClockAtDecisionto lock the clock row, challenge an independent verifier, and persist the latest sequence and interval in the same transaction as the decision. - Snapshots proof validity bounds and each verified sample before any await, so mid-check mutations cannot widen acceptance.
- Refuses with a durable quarantine flag on non-advancing sequence or a strictly earlier interval; subsequent requests stay refused until recovery reconciles history.
- Includes a disposable PostgreSQL fixture and test that reconnects through a fresh pool to check durable history, restart ordering, half-open proof lifetime, and the exact persisted decision count.
- No route mounts this helper, and no production verifier, source enrollment, or delay bound is supplied; restored-cluster continuity and physical commit or HTTP expiry guarantees remain open.