LearnNewsExamplesConnect
Frontmatter
assigneesToufiqul-27
createdAtNov 13, 2026, 9:45 PM
updatedAtNov 15, 2026, 10:29 PM
githubUrlhttps://github.com/neomjs/neo/issues/20904
authorneo-opus-ada
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtNov 15, 2026, 10:29 PM

CI runs a pull request's changed specs without its source changes

Closed v14.0.0/archive-v14-0-0-chunk-2 enhancementhelp wantedgood first issuecontributor-experienceaitestingbuild
neo-opus-ada
neo-opus-ada commented on Nov 13, 2026, 9:45 PM

Context

A reviewer of an Engine pull request runs one falsifier by hand: does the changed spec fail without the change? An arm that also passes on dev proves nothing about the fix.

From 2026-09-15 to 2026-11-13, 73 outside pull requests closed curated neo issues, and 19 of them drew a change request. At least 7 of those 19 asked for a stronger proof: an arm that would also pass on dev, an AC without a test, the wrong tier, or a timing-dependent arm. Six of the seven were on tickets that already named a check. The change-request rate barely depends on the ticket either: 25 % on the 55 tickets that name a check, 28 % on the 18 that do not. A ticket-side rule would codify current practice and move no number, so the lever is on the pull request side.

The counts are floors: a check is recognised by a spec path or a test command, and a closing reference misses a pull request without a keyword. How many of the seven were the "passes on dev" kind is not broken out; #21049 (formerly AC-8) measures that kind directly. The same read produced #20892.

The Problem

The falsifier runs after the contributor asks for review. The reviewer reverts the change's source, runs the spec, and posts a change request; the contributor's second round follows. Nothing on the pull request shows the contributor beforehand that a new arm passes without the change, and nothing spares the reviewer the run.

The Architectural Reality

  • .github/workflows/test.yml, job unit: runs the unit family at the merge commit only. test/playwright/playwright.config.unit.mjs writes its JSON report to test/playwright/test-results/unit/test-results.json.
  • .github/workflows/classify-test-scope.yml reads the pull request's base only to list changed paths and set run_unit. No neo workflow runs a spec against the base's source; pr-review.yml judges reviews, not tests.
  • Brain's precedent: neomjs/neo-agent-brain .github/workflows/brain-unit.yml runs the whole unit config on the merge commit and on its first parent, which is exactly the base the merge was computed against. test/playwright/compareUnitFailures.mjs there keys tests by project, file and title path, never by line. That design runs the base's own copy of each spec, so it separates pre-existing reds, but an arm a pull request adds never meets the base's source.
  • npm run bundle-browser-deps bundles third-party packages only (parse5, marked, mermaid, monaco, highlight.js), so restoring the change's source after bundling leaves the bundles valid.
  • A pull_request run executes a fork's code with a read-only token and no secrets, after a maintainer approves a first-time contributor's run.
  • Placement: test/playwright/ holds the runner's helper modules (resolveFreePort.mjs, findBridgeScriptRoot.mjs), and test/playwright/unit/test/ holds their specs.

The Fix

A red-on-base job in test.yml, on pull_request only:

  1. It runs when the change touches at least one test/playwright/unit/**/*.spec.mjs and at least one path outside test/. Otherwise it ends at once and names the reason in its summary.
  2. It checks out the merge commit, installs and bundles as unit does, and runs the changed spec files: the head run.
  3. It restores every path the change touched outside test/ to the merge commit's first parent. Modified and deleted files come back, and added files are removed. The head's test/ tree and installed dependencies stay. Then it runs the same spec files again: the base run.
  4. A pure module, test/playwright/compareRedOnBase.mjs, reads both JSON reports, keys each test by project, file and title path, and sorts it into one of three classes: fails without the change, passes both ways, or cannot load without the change.
  5. A test is new when its title path is absent from the base's copy of the file; every test of a spec file the change adds is new. One way to list the base copy is git show into the spec's directory and playwright test --list during the base run, when the source matches it.
  6. Each new test that passes both ways gets a ::warning file=<spec>,line=<line>:: annotation at its own line. The job summary lists every new test with both results, and counts the file's other tests per class.
  7. The job concludes green unless it cannot produce both reports. It is not a required check.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
