← Back to Pull requests

Preserve subsecond lease evidence for interrupted Turn recovery #9314

Closed
unknown closed this pull request without merging on Nov 23, 2026 14:23 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 11:11 UTC
Author

Recovery within one second

A prepared Turn can lose its lease and acquire a higher epoch in the same second. The admission receipt keeps fractional seconds, but the lease writer discarded them. A replacement acquired at 650 ms consequently appeared older than the receipt admitted at 250 ms. The administrative closeout rejected the original Turn even with the current writer’s exact proof.

The claim transport now supplies milliseconds. Acquisition, renewal, transfer and release retain the event time available from the native clock. The closeout transport supplies the observed time with microsecond precision. The existing verifier still checks the original identity, the replacement epoch and version, current ownership and temporal order. Expiry deadlines retain their existing whole-second representation.

Verification

The regression drives the public CLI against isolated File and SQLite providers. It admits a Turn at 250 ms, releases the lease at 450 ms, claims the replacement at 650 ms, renews at 725 ms and closes the original at 850 ms. Replay appends nothing, the Todo stays open and no quota is charged. Both providers reject a closeout observed before the renewal and a whole-second replacement whose order cannot be proven.

Before the change, both providers recorded the 650 ms acquisition at the start of the second. The lease and closeout suites passed after the change. This patch is independent of recovery action selection in #9304.

Diff: 183 lines (+137 / -46) across 2 files Reviewer: BigDataDZ Review duration: 192m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 183 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.312
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9314"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.6% (MEDIUM) · Higher = larger blast radius
35.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.1% · Safe to merge
14.1%