Skip to content

feat: shift-owned keep-Heart-green lane (#625) - #626

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/heart-green-lane
Nov 13, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/heart-green-lane

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Pre-M3 build 3 of 3: a shift-owned keep-Heart-green lane. Closes #625.

agents/conductors/batch/_green.py runs from batch brief --new (and as batch green, which reports only).

Classification: Heart's RED and YELLOW reasons are sorted by a tested rule table (RULES, first match wins; an unmatched reason is human-only):

  • fixable-dev: red CI on main, a red unit test, a failing workspace script, URL lint, a missing workflow;
  • local-checkout: behind, dirty, on a branch, every manifest-drift leg (report only);
  • release-scope: release validation, install check F, rehearsal, an unsatisfiable floor (report, and name the human action);
  • human-only.

What it does with them:

  • Files at most 3 new drafts per brief, red first, deduplicated against drafts, active tasks, queue.md and a state file. A key clears when Heart no longer lists it.
  • Drafts carry no Unattended: header, and their Difficulty comes from sizing, so the lane never self-approves unattended work.
  • Mode: file by default; pick is opt-in.
  • Writes go only into a --mind that is a linked git worktree with --out. A preview writes nothing.
  • Feed: older than 6 h, STALE or unreadable means nothing is filed.
  • Never releases, dispatches or quarantines. Tests pin that no gh workflow or dispatch call is made.

Test plan

  • 67 lane tests plus 229 lane and batch tests.
  • Brain pytest tests/: 1932 passed. The known node-env failure was deselected.
  • Skill line counts OK. Tenant firewall OK.
  • The reviewer replayed 97 real reason strings: only real CI or test reds are fixable.

Gate

  • Heart, scoped dev-ship verdict: GREEN for PyAutoBrain and PyAutoMind. No override was needed.
  • Independent review: FINDINGS, then fixed, then CLEAN. The findings were:
    • drafts were written into the shared Mind checkout, even on a preview;
    • another session's on-disk worktree was classed as fixable;
    • the lane was too eager by default, with self-declared Unattended: ready;
    • a key once filed was never filed again;
    • the canonical-checkout guard could be bypassed from a worktree Brain.
  • Human: asked for the lane on 2026-11-13 ("constantly trying to ensure it's green, without being overly eager doing releases") and gave the merge command (judge tier).

🤖 Generated with Claude Code

Jammy2211 and others added 3 commits November 13, 2026 19:35
`batch brief --new` now reads Heart's release verdict (local
`pyauto-heart readiness --json` with its per-repo keys, else the published
feed; the 6 h age rule applies, and a fresher feed wins over an over-age
snapshot) and sorts every RED/YELLOW/STALE reason with a tested rule table
(`_green.RULES`) into fixable-dev, local-checkout, release-scope or
human-only. For fixable-dev reasons it files at most 3 bug drafts per
brief (judge tier, Lane, re-check-first note, quoted reason, Witness, a
heart-key mark), deduplicated against draft/, active/, queue.md and a state
file in the orchestrator home, and names lane-matching drafts as tasks
under a last `heart-green` goal. The record gets a `## Heart` section.
`batch green` runs the lane alone (report by default).

It runs at brief time only, never in the watcher tick. It never releases,
rehearses, dispatches, forces, writes queue.md, edits another prompt or
quarantines (it may propose one). `_green.py` imports no process or
network module; heart_feed gains `local_readiness` (the raw verdict).
Tests use real Heart reason strings (fixtures/heart_green/reasons.json).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Writes only with --out and an explicit --mind that is not the shared
  canonical checkout (temp-worktree route named); a preview writes no
  draft and no state.
- Every manifest-drift leg is local-checkout (they read on-disk
  checkouts, other sessions' worktrees included); MANIFEST_FIXABLE is the
  allowlist, empty today. Fixture corrected.
- Default mode `file`; `pick` is the human's opt-in. Drafts carry no
  Unattended: header and the sizing faculty's Difficulty.
- A fresh, valid Heart read that no longer lists a key clears its state
  row, so a recurrence files again (still deduped).
- floor-unsatisfiable is release-scope.
- A quarantine's bug task matches only the key mark or its Issue: ref.
- STALE release-scope reasons reach "Needs the human".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…625 review)

write_hold compared --mind with the Mind this Brain resolves, so a worktree
Brain could write into the shared organs checkout. Now a write needs
`git rev-parse --git-dir` != `--git-common-dir`: the main checkout of any
Mind clone, wherever it lives, is refused. Tested with a real repo and a
linked worktree in tmp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 07d9733 into main Nov 13, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/heart-green-lane branch November 13, 2026 20:13
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: shift-owned keep-Heart-green lane (pre-M3)

1 participant