Files
ersatztv/scripts
timothyandClaude Opus 5 7291a50740 fix(820): remove the wrapper scanner — five defects from one mechanism
Two independent cold reviews (Codex cross-family, and a fresh Claude reviewer on
the head) both returned BLOCKED, and between them demonstrated three more ways
past the wrapper machinery. Counting the whole branch, that mechanism produced:

  1. the obligation attached to the wrong population (schemas, not wrappers)
  2. reachability mistaken for protection — `Complete<T>` is shallow
  3. body discovery keyed on a parameter NAME (`payload` made a wrapper vanish)
  4. bodies built as typed LOCALS invisible to the same lookup
  5. `export function` -> `export const` removing real protection while the AST
     scan AND its "independent" regex cross-check went blind TOGETHER, because
     both keyed on the token `export function`

Five defects from one mechanism, each found only by review, and #5 falsifies the
claim I had written that "the two fail in unrelated ways". This repo's answer to
that shape is not a sixth patch — `process.enumerate-workaround-behaviors-before-deleting`
and the withdrawn `test_review_verdict_vocabulary_parity.py` (six rounds, then
deleted) both say to remove the mechanism. The head reviewer independently
recommended narrowing rather than withdrawing, and named the parts worth keeping.

REMOVED: `scanWriteWrappers`, `bodyIdentifierOf`, `localDeclarationType`,
`methodOf`, `scanSchemaReferences`, the wrapper assertions, the wrapper floor and
the AST-versus-regex cross-check. About 250 lines.

KEPT, and each earns its place: every `Complete<X>` must resolve to a GENERATED
schema rather than a hand-written mirror — this is what found the real
`playouts.ts` shadowing defect; droppable schemas set-equal to the reviewed
dispositions, so a new optional member fails until ruled on; MUST-NOT-ANNOTATE as
an asserted absence, which makes §4b executable; a PRODUCTION annotation required
per droppable schema, so a test fixture cannot discharge it.

ADDED, closing the second reviewer's other blocker: the disposition VALUE was an
unchecked kill switch — flipping `MultiCollectionItemRequest` from ANNOTATED to
CREATE and deleting the annotation left every suite green with #807's silent
weight reset live again. `scripts/tests/test_complete_annotation_dispositions.py`
now cross-checks the SPA table against `test_optional_request_members.py`, the
authoritative source that already existed and was not being consulted. It ships a
DECLARED clause mutation in `mutation_manifest.py`, executed by the harness every
run — a real MUTATION grade, not a hand-run claim.

Also closed: a scope edit dropping 65 of 257 files passed every floor and pin.
There is now a ratio check whose denominator is computed by a DIFFERENT expression
than the scope predicate, so the two can actually disagree — a shared helper would
cancel, which is the #819 finding. Witnessed: that exact bypass reddens twice over.

DOCS REWRITTEN, because both reviewers found them asserting coverage the code did
not have. §4b, the inventory row and the decision record now lead with what is NOT
checked: the obligation is per-SCHEMA, not per-site and not per-wrapper, so moving
an annotation off an API wrapper stays green; it is token PRESENCE, so a dead
`export type X = Complete<Y>` discharges it; and the phantom direction is not
checked at all. The wrapper rule's removal is recorded there too, so the cheap
version of that idea is not rebuilt without reading why it failed.

Verified: web 1309 tests green, scripts/tests 1240 green (2 skipped), typecheck +
eslint + ruff clean, decisions-validate OK, guard-inventory counts machine-checked.

Decisions-Edit: yes
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UYNbVwgVszv6Pum7ZuGd75
2026-08-29 22:34:31 +02:00
..
2024-01-15 10:29:07 -06:00
2024-01-16 13:28:46 -06:00