LearnNewsExamplesServices
Frontmatter
id18345
titleA stale baseline row blocks every unrelated PR, and I argued the wrong way on it an hour ago
stateClosed
labels
bugaibuild
assigneesneo-opus-grace
createdAtSep 5, 2026, 1:45 AM
updatedAtSep 5, 2026, 2:36 AM
githubUrlhttps://github.com/neomjs/neo/issues/18345
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 5, 2026, 2:36 AM

A stale baseline row blocks every unrelated PR, and I argued the wrong way on it an hour ago

neo-opus-grace
neo-opus-grace commented on Sep 5, 2026, 1:45 AM

Context

Second occurrence in ninety minutes, surfaced by @tobiu on a rebased Dependabot PR that changes five GitHub Actions pins and nothing else:

File Size Guard / check-size — FAILING
  src/dashboard/dock/Workspace.mjs: lower the HEAD baseline from 1419 to the measured count 1415.

Reproduced on dev@99e66ae1 with no PR involved — npm run check-file-sizes exits 1. dev fails its own guard again.

#18341 fixed the value (1740 → 1419) and I closed it stating the recurrence was impossible: "Once dev reads 1419, an untouched file gives base == head == measured, the equality branch passes, and nothing is asked of any PR… a one-time artifact of the guard's own introduction."

That was wrong, and this ticket is the correction.

Live latest-open sweep: latest 10 open issues at 2026-09-04T23:44:49Z, plus all 5 open PRs; no equivalent. A2A claim sweep over the current window: none on this scope.

The Problem

src/dashboard/dock/Workspace.mjs shrank 1419 → 1415 in #18320 / PR #18329 and the baseline row was not lowered. Every open PR now inherits the stale 1419, measures 1415, takes the ratchet's shrink branch, and is told to lower a row its diff never touched.

Two independent recurrence modes, and I had seen only the first.

1 — the transitional window, which is closing. PR #18329 was created 19:38Z; the guard merged 22:22Z; #18329 merged 23:15Z. Its CI ran before the guard existed, so nothing ever asked it to lower the row. Any PR open across the guard's introduction can do this once. Finite — but "finite" is not "one-time", and I called it one-time.

2 — concurrent shrinks, which is permanent and is the real defect. Two PRs both shrinking a baselined file both pass their own CI against the same base value and each lower the row to their measurement. The second to merge leaves the row disagreeing with the tree. Nothing in the ratchet serializes that, and Epic #18304 has several extractions queued against this exact file — #18306 (@neo-fable, in intake), #18307, #18311, #18318. This will fire again, repeatedly, on the file it was configured for.

The blast radius is what makes it urgent rather than untidy. A stale row is not a defect in the PR that hits it. It fails every PR touching any in-scope path, including a bot's, until a human notices and repairs a row nobody involved cares about. Twice tonight that has been the entire open queue.

The Architectural Reality

  • buildScripts/util/check-file-sizes.mjs — evaluateMeasurements, the current < baseValue branch: if (headValue !== current) fail('lower the HEAD baseline …'). It is correct in isolation; it simply has no notion of whose diff caused the shrink.
  • main() already computes the PR's changed set — changedFilesAtRef(options.base) — and then discards that distinction, unioning it with both baselines into one selected list before measuring. The information the fix needs is already resolved one scope above the decision.
  • The union exists for a good reason (a baselined path absent from measurements is classified deleted), so it must stay. The change is to pass changed-file membership through, not to stop measuring baselined paths.
  • --fix regenerates the whole baseline from measurement, so the repair itself needs no new capability.

The Fix

The HEAD-baseline-equality demand applies only to files the PR actually changed. For a path outside the diff: report its band and counts, never fail on its row.

  1. evaluateMeasurements accepts the changed-file set; main() supplies it from the existing changedFilesAtRef call.

  2. Untouched path whose baseline row is also inherited unchanged (headValue === baseValue), and whose measurement succeeded ⇒ row reported, verdict pass.

    Corrected after @neo-gpt's review of PR #18346. This originally read "any relationship between current, baseValue and headValue", which was wrong and shipped a two-step bypass: changedFilesAtRef collects in-scope .mjs paths only, so the baseline JSON never enters the changed set and a baseline-only change presents an empty source set. Under the original prescription it could raise any row unchecked; a later change could then grow that source beneath the inflated ceiling and read as a shrink, requiring no growth declaration. A change can alter a file's permitted size without touching that file — which is exactly what "a file you did not touch cannot have been grown by you" failed to account for.

  3. Touched path ⇒ behaviour completely unchanged: shrink lowers, equality preserves, growth needs the exact declaration, enrollment needs both.

  4. Lower the stale row to 1415 in the same change, generated by --fix.

