aide_brain
Fetch .aide brain config sections on demand, inspect template and contract details, validate draft files, and guide setup or repair one step at a time.
Instructions
On-demand brain entry-point tool. Call this when you need to reach the brain mid-task — do NOT call it on every /aide boot. Boot-time brain precondition state is already reported by aide_info.brain.status; firing aide_brain at boot duplicates that work unnecessarily. It is also how a brain config is set up, repaired or written for any backend, one decision at a time. Every mode is read-only: no call writes to disk.
Optional source parameter — which read runs. Omitted means "host".
"host"— one section of the host's.aide/config/brain.aide, described below."template"—{ template, purpose }: one section of the bundled template (or its launcher, withkind: "launcher") as verbatim bytes, and that section's one-line purpose from the published contract. The answer is the same whatever state the host's config is in. Use it as a worked example when writing that section for another backend."contract"—{ sections }: every contract section in order, each withmarker,role(liveorseed) andpurpose, and no section text."draft"— a structural check of the draft config atpath, with the same rules and fault vocabulary as the host config check, so a draft that passes is ready to swap in. Returns{ outcome, instructions }:valid;invalidwithfault(missing-sectionsand itssections, ormalformedand itsreason);absentwhen no file is atpath;refusedwhenpathis outside the project, and nothing is read. It checks structure, never content.
Optional kind parameter — host and template reads only: any section marker of the published brain contract (see the enum), live or seed; "launcher" only with source: "template". Omitting it means "orientation", the runtime briefing for reaching the brain mid-task. "config" is the integration's wiring flow that /aide:brain config runs. Seed sections are fetched one per call while seeding. path is required with source: "draft" and accepted nowhere else; any other combination is rejected before the tool runs.
Host read response shape: exactly { status, instructions, found, purpose? }. No backend, no connector, no name, no kind.
found: true—instructionsis that section's verbatim bytes from the host's.aide/config/brain.aide: no trimming, no normalization, no${...}substitution.purposeis that section's one-line purpose from the published contract; use it when adapting the section for another backend.found: false—instructionsis remediation, andpurposeis absent. An absent file → run/aide:brain config. A requested section missing from the file → with the user's consent, callaide_upgradewithcategory: "brain". A malformed or unreadable file → the exact fault, a hand fix with the user, then re-check withaide_info. Do not proceed as if the section were available.
The section is returned on every status where the config exists and is well-formed, including brain-aide-invalid with missing sections, no-mcp-entry and mcp-drift.
status mirrors the BrainState tagged union from buildBrainState, with five values: ok, no-brain-aide, brain-aide-invalid, no-mcp-entry, mcp-drift. Branch on found for "did I get the section" and on status for "is the brain healthy".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Which section: any section marker of the published contract, live or seed, or `launcher` with `source: "template"` only. Omitted means `orientation`. Not accepted with `contract` or `draft`. Seed sections are fetched one per call while seeding. | |
| path | No | Project-relative path of a draft brain config. Required with `source: "draft"` and accepted nowhere else; a path outside the project is refused unread. | |
| source | No | Which read runs. Omitted means `host`: one section of the host's `.aide/config/brain.aide`. `template`: one section or the launcher of the bundled template, with its purpose. `contract`: every contract section with its role and purpose. `draft`: a structural check of the draft config at `path`. |