Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/commands/cortex.md
1 change: 1 addition & 0 deletions .claude/skills/cortex
1 change: 1 addition & 0 deletions .codex/skills/cortex
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ the `/<verb>` slash commands.
| `workspace` | The voice — the organism's expressive function: plan/survey workspace + HowTo example authorship (workspace\|howto registers) — WorkspaceDecision (never writes) | `bin/pyauto-brain workspace` |
| `eyes` | The perceptive function — the organism's sense of its own appearance: survey/review a visualization workspace's figure surface, critiques route to intake/start_dev — EyesSurvey/EyesReviewSurface (never renders, never edits) | `bin/pyauto-brain eyes` |
| `profiling` | The proprioceptive function — the organism's sense of its own effort: campaign/ingest/triage plans over the autolens_profiling workspace — ProfilingDecision | `bin/pyauto-brain profiling` |
| `cortex` | The learning function — where the organism finds out what is true: reason over PyAutoCortex (phases, gates, rulings), render its board, and check in on the runs — pull, score against the pre-registered witness, move what came back to awaiting-ruling; never submits a run, never writes a ruling | `bin/pyauto-brain cortex` |
| `cortex` | The learning function — where the organism finds out what is true: the science check-in over PyAutoCortex ('cortex checkin') — pull every active project through its own sync CLI, score every live run against its pre-registered witness, move what came back to awaiting-ruling, re-render the board and summarise it by project; never submits a run, never writes a ruling | `bin/pyauto-brain cortex` |
| `hygiene` | The maintenance function — the organism's sense of its own upkeep: code-quality debt (dev-loop cost + tidiness), delegating fixes — HygieneDecision | `bin/pyauto-brain hygiene` |
| `clone` | The Mitosis Agent: partition the reference assistant, analyze the domain, emit the CloneDecision; --apply --mode lightweight-seed delegates the seed birth to Build; 'clone sync' patches the reference's generic-file diff onto the born siblings (dry run by default; rejected hunks are a human decision) | `bin/pyauto-brain clone` |
| `build` | Coordinate execution: consult the vitals faculty, then delegate to PyAutoHands | `bin/pyauto-brain build` |
Expand Down
60 changes: 55 additions & 5 deletions agents/conductors/cortex/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
> **Tier: conductor** — a front-door agent you *drive*. The *learning
> function* — where the organism finds out what is true: it reasons over
> PyAutoCortex (the science body map, the pre-registered phases, the rulings
> of record), renders the Cortex board, lists what the gates are waiting on
> and scores what came back from a pull. It **never submits a run and never
> writes a ruling**: the run is the human's act, the verdict is the human's word, and
> the ruling file is the Cortex script's to write.
> of record) and answers one question — *where is my science?* — with one
> command, `checkin`: pull every active project, score every live run, move
> what came back, re-render the board, push the ledger, summarise by project.
> It **never submits a run and never writes a ruling**: the run is the human's
> act, the verdict is the human's word, and the ruling file is the Cortex
> script's to write.

The same split the organism already uses twice — **Heart ↔ vitals**, **Gut ↔
hygiene**: the organ keeps the state, the conductor reasons over it. The
Expand All @@ -17,17 +19,20 @@ the Cortex's intake-and-dashboard conductor.

| Verb | Question | Emits |
|------|----------|-------|
| `checkin [--dry-run \| --apply] [--push \| --no-push] [--project KEY] [--skip-pull] [--refreshed ISO]` | **Where is my science?** | the door — the sequence below, ending in a summary keyed by project; exit **1** when a pull failed or the tree needs a look |
| `census` | What is the Cortex holding? | phase counts by state, the board's section counts, rulings, projects, epics (`--json` for the lot) |
| `dashboard --check` | Are the committed pages current? | exit 0 current · **1 stale** · 2 no checkout · 3 unreadable tree |
| `dashboard --apply` | — | writes `dashboard.md` + `dashboard.html` |
| `gates` | What is each gated phase waiting on? | every gated phase, its refs and the URL each resolves to — read-only and offline |
| `collect [--pull] [--refreshed ISO] [--apply] [--out F] [--phase REL]` | What came back, and is it worth reviewing? | one block per phase — six scored legs, the readout, a blank ruling line — and exit **1** when any is not HEALTHY. **Default scope: every `submitted \| running` phase**; `--phase REL` narrows |

```
pyauto-brain cortex checkin --dry-run # what it would pull and score
pyauto-brain cortex checkin --apply # the check-in
pyauto-brain cortex # census
pyauto-brain cortex dashboard --apply
pyauto-brain cortex gates
pyauto-brain cortex collect --pull --apply # the check-in: pull, score, move on
pyauto-brain cortex collect --pull --apply # the scorer on its own
pyauto-brain cortex <verb> --cortex <dir> # another checkout
```

Expand Down Expand Up @@ -77,6 +82,51 @@ gated refs, 0 flips in its lifetime; sequencing is prose `Ready when:` lines
per Cortex schema decision 54). A human opens the refs and, when they have
closed, types `python3 scripts/cortex.py move <phase> ready`.

## The door (`checkin`)

The verb a human types. It composes what is already here and reasons nothing
extra of its own:

1. **Sync.** Every project with `status: active` in `projects.yaml`, plus any
project that owns a phase in `submitted | running` (a dormant project with a
job still out there is still out there). Each is pulled with **its own**
`<local_path>/<sync_cli> pull` — the verb all seven implement — and the
output is **streamed**, not captured: a pull runs for minutes and the human
is watching this one command. A non-zero exit is recorded against that
project and the sweep continues; one unreachable mirror must not hide the
other six. After a good pull the door writes `<pull root>/.cortex/pull.json`
(`project`, `pulled_at`, `cmd`, `rc`, `phases_live`) — **merged** into
whatever is already there, because one project's own CLI writes the richer
`checkpoints` / `runs` tables the scorer's checkpoint leg reads.
2. **Score + move.** `collect`'s scorer over every live phase, then the same
rehearsed `_apply_checked` moves.
3. **Render.** `dashboard.md` + `dashboard.html`.
4. **Push** (the rule below).
5. **Summarise, by project** — printed **last**, so a chat sees it above the
fold: each project's paths, what its pull did, its phase counts, and every
phase a human could act on today with its health verdict and the fenced,
copy-ready prompt its state already has (`_ruling_payload`,
`_live_payload`, `_ready_payload`, `_gate_payload`). `project_digest()`
builds one project's block and `checkin_summary()` the whole thing.

`--dry-run` (the default) prints the exact pull command per project, the pull
root, and every phase it would score — and reaches nothing at all. `--project
KEY` narrows the sweep; `--skip-pull` re-scores what is already on the laptop,
stamping the refresh from the newest manifest.

### The push rule

`--push` is allowed only when **`gh auth status` succeeds** *and* **the Cortex
checkout is clean on `main`** — read *before* anything is written, because
"clean" stops being true the moment the phases move. That is the whole
cloud/laptop split, and it is also the default: a laptop pushes without asking,
a cloud session cannot and says so. The push cuts
`claude/checkin-<YYYY-MM-DD>` from a fresh `origin/main`, commits the changed
paths **explicitly**, pushes, and names `ledger_merge.yml` as what lands it.
`scripts/ledger_merge.py classify` is asked first and a code-classified diff is
refused before the branch is cut. Never `main`, never `--force`, and a
same-day re-check-in reuses its branch rather than resetting a pushed ref.

## The check-in (`collect`)

This is the verb the human actually drives: *what came back?* With no
Expand Down
Loading
Loading