Repository navigation
Cortex phase 3: private remotes for the Science-folder projects, and the body-map rows #382
Description
Overview
Phase 3 of the cortex-birth epic (ledger draft/feature/pyautocortex/cortex_birth_epic.md; phases 0–2 shipped in #377/#379/#380). The Cortex has a schema, a script, a conductor and a live dashboard, but its science body map projects.yaml is empty. This phase seeds it with real rows, gives the one remotable Science-folder project (subhalo_validation) a private PyAutoLabs remote, points the profiling repo's commentary ledger at the Cortex, and adds the pull manifest that phase 2's collect needs to score the checkpoint leg. Laptop lane throughout.
Reconnaissance settled the open questions: subhalo_validation is clean and remotable (15.9 MB tracked, largest file 1.44 MB, locally simulated datasets, no secrets); Science/euclid cannot get a PyAutoLabs remote under the no-Euclid-data rule (it tracks a DR1 tile-keyed catalogue CSV, already pushes to a personal remote, nests the Overleaf paper repo, is 34 GB) — ruling: remote: none, reason recorded; its code half already lives at PyAutoLabs/euclid_strong_lens_modeling_pipeline. Nothing in repos_sync.py requires a science repo in the Mind's body map; the org-enumerating settings sweep covers a new private repo without registration.
Plan
- Cortex: extend the
projects.yamlgrammar (status: planned, optionalnote:), seed the rows (inference_programme, subhalo_validation, euclid, euclid_dr1_prelim, dormant rows for the git-repo Science trees), record decisions 50–52, re-render the dashboard. - Projects (laptop lane): subhalo
.gitignoregaps, track the untracked pl_eff witness JSONs, README truth,sync.conf.example, pull-manifest hook inhpc/sync pull; profilingCORTEX.md+ manifest hook + mirror ignore; a real pull on both to prove the manifest lands; push subhalomainonce the human creates the private remote. - Brain:
collectgains the manifest's third lookup (checkpoints[<run dir>]). - No changes to
Science/euclid.
Detailed implementation plan
Schema extension (Cortex script, small)
projects.yaml needs two things the phase-1 grammar lacks: status: planned (for
euclid_dr1_prelim) and an optional free-text note: (the prompt's dormant rows).
scripts/cortex.py: PROJECT_STATUSES += ("planned",); note joins PROJECT_FIELDS
as the one optional field (_finish_row no longer lists it as missing); remote
accepts any owner/repo (already does) and the header comment says "the remote —
PyAutoLabs for active projects; a personal remote is recorded as a fact with a note:".
Tests + REFERENCE.md subset text + docs/schema_decisions.md 50.
The pull manifest (decision 40 → amended as decision 51)
<mirror or local_path>/.cortex/pull.json, written by each sync CLI's pull after the
last rsync (dry-run guarded — status calls pull --dry-run):
{"schema": 1, "pulled_at": "<ISO UTC>",
"checkpoints": {"<run dir relative to the pull root>": {"bytes": N, "mtime": "<ISO>"}},
"runs": {"<jobid or jobid_task>": {"checkpoint_bytes": N, "checkpoint_mtime": "<ISO>"}}}
Gathered by one ssh "$HPC_HOST" "find '<ral_root>/output' -name checkpoint.hdf5 -printf '%s %T@ %p\n'"
over the existing ControlMaster mux, before the manifest write. checkpoints is always
filled (keyed by run-dir path — the only key the RAL tree can name); runs is filled
only where the CLI can link a job id to a run dir (subhalo's .out names the sample;
profiling cannot — leave runs empty there). Brain collect gains the third lookup
(runs[ident] → runs[stem] → checkpoints[<resolved run dir rel>]) in a two-line
change + test. .cortex/ is gitignored in every project (it is pull state, like
output/).
Files
/mnt/c/Users/Jammy/Science/subhalo_validation (direct commits on main; human creates the remote)
.gitignore: addhpc/batch_gpu/output/*,hpc/batch_gpu/error/*(+.gitkeep
negations like the cpu pair),.cortex/,*.hdf5,*.dill.output/,dataset/raw|reduced|external,
sync.confalready ignored; the simulateddataset/stays tracked (15 MB, not Euclid —
say so in the README).git add results/delaunay_adapt_split/pl_eff_0_no_subhalo.json pl_eff_1_outer_no_subhalo.json
(the witnesses the README promises).hpc/sync.conf.example(three keys, values as aliases) so a fresh clone has a template.hpc/syncpull()(:194-230): after thefor dirloop,[[ -z "$dryrun" ]] && write_pull_manifest→${PROJECT_ROOT}/.cortex/pull.json(bash +python3 -heredoc
for the JSON; keys per above;runslinked viahpc/batch_cpu/output/output.<jobid>_<task>.out
→ itsSample:/ output dir line when present).- README: the witness sentence made true; one paragraph "Rulings of record live in
PyAutoCortex (projects.yamlrowsubhalo_validation);wiki/project/state.mdand the
journal are commentary and cite ruling ids." - Human step:
gh repo create PyAutoLabs/subhalo_validation --private(empty), then
git remote add origin … && git push -u origin main. Witness:gh repo view … --json visibility→ PRIVATE;git ls-files results/lists the pl_eff pair; no tracked file5 MB, no
.fitsoutsidedataset/(git ls-files | grep -c '\.fits$'= the 15
simulated ones, all underdataset/).
/home/jammy/Code/PyAutoLabs/autolens_profiling (PR, branch feature/cortex-registration)
CORTEX.md(one paragraph: rulings of record live in PyAutoCortex;DECISIONS.mdis
commentary that cites ruling ids; the backfill is phase 4); link it from README.hpc/syncpull()(:183-203): afterpull_indices …,[[ -z "$dryrun" ]] && write_pull_manifest→${LOCAL_PULL_ROOT}/.cortex/pull.json(checkpointsonly);
.cortex/added to the mirror's.gitignore(the mirror is a local repo — commit that
one-liner there; it stays remote-less).hpc/sync.conf.examplegains nothing;hpc/READMEmentions the manifest.
/mnt/c/Users/Jammy/Science/euclid — no changes (ruling: remote: none).
PyAutoCortex (PR, branch feature/cortex-registration)
scripts/cortex.pyschema extension (above) +tests/test_cortex.pycases
(plannedlegal;noteoptional; unknown field still an error).projects.yamlrows (in-grammar, PyYAML-parity):inference_programme: remotePyAutoLabs/autolens_profiling, local_path
/home/jammy/Code/PyAutoLabs/autolens_profiling, ral_root
/mnt/ral/jnightin/autolens_profiling, mirror/mnt/c/Users/Jammy/Science/inference_programme,
sync_clihpc/sync, sync_verbs[pull, logs, status, submit, jobs, sacct, cancel, tail, du, check],
ledgerresults/notes/inference/PROGRAMME.md, witness_fileresults/searches/**/*.json,
partitionboth, statusactive, note "DECISIONS.md is commentary; pull-only CLI — RAL is a git checkout; gpu-1 excluded".subhalo_validation: remotePyAutoLabs/subhalo_validation, local_path
/mnt/c/Users/Jammy/Science/subhalo_validation, ral_root/mnt/ral/jnightin/subhalo_validation,
mirrornone, sync_clihpc/sync, sync_verbs[push, pull, logs, sync, push-data-init, pull-full, status, submit, push-submit, jobs, sacct, cancel, wait-and-pull, tail, du, check, clear-logs],
ledgerwiki/project/state.md, witness_fileresults/**/*.json, partitionral,
statusactive, note "pulls land in the checkout (PULL_DIRS output results); run_chain.sh chains A→B afterok; witness evidence_increase < 5, subhalo_stage, test_mode".euclid: remotenone, local_path/mnt/c/Users/Jammy/Science/euclid, ral_root
/mnt/ral/jnightin/euclid_strong_lens_modeling_pipeline, mirrornone, sync_cli
hpc/sync, sync_verbs[push, pull, sync, status], ledgerCLAUDE.md, witness_file
catalogue/**/*.csv, partitionboth, statusactive, note "NO PyAutoLabs remote by ruling 2026-09-01: tracks DR1 tile-keyed catalogue CSV, personal remote Jammy2211/euclid-dr1-modeling, nested Overleaf paper repo, 34 GB; code half = PyAutoLabs/euclid_strong_lens_modeling_pipeline; witness undefined until a science phase pre-registers one".euclid_dr1_prelim: remotenone, local_path/mnt/c/Users/Jammy/Science/euclid_dr1_prelim,
ral_root/mnt/ral/jnightin/euclid_dr1_prelim, mirrornone, sync_clihpc/sync,
sync_verbs[push, pull, sync, status], ledgerwiki/project/state.md, witness_file
results/**/*.json, partitionboth, statusplanned, note "created by euclid-dr1-prep phase 4 (a Cortex phase after migration); every path is the planned one".- dormant rows (git repos only; non-git trees
subhalo,euclid_group,z_*are storage,
skipped;aris_PJ011646is an assistant clone, skipped):profiling(remote none, note
"2026-05 checkpointed sweep harness, PyAutoNSS venv; name collides with autolens_profiling"),
cowls_diana(none),subhalo_simulations(none; "git init, zero commits, 21 GB"),
slope_hierarchy(Jammy2211/slope_hierarchy),pj011646(Jammy2211/PJ011646),
concr(Jammy2211/cosmology_and_cancer),ic50_workspace(Jammy2211/ic50_workspace)
— each withral_root=/mnt/ral/jnightin/<name>(planned/unknown, noted), mirror
none, sync_clihpc/sync, sync_verbs[pull](unverified, noted), ledgerREADME.md,
witness_fileresults/**/*.json, partitionboth. Keys must match^[a-z][a-z0-9_]*$
(sopj011646,arisnot needed).
projects.yamlheader: the boundary sentence "science repos are NOT added to
PyAutoMind/repos.yaml — that map is the workspace; this one is the science" and the
remote wording above.REFERENCE.mdsubset + fields;docs/schema_decisions.md50–52
(schema extension; manifest v1 schema + gather method +.cortex/ignored; the euclid
ruling and the dormant-row rules: git repos only, personal remotes recorded as facts).python3 scripts/cortex.py checkOK with the rows;pytest tests -qgreen;
dashboard --cortex . --applyso the Projects table renders the rows (commit the render;
the Cortexdashboard_refresh.ymlPR check must be clean).
PyAutoBrain (PR, branch feature/cortex-registration) — tiny
_cortex.pycollect: manifestschema1 reader with the third lookup
(checkpoints[<run dir rel>]),pull.jsonwritten to the tmp mirror in the existing
collect tests; docs line inagents/conductors/cortex/AGENTS.md.
Execution (Opus)
/create_issue→ PyAutoMind#…; prompt →active/;active.mdstatus: workspace-dev,
worktree~/Code/PyAutoLabs-wt/cortex-registrationfor **PyAutoCortex + autolens_profiling- PyAutoBrain** (the Science-folder repo is edited in place on its own
main— it is not a
workspace repo and has no worktree helper; the subagent works there directly with explicit
pathspecs; the mirror likewise).
- PyAutoBrain** (the Science-folder repo is edited in place on its own
- Slice A (Cortex + Brain): schema extension, rows, decisions, render, collect lookup, tests.
- Slice B (projects, laptop lane): subhalo
.gitignore/witnesses/README/sync.conf.example/
manifest hook + commit on main; profilingCORTEX.md+ manifest hook + mirror ignore; a real
hpc/sync pullon both projects to prove the manifest lands (read-only on RAL; rsync
--updateso only new files transfer); then, after the human creates the private remote,
push subhalomainand verify the witness. - Ship: Cortex PR → Brain PR (either order; Cortex first keeps the render honest) →
autolens_profiling PR;/prmper the standing authorisation; the subhalo push is not a PR.
Human steps (please do when the plan is approved — the rest proceeds around them)
! gh repo create PyAutoLabs/subhalo_validation --private --description "Validation of DM-subhalo SLaM detection pipelines on simulated no-subhalo lenses (science project; witness JSONs tracked, outputs local)"
and confirm the euclid ruling (remote: none, reasons above) — approving this plan is that
confirmation unless you say otherwise.
Verification
- Prompt witness:
projects.yamlrows for inference_programme, subhalo_validation, euclid,
euclid_dr1_prelim (planned) + dormant rows;git -C …/subhalo_validation ls-files results/
lists the pl_eff JSONs;gh repo view PyAutoLabs/subhalo_validation --json visibility→
PRIVATE. cortex.py checkOK; Cortexpytestgreen;yaml.safe_load(projects.yaml)parity test
green; dashboard Projects table shows every row; Brainpytestgreen.- Both manifests exist after a real pull, with
pulled_atand ≥1checkpointsentry
(subhalo has live checkpoints on RAL; profiling should too underoutput/searches);
cortex collecton a synthetic member reports the checkpoint leg from the manifest. - Pushed subhalo
main: no file > 5 MB, no.fitsoutsidedataset/, nosync.conf.
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoCortex | main | clean |
| ./PyAutoBrain | main | clean |
| ./autolens_profiling | main | (surveyed at worktree creation) |
| /mnt/c/Users/Jammy/Science/subhalo_validation | main (no remote) | 2 untracked witness JSONs |
Suggested branch: feature/cortex-registration (worktree root ~/Code/PyAutoLabs-wt/cortex-registration/)
Original Prompt
Click to expand starting prompt
Cortex phase 3 — private remotes for the Science-folder projects, and the body-map rows
Type: feature
Target: pyautocortex
Repos:
- PyAutoCortex
- autolens_profiling
Themes: - hpc-gpu
- mind-workflow
Difficulty: medium
Autonomy: supervised
Priority: high
Status: draft
Consequence: judge
Witness:projects.yamlhas rows for inference-programme, subhalo_validation, euclid, euclid_dr1_prelim (planned) and every other Science-folder tree asdormant;git -C /mnt/c/Users/Jammy/Science/subhalo_validation ls-files results/lists the pl_eff witness JSONs;gh repo view PyAutoLabs/subhalo_validation --json visibilitysays PRIVATE
Review-minutes: 15
Unattended: never
Lane: local-dev
Epic: cortex-birth
Phase: 3
Parent: draft/feature/pyautocortex/cortex_birth_epic.md
Filed: 2026-09-01
Phase 3 of 7 in the PyAutoCortex birth epic. Gate: phase 1 (the
projects.yaml schema). May overlap phase 2. Gates phase 4. Laptop lane
throughout — the projects live under /mnt/c/Users/Jammy/Science/ and the
remotes are created by the human.
Context (ruled 2026-09-01)
Each Science-folder project gets a private PyAutoLabs remote holding code,
config, wiki and witness result files only. Outputs, checkpoints and laptop
mirrors stay local and gitignored. No Euclid data files of any kind —
consortium-controlled, private repo or not. The inference_programme mirror
stays remote-less ("holds data, not science"). PyAutoLabs rather than a
personal account so repo_settings.yml's live org enumeration applies policy
to them; the personal-repo convention applies to papers, not projects.
State of the trees today (audit 2026-09-01): subhalo_validation is a local git
repo, no remote, not in any body map; its README says the witness JSONs are
tracked but the pl_eff pair is untracked. Science/euclid is the private DR1
source-of-truth tree with no remote. euclid_dr1_prelim does not exist yet
(euclid-dr1-prep phase 4 creates it). inference_programme is the profiling
mirror (LOCAL_PULL_ROOT), local git, no remote by design. Other trees:
PJ011646, aris_PJ011646, concr, cowls_diana, euclid_group,
ic50_workspace, profiling (2026-05 sweep harness — name collides with
autolens_profiling), slope_hierarchy, subhalo, subhalo_simulations,
z_dataset, z_projects_complete/, z_vault.
Task
subhalo_validation: write a.gitignorethat excludesoutput/,
hpc/batch_*/output/,hpc/batch_*/error/,*.zip,*.hdf5,*.dill,
dataset/FITS, and keepsscripts/,simulators/,config/,hpc/
(scripts andsync, notsync.conf),wiki/,results/**/*.json,
results/figures/*.jpg. Track the untracked pl_eff witness JSONs. Human
createsPyAutoLabs/subhalo_validationprivate; pushmain. Fix the README
line that claims the witnesses are tracked so it is true.Science/euclid: same pattern, with a data audit first: list every
file over 1 MB and every.fits/.h5/catalogue CSV, and confirm with the
human which are consortium data before any remote exists. Push only after
that list is ruled on. If the ruling is "too entangled", record the reason in
projects.yaml(remote: none — data-entangled, see ruling R-…) and move on
— the epic does not block on it.autolens_profiling: already has a remote. Add aCORTEX.mdpointer
(one paragraph: "rulings of record live in PyAutoCortex; DECISIONS.md is
commentary and cites ruling ids") — the DECISIONS backfill itself is phase 4.projects.yamlrows in the Cortex, from the audit's where-to-look table:inference-programme: repoautolens_profiling, RAL
/mnt/ral/jnightin/autolens_profiling(git checkout), mirror
/mnt/c/Users/Jammy/Science/inference_programme(no remote), sync
hpc/sync(pull-only:pull logs status submit jobs sacct cancel tail du check— no push by design), ledger
results/notes/inference/PROGRAMME.md+DECISIONS.md, witness result
JSON (results/searches/**/hpc_hpc_a100_fp64_*.json: stamp +target_id+
provenance triple), partitiongpu(gpu-1 excluded) +ral.subhalo_validation: local/mnt/c/Users/Jammy/Science/subhalo_validation,
RAL/mnt/ral/jnightin/subhalo_validation(rsync), mirror = project
itself (PULL_DIRS=(output results)), synchpc/sync(push/pull/
push-submit/wait-and-pull/…) +hpc/run_chain.sh, ledger
wiki/project/state.md+ journal +results_summary.md, witness
results/<pipeline>/<lens>_no_subhalo.json→evidence_increase(< 5),
subhalo_stage,test_mode, partitionral.euclid: local/mnt/c/Users/Jammy/Science/euclid, pipeline repo
euclid_strong_lens_modeling_pipeline, RAL
/mnt/ral/jnightin/euclid_strong_lens_modeling_pipeline, synchpc/sync
(push pull sync status; submit from the cluster), ledger: none (the
euclid-dr1-prep epic file until phase 4 migrates it), witness: undefined
until the science phase pre-registers one.euclid_dr1_prelim:status: planned, everything elsetbd— created by
euclid-dr1-prep phase 4.- Every other tree above:
status: dormant,local_pathonly, one-line
note:(e.g.profiling: "2026-05 checkpointed sweep harness, PyAutoNSS
venv; name collides with autolens_profiling").
- Add the three private remotes to
PyAutoMind/repos.yaml? No. The Mind's
body map is the workspace; science projects are the Cortex's body map. Record
that boundary inprojects.yaml's header comment.
Acceptance
- The witness above;
cortex.py checkpasses with the seeded rows; each
pushed remote'smaincontains no file over the size the human ruled and no
.fits. - Commits on the project repos'
main(they are not PR-shaped repos; the
Cortex PR carriesprojects.yaml).
Out of scope
- Unifying the three
hpc/syncCLIs (deferred; epic ledger). - Moving any tree out of
/mnt/c/Users/Jammy/Science/. - Creating
euclid_dr1_prelim(euclid-dr1-prep phase 4, which will by then be a
Cortex phase).
Activity
prompt: file issue + route cortex-registration (#382) → start_workspace
prompt: heart-ack for cortex-registration (#382)
Jammy2211 commentedon Sep 2, 2026
Shipped
Phase 3 of the
cortex-birthepic — private remotes for the Science-folder projects, and the body-map rows.PRs merged
5fa9cf0):projects.yamlseeded with eleven rows; grammar gainsstatus: plannedand an optional quotednote:; decisions 50–52; dashboard re-rendered.cortex.py checkOK,pytest tests -q→ 130 passed.Cortex Check+Dashboard Refreshgreen on the PR and again onmain;Pages Dashboardgreen and https://pyautolabs.github.io/PyAutoCortex/ serves 200.af73219):cortex collectreads the pull manifest's v1checkpointstable (lookupruns[ident]→runs[stem]→checkpoints[<run dir>];bytes: 0is FAIL; a manifest with noschemastill reads as the phase-2 shape).pytest tests -q→ 744 passed;Brain Testsgreen on 3.12 and 3.13.e0c85ee):CORTEX.mdpointer +README.mdline;hpc/sync pullwrites<LOCAL_PULL_ROOT>/.cortex/pull.json(schema 1, dry-run guarded,gather_errornever breaks a pull).lintgreen.subhalo_validation — pushed to its new PRIVATE remote
PyAutoLabs/subhalo_validationat8ba3875(direct tomain, no PR: the repo is not a workspace repo). Three witness JSONs are now tracked underresults/delaunay_adapt_split/(twopl_eff_*, onepl_sersic_*).euclid ruling —
remote: none: the euclid tree tracks a DR1 tile-keyed catalogue CSV, already pushes to a personal remote (Jammy2211/euclid-dr1-modeling), nests the Overleaf paper repo and weighs 34 GB, so it is not a PyAutoLabs repo — its code half already lives atPyAutoLabs/euclid_strong_lens_modeling_pipeline.Manifests proven by real pulls, not fixtures —
autolens_profilingwrote 2 checkpoints (live nautilus point-source searches);subhalo_validationwrote 0, correctly, because no search is in flight there. The real pull is also what caught the key bug: the checkpoint lives at<run dir>/files/search_internal/checkpoint.hdf5, so the manifest key is the run directory (the grandparent), not thefiles/directory it was first keyed by.Closing as completed. Phases 0–3 are shipped; phase 4 is
draft/feature/pyautocortex/cortex_migration_split_epics.md.complete: cortex-registration (#382) — cortex-birth phase 3 shipped