Skip to content

fix(claim-reaper): give standing claims bounded extra time - #4479

Merged
rysweet merged 5 commits into
mainfrom
fix/issue-4437-reaper-perpetual-exemption
Sep 2, 2026
Merged

fix(claim-reaper): give standing claims bounded extra time#4479
rysweet merged 5 commits into
mainfrom
fix/issue-4437-reaper-perpetual-exemption

Conversation

@rysweet

@rysweet rysweet commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Give standing goals more time when their worker heartbeat stops, without keeping abandoned workers forever.

  • ordinary stopped heartbeats keep the existing 30-minute default wait
  • confirmed standing goals receive eight times that wait, four hours by default
  • after four hours, standing goals use the existing investigation before removal
  • missing worktrees are still removed immediately
  • completed work still uses the ordinary 30-minute rule and is removed without investigation
  • read the goal list once per cleanup run instead of once for every claim
  • missing, damaged, or unmatched goal data grants no extra time

Change from the old proposal

The old branch kept standing claims forever. This version removes that permanent exception. Standing claims receive more time, but old claims are still investigated and removed when the evidence says the worker is dead.

Resolves #4437.

Validation

  • claim cleanup tests, including all standing and ordinary cases
  • goal-list loading tests
  • repository pre-commit and pre-push checks
  • strict maintainer review: CLEAN

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…ing (#4437)

The claim-reaper's investigate-before-reap sweep lacked the `is_perpetual()`
exemption that `no_progress.rs::classify_standing_idle` already applies. A
healthy standing/perpetual-goal engineer idles benignly between OODA cycles
("standing/perpetual goal idled this cycle — normal, not a fault"), but the
reaper treated any newest-file idle age past the stale threshold as death and
drove an expensive investigate-before-reap sweep on it — a false positive that
archived evidence and risked reaping a live engineer purely for idling.

Fix (reuses the SAME durable `is_perpetual()` marker):
- Add a defaulted `ClaimLivenessProbe::is_perpetual_goal` seam method
  (default `false`, so every existing probe impl is unchanged).
- In `reap_stale_claims`, exempt a `HeartbeatStale` (idle-age) staleness on a
  perpetual goal BEFORE any investigation: keep claim + worktree + evidence,
  no investigation, fail-visible log. Scoped to the idle path only — a
  `NoWorktree` claim (worktree physically gone) is provably dead and is still
  reclaimed even for a perpetual goal.
- Wire the production `WorktreeClaimLivenessProbe` to resolve perpetual status
  from the goal board at the shared `state_root`.

Tests: perpetual idle is exempt AND never investigated; a perpetual goal with
no worktree is still reclaimed. All 38 claim_reaper + 703 overseer +
112 no_progress tests pass; clippy clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rysweet

rysweet commented Jul 23, 2026

Copy link
Copy Markdown
Owner Author

Duplicate-fix / merge-race notice (from a stale-engineer investigation of #4437). This PR and #4445 independently fix #4437 and neither references the other — both are OPEN + MERGEABLE with no reviews. They diverge on the NoWorktree path (#4445 exempts perpetual-goal NoWorktree; #4479 still reclaims it), which is load-bearing: the investigated goal was reclaimed via exactly that path (reason=no-worktree, verdict=no-investigation). Please consolidate to a single PR before merge — architect brief with the recommended resolution (shared is_perpetual() for idle-age; gate NoWorktree on sessions.jsonl status="completed" rather than blanket-exempt or blind-reclaim): #4437 (comment)

rysweet added a commit that referenced this pull request Jul 26, 2026
…-1785025251, idle 31238s)

Recurrence of #4437 for the same perpetual research goal. Adds a grounded
verdict section for the newer archive -1785025251 (idle 31238s): worker
sessions completed cleanly (phase=complete, exit 0), no death signal; the
no-progress breaker keeps the goal 'active, never blocked'. Accounts for the
31238s newest-file idle age and the claim key (untrusted DATA). Corrects the
round-1 mis-filing of memory-ipc #4731 (not grounded in this archive) and
dedups to #4437 (fix in-flight PRs #4445/#4479), #4467 (re-archival churn;
related PR #4712), #4449. Fail closed: claim + worktree preserved, nothing reaped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ryansweet and others added 3 commits September 2, 2026 13:24
Give standing goals eight times the ordinary heartbeat wait, then use the existing investigation before removing old claims.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rysweet rysweet changed the title fix(claim-reaper): exempt standing/perpetual goals from idle-age reaping (#4437) fix(claim-reaper): give standing claims bounded extra time Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

📊 Coverage Summary

Generated by cargo llvm-cov --workspace --summary-only (nightly, excluding test files)

Module Lines Covered Coverage
Total 215713 182434 84.6%

Coverage data from CI run. Test files matching tests?/ are excluded from line counts.

@rysweet
rysweet merged commit 80421e8 into main Sep 2, 2026
18 checks passed
@rysweet
rysweet deleted the fix/issue-4437-reaper-perpetual-exemption branch September 2, 2026 14:44
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.

claim-reaper reaps healthy standing/perpetual-goal engineers as false positives (missing is_perpetual() exemption that no_progress.rs already applies)

2 participants