Skip to content

feat: worktree_ref pinning + SIGHUP graceful shutdown - #30

Merged
usjoh merged 1 commit into
mainfrom
feat/worktree-ref-and-sighup
Aug 1, 2026
Merged

feat: worktree_ref pinning + SIGHUP graceful shutdown#30
usjoh merged 1 commit into
mainfrom
feat/worktree-ref-and-sighup

Conversation

@usjoh

@usjoh usjoh commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Two hardening changes from the 2026-07-31 Observer-Triad closeout arc, plus the MODEL-NOTES scoreboard correction for the rows that arc misclassified.

worktree_ref — pin the commit task worktrees are created at

Run-level manifest field, default HEAD (zero behavior change when absent). Worktree creation is orchestrator-side and unsandboxed, so pinning an older immutable baseline is free. Without it, yesterday's dispatch needed a spec-side git checkout inside the Ringer worktree — which fails outright under workspace-write (.git/worktrees/<id>/index.lock is outside the writable roots, cost: two failed dispatches to diagnose) — and the working fallback made each worker git clone the repo into its own taskdir, burning tokens on plumbing.

  • Both worktree add sites (run + baseline) take the ref, --detach on both so a branch-name ref can't fail on "already checked out"
  • worktree_ref without worktrees: true is a manifest error
  • from_path/with_max_parallel rebuilt on dataclass_replace so future Manifest fields can't be silently dropped by field-copying constructors

SIGHUP joins the graceful-shutdown set

A run's parent is often an interactive agent session. When one died mid-run yesterday (network drop), the shell HUP'd the group: the orchestrator died before any flush — ghost state (live/unfinished forever), workers killed, no ERROR verdicts. SIGHUP now triggers the same graceful path as SIGINT/SIGTERM.

nohup semantics preserved: an inherited SIG_IGN is respected — installing a handler over it would turn nohup's hangup-survival promise into a graceful shutdown. Tested both ways.

Testing

325 → 332, full suite green. Mutation-tested at every wired site — four mutations, four caught:

mutation caught by
run-path worktree add reverted to HEAD e2e: pinned-ref run asserts the checked-out sha
baseline-path worktree add reverted to HEAD baseline check passes only in the pinned commit's tree
SIGHUP never registered HUP → rc 130 + finished state
SIG_IGN check dropped nohup-semantics test: run must survive HUP

MODEL-NOTES

Dated correction under gpt-5.6-sol for the three 2026-07-31 failure_class=model FAIL rows that were sandbox-contract and killed-run casualties, with the re-run evidence (same three lanes: 3/3 first-try, READY×3).

…ath via SIGHUP

Two hardening changes from the 2026-07-31 Observer-Triad closeout arc, plus
the MODEL-NOTES correction for the eval rows that arc misclassified.

worktree_ref (run-level manifest field, default HEAD): worktree creation
happens orchestrator-side and unsandboxed, so a run anchored to an older
immutable baseline can pin it for free. The alternative was observed twice
in one day: a spec ordering `git checkout` inside the Ringer worktree fails
outright under workspace-write (the shared .git/worktrees metadata is
outside the writable roots), and the workaround — each worker cloning the
repo into its own taskdir — burns tokens on plumbing. Both worktree add
sites (run and baseline) take the ref; --detach on both so a branch-name
ref cannot fail on "already checked out". Validation refuses the field
without worktrees:true. from_path/with_max_parallel rebuilt on
dataclass_replace so new Manifest fields cannot be silently dropped by
field-copying constructors again.

SIGHUP joins SIGINT/SIGTERM in the graceful-shutdown set: a run's parent is
often an interactive agent session, and when one died mid-run (network
drop) the shell HUP'd the group — the orchestrator died before any flush
and left a ghost (state live/unfinished, workers killed, no ERROR verdicts).
An INHERITED ignore is respected: `nohup ./ringer.py run` still survives
hangups, because installing a handler over SIG_IGN would turn nohup's
promise into a graceful shutdown.

Mutation-tested at every wired site — four mutations (run-path ref, baseline
ref, SIGHUP registration, SIG_IGN respect), four caught. Suite 325 -> 332.

MODEL-NOTES: dated correction under gpt-5.6-sol for the three 2026-07-31
FAIL rows stamped failure_class=model that were sandbox-contract and
killed-run casualties, with the re-run evidence (3/3 first-try READY).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@usjoh
usjoh merged commit 2d11e39 into main Aug 1, 2026
2 of 3 checks passed
@usjoh
usjoh deleted the feat/worktree-ref-and-sighup branch August 1, 2026 11:03
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.

1 participant