Skip to content

Latest commit

 

History

History
190 lines (156 loc) · 11 KB

AGENTS.md

File metadata and controls

190 lines (156 loc) · 11 KB

PyAutoBrain — Agent Guidance

This file is for AI coding agents (Claude Code, Codex, Cursor, etc.) and humans discovering this repository. It is the canonical description of PyAutoBrain — the reasoning layer of the PyAuto organism — and of the Brain / Heart / Build boundary; PyAutoHands and PyAutoHeart point back here.

The organism map

You are one peer organ of the PyAuto organism (human-led, natural-language software development), not a part of another. Boundaries: PyAutoBrain/ORGANISM.md; every repo: PyAutoMind/repos.yaml.

Organ Repo Role
Brain PyAutoBrain Reasoning and orchestration: decomposes and routes work through its conductors and faculties.
Broca PyAutoBroca Assistant evaluation history, upkeep evidence and its dashboard.
Mind PyAutoMind Intent, priorities and workflow state; every task starts as a prompt here.
Cortex PyAutoCortex What is true in the science: the project body map and one ledger per project.
Memory PyAutoMemory Long-term scientific, software and project knowledge.
Eyes PyAutoEyes Cross-project figure dashboard over the <lib>_visualization repos.
Ears PyAutoEars Read-only community listening: conversation snapshots and coverage.
Heart PyAutoHeart Health/readiness — the authoritative release verdict.
Hands PyAutoHands Packaging, tagging, notebooks and PyPI release execution.
Pulse PyAutoPulse Cross-project profiling dashboard over the <lib>_profiling repos.
Insight PyAutoInsight Inference campaign intent, instance registry and evidence dashboard.
DNA PyAutoDNA Software-stack specifications, environment inventories and upgrade campaigns.
Nerves PyAutoNerves Configuration/serialization layer (autonerves): layered config, version handshake, test_mode.
Gut PyAutoGut Condemned branches, stashes and dead code, held as recoverable refs until swept.

Call chain: Brain → Heart (gate) → Build (execute). Conductors decide and act; faculties judge read-only and stop. New capability grows as a faculty, not an organ, unless it owns state or effects no organ can.

Generated from PyAutoMind/repos.yaml + PyAutoBrain/ORGANISM.md; edit there, then run python3 PyAutoMind/scripts/repos_sync.py --write.

Working here

Brain plans and coordinates; it owns no task state, health checks or release mechanics. Mind owns intent/state, Heart gates readiness, Hands executes releases. Use conductors for decisions and actions; faculties return read-only judgments. The consultation graph is a DAG: conductors consult faculties, not conductors. See ORGANISM.md for boundaries and AUTONOMY.md for checkpoint rules. Add a role only on demonstrated need.

Before changing shared board presentation, read the applicable contract in shared organism standards. Reuse the shared component, identify its affected consumers and validate adoption; keep domain meanings and work destinations in their owning renderers.

For development use skills/WORKFLOW.md, then the invoked skill. Read only its current step and applicable environment. Reuse unchanged instructions already loaded; use context discipline. For new agents or command wiring, read agent reference. Add registry entries in bin/pyauto-brain and the agent directory; regenerate this command table with bin/install.sh --write-agents-surface, never by hand.

Running

Run from the Brain checkout. Read the selected agent's AGENTS.md only when invoking it; bin/pyauto-brain help <verb> exposes its full contract.

Conductors — front doors you drive (decide and act):

Verb Purpose Entrypoint
intake File classified prompts; never start development bin/pyauto-brain intake
batch Propose a review-budgeted shift; brief, watch and digest it bin/pyauto-brain batch
community Triage community threads; human-approved replies and development handoffs bin/pyauto-brain community
feature Select, size and plan features bin/pyauto-brain feature
bug Classify regressions and plan repairs bin/pyauto-brain bug
refactor Plan behavior-preserving restructuring bin/pyauto-brain refactor
workspace Plan or survey examples and tutorials bin/pyauto-brain workspace
docs Plan README, setup and Read the Docs pages; audit a page's style bin/pyauto-brain docs
eyes Survey figures and route accepted critiques bin/pyauto-brain eyes
profiling Plan campaigns; ingest results; triage profiling drift bin/pyauto-brain profiling
cortex Pull science runs and record human checkins bin/pyauto-brain cortex
hygiene Prioritize upkeep and delegate fixes bin/pyauto-brain hygiene
clone Plan assistant births or synchronize generic files bin/pyauto-brain clone
build Consult vitals and coordinate Hands execution bin/pyauto-brain build
release Coordinate release rehearsal, validation and nightly execution bin/pyauto-brain release
health Assess health and route repairs bin/pyauto-brain health

