LearnNewsExamplesServices
Frontmatter
id18341
titledev fails its own size guard, so every open PR is asked to fix a baseline it never touched
stateClosed
labels
bugaibuild
assigneesneo-opus-grace
createdAtSep 5, 2026, 12:47 AM
updatedAtSep 5, 2026, 12:58 AM
githubUrlhttps://github.com/neomjs/neo/issues/18341
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 5, 2026, 12:58 AM

dev fails its own size guard, so every open PR is asked to fix a baseline it never touched

neo-opus-grace
neo-opus-grace commented on Sep 5, 2026, 12:47 AM

Context

Surfaced by @tobiu at 2026-09-04 ~22:45Z on the rebased Dependabot PR #18325, whose File Size Guard job reads:

FAIL over-target  1419 code |  1785 doc (49.2%)  src/dashboard/dock/Workspace.mjs

check-file-sizes: 1 violation(s).
  src/dashboard/dock/Workspace.mjs: lower the HEAD baseline from 1740 to the measured count 1419.

His read, and it is the right one: "that makes no sense for dependabot." A bot bumping npm versions cannot lower a code-line baseline, and it has no business being asked to.

Reproduced on dev@b7c9f7c953 itself, with no PR involved:

$ npm run check-file-sizes
FAIL over-target  1419 code |  1785 doc (49.2%)  src/dashboard/dock/Workspace.mjs
check-file-sizes: 1 violation(s).
  src/dashboard/dock/Workspace.mjs: HEAD baseline must equal the measured count 1419.

dev fails its own guard. Live latest-open sweep: checked the latest 20 open issues at 2026-09-04T22:47:04Z; the only file-size ticket is #18278, closed. A2A claim sweep over the current mailbox window: no claim on this scope. Own-assignment sweep: none on the build surface.

The Problem

Merge order, and nothing else.

commit time what it did
0cc5cad95e (#18305 / PR #18324) 22:15Z maximize became a plugin — src/dashboard/dock/Workspace.mjs 1740 → 1419 code lines
33d12ba837 (#18278 / PR #18333) 22:22Z the size guard merged, carrying file-size-baseline.json with 1740

The guard's baseline was measured before the shrink landed and merged after it, so dev shipped a baseline that disagrees with dev's own tree by 321 lines.

Every PR then inherits the stale 1740 as both its base and HEAD baseline, measures 1419, and takes the shrink branch of the ratchet — which correctly requires the HEAD entry to be lowered in the same change. The requirement is right; the PR being asked is arbitrary. Dependabot cannot satisfy it, and neither should anyone else whose diff never touched that file.

The ratchet is not the defect, and this ticket must not be read as a case against it. Once dev reads 1419, an untouched file gives base == head == measured, the equality branch passes, and nothing is asked of any PR. Going forward the invariant is self-maintaining: a PR that shrinks a baselined file is required to lower the row in the same commit, so dev cannot drift again through the normal path. What happened here is a one-time artifact of the guard's own introduction racing a shrink that predated it.

This is my miss. I approved #18333 at 22:17Z — two minutes after #18324 had already merged. I verified the baseline file's contents and the four counts as the author reported them, and never re-measured them against the tree they would land on. A baseline is a witness minted at authoring time; between authoring and merge, the thing it witnesses can move.

The Architectural Reality

  • buildScripts/util/check-file-sizes.mjs — evaluateMeasurements, the current < baseValue branch: if (headValue !== current) fail('lower the HEAD baseline …'). Correct as written; it is answering a question about a tree whose baseline row is stale.
  • buildScripts/util/file-size-baseline.json — src/dashboard/dock/Workspace.mjs: 1740, against a measured 1419 at dev@b7c9f7c953. The other three rows are current: Workstation 3390, DemoB 2701, DragDrop 1267.
  • .github/workflows/file-size-guard.yml runs only on pull_request, so dev never audits itself and the inconsistency is invisible until it fails somebody else's PR.
  • --fix already produces exactly the required edit (reconcileBaseline writes measured over-target counts), so no new capability is needed.

The Fix

Lower src/dashboard/dock/Workspace.mjs to 1419 in buildScripts/util/file-size-baseline.json, generated with npm run check-file-sizes -- --fix rather than typed.

That is the whole change. It unblocks every open PR at once, because the stale row was the only violation.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
file-size-baseline.json #18278's ratchet — a shrink lowers the entry src/dashboard/dock/Workspace.mjs: 1740 → 1419; the other three rows unchanged none needed — --fix is idempotent and regenerates from measurement learn/guides/advanced/BuildArchitecture.md §7 already documents --fix npm run check-file-sizes exits 0 on dev after the change, and the four rows still report

Decision Record impact

none — a stale generated value, not a contract change.

Acceptance Criteria

  • AC-1 — npm run check-file-sizes on this branch reports 0 violations and still lists all four baselined files with their bands.
  • AC-2 — Red-first, and it needs no construction: dev@b7c9f7c953 fails the same command with exactly one violation naming src/dashboard/dock/Workspace.mjs. The pre-state is the falsifier; record it rather than building a fixture.
  • AC-3 — The baseline row equals the measured count 1419, and was produced by --fix, not hand-edited. The other three rows are byte-identical to their current values — a --fix run that silently re-writes an unrelated row would mean the tree moved under a second file, which is a different finding and must not ride along unnoticed.
  • AC-4 — The File Size Guard job passes on this PR, which is the first PR to exercise the guard against a consistent baseline.
  • AC-5 — Non-vacuity: confirm the guard still fails on genuine growth after the fix. Raising the row by hand to 1420 (measured 1419) must fail with the shrink message; restoring it must pass. A baseline correction that quietly disarmed the ratchet would satisfy AC-1 through AC-4.

Out of Scope

  • Changing the ratchet so untouched files are exempt. My first read, and it is wrong: with a consistent dev an untouched file hits the equality branch and passes, so the exemption would buy nothing and would remove the arm that catches a shrink whose PR forgot to lower the row.
  • A dev-side run of the guard. Tempting — dev failing its own gate for seven minutes with nothing to notice it is the real gap here — but it is a workflow-surface change with its own required-check consequences, and this ticket is the unblock. Worth its own ticket if it recurs.
  • Splitting src/dashboard/dock/Workspace.mjs. That is Epic #18304's work; this only records what #18324 already removed.

Avoided Traps

  • Reading this as "the ratchet is broken." The operator's framing was that the demand makes no sense for Dependabot, which is true of this PR and would have been true of any PR open at that moment. The mechanism is a stale row, not a bad rule, and fixing the rule would have been a redesign in response to a one-line defect.
  • Hand-editing the JSON. The file is generated; typing 1419 would produce the right bytes today and detach the file from its generator. --fix is the documented path.
  • Treating the guard's own CI as the falsifier. The guard runs only on pull_request, so a green dev says nothing about this. The reproduction has to be a local run against dev, which is what AC-2 records.

Related

  • #18278 / PR #18333 — the guard and its baseline
  • #18305 / PR #18324 — the shrink that landed seven minutes earlier
  • #18325, #18326 — the Dependabot PRs blocked by this, where it surfaced
  • #18304 — the epic that will keep shrinking this file, so the row will move again

Origin Session ID: b983b2a8-18bc-4dd0-a63f-23380dc3a49d

Retrieval Hint: query_raw_memories("file-size baseline stale 1740 1419 dock Workspace guard merged after the shrink")