Skip to content

feat: schematise Mind's PR ledger and render the pending-release chain #392

Closed

Description

@Jammy2211

Overview

Phase 3 of the mind-post-cortex epic (ledger:
draft/maintenance/pyautomind/mind_post_cortex_epic.md),
covering assessment gaps 1 and 2.

Mind's ledger stops at "issue open". library-pr: / workspace-pr: are written by
ship_library and read by /prm, but they are absent from the active.md schema in
REFERENCE.md — so nothing validates them and the dashboard renders only the free-text
status:. Separately, two libraries (PyAutoArray, PyAutoLens) have sat pending-release
since 2026-09-02 with no machine view except the Brain board's live gh search, and the
workspace tasks blocked behind those releases are gated only in prose.

This task schematises the PR keys, adds a drift check for them, and renders both the PR
links and the pending-release → release → unblocked-workspace chain on the Mind dashboard
— as a ledger view, never a live gh call at render time.

Plan

  • Add library-pr:, workspace-pr: (repeatable, single-line form preserved),
    pending-release: and release-gate: to the active.md schema in REFERENCE.md,
    plus pending-release: to the completion-record schema, with the rule that a row
    whose status: declares awaiting-merge / PR open / shipped must carry at least
    one *-pr:.
  • Enforce that rule in scripts/lifecycle.py check as a warning first (exit 0),
    with the escalation rule to an error stated in REFERENCE.md; add tests.
  • Warn (never error) on a complete/ record whose pending-release: is still uncleared
    after N days.
  • Brain _intake.py: In-flight rows gain PR links (PyAutoBrain#343) and a
    pending-release badge read from the ledger; a new Pending release section
    under In flight groups merged-but-unreleased library PRs and, under each, the active
    tasks whose release-gate: names that library. Empty section is omitted.
  • Skill wording: ship_library / ship_workspace write the schematised keys;
    /prm carries pending-release: into the completion record; /review_release
    step 5 (the "Live run" branch)
    is the step that clears it once a release has
    actually published.
  • Fix the CI render defect phase 2 found: dashboard_refresh.yml runs --mind . from
    inside PyAutoMind, so _intake._cortex_root never resolves the sibling PyAutoCortex
    checkout and CI renders silently drop the Cortex-gate badges.
Detailed implementation plan

Work Classification

Library (organ source + docs; no workspace scripts).

Affected Repositories

  • PyAutoMind (primary) — REFERENCE.md, scripts/lifecycle.py, tests/
  • PyAutoBrain — agents/conductors/intake/_intake.py, tests/test_intake_dashboard.py,
    skills/ship_library/, skills/ship_workspace/, skills/prm/
  • PyAutoHeart — skills/review_release/review_release.md (the clearing step)

Branch Survey

Repository Current Branch Dirty?
./PyAutoMind main clean
./PyAutoBrain main clean
./PyAutoHeart main clean

Suggested branch: feature/mind-post-cortex-p3-pr-ledger
Worktree root: ~/Code/PyAutoLabs-wt/mind-post-cortex-p3-pr-ledger/

Branched from main, not from phase 2's feature/mind-post-cortex-p2-science-residue
(open, unmerged: PyAutoMind#391, PyAutoBrain#343, PyAutoCortex#8). A git merge-tree
against that branch is run in both repos before shipping and the result is reported in the
PR body.

Implementation Steps

  1. PyAutoMind/REFERENCE.md — extend the active.md schema block with
    - library-pr:, - workspace-pr: (both repeatable; the existing single-line
    <url>, <url> form stays valid), - pending-release: <lib>@<pr-url> and
    - release-gate: <lib>. Add the *-pr:-required rule and its warning→error
    escalation rule. Add - pending-release: to the completion-record schema. Add a short
    "the pending-release chain" subsection naming GitHub's label + the Hands release as the
    source of truth, Mind as the link and gate, the dashboard section as the ledger view and
    the Brain board's live gh query as the fresh view, and /review_release step 5 as the
    step that clears the key.
  2. PyAutoMind/scripts/lifecycle.py — registry_entries() gains a repeat-tolerant
    multi-value collector; new pr_key_problems() (status declares merge-ready but no
    *-pr:) and pending_release_problems() (uncleared pending-release: older than N
    days on a complete/ record). cmd_check prints these as warning: lines and keeps
    exit 0; hard drift keeps exit 1.
  3. PyAutoMind/tests/test_lifecycle_check.py — fixture rows for both warnings, the
    single-line and repeated *-pr: forms, and a passing live-shaped ledger.
  4. PyAutoBrain/agents/conductors/intake/_intake.py — parse_registry collects
    repeated keys into a multi map and derives prs / pending_release /
    release_gate; census carries them onto in_flight rows and builds a
    pending_release aggregate from active.md rows plus complete/ records;
    render_dashboard and render_dashboard_html render the PR links, the badge and the
    new Pending release section.
  5. PyAutoBrain/agents/conductors/intake/_intake.py — _cortex_root resolves the
    Mind path before taking .parent, so --mind . from inside the Mind checkout finds
    the sibling PyAutoCortex/.
  6. PyAutoBrain/tests/test_intake_dashboard.py — fixtures covering the PR column,
    the badge, the Pending release section (present and omitted), and the --mind .
    Cortex-root resolution.
  7. Skill wording — PyAutoBrain/skills/ship_library/reference.md,
    skills/ship_workspace/reference.md, skills/prm/prm.md; and
    PyAutoHeart/skills/review_release/review_release.md step 5.

Key Files

  • PyAutoMind/REFERENCE.md — the active.md / completion-record schemas
  • PyAutoMind/scripts/lifecycle.py — registry_entries, cmd_check
  • PyAutoBrain/agents/conductors/intake/_intake.py — parse_registry, census,
    render_dashboard, render_dashboard_html, _cortex_root
  • PyAutoBrain/skills/{ship_library,ship_workspace,prm}/ — the writers and readers
  • PyAutoHeart/skills/review_release/review_release.md — the clearing step

Testing

python3 -m pytest -q in PyAutoMind and PyAutoBrain, plus
python3 scripts/lifecycle.py check on the live ledger and a
TZ=UTC pyauto-brain intake --apply dashboard regeneration from the canonical checkouts.

Design guardrails (from the epic)

  • Prefer the lean existing lever; do not build a fourth surface.
  • Never call gh at dashboard render time — the dashboard renders the ledger only.
  • GitHub's pending-release label and the Hands release stay the source of truth.
  • Keep the single-line library-pr: form working; omit an empty Pending release section.

Original Prompt

Click to expand starting prompt
# Mind's PR ledger: schematise `library-pr:`/`workspace-pr:`, render PRs and the pending-release chain

Type: feature
Target: pyautomind
Repos:
- PyAutoMind
- PyAutoBrain
Themes:
- mind-workflow
Difficulty: medium
Autonomy: safe
Priority: high
Status: draft
Consequence: judge
Witness: `REFERENCE.md` "Registry entries → active.md" lists `library-pr:`, `workspace-pr:` and `release-gate:`; `python3 scripts/lifecycle.py check` fails on a fixture row whose `status:` says `awaiting-merge` but carries no `*-pr:` key and passes on the live ledger; the regenerated `dashboard.md` In-flight table has a PR column linking every `*-pr:` and a new "Pending release" section listing merged-but-unreleased library PRs and the active tasks whose `release-gate:` names them; Brain intake tests cover both renders
Review-minutes: 20
Unattended: ready
Epic: mind-post-cortex
Phase: 3
Filed: 2026-09-03

Phase 3 of `mind-post-cortex` — assessment gaps 1 and 2. Two PRs: Mind
(schema + drift check) and Brain (dashboard renderer).

## Gap 1 — the PR ledger is unschematised (S)

`library-pr:` / `workspace-pr:` are written by `ship_library` (`skills/ship_library/ship_library.md` ~L113)
and read by `/prm` (`skills/prm/prm.md` ~L69) but absent from the `active.md`
schema (`REFERENCE.md` ~L525-553); they are documented only for completion
records (~L631). So nothing validates them and the dashboard renders only the
free-text `status:`.

- Add `library-pr:`, `workspace-pr:` (URL, repeatable — a task may have several
  per kind; keep the existing single-line form working) and `release-gate:`
  (see gap 2) to the `active.md` schema in `REFERENCE.md`, with the rule:
  a row whose `status:` contains `awaiting-merge`, `PR open` or `shipped`
  must carry at least one `*-pr:`.
- `scripts/lifecycle.py check`: enforce that rule (warn → error after one
  release cycle if you prefer; state which). Add a test.
- Brain `_intake.py` dashboard: In-flight rows get a **PR** column — one link
  per `*-pr:` labelled by repo (`PyAutoFit#1555`), plus the `pending-release`
  badge when the PR carries that GitHub label *as recorded in the ledger*
  (never a live `gh` call at render time). Extend the dashboard fixture test.
- Ship skills: confirm `ship_library`/`ship_workspace` write the keys in the
  schematised form; fix the wording in `skills/*/reference.md` if it differs.

## Gap 2 — no pending-release → release → unblocked-workspace chain (M)

Two libraries (PyAutoArray, PyAutoLens) have sat `pending-release` since
2026-09-02 (`epics.md` image-source-mappings status) and phase 3 was opened
ahead of the release by hand. The only machine view is the Brain board's live
`gh` search (`board/_board.py` ~L653-664).

Design (prefer the lean existing lever; do not build a fourth surface):

- **Source of truth stays GitHub** (the `pending-release` label on merged
  library PRs) and Hands (the release that clears it). Mind holds only the
  *link and gate*.
- `ship_library` writes `pending-release: <lib>@<pr-url>` into the task's
  `active.md` row when it opens a pending-release PR; `ship_workspace` writes
  `release-gate: <lib>` on a workspace task blocked behind an unreleased
  library. `/prm` close-out carries `pending-release:` into the completion
  record; the release path (`pre_build`/Hands post-publish or `/prm` on the
  release) clears it — specify exactly which step and edit that skill.
- Dashboard: a **Pending release** section under In flight, grouped by
  library: merged-but-unreleased PRs (from `active.md` rows and
  `complete/` records whose `pending-release:` is not yet cleared) and, under
  each, the active tasks whose `release-gate:` names it. Empty section is
  omitted.
- `lifecycle.py check`: a `complete/` record with an uncleared
  `pending-release:` older than N days is a warning, not an error.

Keep the Brain board's live query as the fresh view; the dashboard section is
the ledger view and must say so in one line.

Activity

  1. Jammy2211 commented on Sep 3, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped to PR-open — three PRs, merge stays human

    Repo PR What
    PyAutoMind #393 REFERENCE.md schema (library-pr:, workspace-pr:, pending-release:, release-gate:) + lifecycle.py check
    PyAutoBrain PyAutoLabs/PyAutoBrain#344 dashboard PR column + Pending release section, ship/prm skill wording, CI Cortex-badge fix
    PyAutoHeart PyAutoLabs/PyAutoHeart#195 /review_release step 6 — the step that clears pending-release:

    Suggested merge order: PyAutoMind#393 → PyAutoBrain#344 → PyAutoHeart#195 (the schema is what the other two point at). Nothing forces it technically.

    Which step clears pending-release: — and why

    pre_build (Hands) only asserts the label exists and dispatches release.yml; /build and /release coordinate and validate. Nothing in the organism removed the label at all. /review_release step 5's "Live run" branch is the one step that establishes a release actually published, so a new step 6 there does the clearing (label off the merged PRs, then the pending-release: / release-gate: lines out of Mind). A release that was dispatched is not a release that published.

    Witness

    • REFERENCE.md "active.md schema" lists all four keys ✅
    • lifecycle.py check fails on a fixture row with status: awaiting-merge and no *-pr:, and passes on the live ledger ✅
    • The In-flight rows link every *-pr: labelled by repo; the Pending release section groups merged-but-unreleased PRs with the tasks whose release-gate: names them; empty section omitted ✅
    • Brain fixture tests cover both renders ✅

    The one deliberate deviation from the gap-1 text: the PR-key rule is drift (exit 1), not a warning — it is a contradiction inside a single entry, and the witness asks for check to fail on it. The pending-release staleness check is the warning, and REFERENCE.md states that it must never escalate.

    Bonus

    The CI defect phase 2 found is fixed in PyAutoBrain#344: dashboard_refresh.yml runs the renderer as --mind ., and Path(".").parent is . — so _cortex_root looked for PyAutoMind/PyAutoCortex and every CI render silently dropped the Cortex-gate badges. One line + a test; no workflow change needed.

    Tests

    PyAutoMind pytest -q → 380 passed. PyAutoBrain pytest -q → 867 passed, 1 failed — test_cortex_conductor::test_a_fixture_tree_finds_the_schema_its_checkout_ships, which fails identically on main inside a task worktree (symlinked PyAutoCortex, resolved-path compare) and passes in the canonical checkout.

    Merge-tree vs the open phase-2 branch

    PyAutoBrain: CLEAN. PyAutoMind: conflicts only in the generated dashboard.md/.html — and a control merge of that same phase-2 branch into plain origin/main gives the identical conflict, so it is phase 2's rebase debt, not an interaction.

    Heart

    RED at PR-open: PyAutoLens: CI failure, release validation FAILED (stage integrate), PyAutoArray: open PR 11d old. None touches this diff. Not acknowledged for this task — merge needs your own call.

  2. Jammy2211 commented on Sep 3, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    Phase 3 of mind-post-cortex — the Mind's PR ledger, its drift check, its dashboard render and the step that clears the pending-release chain.

    PR Merged
    #393 — schema + drift check 7d3ed60f
    PyAutoLabs/PyAutoBrain#344 — renderer + ship-skill wording fcb43755
    PyAutoLabs/PyAutoHeart#195 — review_release step 6, the clearing step b91c026a
    • REFERENCE.md now schematises library-pr: / workspace-pr: (repeatable; the old <url>, <url> line still parses) plus pending-release: <lib>@<pr-url> and release-gate: <lib>, with two prose sections stating the contract once. GitHub's label and the Hands release stay the source of truth; Mind holds only the link and the gate.
    • lifecycle.py check — drift (exit 1) on an active.md row that declares open/shipped PRs and names none; warning (exit 0, never escalatable) on a complete/ record whose pending-release: is uncleared after 30 days.
    • The dashboard renders every *-pr: as a repo-labelled link on the In-flight line, and a new Pending release section groups merged-but-unreleased library PRs with the tasks their release-gate: blocks. No gh call at render time. It also fixes the CI defect phase 2 found: --mind . from inside the Mind checkout resolved _cortex_root to PyAutoMind/PyAutoCortex, so every CI render silently dropped the Cortex-gate badges.
    • /review_release step 6 is the one place that clears the chain — only for a live run whose release jobs succeeded. A release that was dispatched is not a release that published.

    One trap worth knowing: the new check went RED on #393's own CI, not on main — euclid-cpu-two-stage-route landed on main after the branch was cut and names its PR only inside the status: prose. It got its workspace-pr: key in 16bdd13f; lifecycle check is OK on the live ledger. REFERENCE.md had predicted exactly this: "the first failure can only be a new row."

    Record: complete/2026/09/mind-post-cortex-p3-pr-ledger.md. Next in the epic is phase 4 (mind-post-cortex-p4-batch-fidelity, PyAutoBrain#345) — GitHub has already retargeted PyAutoMind#394 from this branch onto main, where it now reads CONFLICTING on the generated dashboard pages; take upstream and re-render.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions