Repository navigation
Description
Overview
Add a read-only pyauto-brain batch watch command: a live terminal view of a running shift. It shows the time left, each task's state and pick reason, PR/CI health and the budgets, and refreshes in place. It reads only what the shift watcher already records. It is a follow-up from the orchestrator pilot (#574), wanted before the first live shift.
Prompt: PyAutoMind/draft/feature/pyautobrain/batch_watch_live_view.md
Plan
- Add
batch watch(with--once,--interval), which reads the brief,counters.json, the leases andtick.log. - Share per-task state wording with the digest, so the live view and the digest never disagree.
- On a live shift: at most one
claude agents --jsonper refresh;gh pr checkscached per interval. - Strictly read-only: no write to the slot, Mind or GitHub, enforced by a test.
- Docs paragraph in the batch
AGENTS.mdand the pilot README.
Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary (a non-PASS Witness → human /prm).
Detailed implementation plan
Affected repositories
- PyAutoBrain (primary)
Work classification
Library (Brain organ code)
Branch survey
| Repository | Current branch | Dirty? |
|---|---|---|
| PyAutoBrain | main | clean |
Suggested branch: feature/batch-watch-live-view
Worktree root: ~/Code/PyAutoLabs-wt/batch-watch-live-view/
Implementation steps
_digest.task_state(task, counters, leases, agents, health). Factored out of_line, which keeps byte-identical digest output. It adds live-only states: running, blocked (stalled since), awaiting redispatch.- New
agents/conductors/batch/_watch.py.snapshot()(reads via_orchestrator.read_countersandleases),render(), and awatch()loop. The header shows slot, SHADOW/LIVE, time toreview-at:or "closed", STOP, last tick and action. Then the task lines (state, why, PR + health, redispatch count), budgets againstmax-sessions:,token-budget:andmerge-cap:, and the last 5tick.logactions. A slot with no folder yet prints "no tick yet". _batch.py: add thewatchverb plus--onceand--interval(default and minimum 30 s); it reuses--recordand--home.- Network:
claude agents --jsononly when live and leases exist;gh pr checksonly for unmerged PRs, cached per interval. - Tests
tests/test_batch_watch.py: shadow, live and no-tick fixtures; slot bytes identical after--once; digest/watch state parity; header time logic. Plus the firewall check (--root <worktree>) and the full Brain suite (2test_prompt_budgetfailures already exist on main). - Witness:
--onceoutput on the real shadow slot2026-11-05-amand on the live fixture, pasted into the PR. - Docs: batch
AGENTS.md(shift watcher section) and the pilot README line.
Out of scope: the watcher opening a brief before dispatched:. That is logged on #574 and is a separate fix.
Key files
agents/conductors/batch/_digest.py: shared task stateagents/conductors/batch/_watch.py: newagents/conductors/batch/_batch.py: verb wiringtests/test_batch_watch.py: new
🤖 Generated with Claude Code
Activity
Jammy2211 commentedon Nov 4, 2026
Shipped
Merged in #576 (
28fb9175) as a glance-tier in-turn merge: Witness PASS, CI green on both pytest legs, Heart YELLOW acknowledged by the human.pyauto-brain batch watch --record <brief> [--once] [--interval N]is a live, read-only view of a running shift. From a task worktree, pass--home ~/Code/PyAutoLabs-wt/.orchestrator; from the canonical checkout the default state home is correct.Revert:
git revert -m 1 28fb9175in PyAutoBrain.🤖 Generated with Claude Code