test.yml job red-on-base (new) this ticket an annotation on each new test that passes both ways; a summary of all classes no unit spec or no non-test path changed → skipped with its reason; a missing or unreadable report → the job fails the job's comment in test.yml AC-7's demonstration run
test/playwright/compareRedOnBase.mjs (new) this ticket pure: two reports in, three classes out none JSDoc @summary test/playwright/unit/test/compareRedOnBase.spec.mjs (AC-6)

Decision Record impact: none.

Acceptance Criteria

  • AC-1: On a pull request that changes a unit spec and a path outside test/, the job runs the changed spec files at the merge commit, then again with every non-test change restored to the base.
  • AC-2: Each new test that passes both ways carries a warning annotation at its own line, and the summary lists every new test with both results.
  • AC-3: A spec that cannot load without the change is reported as its own class, never as a red that proves the change.
  • AC-4: Flagged tests leave the job green. It fails only when a report is missing or unreadable.
  • AC-5: The job runs under pull_request with contents: read, reads no secret, and is skipped with its reason when no unit spec or no non-test path changed.
  • AC-6: compareRedOnBase.mjs has a unit spec. Tests are keyed by title path, never by line; a load error is its own class; a renamed test reads as new.
  • AC-7: The pull request body links one CI run on a demonstration change in which one new arm fails without the change, and another passes both ways and carries the annotation.
  • AC-8 (post-merge): 30 days after merge, re-count the change requests on outside pull requests that ask for an arm that fails without the change, against the window above. Falsifier: that kind does not fall. Moved to #21049 on 2026-11-15, so that this ticket can close with its pull request.

Out of Scope

  • The unit-tz, components and e2e tiers: they need browsers or extra processes. A follow-up if the unit job proves out.
  • Brain and Skills: four outside merges each in the 30 days to 2026-11-13, against 49 in neo.
  • A required check or a red X: a spec that pins existing behaviour, such as a refactor's guard or a testing ticket's arm, passes on base by design.
  • A ticket-side rule that a curated ticket must name a check: the rates above do not separate.
  • Marking modified arms: an arm whose body changed under the same title is not marked new.

Avoided Traps

  • pull_request_target, for a write token to post a comment. It runs a fork's code with the base's privileges. Annotations and the step summary need no write token.
  • Checking out the base and copying the head's test/ onto it. A dev dependency the change adds would then fail every changed spec at load. Installing at the merge commit and restoring only the change's non-test paths keeps the head's dependencies.
  • Running the base's own copy of each spec, as brain-unit.yml does. That separates pre-existing reds, but never runs a new arm against the old source.

Related

  • #20892: the contributor epic from the same read.
  • #21049: the 30-day recount, split from AC-8.
  • neomjs/neo-agent-brain brain-unit.yml and test/playwright/compareUnitFailures.mjs: the base and head precedent.

Live latest-open + closed sweep: latest 20 open (created-desc) and closed searches ("red on dev", "fails on dev", "spec base red-first check", "changed spec base workflow"; no same-surface hit to read) at 2026-11-13T20:39Z, latest 5 re-checked at 20:44Z; no equivalent or prior exclusion found. Backlog band: 43 open (orange); no owning epic, since #20892's outcome is a contributor's standing, not review rounds. A2A in-flight sweep (last 30, all read-states): no claim on this scope. Memory Core rationale sweep: no prior proposal of a red-on-base check. Own neo assignments: none. Brain and Skills searched: none.

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Origin Session ID: d1e33fc0-1efd-4fb1-bfa5-11e755b5cc59

Retrieval Hint: "changed spec passes on dev without the change; outside pull request proof change requests"

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code

tobiu referenced in commit 8bc2f5e - "feat(test): add advisory red-on-base comparison (#20904) (#21027) on Nov 15, 2026, 10:29 PM
tobiu closed this issue on Nov 15, 2026, 10:29 PM