Repository navigation
Description
Overview
Follow-up to #267 / #268, which fixed the PyAutoNerves half of the Refactor
Agent's witness map. This is the audit that prompt asked for and never got: "add
PyAutoNerves — and audit the other organ/library repos — so refactor
decisions stop flagging witnessed repos as unwitnessed."
The audit found the Nerves case was not a one-off. test_witness misses five
repos that have real test suites, and two more are split across two keys the
way autoconf/pyautonerves were — so pyauto-brain refactor tells you to
"strengthen tests first" for repos that are already tested.
Every row below was verified against the repository itself (shallow tree read of
PyAutoLabs/<repo>@main), not inferred from naming convention.
Findings
| Repo | Category | Test dir (verified) | In test_witness today |
|---|---|---|---|
| PyAutoNerves | organ | test_autonerves |
✅ (added in #268) |
| PyAutoFit | library | test_autofit |
✅ |
| PyAutoArray | library | test_autoarray |
✅ |
| PyAutoGalaxy | library | test_autogalaxy |
✅ |
| PyAutoLens | library | test_autolens |
✅ |
| PyAutoCTI | library | test_autocti |
❌ missing entirely |
| PyAutoReduce | library | test_autoreduce |
pyautoreduce — @autoreduce misses it |
| PyAutoBrain | organ | tests |
❌ missing |
| PyAutoHeart | organ | tests |
❌ missing |
| PyAutoHands | organ | tests |
❌ missing |
| PyAutoMemory | organ | tests |
❌ missing |
| PyAutoMind | organ | tests |
❌ missing |
| PyAutoGut | organ | none | correctly absent — genuinely unwitnessed |
The two-keys-per-repo defect recurs
This is the same root cause #268 fixed for Nerves, still live for two repos:
normalise_repo("PyAutoCTI")→pyautocti,normalise_repo("@autocti")→
autocti. No alias joins them, and neither is intest_witness.normalise_repo("PyAutoReduce")→pyautoreduce,
normalise_repo("@autoreduce")→autoreduce. The map is keyed on the
prefixed form, so the bare package mention — the spelling prompts actually
use — misses.
Same shape for the organs: extra_organism_targets adds bare autohands as a
target while @PyAutoHands normalises to pyautohands.
Plan
- Give every repo one canonical normalised key, extending the alias policy fix: retire PyAutoConf rename leftovers in Brain functional surfaces #268
established: bare package name where the repo ships a package
(autocti,autoreduce), repo name where it does not (pyautobrain,
pyautoheart, …). - Re-key and fill
test_witnessso all twelve tested repos resolve, under every
spelling a prompt might use. - Leave PyAutoGut out, with a comment saying it has no suite — an honest "no
witness" rather than a silent gap. - Add a drift guard so a new library or organ cannot join the body map without
either a witness row or an explicit, reasoned exclusion.
Detailed implementation plan
Affected Repositories
- PyAutoBrain (only)
Work Classification
Library / organism-infrastructure. Effective autonomy safe
(header safe, maintenance cap safe).
Implementation Steps
-
config/policy.yaml→repo_aliases. Addpyautocti: autocti,
pyautoreduce: autoreduce, andautohands: pyautohandsso each repo has a
single canonical key. (Nerves already done in fix: retire PyAutoConf rename leftovers in Brain functional surfaces #268.) -
config/policy.yaml→test_witness. Re-keypyautoreduce→
autoreduce; addautocti: PyAutoCTI/test_autocti,
pyautobrain: PyAutoBrain/tests,pyautoheart: PyAutoHeart/tests,
pyautohands: PyAutoHands/tests,pyautomemory: PyAutoMemory/tests,
pyautomind: PyAutoMind/tests. Comment PyAutoGut's deliberate absence. -
tests/test_policy_seams.py. New drift guard: every body-map repo of
categorylibraryororganmust have atest_witnessrow, except a
namedWITNESS_EXEMPTset (PyAutoGut, with its reason). A new organ with a
suite and no witness row then fails here instead of silently reporting
unwitnessed. Plus per-spelling assertions for the CTI and Reduce keys,
mirroring the Nerves ones fix: retire PyAutoConf rename leftovers in Brain functional surfaces #268 added.
Key Files
config/policy.yaml— both maps.agents/conductors/refactor/_refactor.py—behaviour_preservationconsumer (unchanged).agents/faculties/sizing/_sizing.py—normalise_repo/_body_map_categories(unchanged).tests/test_policy_seams.py— the guard.
Verification
python3 -m pytest tests/ -qpython3 PyAutoMind/scripts/repos_sync.py --check- Live
bin/pyauto-brain refactoron prompts mentioning the newly-witnessed
repos, confirmingunwitnessed_reposis empty.
Risk
Low, and lower than #268: test_witness has exactly one consumer
(_refactor.behaviour_preservation) and the change only ever adds resolvable
keys. No conductor behaviour changes for a repo that already resolved.
Note on ordering
This builds on #268 (same file, same two maps) and should merge after it.
Original Prompt
Click to expand starting prompt
# Refactor Agent witness map lacks PyAutoNerves test suite
Type: maintenance
Target: pyautobrain
Repos:
- @PyAutoBrain
Difficulty: low
Autonomy: safe
Priority: low
Status: draft
Filed: 2026-08-19 (backfilled from git)
## Finding (2026-08-19, lazy-heavy-imports RefactorDecision)
`pyauto-brain refactor` reported `[unwitnessed: pyautonerves]` and advised
"strengthen tests first", but PyAutoNerves has a real suite
(`test_autonerves`, 157 tests, verified jax-less in the JAX-default arc).
The witness map only knows autoarray/autofit.
## Task
Add PyAutoNerves (`PyAutoNerves/test_autonerves`) — and audit the other
organ/library repos — to the Refactor Agent's witness map so refactor
decisions stop flagging witnessed repos as unwitnessed.
Activity
Jammy2211 commentedon Aug 24, 2026
Shipped as #271 — and one gap deliberately left open
PR #271 covers the audit as planned: PyAutoCTI and the five organ suites added,
PyAutoReduce re-keyed, PyAutoGut's absence documented, three body-map-derived
guards added and mutation-tested. 468 tests green,
repos_sync --checkclean.Two things worth recording here rather than burying in the PR.
The organ spellings still split — not fixed, on purpose
_target_sets.names_forregisters both spellings of everyPyAuto*repo asknown targets (
name.lower()andname.lower()[2:]). For libraries the bareform is canonical and the alias table joins them. For organs it does not:
@PyAutoBrainpyautobrain@autobrainautobrain@autoheart,@automemory,@automind,@autogutI fixed only
@autohands, becauseextra_organism_targetsexplicitlydeclares it, so it reaches real code today. The rest are latent: no prompt in
the Mind history uses them.
Fixing them properly is not a one-line alias sweep — it means deciding whether
organs key bare or prefixed, and
target_signalskeys the prefixed form(
pyautobrain,pyautomind,pyautoheart,pyautobuild), so the decision hasto hold across both maps. That is a policy question wider than this prompt, and
widening #271 to answer it would have made a
safe-autonomy maintenance PR intoa routing change. Worth a
refactor/pyautobrain/prompt — happy to file onevia
/intakeif you want it picked up.The deeper pattern
Three separate repos have now hit the same defect — Nerves (#267), CTI and
Reduce (this one) — and each was found only because someone happened to look.
The shared cause is that
repo_aliasesis hand-maintained whileKNOWN_REPOSis derived from the body map, so the two drift silently andthe gap only shows as a wrong-but-plausible conductor message.
Guard 2 in #271 (a witness key must be what its repo normalises to) closes the
witness-map instance of this. It does not close the general case: an alias gap
in a map with no coverage guard is still invisible. If a fourth instance turns
up, the fix is probably to derive the aliases from the body map rather than add
another per-map guard.
Heart
Not consulted —
pyauto-heartis unreachable in this web-github session, as on#268. The suite stood in per the
WORKFLOW.mdfallback and is green, but noverdict was obtained, and no YELLOW was acknowledged because none was seen.
Generated by Claude Code
Jammy2211 commentedon Aug 24, 2026
Shipped
Merged as #271 (
cf969f3) intomain, after #268. CI green:Brain Testson
2846b65. Branch proven merged — 0 unmerged commits.PyAutoCTI and the five organ suites (Brain, Heart, Hands, Memory, Mind) added;
PyAutoReduce re-keyed off the prefixed spelling; PyAutoGut's absence documented
as deliberate. Three body-map-derived guards added and mutation-tested — the
pre-existing mis-keyed Reduce row now fails all three.
The gap left open is filed as a prompt rather than left as a comment:
draft/bug/pyautobrain/organ_repo_spellings_split_across_keys.md(merged inPyAutoMind#304). It covers the bare organ spellings —
@autobrain,@autoheart,@automemory,@automind,@autogut— which are registered asknown targets but normalise to keys nothing is filed under, and it asks for the
keying decision before any edit, since
target_signalskeys the prefixed formwhile
test_witnessnow keys libraries bare.That prompt also carries the class-level question this task raised: three repos
have now hit the same defect because
repo_aliasesis hand-maintained while theknown-target set is derived from the body map. Deriving the aliases would close
the class instead of its fourth instance.
Note on the intake:
pyauto-brain intake classifyscored thisbugat highconfidence (kept) but proposed
Target: autocti— it read the prior-instancehistory in the draft as the subject — and
Difficulty: too-large, inflated byrepo names and design keywords. Corrected to
pyautobrain/largeon review,with the correction recorded in the prompt itself.
Heart was not consulted here either;
autonomy_log.mdrecords the run asheart NOT EVALUATED.Generated by Claude Code