Repository navigation
policy: shift cockpit watch carve-out + hook guards Monitor/background GitHub polls (PyAutoBrain#646) - #575
Merged
Merged
Conversation
PyAutoBrain#646. Human rulings H1 (a), H2 (b) 45 min, H3 (a), H3b (a). - policy/shift_cockpit_watch.md: the DESIGN 3.1 carve-out, worded as approved. It is its own page because end_at_deliverable.md is stamped into every repo's AGENTS.md and capped at 10 lines; that file now bans a Monitor or background loop on GitHub and points at the carve-out. - shift_watcher.md: the one sentence on the cockpit watch. - end_at_deliverable_hook.sh: Monitor runs only the canonical `pyauto-brain batch watch --stream --record .../batches/<slot>.md` from dispatched - 30 min to review-at + 45 min (fail closed on an unreadable record); any other form naming the watcher is refused; a Monitor naming GitHub (gh, fetching git, github.com, claude agents, ci_verdict) or a WebSocket is refused; local tails pass. A background Bash loop on GitHub is refused; foreground Bash always passes. Refusals say: read CI once in the foreground, report and hand back. - repos_sync.py: Monitor and Bash join DELIVERABLE_HOOK_MATCHER; --check now flags a settings.json registering the hook under a stale matcher and --write refreshes it in place (before, only the command was compared, so the widened matcher would never have propagated). - Mind's own generated copies regenerated; other repos follow via the propagate workflow after merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…path Findings on 767be8c03 (PyAutoBrain#646): - The stream command is matched whole and unstripped, every character in [A-Za-z0-9._/ -], so `;`, `$IFS`, backticks, `$( )`, quotes, globs, redirections and newlines can no longer ride on an allowed stream. - The CLI and the record are pinned to the Brain and Mind checkouts the workspace's own resolver names (PYAUTO_ROOT, else the `.pyauto-root` above the hook, then PyAutoBrain/agents/_repo_paths.py); a CLI that merely exists elsewhere is refused, and no resolvable workspace fails closed. - The payload reaches Python on stdin, not an env var: a call over 128 KB no longer fails to start Python (exit 126, which failed open). - A bash fast path allows a foreground Bash call before Python starts (90 ms -> 9 ms per call); anything ambiguous still goes to Python. - end_at_deliverable.md says "draining usage" again, still 10 lines. - shift_cockpit_watch.md lists the v1 limits (textual false refusals and false passes). Propagation: session_hook_propagate.yml writes the hook copy and the settings.json matcher through write_session_hooks and commits them in one commit per repo, so the new matcher never lands beside the old hook. Codex users must re-trust the changed hook hash in `/hooks`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PR that edits policy/end_at_deliverable.md cannot make the other repos' AGENTS.md blocks match on their cloned mains: the per-repo regeneration wave writes them after merge. The gate now decides `deliverable_pr` from the PR's diff (independent of the hook, filing, map and Codex decisions), asserts PyAutoMind's own block first, then drops only `end-at-deliverable blocks (generated)` with the same loud banner. The policy joins the push and pull_request path filters, so the leg is still graded on every other PR and on push to main. repos_sync gains a DELIVERABLE_BLOCKS label constant; workflow tests cover the decision, the skip, its composition and the compensating control. 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
The doctrine-and-hook half of M3.4 build C (PyAutoLabs/PyAutoBrain#646). Human rulings 2026-11-16, all as recommended (
Science/scratch/m3_4_m3_5_design/HUMAN.md):H1 (a): the carve-out as worded;
H2 (b): the watch may run until 45 min after review-at;
H3 (a): block any Monitor that touches GitHub or a WebSocket;
H3b (a): block background Bash that polls GitHub.
policy/shift_cockpit_watch.md(new): the design's §3.1 carve-out, word for word. A chat may keep one Monitor on the shift's local event stream, requested by the human, only inside the shift window (30 min beforedispatched:until 45 min afterreview-at:), and it ends with the shift. A v1 Limits note lists the textual gaps.end_at_deliverable.mdstays at its 10-line cap, because it is stamped into every AGENTS.md. It now bans aMonitoror background loop on GitHub and points to the new page; "draining usage" is kept.shift_watcher.mdpoints to the page.The hook (
end_at_deliverable_hook.sh):[A-Za-z0-9._/ -], and pinned to the resolved Brain/Mind checkouts. The window comes from the shift record and fails closed.gh, a fetchinggit,github.com,claude agents,ci_verdictor a WebSocket is refused, and so is a background Bash loop on GitHub.repos_sync.py:--checknow flags a stale matcher and--writerefreshes it. Before, the matcher never propagated.On merge, the propagate workflow writes the hook copy,
settings.jsonmatcher,.codex/hooks.jsonand AGENTS.md block together, one commit per repo, about 49 repos. Codex users must re-trust the changed hook hash.Test plan
repos_sync --checkshows no Mind drift.lifecycle.py checkOK.🤖 Generated with Claude Code