Repository navigation
feat: shift event stream, batch watch --stream, /add /cap /kill (M3.4 build A, #644) - #647
Merged
Merged
Conversation
#644) M3.4 Build A, the shift cockpit's engine. - _events.py: record_tick appends one JSON line per new event to the slot's events.jsonl, inside the tick lock, from the tick's result and counters (no subprocess, no network). Keys dedup in the file itself, so a crash never repeats an event or reuses a seq; one cap line per shift-wide class. - _orchestrator: record events in the open tick, finish_shift and late_sweep; out["health"] for ci lines; shift-end when nothing is left for the late sweep; needs-you event comments, at most 5 + 1 a shift, no @ (H4b). - Steering verbs: /cap (never above the brief's own value, H6), /add (refused within 30 min of review-at; overrides exclude: and the parked hold, never the organ rule, H8; one Mind fetch per /add), /kill (local claude stop; the reap marks the exit killed, re-dispatched once unless dropped, H5). _brief.effective applies caps and added tasks per tick. - batch watch --stream [--from --for --json --check]: prints the stream, exits 0 at shift-end, STOP or the window's end, 3 at a segment end. - _batch.grade_text; _digest cap-override line, killed exit word, #641 and close-out refusal classes. - Tests: events, stream, steering (one per verb and ack, all failing on main), and a replay of shift B's real tick.log (2026-11-14-pm3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AUTONOMY.md amendment 2026-11-16 items 1-3, approved by the human: the per-shift events.jsonl, /add's one Mind fetch per command with /cap and /kill's local claude stop, and needs-you event comments (at most 5 + 1 a shift). /drop's "a running worker is not killed by the watcher" now ends "unless the human commands /kill"; the revert condition names them all. The batch skill and its reference list the new verbs and --stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Close-out gates read `budget is not None`: a `/cap tokens 0` now stops close-outs, as its ack says (test). - Needs-you event comments count as `event_comments`, apart from `pushes`, so the digest's push-test finding no longer fires on a normal shift; the digest names their count (test). AUTONOMY item 3 says so. - Event keys are truncated before dedup (KEY_MAX), so a long key never repeats; a `ci` key carries the PR's line count, so a verdict that changes again is streamed again (tests). - `batch watch --stream --from N` attaches after `shift-end` when N is before it, so a re-attaching cockpit gets the digest and shift-end (test). - A comment at `/kill`: a crash before the counters write re-stops the same agent id at most. - batch AGENTS.md: seven verbs, `/kill` is the watcher's, the event stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #644, the engine side of the M3.4 chat cockpit. Design:
Science/scratch/m3_4_m3_5_design/DESIGN.md§1, §2.3, §3.3. The human's decisions, all as recommended (2026-11-16): H4 b, H5 a, H6 a, H8 a/a, H10 a, and the watcher-network amendment._events.py:events.jsonl, written inside the tick lock with no subprocess or network calls.seqand dedup keys come from the file, so a crash can't repeat an event or reuse aseq.cievent repeats only when the verdict changes.pyauto-brain batch watch --stream [--from N] [--for S] [--json] [--check]: tails the stream and exits at shift end, on stop, on STOP, at the window close, or after--for. It makes no network calls.mention_loginonly, enacted once by comment id):/cap merges|workers|tokens <n>: lower a cap, or raise it back up to the brief's value._brief.effectiveis used everywhere caps are read, andtokens 0really stops new close-outs./add <prompt>: goes through the claim, repo-claim and organ gates. It is refused within 30 min of review-at and makes exactly one Mind fetch./kill <task>: runsclaude stopon that shift's own lease agent only, then re-dispatches once unless the task was/dropped. Ifclaude stopfails, the ack says refused.killedoutcome, and the feat: glance public-name diff check — added or renamed public library names go to a human /prm #641 public-name and decision-taken refusal classes.batch/AGENTS.mdlists the seven verbs.Test plan
2026-11-14-pm3/tick.log. All 31 steering tests fail on main.--streamover a 20-minute synthetic shift prints the required events in order (build_a_stream.txt) and exits 0./cap tokens 0didn't stop close-outs, plus 5 follow-ups), fixed in 1d8a1b1. Re-review in progress.Merge before the M3.5 inbox PR (#645), which rebases onto this.
🤖 Generated with Claude Code