Skip to content

ci: Node legs run file-reading tests by the inputs Main recorded for them - #12129

Closed
josephfarina wants to merge 15 commits into
mainfrom
ci/test-inputs
Closed

josephfarina wants to merge 15 commits into
mainfrom
ci/test-inputs

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

HOLD: CI changes are paused for now; this waits until CI work resumes.

Maintainer impact

Nearly every Node test reads files, so FR13's file-system rule runs almost the whole Node suite on every pull request: about 77 runner-minutes per run, the largest share of a run's cost under CI's job ceiling. The theme editor's 388 test files are more than half of it, and most changes touch none of their inputs.

Replaying the last 120 pull requests' changed files against a recording of the full Node suite:

File-reading Node test time left out per pull request 30% on average (median 10%)
Runner-minutes saved per pull-request run about 19 on average (median about 6)
Pull requests that skip at least 90% of the theme editor's tests 37%
Pull requests that still run every file-reading test (install, CI, test setup or build configuration changed) 13%
Test files whose record cannot see all they read (they always run) 124 of 1,585

Fallback. A pull request with no usable record runs exactly today's set: Main keeps no record, none is of a commit among the merge base's latest 100, the paths changed since the record cannot all be listed, the lookup fails, or the record is of another format version or another commit. One job picks the record and every leg reads that one choice, so legs always split the same list; a leg that cannot read the chosen record fails rather than run a different list.

Intended invariant

spec:AST-030 FR13 and the new DEC-31: a file-reading test still runs whenever the change can reach what it reads. Every required context and every owner keeps reporting as today.

Change

  • scripts/test-inputs/record.mjs, preloaded with --import in a recording run, records per test file what each Node process touches: files read, paths probed but missing, folders listed, paths written, and what it cannot see (a program that is not Node, a shell command, a child given an environment without the recorder, or a worker of a process the recorder was not preloaded into). Node children and worker threads record themselves under the same test file. The global setup records each of its parts as a step.
  • Main's full unit run records in each Node leg. When all legs pass, one job merges their lines into the record (scripts/test-inputs/merge.mjs) and keeps it as the node-test-inputs artifact. A test that read a step's output inherits that step's inputs. A test that read a package's build output depends on the whole package.
  • On a pull request, node-test-inputs picks the record, and the Node legs narrow the file-reading guards with it (scripts/test-inputs/select.mjs through fs-guard-tests.mjs --inputs). Tests the change reaches through their module graph, and tests that load a changed package by name, run as today.
  • Safety rules, each tested:
    1. A test file the pull request changes always runs.
    2. A change anywhere under a folder a test listed runs it (a file in a new subfolder of a folder it walks); a folder it checked as a whole runs it when the folder is gone; a path it looked for and found missing runs it once the path exists.
    3. A change to any package.json, the lockfile, the workspace or Node version, .github/, the Vitest configuration and setup files, the test utilities, or TypeScript or bundler configuration or build scripts runs every file-reading test.
    4. The record must be of a commit the merge base contains, and the paths changed between that commit and the base count as changed; a file-reading test whose import closure reaches one of them, or a workspace package one belongs to, runs (the record holds no module Vitest itself transforms). Main keeps a record only for the commit its run was dispatched on, and a leg narrows nothing when the record's commit is not the one picked. A test file the record does not name runs.
    5. A test that starts a program that is not Node, a shell command, or a Node child or worker that does not load the recorder always runs.
    6. When a Node test fails on Main's full run, the run names every pull request merged since the last passing full run that left the test out, and opens an issue, so a wrong skip shows within the hour.
  • Leg 1 keeps the list it left out (node-skipped-tests) for that alarm.

Evidence

  • Failure before the change: a template-only change (for example, one that narrows block templates) ran all 388 theme editor test files, though none reads the templates it touched.
  • Success after the change: on the replay, that change runs 23 of the 388. A Core change still runs them, because they read Core's build. A change to the test utilities runs every file-reading test.
  • Product/runtime behavior verified unchanged: CI only. With and without recording, the same 60-file sample passes. Recording costs about 8% more CPU (user plus system time) on Main's legs.
  • CI impact: pull-request Node legs leave out tests whose recorded inputs the change cannot reach, saving about 19 runner-minutes per run on average. One new slim job per pull-request run (seconds). Main's full run gains one standard job after its legs (the merge took 3.5 GB and under two minutes on a full run's lines), plus per-leg artifacts. The record is about 5 MB compressed.

Scope

