diff --git a/AGENTS.md b/AGENTS.md index a2931e62..561b9a20 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,13 +16,14 @@ Canonical boundaries live in `PyAutoBrain/ORGANISM.md`; the full body map | Organ | Repo | Role | |-------|------|------| -| **Mind** | PyAutoMind | Intent, goals, priorities, workflow state; every task starts as a markdown prompt here. | | **Brain** | PyAutoBrain | Reasoning/orchestration layer; how work is decomposed and routed; the specialist agents. | -| **Hands** | PyAutoHands | Packaging, tagging, notebook generation, PyPI release execution. | -| **Heart** | PyAutoHeart | Health/readiness — the authoritative "is it safe to release?" verdict. | +| **Mind** | PyAutoMind | Intent, goals, priorities, workflow state; every task starts as a markdown prompt here. | +| **Cortex** | PyAutoCortex | The Cortex — where the organism learns what is true: the science body map (`projects.yaml`) and the rulings of record for every science run; the science mirror of the Mind (runs and rulings, not prompts and PRs). | | **Memory** | PyAutoMemory | Long-term scientific/software/project knowledge (see science pointer below). | -| **Gut** | PyAutoGut | Owns the lifecycle of condemned self-material (stale branches, stashes, dead code/tests): holds it as durable, recoverable git refs through a transit window and voids it on a sweep. The storage mirror of Memory (retention vs release). | +| **Heart** | PyAutoHeart | Health/readiness — the authoritative "is it safe to release?" verdict. | +| **Hands** | PyAutoHands | Packaging, tagging, notebook generation, PyPI release execution. | | **Nerves** | PyAutoNerves | The Nerves — the configuration/serialization layer connecting workspace conventions to libraries (layered config, version handshake, test_mode), delivered as the `autonerves` package. | +| **Gut** | PyAutoGut | Owns the lifecycle of condemned self-material (stale branches, stashes, dead code/tests): holds it as durable, recoverable git refs through a transit window and voids it on a sweep. The storage mirror of Memory (retention vs release). | Call chain (always this order): **Brain → Heart (gate) → Build (execute)**. Brain agents are **conductors** (front-door; a human drives them; they decide *and* act) or **faculties** (read-only opinions the conductors consult; they judge and stop). New capability grows as a faculty, not a new organ, unless it owns state or effects no existing organ can. diff --git a/ORGANISM.md b/ORGANISM.md index 95ec4137..0f909bb4 100644 --- a/ORGANISM.md +++ b/ORGANISM.md @@ -12,13 +12,14 @@ organs plan, build, test and release it, and you make every judgment call. | Organ | Repo | Role and boundary | |-------|------|-------------------| -| **Mind** | PyAutoMind | Decides *what* — intent, goals, priorities, workflow state, the prompt registry and taxonomy. Also holds the body map (`repos.yaml`, the single source of repo identity). | | **Brain** | PyAutoBrain | Figures out *how* — reasoning, planning, decomposition, routing; hosts the specialist agents. Owns **no state, no health checks, no execution mechanics**. | +| **Mind** | PyAutoMind | Decides *what* — intent, goals, priorities, workflow state, the prompt registry and taxonomy. Also holds the body map (`repos.yaml`, the single source of repo identity). | +| **Cortex** | PyAutoCortex | Learns *what is true* — the science body map (`projects.yaml`) and the rulings of record for every science run; the science mirror of the Mind (runs and rulings ↔ prompts and PRs). The Mind decides what to build, the Brain routes the work and executes nothing, the Cortex learns what is true. A verdict recorded only outside the Cortex does not exist: project ledgers are commentary that cite the ruling. | +| **Memory** | PyAutoMemory | Long-term knowledge — *what the science says* (literature wikis, concepts, bibliographies). Operational history — *what the organism did* — lives in Mind (the `complete/` records, issues), not here. | | **Heart** | PyAutoHeart | Determines whether the organism is healthy. `pyauto-heart readiness` is the **authoritative** GREEN/YELLOW/RED "is it safe to release?" gate. An observer: never writes into other repos, never triggers Build. | | **Hands** | PyAutoHands | Builds and releases — packaging, tagging, notebook generation, PyPI via `release.yml`. A pure executor: runs no readiness checks and never re-derives a gate decision. | -| **Memory** | PyAutoMemory | Long-term knowledge — *what the science says* (literature wikis, concepts, bibliographies). Operational history — *what the organism did* — lives in Mind (the `complete/` records, issues), not here. | +| **Nerves** | PyAutoNerves | The configuration/serialization layer (`autonerves`) — layered config with overrides, the workspace↔library version handshake, `test_mode`, FITS/JSON I/O. Connects the organism's conventions to every library; the base layer the scientific libraries all import. | | **Gut** | PyAutoGut | Owns the lifecycle of *condemned self-material* — stale branches, stashes, dead code/tests. Holds each as a durable, recoverable git ref through a transit window and **voids** it on a sweep. The storage mirror of Memory (retention ↔ release); the hygiene conductor drives it, as vitals reads Heart. | -| **Nerves** | PyAutoNerves | The configuration/serialization layer (`autonerves`) — layered config with overrides, the workspace↔library version handshake, `test_mode`, FITS/JSON I/O. Connects the organism's conventions to every library; the base layer the scientific libraries all import. The seventh organ. | *Hands* and *Build* name the **same organ** (PyAutoHands) throughout this document: the organ is the **Hands**, and *Build* is the call-chain step it @@ -65,8 +66,12 @@ human types); let faculties multiply behind them. New capability grows as a **faculty** (cheap: one directory, one doc, one script), not as a repo. A new organ costs an `AGENTS.md`, a `CLAUDE.md` stub, install wiring, a body-map row and boundary prose — it must earn that by -owning state or effects no existing organ can. Configuration/signalling is the -one standing exception that already earned organ status: it is the **Nerves** +owning state or effects no existing organ can. Two capabilities have earned +organ status that way. Configuration/signalling is the **Nerves** (PyAutoNerves), the base config/serialization layer every library imports — new -config surfaces belong there, not in a new organ. The human interaction layer -is the command surface (`/route` + the verb commands), which is part of Brain. +config surfaces belong there, not in a new organ. Learning what is true is the +**Cortex** (PyAutoCortex), the second organ to earn it: it owns state no organ +owned before — the science body map and the rulings of record — so science +runs and their verdicts belong there, not in the Mind. The human interaction +layer is the command surface (`/route` + the verb commands), which is part of +Brain. diff --git a/README.md b/README.md index e173203d..c503753b 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,10 @@ bin/pyauto-brain vitals # read the Heart's readiness verdict bash bin/install.sh # symlink every organ's skills into ~/.claude ``` -The seven organs the Brain coordinates — Mind (intent), Brain (reasoning), -Heart (health), Hands (release), Memory (knowledge), Gut (shedding), Nerves -(configuration) — are defined once in [ORGANISM.md](ORGANISM.md), which this +The eight organs the Brain coordinates — Brain (reasoning), Mind (intent), +Cortex (learning what is true), Memory (knowledge), Heart (health), Hands +(release), Nerves (configuration), Gut (shedding) — are defined once in +[ORGANISM.md](ORGANISM.md), which this repo hosts. Agent contracts and the generated command table are in [AGENTS.md](AGENTS.md). The full organism documentation — including how to fork it and lead your own — is at , diff --git a/agents/_pyauto_root.py b/agents/_pyauto_root.py index acc9ecfb..f1a0db40 100644 --- a/agents/_pyauto_root.py +++ b/agents/_pyauto_root.py @@ -45,11 +45,12 @@ # want) but a Brain-only remote session is still a legitimate root. SIBLING_ORGANS = ( "PyAutoMind", + "PyAutoCortex", + "PyAutoMemory", "PyAutoHeart", "PyAutoHands", - "PyAutoMemory", - "PyAutoGut", "PyAutoNerves", + "PyAutoGut", ) _BRAIN_HOME = Path(__file__).resolve().parents[1] diff --git a/bin/install.sh b/bin/install.sh index 4d0996ba..aa006f30 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -67,7 +67,7 @@ CODEX_HOME="${CODEX_HOME:-$HOME/.codex}" # are skipped, so this runs in a partial/web checkout. COMMANDS_BEGIN="" COMMANDS_END="" -ORGAN_REPOS=(PyAutoMind PyAutoBrain PyAutoHeart PyAutoHands PyAutoMemory) +ORGAN_REPOS=(PyAutoBrain PyAutoMind PyAutoMemory PyAutoHeart PyAutoHands) # Emit the canonical command-surface block (identical in every organ) to stdout, # sourced from the agent registry in bin/pyauto-brain — the single source of @@ -185,7 +185,7 @@ check_agents_surface() { # is checked out. The AGENTS.md command surface (above) still advertises the full # verb set + hosting organ. Generated + drift-checked — do not hand-edit these # dirs. Symlinks (single source = skills/), matching the user-level install. -DISCOVERY_REPOS=(PyAutoMind PyAutoBrain PyAutoHeart PyAutoHands autolens_profiling) +DISCOVERY_REPOS=(PyAutoBrain PyAutoMind PyAutoHeart PyAutoHands autolens_profiling) DISCOVERY_DIRS=(.claude/commands .claude/skills .codex/skills) # Emit the (linktarget) pairs a repo's committed discovery should contain, diff --git a/board/_theme.py b/board/_theme.py index 0649c855..301c961e 100644 --- a/board/_theme.py +++ b/board/_theme.py @@ -67,12 +67,6 @@ # hero: (lift, base) — the hero's radial gradient, echoing each logo's # vignette: a tinted lift behind the wordmark falling to near-black. ORGANS = { - "mind": { - "organ": "Mind", - "tagline": "Intent. Priority. Flow.", - "ink_light": "#0a7d72", "ink_dark": "#2ee6cf", "glow": "#00d1ba", - "hero": ("#07302b", "#000000"), - }, "brain": { "organ": "Brain", "tagline": "Reason. Plan. Decide.", @@ -80,6 +74,19 @@ "glow2": "#a855f7", "hero": ("#16234f", "#000312"), }, + "mind": { + "organ": "Mind", + "tagline": "Intent. Priority. Flow.", + "ink_light": "#0a7d72", "ink_dark": "#2ee6cf", "glow": "#00d1ba", + "hero": ("#07302b", "#000000"), + }, + "memory": { + "organ": "Memory", + "tagline": "Remember. Learn. Evolve.", + "ink_light": "#6b34d6", "ink_dark": "#b37eff", "glow": "#b37eff", + "glow2": "#8b5cf6", + "hero": ("#221345", "#000000"), + }, "heart": { "organ": "Heart", "tagline": "Check. Validate. Protect.", @@ -92,13 +99,6 @@ "ink_light": "#9a5400", "ink_dark": "#ffa733", "glow": "#ff9201", "hero": ("#372100", "#000000"), }, - "memory": { - "organ": "Memory", - "tagline": "Remember. Learn. Evolve.", - "ink_light": "#6b34d6", "ink_dark": "#b37eff", "glow": "#b37eff", - "glow2": "#8b5cf6", - "hero": ("#221345", "#000000"), - }, # The umbrella is the one board with no logo to sample: the accent and # the tagline are designed to sit in the family rather than read off a # file. Replace both from the logo if that repo ever grows one. @@ -122,30 +122,6 @@ # are ~1KB of path data, stay sharp on any screen, and take the accent. # Keep them that way — a mark is a logo's glyph in line art, not a rendering. MARKS = { - # Mind — a left-facing head profile, a check inside the skull, three - # node-tipped signal lines leaving the back of the head, inside a ring. - "mind": ( - '' - '' - '' - '' - '' - '' - '' - '' - '' - ), # Brain — a circuit brain: two lobed hemispheres either side of a spine, # each branching into elbowed, node-tipped traces, inside a ring. "brain": ( @@ -187,6 +163,61 @@ '' '' ), + # Mind — a left-facing head profile, a check inside the skull, three + # node-tipped signal lines leaving the back of the head, inside a ring. + "mind": ( + '' + '' + '' + '' + '' + '' + '' + '' + '' + ), + # Memory — an open book with a node-tree growing out of its spine and a + # scatter of stars, under an arc open at the bottom. + "memory": ( + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + ), # Heart — a heart outline crossed by an ECG trace, with the check badge # sitting in the ring's lower-right gap. "heart": ( @@ -222,37 +253,6 @@ '' ), - # Memory — an open book with a node-tree growing out of its spine and a - # scatter of stars, under an arc open at the bottom. - "memory": ( - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - '' - ), # Umbrella — no logo to sample, so the family language (ring, line-art, # node dots) applied to the double helix the board already carried. "organism": ( diff --git a/config/policy.yaml b/config/policy.yaml index 01c1b449..fe3ac983 100644 --- a/config/policy.yaml +++ b/config/policy.yaml @@ -164,9 +164,9 @@ board: # (yaml) and by the Mind renderer's footer (stdlib regex on this block — # keep one `name: Repo` pair per line). boards: - mind: PyAutoMind brain: PyAutoBrain + mind: PyAutoMind + memory: PyAutoMemory heart: PyAutoHeart hands: PyAutoHands - memory: PyAutoMemory organism: PyAutoScientist diff --git a/docs/concepts/organism.md b/docs/concepts/organism.md index 6e613d54..9f766241 100644 --- a/docs/concepts/organism.md +++ b/docs/concepts/organism.md @@ -9,11 +9,12 @@ it and adds the framework/instance distinction an adopter needs. | Organ | Repo | Job | |-------|------|-----| -| **Mind** | PyAutoMind | Decides *what* — intent, goals, priorities, workflow state, the prompt registry, and the body map (`repos.yaml`). | | **Brain** | PyAutoBrain | Figures out *how* — reasoning, planning, routing; hosts the specialist agents. Owns no state, no health checks, no execution mechanics. | +| **Mind** | PyAutoMind | Decides *what* — intent, goals, priorities, workflow state, the prompt registry, and the body map (`repos.yaml`). | +| **Cortex** | PyAutoCortex | *Learns what is true* — the science body map (`projects.yaml`) and the rulings of record for every science run; the science mirror of the Mind (runs and rulings ↔ prompts and PRs). The Mind decides, the Brain routes, the Cortex learns; a verdict recorded only outside the Cortex does not exist. | +| **Memory** | PyAutoMemory | *Knows* — long-term domain knowledge: literature wikis, concepts, bibliographies. Pull-only; consulted, never load-bearing at runtime. | | **Heart** | PyAutoHeart | Decides whether the organism is *healthy*. `pyauto-heart readiness` is the authoritative GREEN/YELLOW/RED release gate. An observer: never writes into other repos, never triggers a build. | | **Hands** | PyAutoHands | *Does* — packaging, tagging, notebook generation, PyPI releases. A pure executor: never re-derives a gate decision. | -| **Memory** | PyAutoMemory | *Knows* — long-term domain knowledge: literature wikis, concepts, bibliographies. Pull-only; consulted, never load-bearing at runtime. | | **Gut** | PyAutoGut | *Sheds* — the lifecycle of condemned self-material (stale branches, stashes, dead code/tests): holds each as a durable, recoverable git ref through a transit window, then **voids** it on a sweep. The storage mirror of Memory (retention ↔ release); the hygiene conductor drives it, as vitals reads Heart. | Everything else — the libraries being developed, their example workspaces, @@ -34,16 +35,16 @@ organ has to be trusted to police itself. ## Framework vs instance -The six organs split on one line that matters for adoption: +The organs split on one line that matters for adoption: - **Framework organs — Brain, Heart, Hands.** Code, agents, checks, pipelines. Domain facts appear only in declared config surfaces (tables and policy files, not logic), and a drift check — the {ref}`tenant firewall ` — keeps it that way. -- **Instance organs — Mind, Memory, Gut.** Committed state, knowledge, and - shed material. These are *inherently yours*: an adopter never forks the - upstream Mind, Memory or Gut content, they create their own repos with the - same documented shape. +- **Instance organs — Mind, Cortex, Memory, Gut.** Committed state, rulings, + knowledge, and shed material. These are *inherently yours*: an adopter never + forks the upstream Mind, Cortex, Memory or Gut content, they create their own + repos with the same documented shape. One more principle worth knowing before you read anything else: **one canonical page per fact.** Organ boundaries live in ORGANISM.md; diff --git a/docs/index.md b/docs/index.md index cd164cb5..143bfaa8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,8 +2,9 @@ PyAutoScientist is a working, opinionated reference implementation of an **AI-agent development organism** for human-led, natural-language software -development: a set of six git repositories — Mind, Brain, Heart, Hands, -Memory, Gut — through which you lead a multi-repo project in plain English. You +development: a set of eight git repositories — Brain, Mind, Cortex, Memory, +Heart, Hands, Nerves, Gut — through which you lead a multi-repo project in +plain English. You describe what you want; AI agents plan, implement, test, gate and release it; you make every judgment call. @@ -52,11 +53,12 @@ concepts/workflow :caption: The organs :maxdepth: 1 -organs/mind organs/brain +organs/mind +organs/cortex +organs/memory organs/heart organs/build -organs/memory organs/gut ``` diff --git a/docs/organs/cortex.md b/docs/organs/cortex.md new file mode 100644 index 00000000..51025862 --- /dev/null +++ b/docs/organs/cortex.md @@ -0,0 +1,59 @@ +# Cortex — PyAutoCortex + +**What it owns:** the *science body map* (`projects.yaml` — each science +project's repo and remote, local path, RAL root, laptop mirror, sync CLI, +ledger and witness file) and the **rulings of record** for every science run. +The Cortex is the science mirror of the Mind: the Mind holds prompts and PRs, +the Cortex holds runs and rulings. *The Mind decides what to build, the Brain +routes the work and executes nothing, the Cortex learns what is true.* + +**Repo:** [PyAutoLabs/PyAutoCortex](https://github.com/PyAutoLabs/PyAutoCortex) + +## The defining function: learning + +A science phase begins as a **pre-registered question with a witness** — the +file or number that will settle it — before anything is submitted. The run +happens on RAL or the laptop; its evidence (`.err`, checkpoints, witness +JSONs, figures) is **pulled** to the laptop; the human inspects it and records +a **ruling**: *accept*, *rerun* or *drop*. That ruling is the organism +learning something. + +The **ruling-of-record rule:** a verdict recorded only outside the Cortex +does not exist. Project ledgers (a `DECISIONS.md`, a `RESULTS.md`, a project +wiki's `state.md`) remain as scientific commentary — evidence, reasoning, +consequences — and cite the ruling id. Rulings are append-only: a superseded +ruling is never edited, a new one supersedes it. + +## Gates + +A science phase declares what it waits on as GitHub issue and PR references, +in the `Blocked-by:` grammar the Mind already uses. A daily grading job flips +a phase from *gated* to *ready* when every reference closes. The Mind learns +nothing about the Cortex beyond a render-time badge — "gates a Cortex phase" +— on the development issue in question. One grammar, one direction. + +## The driver split + +The Cortex *holds runs and rulings*; it decides nothing. The Brain's cortex +conductor (phase 2) does the reasoning — renders the board, grades the gates, +plans and collects batches — the same split as **Heart ↔ vitals** and +**Gut ↔ hygiene**: the organ keeps the state, the conductor reasons over it. + +## Batches + +Cortex batches are a **rolling board**, not a review-at-once slot: a member +joins the review when its results are pulled, and nothing mid-flight is +reviewable. They carry their own `review-at:`, separate from the Mind's +development batches — the two kinds of work keep the batch-processing API but +never share one batch. + +## For an adopter + +Like Mind, Memory and Gut, the Cortex is an **instance organ** — inherently +yours. You do not fork this repo's contents; you create your own Cortex with +the same shape, pointing at your own science projects and holding your own +rulings. + +The birth of this organ is tracked in the +[cortex-birth epic ledger](https://github.com/PyAutoLabs/PyAutoMind/blob/main/draft/feature/pyautocortex/cortex_birth_epic.md). +The repo is born empty; phase 1 fills it. diff --git a/tests/test_policy_seams.py b/tests/test_policy_seams.py index 43253be6..3f5764e0 100644 --- a/tests/test_policy_seams.py +++ b/tests/test_policy_seams.py @@ -103,6 +103,8 @@ def test_refactor_test_witness_loads(): # statement that the repo has no test suite — not a licence to skip one. WITNESS_EXEMPT = { "PyAutoGut": "no test suite (bin/ + docs only, verified at PyAutoBrain#269)", + "PyAutoCortex": "born empty 2026-09-01 (cortex-birth phase 0, PyAutoMind#377); " + "phase 1 adds tests/ and the test_witness row", }