diff --git a/agents/conductors/batch/AGENTS.md b/agents/conductors/batch/AGENTS.md index 06be94a9..c9f4307e 100644 --- a/agents/conductors/batch/AGENTS.md +++ b/agents/conductors/batch/AGENTS.md @@ -63,6 +63,47 @@ teaches the human to distrust the number it reports. Counted in **tasks awaiting review**, never in PRs — 94 of 332 August records named two or more PRs, so a PR-count cap trips on a single healthy batch. +**Derived, not asked for.** The count is read from `PyAutoMind/active.md`: a +task counts when its row names an open PR (`library-pr:` / `workspace-pr:` — +the PR ledger, `PyAutoMind/REFERENCE.md` "The PR keys") or its `status:` says +`awaiting-merge` / `PR open` in words, which is how rows written before that +schema spelled it. `--awaiting-review ` still overrides, including `0` — a +human asserting the queue is empty outranks the derivation. Until 2026-09-03 +the flag defaulted to `0` and nothing derived it, so every plan composed a +shift as though nothing were waiting: the one input that can SHRINK a batch +could only arrive by hand, and never did. + +No `gh` call, here or anywhere in `plan`. `active.md` is the ledger and GitHub +is the truth about mergeability; a shift must be plannable offline +(`mind_post_cortex_epic.md`: no live PR state in Mind). + +## The queue is the order + +`PyAutoMind/queue.md` is the one file the human maintains by hand, and the only +statement of *importance* the planner has — everything else it reads is a +property of the work, not a preference about it. **Order is priority**: moving +an entry up *is* the act of prioritising it. + +`plan` reads exactly three things, and nothing live: + +1. `queue.md` — the `kind: prompt` entries, in file order; +2. the `draft/` backlog, graded through the sizing faculty; +3. the review-queue depth, derived from `active.md` as above. + +A queued prompt outranks an unqueued one; among queued ones the file's order +wins; below the queue the old rule stands — cheapest first, because that list +is read when there is a slot to fill and the question is what fits in it. A +queue entry written against `draft/…` still matches its prompt after it moves +to `active/` (matched on the basename), so an entry never silently loses its +priority. `retired`, `epic-slice` and `theme-sweep` entries are skipped rather +than resolved: resolving one is a decision (which phase? which chip?), and the +reader does not decide. + +`plan` also reports what the **previous slot carried**: the members its +`outcomes:` block marks `carried` are read first, because they are already +costing the human review-minutes in the slot being planned and a batch composed +as though they were not is over-sold by exactly that much. + - clear → the full budget; - above half the cap → the review-bearing half is **halved** (the fill is not: it does not touch the queue); @@ -472,6 +513,30 @@ are exactly the outcomes no word list would have protected. The write is rehearsed on a throwaway copy and refused if a member line or a key would be lost; the `notes: |` block is never touched. +Two **blocks** are stamped alongside those keys, both derived and both rewritten +on every apply of an open record (and filled once, then left, on a closed one — +its contents are history, like `delivered:`): + +- **`outcomes:`** — one `: ` per member. This is the *accounting*; the member line's outcome + column is the *evidence* ("PyAutoFit#1554, 4/4 checks green"). It is read + from the ledger and nothing else: a `complete/` record that names the member + (`- batch: — member ```, or a record filed under the member's + own name) → `merged`; a review `decision:` that rejected it → + `rejected-at-review`; a row still in `active.md` → `carried`; otherwise + `unreviewed`. In that order, because a rejected member is still in + `active.md` and a merged one may be too. All nine members of the + 2026-08-31-pm slot merged and every one of them was recorded + `decision: UNREVIEWED` — the completion records knew, and nothing read them. +- **`merge-order:`** — the `/prm` sequence, as advice and never an action: + dispatch order (the order the human listed the members in — the only stable + order there is, since `members` is sorted by health), with library repos + first (the library-first merge gate) and same-repo members serialised (the + first merge moves `main` and stales its siblings' evidence). Nothing is + filtered: a member with no PR is listed in its place with what it is waiting + on, because an order that silently omits a member is an order somebody merges + out of. It is rendered in the collect report's summary too. + ### The close leg **`dev` — collected once, reviewed once.** A review that has landed closes the diff --git a/agents/conductors/batch/_batch.py b/agents/conductors/batch/_batch.py index 08375897..51643211 100644 --- a/agents/conductors/batch/_batch.py +++ b/agents/conductors/batch/_batch.py @@ -45,7 +45,7 @@ from _sizing import ( # noqa: E402 BODY_MAP_PATH, LIBRARY_REPOS, effective_autonomy, effective_consequence, effective_difficulty, effective_review_minutes, effective_unattended, - parse_prompt, priority_rank, + normalise_repo, parse_prompt, priority_rank, ) # `_status` (same directory) is the one definition of this vocabulary — the # batch status box on both dashboards reads a record the same way this @@ -157,15 +157,96 @@ def survey(mind: Path) -> list[dict]: return out +#: A `queue.md` section heading — `## .