Skip to content

feat(repos_sync): check the hygiene conductor's repo coverage - #132

Merged
Jammy2211 merged 3 commits into
mainfrom
claude/hygiene-coverage-drift-kso7h1
Aug 5, 2026
Merged

feat(repos_sync): check the hygiene conductor's repo coverage#132
Jammy2211 merged 3 commits into
mainfrom
claude/hygiene-coverage-drift-kso7h1

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

The Mind half of PyAutoLabs/PyAutoBrain#197 — paired with PyAutoLabs/PyAutoBrain#200, which repairs the conductor itself. Safe to merge in either order: the check skips cleanly when PyAutoBrain is not checked out.

Why the firewall could not catch this

The hygiene conductor's repo arrays drifted to five libraries of six and four organs of seven, with every drift check green. The tenant firewall had an entry for hygiene.sh — but it allowlisted the stale names. It asked "are these names permitted here?" when the question was "does this cover the organism?".

check_hygiene_coverage asks the second question, in two legs because either alone is escapable:

Leg A — every reader the conductor might use returns exactly the declared sets.

Worth being precise about what this can and cannot prove: the conductor reads repos.yaml, so a manifest edit moves both sides together and they can never desynchronise — that is the whole point of deriving. What leg A actually guards is the reader, specifically the PyYAML-free fallback, which runs only where PyYAML is absent and is verified nowhere else. A fallback that quietly drops a repo is exactly the original bug's class, so both readers run and both must agree. A --parser flag was added to the helper for this.

Leg B — no repo name is written back into a *_REPOS=(…) array. This is what stops a future edit from "simplifying" the derivation away.

Both legs were driven with failing input before being trusted

A drift check that cannot fail is decoration.

  • Leg B, on a re-hardcoded array → caught PyAutoFit, PyAutoLens.
  • Leg A, on a deliberately narrowed fallback regex → caught 4 repos dropped by the minimal reader alone, while the PyYAML reader stayed correct. This is precisely the invisible case.
  • My first attempt at leg A passed when it should have failed — that is how the tautology above was found, and why the check now tests the reader rather than the content.

The allowlist entry is removed, not updated

The conductor now names no instance fact at all (verified by running the token scan over both its files), so re-adding an entry would re-permit the drift this check exists to catch. A comment in its place says so.

Testing

  • 88 passed on Python 3.12 (the version the privacy job pins), plus 3.11 — 9 new.
  • repos_sync.py --check gains exactly one line and nothing else: diffed against a stashed baseline to prove the 6 tenant-firewall mismatches it still reports are pre-existing PyAutoHands drift, not introduced here.
  • lifecycle.py check: OK.
  • Fixtures are fictional throughout — tests/** is KEEP-copied verbatim into the public template, and a test that hardcodes the list under test can only agree with itself.

Generated by Claude Code

claude added 3 commits August 5, 2026 11:06
Advance the prompt draft/bug/pyautobrain/ → active/ and register the task in
active.md. Issue PyAutoBrain#197 filed via the GitHub MCP surface (no gh CLI in
this cloud session).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SzmzZidPBRqQZjEEw1d6ET
The tenant firewall could not catch the hygiene conductor's repo-array drift,
because its entry for hygiene.sh ALLOWLISTED the stale names — it asked "are
these names permitted here?" when the question was "does this cover the
organism?". So the arrays drifted to five libraries of six and four organs of
seven with every check green.

check_hygiene_coverage asks the second question, in two legs because either
alone is escapable:

  A. every reader the conductor might use returns exactly the declared sets.
     Note what this can and cannot prove: the conductor reads repos.yaml, so a
     manifest edit moves both sides together and they can never desynchronise —
     that is the point of deriving. What leg A actually guards is the READER,
     specifically the PyYAML-free fallback used only where PyYAML is absent and
     verified nowhere else. A fallback that quietly drops a repo is exactly the
     original bug's class, so both readers run and both must agree.
  B. no repo name is written back into a *_REPOS=(...) array — what stops a
     future edit from "simplifying" the derivation away.

Both legs were driven with failing input before being trusted: leg B on a
re-hardcoded array, leg A on a deliberately narrowed fallback regex, which it
caught as four repos dropped by the minimal reader alone.

The hygiene.sh firewall allowlist entry is REMOVED rather than updated: the
conductor now names no instance fact, so re-adding an entry would re-permit the
drift this check exists to catch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SzmzZidPBRqQZjEEw1d6ET
@Jammy2211
Jammy2211 merged commit c0576aa into main Aug 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants