Skip to content

S10 (#192) — repair the þing-01 redaction guard; a declared root that vanishes now fails - #204

Merged
Polichinel merged 1 commit into
developmentfrom
feat/s10-repair-redaction-guard
Aug 2, 2026
Merged

Polichinel merged 1 commit into
developmentfrom
feat/s10-repair-redaction-guard

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Closes #192. Closes register C-74. Part of epic #181.

The defect

tests/test_redaction_guard.py pins the þing-01 #135 delivery-log redaction audit over five module trees. Epic #148's #153 moved the machinery from unfao/ to contract/, and four of the five roots were never re-pointed.

files scanned
stale roots (as merged, for two days) 6
repaired 17

Silent by construction. _python_sources calls rglob on anything that is not a file, and rglob on a nonexistent directory yields an empty iterator rather than raising. A missing root and a clean root are indistinguishable to the scan.

Re-pointing fixes today; the existence assertion fixes the class

That is the half worth having. A declared path that does not exist is now an error rather than silence, and a third check bounds the count so narrowing surfaces as a number.

Mutation-proven by restoring the pre-S10 roots — two failures:

declared credential-blind root(s) no longer exist:
  ['unfao/wire', 'unfao/historical.py', 'unfao/track_a_source.py', 'unfao/frame_extraction.py']

the credential-blind scan covers only 6 files.

And the guard is now proven to bite on the defect it was written for — a module reading os.environ['APPWRITE_DATASTORE_API_KEY']. That had never been demonstrated, which is what two silent days buys you.

List, not derivation — decided, per the issue

test_clone_readiness.py enumerates an overlapping module set for a different question ("does the machinery import without the partner?"). Folding them together would couple two guards whose sets are free to diverge — a module can be partner-neutral without being credential-blind. Two lists that each say what they mean beat one that means neither.

What makes the explicit list safe is the existence assertion. Without it, a list is exactly the fragile thing it looked like here.

No leak occurred

Checked at registration and again now: zero hits for os.environ, getenv, load_dotenv, API_KEY, credentials across all 17 files. The audited fact stayed true. What had gone was the thing that would notice it stopping.

Two claims restored, not quietly reverted

C-57 said the redaction clause was "already mechanically enforced"; Cluster I's fix strategy cited this exact file as the guard pattern working. Both were corrected when C-74 was registered this morning. Both are true again — and the episode is left visible, because a claim that was false for two days is worth more as a record than as a correction tidied away.

The register's own guard caught me mid-story

The extraction regex for moving C-74 used a (?=^### ) boundary. C-74 was the last entry in Open Concerns, so the match ran past the section break and swallowed the ## Disagreements heading, filing three D-entries under Open.

Four integrity tests failed immediately:

header says 17 open concerns, the file holds 20
disagreement(s) filed under 'Open Concerns': ['D-12', 'D-11', 'D-09']

Fixed with a section-aware boundary. The guard S2 built, catching a defect in the tooling that maintains the register it guards — which is the epic's thesis arriving from an unexpected direction.

Verification

ruff check .                                     # clean
pytest -q                                        # 302 passed, 3 skipped, 41 xfailed, 5 known pyarrow
pytest -q tests/test_redaction_guard.py          # 5 passed
pytest -q tests/test_register_integrity.py       # 10 passed
git diff --stat origin/main -- tests/fixtures/   # empty

Register: 74 concerns, 17 open, 57 resolved.

🤖 Generated with Claude Code

… that vanishes now fails

tests/test_redaction_guard.py pins the #135 delivery-log redaction audit over five
module trees. Epic #148's #153 moved the machinery from unfao/ to contract/ and
four of the five roots were never re-pointed. The guard kept passing while
scanning 6 files instead of 17.

Re-pointing fixes today. The assertion that every declared root EXISTS fixes the
class, and that is the half worth having: rglob on a nonexistent directory yields
an empty iterator rather than raising, so a missing root and a clean root were
indistinguishable to the scan. A package move silently emptied it while the suite
stayed green. A third check bounds the count, so narrowing surfaces as a number
rather than as nothing.

Mutation-proven by restoring the pre-S10 roots: two failures, one naming all four
missing paths, one reporting "covers only 6 files". The guard is also now proven
to bite on the defect it was written for — a module reading
os.environ['APPWRITE_DATASTORE_API_KEY'] — which had never been demonstrated. An
unproven guard is what two silent days buys you.

Explicit list, not derivation, decided and recorded. test_clone_readiness.py
enumerates an overlapping set for a different question; folding them together
would couple two guards whose sets are free to diverge, since a module can be
partner-neutral without being credential-blind. What makes the list safe is the
existence assertion.

No leak occurred. The relocated modules were checked at registration and again
here: zero hits for os.environ, getenv, load_dotenv, API_KEY, credentials.

Two entries that had vouched for this guard are restored rather than quietly
reverted — C-57's "already mechanically enforced" and Cluster I's fix strategy —
because a claim that was false for two days is worth more as a record.

Also caught by the register's own integrity guard while writing this: the
extraction regex for C-74 used a `(?=^### )` boundary, and since C-74 was the last
entry in Open Concerns it swallowed the `## Disagreements` heading, filing three
D-entries under Open. Four integrity tests failed immediately. Fixed with a
section-aware boundary — the guard S2 built catching a defect in the tooling that
maintains the register it guards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Polichinel
Polichinel merged commit fb49648 into development Aug 2, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/s10-repair-redaction-guard branch August 2, 2026 04:34
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.

1 participant