You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root-causes the SunoSavvy runaway: a handoff written ~3 days earlier
auto-presented as a one-click "claim this handoff" in a fresh unrelated
session; claiming it resumed an 8-step chain and the auto-loop ran away.
CENTER-AUDIT wf_5e11b0c7-efe (Angle A, CONFIRMED): a handoff is intentionally
cross-session, but (1) the claim path never consulted createdAt — handoffPanelMode
returned "claim" purely on (handoff exists) && (no live goal), and (2) the plugin
boot cleanup unlinked terminal state + orphan chains but never touched the
handoff file, so it lingered forever and auto-presented as claimable.
Operator chose both fixes:
Renderer guard (any age) — goal-panel-pure.ts, goal-panel.tsx, en.ts
- New pure helpers: handoffAgeMs, isHandoffStale (warn >=1 day or unparseable),
formatHandoffAge ("3 days ago"), handoffOriginLabel; MAX_HANDOFF_AGE_MS (7d) /
HANDOFF_WARN_AGE_MS (1d).
- Claim panel now shows age + origin session + "resumes an N-step chain",
amber-warns when stale, and requires a two-step confirm (Claim -> Claim
anyway / Cancel). A bare click can never auto-claim; the confirm resets when
the handoff stops being claimable.
Boot auto-expire backstop (7d) — goal-state.ts, server.ts
- Export MAX_HANDOFF_AGE_MS. Boot cleanup quarantines a handoff older than 7
days by renaming to .goal-handoff.json.stale.<ts> (recoverable, mirrors
corrupt-file quarantine). Fresh handoffs (legit "resume tomorrow") preserved.
Tests
- goal-panel-pure.test.ts (+10): age parsing, stale thresholds incl. the 3-day
incident case, format buckets, origin label, threshold ordering.
- boot-stale-handoff.test.mjs (+3): 8-day quarantined (recoverable), 1-hour
preserved, just-under-7-days preserved.
Verification: autogoal 1421/1424 (3 unrunnable shell tests), app 196/196 +
typecheck clean, desktop tsgo clean. Incident record:
docs/audits/2026-06-28-stale-handoff-incident.md.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments