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/batch.md
1 change: 1 addition & 0 deletions .claude/commands/ci_speedup.md
1 change: 0 additions & 1 deletion .claude/commands/register_and_iterate.md

This file was deleted.

1 change: 0 additions & 1 deletion .claude/commands/run_queue.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/commands/start_bundle.md
1 change: 1 addition & 0 deletions .claude/skills/batch
1 change: 1 addition & 0 deletions .claude/skills/ci_speedup
1 change: 1 addition & 0 deletions .claude/skills/start_bundle
1 change: 1 addition & 0 deletions .codex/skills/batch
1 change: 1 addition & 0 deletions .codex/skills/ci-speedup
1 change: 0 additions & 1 deletion .codex/skills/register-and-iterate

This file was deleted.

1 change: 0 additions & 1 deletion .codex/skills/run-queue

This file was deleted.

1 change: 1 addition & 0 deletions .codex/skills/start-bundle
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@ jobs:
- name: Run tests
working-directory: PyAutoBrain
run: pytest tests/ -q
# The committed `.claude/` + `.codex/` discovery trees are generated
# symlinks, and nothing regenerated them: three skills (batch,
# ci_speedup, start_bundle) were never registered and two deleted ones
# (register_and_iterate, run_queue) stayed linked, so a web session —
# which loads only committed files — silently lacked those verbs. The
# generator has always had a drift mode; it just ran in no CI. Only the
# repos checked out above are examined (the check skips the rest), so
# this gates Brain and Mind and nothing a Brain PR cannot fix.
- name: Skill discovery trees are current (.claude/ + .codex/ symlinks)
run: bash PyAutoBrain/bin/install.sh --check-project-discovery
# A skill's SKILL.md + body is MANDATORY context every time the skill
# loads, so line count is a per-invocation token cost, not a style
# preference. Report-only: `batch` and `prm` are over the 200-line budget
# today and trimming them is its own task — this step makes the debt
# visible on every PR without reddening a gate nobody can currently pass.
- name: Skill line-count budget (report-only — known offenders)
continue-on-error: true
working-directory: PyAutoBrain
run: bash bin/check_skill_line_counts.sh
- name: Tenant firewall (instance facts stay in declared config surfaces)
run: >
python3 PyAutoMind/scripts/repos_sync.py --check
Expand Down
55 changes: 14 additions & 41 deletions 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 keeps track of what is true: the per-project science ledger over PyAutoCortex ('cortex checkin') — pull every active project through its own sync CLI, show where each run stands, re-render the board; it records cluster facts and the human's words, never a verdict of its own | `bin/pyauto-brain cortex` |
| `cortex` | The learning function — where the organism keeps track of what is true: the per-project science ledger over PyAutoCortex — 'cortex pull' on the laptop pulls every active project through its own sync CLI and shows where each run stands; 'cortex checkin' anywhere stamps, re-renders the board and pushes the ledger; it records cluster facts and the human's words, never a verdict of its own | `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 All @@ -166,48 +166,21 @@ it resolves the sibling `pyauto-heart` and `autohands` binaries from PATH or the
<!-- repos_sync:remote:begin -->
## Remote sessions (Claude Code on web and mobile)

Three facts, all measured in a web/mobile container, where this file is loaded
and little else is. They ride in every organ because a session may hold any
subset of them — and the session that needs this most is the one holding
several, which is exactly the session no hook fires in.
Three facts, measured in a web/mobile container. A session holding several
organs is cwd'd at the repos' *parent*, where no project hook fires, so
nothing has set it up — this block is what does.

- **Bootstrap in the first turn, unconditionally** — before the first test
command, not as a remedy once something looks wrong:

```
bash PyAutoMind/scripts/session_bootstrap.sh # ~10s cold, ~1s warm
bash PyAutoMind/scripts/session_bootstrap.sh --check # report only
```

A session holding several organs registers no SessionStart hook — Claude Code
reads project hooks from the project directory, which in that layout is the
repos' *parent*, not a repo — so nothing has set this session up. It was once
phrased as a remedy keyed to `No module named pytest` or collection
`ImportError`s naming `yaml`; that symptom stopped appearing when the
container image moved to Python 3.12, while the environment is still wrong in
ways that read like a bad command rather than a stale session (`pytest -n
auto` → `unrecognized arguments: -n`). The bootstrap also **unshallows the
clones**: a remote session clones shallow, and `git merge-base --is-ancestor`
then answers "not an ancestor" for a commit whose ancestry is merely absent —
the answer the ship and close-out procedures act on when proving a branch
merged.

- **Then run the suite in parallel.** 4 cores, subprocess-heavy suites, no
single slow test: about 3.5x. `python3 -m pytest -q -n auto`, with
`pytest-xdist` supplied by the bootstrap above.

- **There is no `gh`, and installing one does not help.** A remote session
reaches GitHub through the `mcp__github__*` tools, already scoped to the
session's repos. `gh` installs in two seconds and is a trap: it authenticates,
then 403s every repo-scoped call, because the egress proxy serves neither the
REST repo paths nor GraphQL beyond a pinned set of PR-review operations — a
binary that looks healthy and fails everything that matters. It also defeats
the surface probe, which keys off `gh auth status`. Read
`PyAutoBrain/skills/GITHUB_ACCESS.md` at the top of any run that touches
GitHub; it maps each `gh` operation onto its MCP tool. Spell that path from
the workspace root, as written: a multi-organ session is cwd'd at the repos'
*parent*, so a bare `skills/…` reads as a missing file rather than a missing
repo prefix.
command, not as a remedy: `bash PyAutoMind/scripts/session_bootstrap.sh`
(`--check` reports only). It supplies pytest/PyYAML/xdist and **unshallows
the clones**, without which `git merge-base --is-ancestor` calls a merged
branch "not an ancestor" and the close-out acts on it.
- **Run the suite in parallel**: `python3 -m pytest -q -n auto` (4 cores,
~3.5x).
- **There is no `gh`, and installing one does not help** — it authenticates,
then 403s every repo-scoped call through the egress proxy. GitHub is the
`mcp__github__*` tools; `PyAutoBrain/skills/GITHUB_ACCESS.md` maps each
`gh` operation onto its tool and is the one full page on the subject.
<!-- repos_sync:remote:end -->

## The command surface (Brain implicit)
Expand Down
14 changes: 7 additions & 7 deletions ORGANISM.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ organs plan, build, test and release it, and you make every judgment call.
|-------|------|-------------------|
| **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. |
| **Cortex** | PyAutoCortex | Keeps track of *what is true* — the science body map (`projects.yaml`) and **one ledger per science project** (`## Now`, the `## Runs` on the cluster, a `## Log` that only gets longer); the science mirror of the Mind (runs and a dated log ↔ prompts and PRs). Not a task tracker: it records cluster facts and the human's words, never a verdict of its own. |
| **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. |
Expand Down Expand Up @@ -69,9 +69,9 @@ install wiring, a body-map row and boundary prose — it must earn that by
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. 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.
config surfaces belong there, not in a new organ. Keeping track of 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 per-project
ledgers — so science runs and the human's notes on them belong there, not in
the Mind. The human interaction layer is the command surface (`/route` + the
verb commands), which is part of Brain.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ fresh when you wake.
You drive it in plain English, through short slash commands in a Claude Code
chat: `/intake` to file an idea, `/start_dev` to begin a task, `/health` for a
check-up — or just `/route <what you want>` and the Brain picks the right
door. The full command surface (13 conductors + 5 faculties) is the generated
table in [AGENTS.md](AGENTS.md).
door. The generated table in [AGENTS.md](AGENTS.md) is the roster — every
conductor and faculty, regenerated from the router.

1. **A task arrives.** Usually from the Mind's backlog — pick a task on the
[PyAutoMind dashboard](https://pyautolabs.github.io/PyAutoMind/) and paste
Expand All @@ -43,7 +43,7 @@ table in [AGENTS.md](AGENTS.md).
knows, `review` judges a branch. A conductor never consults another
conductor — an opinion worth sharing becomes a faculty.
4. **The organs execute.** Always in the same order — **Brain → Heart (gate)
→ Hands (execute)**: work happens on task worktrees, ships as pull
→ Build (execute)**: work happens on task worktrees, ships as pull
requests behind the Heart's health verdict, and is packaged and released
by the Hands.
5. **Autonomy is a contract.** How much a run may do without a human is
Expand Down
Loading
Loading