Skip to content

feat(hygiene): hygiene conductor — phase 2 modes (pre-scan + delegate) (#89) - #90

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

feat(hygiene): hygiene conductor — phase 2 modes (pre-scan + delegate) (#89)#90
Jammy2211 merged 1 commit into
mainfrom
feature/hygiene-agent-phase-2

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

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). perf stays staged for
phase 3.

Modes (live)

Mode Pre-scan (kind) Delegates to
tidy git debris — stale branches / stashes / [gone] refs / dirty checkouts (debris) /repo_cleanup (Brain)
noise none — needs a pytest + workspace-script run (advisory) /cli_noise_clean (Heart)
deps capped/pinned specifiers in library pyproject.toml (surface) /dep_audit (Heart, hits PyPI)
docs docs/api/*.rst + currentmodule counts, 3 doc repos (surface) /audit_docs (Heart, imports)

noise/deps/docs route 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:

  • debris (tidy) — directly-removable items; a real, rankable count.
  • surface (deps/docs) — only sizes the audit; the count is not a
    problem count (real findings emerge when the delegated skill runs).
  • advisory (noise) — no cheap local signal.

Only debris drives the default ranking, so the no-arg run recommends tidy
when 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-kind
    model, honest default ranking, extended --json HygieneDecision
    ({mode,kind,status,count,summary,delegate}).
  • agents/conductors/hygiene/AGENTS.md — modes table + pre-scan-kind doctrine.
  • skills/hygiene/hygiene.md — veneer updated (only perf staged).
  • skills/repo_cleanup/SKILL.mdtidy is the front door; the skill stays the executor.
  • tests/test_hygiene_conductor.pynew: hermetic contract tests (JSON
    structure, per-mode round-trip, exit codes, help) with PYAUTO_ROOT pointed at
    an empty temp dir.

Autonomous-ship gate (--auto, supervised)

  • Tests — PyAutoBrain 34 pass (30 + 4 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; run parked at supervised ship
    sign-off and shipped on explicit live human go-ahead.

Validation checklist (reviewer)

  • bin/pyauto-brain hygiene ranks tidy first when debris exists; deps/docs shown as surface.
  • hygiene {tidy,deps,docs,noise} each emit real pre-scan + delegate; --json valid.
  • hygiene bogus exits 2; hygiene --help prints the usage block.
  • perf still reports staged (phase 3).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Tw3EwV55k6VzxorYng3Kfn

…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
@Jammy2211
Jammy2211 merged commit 60064d9 into main Jul 11, 2026
@Jammy2211
Jammy2211 deleted the feature/hygiene-agent-phase-2 branch July 11, 2026 16:37
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 2 modes (absorb + consult)

1 participant