claude exits 1 with an active git stash; harness ships/merges a scratch commit instead of the feature (porksicle #110 -> #305

Closed
opened 2026-07-01 03:10:22 +00:00 by igor · 1 comment
Collaborator

Diagnosis

On the tick that claimed porksicle.com#110 ("Reframe the homepage stats"), claude implemented the change, then ran a git stash to capture "before" (master-state) screenshots. It exited 1 while the stash was still active -- before restoring its feature edits (git stash pop). Last action was reading the before screenshot, mid-workflow:

Jun 30 21:50:00 igor tick.sh[233531]: Now I have the "before" screenshot showing the old three-pill layout: "1,234 players · 56,789 plays · 2 hours wasted". Let's check the mobile before too:
Jun 30 21:50:01 igor tick.sh[231173]: [agent] claude exited 1 (elapsed 347s)

The harness's commit-everything step then saw only the leftover untracked screenshot script (the real edits were stashed away) and committed that:

Jun 30 21:50:03 igor tick.sh[231173]: [agent] harness-commit: 1 file(s), subject: chore: add script to capture before screenshots with playwright
Jun 30 21:50:24 igor tick.sh[231173]: [agent] outcome: PR (1 commit(s), 45 line(s))

PR #114 shipped a scratch playwright script, not the stats reframe, and was auto-merged to master:

Jun 30 21:55:52 igor tick.sh[237563]: [agent] automerge: merged joshtronic/porksicle.com#114 (approved by joshtronic, CI green) -- watching deploy fd6b8fb6

Issue #110's requested change was silently dropped, the issue was falsely resolved (time logged, PR merged), and dead scratch code now lives in master. Contrast #108, which also claude exited 1 (elapsed 224s) but only after restoring its stash, so it shipped correctly (harness-commit: 3 file(s), subject: feat: add copyright year to site footer). The bug is exit-1 timing vs. stash-restore, plus the harness committing an active-stash tree with no guard.

What "fixed" looks like

  • Harness refuses to commit/ship when claude exited nonzero, or when git stash list is non-empty, or when the diff/commit-subject doesn't correspond to the claimed issue -- abort the ship instead of committing whatever remains.
  • Restore stashes (git stash pop) in the cleanup trap before the commit step.
  • Re-open #110 and revert/clean the stray chore: add script to capture before screenshots change from master.

service: agent.service
severity: high
window: 2026-06-30 21:00-22:00 (filed by the hourly logwatch pass)

## Diagnosis On the tick that claimed **porksicle.com#110 ("Reframe the homepage stats")**, claude implemented the change, then ran a `git stash` to capture "before" (master-state) screenshots. It exited **1 while the stash was still active** -- before restoring its feature edits (`git stash pop`). Last action was reading the *before* screenshot, mid-workflow: ``` Jun 30 21:50:00 igor tick.sh[233531]: Now I have the "before" screenshot showing the old three-pill layout: "1,234 players · 56,789 plays · 2 hours wasted". Let's check the mobile before too: Jun 30 21:50:01 igor tick.sh[231173]: [agent] claude exited 1 (elapsed 347s) ``` The harness's commit-everything step then saw only the leftover untracked screenshot script (the real edits were stashed away) and committed that: ``` Jun 30 21:50:03 igor tick.sh[231173]: [agent] harness-commit: 1 file(s), subject: chore: add script to capture before screenshots with playwright Jun 30 21:50:24 igor tick.sh[231173]: [agent] outcome: PR (1 commit(s), 45 line(s)) ``` PR #114 shipped a **scratch playwright script, not the stats reframe**, and was auto-merged to master: ``` Jun 30 21:55:52 igor tick.sh[237563]: [agent] automerge: merged joshtronic/porksicle.com#114 (approved by joshtronic, CI green) -- watching deploy fd6b8fb6 ``` Issue #110's requested change was silently dropped, the issue was falsely resolved (time logged, PR merged), and dead scratch code now lives in master. Contrast #108, which also `claude exited 1 (elapsed 224s)` but only *after* restoring its stash, so it shipped correctly (`harness-commit: 3 file(s), subject: feat: add copyright year to site footer`). The bug is exit-1 timing vs. stash-restore, plus the harness committing an active-stash tree with no guard. ## What "fixed" looks like - Harness refuses to commit/ship when claude exited nonzero, or when `git stash list` is non-empty, or when the diff/commit-subject doesn't correspond to the claimed issue -- abort the ship instead of committing whatever remains. - Restore stashes (`git stash pop`) in the cleanup trap before the commit step. - Re-open #110 and revert/clean the stray `chore: add script to capture before screenshots` change from master. --- service: agent.service severity: high window: 2026-06-30 21:00-22:00 (filed by the hourly logwatch pass) <!-- agent:logwatch -->
igor added spent time 2026-07-01 03:10:23 +00:00
3 minutes 2 seconds
Author
Collaborator

Resolved — closing.

The harness defect (the issue-ship path committing/shipping a partial worktree on a nonzero claude exit) is fixed in #307, merged and live in production (the fail-safe ${CLAUDE_EXIT:-1} gate now refuses to commit an interrupted run).

The porksicle residue is handled too: the #110 reframe had already shipped correctly on the retry (porksicle#116, "Closes #110"), and the stray shot-before.mjs scratch file is removed by porksicle#117 (approved, merging shortly).

Note: #307 makes an exit-1 non-catastrophic (no more wrong-diff ships) but doesn't cure the exit-1 itself — that root-cause continues in #306.

**Resolved — closing.** The harness defect (the issue-ship path committing/shipping a partial worktree on a nonzero `claude` exit) is fixed in **#307**, merged and **live in production** (the fail-safe `${CLAUDE_EXIT:-1}` gate now refuses to commit an interrupted run). The porksicle residue is handled too: the #110 reframe had already shipped correctly on the retry (porksicle#116, "Closes #110"), and the stray `shot-before.mjs` scratch file is removed by porksicle#117 (approved, merging shortly). Note: #307 makes an exit-1 **non-catastrophic** (no more wrong-diff ships) but doesn't cure the exit-1 itself — that root-cause continues in #306.
igor closed this issue 2026-07-01 15:55:33 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Total time spent: 3 minutes 2 seconds
igor
3 minutes 2 seconds
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshtronic/igor#305
No description provided.