From 3e796949e6eb5924e13c58776162c782e9c2615b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 16:37:10 +0000 Subject: [PATCH] skills: trim the start_dev and /prm mandatory reads (token load, levers 5-6) Measured by PyAutoMind scripts/token_load.py (entry + body + CONTEXT.md + WORKFLOW.md): - start_dev 499 -> 360 lines (target 350; CI budget 400 now passes) - /prm 456 -> 338 lines (target 300; CI budget 450 now passes) No gate, refusal or rule removed. Conditional material moves verbatim into the reference files the skills already point at: start_dev's --auto contract and prompt-path edge cases -> start_dev/reference.md; /prm's wait-step incident history and closing notes -> prm/reference.md. WORKFLOW.md (181 -> 117) and CONTEXT.md (68 -> 61) are tightened in place, keeping every test-pinned phrase. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016nhQ8MapiJKa7vatHsEsZH --- skills/CONTEXT.md | 83 ++++++------- skills/WORKFLOW.md | 224 ++++++++++++---------------------- skills/prm/prm.md | 221 +++++++++++++-------------------- skills/prm/reference.md | 25 ++++ skills/start_dev/reference.md | 47 +++++++ skills/start_dev/start_dev.md | 214 +++++++++++--------------------- 6 files changed, 350 insertions(+), 464 deletions(-) diff --git a/skills/CONTEXT.md b/skills/CONTEXT.md index 08c56d59..aa8770e3 100644 --- a/skills/CONTEXT.md +++ b/skills/CONTEXT.md @@ -1,15 +1,14 @@ # Context and output discipline -Read this once for development or review. It changes how evidence is loaded, -not any approval, test, independent-review, Heart or release requirement. +Read once for development or review. It changes how evidence is loaded, never +an approval, test, independent-review, Heart or release requirement. ## Resolve locations once -Repository names in prose (for example `PyAutoMind/active.md`) identify a -repository-relative file, not a fixed workspace-root path. Main checkouts may -be grouped under `organs/`, `lens/`, etc.; task bundles and remote clones may -be flat. Use the manifest-backed resolver already in Brain. From the **Brain -checkout** (locate it using the workspace routing map): +`PyAutoMind/active.md` in prose names a repository-relative file, not a fixed +path: main checkouts may be grouped (`organs/`, `lens/`, …), task bundles and +remote clones flat. From the **Brain checkout** use the manifest-backed +resolver: ```bash source bin/_pyauto_root.sh @@ -18,51 +17,45 @@ export PYAUTO_BRAIN="$(pyauto_repo_path PyAutoBrain "$PYAUTO_ROOT")" export PYAUTO_MIND="$(pyauto_repo_path PyAutoMind "$PYAUTO_ROOT")" ``` -Keep these paths for the current checkout. Resolve other repositories only when -needed, with `pyauto_repo_path "$PYAUTO_ROOT"`; use `--required` with -`agents/_repo_paths.py path` when existence is mandatory. Re-resolve after -changing worktree/root or moving checkouts. Do not reuse main paths inside a -task bundle. Run Mind's `scripts/lifecycle.py` from the resolved Mind checkout. -On a GitHub-only surface use repository identity and API paths, not shell setup. +Resolve other repos only when needed (`pyauto_repo_path "$PYAUTO_ROOT"`; +`agents/_repo_paths.py path --required` when existence is mandatory). +Re-resolve after changing worktree/root; never reuse main paths inside a task +bundle. Run `scripts/lifecycle.py` from the resolved Mind checkout. On a +GitHub-only surface use repository identity and API paths, not shell setup. ## Read the applicable procedure -- Load the workspace rules, target repo instructions and invoked skill once. - Reuse them while unchanged. Refresh after an instruction edit, branch/root - change or compaction that lost a required rule; do not assume missing context. -- Reference files are indexes: locate headings, then read the current section. - Do not concatenate every reference at startup. Select the local or remote - lane once. Load linked-library instructions only for a linked task, autonomy - details only when applicable, and post-merge close-out only after merging. -- Never replace an independent review with the author's summary. Give the - reviewer a bounded scope and direct access to the diff and supporting evidence. +- Load workspace rules, target-repo instructions and the invoked skill once; + reuse them while unchanged. Refresh after an instruction edit, a branch/root + change or a compaction that lost a required rule — never assume it. +- Reference files are indexes: find the heading, read that section. Select the + local or remote lane once. Load linked-library instructions, autonomy detail + and the post-merge close-out only when they apply. +- Never replace an independent review with the author's summary; give the + reviewer a bounded scope and direct access to the diff and evidence. ## Bound tool results -- Search paths first (`rg --files`), then scoped text (`rg -n`), then the relevant - lines. Do not dump every sibling's instructions or entire registries. -- For routine status, use diff statistics, selected JSON fields, pass/fail - counts and failure excerpts. Default to roughly 1–2k output tokens per call; - raise the limit deliberately when the decision needs more evidence. -- Save full test/build logs in the task's ignored scratch directory. Return - exit status, counts and the relevant failure tail, with a log path. Preserve - the command's exit code; a successful `tail` must not mask a failed test. -- If output is truncated, narrow the query. Never assume the missing part was - clean. Keep exact gate reasons and complete review findings available. -- Batch independent reads. Do not repeat an unchanged successful check without - changed inputs or a gate requiring it. Reuse a worker for coherent fixes; - communicate milestones or actionable findings, not repeated status requests. +- Paths first (`rg --files`), then scoped text (`rg -n`), then the lines that + matter; never dump every sibling's instructions or whole registries. +- Routine status: diff stats, selected JSON fields, pass/fail counts, failure + excerpts — about 1–2k output tokens per call unless the decision needs more. +- Save full test/build logs in the task's ignored scratch directory; return + exit status, counts, the failure tail and the log path. Preserve the exit + code — a successful `tail` must not mask a failed test. +- Truncated output: narrow the query; never assume the rest was clean. Keep + exact gate reasons and complete review findings available. +- Batch independent reads; do not repeat an unchanged successful check. Reuse a + worker for coherent fixes; report milestones and findings, not status pings. ## Completed-phase handoff -At a completed phase, refresh the existing issue/Mind task record with: +At a completed phase, refresh the issue/Mind task record in about 10–20 lines: objective and remaining scope; accepted decisions and authorizations; worktree, -branch and commit; changed files; validation results with log paths; open risks -or review findings; and the next concrete action. Keep this to a short section -(about 10–20 lines), linking evidence instead of copying logs or chat history. - -Continue already-authorized work in the current turn. Do not stop solely to -force a fresh chat, start a replacement session automatically, or treat a -handoff as new approval. When the user resumes in a fresh session, load that -record and verify the current branch/claims before continuing. A handoff never -carries expired merge authority, clears a gate, or replaces independent review. +branch and commit; changed files; validation with log paths; open risks or +findings; the next concrete action. Link evidence, do not copy logs. Continue +already-authorized work in the current turn — never stop just to force a fresh +chat, never auto-start a replacement session, never treat a handoff as new +approval. A resumed session loads that record and verifies the branch and +claims first. A handoff never carries expired merge authority, clears a gate +or replaces independent review. diff --git a/skills/WORKFLOW.md b/skills/WORKFLOW.md index b4d9e6f9..9f9612a0 100644 --- a/skills/WORKFLOW.md +++ b/skills/WORKFLOW.md @@ -1,173 +1,109 @@ # PyAuto workflow skills — shared reference The `start_*` and `ship_*` skills are entry points, not independent reasoning -systems. Mind owns task state, Brain plans and coordinates, Memory supplies -read-only context, Heart gates shipping, and Hands handles releases only. - -Read [CONTEXT.md](CONTEXT.md) once for bounded reads/output, phase handoffs and -grouped/flat path resolution. Reuse unchanged instructions already loaded. - -## Call chains +systems: Mind owns task state, Brain plans and coordinates, Memory supplies +read-only context, Heart gates shipping, Hands handles releases only. Read +[CONTEXT.md](CONTEXT.md) once; reuse unchanged instructions already loaded. ```text -start_dev → Brain feature decision → Mind task + plan → start_library/workspace -ship_* → Brain review/vitals → Heart gate → commit/push/feature PR -release → Brain release decision → Heart gate → Hands -``` - -Development worktrees, commits, and feature PRs belong to the dev workflow, -not Hands. Autonomy checkpoints are defined once in `../AUTONOMY.md`; default -runs present and wait, while explicit `--auto` runs follow that contract. - -## Brain entry points - -```bash -bin/pyauto-brain feature -bin/pyauto-brain review --task -bin/pyauto-brain vitals -bin/pyauto-brain build --dry-run +start_dev → Brain feature decision → Mind task + plan → start_library/workspace +ship_* → Brain review/vitals → Heart gate → commit/push/feature PR +release → Brain release decision → Heart gate → Hands ``` -If Brain is unavailable, emulate the requested decision from its `AGENTS.md` -and this file, and say that it was emulated. +Worktrees, commits and feature PRs belong to the dev workflow, not Hands. +Autonomy checkpoints live once in `../AUTONOMY.md`: default runs present and +wait; explicit `--auto` runs follow that contract. Brain entry points: +`bin/pyauto-brain feature `, `review --task `, `vitals`, +`build --dry-run`; if Brain is unavailable, emulate the decision from its +`AGENTS.md` and this file and say it was emulated. ## Orchestration capabilities and execution evidence -The **orchestration environment** is the scientist-facing session currently -driving the task. The **execution environment** is wherever a particular phase -obtains the evidence it needs. They may be the same place, but they need not be. -Neither is an organ and neither owns task state: Mind remains the sole lifecycle -record. - -Reason about capabilities, not product names. Probe the current surface once and -use only capabilities it actually exposes: - -- `repository-read` / `repository-write` — inspect or change repository files; -- `github-control` — branches, commits, issues, PRs, reviews and Actions state; -- `local-filesystem` / `shell-runtime` — checkout-local files, commands and imports; -- `test-execution` — unit/integration/smoke commands in a real runtime; -- `worktrees` — isolated local task checkouts; -- `independent-review` — a reviewer genuinely independent of the authoring context; -- `remote-compute` — SSH/HPC/GPU or other environment-specific execution. - -A model/provider/app name does not imply any item in that list. In particular, a -connected Chat surface may expose read-only GitHub access, read/write GitHub -actions, or no GitHub action at all. Detect what is present; fail closed on what -is absent. - -For each phase, identify the **required evidence** first. Stay in the current -orchestration environment when its capabilities can honestly produce it. An -existing repository CI workflow on the exact branch head may provide applicable -test/smoke evidence when it runs the required scope; verify the head SHA and -individual legs rather than treating "CI green" as a generic proof. Do not add a -throwaway workflow merely to obtain a shell. - -When a capability is missing, delegate the **smallest coherent phase** that -needs it and return its diff/commit plus decision-relevant evidence to the same -Mind task. If substantial implementation itself is runtime-dependent -(scientific/numerical debugging, profiling, HPC, environment inspection, -generated artefacts), route that coherent phase to an execution environment -from the outset; Chat or another orchestration surface can still retain the -Brain decisions and user conversation. - -When the selected workflow path requires independent review, it is evidence, -not a second look by the author: the same conversation that wrote a branch -cannot self-certify the review faculty's independence. That requirement is -path-specific — notably the review-faculty leg of the `--auto` -autonomous-ship gate and the independent-adversary cases defined by -`AUTONOMY.md` — not a universal prerequisite for an ordinary human-approved -merge. When the active path actually requires it, delegate only the review -phase, or require human review if no independent reviewer is available. - -**Heart remains separate from CI.** Exact-head CI can satisfy applicable test or -smoke evidence; it never substitutes for the authoritative Heart verdict. If the -current surface cannot read fresh authoritative Heart evidence, obtaining that +The **orchestration environment** drives the task with the scientist; the +**execution environment** is wherever a phase obtains its evidence. They may +differ; neither is an organ or owns task state (Mind does). Probe the current +surface once for capabilities, never product names — `repository-read` / +`repository-write`, `github-control`, `local-filesystem` / `shell-runtime`, +`test-execution`, `worktrees`, `independent-review`, `remote-compute` — and +fail closed on what is absent (a connected Chat surface may have read-only, +read/write or no GitHub action). + +Per phase, name the **required evidence** first and stay where the current +capabilities can honestly produce it. Exact-head CI on the branch can supply +applicable test/smoke evidence (verify the head SHA and each leg); never add a +throwaway workflow to get a shell. When a capability is missing, delegate the +**smallest coherent phase** that needs it and return its diff plus evidence to +the same Mind task; route runtime-dependent implementation (numerical +debugging, profiling, HPC, generated artefacts) to an execution environment +from the outset. + +Independent review, where the path requires it (the review-faculty leg of the +`--auto` ship gate; the independent-adversary cases in `AUTONOMY.md`), is +evidence: the conversation that wrote a branch cannot self-certify it. Delegate +only that phase, or require human review. It is not a prerequisite for an +ordinary human-approved merge. **Heart remains separate from CI:** exact-head +CI never substitutes for the authoritative Heart verdict; reading fresh Heart evidence is itself a bounded missing-capability step. -`Lane:` remains an intrinsic scheduling requirement (`any` or `local-dev`) -for a task that genuinely needs local data/output/SSH resources. It is not the -name of the orchestrating product and must not grow a `chatgpt`, `codex` or -`claude` value. - -**No OpenAI API fallback** — see [`MODEL_DELEGATION.md`](MODEL_DELEGATION.md). - -## Model delegation - -Read [`MODEL_DELEGATION.md`](MODEL_DELEGATION.md) before assigning a worker. +`Lane:` stays an intrinsic scheduling requirement (`any` or `local-dev`); it +must not grow a `chatgpt`, `codex` or `claude` value. **No OpenAI API +fallback** — and worker assignment — see +[`MODEL_DELEGATION.md`](MODEL_DELEGATION.md); read it before assigning a worker. ## Memory and planning For substantial architectural or scientific planning, consult `bin/pyauto-brain memory ""`, read only the cited pages, and proceed -honestly when it has no matches. PyAutoMemory citations never enter public -user-facing output. - -`start_dev` produces both a short human plan and a detailed issue plan, surveys -only affected repos, then uses Mind's `create_issue` primitive. Do not duplicate -issue or lifecycle mechanics in Brain. +honestly when it has no matches; PyAutoMemory citations never enter public +user-facing output. Issue and lifecycle mechanics stay with Mind's +`create_issue` primitive and scripts, never duplicated in Brain. ## Heart gate -**At the door:** development entry (`start_dev` step 0a "Heart at the door", -mirrored by `route`) first reads the Heart's published feed -with the read-only `bin/heart_feed.py` — RED stops before planning, YELLOW/STALE -warn and continue. It is a light early read, never a tick; the ship-time gate -below is unchanged and still authoritative. - -Before `ship_*`, use the vitals faculty for the authoritative verdict: - -- GREEN: continue. -- YELLOW: show exact reasons and require the acknowledgement defined by the - autonomy contract. -- STALE: may pass for development only as defined by the canonical Heart - contract; it remains a release blocker. -- RED: stop. After the exact reason strings are quoted verbatim from the - current Heart verdict and validation is shown, a live human may use - `AUTONOMY.md` "Human override for Heart RED (development only)" or the - narrower "Corrective-PR exception for Heart RED". Neither permits a release, - CI bypass, or merge. - -Applicable tests, downstream smoke checks for public API changes, and Heart -remain the ordinary development evidence. Review requirements depend on the -selected path: under `--auto`, the autonomous-ship gate requires -review-faculty `CLEAN` as defined by `AUTONOMY.md`; the independent-adversary -leg remains limited to the batch/experiment cases defined there. For an -ordinary human-approved ship/merge, a separate review-faculty `CLEAN` verdict -is **not a universal prerequisite** unless another explicit repository, -branch-protection, or task rule requires it. Merge is always a current human -action and still requires the applicable GitHub checks. +**Heart at the door:** development entry (`start_dev` step 0a, mirrored by +`route`) reads the Heart's published feed with the read-only +`bin/heart_feed.py` — RED stops before planning, YELLOW/STALE warn and +continue. A light early read, never a tick; the ship-time gate stays +authoritative. + +Before `ship_*`, the vitals faculty gives the verdict: GREEN continues; YELLOW +shows exact reasons and needs the autonomy-contract acknowledgement; STALE may +pass for development only (still a release blocker); RED stops. After the exact +reason strings are quoted verbatim from the current Heart verdict and +validation is shown, a live human may use +`AUTONOMY.md` "Human override for Heart RED (development only)" or the narrower +"Corrective-PR exception for Heart RED" — neither permits a release, CI bypass +or merge. + +Ordinary development evidence is applicable tests, downstream smoke checks for +public API changes, and Heart. For review, under `--auto` the autonomous-ship +gate requires review-faculty `CLEAN` (`AUTONOMY.md`); for an ordinary human-approved +ship/merge it is **not a universal prerequisite** unless a repository, +branch-protection or task rule says so. Merge is always a current human action +and still requires the applicable GitHub checks. ## Cross-harness behavior -- `/name` means use that skill; skill-aware harnesses follow its `SKILL.md`. -- Plan Mode means present-and-wait unless explicit `--auto` changes that gate. -- With no prompt, first create a concise Mind draft containing the original - request verbatim. -- If a requested worker is unavailable, execute directly only when the current - surface has the required capability; otherwise use the bounded cross-environment - handoff in `MODEL_DELEGATION.md` or stop without weakening any gate. -- `gh` commands name GitHub operations; map those operations onto the authenticated - GitHub-control surface actually available via `GITHUB_ACCESS.md`. +`/name` means use that skill (`SKILL.md`); Plan Mode means present-and-wait +unless explicit `--auto`; with no prompt, first write a Mind draft holding the +request verbatim. An unavailable worker → execute directly only where the +surface has the capability, else the bounded handoff in `MODEL_DELEGATION.md` +or stop, never weakening a gate. `gh` commands name GitHub operations; map them +onto the surface actually available via `GITHUB_ACCESS.md`. ## Task state and worktrees -Mind paths are relative to its resolved checkout: `active.md`, `planned.md`, -and prompt lifecycle `draft/ → active/ → complete/YYYY/MM/`. Use Mind's -lifecycle and prompt-sync scripts; do not hand-roll state transitions. - -Local tasks use the Brain checkout's `bin/worktree.sh` and -`feature/` branches. `worktree_check_conflict` fails closed when it -cannot read the registry, and warns (exit unchanged) on on-disk worktrees no -`active.md`/`parked.md` claim covers; `worktree_audit_orphans` is the -report-only sweep. A repo bullet beneath an active task's `repos:` is a -claim; tasks touching the same repo serialize unless a human explicitly -authorizes coordination. Source the generated `activate.sh` before Python or -tests. - -In web/CI sessions with clones, use those clones and explicit cache/PYTHONPATH -settings. A GitHub-control-only session may have no clone at all: it operates on -remote branches/files and records no fake `worktree:` path. The same Mind -registry and branch/commit provide continuity across environments. +Mind paths are relative to its resolved checkout (`active.md`, `planned.md`, +`draft/ → active/ → complete/YYYY/MM/`); use Mind's lifecycle and prompt-sync +scripts, never hand-rolled transitions. Local tasks use `bin/worktree.sh` and +`feature/` branches: `worktree_check_conflict` fails closed when it +cannot read the registry and warns on unclaimed on-disk worktrees; +`worktree_audit_orphans` is the report-only sweep. A repo bullet under an +active task's `repos:` is a claim; tasks on the same repo serialize unless a +human authorizes coordination. Source the generated `activate.sh` before +Python or tests. Web/CI sessions use their clones; a GitHub-control-only +session operates on remote branches and records no fake `worktree:` path. ## Repository routing diff --git a/skills/prm/prm.md b/skills/prm/prm.md index 40efaa4c..f329b3d5 100644 --- a/skills/prm/prm.md +++ b/skills/prm/prm.md @@ -1,19 +1,16 @@ # /prm — PR, CI green, then merge -The last thing you type for a task: watch the feature PR's checks, merge the -moment they are genuinely green, then close the task out — issue closed, prompt -moved `active/` → `complete/`, `dashboard.md` reconciled and regenerated, -worktree and local branches removed — and hand back a ledger. - -Load this procedure once. Skip the MCP lane on local CLI; on MCP skip local -command recipes. Read the close-out only after merging. Reuse unchanged -references already loaded. Each step below has a matching section in [`reference.md`](reference.md) carrying -its commands, failure signatures and reasoning (the close-out's sub-steps are its -numbered §1-7); read it when you run the step. -Routing: `PyAutoBrain/skills/COMMANDS.md`. `/prm` sequences owners it never -second-guesses ([`SKILL.md`](SKILL.md)): never re-running the readiness gate, -never editing code to make a check pass, never opening a PR (that is `/ship_*`), -never hand-writing a generated page. +The last thing you type for a task: judge the feature PR's checks, merge when +they are genuinely green, then close the task out — issue closed, prompt moved +`active/` → `complete/`, `dashboard.md` regenerated, worktree and local +branches removed — and hand back a ledger. + +Each step has a matching section in [`reference.md`](reference.md) (the +close-out's sub-steps are its §1-7); read it when you run the step, and the +close-out only after merging. `/prm` sequences owners it never second-guesses +([`SKILL.md`](SKILL.md)): it never re-runs the readiness gate, edits code to +make a check pass, opens a PR (that is `/ship_*`) or hand-writes a generated +page. Routing: `PyAutoBrain/skills/COMMANDS.md`. ## Usage @@ -27,9 +24,7 @@ never hand-writing a generated page. ## Environment: decide your GitHub surface first -Steps below are written as `gh` commands because that names each operation most -clearly; without `gh` they are the *operation*, not the command. Probe once, and -remember the answer — it is the only probe this run needs: +Probe once and remember the answer: ```bash command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1 \ @@ -38,147 +33,105 @@ command -v gh >/dev/null 2>&1 && gh auth status >/dev/null 2>&1 \ - **`gh`** (local CLI) — `$PYAUTO_ROOT` (`bin/_pyauto_root.sh`) holds the sibling repos; branch detection and worktree cleanup are available. -- **`mcp`** (a session without authenticated `gh`) — when no local multi-repo - checkout is available, GitHub is the `mcp__github__*` surface, mapped step by step in - [`../GITHUB_ACCESS.md`](../GITHUB_ACCESS.md). Drive every step through it, - **skip the local-only cleanup** with a one-line note, never `cd` into a repo - that isn't there, and never report the close-out blocked for want of `gh`. - `/prm` **deletes no remote branch on any surface** (step 5.6), so nothing here - needs the second probe that step used to carry. - -On MCP, read [mcp.md](mcp.md) for the exact calls; do not load local recipes. +- **`mcp`** — GitHub is the `mcp__github__*` surface, mapped in + [`../GITHUB_ACCESS.md`](../GITHUB_ACCESS.md): read [mcp.md](mcp.md) for the + exact calls (not the local recipes), skip the local-only cleanup with a + one-line note, never `cd` into a repo that isn't there, and never report the + close-out blocked for want of `gh`. `/prm` deletes no remote branch on any + surface (step 5.6). ## 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". +"Merge authority follows Consequence"). Run from step 2, 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 -task in `PyAutoMind/active.md` (its `library-pr:` / `workspace-pr:` entries; with -no checkout read it through `gh api` or `get_file_contents`) → `gh pr list` -across the claimed repos. If more than one candidate survives, **list them -numbered and ask once** — never guess which PR to merge. Report each as -`owner/repo#N — title — branch` first. A task that shipped both a library and a -workspace PR is **one** `/prm` run over both, merged in gate order (step 4). +Explicit argument → current branch (`gh pr view --json`) → the claimed task's +`library-pr:` / `workspace-pr:` in `PyAutoMind/active.md` → `gh pr list` across +the claimed repos. More than one candidate → **list them numbered and ask +once**; never guess. Report each as `owner/repo#N — title — branch`. A task with +a library and a workspace PR is **one** run over both, in gate order (step 4). ## 2. Judge CI honestly — every run, every leg -A head sha triggers **two** runs of each workflow (`push` and `pull_request`), -each with its own matrix legs, so one green row is not "CI green": enumerate -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. +A head sha triggers **two** runs per workflow (`push` and `pull_request`), each +with matrix legs: enumerate every run for the sha and every job; anything not +`completed` is *not ready*, and an empty run list is not green. Read +`mergeable` / `mergeStateStatus`: `UNSTABLE` is pending-or-red, and +`CONFLICTING` / `BEHIND` / `BLOCKED` stops the run whatever the checks say. A +test leg `skipped` is **not green** — name it; a tiered merge stops on it. ## 3. Wait, or stop -- **Pending** — wait only by a mechanism that ends with this turn. That is an - 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 - **end the turn** and tell the human to re-run `/prm` once CI is green. - Never `subscribe_pr_activity`, never `send_later`, never a routine, cron - or wake-up: **sessions end at their deliverable** - (`PyAutoMind/policy/end_at_deliverable.md`). A mobile `/prm` that armed a - subscription and an hourly check-in kept renewing it all night with no task - active and drained a day's usage (2026-09-03, 02:39 → 12:11 UTC); five - batch members did the same on 2026-08-31. Waiting for CI is the human's - next `/prm`, not a timer this session leaves running. - - **Poll (local CLI).** Every ~90s, one compact line per poll - (`3/4 legs done`), capped at ~30 min — the poll must finish **inside this - turn**, and that cap is what guarantees it does. Then report where it - stands rather than spinning. No mechanism may outlive the turn: if the cap - is reached, stop and hand back, exactly as the mobile lane does. -- **Red** — **fetch the failing job's log immediately** (GitHub purges the blob; - once purged the failure is unnameable forever), quote the failing step, and - stop. Do not merge, do not re-run, do not "wait for the flake to pass". Offer - `/bug`, or a named re-run if the user judges it a flake — their call, not yours. +- **Pending** — wait only by a mechanism that ends with this turn. Under + `--no-wait`, judge once, report and stop. + - **Stop (mobile, web — required there).** Report each PR's state (per-leg + counts, `2/4 legs done`, red or pending named), **end the turn** and tell + the human to re-run `/prm` once CI is green. Never `subscribe_pr_activity`, + never `send_later`, never a routine, cron or wake-up: **sessions end at + their deliverable** (`PyAutoMind/policy/end_at_deliverable.md`; the + incidents are in [`reference.md`](reference.md) → "Why the wait ends with + the turn"). Waiting for CI is the human's next `/prm`. + - **Poll (local CLI).** Every ~90s, one compact line per poll, capped at ~30 + min so it finishes **inside this turn**; at the cap, stop and hand back. + (A tiered merge's ~60-min watch is the one other in-turn wait.) +- **Red** — **fetch the failing job's log immediately** (GitHub purges it), + quote the failing step, and stop: no merge, no re-run, no waiting for the + flake. Offer `/bug`, or a named re-run if the user judges it a flake. - **No checks configured** — say so explicitly and ask before merging. ## 4. Merge -Green on every leg → merge, in this order: - -**PRs shipped under the Heart RED development override.** The shipping grant -alone is not merge authority. Require a separate explicit human merge command -and every required GitHub check green; never force, override protection, or -treat Heart RED as cleared. A live message may authorize both shipping and -merge, but that merge grant lasts only for the current turn. If the turn ends -before checks are green, it expires: arm no waiter or auto-merge, stop, and -require the human to invoke `/prm` again. This permission never reaches a -release or release rehearsal. - -1. **Library freeze gate:** for library PRs, read [freeze.md](freeze.md) and - check Heart's freeze flag. Stop when frozen unless the human supplied - `--thaw ""`; record that override. Never thaw past red CI. -2. **Library PR first.** The workspace PR may not merge until its upstream - 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) - — 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 - hygiene: if the harness's routine list shows a subscription or a - `send_later` reminder on a target PR, drop it (`unsubscribe_pr_activity`, - cancel the reminder). Never create one. - -Never force, never override a protection, never rewrite history. If a merge is -refused by GitHub, report the reason verbatim and stop. +Green on every leg → merge, in this order. + +**PRs shipped under the Heart RED development override:** the shipping grant +is not merge authority. Require a separate explicit human merge command and +every required GitHub check green; never force, override protection, or treat +Heart RED as cleared. A live message may authorize both shipping and merge, +but that merge grant lasts only for the current turn: if the turn ends before +checks are green it expires — arm no waiter or auto-merge, stop, and require +the human to invoke `/prm` again. This never reaches a release or rehearsal. + +1. **Library freeze gate:** for library PRs read [freeze.md](freeze.md) and + check Heart's freeze flag; stop when frozen unless the human supplied + `--thaw ""` (record it). Never thaw past red CI. +2. **Library PR first.** A workspace PR may not merge until its upstream library + PR is `MERGED` ([`../ship_workspace/reference.md`](../ship_workspace/reference.md)); + no `--auto`-flag workaround. +3. `gh pr merge --merge` per PR (`-R owner/repo` without a checkout) — one + bare, unchained call per PR; a denied merge stops the run — then confirm + `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** — a subscription or `send_later` + reminder on a target PR (`unsubscribe_pr_activity`, cancel it). Never create + one. + +Never force, override a protection or rewrite history. A merge GitHub refuses: +report the reason verbatim and stop. ## 5. Close the task out 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 -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. +[closeout.md](closeout.md)** in order: prove each claimed branch merged, close +the issue, `lifecycle.py close`, carry pending-release obligations, the +glance-tier shadow row, reconcile and regenerate the dashboard, then remove the +worktree and local branches. No close-out on partial evidence. A task with no +issue, prompt or worktree skips those sub-steps and says so; the dashboard +regen is skipped only when the close-out wrote nothing to Mind. ## 6. The only guards that stop you -Stop and report instead of pressing on when: - -- a branch in the task is **unmerged** with no open PR (step 5.1) — the waves trap; -- Heart's **freeze** is active and a target PR is in a library repo (step 4), - and no `--thaw ""` was given; +- a branch in the task is **unmerged** with no open PR (step 5.1); +- Heart's **freeze** is active for a library PR and no `--thaw ""` was given; - `worktree_remove` **refuses** (dirty repo, stale claim) — fix the cause, never - `PYAUTO_WT_FORCE=1` past it; + `PYAUTO_WT_FORCE=1`; - the worktree holds **gitignored data products** (reduced datasets, caches, - `output/` fits) — removal destroys them, and they may not be cheaply - re-derivable. List them with sizes and **ask once**: delete, or keep the - worktree and finish the rest. `/prm`'s only question, and only when they exist. - -## Notes - -- `/prm` merges an **existing** PR. No PR yet → `/ship_library` or - `/ship_workspace` first; `/prm` will say so rather than opening one. The one - exception is Mind's own close-out commit, which needs no PR at all: pushing - the branch is what lands it (step 5.4). -- It never bypasses the Heart readiness gate — that ran at ship time, and a red - 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". 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 - to Mind at all: re-rendering a current tree is a clean-`git status` no-op, so - when in doubt run it. + `output/` fits) — list them with sizes and **ask once**: delete, or keep the + worktree and finish the rest. `/prm`'s only question. + +More notes (no PR yet, Mind's own close-out, freeze vs readiness): +[`reference.md`](reference.md) → "Notes (moved from prm.md)". diff --git a/skills/prm/reference.md b/skills/prm/reference.md index 5adfebeb..4597d96a 100644 --- a/skills/prm/reference.md +++ b/skills/prm/reference.md @@ -455,3 +455,28 @@ dashboard: regenerated (dashboard.md + dashboard.html, same commit as the record standing: draft/bug/priors/14_replace_transform_stack_with_bijectors.md — resemblance only → /intake reconcile draft/bug/priors ``` + +## Why the wait ends with the turn + +A mobile `/prm` that armed a subscription and an hourly check-in kept renewing it all night with no task active and drained a day's usage (2026-09-03, 02:39 → 12:11 UTC); five batch members did the same on 2026-08-31. + +## Notes (moved from prm.md) + + +- `/prm` merges an **existing** PR. No PR yet → `/ship_library` or + `/ship_workspace` first; `/prm` will say so rather than opening one. The one + exception is Mind's own close-out commit, which needs no PR at all: pushing + the branch is what lands it (step 5.4). +- It never bypasses the Heart readiness gate — that ran at ship time, and a red + 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". 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 + to Mind at all: re-rendering a current tree is a clean-`git status` no-op, so + when in doubt run it. diff --git a/skills/start_dev/reference.md b/skills/start_dev/reference.md index 6ed246bc..d8041aee 100644 --- a/skills/start_dev/reference.md +++ b/skills/start_dev/reference.md @@ -218,3 +218,50 @@ Resume metadata must describe the active harness. Record `codex resume ` or `claude --resume ` only when that harness and its real session ID are known; otherwise retain the known harness and mark the ID unavailable. Preserve earlier session records verbatim when resuming work from another harness. + +## Prompt-path edge cases + +If the user gives a development task with **no** prompt path, first write a +concise prompt file under the resolved Mind checkout’s `draft///` folder +(include the original request verbatim), then continue with that path. Never +write one under `human_review/` — that folder is shipped work awaiting a human's +sign-off, not work to start, and it is filed only by an explicit `/intake` +declaration. + +A `draft/human_review/…` path handed to `/start_dev` is almost certainly a +mistake: the work it names already shipped. Say so and offer the review (read +the prompt, find the merged PR and the `complete/` record, report back) instead +of opening a worktree — unless the user confirms they want new development, in +which case file that as its own ordinary prompt. + +## --auto mode (read only when launched with `--auto`) + +Only when the human launches with an explicit `--auto` (never ambient — the +activation rule in [`../../AUTONOMY.md`](../../AUTONOMY.md)): + +1. Compute the **effective level** = min(prompt `Autonomy:` header, work-type + cap from the contract); missing header → `human-required`. +2. **`safe`** → skip the Plan-Mode hold: write both plan levels into the issue + (step 5 below) and proceed straight through steps 4–7 and into + `start_library`/`start_workspace` and implementation. The plan the human + would have approved is on the issue for post-hoc validation. +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** (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" + section: question → park → next independent step or task → resume from + `active.md`); mechanical stretches proceed. +4. **`human-required`** → `--auto` changes nothing; today's flow. +5. If the human acknowledged a Heart YELLOW reason set at launch, record that + exact list in the task's `active.md` entry (`- heart-ack:` block) — the + 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** — 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. diff --git a/skills/start_dev/start_dev.md b/skills/start_dev/start_dev.md index f08eafaf..360e0594 100644 --- a/skills/start_dev/start_dev.md +++ b/skills/start_dev/start_dev.md @@ -1,18 +1,12 @@ # Start Dev: Classify, Plan, Register -Universal entry point for starting development work. It reads intent from a -**PyAutoMind** prompt, routes the reasoning through the **PyAutoBrain Feature -Agent** (which consults **PyAutoMemory** for context), creates a tracked GitHub -issue, registers the task in Mind state, and hands off to `/start_library` or -`/start_workspace`. - -This is a **workflow entry point, not an agent** — classification, planning and -risk judgement belong to Brain. Read -[`../WORKFLOW.md`](../WORKFLOW.md) first: it defines the organ boundary, the -Brain-agent entry points, Memory consultation, the execution-environment model, -the provider-aware **model-delegation policy** (Anthropic retains Fable → Opus -and Opus → Opus; OpenAI works inline by default with bounded exceptions), and -the Mind registry paths used below. +Universal entry point for starting development: read a **PyAutoMind** prompt, +route the reasoning through the **PyAutoBrain Feature Agent** (which consults +**PyAutoMemory**), create a tracked issue, register the task in Mind and hand +off to `/start_library` or `/start_workspace`. A workflow entry point, not an +agent — classification, planning and risk judgement belong to Brain. Read +[`../WORKFLOW.md`](../WORKFLOW.md) first (organ boundary, entry points, +execution environments, model delegation, Mind paths). > No `gh` on a remote session — map each `gh` step via [`../GITHUB_ACCESS.md`](../GITHUB_ACCESS.md). @@ -20,58 +14,22 @@ the Mind registry paths used below. ``` /start_dev # path relative to PyAutoMind/ -/start_dev --auto # autonomous mode per ../AUTONOMY.md (see "--auto mode") +/start_dev --auto # autonomous mode per ../AUTONOMY.md ``` -Prompts live under `draft///` (first folder = work type, second = -target repo/domain). Pre-migration `/.md` paths still resolve. -Examples: `draft/bug/autofit/factor_graph_instance_iteration.md`, -`draft/feature/autoarray/oversampling.md`. - -If the user gives a development task with **no** prompt path, first write a -concise prompt file under the resolved Mind checkout’s `draft///` folder -(include the original request verbatim), then continue with that path. Never -write one under `human_review/` — that folder is shipped work awaiting a human's -sign-off, not work to start, and it is filed only by an explicit `/intake` -declaration. - -A `draft/human_review/…` path handed to `/start_dev` is almost certainly a -mistake: the work it names already shipped. Say so and offer the review (read -the prompt, find the merged PR and the `complete/` record, report back) instead -of opening a worktree — unless the user confirms they want new development, in -which case file that as its own ordinary prompt. - -## --auto mode - -Only when the human launches with an explicit `--auto` (never ambient — the -activation rule in [`../../AUTONOMY.md`](../../AUTONOMY.md)): - -1. Compute the **effective level** = min(prompt `Autonomy:` header, work-type - cap from the contract); missing header → `human-required`. -2. **`safe`** → skip the Plan-Mode hold: write both plan levels into the issue - (step 5 below) and proceed straight through steps 4–7 and into - `start_library`/`start_workspace` and implementation. The plan the human - would have approved is on the issue for post-hoc validation. -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** (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" - section: question → park → next independent step or task → resume from - `active.md`); mechanical stretches proceed. -4. **`human-required`** → `--auto` changes nothing; today's flow. -5. If the human acknowledged a Heart YELLOW reason set at launch, record that - exact list in the task's `active.md` entry (`- heart-ack:` block) — the - 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** — 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. +Prompts live under `draft///` (pre-migration +`/.md` still resolves), e.g. +`draft/bug/autofit/factor_graph_instance_iteration.md`. No prompt path → first +write one under `draft///` with the request verbatim (never +under `human_review/`); a `draft/human_review/…` path names shipped work — +offer the review instead ([`reference.md`](reference.md) → "Prompt-path edge +cases"). + +**`--auto`** applies only when the human launches with the flag (never +ambient): read [`reference.md`](reference.md) → "--auto mode" for the +effective-level rules (`safe` skips the plan hold; `supervised` decides-and-flags +at ship and parks other judgment gates; `human-required` changes nothing) and +the launch-time `heart-ack:` record. Without the flag: present-and-wait. Resolve paths once using [CONTEXT.md](../CONTEXT.md). Read only the reference section required by the current step; a prior accepted plan remains approved. @@ -104,54 +62,40 @@ source "${PYAUTO_MIND:-$(test -d organs/PyAutoMind && echo organs/PyAutoMind || prompt_sync_new_prompts # sweep up any new local prompt ideas (no-op if none) ``` -Then scan `PyAutoMind/active.md`: if an entry already matches this prompt/task -(work begun in another session or environment), offer to **resume** it — read the -entry and continue from where it is — instead of starting fresh. `active.md` is -the shared task state, so no special handoff step is needed across environments. +Then scan `PyAutoMind/active.md`: an entry matching this prompt (begun in +another session or environment) → offer to **resume** it from where it is; +`active.md` is the shared state, so no handoff step is needed. ### 1. Read the prompt -Normalize the argument (strip whitespace/backticks/angle-brackets; if it's a -markdown link `[label](path)`, take its target). Resolve Mind once. Accept a -Mind-relative path, or strip the resolved Mind root / its workspace-relative -prefix (`organs/PyAutoMind/` or `PyAutoMind/`) exactly once. Never prepend Mind -to an already resolved path. Read the resulting file inside that checkout. If missing, report and list prompts in that folder. +Normalize the argument (strip whitespace, backticks, angle brackets; a +markdown link → its target). Accept a Mind-relative path, or strip the resolved +Mind root / `organs/PyAutoMind/` / `PyAutoMind/` prefix exactly once — never +prepend Mind to a resolved path. Missing file → report and list that folder. ### 2. Route through the Feature Agent (Brain + Memory) -Hand the prompt to the Brain reasoning layer: - ```bash bin/pyauto-brain feature //.md ``` -The Feature Agent classifies the work (using the work-type folder and the -prompt's `@RepoName` references), **consults PyAutoMemory** for scientific/ -architectural context and prior art, estimates difficulty, decides whether to -phase, and emits a decision the rest of this skill consumes. If `pyauto-brain` -is unavailable (e.g. a GitHub-only session), emulate it inline per WORKFLOW.md: - -- **Classify** by work type and target repos (library vs workspace — see - WORKFLOW.md mapping). Library + workspace → start library, workspace follows. -- **Pull Memory context** for any non-trivial design decision before planning. -- **Explore** the referenced code briefly (classes, callers, existing tests) — - enough for an informed plan, not an exhaustive audit. - -For a non-feature work type with no dedicated agent yet (bug/refactor/docs/…), -apply the closest available reasoning and record the missing agent as a -follow-up; the skill still runs end-to-end. +The Feature Agent classifies (work-type folder + `@RepoName` references), +**consults PyAutoMemory**, estimates difficulty, decides phasing and emits the +decision this skill consumes. Without `pyauto-brain` (e.g. GitHub-only), +emulate it inline per WORKFLOW.md: classify (library + workspace → library +first), pull Memory context for non-trivial design, explore the referenced code +just enough to plan; a work type with no agent uses the closest reasoning and +records the missing agent as a follow-up. ### 3. Produce the plan -Two levels: a **high-level** plan (3–8 plain-English bullets, no code) and a -**detailed** plan (file paths, function/class names, changes per step, key -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": +Two levels: **high-level** (3–8 plain-English bullets, no code) and +**detailed** (file paths, functions/classes, changes per step, trade-offs, +testing) — enough for a fresh session to start from the issue alone. The +high-level plan ends with one **tier + merge mode** line from the prompt's +**declared** `Consequence:` (never sizing-inferred), 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) @@ -159,29 +103,24 @@ Tier: glance — merge mode: auto-merge on green if the Witness passes, post-mer 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. +**Approving the plan authorizes that merge mode**; a plan without the line +authorizes no merge. An epic's approval chains auto-merged phases without +re-asking, stopping at a `judge` phase, a failure, Heart RED or unnamed scope. ### 4. Survey branches -Run the **branch survey** ([`reference.md`](reference.md) → "Branch survey") -for the affected repos: report each repo's branch + dirty state, check worktree -claims, suggest `feature/` (kebab-case, <50 chars), and derive the -worktree root `~/Code/PyAutoLabs-wt//` (created later by -`/start_library`). +Run the **branch survey** ([`reference.md`](reference.md) → "Branch survey"): +each repo's branch + dirty state, worktree claims, a suggested +`feature/` (kebab-case, <50 chars) and the worktree root +`~/Code/PyAutoLabs-wt//` (created by `/start_library`). ### 5. Create the issue via the Mind primitive -Generate a concise title (<70 chars, conventional prefix where apt), then -**delegate the issue write to `/create_issue`** (the PyAutoMind issue+registry -primitive) — pass it the classified primary repo, title, two-level plan, and -suggested branch. It assembles the body, creates the issue (after review), moves -the prompt to `active/`, and pushes Mind. Do **not** re-implement issue creation -here. Registration in `active.md` is conflict-dependent (next step), so tell -`/create_issue` to **skip its active.md registration** — start_dev owns that -routing decision. +Title <70 chars (conventional prefix where apt), then **delegate the issue +write to `/create_issue`** with the primary repo, title, two-level plan and +branch — it assembles the body, creates the issue after review, moves the +prompt to `active/` and pushes Mind. Never re-implement it; tell it to **skip +its active.md registration** (start_dev owns that routing decision). ### 6. Register in Mind + route @@ -194,29 +133,25 @@ source "${PYAUTO_BRAIN:-$(test -d organs/PyAutoBrain && echo organs/PyAutoBrain worktree_check_conflict [repo2 ...] ``` -**GitHub-control-only surface (no clone/worktree):** do not skip the conflict -guard. Read the current `PyAutoMind/active.md` through GitHub and inspect every -other task's `repos:` bullets. Any target repo claimed by another active task -is the same hard conflict the local helper would report. If current Mind state -cannot be read, fail closed; never infer "no conflict" from missing local files. - -- **No conflict, local:** register `status: library-dev | workspace-dev` and the - real `worktree:` path. -- **No conflict, GitHub-control-only:** register the same status, real - `session:` / `location:` metadata and repo branch claims, and record **no fake `worktree:` field**. A later execution environment resumes the same - branch/commit. -- **Conflict:** register in `PyAutoMind/planned.md` (blocked) and tell the user - what's holding the repo. - -Registry-entry formats are in [`reference.md`](reference.md) → "Registry -entries". Then route: library → `/start_library`; workspace → `/start_workspace`; -both → `/start_library` first. Display the issue URL, primary repo, branch, and -classification. +**GitHub-control-only surface (no clone/worktree):** never skip the conflict +guard — read the current `PyAutoMind/active.md` through GitHub; a target repo +under another active task's `repos:` is a hard conflict, and unreadable Mind +state fails closed. + +- **No conflict:** register `status: library-dev | workspace-dev` with the real + `worktree:` path (local), or real `session:` / `location:` metadata and repo + branch claims and **no fake `worktree:` field** (GitHub-control-only; a later + execution environment resumes the same branch/commit). +- **Conflict:** register in `PyAutoMind/planned.md` (blocked) and say what holds + the repo. + +Formats: [`reference.md`](reference.md) → "Registry entries". Route library → +`/start_library`, workspace → `/start_workspace`, both → library first; show +the issue URL, primary repo, branch and classification. ### 7. Push Mind state -`/create_issue` already pushed the issue + `active/` move; push the routing -registration (active.md / planned.md) added in step 6: +Push the routing registration from step 6 (`/create_issue` pushed the rest): ```bash source "${PYAUTO_MIND:-$(test -d organs/PyAutoMind && echo organs/PyAutoMind || echo PyAutoMind)}/scripts/prompt_sync.sh" @@ -226,9 +161,6 @@ prompt_sync_push "prompt: route (#) → " ## Notes - Always present the issue body for review before creating it. -- Resolve GitHub operations through `GITHUB_ACCESS.md`. Only a shell-`gh` - surface can meaningfully use `gh auth login`; a connected GitHub action - surface has its own permissions and must never be repaired with an OpenAI API - key or browser/session credential. -- Long-form detail (issue-body template, registry formats) is in - [`reference.md`](reference.md). +- A connected GitHub action surface has its own permissions: never repair it + with an OpenAI API key or browser/session credential (`gh auth login` only on + a shell-`gh` surface).