Repository navigation
maintenance: drift-check the manifest against disk in both directions - #414
Merged
Merged
Conversation
repos_sync.py could not see either kind of drift:
declared but not on disk — skipped at three checks (CLAUDE pointers, origins,
codex hooks). After any regroup they would pass
while checking nothing. A successful check that
means reduced coverage is the failure to remove.
on disk but not declared — structurally invisible: the walk starts from the
manifest and asks whether each entry is present,
so an unlisted checkout is silence, not a failure.
A new `workspace checkouts (manifest <-> disk)` leg closes both. It needs NO
opt-out key for the first direction: with admin_jammy gone the manifest is 38
declared to 38 on disk, so absence is simply an error. The second direction
needs one entry — `unmapped_checkouts:` listing `.github`, a real checkout with
a real remote that is deliberately not a body-map repo. Only directories holding
.git are considered, so tmp/, scrap.md and the dotfiles need no declaration.
admin_jammy removed: it is not part of the PyAutoLabs ecosystem, and
PyAutoBrain/bin/README.md already recorded that it was slated to leave. Its
now-empty `admin:` category goes with it. This retires
draft/maintenance/pyautomind/autolens_jax_joss_manifest_gap.md, whose defect was
the second direction above and which outlived its example.
The leg enforces only under a root carrying a .pyauto-root marker, and otherwise
prints its denominator and fails nothing — CI lays repos out side by side with
no marker, so nothing asserts one exists. The denominator goes on its own line
because Heart's manifest_drift parser anchors the status to end-of-line; a
suffix would make the leg invisible to Heart. (That parser is too brittle and
already drops one existing leg — filed separately as a bug.)
repos_sync.py and spawn.py now take the root from the shared resolver, with
--root still winning. Both refuse a resolved root that does not contain their own
checkout: the resolver is Brain-anchored, and in a bundle whose PyAutoBrain is a
symlink it resolves to CANONICAL, which would have had --write regenerate
another tree. --write now also writes the marker beside the routing table, so it
is generated rather than placed by hand; the bootstrap is additive and pinned by
a test.
Suite 501 passed (was 482; +19). --check green on the real workspace, all 18
legs, and both new directions proven red-before/green-after on real repos.
Part of PyAutoBrain#391 (phase 1a). No directory layout changes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161NLKVzbBMzhaBfjpGogor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of PyAutoLabs/PyAutoBrain#391 (phase 1a). Changes no directory layout. Companion to PyAutoLabs/PyAutoBrain#392, PyAutoLabs/PyAutoHeart#232, PyAutoLabs/PyAutoHands#283; mergeable in any order.
The check was blind both ways
repos_sync.py:882CLAUDE pointers,:1318origins,:1607codex hooks). After any regroup these would pass while checking nothing — a successful check that means reduced coverage.A new
workspace checkouts (manifest ↔ disk)leg closes both.Red-before / green-after, on real repos:
PyAutoReducepulled aside): beforeexit=0, PyAutoReduce mentioned 0 times. Afterexit=1,✗ 'PyAutoReduce': declared in repos.yaml but not checked out at the workspace root.undeclared_clone/.git): beforeexit=0, 0 mentions. Afterexit=1, naming it and pointing at both remedies.No opt-out key was needed
The first direction ships with no exception mechanism at all.
admin_jammywas the only declared-but-absent entry, and it is not part of the PyAutoLabs ecosystem —PyAutoBrain/bin/README.md:12already recorded it as "slated to leavePyAutoLabs/". With it removed the manifest is 38 declared ↔ 38 on disk, so absence is simply an error. Its now-emptyadmin:category goes with it (verified nothing readscategories["admin"]).The reverse direction needs exactly one entry:
unmapped_checkouts:listing.github— a real checkout with a real remote that is deliberately not a body-map repo. Proven load-bearing by unlisting it and watching the real workspace go red. Only directories holding.gitcount, sotmp/,scrap.mdand the dotfiles need no declaration.This retires
draft/maintenance/pyautomind/autolens_jax_joss_manifest_gap.md, whose defect was the second direction and which outlived its example.CI safety
The leg enforces only under a root carrying a
.pyauto-rootmarker; otherwise it prints its denominator and fails nothing. Nothing asserts a marker exists. Verified againstfirewall_gate.yml, the only CI caller, which runs--check --root "$GITHUB_WORKSPACE"over four side-by-side repos:OK · 4 of 38 declared repo(s) checked out; no .pyauto-root at this root — presence not enforced, run exit 0.The denominator goes on its own line because Heart's
manifest_drift.py:45anchors the status to end-of-line — a suffix would make the leg invisible to Heart. That parser is too brittle and already silently drops one existing leg (generated hooks, whose(37 of 37 checked out, …)suffix breaks the regex); filed separately as a bug, not touched here.Resolver adoption, with a guard
repos_sync.pyandspawn.pytake the root from the shared resolver,--rootstill winning. Both refuse a resolved root that does not contain their own checkout: the resolver is Brain-anchored, and in a task bundle whosePyAutoBrainis a symlink it resolves to canonical — which would have had--writeregenerate another tree and the bootstrap fan hooks out over it.--writenow also writes the marker beside the routing table, so it is generated rather than placed by hand. The bootstrap is additive and confirmed live, not argued: fresh root →--checkpasses with "presence not enforced" →--writewrites the marker → next--checkenforces. Pinned astest_the_bootstrap_is_additive.Correction to the original scope:
spawn.py:507is not a workspace-root site — thatparents[2]lives inside a template string for a generated satellite repo's smoke runner. Left alone; the real site is themain()default.Verification
--checkon the real workspace → all 18 legs OK, exit 0, includingworkspace checkouts (manifest ↔ disk): OK · 38 of 38 declared repo(s) checked out. Suite 501 passed (was 482; +19 across two new files, fictional fixtures, each direction driven to failure).🤖 Generated with Claude Code
https://claude.ai/code/session_0161NLKVzbBMzhaBfjpGogor