You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(scripts): give the objectui changeset digest #6923's leading-blank-line preamble (#7044) (#7162)
`objectui-changeset-digest.mjs` is the fourth carrier of this repo's changeset
frontmatter parser. #7004 aligned its entry regex with the three gates; it never
got #6923's other half, so it still required the opening fence on line 1. A
changeset opening with a single blank line therefore declared nothing here,
which makes it read `release-nothing` and drops the commit out of the release
digest entirely -- #4731's harm, reached through the parser.
Measured with @changesets/parse@0.4.3 (the version this repo resolves): every
leading-blank-line form below is a real `major` to changesets, and was `{}` to
this file.
Second half, and the one that stops the recurrence: #7004's family-agreement
assertion in `check-empty-changeset.mjs`'s self-test now covers the fence
preamble as well as the entry regex. Per file it asserts the opening fence is
tested at the cursor the blank-line skip advanced (never at a literal
`lines[0]`), and that the statement immediately above that test is the family's
byte-identical skip. Extraction is by position, not by content, so the
agreement is a real comparison; a shared-but-stale statement is rejected by
name.
Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
Co-authored-by: Claude <noreply@anthropic.com>
// Anti-vacuous-green (#6983), same discipline as the entry regex above:
1385
+
// an extraction that finds nothing must fail here rather than hand the
1386
+
// two assertions below an empty set to agree about.
1387
+
assert(
1388
+
fenceAt>0,
1389
+
`family: an opening-fence test must be extractable from ${rel} — found none, so the extraction went stale and the preamble agreement below would judge nothing`,
`family: ${rel} must test the opening fence at the cursor the blank-line skip advanced, never at a literal line index — \`lines[0]\` IS #7044: the changeset opens with one blank line, the fence is on line 2, and the entire block reads as absent (found: ${JSON.stringify(srcLines[fenceAt].trim())})`,
1395
+
);
1396
+
// The statement immediately above it, extracted by POSITION rather than
1397
+
// by content — so the agreement asserted next is a real comparison and
`family: all four parsers must carry a byte-identical leading-blank-line preamble immediately before their fence test — found ${distinctPreambles.size} distinct spellings: ${JSON.stringify([...preambles])}`,
1410
+
);
1411
+
// And the shared statement must be the SKIP, so this cannot go green on
1412
+
// four identical copies of something else sitting in that position.
1413
+
assert(
1414
+
[...distinctPreambles][0]==="while (i < lines.length && lines[i].trim() === '') i++; // tolerate leading blank lines",
1415
+
`family: the shared statement before the fence test must be the leading-blank-line skip itself (#6923) — found ${JSON.stringify([...distinctPreambles][0])}`,
1416
+
);
1342
1417
}
1343
1418
1344
1419
// ── Missing input is a failure, never a pass (#4690) ─────────────────────
check('#7044 D1 one leading blank line before the fence',parsedPkgs('\n'+CS_MAJOR)==='{"@object-ui/layout":"major"}',parsedPkgs('\n'+CS_MAJOR));
2030
+
check('#7044 D2 two leading blank lines',parsedPkgs('\n\n'+CS_MAJOR)==='{"@object-ui/layout":"major"}',parsedPkgs('\n\n'+CS_MAJOR));
2031
+
check('#7044 D3 a leading WHITESPACE-ONLY line (the preamble trims, it does not test for empty)',parsedPkgs(' \n'+CS_MAJOR)==='{"@object-ui/layout":"major"}',parsedPkgs(' \n'+CS_MAJOR));
2032
+
check(
2033
+
'#7044 D4 a leading blank line with CRLF endings — the two dialect rows compose',
2034
+
parsedPkgs('\r\n---\r\n"@object-ui/layout": major # keep\r\n---\r\n\r\nbody\r\n')==='{"@object-ui/layout":"major"}',
2035
+
parsedPkgs('\r\n---\r\n"@object-ui/layout": major # keep\r\n---\r\n\r\nbody\r\n'),
2036
+
);
2037
+
check(
2038
+
'#7044 D5 the SUMMARY is the body, not the frontmatter — the old anchor handed back the raw fence text',
'#7044 D7 control — skipping blanks did NOT make the parser fence-less: a leading blank line over an UNFENCED file still declares nothing, and its body survives whole',
0 commit comments