Skip to content

feat(cortex): drift check between the Science tree and projects.yaml - #544

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cortex-science-drift
Oct 29, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/cortex-science-drift

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #543 (phase 1 of making the Cortex the Science project manager; phase 2, cortex birth, follows as its own issue).

Summary

  • New read-only pyauto-brain cortex drift [--science-root PATH] [--json] compares the laptop Science tree (<root>/<category>/<project>) with projects.yaml. The root is derived from the rows' local_paths.
  • Errors (exit 1):
    • a folder in active/ or development/ with no row;
    • a non-retired row whose folder is gone;
    • a category that disagrees with the row's status;
    • a derived root that no longer exists while other rows' folders do. This is the 2026-10 incident: Science moved under Workspace\\, and pull reached 3 of 12 active projects.
  • Warnings:
    • an unregistered complete/ or archive/ folder (storage);
    • a ral_root in a different category from its local_path.
  • census and checkin (dry-run and apply) print a one-line summary. census() itself stays drift-free, so the board rendered in CI doesn't depend on the machine.

API Changes

None to the library API. The conductor gains a verb: cortex drift. census --json gains a top-level drift key (CLI output only, not in census()).

Review findings addressed

  • A symlinked --science-root (~/Science/Science) produced false unregistered errors and skipped the category checks. Paths now compare after realpath; there's a test.
  • checkin --dry-run (the default) didn't print the drift line. It does now; there's a test.
  • Clearer messages for a row with no local_path and for an explicitly given root.
  • Stated limit, with a test: detecting the laptop relies on some row's folder existing. The repo-backed ~/Code rows provide that today.
  • Plan step 6 expected 4 warnings on the real tree; there are 11, and all are genuine: the 4 development projects, euclid and euclid_dr1 RAL categories, and 5 unregistered storage folders.

Validation

Against the real tree with PyAutoCortex#77's register: 0 errors, 11 warnings, exit 0. Against the pre-#77 register: 12 errors, exit 1.

Companion: the PyAutoCortex PR on the same branch (docs, decision 62). Land PyAutoLabs/PyAutoCortex#77 first.

Heart RED override (development only)

Authorized by the live human on 2026-10-29: "I authorize" (for PyAutoBrain#543, after the exact RED reasons were shown). Development ship only: commit, push, PR-open. Merge needs a separate human /prm with every required check green. No release.

Exact RED reasons (pyauto-heart readiness, 2026-10-29):

  • PyAutoArray: 4 uncommitted source change(s)
  • PyAutoGalaxy: 9 commit(s) behind origin
  • PyAutoLens: 7 commit(s) behind origin
  • release validation incomplete: no rehearsal for current source
  • release push credential check stale (pyautolabs-bot, 49h old)

None of these involves PyAutoBrain or PyAutoCortex. This branch does not fix them.

Passed branch gates: Brain tests/test_cortex_conductor.py 71 passed (12 new); Cortex cortex check: OK + 65 tests; no new ruff findings; no smoke leg applies (no workspace or library code); independent review FINDINGS, all addressed (see below).

🤖 Generated with Claude Code

New read-only `cortex drift [--science-root PATH] [--json]` verb: compares
the laptop Science tree (<root>/<category>/<project>, root derived from the
rows' local_path) with projects.yaml. Errors: unregistered folder in
active/ or development/, a non-retired row whose folder is gone, category
vs status, a derived root that no longer exists while other rows' folders
do. Warnings: unregistered complete/archive folders (storage), a ral_root
in a different category. census and checkin (dry-run and apply) print a
one-line summary; census() itself stays drift-free so the CI-rendered
board is machine-independent. Paths compare after realpath, so the
~/Science/Science launch symlink matches.

Refs #543

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

feat(cortex): drift check between the Science tree and projects.yaml

1 participant