From e009387a9f0294a0cf7bb8571f0917d4f1a1bfe3 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 02:04:08 +0000 Subject: [PATCH] hygiene ci + /ci_speedup: rank the slowest parts of CI off the Heart board MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Heart publishes per-script smoke timings, the slowest unit tests and every gate's wall-clock as the `performance` block of its board, but nothing read it: the only consumer was a human on the โฑ section. This adds the conductor's read of that surface and a maintenance door that acts on it. - `_hygiene_ci.py` (stdlib): fetch the board (Pages / HYGIENE_HEART_BOARD / a local Heart checkout โ€” org derived from the body map, never hardcoded), rank three lanes, fold a script's python legs into ONE candidate whose cost is the slowest leg (the gate waits for it), carry the evidence (seconds, share of leg, cache_jax, run URL) and read the levers off the script text when it is checked out (env_knob / simulates / jax_jit / full_datasets / real_search / subprocess / plots). One ๐Ÿ“‹ per item for /ci_speedup. An unreachable board is exit 3, never a clean zero. - `hygiene ci [--top N] [--lane โ€ฆ] [--json]`: on-demand mode (network, so never the default scan), flags passed through to the helper. - `skills/ci_speedup/`: the executor โ€” reproduce the number under the smoke profile (cold + warm cache), name the split (compile / simulate / search / repeated construction / plots), pick the smallest lever that keeps the assertion, ship through start_dev โ†’ ship_*; never demote a script to get the number down. - tests: leg folding, null rows, levers, unreachable path, dispatcher round-trip. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_015J8ZLmc55ZT1nSRntZMz9K --- agents/conductors/hygiene/AGENTS.md | 12 + agents/conductors/hygiene/_hygiene_ci.py | 405 +++++++++++++++++++++++ agents/conductors/hygiene/hygiene.sh | 28 +- skills/COMMANDS.md | 13 +- skills/ci_speedup/SKILL.md | 13 + skills/ci_speedup/ci_speedup.md | 127 +++++++ skills/hygiene/hygiene.md | 6 +- tests/test_hygiene_ci.py | 183 ++++++++++ 8 files changed, 780 insertions(+), 7 deletions(-) create mode 100755 agents/conductors/hygiene/_hygiene_ci.py create mode 100644 skills/ci_speedup/SKILL.md create mode 100644 skills/ci_speedup/ci_speedup.md create mode 100644 tests/test_hygiene_ci.py diff --git a/agents/conductors/hygiene/AGENTS.md b/agents/conductors/hygiene/AGENTS.md index fd6d9dad..ef9709a0 100644 --- a/agents/conductors/hygiene/AGENTS.md +++ b/agents/conductors/hygiene/AGENTS.md @@ -71,6 +71,7 @@ names โ€” and they keep reporting even when the repo-array modes are `unscanned` | Mode | Pre-scan (kind) | Delegates to | |------|-----------------|--------------| +| `ci` | the slowest parts of CI, read off the Heart board's published `performance` block โ€” smoke-script rows (python legs folded; the slowest leg is the cost, since the gate waits for it), the slowest unit tests, and every gate's wall-clock median (**timing**). Each item carries its evidence (seconds, share of its leg, `cache_jax` state, run URL) and, when the script is checked out under the scan root, the *levers* read from its text: `env_knob` (an `os.environ.get` sizing knob โ†’ a `profile_smoke.yaml` `set:`), `simulates`, `jax_jit`, `full_datasets`, `real_search`, `subprocess`, `plots`. Reads Pages, `HYGIENE_HEART_BOARD`, or a local Heart checkout; an unreachable board is exit 3, never a clean zero. On demand only โ€” never the default scan | `/ci_speedup` (executes one item through `/start_dev` โ†’ `ship_*`; a *slowdown* row is `/bug`'s, a hang is the board's kill-timer prompt) | | `perf` | dev-loop timing โ€” prefers Heart's tracked timing legs when present (`import_time`, `unit_test_timing`, `workspace_testmode_timing`), else times `import ` per library in a **subprocess** (**timing**) | `/refactor` / `/bug` (+ Heart timing legs) | | `tidy` | git debris โ€” stale branches, stashes, `[gone]` refs, dirty checkouts (**debris**) | **condemn** โ†’ files candidates into `condemned.md` async (PyAutoGut archives the fragile forms); no synchronous per-item gate | | `sweep` | reads `condemned.md`, classifies entries by their transit clock (**due** / pending / undated) | `pyauto-gut void` for past-due entries, behind the existing `repo_cleanup` safety gates | @@ -92,6 +93,7 @@ names โ€” and they keep reporting even when the repo-array modes are `unscanned` pyauto-brain hygiene # pre-scan across modes โ†’ ranked worklist pyauto-brain hygiene perf # import cost (subprocess) โ†’ /refactor + Heart legs pyauto-brain hygiene perf --profile