Overview
Phase 3 (final core phase) of the PyAutoBrain hygiene conductor (P1 scaffold #88, P2 modes #90). Bring the perf mode live — developer-loop cost: slow unit tests, slow integration-mode workspace scripts, and import time — completing all five modes. Keeps the phase-2 shape: cheap read-only pre-scan + delegate; the conductor never runs heavy audits and never mutates a repo. Umbrella: PyAutoMind/issued/hygiene_agent.md.
Plan
- import-cost pre-scan — time
python3 -c "import <pkg>" per library in a subprocess (best-effort; the conductor stays bash and never imports the JAX stack itself). Report per-library import seconds; libraries over threshold are the actionable signal; not-importable → advisory.
- consult Heart for heavy signals — slow tests/scripts are already tracked by PyAutoHeart's
script_timing / test_run legs; perf surfaces those (via vitals / pyauto-heart) rather than re-running them, and routes the slow items. ("measurement lives in Heart; hygiene acts.")
- delegate fixes — slow function →
/refactor or /bug; JAX-adaptation surfaced as a recommendation, never an automatic rewrite.
- extend
--json perf row from staged to real rows; flip perf live in the conductor + veneer (nothing then remains staged); default worklist ranks the perf import signal alongside tidy debris.
Detailed implementation plan
Affected Repositories
Work Classification
Library (Brain-source)
Implementation Steps
agents/conductors/hygiene/hygiene.sh — add prescan_perf (subprocess import timing per library, best-effort, threshold flag) + a Heart-timing consult (surface script_timing/test_run findings); make perf a live mode (drop the staged branch); extend the --json row.
agents/conductors/hygiene/AGENTS.md — flip perf from staged → live; document the import-pre-scan + Heart-consult + delegate.
skills/hygiene/hygiene.md — remove the "perf staged" note (nothing staged now).
tests/test_hygiene_conductor.py — extend hermetic tests for the perf row shape (it is no longer staged).
Key Files
agents/conductors/hygiene/hygiene.sh — the conductor to extend.
agents/_common.sh — consult_vitals_verdict / resolve_heart for the Heart consult.
Charter guard
The import timing runs in a subprocess — the conductor never imports JAX/the science stack into the Brain process (stdlib/bash only).
Testing
pyauto-brain hygiene perf emits real import timings + surfaced Heart findings (human + --json); nothing reports staged; PyAutoBrain tests/ green.
Deferred (NOT this phase)
A standing PyAutoHeart import_time (or cli_noise) leg — adding Heart legs is a PyAutoHeart change; keep phase 3 PyAutoBrain-only and note the leg as a follow-up if the import pre-scan proves worth promoting to a tracked Heart signal.
Autonomy
--auto, effective supervised (header supervised ∧ feature-medium cap safe). Parks at ship sign-off. Merge/close human.
Original Prompt
Click to expand starting prompt
Phase 3 (final): bring the hygiene conductor's perf mode live — dev-loop cost (slow unit tests, slow integration-mode scripts, import time). Keep phase-2 shape (pre-scan + delegate; never mutate). import-cost pre-scan times python3 -c "import pkg" per library in a subprocess (conductor never imports JAX); consult Heart's script_timing/test_run for slow tests/scripts and route to refactor/bug; JAX-adapt is a judgement recommendation. Flip perf live (nothing staged after). Defer a standing Heart import_time leg. Done when perf emits real timings + Heart findings, nothing staged, tests green.
Overview
Phase 3 (final core phase) of the PyAutoBrain hygiene conductor (P1 scaffold #88, P2 modes #90). Bring the
perfmode live — developer-loop cost: slow unit tests, slow integration-mode workspace scripts, and import time — completing all five modes. Keeps the phase-2 shape: cheap read-only pre-scan + delegate; the conductor never runs heavy audits and never mutates a repo. Umbrella:PyAutoMind/issued/hygiene_agent.md.Plan
python3 -c "import <pkg>"per library in a subprocess (best-effort; the conductor stays bash and never imports the JAX stack itself). Report per-library import seconds; libraries over threshold are the actionable signal; not-importable → advisory.script_timing/test_runlegs;perfsurfaces those (via vitals /pyauto-heart) rather than re-running them, and routes the slow items. ("measurement lives in Heart; hygiene acts.")/refactoror/bug; JAX-adaptation surfaced as a recommendation, never an automatic rewrite.--jsonperfrow fromstagedto real rows; flipperflive in the conductor + veneer (nothing then remains staged); default worklist ranks the perf import signal alongsidetidydebris.Detailed implementation plan
Affected Repositories
Work Classification
Library (Brain-source)
Implementation Steps
agents/conductors/hygiene/hygiene.sh— addprescan_perf(subprocess import timing per library, best-effort, threshold flag) + a Heart-timing consult (surfacescript_timing/test_runfindings); makeperfa live mode (drop the staged branch); extend the--jsonrow.agents/conductors/hygiene/AGENTS.md— flipperffrom staged → live; document the import-pre-scan + Heart-consult + delegate.skills/hygiene/hygiene.md— remove the "perf staged" note (nothing staged now).tests/test_hygiene_conductor.py— extend hermetic tests for theperfrow shape (it is no longerstaged).Key Files
agents/conductors/hygiene/hygiene.sh— the conductor to extend.agents/_common.sh—consult_vitals_verdict/resolve_heartfor the Heart consult.Charter guard
The import timing runs in a subprocess — the conductor never imports JAX/the science stack into the Brain process (stdlib/bash only).
Testing
pyauto-brain hygiene perfemits real import timings + surfaced Heart findings (human +--json); nothing reportsstaged; PyAutoBraintests/green.Deferred (NOT this phase)
A standing PyAutoHeart
import_time(orcli_noise) leg — adding Heart legs is a PyAutoHeart change; keep phase 3 PyAutoBrain-only and note the leg as a follow-up if the import pre-scan proves worth promoting to a tracked Heart signal.Autonomy
--auto, effective supervised (headersupervised∧ feature-medium capsafe). Parks at ship sign-off. Merge/close human.Original Prompt
Click to expand starting prompt
Phase 3 (final): bring the hygiene conductor's
perfmode live — dev-loop cost (slow unit tests, slow integration-mode scripts, import time). Keep phase-2 shape (pre-scan + delegate; never mutate). import-cost pre-scan timespython3 -c "import pkg"per library in a subprocess (conductor never imports JAX); consult Heart's script_timing/test_run for slow tests/scripts and route to refactor/bug; JAX-adapt is a judgement recommendation. Flip perf live (nothing staged after). Defer a standing Heart import_time leg. Done when perf emits real timings + Heart findings, nothing staged, tests green.