feat(hygiene): hygiene conductor — phase 2 modes (pre-scan + delegate) (#89) - #90
Merged
Merged
Conversation
…gate (#89) Phase 2 of the hygiene conductor. The four non-perf modes go live as cheap, read-only local PRE-SCANs that DELEGATE the full audit + any execution to the owning skill — the conductor never runs a heavy audit and never mutates a repo: - tidy → git-debris pre-scan (stale branches/stashes/[gone] refs/dirty trees across libs + org repos) → /repo_cleanup (Brain executor). - deps → capped/pinned specifiers in library pyproject.toml → /dep_audit. - docs → docs/api/*.rst + currentmodule counts (3 doc repos) → /audit_docs. - noise → advisory (no cheap local signal) → /cli_noise_clean. (noise/deps/docs are read-only PyAutoHeart observation skills — measurement lives in Heart; hygiene pre-scans, prioritises and routes.) Pre-scans are typed 'debris' (rankable removable count — tidy), 'surface' (sizes the audit, NOT a problem count — deps/docs), or 'advisory' (noise). Only 'debris' drives the default ranking, so the recommendation is honest: tidy when debris exists, else prompt the periodic audits. Extended --json HygieneDecision carries {mode,kind,status,count,summary,delegate}. perf stays staged (phase 3). Docs: AGENTS.md modes table + pre-scan-kind model; /hygiene veneer (only perf staged); repo_cleanup/SKILL.md (tidy is the front door, skill stays executor). Tests: PyAutoBrain 30 pass. 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 #89 (phase 2 of the hygiene conductor).
What
Phase 2 gives the four non-perf hygiene modes real behaviour: each is a cheap,
read-only local pre-scan that delegates the full audit + any execution to
the owning skill. The conductor never runs a heavy audit and never mutates a repo
(consistent with its charter and the phase-1 boundaries).
perfstays staged forphase 3.
Modes (live)
tidy[gone]refs / dirty checkouts (debris)/repo_cleanup(Brain)noise/cli_noise_clean(Heart)depspyproject.toml(surface)/dep_audit(Heart, hits PyPI)docsdocs/api/*.rst+currentmodulecounts, 3 doc repos (surface)/audit_docs(Heart, imports)noise/deps/docsroute to read-only PyAutoHeart observation skills —measurement lives in Heart; hygiene pre-scans, prioritises and routes.
Design note (a refinement of the approved boundary)
All four skills are pure agent-run markdown (three Heart-owned), so a stdlib/bash
conductor genuinely cannot execute them. The modes are therefore pre-scan +
route, not "run the audit". Pre-scans are typed so the ranking is honest:
tidy) — directly-removable items; a real, rankable count.deps/docs) — only sizes the audit; the count is not aproblem count (real findings emerge when the delegated skill runs).
noise) — no cheap local signal.Only
debrisdrives the default ranking, so the no-arg run recommendstidywhen debris exists, else prompts the periodic audits. This strengthens the
"skills stay the executors" boundary rather than departing from it.
Changes
agents/conductors/hygiene/hygiene.sh— the four pre-scans, the pre-scan-kindmodel, honest default ranking, extended
--jsonHygieneDecision(
{mode,kind,status,count,summary,delegate}).agents/conductors/hygiene/AGENTS.md— modes table + pre-scan-kind doctrine.skills/hygiene/hygiene.md— veneer updated (onlyperfstaged).skills/repo_cleanup/SKILL.md—tidyis the front door; the skill stays the executor.tests/test_hygiene_conductor.py— new: hermetic contract tests (JSONstructure, per-mode round-trip, exit codes, help) with
PYAUTO_ROOTpointed atan empty temp dir.
Autonomous-ship gate (
--auto, supervised)sign-off and shipped on explicit live human go-ahead.
Validation checklist (reviewer)
bin/pyauto-brain hygienerankstidyfirst when debris exists; deps/docs shown as surface.hygiene {tidy,deps,docs,noise}each emit real pre-scan + delegate;--jsonvalid.hygiene bogusexits 2;hygiene --helpprints the usage block.perfstill reports staged (phase 3).🤖 Generated with Claude Code
https://claude.ai/code/session_01Tw3EwV55k6VzxorYng3Kfn