๐ fix(manager): a gate pass longer than the lease keeps its task #175
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) ร (1 โ Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 ยท Change Risk (XGBoost)
Score: 0.40 ยท 303 lines diff across 3 files
Model 2 ยท Review Depth (DistilBERT)
Depth Score: 0.17 ยท 1 substantive comment(s)
Model 3 ยท Review Timing & Attention
Session adequacy: 100% ยท Reviewer familiarity: 35%
Bedrock Claude 3 ยท Risk Narration
(disconnected)
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.342
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #175"
general
weight: 0.35
Misery7100
Why
The first erp-backend night (S-0003, width 2) hit this. T-0001's gate pass ran 21 minutes on a cold seat:
uv syncand image pulls in nested dind, then unit, quality and e2e. The pass records nothing betweenattempt.finished(18:37:38Z) andgates.evaluated(18:58:28Z).expired()counts only recorded facts againstLEASE_SECONDS = 900, so at 18:52:44Z the second worker's pass:1. released T-0001 (
lease expired; last held by erp-1),2. claimed it,
3. was refused (
T-0001 has an existing run in state gated),4. escalated it
gate_infrastructure_failure.The first worker then gated it green and landed it anyway, so the escalation needed a person to close it (
manager resolve --resolution landed).What
gates/runner.py: the gate listrun_gatesbuilds becomesbattery(ctx, only). The newbattery_budget(gates, ctx)is the pass's upper bound: each gate's timeout (600 s for a shell gate without one), twice because a failed command runs once more (run_command), and once per command for acceptance. A gate whose paths the attempt did not touch is left out, asrun_gatesskips it.gates.started(attempt,budget_s), written by the worker and relayed like the other attempt facts. The runner records it just beforerun_gates.manager.py:TaskView.quiet_untilholds the end of the silence a pass announced. Only the next change of state clears it, so a late burn or promotion cannot cut the pass short. The newlease_ends(view, window)counts from the later of the last fact and that end, andexpired()and the night-opening report (S-0089/D-3) both use it.stalled()no longer marks a pass within its budget as wedged.The lease still counts facts, not a heartbeat (S-0044/D-6, LOCKED): a worker that dies mid-pass loses the task once the budget has passed too.
Tests
test_a_battery_budget_bounds_every_command_and_its_reruntest_a_gate_pass_keeps_its_lease_for_the_budget_it_announcedtest_a_gate_pass_within_its_budget_is_not_stalledtest_manager_e2e(real Postgres and Docker): each pass recordsgates.startedbeforegates.evaluated, with a positive budget.ruff check,ruff format --checkandmypy srcare clean.๐ค Generated with Claude Code
https://claude.ai/code/session_01X5XatXv3dQLan6TyQoHFyF