test(#397): enumerate the exact-sizing seam - #404
Conversation
Second seam, after call_lowering. `can_size_exactly` is the guard that decides whether a type's size may reach a `memory.copy` length — the gate #393 turned on. Its structure makes it quietly fragile: _ => true A container variant that forgets to recurse falls into that arm and reports its contents as exactly sizeable. The resolver then records a size built from the 4-byte fallback, and the copy runs short. That is #393 exactly, one level down, with nothing failing. Four tests: - an unresolvable type must poison EVERY container that can hold one, checked per variant so a failure names which one; - the mirror — a resolvable type must stay sizeable in every container, without which a `can_size_exactly` that simply returned false would satisfy the first test while disabling sizing entirely; - nesting must not launder it (three levels deep, not one); - leaves stay sizeable by construction. Plus a compile-time tripwire: `variant_name` matches every `ComponentValType` variant with NO wildcard, so adding one breaks this test and forces a decision about whether the sizing seam must recurse into it. The `_ => true` arm means silence is the default otherwise. Control, checked for reachability BEFORE running it this time: removing the `Option` arm so it falls through to `_ => true` fails two of the four tests and names the variant — #397/#393: Option does not propagate un-sizeability while the mirror test stays green, showing it is not a blanket-false. 887 tests (--workspace), exit 0. Refs: #397, #393 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WrmMqf1iuTS1UBEes5TmdC
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
LS-N verification gate✅ 59/59 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
Mythos delta-pass (auto)✅ NO FINDINGS across 1 Tier-5 file(s)
Auto-run via |
Second seam, after
call_loweringin #403.Why this one
can_size_exactlydecides whether a type's size may reach amemory.copylength — the gate #393 turned on. Its structure is quietly fragile:_ => trueA container variant that forgets to recurse falls into that arm and reports its contents as exactly sizeable. The resolver records a size built from the 4-byte fallback, and the copy runs short. That is #393 exactly, one level down, with nothing failing.
It is also the shape auto-Mythos flagged in my own #393 fix — a type escaping the check that was supposed to catch it.
Four tests plus a tripwire
can_size_exactlythat simply returnedfalsewould satisfy the first test while disabling sizing entirely;The tripwire:
variant_namematches everyComponentValTypevariant with no wildcard, so adding a variant breaks this test and forces a decision about whether the sizing seam must recurse into it. Given_ => true, silence is otherwise the default.Control
Checked for reachability before running it this time. Removing the
Optionarm so it falls through to_ => true:Naming the variant matters: the failure tells you which arm to fix, not just that something is wrong.
fmt clean, clippy
-D warningsclean, 887 tests, exit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01WrmMqf1iuTS1UBEes5TmdC