Repository navigation
feat(cortex): one check-in door — pull, score, render, push, summarise by project - #350
Merged
Merged
Conversation
…e by project `pyauto-brain cortex checkin` is the verb behind "where is my science?". It composes the primitives phase 1 decoupled and reasons nothing extra of its own: 1. Sync — every `status: active` project in `projects.yaml`, plus any project owning a phase in `submitted | running`, pulled with **its own** `<local_path>/<sync_cli> pull`. Output is streamed, not captured: a pull runs for minutes and the human is watching this one command. A non-zero exit is recorded against that project and the sweep continues — one unreachable mirror must not hide the other six. After a good pull it writes `<pull root>/.cortex/pull.json` (`project`, `pulled_at`, `cmd`, `rc`, `phases_live`), **merged** into whatever the project's own CLI already wrote there, so the richer `checkpoints`/`runs` tables the scorer's checkpoint leg reads survive untouched. 2. Score + move — `collect`'s scorer over every live phase, then the same rehearsed `_apply_checked` moves. 3. Render — `dashboard.md` + `dashboard.html`. 4. Push — `claude/checkin-<date>` cut from a fresh `origin/main`, explicit paths, no force, never `main`, and refused before the branch is cut if `scripts/ledger_merge.py classify` calls the diff code. Allowed only when `gh auth status` succeeds AND the Cortex is clean on `main` — read before anything is written, because "clean" stops being true the moment the phases move. That is the cloud/laptop split, and it is also the default. 5. Summarise, by project, LAST — so a chat sees it above the fold: each project's paths, what its pull did, its phase counts, and every phase a human could act on today with its health verdict and the fenced, copy-ready prompt its state already has. `--dry-run` is the default and reaches nothing at all: it prints the exact pull command per project, the pull root, and every phase it would score. `--project KEY` narrows; `--skip-pull` re-scores offline, stamping the refresh from the newest manifest. `/cortex` is installed rather than merely advertised: the skill body is now the check-in sequence with the verbs as an appendix, and the committed `.claude`/`.codex` discovery links exist alongside the other 29 commands. Tests: dry-run listing, per-project pull-failure isolation (a fake `sync_cli` exiting 1 for one project — the other still pulls and every phase is still scored), manifest write and merge-not-clobber, `--skip-pull`, `--project`, the summary's ordering and by-project keying, the render leg leaving the board current, the no-push path, and the push refusal on a code-classified diff. No test runs a real `hpc/sync pull`. Stacked on #348 — retargets to main when it merges. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
This was referenced Sep 4, 2026
Base automatically changed from
feature/cortex-checkin-p1-shed-review-slot
to
main
September 4, 2026 13:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of the
cortex-checkinepic (#349). Stacked on #348 — retargets to main when it merges. The Cortex half is PyAutoLabs/PyAutoCortex#11, stacked on PyAutoCortex#10.What this adds
pyauto-brain cortex checkin— the verb behind "where is my science?". It composes the primitives phase 1 decoupled (run_pull,score_phase,_apply_checked,render_pages, the payload builders) and reasons nothing extra of its own:status: activerow ofprojects.yaml, plus any project owning a phase insubmitted | running— a dormant project with a job still out there is still out there. Each is pulled with its own<local_path>/<sync_cli> pull, the verb all seven implement. Output is streamed, not captured: a pull runs for minutes and the human is watching this one command. A non-zero exit is recorded against that project and the sweep continues.<pull root>/.cortex/pull.jsongetsproject/pulled_at/cmd/rc/phases_live— merged into whatever the project's own CLI already wrote there.autolens_profiling'shpc/syncwrites thecheckpoints/runstables that are the only window onto the RAL-onlycheckpoint.hdf5; clobbering them would blind the scorer's checkpoint leg.collect's scorer over every live phase, then the same rehearsed_apply_checkedmoves (running → pulled → awaiting-ruling).dashboard.md+dashboard.html.claude/checkin-<YYYY-MM-DD>cut from a freshorigin/main, explicit paths, no force, nevermain— and refused before the branch is cut ifscripts/ledger_merge.py classifycalls the diff code.local_path/mirror/ RAL root, what the pull did, phase counts, and every phase a human could act on today with its health verdict, the run dirs and logs the scorer touched, and the fenced copy-ready prompt its state already has.The push rule
--pushis allowed only whengh auth statussucceeds and the Cortex checkout is clean onmain— read before anything is written, since "clean" stops being true the moment the phases move. That is the whole cloud/laptop split and it is also the default: a laptop pushes without asking, a cloud session cannot and is told so. Stated in the output either way./cortex, installed rather than advertisedskills/COMMANDS.mdhas advertised/cortexsince the conductor was born;~/.claude/commands/cortex.mdnever existed. The skill body is now the check-in sequence (verbs demoted to an appendix), the staleplan/gates --graderows retired in phase 1 are gone, and the committed.claude/{commands,skills}+.codex/skillsdiscovery links exist alongside the other 29 commands.bin/install.shneeded no change — it already linksskills/<verb>/<verb>.md; nobody had run it since the skill was added.Tests
tests/test_cortex_conductor.pygains a check-in block over the existingboardfixture: the dry-run listing (projects, exact pull commands, phases, nothing written), dry-run-is-the-default, per-project pull-failure isolation (a fakesync_cliexiting 1 for one project — the other still pulls, every phase is still scored, the failure lands on the right project and the exit code is 1), manifest write, merge-not-clobber,--skip-pullrunning no CLI,--project, the summary's by-project keying and its position last, the render leg leavingdashboard --checkclean, the no-push path, the preflight refusing anything that is not a cleanmain, and the push refusing a code-classified diff. No test runs a realhpc/sync pull— every pull under test is a fake script, and no fixture names a real org or repo.python3 -m pytest -q: 874 passed, 3 failed →tests/test_gh_surface.pywas mine (the new skill body mentionsgh auth status; it now points atGITHUB_ACCESS.md) and is fixed; the twotests/test_branch_sweep.pyfailures reproduce unchanged on the phase-1 base and are not this branch's. Targeted re-run oftest_cortex_conductor.py+test_skill_install.py+test_gh_surface.py: 68 passed.Verified live, without touching RAL
checkin --dry-runagainst the real Cortex: 3 active projects (euclid,inference_programme,subhalo_validation), the exactcd … && hpc/sync pullfor each, 2 live phases (bothsubhalo_validation), andpush would be: yes. It SSHes nowhere.--applywas exercised only against fixtures, deliberately: a real pull is minutes of RAL traffic and the human's call.Noted, not fixed
bin/install.sh --check-project-discoveryreports pre-existing drift unrelated to this branch (batch/start_bundlemissing from the committed links,register_and_iterate/run_queuepresent and unwanted). Nothing checks it in CI. Left alone rather than swept into a cortex PR.Closes #349 (with PyAutoCortex#11).
🤖 Generated with Claude Code
https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6