From a70ced3dbd91d414175bf523cddde0d6b7dd5630 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Aug 2026 22:18:24 +0000 Subject: [PATCH] prompt: complete hygiene-detail-flag (PyAutoBrain#203, PR #204 merged) Advances the prompt active/ -> complete/2026/08/ now that PyAutoBrain#204 (abacdd3) and PyAutoMind#138 (4d19947) are merged and issue #203 is closed, and removes the task's active.md section per the ledger invariant. The record carries the verification (19 drifted keys resolved exactly; 236 tests green on merged main), the API constraint that kept diff() / orphan_files() signature-stable, and four traps worth reuse: active.md merge conflicts are routine and always additive; prompt_sync_push targets main and 403s on a mandated branch; this container's local Mind main diverged from origin/main with content that had already landed under different SHAs; and _suppressed() is pre-existing dead code left deliberately unfixed. lifecycle.py check and index --check both pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XvQ4YHkNynTmS4ovHAgbWB --- active.md | 17 --- active/add_a_detail_flag_to_the_hygiene.md | 14 --- complete/2026/08/hygiene-detail-flag.md | 114 +++++++++++++++++++++ complete/index.md | 3 +- 4 files changed, 116 insertions(+), 32 deletions(-) delete mode 100644 active/add_a_detail_flag_to_the_hygiene.md create mode 100644 complete/2026/08/hygiene-detail-flag.md diff --git a/active.md b/active.md index 56a5db73..618f1fb6 100644 --- a/active.md +++ b/active.md @@ -1,22 +1,5 @@ # Active Tasks -## hygiene-detail-flag -- issue: https://github.com/PyAutoLabs/PyAutoBrain/issues/203 -- status: library-dev — PR OPEN, CI GREEN. PyAutoBrain#204 (`c05c9e4`, Brain Tests success, mergeable_state clean); Mind-side state in PyAutoMind#138. Cloud session (`web-github`): no worktree, no `gh` CLI; issue and PRs filed via the GitHub MCP surface, work done in the canonical /home/user/PyAutoBrain checkout on the harness-mandated branch. Merge is a human act — not merged. -- verification: full PyAutoBrain suite 236 passed (`tests/`), hygiene conductor file 53 passed. `--detail` reproduces the expected 19 keys exactly (see baseline below); default line byte-identical; `hygiene config --json` row and the default summary table unchanged. -- shape: `diff_detail()` / `orphan_detail()` return the items; `diff()` / `orphan_files()` became the count view over the same single traversal via `_summarise()`, so a tally cannot disagree with its own listing. `render_detail()` groups keys under the workspace file missing them and orphans under their repo. `--detail` drops the machine `count|` prefix (it is the human/routing view); default output keeps it. -- scope-note: also wired the `hygiene config` single-mode human branch in `hygiene.sh` to render the detail block, mirroring the existing `refs`/`optdeps`/`extras` branches — without it the flag is only reachable by calling the helper directly, which is the same "not routable" complaint one level up. `prescan_config()` untouched. -- observed-not-fixed: `_hygiene_config.py::_suppressed()` is dead code — it predates this change (`orphan_files` always inlined `r.split("/")[0] in owners`). Left alone deliberately to keep this PR scoped; worth a separate tidy. -- what: the hygiene `config` prescan (`agents/conductors/hygiene/_hygiene_config.py`) emits only `count|summary`; `main()` takes only `--root`. Add `--detail` printing each drifted key path grouped by the config file it is missing from, and the same for the `orphan_files` signal. Default single-line output stays byte-identical so the conductor's summary table is unchanged. -- why it matters: the hygiene skill routes config findings onward for repair, but the mode hands over nothing routable — recovering the key paths today means importing the module and re-running `diff()` by hand. -- baseline (live checkouts, root /home/user): `19|19 library config keys absent downstream (review/mirror): autofit_workspace:3 autogalaxy_workspace:15 autolens_workspace:1`; orphan_files 0. `--detail` must resolve those 19 to autofit_workspace general.yaml (output.search_internal, test.check_likelihood_function) + logging.yaml (total_files_open); autogalaxy_workspace general.yaml (test.exception_override) + 14 notation.yaml labels; autolens_workspace general.yaml (output.fit_dill). -- api-constraint: `diff()` and `orphan_files()` keep their `(total, ["repo:N", ...])` returns — `tests/test_hygiene_conductor.py` asserts all three directly. The detail cores go underneath them, one traversal, so count and listing cannot disagree. -- prompt: active/add_a_detail_flag_to_the_hygiene.md -- worktree: (none — cloud session, canonical checkout) -- repos: - - PyAutoBrain -- prompt-provenance: the draft was filed on `claude/hygiene-agent-run-n9qtd5` (PyAutoMind, commit 89f5404, which filed four hygiene-run findings at once) and is not yet on main. Only this one prompt file was checked out onto the working branch — the other three belong to their own tasks. - ## pyautogalaxy-mge-sigma-test - issue: https://github.com/PyAutoLabs/PyAutoGalaxy/issues/550 - status: library-dev — fix COMMITTED AND PUSHED to `claude/pyautogalaxy-mge-sigma-test-3neq07` (PyAutoGalaxy 91eb878). NO PR opened (not requested). Cloud session, no worktree and no `gh` CLI; issue filed via the GitHub MCP surface. diff --git a/active/add_a_detail_flag_to_the_hygiene.md b/active/add_a_detail_flag_to_the_hygiene.md deleted file mode 100644 index baeae2fd..00000000 --- a/active/add_a_detail_flag_to_the_hygiene.md +++ /dev/null @@ -1,14 +0,0 @@ -# Add a --detail flag to the hygiene config scan so - -Type: feature -Target: PyAutoBrain -Repos: -- PyAutoBrain -Difficulty: small -Autonomy: safe -Priority: normal -Status: formalised - -Add a --detail flag to the hygiene config scan so its findings are routable. The config scan in PyAutoBrain agents/conductors/hygiene/_hygiene_config.py emits only a 'count|summary' line naming how many library config keys are absent downstream and a per-target tally. Its main() accepts only --root and prints that one line, so there is no way to see which key paths actually drifted. The hygiene skill tells the operator to route config findings onward for repair, but the mode hands over nothing routable: recovering the key paths currently means importing the module and re-running its diff() internals by hand. Add a --detail flag that prints each drifted key path grouped by the config file it is missing from, keeping the existing single-line output as the default so the conductor's summary table is unchanged. Extend the same treatment to the orphan_files signal the module already computes. - - diff --git a/complete/2026/08/hygiene-detail-flag.md b/complete/2026/08/hygiene-detail-flag.md new file mode 100644 index 00000000..4e4736dd --- /dev/null +++ b/complete/2026/08/hygiene-detail-flag.md @@ -0,0 +1,114 @@ +Added a `--detail` flag to the hygiene conductor's `config` prescan so its +findings can actually be routed to `/refactor`. + +## The problem + +`agents/conductors/hygiene/_hygiene_config.py` emitted only a `count|summary` +line and its `main()` accepted only `--root`. The mode therefore reported *how +many* library config keys were absent downstream (and a per-repo tally) but +never *which*. The hygiene skill instructs the operator to route config findings +onward for repair — recovering the actual key paths meant importing the module +and re-running `diff()` internals by hand. + +## What shipped + +**Two views over one traversal.** Each of the two signals was split into a +detail core plus the existing count wrapper: + +- `diff_detail()` → `(workspace repo, config file, sorted missing key paths)` +- `orphan_detail()` → `(repo, sorted orphan relpaths)` +- `diff()` / `orphan_files()` became the count view over those same walks, via a + shared `_summarise()` / `_counts_by_repo()`. + +Because the count is now *derived from* the listing rather than computed +alongside it, a tally can no longer disagree with what it is a tally of. + +`render_detail()` groups each drifted key path under the workspace config file +missing it, and each orphan file under its repo. `--detail` prints the summary +sentence without the machine `count|` prefix (it is the human/routing view), +then the groups. + +**The default is byte-identical.** `prescan_config()` in `hygiene.sh` parses +`${out%%|*}`, so the conductor's default summary table and the `--json` row are +untouched — locked by a test that fails if a line, prefix, or trailing newline +is ever added. + +**One addition beyond the filed prompt:** the `hygiene config` single-mode human +branch in `hygiene.sh` now renders the detail block, mirroring the existing +`refs` / `optdeps` / `extras` branches. Without it the flag would be reachable +only by calling the helper directly — the same "hands over nothing routable" +complaint one level up. The usage line was corrected too: the mode has always +folded in the orphan signal, but only named the key drift. + +## API constraint that shaped the design + +`diff()` and `orphan_files()` keep their exact `(total, ["repo:N", ...])` +returns. Three existing tests in `tests/test_hygiene_conductor.py` +(`test_config_helper_recursive_key_diff`, +`test_orphan_files_flags_unmirrored_and_suppresses_owned`, +`test_orphan_files_skips_non_mirror_repos`) call them directly, so the detail +cores had to go *underneath* them rather than replace them. + +## Verification + +`--detail` against the live checkouts resolved the 19 drifted keys to exactly +the expected set — this was the acceptance criterion, checked rather than +assumed: + +- autofit_workspace `general.yaml` — `output.search_internal`, + `test.check_likelihood_function`; `logging.yaml` — `total_files_open` +- autogalaxy_workspace `general.yaml` — `test.exception_override`; plus 14 + `notation.yaml` labels (multipoles, virial mass/overdensity, GRF and + `InputPotential` superscripts) +- autolens_workspace `general.yaml` — `output.fit_dill` + +Full PyAutoBrain suite: 236 passed (re-run on merged `main`). Seven new contract +tests cover the key grouping, the orphan grouping (with `ORPHAN_OWNERS` +suppression intact), the unchanged default line, the clean-tree case, the +`hygiene config` surface, and the unchanged `--json` row. Orphan count is 0 in +the current checkouts, so that path is covered by fixtures, not live data. + +## PRs + +- PyAutoBrain#204 — MERGED `abacdd3` (head `c05c9e4`, Brain Tests green) +- PyAutoMind#138 — MERGED `4d19947` (Mind state; Lifecycle Drift green) +- Issue PyAutoBrain#203 — closed by the merge + +## Traps and findings + +- **`active.md` conflicts are the norm, not an incident.** PyAutoMind#138 went + `dirty` within minutes of opening: `main` moved (#137) and both sides + prepended a section under `# Active Tasks`. Resolution is always additive — + keep both — and worth verifying with `git diff origin/main -- active.md` + showing *only* your own section added, rather than trusting the merge. +- **`prompt_sync_push` pushes `main`, not your branch.** On a harness-mandated + branch it fails with `HTTP 403` / non-fast-forward after committing. The + commit lands fine; push the branch explicitly afterwards. +- **Local Mind `main` in this container had ~50 commits not on `origin/main`**, + whose content had in fact landed upstream via PRs under different SHAs — + `origin/main` was strictly richer in files. Left untouched rather than reset, + since the local branch still held 335 lines `origin/main` lacked. Worth a + deliberate reconciliation pass; do not assume local `main` is authoritative. +- **`_hygiene_config.py::_suppressed()` is dead code** — it predates this change + (`orphan_files` always inlined `r.split("/")[0] in owners`). Deliberately left + alone to keep the diff scoped; a candidate for a later tidy. +- Cloud session (`web-github`): no worktree, no `gh` CLI — issue, PRs and merges + went through the GitHub MCP surface; work happened in the canonical + `/home/user/PyAutoBrain` checkout on the mandated branch. + +## Original prompt + +# Add a --detail flag to the hygiene config scan so + +Type: feature +Target: PyAutoBrain +Repos: +- PyAutoBrain +Difficulty: small +Autonomy: safe +Priority: normal +Status: formalised + +Add a --detail flag to the hygiene config scan so its findings are routable. The config scan in PyAutoBrain agents/conductors/hygiene/_hygiene_config.py emits only a 'count|summary' line naming how many library config keys are absent downstream and a per-target tally. Its main() accepts only --root and prints that one line, so there is no way to see which key paths actually drifted. The hygiene skill tells the operator to route config findings onward for repair, but the mode hands over nothing routable: recovering the key paths currently means importing the module and re-running its diff() internals by hand. Add a --detail flag that prints each drifted key path grouped by the config file it is missing from, keeping the existing single-line output as the default so the conductor's summary table is unchanged. Extend the same treatment to the orphan_files signal the module already computes. + + diff --git a/complete/index.md b/complete/index.md index 1a18685f..e75756f0 100644 --- a/complete/index.md +++ b/complete/index.md @@ -6,7 +6,7 @@ Token-light navigation over the finished-work records (schema: only then grep a dated bucket. Curators: edit the band between the CURATED markers; everything below GENERATED is rebuilt. -894 records across 7 buckets. +895 records across 7 buckets. ## Highlights @@ -27,6 +27,7 @@ _(curate hard-won records here — survives regeneration.)_ - [health-conductor-stale-verdict](2026/08/health-conductor-stale-verdict.md) - [howto-smoke-all-tutorials](2026/08/howto-smoke-all-tutorials.md) - [hygiene-coverage-drift](2026/08/hygiene-coverage-drift.md) +- [hygiene-detail-flag](2026/08/hygiene-detail-flag.md) - [interferometer-start-here-integrate-oom](2026/08/interferometer-start-here-integrate-oom.md) - [intra-family-dep-floors](2026/08/intra-family-dep-floors.md) - [jax-grad-smoke-timeout-budget](2026/08/jax-grad-smoke-timeout-budget.md)