* ci: trace shared script modules to the tests that import them
A pull request that changed any scripts/lib module ran the complete
suite. Shared script modules now pass a change through to the tests,
verifiers and other shared modules that import them, like test helpers.
Another consumer (a build or test-runner script, root configuration,
package metadata, a hook or a workflow) that imports the module or names
it by file name still selects the complete suite.
The tracing core is exported as traceAffectedTests so a bounded local
gate can reuse it.
Fixes#11381
* ci: follow verifier source loads and named verifiers when tracing script modules
- Module URLs (new URL("./x.mts", import.meta.url), as loaded by
importVerifierSource) are import edges.
- A test that names a verifier or shared module the change reaches is
selected, not only one that names a changed path.
- A changed shared module that no test reaches runs the complete suite
even when other changes select tests.
* ci: select tests that start the built server beside a changed presentation owner (#11519)
* ci: select tests that start the built server beside a changed presentation owner
A test that starts the built CLI or MCP server reaches server, contract,
entrypoint and CLI modules through the build, not an import, so a change
there selected none of them (#11146 failed on main this way). Such a
test is now selected when it, or a helper it imports, starts
scripts/rea.mjs or dist/, and it imports a module from the changed
owner's directory.
Fixes#11366
* ci: recognise only the repository's built entry points as runtime launchers
A package subpath such as ajv/dist/2020.js matched the dist/ pattern, so
in-process tests importing Ajv counted as built-runtime launchers.
* ci: balance selected test shards by recorded duration (#11522)
A selected PR run split its files across groups round-robin, so a few
slow files could land together. The plan now records the selected files
and a shard count (version 3), and each job runs one --shard of the
selection through the exact-test runner with the timing history main
already publishes, so the CI sequencer balances shards by per-file
duration (the median for files without a timing). Without history,
Vitest's own deterministic sharding applies.
Fixes#11382
On the fast tier a shared-boundary file selected a provider lane only
when exactly one lane matched it. Lanes that cover src/process/** by
directory glob counted as matches too, so a file one lane names
explicitly (src/process/RegularFileRead.ts for agentenv, moved there in
#11299) selected no lane. Only patterns without ** now count as owners;
files several lanes name still run code and runtime only on the fast
tier.
Fixes#11404
* ci: run only the affected portable tests on pull requests
Pull-request CI now runs static checks, the build and the portable tests a change affects, selected from test imports (through test-only helpers), same-stem and directory-scanning tests, leaf-owner boundary tests and tests that name a changed path. Shared boundaries, untraced inputs, empty selections and selections above 150 files fall back to the complete fast suite. Main pushes, schedules, releases and ci:full keep the complete suite. The portable report verifies the exact selected inventory and the CI required gate accepts a selected plan only for a fast pull request with code changes.
* ci: own leaf-adapter tests by name and keep subset summaries diagnostic
The repository is user-owned, and GitHub offers merge queues only to organization-owned repositories, so no merge_group event can occur. Revert what 5efaedda88 (#11297) added only for merge groups. Reapply that commit if the repository moves to an organization.
* ci: run required checks on merge-queue groups
Add the merge_group trigger to CI and PR title validation so every required
check reports on the queued group's exact head. Group runs use exact-head
concurrency groups that pushes cannot cancel, classify the group's combined
diff from its base (a non-ancestor base fails planning), and keep the CI
required gate running when a group is cancelled so it fails instead of
reporting a skipped check. Title validation checks every squash commit
subject between the group base and head.
* ci: read the merge-group comparison from a file
* refactor(ci): plan change scopes through an injectable Git owner
ciChangeScope.test.ts spent about five processes per case (copy the seed
repository, git add, commit and rev-parse, then node plan.mjs with its own
merge-base and diff) to ask which lanes a path selects. Move the planner
into change-plan.mjs as planChanges(request, repository), keep plan.mjs as
the workflow entrypoint over gitRepository(), and answer the path and
package-script tables from an in-memory commit. History, renames,
deletions, push baselines, malformed metadata and GITHUB_OUTPUT keep the
Git fixture or the spawned entrypoint.
378 tests: 30.6 s elapsed and 32.6 s CPU before, 4.0 s and 4.0 s after.
* test(ci): cover workflow environment wiring through the plan entrypoint