Skip to content

Commit 306f202

Browse files
committed
test(pm): pin the frames the unreadable-guard protects
Ablation leg B4 — dropping the `!unreadable` guard on the leading-comment reset — came back GREEN, so the guard was pinned by nothing. Recorded rather than quietly re-run: every suppressing reader has already refused on the flag by then, so the guard's only observable effect is on `enclosingDelimiter`, which ignores the flag and would lose a frame the hunk really showed. This case reads that, and the re-spelled leg now fails 1 of 577. Claude-Session: https://claude.ai/code/session_01AmH9bKvGoLjiY86Q4Z3og2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent e669c1b commit 306f202

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎scripts/pm/check-widening-tells.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
14771477
'#18640 — an inline closed set RE-SPELLED at the same binding is not a set that gained a value': 20,
14781478
'#18702 — a declaring factory PRIVATE to one file, resolved through its own DEFINITION': 54,
14791479
"#18721 — a hunk's LEADING CONTEXT is not a reason to abandon the parameter reading": 14,
1480-
'#19099 — a member BOUNDED inside a bag the block re-declared out of a universal acceptor': 66,
1480+
'#19099 — a member BOUNDED inside a bag the block re-declared out of a universal acceptor': 67,
14811481
});
14821482

14831483
// DELETING an entry silences that battery's floor exactly as effectively as
@@ -5792,6 +5792,7 @@ export function selfTest() {
57925792
t('⭐ `enclosingDelimiters` reads a `*/` outside a block comment as "the hunk began inside one", and DISCARDS the frames the comment text pushed', enclosingDelimiters([CTX(' * see makeThing({ a, b'), CTX(' */'), CTX(' next: z.string(),')], 2).unreadable === false && enclosingDelimiters([CTX(' * see makeThing({ a, b'), CTX(' */'), CTX(' next: z.string(),')], 2).frames.length === 0);
57935793
t('⛔ …and it applies ONCE and only before anything made the walk unreadable: a second `*/`, or one after a regex, raises the flag instead', enclosingDelimiters([CTX(' */'), CTX(' */'), CTX(' next: z.string(),')], 2).unreadable === true && enclosingDelimiters([CTX(' slug: z.string().regex(/^[a-z{]+$/),'), CTX(' */'), CTX(' next: z.string(),')], 2).unreadable === true);
57945794
t('⛔ …and a `*/` that CLOSES a comment this walk opened itself is ordinary, flagging nothing', enclosingDelimiters([CTX(' /* note ({ */ name: z.string(),'), CTX(' next: z.string(),')], 1).unreadable === false);
5795+
t('⛔ …and once the walk is UNREADABLE the reset is REFUSED, which is the frames that guard protects: every suppressing reader has already refused on the flag, but `enclosingDelimiter` ignores it and would otherwise lose a frame the hunk really showed', enclosingDelimiter([CTX(' wrap: z.object({'), CTX(' slug: z.string().regex(/^x/),'), CTX(' */'), CTX(' next: z.string(),')], 3)?.opener === '{' && enclosingDelimiters([CTX(' wrap: z.object({'), CTX(' slug: z.string().regex(/^x/),'), CTX(' */'), CTX(' next: z.string(),')], 3).frames.length === 2);
57955796
t('⭐ a lone `/` is a DIVISION and raises nothing; a `/` with another `/` left on its line may be a regex and raises the flag', enclosingDelimiters([CTX(' half: z.number().default(TOTAL / 2),'), CTX(' next: z.string(),')], 1).unreadable === false && enclosingDelimiters([CTX(' slug: z.string().regex(/^x/),'), CTX(' next: z.string(),')], 1).unreadable === true);
57965797

57975798
// -- T3 --------------------------------------------------------------------

0 commit comments

Comments
 (0)