Skip to content

feat: Lane fail-closed + queue.md, M2 rulings, scoped Heart gate + rehearsal callers (M2.3, #614) - #620

Merged
Jammy2211 merged 6 commits into
mainfrom
feature/lane-fail-closed
Nov 13, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
feature/lane-fail-closed

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Programme M2.3, plus the Brain callers for M2.1 and M2.4. Closes #614.

M2.3:

  • An absent Lane fails closed in unattended plans and watcher ticks. --attended and brief-named tasks are exempt.
  • Intake refuses a draft with no Lane.
  • An empty queue.md stops unattended backlog dips.
  • Priority sorts before review-minutes.
  • A read_queue bug is fixed: the Retired footer had overwritten the live entry.
  • AUTONOMY.md gains the dated section "M2 rulings — 2026-11-12" (all six human rulings).

M2.1 callers:

  • Every dev-ship Heart gate uses pyauto-heart readiness --dev --repos <task repos>, including the watcher's close-out.
  • An empty scope, or a reply without gate: dev-ship, parks.
  • With no Heart CLI, only a published GREEN under 6 h old passes.
  • heart_feed.py treats a feed over 6 h old as never GREEN.

M2.4 callers:

  • nightly.sh takes commit_shas from rehearsal.json, and the same file feeds Stage 3 and Heart validate.
  • The live dispatch carries rehearsal_run_id and commit_shas.
  • The manual door forwards the run id, and refuses one that differs from the run Heart validated.

Test plan

  • Brain pytest tests/: 1794 passed. The known environmental failure test_grouped_organ_consumers remains.
  • The new tests run offline and fail on the old code.
  • Skill line counts OK. Tenant firewall OK.
  • The independent review took several rounds: FINDINGS, then fixed, then CLEAN.

Heart RED override (development only)

Authorization from the live human at the programme M2 gate, 2026-11-13: "Override + merge all". This authorizes the development-only RED override for #614, PyAutoLabs/PyAutoHeart#340 and PyAutoLabs/PyAutoHands#337 and gives the merge command (order Mind, Hands, Brain, Heart), conditional on every required check being green within the turn.

Heart verdict RED (pyauto-heart readiness, verdict ts 2026-11-12T22:43:14Z). The current RED reasons, verbatim: "PyAutoNerves: 4 commit(s) behind origin"; "PyAutoFit: 2 commit(s) behind origin"; "PyAutoArray: 4 commit(s) behind origin"; "PyAutoGalaxy: on branch feature/galaxy-guide-rebalance (not main)"; "PyAutoGalaxy: 1 uncommitted source change(s)"; "PyAutoLens: 1 uncommitted source change(s)"; "PyAutoLens: 45 commit(s) behind origin"; "PyAutoCTI: 4 commit(s) behind origin"; "install verification FAILED (testpypi; checks F)"; "release validation FAILED (stage integrate)"

None of these is in PyAutoMind, PyAutoBrain, PyAutoHeart or PyAutoHands. Branch gates passed: tests, independent review CLEAN after fix rounds, smoke not applicable. This PR does not fix Heart, and Heart stays RED for release.

Tier: glance. Merge mode: auto-merge on green if the Witness passes, with a post-merge summary. A RED override additionally needs the human's merge command, which was given in the same turn.

🤖 Generated with Claude Code

Jammy2211 and others added 6 commits November 12, 2026 21:25
…ings in AUTONOMY (M2.3, #614)

(a) Lane. `_batch.grade` records the DECLARED lane (None when absent or
invalid). `plan(attended=False)` — every `batch plan` and every watcher
tick — excludes a backlog draft with no valid `Lane:` (`lane_absent_why`)
and says so in the plan output and the shift digest; `batch plan
--attended` reads it as `any`. A brief's named tasks are the human's own
pick and are not gated. Intake now always writes `Lane:`, `any` when
inference finds no resource signal, instead of refusing. Documented
default reworded in `_batch.py`, `_sizing.py` and `_intake.py`.

(b) queue.md. An empty or absent queue.md stops an unattended shift's
backlog dip (named tasks still run); the watcher now reads queue.md at
all. Below the queue the planner sorts priority before review-minutes
(`rank_note` follows). `read_queue` fix: a `- ref:` in the `## Retired`
footer overwrote the last live entry's ref, so the planner read Mind's
queue as `euclid-dr1-prep`.

(c) AUTONOMY.md: one inserted section, "M2 rulings — 2026-11-12",
recording the six M1-gate rulings with build issue / human act and a
revert condition each. No other doctrine text changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…atch skill (#614 review)

Review findings on M2.3:

1. Ruling deviation removed. Intake no longer writes `Lane: any` when
   inference finds nothing: `analyse` leaves the lane undecided
   (`lane: None`, `lane_refusal`) unless the filer passes `--lane`, the
   text carries a `Lane:` header, or a resource signal infers one, and
   `write_prompt` raises `LaneRequired`. `classify --apply` exits 6 with a
   message naming the header line and `--lane any`; `ideas --apply`
   files the rest and refuses (and does not mark) lane-less bullets.
   AUTONOMY.md "M2 rulings", the batch and intake AGENTS.md and the
   sizing comment now record the refusal. Intake tests that file a draft
   pass `lane="any"`.
3. skills/batch/batch.md: an empty queue.md gives an empty unattended
   batch; "here are the ones I want" plans as named tasks or with
   `batch plan --attended`. Kept within the 200-line budget.
4. The M2.5 quote restores "(21.8 KB today)" verbatim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… --repos (Heart#340 callers)

- agents/_common.sh: `consult_vitals_verdict --repos A,B` and
  `consult_vitals_red_reasons --repos A,B [--field …]` call
  `pyauto-heart readiness --dev --repos A,B --json`; a scoped read that
  does not come back as the dev-ship gate is "unknown" (park), never a pass.
  `active_task_repos <task>` reads the scope from active.md `repos:`.
  Unscoped calls (release conductor, nightly, build release mode) unchanged.
- bin/heart_feed.py: a feed older than 6 h (or undated) is never GREEN —
  STALE with an age row, `pass` true only for GREEN; `--repos A,B` asks the
  local dev-ship gate, else reads the published feed unscoped and says so.
- Leg 4 (AUTONOMY.md), ship_library / ship_workspace step 3, WORKFLOW.md
  "Heart gate", ORGANISM.md call chain: the scoped gate, STALE never passes.
  The health conductor and vitals docs drop "STALE passes the dev-ship gate".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d commit_shas (Hands#337 callers)

- nightly: commit_shas.json comes from the Stage 2 rehearsal.json
  (`rehearsal_record`), not `gh api …/commits/main`; the same file feeds
  Stage 3 and `pyauto-heart validate --commit-shas`; the live dispatch
  sends `rehearsal_run_id` + the compact `commit_shas`
  (`live_release_inputs`), replacing the `{"rehearsal":"false",
  "minor_version":"1"}` payload #337 refuses. A missing record or a run-id
  mismatch pages and stops. `dispatch_and_await` moved to _nightly_lib.sh
  (records LAST_RUN_ID) so it is testable with a fake gh.
- rehearse.sh: the plan's capture-heads step becomes
  commit-shas-from-record; ingest writes commit_shas.json from
  rehearsal.json and refuses a --commit-shas file that disagrees.
  validate.sh falls back to rehearsal.json for Stage 3's commit_shas.
- Manual door: `release --rehearsal-run-id <id>` → build.sh → `autohands
  pre_build <minor> <id>`; else $REHEARSAL_RUN_ID, else Heart's validated
  stages.rehearse.run_id; refuses (exit 5) before any gate without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for the PR's repo (Heart#340)

The unattended close-out's Heart check was `heart_feed.py` exit 2 (RED,
organism-wide). It is a development-ship gate, so it now runs the same rule
as `consult_vitals_verdict --repos`: `closeout_prompt` derives the PR's repo
(`pr_repos`) and renders `consult_vitals_verdict --repos <repo>`; only
`green` merges, `stale` never does, and `unknown` (a reply that is not the
dev-ship gate, or no Heart) refuses. A URL that is not a GitHub PR cannot be
scoped and refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k; door refuses a run id Heart never validated (review)

1. `consult_vitals_verdict --repos ""` (a task with no `repos:`) echoes
   "unknown" without asking Heart, and `consult_vitals_red_reasons --repos ""`
   prints nothing — never the unscoped verdict.
2. With no Heart CLI (a web session), `_published_green_fallback` reads the
   published organism-wide feed through bin/heart_feed.py: GREEN and under
   6 h old passes (at least as strict as any scope); anything else is
   "unknown". A Heart that answers but errors is "unknown", not this
   fallback. Leg 4 (AUTONOMY.md) documents it.
3. build.sh release door: a given rehearsal run id (flag, positional or
   $REHEARSAL_RUN_ID) that differs from Heart's validated
   stages.rehearse.run_id refuses (exit 5) printing both ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: absent Lane fails closed unattended; validated queue.md; M2 rulings in AUTONOMY (M2.3)

1 participant