Components: CI test selection, CI records

  • No intended public API, product behavior, visual direction, or policy change beyond the CI record change below.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node over every test file that reads the workflows, admission, fs-guard-tests or scripts/test-inputs (58 files): all pass except ci-interaction-lab-specs, which fails on main too.
  • scripts/test-inputs/test-inputs.test.mjs: the recorder in real child processes (reads, probes, listings, writes, a Node child, a non-Node program, no owner), the merge (setup steps, build output, a test's own writes, checkout files), and every selection rule.
  • .github/scripts/test-inputs-workflow.test.mjs: the wiring in ci.yml and deploy.yml, the record picker against a stubbed API (newest record of the base, renamed paths, no record, too many changed paths), and the alarm's readers.
  • The replay above: a full recording of the Node suite, merged and selected against the changed files of the last 120 pull requests.
  • pnpm check:knowledge: aligned.

Writing rubric results

R1 narration: DEC-31's first draft said the run "now records" and that the legs run every test "as before"; rewritten in the present tense.
R2 research: the replay numbers stay in this description; DEC-31 keeps only the conclusion that most changes touch none of the editor tests' inputs.
R3 evidence: FR13's verification row names the two test files and their cases.
R4 rejected alternatives: one Rejected: line in DEC-31, naming three.
R5 change references: none.
R6 open questions: none.
R7 project status: none.

…them

Main's hourly full unit run records what each Node test file touches
(files read or probed, folders listed, paths written, and the same for the
test setup's steps) and keeps the record as an artifact. A pull request's
Node legs then run a file-reading test only when the change reaches one of
its recorded inputs. A changed test, a test with no record, a test whose
record cannot see all it reads, and any change to the install, CI, test
setup or build configuration still run. Without a usable record the legs
run every file-reading test. When a Node test fails on main, the run names
any merged pull request that left it out and opens an issue.

spec:AST-030 FR13 points to the new DEC-30.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 9:48am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 19, 2026, 4:23 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the spec:AST-030 change, and four fixes are needed whatever that decision is.

  • The recorder import in vitest.global-setup.node.mjs sits between process.once('exit', endRun) and try, so scripts/ensure-core-built.test.mjs (the run-lease contract) fails in test-node; move the import and recordStep inside the try block.
  • select.mjs matches a changed path only against a test's exact folders, so a file added in a new subfolder of a folder a test lists (for example packages/cli/api/icon/newdir/ for icon-set-doc-pointers.test.mjs) leaves out a test that reads it; keep listed folders apart in the record and run a test when a listed folder is an ancestor of a changed path, with a nested-folder test case.
  • DEC-30 says a test that starts a worker thread always runs, but record.mjs treats a worker without an env as recorded, which holds only when the starting process was preloaded with the recorder; mark such workers unseen otherwise, add a worker test case, and make DEC-30 state the rule the code keeps.
  • The FR13 amendment is inserted before "; and every test that loads a changed workspace package from its build", which leaves that run category attached to the new restriction; move the new sentence after the dist/ clause.

The current FR13 runs every file-reading test on a pull request, and this change intentionally replaces that with DEC-30, so approval needs an engineering owner to approve or reject the FR13 amendment and DEC-30 (the recording on Main, the skip rules, the record picker and the issue-opening alarm) by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Smaller notes, such as a record version mismatch failing every Node leg instead of falling back, are in the review.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • The recorder records reads, probes, listings, writes and what it cannot see, and Node children record under the same test: verified (test-inputs.test.mjs first case; probe).
  • Worker threads record themselves under the same test: true only when the starting process was preloaded with the recorder (probe); DEC-30 states the opposite rule: false as written in DEC-30.
  • The global setup records each part as a step: verified (vitest.global-setup.node.mjs step names).
  • Main's legs record, one job merges when all pass and keeps the record artifact: verified (deploy.yml; workflow test).
  • A test that read a step's output inherits that step's inputs: verified (merge.mjs:142-151; merge test).
  • A test that read a package's build output depends on the whole package: partly; when a recorded step with nothing unseen wrote that output, the test gets the step's folders only (merge.mjs:142-151).
  • One job picks the record, every leg reads that choice, and a leg that cannot read it fails: verified (ci.yml; workflow test).
  • With no usable record (none kept, none of the base's latest 100 commits, too many changed paths, or a failed lookup) the legs run today's set: verified (test-inputs-pick.cjs:29-79; the legs keep !cancelled()).
  • A changed test always runs; install, CI, test setup and build configuration changes run every file-reading test: verified (select.mjs:22-37, :62; tests).
  • The record must be of a commit the merge base contains, paths changed since count, and an unrecorded test runs: verified (test-inputs-pick.cjs; select.mjs:59).
  • A test that starts a non-Node program, a shell command, or a child or worker without the recorder always runs: verified for children and shells; a worker started without an env from a process that imported the recorder at run time is not caught (probe).
  • Main's failed full run names merged pull requests that left the test out and opens an issue: verified by reading (skipped-test-alarm.cjs; deploy.yml); only its readers are tested.
  • Leg 1 keeps the list it left out: verified (ci.yml; leg-bounds test).
  • A file-reading test still runs whenever the change can reach what it reads: false (new subfolder of a listed folder, probe).
  • Replay figures (time left out, minutes saved, share of theme editor tests skipped, 23 of 388, recording CPU cost, merge memory): not verifiable at this head; Main keeps no record yet.
  • The listed 58 test files pass apart from one known failure: not rechecked here; scripts/ensure-core-built.test.mjs, outside that list, fails in CI at this head.
  • No public API, product behavior or visual change: verified (no package files change).

Files:

  • .github/scripts/ci-admission.test.mjs: clear
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear
  • .github/scripts/ci-test-routing.test.mjs: clear
  • .github/scripts/fs-guard-tests.mjs: non-blocking (a record version mismatch fails the leg)
  • .github/scripts/lib/skipped-test-alarm.cjs: clear
  • .github/scripts/lib/test-inputs-pick.cjs: clear
  • .github/scripts/test-inputs-workflow.test.mjs: clear
  • .github/workflows/ci.yml: clear
  • .github/workflows/deploy.yml: non-blocking (a failed record merge turns Main's run red)
  • docs/specs/AST-030/spec.md: owner decision needed; blocking (FR13 clause order, DEC-30 worker rule)
  • scripts/test-inputs/merge.mjs: part of the subfolder finding (listed folders kept with read folders)
  • scripts/test-inputs/record.mjs: blocking (worker rule); duplicate comment
  • scripts/test-inputs/select.mjs: blocking (subfolder finding)
  • scripts/test-inputs/setup.mjs: clear
  • scripts/test-inputs/test-inputs.test.mjs: missing nested-folder and worker cases
  • vitest.config.ts: clear
  • vitest.global-setup.node.mjs: blocking (lease contract test fails)

Automated review (maintainer link)

Comment thread vitest.global-setup.node.mjs Resolved
Comment thread scripts/test-inputs/select.mjs Resolved
Comment thread scripts/test-inputs/record.mjs Resolved
Comment thread docs/specs/AST-030/spec.md Resolved
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ad6fb4f

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

…s, setup lease order

- The record keeps listed folders apart; a change anywhere under one runs
  the test, so a file in a new subfolder of a folder a test walks runs it.
- A worker thread counts as recorded only in a process the recorder was
  preloaded into; DEC-30 states the rule.
- The global setup loads the recorder inside the run lease's try block.
- The FR13 sentence follows the build-output clause.
- A record of another format version narrows nothing.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the spec:AST-030 change, and four fixes are needed whatever that decision is.

  • Regression: main now has its own DEC-30 (a release-critical pull request is admitted at once) and this branch conflicts with it in docs/specs/AST-030/spec.md, so merge main, number the new decision DEC-31, and update the FR13 sentence, the decision's Reference line, the deploy.yml comment and the test-inputs-workflow.test.mjs header.
  • Still open from the last review: a test that checks a folder with existsSync or stat is left out when the change creates or empties that folder, because merge.mjs records the folder's parent and select.mjs compares only each changed path's own folder; run a test when a changed path is at or under a path it read or probed, and add both cases to test-inputs.test.mjs.
  • Miss: test-inputs-pick.cjs takes the dispatching run's head commit as the record's commit while deploy.yml records needs.main-commit.outputs.sha, so a run that validates an older commit is labelled with the tip and the paths changed in between never count; read the commit from the downloaded record, or keep the record only when the two agree.
  • Miss: paths changed between the record's commit and the base never reach the module graph, and the record holds no module the Vitest runner loads (all-or-nothing.test.mjs records none of its four imports), so a helper that changed on main after the record can hide a test; also run every guard whose import closure reaches one of those paths.

The current FR13 runs every file-reading test on a pull request, and this change intentionally narrows it with a new decision, so approval needs an engineering owner to approve or reject the FR13 change and that decision (the recording on Main, the record picker, the skip rules and the issue-opening alarm) by commenting /approve-spec <full head SHA> on the head that resolves the conflict; the author may do so as an engineering owner. The earlier fixes (setup lease order, listed subfolders, worker threads, the FR13 clause order) hold on this head, and two smaller notes are in the review.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • The recorder notes reads, probes, listings, writes and what it cannot see, and Node children and worker threads record under the same test file: verified (test-inputs.test.mjs recorder and worker cases; a recording run).
  • The global setup records each of its parts as a step: verified (vitest.global-setup.node.mjs step names; recorded step lines).
  • Main's full run records in each leg, and one job merges the lines into the kept record when every leg passes: verified (deploy.yml record job; workflow test).
  • A test that read a step's output inherits that step's inputs, and one that read a package's build output depends on the whole package: verified (merge.mjs step and build-output handling; merge test); when a recorded step with nothing unseen built that output, the test takes the step's inputs.
  • On a pull request one job picks the record and the legs narrow the guards with it, while module-graph and package-by-name tests run as before: verified (ci.yml; fs-guard-tests.mjs keeps the build and reached lists).
  • A changed test file always runs: verified (select.mjs and its test).
  • A change anywhere under a listed folder runs the test: verified for listings; false for a folder checked with existsSync or stat that the change creates or empties (probe).
  • Install, CI, test setup, test utilities and build configuration changes run every file-reading test: verified (select.mjs list and its test).
  • The record must be of a commit the merge base contains, the paths changed since count, and an unrecorded test runs: partly false; the commit checked is the dispatching run's head, not the commit recorded.
  • A non-Node program, a shell command, or a child or worker without the recorder always runs its test: verified (record.mjs; tests).
  • A failing test on Main names the merged pull requests that left it out and opens an issue: verified by reading (skipped-test-alarm.cjs, deploy.yml); only its readers are tested.
  • Leg 1 keeps the list it left out: verified (ci.yml; leg-bounds test).
  • With no usable record the legs run today's set, every leg reads one choice, and a leg that cannot read it fails: verified (picker fallbacks, record-version fallback, workflow test).
  • A file-reading test still runs whenever the change can reach what it reads: false (folder checks; helpers changed since the record).
  • Every required context and owner keeps reporting: verified (no required name changes; the legs keep running when the picker is skipped or fails).
  • The replay figures (time left out, minutes saved, share of theme-editor tests skipped, the 23 of 388 example, recording cost, merge memory): not verifiable here; Main keeps no record yet.
  • The listed test files pass apart from one known failure: the new and changed contract tests pass here; the whole list was not rerun.
  • The knowledge check is aligned: verified.
  • No public API, product behavior or visual change: verified (no package files change).

Files:

  • .github/scripts/ci-admission.test.mjs: clear
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear
  • .github/scripts/ci-test-routing.test.mjs: clear
  • .github/scripts/fs-guard-tests.mjs: blocking (since-record paths skip the module graph)
  • .github/scripts/lib/skipped-test-alarm.cjs: clear (its last-passing-run compare reads the same head commit as the picker)
  • .github/scripts/lib/test-inputs-pick.cjs: blocking (record commit)
  • .github/scripts/test-inputs-workflow.test.mjs: header names the reused DEC-30; no case for a run of an older commit
  • .github/workflows/ci.yml: clear
  • .github/workflows/deploy.yml: comment names the reused DEC-30; non-blocking (a failed record merge turns Main's run red)
  • docs/specs/AST-030/spec.md: owner decision needed; blocking (DEC-30 reused, conflict with main)
  • scripts/test-inputs/merge.mjs: blocking (folder probes and stats)
  • scripts/test-inputs/record.mjs: records no module the Vitest runner loads; duplicate comment (non-blocking)
  • scripts/test-inputs/select.mjs: blocking (folder probes and stats)
  • scripts/test-inputs/setup.mjs: clear
  • scripts/test-inputs/test-inputs.test.mjs: missing folder-probe and folder-stat cases
  • vitest.config.ts: clear
  • vitest.global-setup.node.mjs: clear

Automated review (maintainer link)

Comment thread docs/specs/AST-030/spec.md Resolved
Comment thread scripts/test-inputs/merge.mjs Resolved
Comment thread .github/scripts/fs-guard-tests.mjs Resolved
…ecord commit, since-record closure

- main's new DEC-30 keeps its number; this decision is DEC-31.
- A folder a test checks as a whole runs it when the folder is gone; a path
  it looked for and found missing runs it once the path exists.
- Main keeps the record only for the commit its run was dispatched on, and
  a leg narrows nothing when the record's own commit is not the one picked.
- A file-reading test whose import closure reaches a path changed since the
  record, or a workspace package such a path belongs to, runs.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the spec:AST-030 change, and one fix is needed whatever that decision is.

  • Miss: fs.cpSync(src, dest, {recursive: true}) without a filter copies a checked-in folder natively, so record.mjs sees only the source path and merge.mjs stores it as a checked folder, which leaves a test that copies a fixture and runs on the copy out of every pull request that edits or adds a file in that fixture; note a cp or cpSync source as a listing and add the case to test-inputs.test.mjs.

The current FR13 runs every file-reading test on a pull request, and this change narrows it on purpose with the new DEC-31. So approval needs an engineering owner to approve or reject the FR13 change and DEC-31 (the recording on Main, the record picker, the skip rules and the issue-opening alarm) by commenting /approve-spec <full head SHA> on the head that will merge; the author may do this as an engineering owner. The earlier fixes hold on this head (the DEC-31 numbering, folder checks and missing paths, the record's commit, the since-record import closure), and four smaller notes are in the review.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Nearly every Node test reads files, so FR13 runs almost the whole Node suite on each pull request: consistent with the current rule; the runner-minute figures are not verifiable here.
  • The replay figures (time left out, minutes saved, share of editor tests skipped, share of full runs, tests whose record cannot see everything): not verifiable here, because Main keeps no record yet.
  • With no usable record a pull request runs today's set, one job picks the record, every leg reads that choice, and a leg that cannot read it fails: verified (picker fallbacks, record version and commit fallbacks in fs-guard-tests.mjs, download step without continue-on-error, workflow test).
  • A file-reading test still runs whenever the change can reach what it reads: false for a test that copies a checked-in folder with a native recursive copy (probe).
  • Every required context and owner keeps reporting: verified (no required job renamed; the legs run when the picker is skipped or fails).
  • The recorder notes reads, probes, listings, writes and what it cannot see; Node children and worker threads record under the same test file; the global setup records each part as a step: verified (record.mjs, recorder tests, setup step names), except the native recursive copy.
  • Main's full run records in each leg, and one job merges the lines into the kept record when every leg passes: verified (deploy.yml, workflow test); the record is kept only when the run tested the commit it was dispatched on.
  • A test that reads a setup step's output inherits that step's inputs, and one that reads a package's build output depends on the whole package: verified (merge.mjs, merge test).
  • On a pull request only the file-reading guard tests are narrowed; module-graph and package-by-name tests run as today: verified (fs-guard-tests.mjs).
  • A changed test file always runs: verified (select.mjs, test).
  • A change under a listed folder, a checked folder that is gone, or a probed path that now exists runs the test: verified (select.mjs, tests, probe).
  • Install, CI, test setup, test utilities and build configuration changes run every file-reading test: verified (RUNS_EVERY_TEST and its test).
  • The record must be of a commit among the base's latest hundred, paths changed since it count and reach tests through their import closure, a record of another commit narrows nothing, and an unrecorded test runs: verified (picker, fs-guard-tests.mjs, tests).
  • A test that starts a non-Node program, a shell, or a child or worker without the recorder always runs: verified (record.mjs, tests).
  • A failing test on Main names the merged pull requests that left it out and opens an issue: verified by reading; untested end to end, and its window starts at the previous run's dispatch commit (note).
  • Leg 1 keeps the list it left out: verified (ci.yml, leg-bounds test).
  • A template-only change runs all the editor tests today: consistent with the current rule; the replayed result and the recording cost are not verifiable here.
  • One slim job per pull-request run and one standard job on Main: verified (ci.yml, deploy.yml).
  • No public API, product behaviour or visual change: verified (no package files change).
  • Public text carries no internal context: verified.
  • The listed test files pass: the new and changed test files pass here; the full list was not rerun.
  • The knowledge check is aligned: verified.

Files:

  • .github/scripts/ci-admission.test.mjs: clear
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear
  • .github/scripts/ci-test-routing.test.mjs: clear
  • .github/scripts/fs-guard-tests.mjs: clear
  • .github/scripts/lib/skipped-test-alarm.cjs: note (window starts at the previous run's dispatch commit)
  • .github/scripts/lib/test-inputs-pick.cjs: clear
  • .github/scripts/test-inputs-workflow.test.mjs: note (no case runs the alarm itself)
  • .github/workflows/ci.yml: clear
  • .github/workflows/deploy.yml: note (a failed record step turns Main's run red)
  • docs/specs/AST-030/spec.md: owner decision needed
  • scripts/test-inputs/merge.mjs: blocking (a copied folder becomes a checked folder)
  • scripts/test-inputs/record.mjs: blocking (native recursive copy unseen); duplicate comment (note)
  • scripts/test-inputs/select.mjs: clear
  • scripts/test-inputs/setup.mjs: clear
  • scripts/test-inputs/test-inputs.test.mjs: no recursive-copy case
  • vitest.config.ts: clear
  • vitest.global-setup.node.mjs: clear

Automated review (maintainer link)

Comment thread scripts/test-inputs/record.mjs Resolved
fs.cp and fs.cpSync copy natively, so the recorder notes their source as a
listing: a test that copies a checked-in fixture and runs on the copy runs
when a file in that fixture changes.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the spec:AST-030 change, and one fix is needed whatever that decision is.

  • The new recursive-copy check in scripts/test-inputs/test-inputs.test.mjs (line 84) asserts that the dir folder is listed instead of the copied tree folder, so it still passes with the cp rule in record.mjs undone; assert path.join(work, 'tree') so the copy fix stays guarded.

The current FR13 runs every file-reading test on a pull request, and this change narrows it on purpose with the new DEC-31. Approval therefore needs an engineering owner to approve or reject the FR13 change and DEC-31 (the recording on Main, the record picker, the skip rules and the issue-opening alarm) by commenting /approve-spec <full head SHA> on the head that will merge; the author may do this as an engineering owner. The recursive fs.cpSync copy is now recorded as a listing, and four smaller notes from earlier rounds still stand in the review.

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Nearly every Node test reads files, so FR13 runs almost the whole Node suite on each pull request (about 77 runner-minutes): consistent with the current rule; the minute figures are not verifiable here.
  • The replay figures (time left out, minutes saved, share of editor tests skipped, share that still runs everything, tests whose record cannot see everything): not verifiable here, because Main keeps no record yet.
  • With no usable record a pull request runs today's set, one job picks the record, every leg reads that choice, and a leg that cannot read it fails: verified (picker fallbacks in test-inputs-pick.cjs, version and commit fallbacks in fs-guard-tests.mjs, a download step without continue-on-error, workflow test).
  • A file-reading test still runs whenever the change can reach what it reads: verified for reads, listings, folder checks, missing paths and recursive copies (probe); the copy case has no effective test.
  • Every required context and owner keeps reporting: verified (no required job renamed; the legs run when the picker is skipped or fails).
  • The recorder notes reads, probes, listings, writes and what it cannot see; Node children and worker threads record under the same test file; the global setup records each part as a step: verified (record.mjs, recorder tests, setup step names).
  • Main's full run records in each leg, and one job merges the lines into the kept record when every leg passes: verified (deploy.yml, workflow test); the record is kept only when the run tested the commit it was dispatched on.
  • A test that reads a setup step's output inherits that step's inputs, and one that reads a package's build output depends on the whole package: verified (merge.mjs, merge test).
  • Only the file-reading guard tests are narrowed; module-graph and package-by-name tests run as today: verified (fs-guard-tests.mjs).
  • A changed test file always runs: verified (select.mjs, test).
  • A change under a listed folder, a checked folder that is gone, or a probed path that now exists runs the test: verified (select.mjs, tests, probe).
  • Install, CI, test setup, test utilities and build configuration changes run every file-reading test: verified (RUNS_EVERY_TEST and its test).
  • The record must be of a commit the merge base contains, paths changed since it count and reach tests through their import closure, a record of another commit narrows nothing, and an unrecorded test runs: verified (picker, fs-guard-tests.mjs, tests).
  • A test that starts a non-Node program, a shell, or a child or worker without the recorder always runs: verified (record.mjs, tests).
  • A failing test on Main names the merged pull requests that left it out and opens an issue: verified by reading; untested end to end, and its window starts at the previous run's dispatch commit (note).
  • Each safety rule is tested: true for rules 1, 2, 3 and 5; in rule 4 a record of another commit narrowing nothing is checked only by reading fs-guard-tests.mjs (the tests pin only the argument), and the alarm (rule 6) is tested only through its readers and wiring (note).
  • Leg 1 keeps the list it left out: verified (ci.yml, leg-bounds test).
  • A template-only change runs all the editor tests today: consistent with the current rule; the replayed 23 of 388 and the recording cost are not verifiable here.
  • One slim job per pull-request run and one standard job on Main: verified (ci.yml, deploy.yml).
  • No public API, product behaviour or visual change: verified (no package files change).
  • Public text carries no internal context: verified.
  • The listed test files pass: the new and changed test files pass here; the full list was not rerun.
  • The knowledge check is aligned: not rerun at this head; the record is unchanged since it was last checked.

Files:

  • .github/scripts/ci-admission.test.mjs: clear
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear
  • .github/scripts/ci-test-routing.test.mjs: clear
  • .github/scripts/fs-guard-tests.mjs: clear
  • .github/scripts/lib/skipped-test-alarm.cjs: note (the window starts at the previous run's dispatch commit)
  • .github/scripts/lib/test-inputs-pick.cjs: clear
  • .github/scripts/test-inputs-workflow.test.mjs: note (no case runs the alarm itself)
  • .github/workflows/ci.yml: clear
  • .github/workflows/deploy.yml: note (a failed record step turns Main's run red)
  • docs/specs/AST-030/spec.md: owner decision needed
  • scripts/test-inputs/merge.mjs: clear
  • scripts/test-inputs/record.mjs: clear (recursive copy fixed); duplicate comment (note)
  • scripts/test-inputs/select.mjs: clear
  • scripts/test-inputs/setup.mjs: clear
  • scripts/test-inputs/test-inputs.test.mjs: blocking (the copy check asserts the wrong folder)
  • vitest.config.ts: clear
  • vitest.global-setup.node.mjs: clear

Automated review (maintainer link)

… listed

The case listed the copy source as `dir`, which other calls list too, so it
passed with the cp rule undone. It now asserts the copied `tree` folder,
which only the cp rule lists.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the spec:AST-030 change, and one fix is needed whatever that decision is.

  • Miss: scripts/test-inputs/record.mjs does not watch child_process.fork, so a test whose Node child is forked with its own env records none of that child's reads and is left out when they change, although DEC-31 says such a test always runs; wrap fork beside spawn and add a forked child with a stripped env to the recorder test.

The current FR13 runs every file-reading test on a pull request, and this change narrows it on purpose with the new DEC-31. Approval therefore needs an engineering owner to approve or reject the FR13 change and DEC-31 (the recording on Main, the record picker, the skip rules and the issue-opening alarm) by commenting /approve-spec <full head SHA> on the head that will merge; the author may do this as an engineering owner. The recursive-copy test now checks the copied folder, and four smaller notes from earlier rounds still stand in the review.

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Nearly every Node test reads files, so FR13 runs almost the whole Node suite on each pull request (about 77 runner-minutes): consistent with the current rule; the minute figures are not verifiable here.
  • The replay figures (time left out, minutes saved, share of editor tests skipped, share that still runs everything, tests whose record cannot see everything): not verifiable here, because Main keeps no record yet.
  • With no usable record a pull request runs today's set, one job picks the record, every leg reads that choice, and a leg that cannot read it fails: verified (picker fallbacks in test-inputs-pick.cjs, version and commit fallbacks in fs-guard-tests.mjs, a download step without continue-on-error, workflow test; CI at this head ran the full set with the no-record notice).
  • A file-reading test still runs whenever the change can reach what it reads: verified for reads, listings, folder checks, missing paths and recursive copies; false for a Node child started with fork and its own environment (probe).
  • Every required context and owner keeps reporting: verified (no required job renamed; the legs run when the picker is skipped or fails).
  • The recorder notes reads, probes, listings, writes and what it cannot see; Node children and worker threads record under the same test file; the global setup records each part as a step: verified (record.mjs, recorder tests, setup step names), except a forked child given its own environment, which is neither recorded nor marked.
  • Main's full run records in each leg, and one job merges the lines into the kept record when every leg passes: verified (deploy.yml, workflow test), also merged with main's planned Node legs; the record is kept only when the run tested the commit it was dispatched on.
  • A test that reads a setup step's output inherits that step's inputs, and one that reads a package's build output depends on the whole package: verified (merge.mjs, merge test).
  • Only the file-reading guard tests are narrowed; module-graph and package-by-name tests run as today: verified (fs-guard-tests.mjs).
  • A changed test file always runs: verified (select.mjs, test).
  • A change under a listed folder, a checked folder that is gone, or a probed path that now exists runs the test: verified (select.mjs, tests).
  • Install, CI, test setup, test utilities and build configuration changes run every file-reading test: verified (RUNS_EVERY_TEST and its test).
  • The record must be of a commit the merge base contains, paths changed since it count and reach tests through their import closure, a record of another commit narrows nothing, and an unrecorded test runs: verified (picker, fs-guard-tests.mjs, tests).
  • A test that starts a non-Node program, a shell, or a Node child or worker without the recorder always runs: false for a Node child started with fork and its own environment (probe); verified for the other cases (recorder tests).
  • A failing test on Main names the merged pull requests that left it out and opens an issue: verified by reading; untested end to end, and its window starts at the previous run's dispatch commit (note).
  • Each safety rule is tested: true for rules 1, 2 and 3; in rule 4 a record of another commit narrowing nothing is checked only by reading fs-guard-tests.mjs, rule 5 has no fork case, and the alarm (rule 6) is tested only through its readers and wiring.
  • Leg 1 keeps the list it left out: verified (ci.yml, leg-bounds test).
  • A template-only change runs all the editor tests today: consistent with the current rule; the replayed 23 of 388 and the recording cost are not verifiable here.
  • One slim job per pull-request run and one standard job on Main: verified (ci.yml, deploy.yml).
  • No public API, product behaviour or visual change: verified (no package files change).
  • Public text carries no internal context: verified.
  • The listed test files pass: the new and changed test files pass here, and the workflow contracts pass merged with today's main; the full list was not rerun.
  • The knowledge check is aligned: not rerun here.

Files:

  • .github/scripts/ci-admission.test.mjs: clear
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear
  • .github/scripts/ci-test-routing.test.mjs: clear
  • .github/scripts/fs-guard-tests.mjs: clear
  • .github/scripts/lib/skipped-test-alarm.cjs: note (the window starts at the previous run's dispatch commit)
  • .github/scripts/lib/test-inputs-pick.cjs: clear
  • .github/scripts/test-inputs-workflow.test.mjs: note (no case runs the alarm itself)
  • .github/workflows/ci.yml: clear
  • .github/workflows/deploy.yml: note (a failed record step turns Main's run red)
  • docs/specs/AST-030/spec.md: owner decision needed
  • scripts/test-inputs/merge.mjs: clear
  • scripts/test-inputs/record.mjs: blocking (fork is not watched); duplicate comment (note)
  • scripts/test-inputs/select.mjs: clear
  • scripts/test-inputs/setup.mjs: clear
  • scripts/test-inputs/test-inputs.test.mjs: clear (the copy check is fixed); the missing fork case belongs to the blocking finding
  • vitest.config.ts: clear
  • vitest.global-setup.node.mjs: clear

Automated review (maintainer link)

Comment thread scripts/test-inputs/record.mjs Resolved
child_process.fork always starts Node; when its environment drops the
recorder, the recorder notes it as unseen, so the test runs on every pull
request. The recorder test forks a child that keeps the environment (its
reads record) and one given a stripped environment.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the intentional spec:AST-030 change; no blocking defect remains at this head.

  • To approve, an engineering owner comments /approve-spec <full head SHA> on the head that will merge (the author may, as an engineering owner), deciding the FR13 change and the new DEC-31: the recording on Main, the record picker, the skip rules and the alarm that opens an issue on Main.
  • DEC-31's Decider line names a decider who has not recorded a decision on this pull request; it should name whoever approves.

The child_process.fork gap is fixed: a test whose forked Node child drops the recorder now always runs, and the recorder test fails without the new wrapper. Four non-blocking notes remain: Main's full run turns red if the record merge or upload fails (deploy.yml), the alarm compares from the commit a run was dispatched on rather than the one it tested (skipped-test-alarm.cjs), skippedFailures has no test, and record.mjs states the Node-child rule twice.

Claims and files checked

Review mode: incremental; reason: none

Automated review (maintainer link)

…larm compares from the tested commit

- DEC-31 names its decider as pending until that approval is recorded.
- Making or keeping the record continues on error: without it pull requests
  run every file-reading test, so main stays green.
- The alarm compares from the commit the last passing run tested (a
  dispatch names it in its run name), not the commit it ran on.
- skippedFailures takes its download as a parameter and has a test; the
  recorder states the Node-child rule once.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the intentional spec:AST-030 change, and three fixes are needed either way.

  • To approve the spec change, an engineering owner comments /approve-spec <full head SHA> on the head that will merge (the author may, as an engineering owner), deciding the FR13 change and DEC-31: the recording on Main, the record picker, the skip rules and the alarm that opens an issue on Main.
  • Regression: main now requires every checkout in deploy.yml to be bounded at five minutes and retried once, so the new node-test-inputs job's plain checkout fails main-validation-workflow.test.mjs on the merge commit (test-node (1/8)); merge main, give that checkout the same bounded retry and stop step, and add the job to the test's list.
  • Miss: the Main leg step now names --reporter=default --reporter=json, which turns off Vitest's automatic github-actions reporter, so a Node test that fails on Main's full run no longer gets an annotation; add --reporter=github-actions there, as the pull-request legs in ci.yml do.
  • testedCommit in skipped-test-alarm.cjs copies testedSha from scripts/release/release-check-receipt.mjs but falls back to the dispatch commit, which the existing readers and deploy.yml's commit resolver say an unnamed run may not have tested; share one reader and make the fallback explicit.

The four earlier notes are fixed: the record steps no longer turn Main red, the alarm compares from the tested commit with a test, and the duplicate comment is gone. One non-blocking point: DEC-31 narrows DEC-6 ("tests that read sources through the file system run whole") without naming it.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the cost and replay figures (runner-minutes, share left out, test counts, recording overhead, merge memory): unverified, since Main keeps no record yet.
  • Claim: with no usable record the legs run today's set (no record, none of a recent base commit, too many changed paths, a failed lookup, another format or commit): verified in test-inputs-pick.cjs:474-506, fs-guard-tests.mjs:497-517 and CI's notice at this head.
  • Claim: one job picks the record and every leg reads that choice; a leg that cannot read it fails: verified in ci.yml and test-inputs-workflow.test.mjs.
  • Claim: every required context and owner keeps reporting: verified, no required job renamed.
  • Claim: the recorder notes reads, probes, listings, writes and what it cannot see, for Node children, workers and setup steps too: verified by the recorder tests and a real recording run.
  • Claim: Main merges the legs only when all pass and keeps the record; step outputs inherit step inputs and build output maps to its package: verified in deploy.yml and merge.mjs with tests.
  • Claim: legs narrow only the file-reading guards; module-graph and package-name tests run as today: verified in fs-guard-tests.mjs.
  • Claim: safety rules 1 to 5: verified in select.mjs, fs-guard-tests.mjs and tests.
  • Claim: rule 6, the alarm names merged pull requests and opens an issue: verified in deploy.yml and skipped-test-alarm.cjs, now with a test.
  • Claim: leg 1 keeps the left-out list: verified in ci.yml.
  • Claim: the same 60-file sample passes with and without recording: unverified; three guard tests pass with recording here.
  • Claim: one new slim job per pull-request run, seconds long: verified, 8 s at this head.
  • Claim: no public API or product change: verified.
  • Claim: the listed test runs pass and the knowledge check is aligned: the five changed test files pass at the head (the merge with main fails one other test, see above) and the knowledge check reports aligned.
  • Claim: the rubric notes (DEC-31's one Rejected line naming three, the FR13 row naming both test files): verified.
  • File .github/scripts/ci-admission.test.mjs: clear.
  • File .github/scripts/ci-node-leg-bounds.test.mjs: clear.
  • File .github/scripts/ci-test-routing.test.mjs: clear.
  • File .github/scripts/fs-guard-tests.mjs: clear.
  • File .github/scripts/lib/skipped-test-alarm.cjs: copied run-name reader (blocking).
  • File .github/scripts/lib/test-inputs-pick.cjs: clear.
  • File .github/scripts/test-inputs-workflow.test.mjs: clear.
  • File .github/workflows/ci.yml: clear.
  • File .github/workflows/deploy.yml: unbounded checkout on the merge with main, and dropped failure annotations (blocking).
  • File docs/specs/AST-030/spec.md: held for an engineering owner; DEC-6 not named (non-blocking).
  • File scripts/test-inputs/merge.mjs: clear.
  • File scripts/test-inputs/record.mjs: clear.
  • File scripts/test-inputs/select.mjs: clear.
  • File scripts/test-inputs/setup.mjs: clear.
  • File scripts/test-inputs/test-inputs.test.mjs: clear.
  • File vitest.config.ts: clear.
  • File vitest.global-setup.node.mjs: clear.

Automated review (maintainer link)

Comment thread .github/workflows/deploy.yml Resolved
Comment thread .github/workflows/deploy.yml Resolved
Comment thread docs/specs/AST-030/spec.md Resolved
…sted-commit reader

- The node-test-inputs job checks out with main's bounded retry and stop step.
- Main's recording legs name the github-actions reporter, so a failing Node
  test on the full run is annotated.
- The release-check receipt and the skipped-test alarm read a Main run's
  tested commit through one helper; a run that names none is passed over.
- DEC-31 says it narrows DEC-6 for the Node project.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the intentional spec:AST-030 change, and one fix is needed whatever that decision is.

  • To approve the spec change, an engineering owner comments /approve-spec <full head SHA> on the head that will merge to accept the FR13 narrowing and the new DEC-31 (the recording on Main, the record picker, the skip rules and the alarm), or rejects it; the author may do this as an engineering owner.
  • .github/scripts/ci-heavy-lanes.test.mjs ("reads the commit a unit run names exactly as the release receipt does") still expects the run-name pattern in scripts/release/release-check-receipt.mjs, which this head moved to scripts/lib/main-run-commit.cjs, so the Node run fails here and every full unit run of main would fail after merge; point the test at the shared module and check that the receipt imports it.

The earlier fixes (the bounded checkout of the record job, the github-actions reporter on Main's Node legs, and one shared tested-commit reader) are in place, and the selection rules held on a real recording of three guard tests.

Claims and files checked

Review mode: full; reason: spec-record

Claims in the description:

  • FR13's file-system rule runs nearly the whole Node suite on every pull request, about 77 runner-minutes: not checkable here (a measurement).
  • The replay figures (time and minutes saved, the share of pull requests, unseen test files, the theme editor's 388 and 23 files): not checkable until main keeps a record.
  • Without a usable record every file-reading test runs, one job picks the record, and a leg that cannot read it fails: verified (ci.yml picker job and download step; this head's run reports that main keeps no record).
  • The recorder notes reads, probes, listings, writes and what it cannot see, for Node children, workers and setup steps too: verified (test-inputs.test.mjs, a real recording run).
  • Main's legs record, one job merges them when every leg passes, and build output counts as the whole package: verified (deploy.yml, merge.mjs tests).
  • Pull requests narrow only the file-reading guards, and module-graph and package-name tests still run: verified (fs-guard-tests.mjs).
  • Safety rules 1 to 6: verified (select.mjs, record.mjs, skipped-test-alarm.cjs and their tests).
  • Leg 1 keeps the list it left out: verified (ci.yml).
  • Recording costs about 8% more CPU, the same 60-file sample passes, the merge takes 3.5 GB, the record is about 5 MB: not checkable here.
  • One slim job per pull-request run and one standard job on Main: verified (runner labels in both workflows).
  • No public API or product change: verified.
  • The workflow-reading tests all pass except one that fails on main too: false at this head (ci-heavy-lanes.test.mjs fails).
  • The two new test files cover the listed cases: verified (14 and 9 pass).
  • The knowledge check is aligned: verified.
  • Writing rubric results: verified against DEC-31.

Files:

  • .github/scripts/ci-admission.test.mjs, ci-node-leg-bounds.test.mjs, ci-test-routing.test.mjs, main-validation-workflow.test.mjs, test-inputs-workflow.test.mjs: clear.
  • .github/scripts/fs-guard-tests.mjs, lib/skipped-test-alarm.cjs, lib/test-inputs-pick.cjs: clear.
  • .github/workflows/ci.yml, .github/workflows/deploy.yml: clear.
  • docs/specs/AST-030/spec.md: waits on the owner decision.
  • scripts/lib/main-run-commit.cjs, scripts/release/release-check-receipt.mjs: the move breaks ci-heavy-lanes.test.mjs (finding above).
  • scripts/test-inputs/merge.mjs, record.mjs, select.mjs, setup.mjs, test-inputs.test.mjs: clear.
  • vitest.config.ts, vitest.global-setup.node.mjs: clear.

Automated review (maintainer link)

…eader

The pattern moved to scripts/lib/main-run-commit.cjs; the test checks it
there and that the release receipt imports it.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the intentional spec:AST-030 change; no blocking defect remains at this head.

  • To approve the spec change, an engineering owner comments /approve-spec <full head SHA> on the head that will merge to accept the FR13 narrowing and the new DEC-31 (the recording on Main, the record picker, the skip rules and the alarm), or rejects it; the author may do this as an engineering owner.

The heavy-lanes contract now checks the shared run-name reader and the receipt's import, and it passes, so the earlier fix request is resolved.

Claims and files checked

Review mode: incremental; reason: none

Claims in the description:

  • FR13's file-system rule runs nearly the whole Node suite on every pull request, about 77 runner-minutes: not checkable here (a measurement).
  • The replay figures (time and minutes saved, the share of pull requests, unseen test files, the theme editor's 388 and 23 files): not checkable until main keeps a record.
  • Without a usable record every file-reading test runs, one job picks the record, and a leg that cannot read it fails: verified (ci.yml picker job and download step; this head's run reports that main keeps no record).
  • The recorder notes reads, probes, listings, writes and what it cannot see, for Node children, workers and setup steps too: verified (test-inputs.test.mjs, a real recording run).
  • Main's legs record, one job merges them when every leg passes, and build output counts as the whole package: verified (deploy.yml, merge.mjs tests).
  • Pull requests narrow only the file-reading guards, and module-graph and package-name tests still run: verified (fs-guard-tests.mjs).
  • Safety rules 1 to 6: verified (select.mjs, record.mjs, skipped-test-alarm.cjs and their tests).
  • Leg 1 keeps the list it left out: verified (ci.yml).
  • Recording costs about 8% more CPU, the same 60-file sample passes, the merge takes 3.5 GB, the record is about 5 MB: not checkable here.
  • One slim job per pull-request run and one standard job on Main: verified (runner labels in both workflows).
  • No public API or product change: verified.
  • The workflow-reading tests pass except one that also fails on main: verified for the files run here, the heavy-lanes contract included; the named exception passed here too.
  • The two new test files cover the listed cases: verified (14 and 9 pass).
  • The knowledge check is aligned: verified.
  • Writing rubric results: verified against DEC-31.

Files:

  • .github/scripts/ci-heavy-lanes.test.mjs: clear (checks the shared reader and the receipt's import).
  • .github/scripts/ci-admission.test.mjs, ci-node-leg-bounds.test.mjs, ci-test-routing.test.mjs, main-validation-workflow.test.mjs, test-inputs-workflow.test.mjs: clear.
  • .github/scripts/fs-guard-tests.mjs, lib/skipped-test-alarm.cjs, lib/test-inputs-pick.cjs: clear.
  • .github/workflows/ci.yml, .github/workflows/deploy.yml: clear.
  • docs/specs/AST-030/spec.md: waits on the owner decision.
  • scripts/lib/main-run-commit.cjs, scripts/release/release-check-receipt.mjs: clear.
  • scripts/test-inputs/merge.mjs, record.mjs, select.mjs, setup.mjs, test-inputs.test.mjs: clear.
  • vitest.config.ts, vitest.global-setup.node.mjs: clear.

Automated review (maintainer link)

# Conflicts:
#	vitest.global-setup.node.mjs

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner deciding the intentional spec:AST-030 change, and one fix is needed whatever that decision is.

  • To approve the spec change, an engineering owner comments /approve-spec <full head SHA> on the head that will merge (the author may do so as an engineering owner); it settles whether pull-request Node legs may leave out a file-reading test whose recorded inputs the change misses, which the new FR13 sentence and DEC-31 allow and FR13 and DEC-6 as they stand forbid.
  • Miss: scripts/test-inputs/record.mjs writes a process's lines only when it exits, so a page-render host that render-page.mjs stops with SIGKILL either loses everything it read, leaving its test out of a change only the host read, or leaves a line cut short that makes merge.mjs throw so Main keeps no record.

Non-blocking: the bundled-theme build in the global setup's shared folder is credited to step:base-themes, which reads nothing, so a test that only links that build records none of packages/themes/<theme>/.

Claims and files checked

Review mode: incremental; reason: none

  • Since the last review: the merge of main into vitest.global-setup.node.mjs and .github/workflows/deploy.yml, rechecked with the recorder, merge and selection.
  • Earlier fixes still hold: nested folders under a listed folder, the record's commit, recursive copies, forked children, the DEC-6 reference and the heavy-lanes contract.

Automated review (maintainer link)

Comment thread scripts/test-inputs/record.mjs Resolved
Comment thread vitest.global-setup.node.mjs Resolved
…s are written whole

A recorded Node child writes its lines when it exits, so one stopped by a
signal (a page host killed once it answered) wrote none, or a cut-short
line that made the merge throw. The parent now notes such a child as
unseen for the owner it started under, so the test runs; and each line is
its own file, written and then renamed into place, so no line is cut.
…s inputs

The first worker builds a bundled theme into the run's shared folder and
the rest link it, so the build was credited to the setup step that made the
empty folder and read nothing. The merge now credits each path to its
nearest maker, a step or a test, so a test that links the build depends on
what the building test read.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision on the spec:AST-030 change, and two defects need fixing either way.

Spec decision. This pull request intentionally narrows spec:AST-030 FR13 and DEC-6, which today run every file-reading test on a pull request, through the new DEC-31. An engineering owner records the decision by commenting /approve-spec <full head SHA> on the head that will merge, or rejects it; the author may do so if they are an engineering owner.

Blocking:

  • scripts/test-inputs/record.mjs:48 names each line file by process id and a counter each thread keeps for itself, so a worker thread's line replaces its process's line: the pull request's own test "records a worker thread of a preloaded process" fails (scripts/test-inputs/test-inputs.test.mjs:152, also in test-node (2/8)), and a worker's line can replace the unseen mark a stopped child wrote, so a test whose host was killed can be left out; adding workerThreads.threadId to the name fixes both.
  • The new mark for a recorded child stopped by a signal makes the global setup's theme cache step unseen (its page hosts are stopped with SIGKILL once they answer), so every test that copies that cache, up to 435 of the 1,573 file-reading tests and 409 of them the theme editor's, always runs and the description's savings no longer hold; have a child write its lines before it answers, or measure again and restate the figures.

Non-blocking: a worker thread ended with terminate() loses its reads without an unseen mark (Miss).

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: with no usable record the legs run today's set: verified (fs-guard-tests.mjs:497-517, picker tests in test-inputs-workflow.test.mjs).
  • Claim: one job picks the record and a leg that cannot read it fails: verified (ci.yml download step without continue-on-error).
  • Claim: safety rules 1 to 4 and 6: verified in select.mjs, fs-guard-tests.mjs and the wiring tests.
  • Claim: rule 5 (a child or worker the record cannot see runs): false for a worker of a preloaded process (test-inputs.test.mjs:152 fails).
  • Claim: the replay savings (19 runner-minutes, 37% of pull requests, 23 of 388, 124 of 1,585): false at this head (theme cache step unseen).
  • Claim: the listed test files all pass: false at this head (test-inputs.test.mjs, 1 of 15 fails).
  • Claim: recording costs about 8% CPU and the merge 3.5 GB: not checked (needs a full recording).
  • Files: record.mjs (two findings), test-inputs.test.mjs (failing test), merge.mjs (clear), select.mjs (clear), setup.mjs (clear), fs-guard-tests.mjs (clear), test-inputs-pick.cjs (clear), skipped-test-alarm.cjs (clear), main-run-commit.cjs (clear), release-check-receipt.mjs (clear), ci.yml (clear), deploy.yml (clear), vitest.config.ts (clear), vitest.global-setup.node.mjs (clear), docs/specs/AST-030/spec.md (held for the owner decision), and the six changed CI contract tests (clear).

Automated review (maintainer link)

Comment thread scripts/test-inputs/record.mjs Resolved
Comment thread scripts/test-inputs/record.mjs Resolved
Comment thread scripts/test-inputs/record.mjs Resolved
…ses it on

- Line files carry the thread id, so a worker thread's line never replaces
  its process's.
- A recorded child or worker writes its lines before each IPC message and
  before a write after new inputs, so a page host killed once it answered
  loses nothing it passed on. Only a child stopped by a signal while its
  standard output was read marks its owner unseen, so the theme cache step
  no longer makes every test that copies the cache run.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision on the spec:AST-030 change; no blocking defect remains at this head.

Spec decision. This pull request intentionally narrows spec:AST-030 FR13 and DEC-6, which today run every file-reading test on a pull request, through the new DEC-31 (the recording on Main, the record picker, the skip rules and the alarm). An engineering owner records the decision by commenting /approve-spec <full head SHA> on the head that will merge, or rejects it; the author may do so if they are an engineering owner.

Both defects from the last review are fixed: line files now carry the thread id, and a host killed after it answers keeps its reads, so the theme cache step no longer forces every test that copies it to run.

Non-blocking:

  • A started process now writes a file per flush, so a two-test recording went from 96 line files to 22,170 (21,116 of them from npm pack in the setup's pack step); appending each flush to one file per process, or measuring a full run again, would keep the description's recording and merge figures honest.
  • Miss: a test that reads a shared base theme inherits every mark of the test that built it, so in a recording theme-eject-editor-base always ran because theme-cut-short, which built its theme, drew with a browser; building each shared theme under its own recorder owner would keep those tests selectable.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0).
  • Claim: with no usable record the legs run today's set: verified (fs-guard-tests.mjs:492-517, picker tests in test-inputs-workflow.test.mjs).
  • Claim: one job picks the record and a leg that cannot read it fails: verified (ci.yml download step without continue-on-error, wiring test).
  • Claim: safety rules 1 to 4 and 6: verified in select.mjs, fs-guard-tests.mjs and the wiring tests.
  • Claim: rule 5 (a non-Node program, a shell, or a child or worker without the recorder makes its test run): verified (test-inputs.test.mjs, 15 of 15).
  • Claim: Node children and worker threads record under the same test file: verified (worker case passes; a worker terminated after it answers keeps its read).
  • Claim: the replay savings (about 19 runner-minutes, 37% of pull requests, 23 of 388, 124 of 1,585): not checked (needs a full recording); the theme cache step no longer forces those tests, but the base-theme note above still can.
  • Claim: recording costs about 8% CPU, the merge 3.5 GB and under two minutes, the record about 5 MB: not checked; measured before this head, which writes far more line files.
  • Claim: the listed workflow and test-inputs test files pass: verified for the 9 files run here (286 tests).
  • Files: record.mjs (line-volume note), merge.mjs (base-theme note), test-inputs.test.mjs (clear), select.mjs (clear), setup.mjs (clear), fs-guard-tests.mjs (clear), test-inputs-pick.cjs (clear), skipped-test-alarm.cjs (clear), main-run-commit.cjs (clear), release-check-receipt.mjs (clear), test-inputs-workflow.test.mjs (clear), ci.yml (clear), deploy.yml (clear), vitest.config.ts (clear), vitest.global-setup.node.mjs (clear), docs/specs/AST-030/spec.md (held for the owner decision), and the five changed CI contract tests (clear).

Automated review (maintainer link)

Comment thread scripts/test-inputs/record.mjs Resolved
if (pkg != null) {
if (from.unseen.length > 0) trees.add(`${pkg}/`);
} else {
for (const value of from.unseen) unseen.add(value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (Miss): a test that reads what another test made inherits all of that test's unseen marks, not only those of the build it read. In a recording, theme-eject-editor-base read theme-butter.built that theme-cut-short built in the shared base-themes folder and inherited cut-short's "runs chromium-browser", so it always runs; on Main, with real renders and Chrome on the runners, which theme editor tests stay selectable depends on which test builds each base theme first. Building each shared theme under its own recorder owner (a step:base-theme-<name> switch around the build in real-base-themes.mjs) would keep the build's inputs apart.

…theme builds as its own step

- Each process and thread appends its lines to one file, so a recording no
  longer writes a file per flush; a line a killed process cut short reads
  as one its owner cannot see.
- The recorder records a run for a named step (as), and a shared base theme
  builds under it, so a test that links the build depends on what the build
  read, not on everything its builder did.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision on the spec:AST-030 change; no blocking defect remains at this head.

Spec decision. This pull request intentionally narrows spec:AST-030 FR13 and DEC-6, which today run every file-reading test on a pull request, through the new DEC-31 (the recording on Main, the record picker, the skip rules and the alarm). An engineering owner records the decision by commenting /approve-spec <full head SHA> on the head that will merge, or rejects it; the author may do so if they are an engineering owner.

The line-file volume is fixed at this head (one line file per process and thread instead of one per flush), and CI found no room at this head, so its test jobs still need to run.

Non-blocking:

  • A shared base theme now builds under its own step, but the lock and the .built mark in real-base-themes.mjs are still written by the test that built it, so a test that links the theme still inherits that test's marks (when theme-cut-short builds butter first, theme-eject-editor-base inherits its browser mark and always runs); creating the lock, building and writing the mark under the step would keep such tests selectable.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0).
  • Claim: with no usable record the legs run today's set: verified (fs-guard-tests.mjs:492-517, picker tests in test-inputs-workflow.test.mjs).
  • Claim: one job picks the record and a leg that cannot read it fails: verified (ci.yml download step without continue-on-error, wiring test).
  • Claim: safety rules 1 to 4 and 6: verified in select.mjs, fs-guard-tests.mjs and the wiring tests.
  • Claim: rule 5 (a non-Node program, a shell, or a child or worker without the recorder makes its test run): verified (test-inputs.test.mjs, 16 of 16).
  • Claim: Node children and worker threads record under the same test file: verified (worker and forked-child cases pass).
  • Claim: the global setup records each of its parts as a step: verified (the global setup's step switches).
  • Claim: a test that read a step's output inherits that step's inputs, and one that read a package's build output depends on the whole package: verified (recordings; merge.mjs maker and package-tree rules).
  • Claim: the replay savings (about 19 runner-minutes, 37% of pull requests, 23 of 388, 124 of 1,585): not checked (needs a full recording).
  • Claim: recording costs about 8% CPU, the merge 3.5 GB and under two minutes, the record about 5 MB: not checked; measured before this head.
  • Claim: the listed workflow and test-inputs test files pass: verified for the 9 files run here (287 tests).
  • Files: docs/specs/AST-030/spec.md (held for the owner decision), scripts/test-inputs/record.mjs (clear), scripts/test-inputs/merge.mjs (clear), packages/cli/test-utils/real-base-themes.mjs (base-theme mark note), scripts/test-inputs/select.mjs (clear), scripts/test-inputs/setup.mjs (clear), scripts/test-inputs/test-inputs.test.mjs (clear), .github/scripts/fs-guard-tests.mjs (clear), .github/scripts/lib/test-inputs-pick.cjs (clear), .github/scripts/lib/skipped-test-alarm.cjs (clear), scripts/lib/main-run-commit.cjs (clear), scripts/release/release-check-receipt.mjs (clear), .github/scripts/test-inputs-workflow.test.mjs (clear), .github/workflows/ci.yml (clear), .github/workflows/deploy.yml (clear), vitest.config.ts (clear), vitest.global-setup.node.mjs (clear), the five changed CI contract tests (ci-admission, ci-heavy-lanes, ci-node-leg-bounds, ci-test-routing, main-validation-workflow) (clear).

Automated review (maintainer link)

await (recording
? recording.as(`step:base-theme-${like}`, build)
: build());
fs.writeFileSync(done, '');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: the build above now runs under step:base-theme-<like>, but this mark (and the lock at line 118) is still written under the test that built the theme, and every other test that links it reads the mark (lines 115 and 122-124). merge.mjs then gives that reader all of the builder's inputs and unseen marks: in a one-worker recording, theme-eject-editor-base read theme-butter.built written by theme-cut-short and inherited its "runs chromium-browser", so it runs on every pull request; with the mark and the lock credited to the step, its record has no unseen mark. Making the lock, the build, the mark and the lock's removal one function run under recording.as(...) keeps readers to the build's inputs.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Paused while CI changes are on hold; will reopen when that work resumes.

@github-actions
github-actions Bot deleted the ci/test-inputs branch November 20, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — ad6fb4f0 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant