claim_ttl_hours and abandoned_draft_after_hours derive from the gap between cycle starts, but each bounds a cycle's worst-case runtime
Id: TD-PPagop-26082829 · Status: resolved · Filed: 2026-08-28 · Resolved: 2026-08-28 · Ref: #886
Requirement 1d (agent-ops#591, PR #886) re-expresses four hour-valued keys against the worst-case gap between cycle starts. Two of the four do not bound the interval between cycles at all — they bound how long a single cycle may still be running:
claim_ttl_hours— “far beyond a whole cycle, so only a dead node’s claim ever expires”. What must be outlasted is a live cycle still holding the claim, i.e. its runtime. On Poetic’s 15-minute installation the derivation yields 2 h, while the shipped stage-backstop priors (lib/stage-budget.sh’s STAGE_BUDGET_PRIORS: 20 + 150 + 90 + 30 + 30 + 30 = 350 min) plus stage_budget_lock_seconds’ 30-minute slack put the repo’s own worst-case cycle at ~6.3 h, and the Implementer’s backstop alone at 150 min. lib/claim.sh’s do_gc sweeps the registry entry at the TTL and calls release_branch_if_untouched, which deletes the claim branch while it is still at its base SHA and PR-less — so a cycle whose Implementer has not pushed by the two-hour mark can have its claim branch deleted by another node’s gc and its item become selectable again while it is being worked. Before #886 the window was 6 h and unreachable.abandoned_draft_after_hours— derived to 1 h on the same installation. The threshold was sized against 120 min Implementer + 60 min Reviewer = 180 min; docs/IMPLEMENTATION-PIPELINE-SPEC.md’s own extended note still cites that 180 minutes. scripts/gather-abandoned-drafts.sh’s header mitigation (“candidacy is not selection … a premature candidate loses the claim race”) was written for a margin that occasionally runs out, not for a threshold routinely a third of the work it straddles — and it is weaker in combination with the point above, since the claim that would win that race can itself have been swept at 2 h.
Requirement 1d’s own “already independent” paragraph draws exactly this distinction for lock_stale_after: “a cycle’s own worst-case runtime, not the scheduling interval between cycle starts, is what a stuck lock has to outlast”. The reasoning applies unchanged to these two keys and was not applied to them, because issue #591’s audit classified both as cadence-derived from their schema wording (“a whole cycle”), which read the same as the interval at an hourly cadence.
Suggested fix: floor both derivations at the same stage-backstop-derived quantity lock_stale_after already computes (lib/stage-budget.sh’s stage_budget_lock_seconds), so the cadence can only ever lengthen them, never shorten them below a cycle’s own worst case. The other two hour-valued keys of requirement 1d (disable_default_ttl, none_selected_recheck_hours) bound no in-flight work and are correctly derived as they stand.
Deliberately not changed in #886: reversing it would contradict that pull request’s own work order, whose acceptance criterion 7 names the 6 h → 2 h and 4 h → 1 h movement as the intended outcome. Raised for the maintainer at https://github.com/Poetic-Poems/agent-ops/pull/886#issuecomment-5447070998.
Noticed while reviewing https://github.com/Poetic-Poems/agent-ops/pull/886.