Skip to content

objectui-changeset-digest's frontmatter parser never got #6923's leading-blank-line fix — a changeset opening with a blank line drops out of the release digest #7044

Description

@os-project-manager

Found while fixing #7004 (family-wide trailing-comment gap). Not fixed there#7004's face is the entry regex's anchoring; this is a different row of the same dialect table (where the fence is allowed to start), so it is filed rather than folded in. Unclaimed, unassigned.

The observation

scripts/objectui-changeset-digest.mjs's parseChangeset is the fourth carrier of this repo's changeset-frontmatter parser. #7004 aligned its entry regex with the three gates. What it did not get, and still has not, is #6923's fix: it requires the opening fence on line 1.

// scripts/objectui-changeset-digest.mjs
if (lines[0]?.trim() === '---') {

The three gates all skip leading blank lines first:

while (i < lines.length && lines[i].trim() === '') i++; // tolerate leading blank lines
if (lines[i]?.trim() !== '---') ...

Measured on the #7004 branch, by extracting the shipped function and loading it standalone (no top-level main executed):

digest  (leading blank line): {}
digest  (control, no blank) : {"@object-ui/layout":"major"}

@changesets/parse@0.4.3 reads the leading-blank-line form as a real major — that is exactly what #6923 measured when it fixed the same defect in check-changeset-no-major.mjs.

Consequence — a silent DROP from the release record

This file is not a gate, so it neither reds nor greens. It builds the @objectstack/console changeset body for an objectui pin bump. An entry it cannot see makes the changeset read release-nothing, so the commit leaves the digest entirely.

That is #4731's harm reached by a third route. #4731's own body states the stake: breaking changes are "the single class that must never vanish from a release record", and a major-declaring changeset that opens with one blank line is precisely a breaking change that vanishes.

Why this survived three passes

Nothing mechanical connected this file to the other three. #6923 aligned three parsers and said so; #7004's report named three; this one was found only by grepping the regex literal across scripts/. #7004 adds a family-agreement assertion covering all four (in check-empty-changeset.mjs's self-test) — but it asserts the entry regex and the whole-line-comment guard, not the fence-scanning preamble, so this specific divergence is still uncovered.

Suggested fix

Give it the same preamble the three gates carry, and extend #7004's family assertion to cover the leading-blank-line skip as well, so the fourth carrier cannot drift again on this row either.

Impact, stated honestly

  • No known instance. No changeset in objectui's stock is known to open with a blank line; this was not measured across objectui's history, only in the parser.
  • The digest runs on demand at a pin bump, not in CI, so the blast radius is one release record rather than a gate verdict.
  • Reachable by an ordinary authoring act (an editor or a template leaving a leading newline).

Related: #6923 (the same fix, in the first carrier), #7004 (the entry-regex half, all four carriers), #4731 (why a dropped commit matters), #6099.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions