Skip to content

Commit dca7736

Browse files
committed
fix: the corroboration guard is all-or-nothing, not lockstep
CI failed on this PR: `test_body_map_package_agrees_with_the_witness_map` required `repos.yaml` to DECLARE `package:` for every witness row that names one, and tests.yml pins the sibling Mind checkout to `main`, where the field does not exist yet. The rest of the fix already tolerated that — `canonical_key` falls back to the hand table, with a test pinning it — but this guard did not, so the half that was designed to stand alone could not. Absence of the field is an older body map, not a contradiction: a map declaring NO package anywhere has nothing to corroborate, and the guard stands down. The moment it declares even one, every witness row that names a package must have one — so a PARTIALLY declared map still fails, which is what a new library added without its `package:` would look like. That is a stronger guard than the one it replaces, not a weakened one. Verified against CI's exact condition — this branch's Brain against a PyAutoMind checkout at origin/main, zero `package:` rows: 515 pass. Against the branch's Mind, with all seven declared: 515 pass. Mutation: declaring one package and not the rest fails the guard naming the other six. Also fixes the DeprecationWarning this PR introduced (`maxsplit` passed positionally in `unreachable_repos`). The identical warning from `normalise_repo` is pre-existing and left alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nj7cTnL8Ke5WoNsdGVhCKn
1 parent 6329db8 commit dca7736

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

agents/faculties/sizing/_sizing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def unreachable_repos() -> dict:
183183
name: "name contains a '.' or '/', which normalise_repo truncates — "
184184
"no @-mention can reach it"
185185
for name in _body_map_specs()
186-
if re.split(r"[./]", name, 1)[0] != name
186+
if re.split(r"[./]", name, maxsplit=1)[0] != name
187187
}
188188

189189

tests/test_policy_seams.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,22 @@ def test_body_map_package_agrees_with_the_witness_map():
273273
something compares them — #269 verified every witness row by reading each
274274
repo's own tree, and this pins the body map to that verified evidence rather
275275
than to a second, unchecked transcription.
276+
277+
ALL-OR-NOTHING, not lockstep. A body map that declares NO package anywhere
278+
simply predates the field (this repo's CI pins the sibling Mind checkout to
279+
`main`, and an adopting fork may never adopt it) — absence is an older map,
280+
not a contradiction, so there is nothing to compare and the guard stands
281+
down. Once the map declares even one, every witness row that names a package
282+
must have one: a PARTIALLY declared map is the drift this exists to catch,
283+
and is what a new library added without its `package:` would look like.
276284
"""
277285
sys.path.insert(0, str(BRAIN_HOME / "agents" / "conductors" / "refactor"))
278286
import _refactor
279287

280288
specs = _sizing._body_map_specs()
289+
if not any("package" in spec for spec in specs.values()):
290+
return # a body map from before the field existed — nothing to corroborate
291+
281292
disagree = {}
282293
for key, witness in _refactor.TEST_WITNESS.items():
283294
repo, _, test_dir = witness.partition("/")

0 commit comments

Comments
 (0)