From b4043e7f0d19c1eb10a81653f1e9edf7a9e0779f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 08:31:56 +0000 Subject: [PATCH] Merge authority follows declared Consequence tier (2026-10-02) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AUTONOMY.md gains the dated section "Merge authority follows Consequence — 2026-10-02": declared notify merges in-turn on green CI and runs the /prm close-out; glance does the same only when its Witness passed and feeds the re-scoped Shadow window (20 clean rows confirm, any revert demotes); judge or no declared header stays a human /prm. Plan approval at start_dev (or the --auto/batch launch) is the merge authorization; never auto-merged: decision-taken, Heart RED-override/corrective ships, red/pending/conflicting CI, SKIPPED legs. Checkpoint, levels and invariant rows updated to match. ship_library/ship_workspace gain the post-PR-open tiered-merge step handing off to the /prm procedure; prm documents the bounded in-turn wait (one background gh pr checks --watch, ~60 min, no timers/wake-ups) and the glance-tier shadow row; start_dev's plan states tier + merge mode. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HGSSTEegN9Sbd2TJ6hj1XL --- AUTONOMY.md | 109 ++++++++++++++++++++++-- skills/prm/SKILL.md | 3 + skills/prm/closeout.md | 68 ++++++++------- skills/prm/mcp.md | 2 +- skills/prm/prm.md | 23 ++++- skills/prm/reference.md | 43 ++++++++-- skills/ship_library/reference.md | 5 +- skills/ship_library/ship_library.md | 36 ++++++-- skills/ship_workspace/ship_workspace.md | 27 +++++- skills/start_dev/start_dev.md | 23 ++++- 10 files changed, 276 insertions(+), 63 deletions(-) diff --git a/AUTONOMY.md b/AUTONOMY.md index ab4ae0ae..61a1d3f8 100644 --- a/AUTONOMY.md +++ b/AUTONOMY.md @@ -20,7 +20,7 @@ Where the dev workflow stops for a human today: | 1 | **Plan approval** — present the plan, wait for explicit approval before any edit | `start_dev` (Plan Mode) | | 2 | **Ship PR sign-off** — review of `## API Changes` / `## Scripts Changed` before commit/push/PR | `ship_library` / `ship_workspace` | | 3 | **Heart YELLOW acknowledgement** — warnings surfaced, proceed only on explicit go-ahead | ship gate (`skills/WORKFLOW.md` "Heart readiness gate") | -| 4 | **Merge / issue close** — offered after shipping, never automatic | post-ship | +| 4 | **Merge / issue close** — by the declared `Consequence:` tier: `notify` / `glance` merged in-turn by the shipping session on green CI; `judge` or undeclared offered after shipping, never automatic ("Merge authority follows Consequence", 2026-10-02) | post-ship / `/prm` | | 5 | **Version ask** — the minor-version choice | `pre_build` | | 6 | **Post-merge cleanup confirmation** — worktree removal, branch deletion, registry moves | `ship_*` cleanup | @@ -32,7 +32,7 @@ Where the dev workflow stops for a human today: | Ship PR sign-off | proceed through the autonomous-ship gate; end at PR-open | park (`awaiting-input`), question to the issue, continue elsewhere — except under an explicit `--auto` launch, where it resolves to decide-and-flag (below; 2026-09-07) | present + wait | | Heart YELLOW | park, unless the reason set was human-acknowledged at launch (see the autonomous-ship gate) | same as `safe` | present + wait | | Heart RED | stop, report | stop, report | stop, report — a live human may separately invoke the development override or corrective-PR exception below; neither is an autonomy level | -| Merge / close | human, always | human, always | human, always | +| Merge / close | by declared `Consequence:` (2026-10-02 section) | by declared `Consequence:` | by declared `Consequence:` | | Version ask | n/a — release stays `human-required` (sole exception: the scheduled-nightly standing grant, dated below) | n/a | ask | | Cleanup | proceed + log | proceed + log | confirm | @@ -240,8 +240,9 @@ An interactive `supervised` run parks at ship sign-off exactly as above — the human is one message away, so the round-trip is free. Under an explicit `--auto` launch the ship checkpoint instead resolves to **decide-and-flag** (next section, extended to it 2026-09-07): the run ships to an open PR and the -decision is flagged there. Merge stays a human act either way, and no run ever -bypasses the gate — checkpoint-and-continue frees the human's session, not the +decision is flagged there. A `decision-taken` PR is never auto-merged — its +merge stays a human act whatever its tier ("Merge authority follows +Consequence"), and no run ever bypasses the gate — checkpoint-and-continue frees the human's session, not the checkpoint. ### Decide-and-flag (`--auto` launches) — 2026-08-30, extended 2026-09-07 @@ -443,6 +444,88 @@ own `batches/AGENTS.md` drops both: the Heart gates releases, not runs), and **their absence there is never read as an unacknowledged RED** — the fields are not missing, they do not exist on that schema. +## Merge authority follows Consequence — 2026-10-02 + +**Who merges is decided by the task's declared `Consequence:` tier** +(`PyAutoMind/REFERENCE.md` "The review-cost model"), not by its autonomy level. +Approved by the human 2026-10-02; this section is that dated doctrine edit. + +| Declared `Consequence:` | Who merges | What the human reads | +|---|---|---| +| `notify` | the **shipping session**: it waits for CI inside its turn, merges on green, then runs the `/prm` close-out itself | the close-out ledger | +| `glance` | the shipping session, exactly as `notify` — **only if the `Witness:` check passed** | a **post-merge summary**; each auto-merge appends one Shadow-window row (below) | +| `judge` | the human, by `/prm` — unchanged | the PR | +| *no header* | the human, by `/prm` — unchanged | the PR | + +**Declared means written in the prompt.** A tier the sizing faculty would infer +for a header-less prompt never carries merge authority — a missing header is +`judge` for this purpose, whatever `bin/pyauto-brain sizing` says. + +**The evidence** (cited for the grant, as "Graduation and demotion" requires): + +- ~200 recent merged PRs across 8 repos carried **0 reviews**, and most merged + **under an hour** after opening with 1–2 commits — the human merge on this + organism's own low-consequence work is a click, not a review. +- `PyAutoMind/autonomy_log.md`, first table: **120 `merged-unchanged` / 12 + `amended` / 2 `rejected` / 2 `reverted`**. +- The tier-`notify` Shadow window stood at **13/40, all clean**. The human + grants `notify` early by this edit rather than waiting out the window, and + **re-scopes the window to `glance`**. + +**The authorization is given at plan time, never assumed later.** + +- **Plan approval at `start_dev` is the merge authorization.** The plan must + state the declared tier and the **merge mode** (`auto-merge on green` or + `human /prm`); approving that plan authorizes that merge. A plan that does not + state them authorizes no merge. +- Under **`--auto`** or a **batch**, the launch / slot approval is the + authorization, bounded exactly as the launch is ("What a batch launch is"). +- **Multi-phase epics chain**: a phase that auto-merged hands to the next phase + without re-asking, and the chain **stops** at a `judge`-tier phase, any + failure, Heart RED, or scope the approved plan did not name. + +**The in-turn wait.** After PR-open, the shipping session waits for CI **inside +its own turn**: one background `gh pr checks --watch` capped at **~60 min** +(the Bash call's own timeout). That is a process of this session, not a timer: +no `send_later`, `ScheduleWakeup`, cron, routine or `subscribe_pr_activity` +(`PyAutoMind/policy/end_at_deliverable.md` stands as written). When it returns, +CI is judged exactly as `/prm` step 2 judges it — every run, every leg — and on +green the merge and close-out run per `skills/prm/` in full. Cap reached, or a +surface with no authenticated `gh` (mobile, web): judge once, merge only if +already green, otherwise report and end; the human runs `/prm`. + +**Never auto-merged, at any tier:** + +- a PR carrying the **`decision-taken`** label (decide-and-flag); +- a ship under the **Heart RED development override** or the **corrective-PR + exception** — both keep their own separate human merge command; +- **red, pending or conflicting** CI, or a non-`CLEAN` merge state; +- a **SKIPPED** test leg — skipped is not green. + +The `/prm` guards apply verbatim: the **library-first** gate, the +**sibling-branch** proof (every claimed branch merged before close-out) and the +**data-worktree** question. **`gh pr merge` is a bare, unchained Bash call** +(no `&&`, no `;`, no pipe) so the permission layer sees exactly one merge; if +it is denied, stop and report — never retry it another way. On MCP the merge +is the single `merge_pull_request` call, with the same rule. + +**The `glance` Shadow window.** Each auto-merged `glance` PR appends one row to +`PyAutoMind/autonomy_log.md` "Shadow window" at close-out, recorded +`merged-unchanged` at merge (`lifecycle.py close … --tier glance`). The human +reads the post-merge summary and **amends the row** if they find something +substantive (`merged-after-substantive-change`), or marks it `reverted`. +`glance` is **confirmed at 20 clean rows**. **Any revert demotes that tier back +to a human `/prm`** immediately, by dated doctrine edit citing the row — and a +reverted `notify` merge demotes `notify` the same way. + +**Later step, not now:** GitHub's native `--auto` merge (`gh pr merge --auto`, +`enable_pr_auto_merge`) would let the wait outlive the turn without a timer. +It is not adopted here; it needs its own doctrine edit. + +*Revert condition:* any reverted auto-merge demotes its tier (above); an +auto-merge found to have bypassed one of the never-auto-merge rules retires this +section and returns every merge to `/prm`. + ## Human override for Heart RED (development only) Heart RED still parks every autonomous run and blocks every release. After the @@ -597,14 +680,19 @@ tier), never by weakening leg 4. ## Hard invariants (every level, no exceptions) -- **Merge and issue-close are human acts.** An explicit future flag may extend - autonomy to merge; it does not exist and must not be assumed. +- **Merge and issue-close are human acts, except as "Merge authority follows + Consequence" (2026-10-02) grants them** — a declared `notify` or witnessed + `glance` task, authorized at plan or launch approval, merged in-turn on green + CI. Nothing else extends autonomy to merge; GitHub native auto-merge is not + adopted and must not be assumed. - **Releases are human acts, with one dated exception.** The scheduled-nightly standing grant (2026-07-09, above) is the only path that ships a release without a per-release human; it is activity-gated, Heart-GREEN-gated and kill-switchable. Every other release is `human-required`. - **Autonomous runs end at PR-open**, with the PR body carrying the plan, the - review verdict, test/smoke counts, and a validation checklist. + review verdict, test/smoke counts, and a validation checklist — or, for a + declared `notify` / witnessed `glance` task, at the in-turn merge and + close-out that section grants. - **Never modify code to make tests or smoke tests pass.** - **Heart YELLOW/RED is never acknowledged autonomously.** A launch-time human acknowledgement of a named reason set is a human acknowledgement — it @@ -649,10 +737,13 @@ tier), never by weakening leg 4. ## Consumers - `start_dev` — `--auto` usage, effective-level computation, plan-to-issue - for `safe`, launch-acknowledgement recording (its "--auto mode" section). + for `safe`, launch-acknowledgement recording (its "--auto mode" section); + the plan's tier + merge-mode line. +- `prm` — the CI judgment, merge guards and close-out every merge runs, + human-typed or tiered. - `ship_library` / `ship_workspace` — the four-leg gate at step 4 (five under a batch launch), stop at - PR-open, validation checklist, calibration append; the RED-handling step + PR-open (or the tiered in-turn merge), validation checklist, calibration append; the RED-handling step points here for both the development-only human override and the narrower corrective-PR exception. diff --git a/skills/prm/SKILL.md b/skills/prm/SKILL.md index c23a69aa..e4584e7a 100644 --- a/skills/prm/SKILL.md +++ b/skills/prm/SKILL.md @@ -15,6 +15,9 @@ runs to the end without asking again — but still refuses on red, pending, conflicting, an unmerged upstream library PR or sibling branch, and asks once before deleting a worktree holding irreplaceable data products. +The shipping session also runs it in-turn for a declared `notify` / witnessed +`glance` task its approved plan authorized (`prm.md` "Tiered merge"). + Read only the applicable step/environment from linked references, not all files. Reuse unchanged instructions already loaded; follow [CONTEXT.md](../CONTEXT.md) for bounded output and repository paths. diff --git a/skills/prm/closeout.md b/skills/prm/closeout.md index 57dfd5b2..f6ff1592 100644 --- a/skills/prm/closeout.md +++ b/skills/prm/closeout.md @@ -9,8 +9,11 @@ All Mind paths below are relative to the resolved Mind checkout. ## 5. Close the task out -Typing `/prm` authorized all of this; the only questions are the guards in step -6. Order is forced by the tooling, so do not reorder: +Typing `/prm` authorized all of this — and so did the approved plan or launch +of a tiered merge (prm.md "Tiered merge"), which runs this same close-out +in-turn after its bounded wait; the shipping session never leaves a waiter, +timer or subscription behind to do it later. The only questions are the guards +in step 6. Order is forced by the tooling, so do not reorder: 1. **Prove every branch merged, per repo** — a `complete/` record is a write-up, not a merge receipt, and a task may have shipped in waves. Ask git, per repo @@ -22,11 +25,11 @@ Typing `/prm` authorized all of this; the only questions are the guards in step 3. **Mind: `active/` → `complete/`** — draft the completion body, then one verb does the whole Mind-side close-out — the record, the prompt's removal, the `active.md` row (and any `parked.md`/`planned.md` pointer), - the shadow row when the tier is `notify`, and `complete/index.md`: + the shadow row when the tier is `glance`, and `complete/index.md`: ```bash python3 scripts/lifecycle.py close --date \ - --from-file --pr [--tier notify --gate "" \ + --from-file --pr [--tier glance --gate "" \ --action --stage <1|2>] # dry run: prints every step python3 scripts/lifecycle.py close … --apply # then does them ``` @@ -52,16 +55,15 @@ Typing `/prm` authorized all of this; the only questions are the guards in step clears the key — only `/review_release` does, on a release that actually published (`PyAutoMind/REFERENCE.md` → "The pending-release chain"). - **3b. Shadow row — tier-`notify` only.** The tier-`notify` auto-merge - decision is pre-registered over **40 candidates**, and this close-out is - where the window is fed. It used to hang off a batch review slot, which - runs only when a batch is launched; close-out happens on every shipped - task. Do it only after sub-step 1 proved every branch `MERGED` — the row - records what the human *did* with the PR, and before the merge there is - nothing to record. + **3b. Shadow row — tier-`glance` only.** Since 2026-10-02 the window + counts tier-`glance` merges toward **20 clean rows** (`notify` was granted + then at 13/40, all clean — `../../AUTONOMY.md` "Merge authority follows + Consequence — 2026-10-02"). Do it only after sub-step 1 proved every branch + `MERGED` — the row records what happened to the PR, and before the merge + there is nothing to record. - 1. **Tier.** The prompt's declared `Consequence:` header wins; with no - header, `bin/pyauto-brain sizing `. Anything but `notify` — + 1. **Tier.** The prompt's **declared** `Consequence:` header — never a + tier `bin/pyauto-brain sizing` would infer. Anything but `glance` — **do nothing and say nothing**: no row, no question, no ledger line. 2. **Gate cell.** Copy it from the task's ship calibration row in `PyAutoMind/autonomy_log.md` — `ship_library` / `ship_workspace` wrote @@ -72,28 +74,36 @@ Typing `/prm` authorized all of this; the only questions are the guards in step 3. **Stage.** `2` if an independent-model adversary leg ran on this task, else `1`. Stage 1 and stage 2 are never pooled, so this is not a judgement call: the leg either ran or it did not. - 4. **The one question.** Ask the human exactly this, and ask nothing else: - - > Merged unchanged, or did you change something substantive first? - > (substantive = a change you would have minded finding already merged: - > a changed default, a user-visible error message, a removed or weakened - > test, a renamed public thing, a wrong docs claim) - - → `merged-unchanged` / `merged-after-substantive-change`. `not-merged` - is what gets recorded when `/prm` stopped on a guard (step 6) and never - reached the question — never a guess at what the answer would have been. - 5. **Append** — the `--tier notify --gate "" --action + 4. **The action.** + - **Tiered merge** (prm.md "Tiered merge" — the shipping session merged + it): record `merged-unchanged` at merge and **ask nothing**. The + human reads the post-merge summary and amends the row to + `merged-after-substantive-change` if they find something + substantive, or `reverted` if it was backed out — a `reverted` row + demotes `glance` back to a human `/prm`. + - **Human-typed `/prm`**: ask exactly this, and nothing else: + + > Merged unchanged, or did you change something substantive first? + > (substantive = a change you would have minded finding already merged: + > a changed default, a user-visible error message, a removed or weakened + > test, a renamed public thing, a wrong docs claim) + + → `merged-unchanged` / `merged-after-substantive-change`. + `not-merged` is what gets recorded when `/prm` stopped on a guard (step 6) + and never reached the merge — never a guess at what would have happened. + 5. **Append** — the `--tier glance --gate "" --action --stage <1|2>` flags on the `close` verb above do it (`shadow-row` is the verb underneath). The dry run prints the row and the new count line before anything is written; the row rides the same commit and push as the record and the dashboard, never a commit of its own. 6. **Name it in the ledger** (sub-step 7): "shadow row appended, count - N/40". + N/20" — and, for a tiered merge, end the ledger with the post-merge + summary the human reads in place of the PR: what merged, the witness + result, and the one-command revert. - Protocol, power calculation and the **pre-registered decision rule** live in - the tier-`notify` protocol prompt, folded under `## Original prompt` in - `PyAutoMind/complete/2026/09/prm-shadow-row-notify-tier.md` — read it - before interpreting the table. + The window's header in `PyAutoMind/autonomy_log.md` carries the rule; the + earlier tier-`notify` protocol is folded under `## Original prompt` in + `PyAutoMind/complete/2026/09/prm-shadow-row-notify-tier.md`. 4. **Mind: leave the page true** — the close-out is finished when `dashboard.md` stops offering this work, not when the claim is released. `dashboard_refresh.yml` heals a stale *render*, never a stale *prompt*, so diff --git a/skills/prm/mcp.md b/skills/prm/mcp.md index 744a21c4..706854ec 100644 --- a/skills/prm/mcp.md +++ b/skills/prm/mcp.md @@ -16,7 +16,7 @@ mapping page only if something here is missing. Names take the | 1 resolve | `list_pull_requests` (state `open`), or `pull_request_read` `get` for a known number. Mind's `active.md` via `get_file_contents` | | 2 judge CI | `pull_request_read` `get_check_runs` — every check on the head commit, in one call. Then `pull_request_read` `get` for `mergeable` / `merge_state_status` | | 2 by workflow | `actions_list` `list_workflow_runs` **has no `head_sha` filter** (`workflow_runs_filter` is actor/branch/event/status only): filter by `branch`, then match `head_sha` yourself, or you will judge a stale run. Legs: `actions_list` `list_workflow_jobs`, `resource_id` = run id | -| 3 stop | **No call.** On this surface step 3 is judge-once-then-stop: no `subscribe_pr_activity`, no `send_later`. Report where each PR stands and end the turn; the human re-runs `/prm` when CI is green | +| 3 stop | **No call.** On this surface step 3 is judge-once-then-stop: no `subscribe_pr_activity`, no `send_later`. Report where each PR stands and end the turn; the human re-runs `/prm` when CI is green. A tiered auto-merge (prm.md "Tiered merge") has no wait here either: merge only if already green | | 3 red | `get_job_logs` with `run_id`, `failed_only: true`, `return_content: true` — **before** anything else, the blob is purged | | 4 merge | `merge_pull_request` (`merge_method: "merge"`), then `pull_request_read` `get` to confirm `MERGED`; `unsubscribe_pr_activity` only to clear a stale subscription an older run left | | 5.2 issue | `add_issue_comment`, then `issue_write` `update` with `state: "closed"` and `state_reason: "completed"` — an unset reason is what leaves an issue reading "closed as not planned" | diff --git a/skills/prm/prm.md b/skills/prm/prm.md index 763f009e..40efaa4c 100644 --- a/skills/prm/prm.md +++ b/skills/prm/prm.md @@ -48,6 +48,14 @@ command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1 \ On MCP, read [mcp.md](mcp.md) for the exact calls; do not load local recipes. +## Tiered merge — the shipping session runs this procedure + +Since 2026-10-02 `ship_*` hands a declared-`notify` or witnessed-`glance` task +here after PR-open, authorized by its approved plan or launch (`AUTONOMY.md` +"Merge authority follows Consequence"). Run from step 2 as written, with the +bounded wait, extra refusals and bare merge call in +[`reference.md`](reference.md) → "Tiered merge". + ## 1. Resolve the target PR(s) In order: explicit argument → current branch (`gh pr view --json`) → the claimed @@ -66,6 +74,8 @@ every run for the sha and every job in it, and treat anything not `completed` as *not ready* — not "green so far". An empty run list is not green either. Read `mergeable` / `mergeStateStatus` too: `UNSTABLE` is pending-or-red, and `CONFLICTING` / `BEHIND` / `BLOCKED` stops the run whatever the checks say. +A test leg whose conclusion is `skipped` is **not green** — skipped ≠ passed: +name it in the report; a tiered merge stops on it. ## 3. Wait, or stop @@ -73,6 +83,8 @@ every run for the sha and every job in it, and treat anything not `completed` as in-turn poll on a local CLI, and nothing at all on mobile or web. Under `--no-wait`, do not even poll: judge once, report and stop — which on mobile and web is now the only behaviour the flag or its absence can produce. + (A tiered merge's ~60-min background watch is the one other in-turn wait — + `reference.md` "Tiered merge".) - **Stop (mobile, web — required there).** Report where each target PR stands — per-leg counts, `2/4 legs done`, red or pending named — then @@ -115,7 +127,8 @@ release or release rehearsal. library PR is `MERGED` — the library-first gate ([`../ship_workspace/reference.md`](../ship_workspace/reference.md)). Refuse otherwise; there is no `--auto`-flag workaround. -3. `gh pr merge --merge` per PR (`-R owner/repo` when you have no checkout), +3. `gh pr merge --merge` per PR (`-R owner/repo` when you have no checkout) + — one bare, unchained Bash call per PR; a denied merge stops the run — then confirm the state is `MERGED` — queued or auto-merge is not merged. Never `--delete-branch`: it takes the local branch too, orphaning a task worktree. 4. **Clear anything an older run left armed.** Step 3 arms nothing, so this is @@ -132,7 +145,7 @@ After every target PR is confirmed merged, **read and execute [closeout.md](closeout.md)** in order. It retains the complete mandatory procedure: prove each claimed branch merged, close the issue, move the prompt with `lifecycle.py close`, retain pending-release obligations, record any -notify-tier shadow row, reconcile references and regenerate the dashboard, +glance-tier shadow row, reconcile references and regenerate the dashboard, then remove the worktree and local branches. No close-out on partial evidence. Use the current step's [reference section](reference.md), not the whole file. @@ -160,8 +173,10 @@ Stop and report instead of pressing on when: Heart is not something a merge shortcut may re-judge. The **freeze** flag (step 4) is a different thing and does not re-run anything: readiness answers "is the organism healthy", the freeze answers "is a validation window open - right now". Nor does merge ever stop - being human: `/prm` is a human-typed door, never invoked by the `--auto` queue. + right now". Merge stops being a human-typed act only where a declared + `notify` / witnessed `glance` tier and an approved plan or launch grant it + ("Tiered merge"); otherwise `/prm` is a human-typed door, never + invoked by the `--auto` queue. - A task with no issue, no Mind prompt, or no worktree (a direct wiring change, say) skips those sub-steps and says so — not an error. That licence does **not** extend to the dashboard regen, skippable only where the close-out wrote nothing diff --git a/skills/prm/reference.md b/skills/prm/reference.md index 35aa6ebb..5142d1d7 100644 --- a/skills/prm/reference.md +++ b/skills/prm/reference.md @@ -114,13 +114,40 @@ only for **library** repos. `--thaw ""` merges anyway and appends the override row to `PyAutoMind/autonomy_log.md` (`## Freeze overrides`). An expired flag reads as clear, so a forgotten `--set` never blocks anyone. -## Shadow row (tier-`notify`) +## Tiered merge + +Since 2026-10-02 a PR may also reach this procedure **without** a human typing +`/prm`: `ship_library` / `ship_workspace` hand a declared-`notify` or +witnessed-`glance` task here after PR-open, under the merge authorization the +approved plan (or `--auto` / batch launch) stated. The rule is +[`../../AUTONOMY.md`](../../AUTONOMY.md) "Merge authority follows Consequence — +2026-10-02"; this procedure runs from step 2 exactly as written, with three +differences: + +- **The wait (step 3).** One background `gh pr checks --watch`, capped + ~60 min by the Bash call's own timeout, then the full step-2 judgment. It is + a process of this session — never a `send_later`, wake-up, cron, routine or + subscription — so `end_at_deliverable` holds as written. Cap reached, or no + authenticated `gh` (mobile, web): judge once, merge only if already green, + else report and end; the human runs `/prm`. +- **Extra refusals (step 4).** Never merge a `decision-taken` PR, a Heart + RED-override or corrective-PR-exception ship, red / pending / conflicting + CI, or a SKIPPED test leg — report and stop; the human runs `/prm`. The + library-first, sibling-branch and data-worktree guards apply verbatim. +- **The merge call.** `gh pr merge --merge` as a **bare, unchained** Bash + call (no `&&`, `;` or pipe); if the permission layer denies it, stop and + report — never retry it another way. For `glance`, the close-out appends the + Shadow-window row (`merged-unchanged`, closeout.md 3b) and the ledger is the + human's post-merge summary. + +## Shadow row (tier-`glance`) The other row `/prm` appends to `PyAutoMind/autonomy_log.md`, and the only one -that is routine: one per tier-`notify` candidate, under `## Shadow window` -(prm.md step 5.3b). The window is the pre-registered evidence base for the -question "may an agent ever merge its own low-consequence work?", counted to -**40** candidates rather than run to a date. +that is routine: one per tier-`glance` candidate, under `## Shadow window` +(closeout.md step 5.3b). Until 2026-10-02 the window counted tier-`notify` +candidates toward 40; `notify` auto-merge was then granted at 13/40, all +clean, and the window re-scoped to `glance` auto-merges, counted to **20** +clean rows (`AUTONOMY.md` "Merge authority follows Consequence — 2026-10-02"). ``` | date | task | tier | gate (tests/smoke/review/heart/witness[/adversary]) | human action | stage | @@ -130,9 +157,9 @@ question "may an agent ever merge its own low-consequence work?", counted to |------|---------------------| | `date` | the merge date — when the PR actually went in, not when `/prm` ran | | `task` | the slug plus the PR refs, e.g. `my-task (PyAutoBrain#364 / PR#365)` | -| `tier` | `notify`, and only `notify` — the prompt's declared `Consequence:` header wins over `bin/pyauto-brain sizing ` | +| `tier` | `glance`, and only `glance` — the prompt's **declared** `Consequence:` header; an auto-merge never comes from a sizing-inferred tier | | `gate` | copied verbatim from the task's ship calibration row (written at PR-open by `ship_library` / `ship_workspace`); absent → the legs from the `/prm` step-2 judgement, same form | -| `human action` | `merged-unchanged` / `merged-after-substantive-change` / `not-merged` — nothing else | +| `human action` | `merged-unchanged` / `merged-after-substantive-change` / `not-merged` / `reverted` — nothing else; an auto-merge records `merged-unchanged` at merge and the human amends it | | `stage` | `2` if an independent-model adversary leg ran, else `1`; never pooled | `not-merged` is for a close-out that stopped on a guard before the question was @@ -141,7 +168,7 @@ asked, never a guess at the answer. **Append only after every branch reads the PR, so before the merge there is nothing to record. `python3 scripts/lifecycle.py shadow-row … --apply` writes the row and rewrites -the section's `Count toward 40:` line from the table; without `--apply` it +the section's `Count toward 20:` line from the table; without `--apply` it prints both and writes nothing. The row rides the close-out's existing Mind commit and push — never its own. diff --git a/skills/ship_library/reference.md b/skills/ship_library/reference.md index 53586228..21bc628d 100644 --- a/skills/ship_library/reference.md +++ b/skills/ship_library/reference.md @@ -80,8 +80,9 @@ human's merge decision) and push Mind with file — the five-cell `| date | task | effective level | gates | outcome |` table under the top heading — as the last row of its final segment, in date order. It never goes at the end of the file: the table that sits there is the -**Shadow window** (`## Shadow window`), which is `/prm`'s alone, tier-`notify` -only, appended at close-out with a fixed `human action` vocabulary. Six +**Shadow window** (`## Shadow window`), which is the close-out's alone, +tier-`glance` only (tier-`notify` until 2026-10-02), appended at close-out with +a fixed `human action` vocabulary. Six supervised rows landed there at PR-open between 2026-09-13 and 2026-09-17 and broke `tests/test_autonomy_log_shadow.py` on every Mind CI run until they were moved (2026-09-17). diff --git a/skills/ship_library/ship_library.md b/skills/ship_library/ship_library.md index 551f10ac..b37f7d39 100644 --- a/skills/ship_library/ship_library.md +++ b/skills/ship_library/ship_library.md @@ -103,7 +103,7 @@ step or evidence leg fails, stop and report — do not proceed. 3 note); then ship **without interactive sign-off** — the PR body additionally carries the `## Validation checklist` section ([`reference.md`](reference.md) → "Validation checklist (--auto)"), the run -**stops at PR-open** (merge stays human, always), a calibration row is +**stops at PR-open** unless step 6's declared tier merges it, a calibration row is appended to `PyAutoMind/autonomy_log.md` (its **first** table, never the Shadow window at the end — [`reference.md`](reference.md) → "Which table"), and `active.md` moves to @@ -120,7 +120,8 @@ Analyse downstream workspace impact and present data-driven options — see "Library PR Created" progress comment, set `active.md` to `library-shipped, workspace-pending`, add `library-pr:`, push Mind. - **(iii)** no workspace impact → run `/smoke_test` (with `activate.sh` sourced). - On pass, offer to merge the library PR, post a "Shipped" comment, write the + On pass — unless step 6's tiered merge applies, whose `/prm` close-out does + all of this itself — offer to merge the library PR, post a "Shipped" comment, write the dated completion record (`lifecycle.py record` — also refreshes the index and prunes the `active.md` entry), push Mind. On fail, report and suggest `/start_workspace` (likely option ii); do not merge, do not clean up `active.md`. @@ -128,11 +129,36 @@ Analyse downstream workspace impact and present data-driven options — see Comment templates and Mind-state transitions are in [`reference.md`](reference.md) → "Issue comments + Mind state". -**Under `--auto`:** run the same analysis but never merge and never offer to — -post the data-driven recommendation (i/ii/iii, affected scripts) to the issue -and end the run at PR-open. Routing into `/start_workspace` happens on the +**Under `--auto`:** run the same analysis but never merge or offer to here — +the only merge is step 6's tiered one — post the data-driven recommendation +(i/ii/iii, affected scripts) to the issue and end the run at PR-open (or at +step 6's merge). Routing into `/start_workspace` happens on the next human (or queued) launch. +### 6. Merge by declared tier (post-PR-open) + +Who merges follows the prompt's **declared** `Consequence:` header — +[`../../AUTONOMY.md`](../../AUTONOMY.md) "Merge authority follows Consequence +— 2026-10-02" is the rule; this step only routes to it: + +- **`notify`**, or **`glance` with the `Witness:` check passed**, and the + approved plan (or `--auto` / batch launch) stated `auto-merge on green` → + wait for CI **inside this turn** (one background `gh pr checks --watch`, + capped ~60 min; no timer, wake-up or subscription), then run the + [`/prm`](../prm/prm.md) procedure from its step 2 — judge, merge, close-out — + exactly as a human-typed `/prm` would. For `glance`, the close-out appends + the Shadow-window row and the ledger ends with the post-merge summary. + When step 5 routed the task to `/start_workspace` (options i / ii), merge the + library PR but **run no close-out** — the task stays open as + `library-shipped, workspace-pending`, and the close-out runs at the workspace + PR's own tiered merge. +- **`judge`, no declared header**, a `decision-taken` PR, a Heart RED-override + or corrective-PR-exception ship, or any red / pending-at-cap / conflicting / + SKIPPED leg → **stop at PR-open**; the human runs `/prm`. + +`gh pr merge` is a bare, unchained Bash call; if denied, stop and report. + + ## Notes - This skill ships **library source only** — workspace scripts/notebooks go diff --git a/skills/ship_workspace/ship_workspace.md b/skills/ship_workspace/ship_workspace.md index a1ba435e..39e17429 100644 --- a/skills/ship_workspace/ship_workspace.md +++ b/skills/ship_workspace/ship_workspace.md @@ -93,12 +93,33 @@ to the PR body (`../ship_library/reference.md` → "Validation checklist `PyAutoMind/autonomy_log.md` (its **first** table, never the Shadow window at the end — `../ship_library/reference.md` → "Which table"), set `active.md` to awaiting-merge. Failed leg → -park per [`../../AUTONOMY.md`](../../AUTONOMY.md). Step 5's merge is skipped -entirely — merge stays human. +park per [`../../AUTONOMY.md`](../../AUTONOMY.md). Step 5's offered merge is +skipped entirely — the only merge is step 4b's tiered one. + +### 4b. Merge by declared tier (post-PR-open) + +Who merges follows the prompt's **declared** `Consequence:` header — +[`../../AUTONOMY.md`](../../AUTONOMY.md) "Merge authority follows Consequence +— 2026-10-02" is the rule; this step only routes to it: + +- **`notify`**, or **`glance` with the `Witness:` check passed**, and the + approved plan (or `--auto` / batch launch) stated `auto-merge on green` → + wait for CI **inside this turn** (one background `gh pr checks --watch`, + capped ~60 min; no timer, wake-up or subscription), then run the + [`/prm`](../prm/prm.md) procedure from its step 2 — judge, merge, close-out — + exactly as a human-typed `/prm` would — the library-first gate included (a + workspace PR whose library PR is not `MERGED` stops there). For `glance`, the close-out appends + the Shadow-window row and the ledger ends with the post-merge summary. +- **`judge`, no declared header**, a `decision-taken` PR, a Heart RED-override + or corrective-PR-exception ship, or any red / pending-at-cap / conflicting / + SKIPPED leg → **stop at PR-open**; the human runs `/prm`. + +`gh pr merge` is a bare, unchained Bash call; if denied, stop and report. ### 5. Merge (library-first gate) -Offer to merge (never force). If linked to an upstream library PR, enforce the +Reached only when step 4b did not merge. Offer to merge (never force). If +linked to an upstream library PR, enforce the **library-first merge gate** — the library PR must be `MERGED` before the workspace PR may merge; refuse otherwise (no `gh pr merge --auto`-flag workaround — unrelated to the workflow's `--auto` mode, which never merges). diff --git a/skills/start_dev/start_dev.md b/skills/start_dev/start_dev.md index d0a95fbe..f08eafaf 100644 --- a/skills/start_dev/start_dev.md +++ b/skills/start_dev/start_dev.md @@ -55,7 +55,8 @@ activation rule in [`../../AUTONOMY.md`](../../AUTONOMY.md)): 3. **`supervised`** → the **ship checkpoint does not park**: it resolves to decide-and-flag ([`../../AUTONOMY.md`](../../AUTONOMY.md), "Decide-and-flag") — ship through the autonomous-ship gate, flag the - decision in the PR body, and **end at PR-open** (merge stays human). Every + decision in the PR body, and **end at PR-open** (a `decision-taken` PR is + never auto-merged, whatever its tier). Every *other* judgment gate — a scope/design fork the plan didn't settle, a second flagged decision, a hard blocker — still becomes a batched issue question with an `awaiting-input` park (the contract's "Checkpoint-and-continue" @@ -67,7 +68,9 @@ activation rule in [`../../AUTONOMY.md`](../../AUTONOMY.md)): ship gate's leg 4 reads it; it never extends to new reasons. Everything downstream (`ship_*` under `--auto`) is gated by the four-leg -autonomous-ship gate and **ends at PR-open** — merge stays a human act. +autonomous-ship gate and **ends at PR-open** — or, for a declared `notify` / +witnessed `glance` task, at the in-turn tiered merge, which the `--auto` or +batch launch approval authorizes (the plan's tier + merge-mode line, step 3). Default runs without the flag are unchanged: present-and-wait. Resolve paths once using [CONTEXT.md](../CONTEXT.md). Read only the reference @@ -145,6 +148,22 @@ Two levels: a **high-level** plan (3–8 plain-English bullets, no code) and a trade-offs, testing approach). The detailed plan must be good enough that a fresh session could start from the issue alone. +The high-level plan ends with one **tier + merge mode** line — the prompt's +**declared** `Consequence:` (never a sizing-inferred one) and what happens at +PR-open, per [`../../AUTONOMY.md`](../../AUTONOMY.md) "Merge authority follows +Consequence — 2026-10-02": + +``` +Tier: notify — merge mode: auto-merge on green (in-turn wait, then /prm close-out) +Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary +Tier: judge (or undeclared) — merge mode: human /prm +``` + +**Approving the plan authorizes that merge mode** — no second ask at PR-open. +A plan without the line authorizes no merge. A multi-phase epic's approval +chains each auto-merged phase into the next without re-asking, stopping at a +`judge`-tier phase, a failure, Heart RED or scope the plan did not name. + ### 4. Survey branches Run the **branch survey** ([`reference.md`](reference.md) → "Branch survey")