From c6fb35a50793775e166e1ee06b699b77a32124b3 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 17 Nov 2026 13:35:58 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20shift=20launch=20preflight=20=E2=80=94?= =?UTF-8?q?=20issue=20required,=20pushed=20brief=20opens,=20watcher=20ends?= =?UTF-8?q?=20at=20review-at=20+=2045=20min?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit batches/AGENTS.md "Shift brief": `issue:` is required for a live brief and `batch brief --new --out` creates it; only a pushed brief opens (the watcher reads Mind origin/main); never two open briefs; the watcher stops at review-at + 45 min. policy/shift_watcher.md: the watcher finds the brief on origin/main itself, runs the local `claude auth status --json` login probe (no model call, so "calls no Claude tool" still holds), holds spawns on an expired login as its own event, and ends with the shift. Refs PyAutoLabs/PyAutoBrain#659 (M3.6a). Co-Authored-By: Claude Opus 5.5 --- batches/AGENTS.md | 20 +++++++++++++++++++- policy/shift_watcher.md | 21 ++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/batches/AGENTS.md b/batches/AGENTS.md index 4725688df..b20632ffa 100644 --- a/batches/AGENTS.md +++ b/batches/AGENTS.md @@ -173,7 +173,7 @@ only while a brief is open (`policy/shift_watcher.md`). - dispatched: 2026-11-04T08:30Z - review-at: 2026-11-04T11:30Z # stated by the human; the grant expires here - shift: morning -- issue: https://github.com/PyAutoLabs/PyAutoMind/issues/ # the digest is posted here once +- issue: https://github.com/PyAutoLabs/PyAutoMind/issues/ # required for a live brief; `brief --new` creates it - live: LIVE · 1 running … — status: # written by the watcher only (PyAutoBrain#622) - packet: yes # optional; the HTML packet is opt-in under a brief - heart-ack: @@ -220,6 +220,24 @@ names a file, so writing the record — the dispatch — stays the human's act. `--new` also prints, on stderr, how the goals changed since the newest brief. `brief --check` warns when goal 1 of `goals.md` is missing from a brief. +**The launch (2026-11-17, PyAutoBrain#659).** + +- **`issue:` is required for a live brief** (not `shadow: yes`): the status + comment, the steering commands and the digest all go there. With `--out`, + `brief --new` creates it on PyAutoMind (one `gh issue create`) and writes + it; a file that already names one keeps it, and `--issue ` names one by + hand. `brief --check` refuses a live brief without it, and refuses the + launch while the CLI login has expired or expires before `review-at:` (run + `claude /login`). +- **Only a pushed brief opens.** The watcher finds the brief itself on Mind + `origin/main`: the one whose `dispatched:` has passed and whose + `review-at:` has not. A brief written but not pushed grants nothing. +- **Never two open briefs.** If two pushed briefs overlap, the watcher ticks + neither and says `two open briefs on origin/main`. +- **The watcher stops at `review-at:` + 45 min.** It posts the digest at + `review-at:`, sweeps late arrivals for 45 minutes, then stops ticking the + slot and renews no lease. A worker still out by then is in the digest. + **The keep-Heart-green lane** (PyAutoBrain#625). `brief --new` first reads Heart's release verdict and sorts every reason into `fixable-dev`, `local-checkout`, `release-scope` or `human-only`, and appends a `## Heart` diff --git a/policy/shift_watcher.md b/policy/shift_watcher.md index 7f185747d..1ee231bf3 100644 --- a/policy/shift_watcher.md +++ b/policy/shift_watcher.md @@ -12,14 +12,29 @@ do. No tokens are spent watching. What keeps the exemption narrow: -- It **calls no Claude tool** and **arms nothing inside a session**. A session +- It **calls no Claude tool** and **arms nothing inside a session**. Its + only `claude` calls are local CLI reads: `claude agents --json` for its + workers, and `claude auth status --json` (the login probe, no model call) + on a shift's first tick and when a worker shows as blocked. A session it starts is an ordinary session: it ends at its deliverable, and `send_later`, `ScheduleWakeup`, `CronCreate`, `RemoteTrigger` and `/loop` stay blocked for it. - It **dispatches nothing without an open shift brief** — a `PyAutoMind/batches/.md` record carrying a `brief:` block whose - `review-at:` has not passed (`PyAutoBrain/AUTONOMY.md`, "Shift briefs and - unattended `glance`"). A tick with no open brief does nothing. + `dispatched:` has passed and whose `review-at:` has not + (`PyAutoBrain/AUTONOMY.md`, "Shift briefs and unattended `glance`"). A + tick with no open brief does nothing. **It finds the brief itself** on + Mind `origin/main`, read locally and never fetched for this, so only a + pushed brief opens; two open briefs grant nothing, and it idles saying so. + `PYAUTO_SHIFT_BRIEF` in its env file is only an override, honoured inside + that brief's own window (2026-11-17, PyAutoBrain#659). +- **An expired CLI login holds it.** When the login probe finds `loggedIn: + false` or a `loginExpiresAt` already passed, the watcher records a + `login-expired` event ("CLI login expired: run `claude /login`"), never a + worker "blocked on a person", and starts no worker until the probe passes. +- **It ends with the shift.** After `review-at:` it posts the digest and + sweeps late arrivals; once `review-at:` + 45 min has passed and the digest + is posted, it stops ticking that slot and renews no lease. - **Kill switch:** it checks for a `STOP` file in its slot directory **first**, before reading anything else, and does nothing while that file exists. The human can also write it from their phone by commenting `/stop` on the