Skip to content

feat(hygiene): hygiene conductor — phase 3 perf mode (#91) - #92

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/hygiene-agent-phase-3
Jul 11, 2026
Merged

feat(hygiene): hygiene conductor — phase 3 perf mode (#91)#92
Jammy2211 merged 1 commit into
mainfrom
feature/hygiene-agent-phase-3

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #91 (phase 3 — final core phase of the hygiene conductor).

What

The perf mode goes live, completing all five modes — nothing reports
staged any more
. Keeps the phase-2 shape (cheap read-only pre-scan +
delegate; the conductor never runs heavy audits and never mutates a repo).

perf mode

  • import-cost pre-scan — times import <pkg> per library in a subprocess
    (HYGIENE_PYTHON, default python3), so the conductor itself never imports the
    science/JAX stack (charter held). New timing pre-scan kind: a real,
    rankable count of slow imports (over HYGIENE_PERF_THRESHOLD, default 3.0s);
    advisory when nothing is importable in the ambient env (point HYGIENE_PYTHON
    at the PyAuto venv to time the science libs).
  • consults Heart for the heavy signals — slow tests / integration-mode scripts
    are already observed by PyAutoHeart's script_timing / test_run legs, so
    perf points there and routes 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 in the default footing).

Changes

  • agents/conductors/hygiene/hygiene.shprescan_perf (subprocess import
    timing, timeout-guarded), the timing kind, deferred-in-default handling,
    extended --json, honest ranking (tidy debris → perf → periodic audits).
  • agents/conductors/hygiene/AGENTS.md — modes table + timing kind + the
    subprocess / Heart-consult doctrine; all five modes live.
  • skills/hygiene/hygiene.md — veneer updated (all modes live; HYGIENE_PYTHON note).
  • tests/test_hygiene_conductor.py2 new perf contract tests (timing row
    shape with fast stdlib libs; advisory when nothing importable) + default-scan
    asserts nothing is staged and perf is deferred.

Deferred (explicit follow-up, not this phase)

A standing PyAutoHeart import_time (or cli_noise) leg — promoting the import
pre-scan to a tracked Heart signal — is a PyAutoHeart change; kept out to leave
this phase PyAutoBrain-only.

Autonomous-ship gate (--auto, supervised)

  • Tests — PyAutoBrain 36 pass (34 + 2 new). Downstream libs n/a.
  • Smoke — n/a (Brain reasoning/org repo, no downstream script surface).
  • ReviewCLEAN, risk flags none.
  • Heart — organism YELLOW, no launch ack; parked at supervised ship sign-off,
    shipped on explicit live human go-ahead.

Validation checklist (reviewer)

  • hygiene perf (with HYGIENE_PYTHON = PyAuto venv) reports per-library import timings + Heart pointer; /refactor delegate.
  • hygiene perf --json valid (kind=timing); advisory when a lib isn't importable.
  • hygiene (default) is fast and defers perf; nothing reports staged.
  • hygiene --help lists 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

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
@Jammy2211
Jammy2211 merged commit 10ccc38 into main Jul 11, 2026
@Jammy2211
Jammy2211 deleted the feature/hygiene-agent-phase-3 branch July 11, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(PyAutoBrain): hygiene conductor — phase 3 perf mode

1 participant