Skip to content

fix(batch): live-shift worker gaps — no EnterWorktree, decision label, late-arrival sweep - #595

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/live-shift-worker-gaps
Nov 6, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/live-shift-worker-gaps

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Three gaps found in pilot live shift 1 (re-run, PyAutoLabs/PyAutoMind#543):

  1. EnterWorktree stalls workers. A worker used the EnterWorktree tool to move into its PyAutoLabs-wt/ worktree. That raises a "permission-root relocation" prompt for any worktree outside .claude/worktrees/, and the worker sat blocked about 70 minutes. The worker prompt now forbids the tool; workers use absolute paths and cd in Bash.
  2. Late finishers were stranded. The worker finished 12 minutes after review-at:. After the digest every tick was idle, so its .done and two ledger ops were never collected (they were committed by hand). A closed shift with a lease held or ops queued now runs late_sweep: it reaps, commits the ops through the one Mind writer, and appends a - late: <task> — <url> (after review-at, …) line to the record under ### Late arrivals. It never spawns, re-dispatches, starts a close-out or posts a second comment. With nothing pending, the tick is idle.
  3. Unlabelled decisions. The worker flagged a decision only in its summary. The prompt now requires gh pr edit <url> --add-label decision-taken, which is the label the close-out refuses on.

Closes #594

API Changes

Adds _orchestrator.late_sweep and LATE_HEADING. A new tick action, late. A new counters key, late. The worker template has two new rules.

Witness

  • The worker prompt carries both rules (session_command test).
  • A .done after review-at (digest posted) is reaped by the next tick with action late: outcome recorded, tokens counted, no spawn, lease released; the next tick is idle.
  • A late failed worker is named "crashed; not re-dispatched" and pending_redispatch is emptied.
  • A closed shift with nothing pending stays idle.
  • Real git: the late line lands in the record on Mind main under ### Late arrivals (run with PYAUTO_MIND set, since it needs ledger_merge.py).
  • Control: with the old _orchestrator.py and template, the new tests fail (4 failed); with the fix all 6 pass.
  • Full Brain suite: 1638 passed, 1 skipped. Tenant firewall: OK.
  • Heart STALE, acknowledged by the human at ship.

Tier: glance — merge mode: auto-merge on green with Witness PASS, post-merge summary.

🤖 Generated with Claude Code

… label, late-arrival sweep (#594)

Worker prompt: never EnterWorktree (its permission prompt stalls an
unattended worker); label a PR decision-taken when a decision is flagged.
Watcher: a closed shift with a lease held or ledger ops queued runs
late_sweep: reap, commit ops, name each late arrival in the record under
'### Late arrivals'. Never a spawn, re-dispatch, close-out or second comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 12a8e63 into main Nov 6, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/live-shift-worker-gaps branch November 6, 2026 12:54
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.

fix(batch): live-shift worker gaps — EnterWorktree stall, late finishers stranded, unlabelled decisions

1 participant