Skip to content

Hook: an agent never merges; the merge and push rules apply to every command tool; config refuses a second = (T56, cut to G75) - #33

Merged
erickb336 merged 10 commits into
mainfrom
hook/t56-autopilot-scope
Oct 6, 2026
Merged

erickb336 merged 10 commits into
mainfrom
hook/t56-autopilot-scope

Conversation

@erickb336

@erickb336 erickb336 commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

What this is

PR 33 (T56) first added a night window and a size/risk merge scope for autopilot. The owner's decision G75 replaces that rule: with autopilot on, any PR merges after its clean cycles, at any size, risk and time. So this PR keeps the two parts of T56 that G75 does not remove and that main does not have, and adds one rule that the merge-main round found.

What it adds

  • An agent never merges. The sage hook refuses gh pr merge from any agent (an event with an agent id), also when the merge check passes. Only the main session merges, with autopilot on. On main, an agent's ready merge passes.
  • The merge rule and the push rule apply to every command tool. On main, gitGate runs only for Bash. The sage can also run a command through Monitor, PowerShell and mcp__terminal__run_in_terminal, which the agent rule already lists in SHELL_TOOLS. The dispatch now uses SHELL_TOOLS: a merge that is not the form, an agent's merge, a merge with autopilot off and a force-push are refused the same way through each of them. No deny text changes. The hook reads only the command field (the field that each of these tools has).
  • sage config refuses a second =. cycles.large=3=4 is refused and sets nothing. On main it silently reads 3.

What it removes from the earlier PR

The night window (autopilot.window, OWNER_TZ), the size/risk scope in the hook and its note, the tasks field of the merge check, and their docs and tests. The general autopilot text rewrite belongs to T103.

Evidence

  • The new command-tool test fails on main's hook (detached worktree at 1e64e63: Monitor: a merge that is not the form, actual undefined) and passes here. The two earlier tests fail on main's code too.
  • npm run build (30 files), npm run check and npm test (450 of 450) pass, with a fake ps and kill first on PATH.
  • Merged with origin/main at 1e64e63; git merge-tree reports no conflict.

🤖 Generated with Claude Code

erickb336 and others added 5 commits October 4, 2026 20:24
…at night (T56)

The owner chose (gate G20, a) to keep the scaling plan's Q3. With autopilot on,
the chief's merge now goes through only when the merge check passes, every task
of the pull request is tiny or small with no risk flag, and the time is inside
the night window. Each refusal names the rule that failed. An agent's merge is
refused. New config keys autopilot.window (default 22:00-07:00, may wrap
midnight) and autopilot.tz (default America/Los_Angeles); a bad value fails
closed. Tests use an injected clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…idated config (T56 repair 1)

- config refuses a window not inside the owner's 22:00-07:00 and a time zone that is not a full IANA name or UTC
- a bad value in config.json reads as its default, so the hook's note and scope rule see only validated text
- a refusal quotes at most 40 characters of a bad value
- tests use an injected clock instead of an all-day window

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… at night (T56 repair 1)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…utopilot.tz and a second "=" (T56 repair 2)

F-T56-TZSHIFT: OWNER_TZ = America/Los_Angeles is a code constant; config has no time zone key.
F-T56-EQ: a config value with a second "=" is refused.
F-T56-DESIGNDOC: section 10 of the design page states the owner's rule and the night window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ycle count decided (T56 repair 3)

F-T56-DESIGNDOC-15: the lead box and the Decisions row said autopilot merges
everything after a set number of cycles. They now say: only tiny and small
tasks without a risk flag merge by themselves, at night; the owner merges the rest.
F-T56-DESIGNDOC-OPEN: the clean-cycle question moves from Still open to Made
(1 for tiny and small, 2 for large and risk-flagged). The test now reads the whole page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
erickb336 and others added 3 commits October 4, 2026 22:31
Union of both sides: main's mergeCheck map (T53) keeps size and risk per
task for the autopilot scope rule; T54's one reading rule for counts plus
the narrow-only autopilot.window; config expectations carry the window key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts resolved so that T56's night-window scope rule, T40's role
models and T59's invalid-config note work together: the autopilot note
names a cycles key with no number, else states the tiny-or-small,
no-risk-flag rule and the night window. config prints the window after
cap_total and the model keys last.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…efuses a second =

G75 replaces the night window and the size/risk merge scope, so this
removes autopilot.window, OWNER_TZ, scopeProblem, the tasks field of the
merge check, the 40-character quote and their docs and tests. Two
behaviours stay, each with a test that fails on main:
- the hook refuses any merge from an agent, even a ready one;
- sage config refuses key=value with a second = instead of reading the
  first value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@erickb336 erickb336 changed the title Hook: autopilot merges only tiny or small tasks without a risk flag, at night (T56) Hook: an agent never merges; config refuses a second = (T56, cut to G75) Oct 5, 2026
erickb336 and others added 2 commits October 6, 2026 03:53
# Conflicts:
#	plugins/sage/skills/sage/SKILL.md
…ot only Bash (T56)

gitGate ran only for Bash. The sage can run a command through Monitor,
PowerShell or mcp__terminal__run_in_terminal too, and the agent rule
already lists them in SHELL_TOOLS. The dispatch now uses SHELL_TOOLS, so
a merge that is not the form, an agent's merge, a merge with autopilot
off and a force-push are refused the same way through every command
tool. One test covers the three other tools; it fails on main's hook.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@erickb336 erickb336 changed the title Hook: an agent never merges; config refuses a second = (T56, cut to G75) Hook: an agent never merges; the merge and push rules apply to every command tool; config refuses a second = (T56, cut to G75) Oct 6, 2026
@erickb336
erickb336 merged commit dec200c into main Oct 6, 2026
1 check passed
@erickb336
erickb336 deleted the hook/t56-autopilot-scope branch October 6, 2026 11:29
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.

1 participant