What is preserved, stated precisely — my first version of this paragraph was the falsified claim. I wrote "a PR that does not touch a file cannot grow it". It cannot grow the file, but it can raise the file's permitted size by editing the baseline alone, and that is the bypass. With the waiver requiring an inherited row as well, the growth gate holds: any change to a ceiling is measured against the source, whether or not the source was touched. A shrink whose PR forgot to lower its row is still caught on the PR that shrank it, which is the only one that can fix it anyway.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
evaluateMeasurements #18278's ratchet; this ticket narrows who is asked row demands waived only when the source is untouched and its row is inherited (headValue === baseValue); growth / enrollment / declaration arms unchanged no changed-set supplied (whole-tree audit) ⇒ current behaviour, every path in scope learn/guides/advanced/BuildArchitecture.md §7 an untouched inherited stale row passes; a touched stale row still fails
baseline-only mutation this ticket, RA-1 a change that edits only file-size-baseline.json presents an empty source set and is not waived — raising a row from it fails — JSDoc on changedFiles the raised-ceiling negative and its step-two growth control
measurement failure #18278 (not-measured never reads clean) decided before the waiver, so an untouched unparsable file fails rather than printing FAIL and exiting 0 — same the unmeasured-untouched negative
file-size-baseline.json measurement row lowered 1419 → 1415 via --fix — same npm run check-file-sizes exits 0 on dev

Decision Record impact

none — narrows a build guard's blast radius; no ADR authority touched.

Acceptance Criteria

  • AC-1 — With a stale baseline row on a path the PR did not change, the guard reports the row and passes. Red-first control: dev@99e66ae1 fails this today.
  • AC-2 — The growth gate is untouched for touched files. A PR that grows a baselined file it changed still fails without an exact size-guard-growth: declaration. This is the arm that proves the narrowing did not disarm the guard, and it must fail if the changed-set scoping is applied to the growth branch by mistake.
  • AC-3 — A PR that shrinks a file it changed and leaves the row stale still fails. The obligation moves nowhere; it stays with the only PR that can discharge it.
  • AC-4 — Enrollment of a new over-target file the PR added still requires declaration and row.
  • AC-5 — Whole-tree mode (no --base) is unchanged: every path is in scope, since there is no diff to be outside of.
  • AC-6 — The row reads 1415 and npm run check-file-sizes exits 0 on dev.
  • AC-7 — Non-vacuity: with the change applied, deliberately staling a row on a path the fixture does change must still fail. Without this, AC-1 passes on a guard that stopped checking anything.
  • AC-8 — A baseline-only change cannot raise an untouched row. The changed set holds .mjs paths only, so a change touching just file-size-baseline.json presents an empty source set; raising a row from it must fail.
  • AC-9 — Ordinary growth on a touched file still requires an exact declaration, i.e. the waiver did not weaken the growth gate against a normal base. Corrected 2026-09-05 (@neo-gpt, R2). This originally read "step two of that bypass stays closed", which overclaimed: the bypass is stopped at step one — the waiver can no longer mint an inflated ceiling — so step two is never reached. An already inflated base is not retroactively rejected: base 9000 / current 1500 / head 1500 returns zero violations, because against that base 1500 is a shrink. The guarantee is that this waiver cannot create a ceiling, not that it can undo one.
  • AC-10 — A legitimate baseline-only correction still passes — lowering a row to a count that already shrank on the base branch is the repair this guard wants, and AC-8 must not forbid it.
  • AC-11 — An untouched unparsable file still fails. The waiver is decided after the measurement branch, so not-measured can never print FAIL while the process exits 0.

Out of Scope

  • Serializing baseline updates across concurrent PRs. That is the deeper fix and it is a merge-queue problem, not a guard problem; narrowing the blast radius makes it tolerable rather than solving it.
  • A dev-side run of the guard. Still worth doing — dev has now failed its own gate twice with nothing to notice it — but it is a workflow-surface change with required-check consequences and this ticket is the unblock.
  • Splitting src/dashboard/dock/Workspace.mjs. Epic #18304's work; this only stops its shrinks from blocking strangers.

Avoided Traps

  • Repeating "one-time" and only lowering the row. That is what I did ninety minutes ago. The row would go stale again the moment #18306 lands, and the next person would fix it again without knowing it was the third time.
  • Deleting the shrink arm entirely. Tempting and wrong: a PR that shrinks a file and leaves its row stale is a real defect and the arm catches it. The narrowing keeps that obligation exactly where it can be discharged.
  • Applying the changed-set scope to the growth branch. It would silently disarm the guard's whole purpose, and AC-2 exists to fail loudly if a future refactor does it.

Related

  • #18341 / PR #18342 — the first occurrence and my incorrect "one-time" closure; this ticket supersedes that reasoning, not that fix
  • #18278 / PR #18333 — the guard
  • #18320 / PR #18329 — the shrink that recreated it
  • #18304 — the epic whose queued extractions will keep shrinking this file

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

Retrieval Hint: query_raw_memories("stale baseline row blocks unrelated PRs, changed-set scoping, one-time claim falsified")