Repository navigation
cortex: the schema and the repo skeleton — phase 1 of cortex-birth (PyAutoMind#379) - #1
Merged
Merged
Conversation
…PyAutoMind#379) Bootstrap of the run-and-ruling registry: AGENTS/README/REFERENCE in the Mind register, projects.yaml (restricted YAML subset, empty map, one commented worked example), epics.md with mind-half:, rulings/AGENTS.md (append-only, supersede-never-edit), the rolling-board batches docs with the one review grammar, policy copies, docs/schema_decisions.md (31 dated decisions), cortex_check.yml and ledger_merge.yml (trial-merge check), the repos_sync-generated CLAUDE.md / .claude/ and spliced AGENTS.md blocks, and the test fixtures (skeleton: one project, one phase per state, five rulings with one chain, one batch record + review; empty). scripts/ and tests/*.py follow in part B. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SESCzU1FcwktEAdTZfmf3j
… part B (PyAutoMind#379) scripts/cortex.py — check · gates · rule · move · new, stdlib only, main(argv), --root and --today on every verb; the light-header parser and in-place header editor; the restricted-YAML loop for projects.yaml; every check rule in REFERENCE.md as a leg over `root: Path`; gates grading with an injectable fetch (gh api first, urllib fallback, User-Agent pyautocortex). scripts/ledger_merge.py — the Mind's classifier re-pointed (phases/, rulings/, batches/, epics.md) plus the append-only leg: a `git diff --name-status` entry under rulings/ that is not `A` is code. tests/test_cortex.py (99) and tests/test_ledger_merge.py (24): both fixtures pass check unchanged; every check rule as a tmp_path mutation; every legal transition and every refused one; rule ids, supersession, --also fan-out; gates --grade/--write with an injected fetch; new; PyYAML parity. No fixture was changed. REFERENCE.md and docs/schema_decisions.md gain the choices the code forced (decisions 32–37): the `Reset:` key, `--pulled-to`, the typo-guard checks, the partition default, `--also` on accepted phases, the demotion removing `Gates-cleared:`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SESCzU1FcwktEAdTZfmf3j
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.
Summary
The Cortex skeleton — phase 1 of the
cortex-birthepic (PyAutoLabs/PyAutoMind#379). This PR decides what the Cortex is as files: a run-and-ruling registry (project → phase → runs → rulings) with the ten-state phase model, GitHub-ref gates, the append-only rulings ledger of record ("a verdict recorded only outside the Cortex does not exist"), the rolling-board batch schema, and one stdlib lifecycle script.AGENTS.md,REFERENCE.md,README.md,rulings/AGENTS.md,batches/**/AGENTS.md,batches/packets/TEMPLATE.md): phase header keys and the transition table; run lines in SLURM notation (342091_[0-8,10]) withpulled_to:/after:/resumes:/where:continuation lines; ruling idsR-YYYYMMDD-nn, one file per phase, chains not trees, supersede never edit; one review vocabularyaccept | rerun | drop | leave-to-finish; the laptop-lane closures quoted verbatim.projects.yaml— the science body map in a documented restricted YAML subset (stdlib-parsed, PyYAML-parity tested); code, not ledger, likerepos.yaml. Live map empty; rows are phase 3.scripts/cortex.py—check(hermetic; every rule in REFERENCE.md),gates [--grade [--write]](PR gates clear only on merge; closed-not-planned issues are dead gates; unreadable fails closed;--gradereports,--writeflips),rule,move,new. Minimal in-place header edits; injectable date and fetch.scripts/ledger_merge.py— the Mind's classifier withphases/ rulings/ batches/+epics.mdas ledger, plus append-only enforcement: any non-add status underrulings/**needs a human.cortex_check.yml(check + pytest on push/PR) andledger_merge.yml(auto-merge ledger-onlyclaude/**branches;cortex.py checkruns on the trial-merge tree so two branches assigning the same ruling id cannot both land).docs/schema_decisions.md— 37 dated entries: every choice the epic left open, so phase 2's Brain conductor reads decisions rather than guessing.tests/fixtures/skeleton(ten phases, one per state; five rulings incl. a chain and a leave-to-finish; a batch record and review) andtests/fixtures/emptyare the witness; 123 tests cover everycheckrule as a negative, every legal and refused transition,rule/gates/new, and the YAML-subset parity.repos_sync.py --write:CLAUDE.md, the session hook,.claude/settings.json, and the organism-map/history/remote blocks inAGENTS.md.Deviations from the phase prompt, all recorded in
schema_decisions.md:projects.yamlis code not ledger; no Mind PR (the hook propagation already fans out to every body-map row); noskills/, so noinstall.shchange.Scripts Changed
scripts/cortex.py(new, 1613 lines) — the five verbsscripts/ledger_merge.py(new) — classifier + append-only legtests/test_cortex.py,tests/test_ledger_merge.py,tests/fixtures/**.github/workflows/cortex_check.yml,.github/workflows/ledger_merge.ymlTest Plan
python3 scripts/cortex.py check --root tests/fixtures/skeleton→ OK (the witness);emptyand the live tree → OKpython3 -m pytest tests -q→ 123 passedrepos_sync.py --check --root <worktree>→ 15 legs OK with the Cortex checkout presentcortex_check.ymlgreen on this PRGenerated by the PyAutoLabs agent workflow.