diff --git a/agents/conductors/batch/batch.sh b/agents/conductors/batch/batch.sh deleted file mode 100755 index c88daf83..00000000 --- a/agents/conductors/batch/batch.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/batch/batch.sh — the Batch Agent (a PyAutoBrain conductor). -# -# Composes what goes into one unattended shift. Thin by construction: every -# judgement it uses — consequence tier, review-minutes, readiness, difficulty — -# belongs to the sizing faculty. This agent decides MEMBERSHIP, which is an act -# rather than an opinion, which is what makes it a conductor. -# -# It proposes; it never dispatches. Approving the proposal in a slot is what -# launches a batch (AUTONOMY.md, "What a batch launch is") — the schedule may -# carry the timing, never the authority. -# -# Usage: -# batch.sh plan # the BatchDecision for this session's lane -# batch.sh plan --budget 45 # review-minutes available in the slot -# batch.sh plan --awaiting-review 6 # backpressure input -# batch.sh plan --json -# -# batch.sh slice # propose 2-4 witnessed children of a -# # needs-slicing prompt; writes nothing -# batch.sh slice --slices plan.md # slices from a plan file instead -# batch.sh slice --apply # write children + epics.md entry -# -# batch.sh premise # does its premise still hold on a fresh -# # main? ok | obsolete | unknown (exit 1 = -# # obsolete); --write-verified stamps it - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_batch.py" "$@" diff --git a/agents/conductors/clone/clone.sh b/agents/conductors/clone/clone.sh deleted file mode 100755 index f26c38e8..00000000 --- a/agents/conductors/clone/clone.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/clone/clone.sh — the Clone Agent (a PyAutoBrain reasoning -# conductor). Organism-facing name: the Mitosis Agent — reproduces a mature -# domain assistant into a new specialised cell. -# -# v0 is DECISION ONLY (see DESIGN.md): analyze mode emits a CloneDecision — -# domain analysis, template-boundary partition (seeded from the reference's -# modes/maintainer.md "Assistant-as-template" section), generation plan, the -# mandatory clone-mode question. It writes nothing; --apply arrives with v1. -# -# Usage: -# clone.sh --workspace [--howto ] [--reference ] -# clone.sh PyAutoFit --workspace autofit_workspace --howto HowToFit -# clone.sh --json ... # machine-readable CloneDecision - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_clone.py" "$@" diff --git a/agents/conductors/community/community.sh b/agents/conductors/community/community.sh deleted file mode 100644 index 63dd145b..00000000 --- a/agents/conductors/community/community.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/community/community.sh — the Community Agent (a PyAutoBrain -# reasoning conductor). Organism-facing name: the Ears — the organism's -# receptive language function: it hears the community (the Discussions hub -# where users ask, plus user-filed GitHub issues and PRs) and drafts what the -# organism says back; the human remains the mouth. -# (Wernicke to the Workspace Agent's Broca — that Voice speaks through -# examples; this agent comprehends and converses.) -# -# The CLI emits deterministic, read-only surfaces; the conversational judgment -# (actionable vs ask-for-more, the reply prose) lives in the /community skill -# session, and every outward message is gated on the human. It never posts, -# labels, edits or writes anything. -# -# Usage: -# community.sh # scan (default): the hub's open -# # discussions + external issues/PRs, -# # awaiting-response ranking, review -# # requests -# community.sh scan # same, explicit -# community.sh triage # one discussion/issue/PR -> context- -# # sufficiency surface (+ PR change-shape -# # block); = a discussion/issue/PR -# # URL or owner/repo#N -# community.sh ... --json # machine-readable output - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_community.py" "$@" diff --git a/agents/conductors/cortex/cortex.sh b/agents/conductors/cortex/cortex.sh deleted file mode 100755 index f96dcc13..00000000 --- a/agents/conductors/cortex/cortex.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/cortex/cortex.sh — the Cortex Agent (a PyAutoBrain -# reasoning conductor). The learning function — where the organism keeps -# track of what is true. -# -# Reasons over PyAutoCortex, the organ that holds the science body map and one -# ledger per project (Now, Runs, Log): renders the Cortex board (dashboard.md -# + dashboard.html, published to Pages), runs the check-in (stamp, render, -# push, read the ledger back by project — on any surface), pulls the cluster -# through each project's own sync CLI (the laptop only, where the science -# roots are) and syncs the ledger block onto each project's issue. It records -# cluster facts and the human's words, never a verdict of its own — a run is -# submitted only on the human's ask, and a result or lesson is logged only in -# their words. -# -# Usage: -# cortex.sh # census (default) -# cortex.sh census --json # machine-readable -# cortex.sh dashboard --check # exit 1 if the pages are stale -# cortex.sh dashboard --apply # write dashboard.md + dashboard.html -# cortex.sh pull # the laptop: each project's pull, then jobs verbatim -# cortex.sh pull --dry-run # what it would pull; reaches nothing -# cortex.sh checkin --dry-run # what it would write; writes nothing -# cortex.sh checkin --apply # the check-in: stamp, render, push, read back -# cortex.sh issue [--apply] # the ledger block for each project's issue -# cortex.sh --cortex # point at another PyAutoCortex checkout - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_cortex.py" "$@" diff --git a/agents/conductors/docs/docs.sh b/agents/conductors/docs/docs.sh deleted file mode 100755 index cf07d590..00000000 --- a/agents/conductors/docs/docs.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/docs/docs.sh — the Documentation Agent (a PyAutoBrain -# reasoning conductor). Owns skills/WRITING_STYLE.md: classifies a docs request -# by surface and emits a DocsDecision; audit mode scores one page against the -# style guide's checklist. Read-only — authoring runs through start_dev, and -# tutorial science prose is deferred to the Workspace conductor. -# -# Usage: -# docs.sh "" # plan (default mode) -# docs.sh # plan from a filed prompt -# docs.sh audit [--kind K] # read-only style audit -# docs.sh --json ... # machine-readable output - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_docs.py" "$@" diff --git a/agents/conductors/eyes/eyes.sh b/agents/conductors/eyes/eyes.sh deleted file mode 100755 index 6a15bd91..00000000 --- a/agents/conductors/eyes/eyes.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/eyes/eyes.sh — the Eyes Agent (a PyAutoBrain reasoning -# conductor). The perceptive function — the organism's sense of its own -# appearance. -# -# Surveys a visualization workspace's figure surface (inventory, render -# staleness, gallery currency, never-rendered gaps) and prepares the review -# surface the agentic critique loop consumes. It reasons and delegates — it -# never renders (the workspace's gallery/gallery_run.sh does) and -# never edits plot source (accepted critiques route via intake/start_dev). -# The workspace root is always an argument; this agent names no repos -# (tenant firewall). -# -# Usage: -# eyes.sh survey # EyesSurvey -# eyes.sh review [--batch N] # EyesReviewSurface -# eyes.sh review --against # paper-informed pass: the -# # dir's figures ride along as -# # reference context -# eyes.sh --json ... # machine-readable decision - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_eyes.py" "$@" diff --git a/agents/conductors/profiling/profiling.sh b/agents/conductors/profiling/profiling.sh deleted file mode 100755 index ae97d2b5..00000000 --- a/agents/conductors/profiling/profiling.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/profiling/profiling.sh — the Profiling Agent (a PyAutoBrain -# reasoning conductor). The proprioceptive function — the organism's sense -# of its own effort. -# -# Owns the organism's performance-data lifecycle with autolens_profiling as -# its workspace: diffs the campaign grid against the results tree and emits -# the dispatch plan (campaign), turns probe JSONs + unpinned results into a -# table/pin/baseline plan (ingest), and classifies pinned-value drift -# findings from Heart's profiling_drift leg (triage). It reasons and -# delegates — it never runs sweeps or edits source itself, and it honours -# the CPU-usability policy (autolens_profiling/results/notes/design_lock_in.md). -# -# Usage: -# profiling.sh # campaign, local tier (default) -# profiling.sh campaign --tier a100 # A100 dispatch plan (RAL submits) -# profiling.sh ingest # probe/pin/baseline ingest plan -# profiling.sh triage # drift-flag classification -# profiling.sh --json ... # machine-readable ProfilingDecision - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_profiling.py" "$@" diff --git a/agents/conductors/workspace/workspace.sh b/agents/conductors/workspace/workspace.sh deleted file mode 100755 index 16bdb827..00000000 --- a/agents/conductors/workspace/workspace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# agents/conductors/workspace/workspace.sh — the Workspace Agent (a PyAutoBrain -# reasoning conductor). Organism-facing name: the Voice — the organism's -# expressive function: how it speaks to practitioners (workspace examples) and -# teaches first-time learners (the howto register). -# -# v0 is DECISION ONLY: plan mode emits a WorkspaceDecision (target repo, -# register, placement, sibling to mirror, format checklist, routing); survey -# mode inventories a workspace repo's example catalogue. It writes nothing — -# authoring runs through start_dev → start_workspace → ship_workspace. -# -# Usage: -# workspace.sh "" # plan (default mode) -# workspace.sh # plan from a filed prompt -# workspace.sh survey [--against ] # catalogue inventory/diff -# workspace.sh --json ... # machine-readable output - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" -source "$HERE/../../_common.sh" - -exec python3 "$HERE/_workspace.py" "$@" diff --git a/agents/faculties/review/AGENTS.md b/agents/faculties/review/AGENTS.md index 4fe2c42e..0424b45d 100644 --- a/agents/faculties/review/AGENTS.md +++ b/agents/faculties/review/AGENTS.md @@ -40,7 +40,7 @@ produced by the reviewing agent (the session or subagent consulting this faculty) following the procedure below — mirroring how vitals' script reads Heart and the agent reasons over the verdict. -1. `review.sh` (→ `_review.py`, stdlib-only) resolves the task worktree — +1. `_review.py` (stdlib-only; `pyauto-brain review` runs it) resolves the task worktree — or, for an in-place task with no worktree, the checkouts its `active.md` `- repos:` block claims — or explicit repo paths and emits, per repo: merge-base against `origin/main`, commits ahead, diff stat, changed files, and risk flags (public-API-shaped paths, diff --git a/agents/faculties/review/review.sh b/agents/faculties/review/review.sh deleted file mode 100755 index 1770ae2c..00000000 --- a/agents/faculties/review/review.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# agents/faculties/review/review.sh — the review faculty (a PyAutoBrain -# read-only reasoning capability). It reviews the change. -# -# Prepares the ReviewSurface for a task worktree / feature branch: per-repo -# merge-base against origin/main, commits ahead, diff stat, changed files and -# risk flags. The VERDICT (CLEAN / FINDINGS / BLOCKED) is produced by the -# reviewing agent following AGENTS.md in this directory — this script only -# prepares the surface, mirroring how vitals.sh reads Heart and the agent -# reasons over the result. Read-only: it never dispatches or mutates, never -# fixes a finding, and never opines on release readiness (Heart's, via the -# vitals faculty). -# -# Usage: -# review.sh --task # resolve -wt// -# review.sh --repo [--repo ...] # explicit repo checkouts -# review.sh ... --json # machine-readable ReviewSurface - -set -uo pipefail - -HERE="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" - -exec python3 "$HERE/_review.py" "$@" diff --git a/bin/pyauto-brain b/bin/pyauto-brain index 5c3dc128..04cfcd6c 100755 --- a/bin/pyauto-brain +++ b/bin/pyauto-brain @@ -72,27 +72,34 @@ FACULTIES_DIR="$AGENTS_DIR/faculties" declare -A AGENT_SCRIPT=( [intake]="$CONDUCTORS_DIR/intake/intake.sh" - [batch]="$CONDUCTORS_DIR/batch/batch.sh" - [community]="$CONDUCTORS_DIR/community/community.sh" [feature]="$CONDUCTORS_DIR/feature/feature.sh" [bug]="$CONDUCTORS_DIR/bug/bug.sh" [refactor]="$CONDUCTORS_DIR/refactor/refactor.sh" - [workspace]="$CONDUCTORS_DIR/workspace/workspace.sh" - [docs]="$CONDUCTORS_DIR/docs/docs.sh" - [eyes]="$CONDUCTORS_DIR/eyes/eyes.sh" - [profiling]="$CONDUCTORS_DIR/profiling/profiling.sh" - [cortex]="$CONDUCTORS_DIR/cortex/cortex.sh" [hygiene]="$CONDUCTORS_DIR/hygiene/hygiene.sh" - [clone]="$CONDUCTORS_DIR/clone/clone.sh" [build]="$CONDUCTORS_DIR/build/build.sh" [release]="$CONDUCTORS_DIR/release/release.sh" [health]="$CONDUCTORS_DIR/health/health.sh" [vitals]="$FACULTIES_DIR/vitals/vitals.sh" - [review]="$FACULTIES_DIR/review/review.sh" [memory]="$FACULTIES_DIR/memory/memory.sh" [samplers]="$FACULTIES_DIR/samplers/samplers.sh" [sizing]="$FACULTIES_DIR/sizing/sizing.sh" ) +# Agents with no launcher of their own: the verb runs its Python module +# directly (`exec python3 "$@"`). This dispatcher has already resolved +# and exported the workspace root (bin/_pyauto_root.sh), which is all such a +# launcher used to add. Agents that resolve sibling checkouts or reorder +# arguments keep their script in AGENT_SCRIPT above. +declare -A AGENT_PY=( + [batch]="$CONDUCTORS_DIR/batch/_batch.py" + [community]="$CONDUCTORS_DIR/community/_community.py" + [workspace]="$CONDUCTORS_DIR/workspace/_workspace.py" + [docs]="$CONDUCTORS_DIR/docs/_docs.py" + [eyes]="$CONDUCTORS_DIR/eyes/_eyes.py" + [profiling]="$CONDUCTORS_DIR/profiling/_profiling.py" + [cortex]="$CONDUCTORS_DIR/cortex/_cortex.py" + [clone]="$CONDUCTORS_DIR/clone/_clone.py" + [review]="$FACULTIES_DIR/review/_review.py" +) declare -A AGENT_DESC=( [intake]="File classified prompts; never start development" [batch]="Propose a review-budgeted shift; brief, watch and digest it" @@ -134,7 +141,7 @@ cmd_help() { if [[ $# -gt 0 ]]; then local name="$1" # The doc lives beside the agent's script, wherever its tier put it. - local script="${AGENT_SCRIPT[$name]:-}" + local script="${AGENT_SCRIPT[$name]:-${AGENT_PY[$name]:-}}" local doc="${script:+$(dirname "$script")/AGENTS.md}" if [[ -n "$doc" && -f "$doc" ]]; then cat "$doc" @@ -238,6 +245,10 @@ main() { if [[ "$sub" == "merge-mode" ]]; then exec python3 "$BRAIN_HOME/bin/merge_mode.py" "$@" fi + local module="${AGENT_PY[$sub]:-}" + if [[ -n "$module" && -f "$module" ]]; then + exec python3 "$module" "$@" + fi local script="${AGENT_SCRIPT[$sub]:-}" if [[ -z "$script" || ! -f "$script" ]]; then echo "pyauto-brain: unknown agent '$sub'" >&2