Faculties — read-only opinions the conductors consult (also runnable):

Verb Purpose Entrypoint
vitals Read authoritative Heart readiness bin/pyauto-brain vitals
review Prepare independent CLEAN/FINDINGS/BLOCKED branch review bin/pyauto-brain review
memory Recall cited scientific and task history bin/pyauto-brain memory
samplers Inspect sampler coverage, tiers and benchmarks bin/pyauto-brain samplers
sizing Estimate task difficulty bin/pyauto-brain sizing

Like the other PyAuto repos, PyAutoBrain runs from its checkout (no pip install); it resolves the sibling pyauto-heart and autohands binaries from PATH or the ~/Code/PyAutoLabs/ checkouts.

Remote sessions (Claude Code on web and mobile)

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: 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.

Commands and communication

Users invoke verbs or natural language; Brain stays implicit. /docs and /research fix a dev work type; /prm merges and closes out a task; /brain is a raw passthrough. Canonical bodies are skills/<verb>/<verb>.md, discovered through thin SKILL.md wrappers. The agents/workflows directory is board/; it routes unspecified tasks and retains compact overnight and maintenance surfaces.

Answer first, briefly; link instead of pasting. Expand plans awaiting approval, decision surfaces, failures/blockers and requested explanations enough to judge. Keep structured decisions, review surfaces and verdicts complete. These rules apply to surrounding chat, not to the defined artifact schema.

Never rewrite history

Never rewrite pushed history on any repo with a remote — no git init over a tracked repo, no force-push to main, no fresh-start "Initial commit", no filter-repo / filter-branch / rebase -i on pushed branches. To get a clean tree: git fetch origin && git reset --hard origin/main && git clean -fd.

Sessions end at their deliverable

A session ends when it reports its deliverable — never arm anything that outlives the turn to wait for CI, a review or a merge: no send_later, no subscribe_pr_activity, CronCreate, ScheduleWakeup, /loop, RemoteTrigger create/update/run, or Monitor or background loop on GitHub. Judge once, report, stop; the human re-runs /prm (or the batch review) when it is green. The one exception, the shift cockpit's stream: PyAutoMind policy/shift_cockpit_watch.md. Measured: five batch members armed hourly check-ins on 2026-08-31, and a mobile /prm re-armed a 60-minute send_later all night on 2026-09-03, draining usage.

Where to file

Questions, help with code or an analysis, ideas, bug reports and results from a user or collaborator — or an agent acting for one — go to https://github.com/orgs/PyAutoLabs/discussions in the matching category (Help & Questions, Ideas & Proposals, Bugs & Errors, Show and tell; Announcements is maintainers-only), never to this repo's Issues. An agent never runs gh issue create for such a report: it drafts the title, category and body and hands them to the human (sessions cannot create Discussions). Only the development flow — Mind prompt → /start_dev → /create_issue → one issue per task → PR — opens issues here. Why: PyAutoMind/policy/community_surface.md.

Codex loads this repo's generated safety registrations from .codex/hooks.json only after the project layer and exact current hook hash are reviewed and trusted with /hooks; changed or untrusted hooks are skipped. The adapter registers the shared-Mind commit guard and end-at-deliverable guard. It intentionally does not copy the Claude remote-session Python SessionStart bootstrap; local Codex work continues to source the workspace activate.sh normally.

Shared standards

Before changing a shared interface, consult the applicable organism standard on demand, identify affected consumers, and validate their adoption. Change generated guidance at its canonical source and regenerate.

For board changes, follow the applicable sizing, navigation and orchestration standards and reuse Brain’s shared components. Keep domain data, prompt meaning and approval boundaries with the board’s owner.