Repository navigation
Description
Overview
Phase 2 of making the Cortex the main tool for managing Science projects (phase 1, cortex drift, shipped in #544). Today a new project is started by hand-copying an old one, so it never gets a register row and drift reports it as unregistered. The domain assistants' start-new-project already does the scaffolding. This adds the Cortex half, so that birth plus registration is one flow.
Plan
- New
cortex.py birthin PyAutoCortex: the second command allowed to writeprojects.yaml. It appends one validated row, opens the ledger, and rolls back if the result doesn't read back cleanly. - New
pyauto-brain cortex birth <key> --category active|development --assistant <name> --summary "…". It checks the scaffolded folder exists and has no row, then derives:local_pathandral_root(same category on RAL);- the remote (git origin, or
none); sync_verbsfrom the project'shpc/sync;- the ledger file.
- Dry run by default.
--applycutsclaude/birth-<key>from freshorigin/main, callscortex.py birth, commits, and pushes only if Cortex's own classifier calls the commit a birth (ledger). It then returns tomainand runsdrift. - It never creates a GitHub repo or touches RAL; it prints those commands for the human.
- The Brain's
cortexskill gains a "new project" section: the assistant'sstart-new-projectwith the targetScience/<category>/<key>, data fromScience/dataset/orScience/simulators/, thencortex birth. - Docs: Cortex REFERENCE.md (birth), AGENTS.md (two commands write
projects.yaml), decision 63.
Tier: judge — merge mode: human /prm
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary — conductor verb, skill, tests)
- PyAutoCortex (
scripts/cortex.py birth, tests, docs)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./organs/PyAutoBrain | main | clean |
| ./organs/PyAutoCortex | main | clean |
Suggested branch: feature/cortex-birth
Implementation Steps
PyAutoCortex/scripts/cortex.py:birth_project(root, key, row: dict, summary, today, issue, now)validates the key regex, that the key is unused, thatlocal_pathis unused, and that the fields are complete and quotable. It appends the row block at the end ofprojects.yamlinPROJECT_FIELDSorder, re-reads it withload_projects(restoring the file on any problem), thennew_ledger. CLIbirth <key> --local-path … --ral-root … --remote … --sync-verbs a,b --ledger … --assistant … --partition … --witness-file … --summary … [--issue] [--note]. Tests intests/.PyAutoBrain/agents/conductors/cortex/_cortex.py:birth_row(projects, key, category, assistant, …)derives the fields. The Science root comes fromscience_root_from. The RAL base is the most common<base>of the category-shapedral_roots. Remote fromgit remote get-url origin→owner/repo.sync_verbsfrom thehpc/synccase labels. Ledgerwiki/project/state.md→README.mdfallback.cmd_birthdry-run prints the row.--apply:push_preflight, cutclaude/birth-<key>, subprocesscortex.py birth, commit,ledger_merge.py classify --base origin/main(push only on 0), back tomain, thendrift_reportfiltered to the key.skills/cortex(Brain): a "Starting a new project" section.- Docs: Cortex
REFERENCE.md,AGENTS.md,docs/schema_decisions.md63; conductorAGENTS.md. - Tests: Brain conductor (derivation, dry-run writes nothing, refusals: no folder, existing key or path, wrong category) and Cortex (
birthappends, rolls back, refuses duplicates). - Verify end-to-end on a throwaway Cortex clone, never the real main: scaffold a dummy project dir,
birth --apply --no-push, thendriftis clean for it.
Key Files
PyAutoCortex/scripts/cortex.py,PyAutoCortex/tests/PyAutoBrain/agents/conductors/cortex/_cortex.py,PyAutoBrain/tests/test_cortex_conductor.py,PyAutoBrain/skills/cortex/
Original Prompt
Click to expand starting prompt
Cortex birth: scaffold, seed and register a Science project in one step
Type: feature
Target: cortex
Repos:
- PyAutoBrain
- PyAutoCortex
Themes: - science
- cortex
Difficulty: medium
Autonomy: human-required
Priority: high
Status: formalised
Consequence: judge
Filed: 2026-10-29
Parent: complete/2026/10/cortex-science-drift.md
Original request (verbatim)
"5) Bring this all together with PyAutoCortex which needs to become the main tool to manage Science
projects, its meant to be but hasnt been used as such for a while."
Follow-up (2026-10-29), approving the proposed next steps including "a new-project command that
scaffolds a project in active/ or development/, seeds it from dataset/ or simulators/ and
registers it in one step": "yeah do it", then "Merge, then Phase 2".
Context
Phase 1 (cortex drift, PyAutoBrain#544) shipped 2026-10-29: the register and the Science tree are
now compared on every census/check-in. Today a new project is started by hand-copying an older one,
so it gets no row and the drift check reports it as unregistered. Science layout:
/mnt/c/Users/Jammy/Workspace/Science/{active,development,complete,archive,dataset,simulators};
simulators share --dataset-path / --dataset-types (Science/simulators/AGENTS.md).
Scope (revised 2026-10-29, human-approved: "yes, file it and go")
Scaffolding stays with the domain assistant: autolens_assistant / autofit_assistant
skills/start-new-project.md is the single science-project skill, and the public assistants must
not learn the private Science tree or the Cortex. The Cortex adds only the registration half:
pyauto-brain cortex birth <key> --category active|development --assistant <name> --summary "<one line>" [--issue Repo#N] [--apply]: checksScience/<category>/<key>/
exists and has no row; deriveslocal_path,ral_root(<ral base>/<category>/<key>, base
from the other rows),sync_cli/sync_verbsfrom the scaffoldedhpc/sync,partition,
witness_fileandremote(git origin ornone); writes the row and runscortex.py new
on aclaude/birth-<key>branch (an add-only birth diff, which lands by itself); then runs
driftfor the new project. Dry run by default. Never creates a GitHub remote or touches RAL;
it prints those lines for the human.- The Brain's
cortexskill gains a "new project" section: run the assistant's
start-new-projectwith the targetScience/<category>/<key>, seeddataset/from
Science/dataset/<sample>orScience/simulators/<type>/<lens>.py --dataset-path dataset,
thencortex birth. - Docs: Cortex REFERENCE.md (birth) and schema decision 63.
Out of scope
Moving trees on RAL; output summaries on the board (draft/feature/cortex/output_summary.md).
Activity
Jammy2211 commentedon Oct 29, 2026
Library PRs created
cortex birthverb, the/cortex"Start a new project" section, testscortex.py birth, tests, docs, decision 63. Merge this first; the Brain PR's--applytests skip until it landsWorkspace impact: none (organ tooling). Tier judge: the human merges with
/prm.Open question: should a
development/birth's RAL path be.../development/<key>(mirroring the laptop, as drift expects) or stay under RALactive/like the four existing development projects?Heart RED override (development only)
Authorized by the live human on 2026-10-29: "I authorize development only heart override" (for PyAutoBrain#545, after the exact RED reasons were shown). Development ship only: commit, push, PR-open. Merge needs a separate human
/prmwith every required check green. No release.Exact RED reasons (
pyauto-heart readiness, 2026-10-29):None of these involves PyAutoBrain or PyAutoCortex. This branch does not fix them.
Passed branch gates: Brain
tests/test_cortex_conductor.py80 passed (3 end-to-end tests skip cleanly against a Cortex withoutbirth); Cortex 70 tests +cortex check: OK; no new lint beyond the file's existing idiom; smoke n/a (organ tooling); independent review FINDINGS, all addressed (below).🤖 Generated with Claude Code
Jammy2211 commentedon Oct 29, 2026
Shipped
Merged on 2026-10-29: PyAutoLabs/PyAutoCortex#79 (
cortex.py birth), then #546 (cortex birthverb plus the/cortex"Start a new project" section). The CI failure on #546 was the tenant firewall catching real owner and assistant names in new tests. Fixed with neutral names; CI green.The open question is resolved by the human: mirror on RAL. PyAutoLabs/PyAutoCortex#80 moved the four development trees and euclid on RAL, registered the storage folders as retired, and repointed
concr.cortex drifton main: none — projects.yaml and the Science tree agree.🤖 Generated with Claude Code