Skip to content

feat(cortex): a by-project check-in view and the two missing starting prompts #12

Closed

Description

@Jammy2211

Overview

Phase 3 (last) of the cortex-checkin epic. Phase 1 shed the review-slot and gate apparatus; phase 2 built the checkin door (pull → score → move → render → push → a minimal by-project summary). This phase finishes the sentence the original request asked for: "give me a summary of where every project is in terms of runs and what folders I should check out, and starting prompts to continue any individual project."

Today the dashboard and census are keyed by phase STATE, the Projects table omits local_path / mirror / ral_root, and each phase's ## Where to look bullets — the answer to which folder do I open — are parsed only to locate artefacts and never rendered. Two of the five starting prompts are also missing: "the results are good, file the ruling and open the next phase" and "rerun this".

Stacked on phase 2 (unmerged): branches cut from feature/cortex-checkin-p2-the-door in both repos; PRs target that branch and retarget to main as the stack merges.

Plan

  • Render the ## By project section on the Cortex dashboard (md + html): one block per active project with its three paths, its phase counts, then each non-terminal phase with health, its ## Where to look bullets verbatim, and the copy-ready prompts for its state as chips.
  • Add census --by-project, printing the same tree as text, and make checkin's closing summary that same tree (replacing phase 2's minimal digest) — one builder, three renderings.
  • Add the two missing payload builders — _next_phase_payload (accept → open phase N+1, honouring cortex.py new's own title-prefix convention and pre-filling from the epic ledger / an already-planned sibling phase) and _rerun_payload (rule rerun → move ready → submit → move submitted) — rendered as chips beside the existing rule prompt on the board and in the summary.
  • Add a cortex.py check rule for ## Where to look, now that it is rendered rather than only parsed: a phase past planned must name at least one real location.
  • Document the section, the two prompts and the new rule in PyAutoCortex/REFERENCE.md.
  • Tests in both repos: the section, both payloads, --by-project, a phase with no usable ## Where to look, and the new check rule failing when tripped.
Detailed implementation plan

Affected Repositories

  • PyAutoCortex (primary — the epic's home, cortex.py check rule + REFERENCE.md + the regenerated board)
  • PyAutoBrain (agents/conductors/cortex/_cortex.py — the renderer, census, checkin, payloads)

Branch Survey

Repository Current Branch Dirty?
./PyAutoBrain main clean
./PyAutoCortex main clean

Suggested branch: feature/cortex-checkin-p3-project-summary — cut from origin/feature/cortex-checkin-p2-the-door in both repos (stacked; PRs --base feature/cortex-checkin-p2-the-door).

Implementation Steps

  1. PyAutoBrain/agents/conductors/cortex/_cortex.py — carry the bullets. Extract _where_bullets(mod, ph) from where_paths() (the _where_to_look getter plus the older-checkout fallback), have where_paths() call it, and add "where": _where_bullets(mod, ph) to _phase_row(). Every renderer then has the bullets verbatim without re-reading the tree.
  2. census() — add a planned bucket (sorted) so the by-project tree can render the state order the prompt asks for. SECTIONS / section_counts() are untouched: the board's counts strip stays the five it has.
  3. The two payloads.
    • _next_phase_payload(r, c) — for awaiting-ruling / pulled / accepted: draft the accept body → cortex.py rule <rel> accept --body <file>, then either move an already-existing phase N+1 on (when the project already holds one — that is the ledger naming it) or cortex.py new <project> <slug> --phase <N+1> --title "<tail>" with the title-prefix rule stated inline (new writes # <Project> — phase N: itself), --epic pre-filled from the phase's own Epic:, then the launch lines.
    • _rerun_payload(r, c) — for awaiting-ruling / pulled / running: rule <rel> rerun --body <file>, move <rel> ready, the project's own submit line, move <rel> submitted --run <jobid> (one run per call).
      Both stay short — a human pastes them into a fresh chat.
  4. phase_chips(r, c) — (label, payload) for every prompt a phase's state has; the single place the board, the census tree and the check-in summary agree on which prompts a phase gets.
  5. project_groups(key, c) — that project's phases in state order (awaiting → live → ready → gated → planned), with accepted/dropped/rerun folded into the counts line.
  6. project_digest() — generalised: paths line, optional pull line (omitted by census), counts, then per phase the health/legs (when scored), the ## Where to look bullets verbatim, and the chips. checkin_summary() keeps using it; emit_by_project(c) prints it for census --by-project.
  7. render_dashboard() / render_dashboard_html() — a ## By project section rendered from the same project_groups / phase_chips, placed immediately after the counts table and before ## Awaiting ruling, with a SECTIONS entry (source projects.yaml) so it links its source and joins the counts strip's index.
  8. build_parser() — census --by-project; main() dispatches it.
  9. PyAutoCortex/scripts/cortex.py — new check rule in phase_problems(): a phase whose State: is not planned must carry at least one ## Where to look bullet that is not the template placeholder. The section is now rendered as the human's "which folder" answer, so a placeholder-only section is a hole exactly where a human is being asked to act.
  10. PyAutoCortex/REFERENCE.md — document the ## By project section, the two new prompts and the new check rule.
  11. Regenerate dashboard.md / dashboard.html from inside the Cortex worktree with the Brain worktree's _cortex.py (same stacked branch), commit on the Cortex branch, and confirm dashboard --check is current.

Testing

  • PyAutoBrain/tests/test_cortex_conductor.py: the ## By project section renders one block per project with its three paths and its where-bullets; census --by-project prints the same tree; _next_phase_payload names phase N+1 (both the "already planned" and the "new" branch, and the title-prefix note); _rerun_payload carries rule → ready → submit → submitted in that order; a phase whose ## Where to look holds only the placeholder renders without a where list and without crashing; the check-in summary carries the new chips.
  • PyAutoCortex/tests/test_cortex.py: the new check rule passes on the skeleton and trips when a non-planned phase's ## Where to look is emptied to the placeholder.

Key Files

  • PyAutoBrain/agents/conductors/cortex/_cortex.py — renderer, census, checkin, payloads
  • PyAutoBrain/tests/test_cortex_conductor.py — contract tests
  • PyAutoCortex/scripts/cortex.py — the new check rule
  • PyAutoCortex/REFERENCE.md — the section, the prompts, the rule
  • PyAutoCortex/dashboard.md + dashboard.html — regenerated

Original Prompt

Click to expand starting prompt

Cortex by project: the "where is everything, which folders" summary and the two missing starting prompts

Type: feature
Target: pyautocortex
Repos:

  • PyAutoBrain
  • PyAutoCortex
    Themes:
  • mind-workflow
    Difficulty: medium
    Autonomy: safe
    Priority: high
    Status: draft
    Consequence: judge
    Witness: the regenerated Cortex dashboard.md has a ## By project section (one block per status: active project, then a folded one-liner for dormant projects) that renders each project's local_path / mirror / ral_root, each non-dropped phase with State + health, the phase's ## Where to look bullets verbatim, and per phase the copy-ready prompt for its state, including two NEW ones: "accept → file and start the next phase" (wraps cortex.py rule <phase> accept --body … then cortex.py new <project> <slug> --phase N+1 with the title-prefix rule from memory) and "rerun this phase" (rule … rerun --body …, move ready, move submitted --run); pyauto-brain cortex checkin prints the same by-project summary and prompts; pyauto-brain cortex census --by-project exists; dashboard --check current; Brain + Cortex tests cover the section, both new payloads and a phase with no ## Where to look
    Review-minutes: 20
    Unattended: ready
    Epic: cortex-checkin
    Phase: 3
    Filed: 2026-09-03

Phase 3 of cortex-checkin. Branch from phase 2's branches if unmerged. Two
PRs (Brain renderer + census + checkin summary; Cortex docs/REFERENCE for the
new section and the two prompts, plus any check rule that ## Where to look
now needs, e.g. "every non-planned phase has at least one bullet").

By-project summary

Today every dashboard section and census are keyed by phase STATE
(SECTIONS in _cortex.py ~L231-253), the Projects table omits
local_path/mirror/ral_root, and ## Where to look is parsed
(where_paths ~L1231) only to locate artefacts, never rendered. Add:

  • ## By project in the dashboard (above the state sections or directly
    below the header — pick the one that reads first on a phone and say why):
    per active project, a header with the three paths, then its phases in
    state order (awaiting-ruling, running, submitted, ready, gated, planned;
    accepted/dropped folded into a count), each with health from the last
    scoring, its ## Where to look bullets verbatim, and its prompt.
  • census --by-project printing the same tree as text; checkin uses it for
    its closing summary (replace phase 2's minimal version).

The two missing prompts

Dashboard rows already carry _ruling_payload (rule this),
launch_payload (submit + move), _live_payload (check jobs). Add:

  • _next_phase_payload for an awaiting-ruling (or freshly accepted)
    phase: "the results are good — file the ruling and open phase N+1": the
    rule … accept --body <file> line with a body stub, then
    cortex.py new <project> <next-slug> --phase <N+1> (honour the title-prefix
    and rerun-flow conventions in memory reference_cortex_new_title_prefix_and_rerun_flow),
    then the launch prompt for the new phase. Where the epic ledger names the
    next phase's title, prefill it.
  • _rerun_payload for awaiting-ruling / pulled / running: "rerun
    this": rule … rerun --body <file>, move ready, move submitted --run,
    with the phase's own submit command from launch_payload.

Both render as chips beside the existing rule prompt and appear in the
by-project summary and in checkin's output. Keep the payload text short:
these are things a human pastes into a fresh chat, not scripts.

Activity

  1. Jammy2211 commented on Sep 4, 2026

    @Jammy2211
    ContributorAuthor

    Library PRs Created

    Phase 3 is shipped to PR-open. Both branches are cut from feature/cortex-checkin-p2-the-door and target it; they retarget to main as the stack merges.

    Where ## By project sits: first, immediately after the counts table and above ## Awaiting ruling. The state sections are cross-project lists where every row has to be read to find out whose it is; this is the only section that answers "where is everything" a screen per project, and it opens with the folder paths. The counts table stays above it, so the urgency sections are one tap away by anchor. section_counts() is unchanged — board/_board.py scrapes that table.

    The check rule added: a phase whose State: is past planned must carry at least one ## Where to look bullet that is not the template placeholder. planned is exempt (there the placeholder is honest). Every phase in the tree already passes; the rule is a floor against a rendered hole. Consequence fixed in the same PR: a legacy-born new now writes its --where path as the bullet, since it is born ready.

    Tests: Brain test_cortex_conductor.py 67 passed (13 new); full Brain suite 889 passed with 2 pre-existing test_branch_sweep failures that reproduce unchanged on the phase-2 base. Cortex test_cortex.py 95 passed (2 new); cortex.py check OK; dashboard --check current.

    Heart: RED at ship time, not acknowledged. release validation FAILED (stage integrate) (red) and PyAutoArray: open PR 11d old (yellow) — release-chain facts about other repos; neither Brain nor Cortex is in that chain. PRs opened, nothing merged.

    Merge order for the epic's six PRs: PyAutoBrain#348 → PyAutoCortex#10 → PyAutoBrain#350 → PyAutoCortex#11 → PyAutoBrain#351 → PyAutoCortex#13. Brain before Cortex in each phase — the Cortex dashboard_refresh.yml renders through PyAutoBrain main.

  2. Jammy2211 commented on Sep 4, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    Phase 3 of the cortex-checkin epic — the by-project summary and the two
    missing starting prompts. This closes the epic: all three phases are on main.

    PR Merge sha
    PyAutoLabs/PyAutoBrain#351 5427234f56597b24f819622f1be4f3af2c0e01cc
    #13 7ea86aa8bd64983b3820b148188400e29e1913a7

    Both merged to main on 2026-09-04, Brain before Cortex, after phases 1 and 2.
    GitHub retargeted both PRs to main as the phase below them merged.

    PyAutoBrain#351: Brain Tests green on 3.12 and 3.13 (Docs is path-filtered
    and did not fire — the diff touches no docs path). PyAutoCortex#13's refresh
    check was red on the documented Brain-main skew: that workflow renders the board
    through PyAutoBrain main, which did not yet carry this phase's renderer. It was
    re-run once PyAutoBrain#351 was on main (run 33822978065, attempt 2) and went
    green; check was green throughout.

    Heart was RED at merge time with two reasons — "release validation FAILED
    (stage integrate)" and "PyAutoArray: open PR 12d old" — both release-chain facts
    about other repos, neither of which is in the release chain. Merged under an
    explicit human acknowledgement.

    Closed by /prm.

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