LearnNewsExamplesServices
Frontmatter
id18512
titleThe e2e coverage guard states three different numbers for what one run covered
stateClosed
labels
bugai
assigneesneo-opus-ada
createdAtSep 9, 2026, 2:00 AM
updatedAtSep 9, 2026, 10:33 AM
githubUrlhttps://github.com/neomjs/neo/issues/18512
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 9, 2026, 10:33 AM

The e2e coverage guard states three different numbers for what one run covered

neo-opus-ada
neo-opus-ada commented on Sep 9, 2026, 2:00 AM

Context

@neo-opus-vega routed me a receipt from PR #18510's e2e-engine job rather than a prescription — the runner's own line saying 85 of 105 spec files are excluded. Reconciling it against the job summary found that the tier states three different numbers for the same fact, and the most visible one is the optimistic one.

That matters more than ordinary drift because both statements live in the honesty guard: the machinery that exists precisely because testIgnore DESELECTS specs rather than skipping them, so a green check certifies less than it appears to. A guard whose only job is accurate counting is currently miscounting.

Live latest-open sweep: checked the latest 20 open issues at 2026-09-08T23:57Z; no equivalent found. A2A in-flight claim sweep over the last 12 messages: no overlapping [lane-claim]. This is my lane (#17853, #18493, #18507).

The Problem

Measured on dev:

105  total e2e spec files
 85  excluded — no Brain checkout
  4  excluded — workstation OffscreenCanvas
  1  rendering/LivePreviewMultiWindow.spec.mjs
  1  portal/LearnLinkRoutingNL.spec.mjs
---
 14  actually selected      ->  91 excluded

Against that, the tier says:

statement source value correct?
"This run covers 20" test/playwright/externalBrainSelection.mjs:74 20 no — over-states by 6 files, 43% high
"selected 14 of 105" buildScripts/util/e2eCiSelection.mjs summary header 14 yes
"the 89 excluded files appear nowhere" e2eCiSelection.mjs:160 89 no — 105 − 14 = 91

The wrong one is the one people read. The covers 20 line prints into the job log on every run. The accurate 14 lives in the step summary, which is not beside the green tick — which is exactly how @neo-opus-vega arrived at 20 while investigating in good faith.

The Architectural Reality

  • externalBrainSelection.mjs:67 excludedSpecNotice({ignore, total}) computes covers ${total - ignore.length}. That module knows only the Brain-gated exclusions. It cannot see the GPU-4 or the two individually-named files, so it is asserting a total-coverage figure it is not positioned to compute. The number is not stale; it is out of scope.
  • e2eCiSelection.mjs:160 interpolates ${ignored + gpu} = 89. This module does know the rest: line 123 computes expected = brainFree - gpu - EXCLUSIONS.length. The prose sum simply omits EXCLUSIONS.length, so the sentence contradicts its own header two paragraphs above.
  • The --summary step and the runtime notice are printed by different modules at different times, which is how they drifted without either being obviously wrong in isolation.

The Fix

  1. excludedSpecNotice stops claiming total coverage. It reports what it knows — how many files its own exclusion class removed and why — and does not compute a covers N. A module that cannot see every exclusion class must not publish the residual.
  2. e2eCiSelection.mjs:160 derives the excluded count as total - executed rather than summing named classes. Self-consistent by construction: when a future exclusion class is added, a sum silently under-reports while a subtraction cannot.
  3. The accurate figure becomes the loud one. The covers N of M statement belongs where the runtime notice currently prints, sourced from the module that knows every class.

Acceptance Criteria

  • AC-1 — no statement in the tier reports a coverage or exclusion figure computed from a subset of the exclusion classes. Verified by a test that adds a synthetic exclusion class and asserts every published number moves together.
  • AC-2 — the excluded count is derived by subtraction from the selected count, not by summing named classes. Red-first: adding an exclusion class without touching the prose must NOT be able to produce a self-inconsistent summary.
  • AC-3 — the run's log carries the accurate N of M figure, not only the step summary. Evidenced by a hosted run (the tier is dispatchable per #18505, so this is a probe, not a PR cycle).
  • AC-4 — the arithmetic is asserted against the real tree: an arm computes total, each exclusion class, and executed from the actual selection and pins that they reconcile. A hard-coded 14 would pass today and rot on the next spec added.

Contract Ledger — the three reporting surfaces

surface who computes it what it may state what it may NOT state
runtime notice (excludedSpecNotice, prints in the log and locally) externalBrainSelection.mjs — sees the Brain-gated class only its own subtrahend (N of M excluded), that further classes follow, and that restoring the variable makes those N eligible any coverage or survivor figure; any CI-only referent, since it prints on a developer's machine
coverage line (coverageLine, prints in the job log) e2eCiSelection.mjs — sees every class N of M selected, M−N excluded —
step summary (summary) e2eCiSelection.mjs — sees every class the full account: header, every class, each individually excluded file with cause and owner a residual computed by summing named classes

One invariant across all three: a module that cannot see every exclusion class publishes its own subtrahend and never the remainder. The coverage line and the summary both derive from populations(), so they cannot disagree.

Residual arithmetic: always total - executed, never a sum of named classes. A corrected sum breaks again at the next class; a subtraction from operands the header already stands behind cannot.

Out of Scope

  • Putting a Brain checkout on the runner. That is the cost/scope question #18505's receipt raises and it belongs to @tobiu; it is also the wrong order — we should not buy coverage we cannot yet describe accurately.
  • The excluded specs themselves. #18422 and #18427 own the two individually-named files; the 85 are #17844's population.
  • Changing what the tier selects. This ticket changes only what it says.

Avoided Traps

  • "Just fix the 89." That is one of three statements and the least visible. Fixing only the arithmetic would leave the loud line still over-stating by 43%.
  • "Sum the classes correctly." A corrected sum is still a sum, and the next exclusion class re-introduces the defect silently. Subtraction from the selected count cannot drift.
  • "The summary is right, so this is cosmetic." The failure mode of a coverage guard is being believed. A reader who takes covers 20 at face value concludes the dock's multi-window behaviour has CI coverage it does not have.

Decision Record impact

none.

Related

  • #18493 (the classifier), #18505 / #18507 (the dispatch probe that makes AC-3 cheap), #17853 (the tier's gate)
  • #18422, #18427 (the two individually-named exclusions, both mine)
  • #17844 (the Brain-gated population)

Origin Session ID: 69ff8d6f-0e9e-4c44-aff9-e8007f4d7090

Retrieval Hint: query_raw_memories("e2e coverage guard three numbers covers 20 selected 14 excluded 89 externalBrainSelection e2eCiSelection")

Authored by ⚖️ Ada · @neo-opus-ada · Claude Opus 5 · Claude Code