feat(hygiene): hygiene conductor — phase 3 perf mode (#91) - #92
Merged
Conversation
Phase 3 (final core phase) of the hygiene conductor. The perf mode goes live, completing all five modes — nothing reports 'staged' any more: - import-cost pre-scan: times `import <pkg>` per library in a SUBPROCESS (HYGIENE_PYTHON, default python3; conductor never imports the JAX stack). New 'timing' pre-scan kind — a real, rankable count of slow imports (> threshold); advisory when nothing is importable in the ambient env. - consults Heart for the heavy signals: slow tests/scripts are already tracked by PyAutoHeart's script_timing / test_run legs, so perf points there and routes the slow items rather than re-running pytest/workspace scripts. - delegates fixes to /refactor (or /bug); JAX-adaptation is surfaced as a recommendation, never an automatic rewrite. - the fast default scan DEFERS perf's import timing (it spawns real imports); an explicit `hygiene perf` runs it. Extended --json (kind=timing / status=deferred). Docs: AGENTS.md modes table + timing kind + subprocess/Heart-consult note; the /hygiene veneer (all five modes live). Standing Heart import_time leg left as a deferred optional follow-up (a PyAutoHeart change). Tests: PyAutoBrain 36 pass (2 new perf contract tests). The hygiene conductor epic is complete. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tw3EwV55k6VzxorYng3Kfn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #91 (phase 3 — final core phase of the hygiene conductor).
What
The
perfmode goes live, completing all five modes — nothing reportsstagedany more. Keeps the phase-2 shape (cheap read-only pre-scan +delegate; the conductor never runs heavy audits and never mutates a repo).
perfmodeimport <pkg>per library in a subprocess(
HYGIENE_PYTHON, defaultpython3), so the conductor itself never imports thescience/JAX stack (charter held). New
timingpre-scan kind: a real,rankable count of slow imports (over
HYGIENE_PERF_THRESHOLD, default 3.0s);advisorywhen nothing is importable in the ambient env (pointHYGIENE_PYTHONat the PyAuto venv to time the science libs).
are already observed by PyAutoHeart's
script_timing/test_runlegs, soperfpoints there and routes rather than re-running pytest / workspace scripts./refactor(or/bug); JAX-adaptation is surfaced as arecommendation, never an automatic rewrite.
an explicit
hygiene perfruns it. Extended--json(kind=timing/status=deferredin the default footing).Changes
agents/conductors/hygiene/hygiene.sh—prescan_perf(subprocess importtiming,
timeout-guarded), thetimingkind, deferred-in-default handling,extended
--json, honest ranking (tidy debris → perf → periodic audits).agents/conductors/hygiene/AGENTS.md— modes table +timingkind + thesubprocess / Heart-consult doctrine; all five modes live.
skills/hygiene/hygiene.md— veneer updated (all modes live;HYGIENE_PYTHONnote).tests/test_hygiene_conductor.py— 2 new perf contract tests (timing rowshape with fast stdlib libs; advisory when nothing importable) + default-scan
asserts nothing is
stagedand perf isdeferred.Deferred (explicit follow-up, not this phase)
A standing PyAutoHeart
import_time(orcli_noise) leg — promoting the importpre-scan to a tracked Heart signal — is a PyAutoHeart change; kept out to leave
this phase PyAutoBrain-only.
Autonomous-ship gate (
--auto, supervised)shipped on explicit live human go-ahead.
Validation checklist (reviewer)
hygiene perf(withHYGIENE_PYTHON= PyAuto venv) reports per-library import timings + Heart pointer;/refactordelegate.hygiene perf --jsonvalid (kind=timing); advisory when a lib isn't importable.hygiene(default) is fast and defers perf; nothing reportsstaged.hygiene --helplists perf as live; full suite green.With this the hygiene conductor's five modes are complete.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Tw3EwV55k6VzxorYng3Kfn