Skip to content

fix(loop): wire the resume verdict dispatch — no more silent stall-resume no-ops (issue #154)#161

Merged
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-154-resume-dispatch
Jul 20, 2026
Merged

fix(loop): wire the resume verdict dispatch — no more silent stall-resume no-ops (issue #154)#161
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-154-resume-dispatch

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

What

Wires the action=resume issue=N verdict through the loop driver so bounded stall-resume actually spawns a driver instead of silently no-oping.

Issue #98 (PR #146) added stall detection and a bounded action=resume issue=N branch=<name> verdict to loop-tick.sh, but loop-daemon.sh's run_once dispatch only handled advance/feedback/comment-fix/ci-fix/rebase — a resume verdict fell through to the unrecognized-action branch (no driver, no ledger line), and loop-event.sh had no RESUME prompt variant (it hit the fallthrough and exit 1). Result: every overnight resume-attempt (issues #96, #106, #124, 2026-07-16 → 17) produced no progress; the resume half of #98 had effectively never run.

Fix

  • loop-daemon.sh
    • driver_unit_name(): new resume issue=N arm → distinct transient unit pr-loop-driver-resume-issue<N> (NOT the advance pr-loop-driver-issue<N> shape — a distinct name keeps a resume driver from colliding with / being reattached as an advance driver).
    • verdict_from_unit_name(): exact inverse mapping (round-trips; provably no prefix collision with the advance shape).
    • run_once dispatch: resume issue=* now routes to a real driver spawn; the optional branch=... suffix is stripped before the bare resume issue=N reaches run_driver / unit-naming / the ledger.
    • Debris-check exclusion parity (the load-bearing safety property): verify_and_classify_post_exit() and reattach_orphaned_drivers() remain advance issue=*-only, so a resume verdict is never run through the destructive branch-delete debris classifier — a resume driver continues an existing feat/issue-N-* branch with WIP, which must never be deleted/misclassified. Documented with new comments so it isn't "fixed" away later.
    • Updated the ledger-header / unit-naming / reattach doc + log comment blocks to include the resume shape.
  • loop-event.sh
    • Parses action=resume issue=N with an optional branch=<name> suffix (both forms), threading the branch name into the prompt.
    • New RESUME prompt variant: CONTINUE the existing feat/issue-N-* worktree/branch (never recreate / re-scope), re-run gates, route through reviewer lenses, and publish (push + open/refresh the bot PR).

Tests

  • loop-daemon.test.sh: resume driver spawns (not the no-op fallthrough); branch-suffix stripping; resume branch never reaches the debris classifier (fixture deliberately omits the bot-gh.sh stub, so the query would fail loudly if it ran); pr-loop-driver-resume-issue<N> unit naming; driver_unit_nameverdict_from_unit_name round-trip; verify_and_classify_post_exit pass-through for resume.
  • loop-event.test.sh: RESUME prompt contract with and without a branch name (both parse paths), asserting resume-specific semantics (continue existing branch / never recreate / re-run gates / publish).
  • loop-tick.sh unchanged. Both reviewer lenses (correctness, tests) confirmed the new tests genuinely FAIL against pre-fix code and PASS after.

Gates green: build, lint, test (loop-daemon.test.sh 113 checks, loop-event.test.sh 82 checks, plus checks.sh test + smoke-fanout.sh).

Follow-ups (non-blocking, from review)

  • A dedicated reattach_orphaned_drivers startup scenario for an already-active pr-loop-driver-resume-issue<N> unit (composing pieces are unit-tested; low risk).
  • An explicit "this branch pre-exists — never delete it" carve-out in the shared prompt cleanup clause for the resume path (currently self-protecting via the "you created" qualifier).

Closes #154.

🤖 Generated with Claude Code

…sume no-ops (issue #154)

Issue #98/PR #146 added stall detection and a bounded `action=resume
issue=N branch=<name>` verdict to loop-tick.sh, but loop-daemon.sh's
run_once dispatch and loop-event.sh's prompt builder never recognized
`resume` — every overnight stall-resume attempt silently fell through
to the unrecognized-action branch and no driver ever spawned (#96,
#106, #124 parked ~12h each).

loop-daemon.sh: dispatch `resume issue=N` alongside advance/feedback/
comment-fix/ci-fix/rebase; give it its own distinct transient unit
name (pr-loop-driver-resume-issue<N>, never reusing advance's
pr-loop-driver-issue<N> shape) with an exact driver_unit_name/
verdict_from_unit_name inverse; strip the verdict's optional trailing
" branch=..." before it reaches driver_unit_name/the ledger; and keep
resume excluded from the advance-only debris classifier (a resume
branch predates this run and may hold real half-done work that must
never be misclassified as deletable debris).

loop-event.sh: parse the resume verdict's issue number and optional
branch name, and build a RESUME driver prompt that instructs the
driver to continue the EXISTING feat/issue-N-* branch (never recreate
it or re-scope from scratch), re-run the module gates, route through
reviewer lenses, and publish (push + open/refresh the bot PR).

Adds loop-daemon.test.sh scenarios 4e/4f (dispatch spawns + branch-
suffix stripping), 10b (debris-exclusion safety), 12b (systemd unit
naming), plus driver_unit_name/verdict_from_unit_name round-trip
checks, and loop-event.test.sh scenarios 3e/3f (RESUME prompt
contract, with and without a branch name).

loop-tick.sh is untouched — it already emitted the verdict correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

fix(loop): wire the resume verdict dispatch — no more silent stall-resume no-ops (issue #154) (not yet reviewed)

@robercano-ghbot
robercano-ghbot merged commit cc6f581 into main Jul 20, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-154-resume-dispatch branch July 20, 2026 19:02
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
Repository owner deleted a comment from robercano-ghbot Jul 23, 2026
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.

Loop: action=resume verdict has no driver-side dispatch — stall-resume silently no-ops

2 participants