Repository navigation
Description
Part of the #241 epic. Registers C-90. Related to #245.
Problem
Two guards in this arc are defended by proofs that cannot fail.
1. The partition's mutation proof is a tautology. tests/test_env_declaration.py:890:
base = {name: {} for name in _TABLE_ROLE}
...
assert not _unclassified_tables(base), "the real registry's tables must all classify"_unclassified_tables is sorted(set(registry) - set(_TABLE_ROLE)), and base is built from _TABLE_ROLE. The expression reduces to the empty set for every possible value of _TABLE_ROLE and every possible upstream registry. Mutation-proven: deleting "edition": "IGNORED" from _TABLE_ROLE — the live registry does carry an [edition] table — failed test_every_table_in_the_registry_is_classified_here while this assertion passed.
Its message compounds it: "the real registry's tables must all classify" asserts a fact about a file this test never opens. A maintainer reading it believes the live registry is validated here. The only thing that validates it skips whenever the sibling is absent. This is decoration inside the test whose own docstring is about removing decoration (ADR-014 §2).
2. registry_current has no test. tests/seam_registry.py:113. The module was extracted for exactly one reason: two copies of the reader disagreed about whether to read the sibling's main or its working tree, and reading the working tree is issue #196 verbatim — the case that cost this platform a withdrawn pull request. The function that settles it is called by five tests and is the subject of none.
Mutation-proven with coverage: replacing its body with rev-parse HEAD → registry_at(repo, sha) — the defect it exists to prevent — leaves the suite at its exact baseline. Lines 86-90 (git show non-zero), 99-103 (the tomllib except) and 135-139 (if not head) are executed by nothing; deleting the try/except and deleting the returncode guard both stay green. test_the_pinned_reader_refuses_every_way_a_baseline_can_be_wrong only ever calls registry_at, and its scratch repo writes valid TOML at every commit, so git show cannot fail and only valid TOML is ever parsed.
Work
- Replace the tautology with an assertion that actually varies, or delete it and let
test_every_table_in_the_registry_is_classified_herecarry the guarantee alone — with its gating stated honestly (it skips without the sibling; say so where the reader will look). - Give
registry_currentits own test against a scratch repository with amain, anorigin/main, and a working tree that differs from both. Assert it readsmain, not the checkout's current ref. - Extend the scratch-repo scenarios so
registry_at's unreached branches are reached: a commit where the registry path is absent (git shownon-zero), a commit where it is not valid TOML, and a repository with neithermainnororigin/main. - Record coverage of
tests/seam_registry.pybefore and after in the pull request.
Acceptance criteria
- Every assertion in
test_the_partition_is_directional_and_bitesfails under at least one mutation of the function it names. - Replacing
registry_currentwith a working-tree orHEADread fails at least one test, demonstrated. - Every
raise RegistryReadErrorbranch inseam_registry.pyis executed by at least one test. - No assertion message claims a fact about a file the test does not open.
Implementation notes
Story #245 may change what the partition asserts. Sequence this after it, or coordinate — the tautology sits directly on the code S4 touches.
The scratch-repo helper needs the hardening from #247 before it grows more scenarios; check whether that has landed first.
Testing
pytest -q tests/test_env_declaration.py. Coverage via sys.settrace or coverage run --include='tests/seam_registry.py'.
Labels
story, testing
Activity
Polichinel commentedon Aug 12, 2026
Gate 2, unchanged in scope. Sequence after #245 — the tautology sits directly on the partition code #245 touches.
Both items are small: the tautology is a deletion, and
registry_current's test is a scratch repo withmain,origin/main, and a divergent working tree. Do not let the coverage work grow past reaching the three deadRegistryReadErrorbranches.Merge pull request #259 from views-platform/fix/246-proofs-that-prove…
Polichinel commentedon Aug 12, 2026
Landed in #259. Both proof defects closed, five mutations proven — including one of mine that was badly chosen and is recorded rather than replaced.