Skip to content

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

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cortex-checkin-p3-project-summary
Sep 4, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/cortex-checkin-p3-project-summary

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Phase 3 (last) of the cortex-checkin epic — PyAutoCortex#12.

Stacked on #350 / PyAutoCortex#11 — retargets to main as the stack merges. Base is feature/cortex-checkin-p2-the-door; that branch is itself based on feature/cortex-checkin-p1-shed-review-slot. Merge order for the epic's six PRs: PyAutoBrain#348 → PyAutoCortex#10 → PyAutoBrain#350 → PyAutoCortex#11 → this PR → PyAutoCortex#13.

What this finishes

The original request: "tell PyAutoCortex to download all results, give me a summary of where every project is in terms of runs and what folders I should check out, and give me starting claude prompts to continue work on any individual project." Phase 2 built the door. This is the summary and the last two prompts.

Before: every dashboard section and census were keyed by phase state, the Projects table omitted local_path / mirror / ral_root, and each phase's ## Where to look bullets — the folder answer itself — were parsed only to locate artefacts and never rendered.

## By project

One tree, three renderings, one builder:

Where What it adds
## By project on dashboard.md / dashboard.html copy buttons
pyauto-brain cortex census --by-project nothing — the tree from the checkout alone, no pull, no cluster
the closing summary of cortex checkin --apply the pull result and the six-leg health (replaces phase 2's minimal digest)

Per project: its three folders, its phase counts by state, then every phase still open — awaiting a ruling, still out there, ready to submit, gated, planned — each with its state, its ## Where to look bullets verbatim, and a copy chip per prompt its state carries. accepted / rerun / dropped are history: counted, not listed. A project gets a block when its row is status: active or it still holds an open phase; every other project folds to one line.

Where the section sits, and why

First — immediately after the counts table, above ## Awaiting ruling. The prompt offered "above the state sections" or "directly below the header"; on this page those are the same place, and the reason to take it is the phone. The state sections are cross-project lists: every row has to be read to find out whose project it is. This is the only section that answers "where is everything" a screen per project, and it opens with the folder paths — the thing the human came for. The counts table stays above it, so the urgency sections are still one tap away by anchor.

section_counts() is deliberately unchanged — board/_board.py scrapes the counts table by regex for the Brain board's strip, so ## By project has no count row of its own.

The two missing prompts

Both render as chips beside the existing rule prompt (the row keeps the payload it always had; these follow it as ↳ chips), and both appear in the by-project tree and in checkin's output.

_next_phase_payload — "the results are good", for pulled / awaiting-ruling. Example (--phase 5 is taken by a phase that has already run, so it offers the lowest free number):

The results for the PyAutoCortex phase phases/proj/four.md are good. Read its `## Witness` and the evidence under its `## Where to look`, draft the accept body for my approval, then file it and open the next phase:
python3 scripts/cortex.py rule phases/proj/four.md accept --body <file>
# phase 5 is taken (phases/proj/five.md, accepted) — the next free number is 10:
python3 scripts/cortex.py new proj <slug> --phase 10 --epic an-epic --title "<the tail only — `new` writes '<Project> — phase 10: ' itself>"
python3 scripts/cortex.py move phases/proj/<slug>.md ready
cd /s/proj && hpc/sync submit <script>

It prefills from the ledger: when the project already holds a phase numbered N+1 in planned or gated, that phase is opened (move … ready + the launch) rather than duplicated — epics.md points at phases/<project>/ for exactly this reason. The title rule is stated inline because cortex.py new writes # <Project> — phase N: in front of --title itself; passing the full headline doubles the prefix.

_rerun_payload — "run it again", for pulled / awaiting-ruling / running:

The PyAutoCortex phase phases/proj/four.md needs running again. Draft the rerun body — what came back, and what changes — for my approval, then file it and relaunch:
python3 scripts/cortex.py rule phases/proj/four.md rerun --body <file>
python3 scripts/cortex.py move phases/proj/four.md ready
cd /s/proj && hpc/sync submit <script>
python3 scripts/cortex.py move phases/proj/four.md submitted --run <jobid>   # one run per call; --after <run> chains the next

A rerun is a ruling first: rerun is the only verb that puts a phase back on the board. The payloads are short on purpose — they are pasted into a fresh chat, not run as scripts, and the <file> / <script> / <slug> / <jobid> placeholders are where the human's own reading lands.

phase_chips(r, c) is the single table saying which prompts a state carries, so a prompt cannot appear on the board and not in the door.

API Changes

Additive only — no signature broke.

  • new: census --by-project; emit_by_project(), phase_chips(), project_groups(), by_project_keys(), project_paths(), project_counts(), _next_phase_payload(), _rerun_payload(), _where_bullets(), _submit_line().
  • changed: census() gains a planned bucket; _phase_row() gains "where" (the bullets verbatim); project_digest()'s pull_line is now optional (census omits it); launch_payload() delegates its middle line to _submit_line(); SECTIONS gains by_project.
  • unchanged on purpose: section_counts(), and therefore board/_board.py's counts strip.

Testing

tests/test_cortex_conductor.py: 67 passed (13 new) against the real Cortex fixture — the section leads the board, a project block names its three folders and its counts, the where-bullets render verbatim, history is counted not listed, census --by-project prints the same tree, a dormant project with nothing open folds to one line, a phase whose ## Where to look names nowhere still renders in all three views, all three branches of the accept-and-open prompt (planned sibling / no sibling / taken number), the rerun prompt's ordering, a project with no submit verb, the state→chips table, and the chips riding beside the rule prompt in md and html.

Full Brain suite: 889 passed, 2 failed — both tests/test_branch_sweep.py (test_an_unexpired_integration_branch_is_protected, test_delete_removes_only_the_expired_integration_branch), pre-existing on this stack and control-tested on the phase-2 base where they reproduce unchanged. Not touched.

Live: cortex census --by-project and cortex checkin --dry-run --skip-pull both run clean against the real Cortex tree; dashboard --check is current after regenerating (PyAutoCortex#13 carries the regenerated pages).

Heart

RED at ship time, not acknowledged by a human. Exact reasons from pyauto-heart readiness --json: red "release validation FAILED (stage integrate)"; yellow "PyAutoArray: open PR 11d old". Both are release-chain facts about other repos; neither PyAutoBrain nor PyAutoCortex is in the release chain, and this branch is a conductor renderer plus tests. PR opened, nothing merged — the merge decision needs the human and an ack (or a green Heart) before it.

🤖 Generated with Claude Code

https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6

The original request asked for one thing the board could not answer: "where
is every project, what folders should I check out, and give me the prompt to
continue any one of them". Every section was keyed by phase STATE, the
Projects table omitted the three folders a project lives in, and each phase's
`## Where to look` bullets — the folder answer itself — were parsed to locate
artefacts and never rendered.

`## By project` is that view, and it is one tree rendered three ways: the
first section of `dashboard.md` / `dashboard.html`, the text
`cortex census --by-project` prints from the checkout alone, and the closing
summary of a real `checkin` (the only one carrying pull results and six-leg
health). Per project: its `local_path` / `mirror` / `ral_root`, its phase
counts, then every phase still open — awaiting, live, ready, gated, planned —
with its state, its `## Where to look` bullets verbatim, and a copy chip per
prompt its state carries. History (accepted / rerun / dropped) is counted,
not listed; a project with nothing open folds to one line.

Two of the five starting prompts were missing and are now here, beside the
rule prompt rather than instead of it:

- `_next_phase_payload` — "the results are good": the accept, then the next
  phase. It prefills from the tree — a planned or gated sibling numbered N+1
  is opened rather than duplicated; a taken number is named and the lowest
  free one offered — and spells out `new`'s own title rule, that it writes
  `# <Project> — phase N: ` in front of `--title` itself.
- `_rerun_payload` — "run it again": the rerun ruling first (the only verb
  that puts a phase back on the board), then ready, the project's own submit
  and the move that records the job id.

`phase_chips()` is the one table saying which prompts a state carries, so a
prompt cannot appear on the board and not in the door. The counts strip is
deliberately unchanged — `board/_board.py` reads it by regex.

Refs PyAutoCortex#12.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
Base automatically changed from feature/cortex-checkin-p2-the-door to main September 4, 2026 14:21
@Jammy2211
Jammy2211 merged commit 5427234 into main Sep 4, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/cortex-checkin-p3-project-summary branch September 4, 2026 14:25
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.

1 participant