Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
stop client shard 1 going red on a different timing-sensitive test each CI run (#7448)
[._.]/ Adam Eivy187ec65b05e8
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 7e65f7e290..9efdbbe22b 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -325,10 +325,11 @@ jobs:run: node scripts/cancel-current-ci-run.jsclient:- # Sharded like the server job; lint, build, and the bundle budget run on shard 1.+ # Sharded like the server job; the build and the bundle budget run on shard 1.+ # Lint is deliberately NOT here — it has its own job (see #7448).name: Client tests and build (${{ matrix.shard }}/${{ strategy.job-total }})needs: impact- if: needs.impact.outputs.client_mode != 'skip' || needs.impact.outputs.build == 'true' || needs.impact.outputs.lint_mode != 'skip'+ if: needs.impact.outputs.client_mode != 'skip' || needs.impact.outputs.build == 'true'runs-on: ubuntu-lateststrategy:matrix:@@ -368,13 +369,6 @@ jobs:vitest-client-${{ runner.os }}-${{ hashFiles('client/package-lock.json') }}-vitest-client-${{ runner.os }}-- - name: Lint client- if: needs.impact.outputs.lint_mode != 'skip' && matrix.shard == 1- env:- CI_LINT_MODE: ${{ needs.impact.outputs.lint_mode }}- CI_LINT_FILES: ${{ needs.impact.outputs.lint_files }}- run: node scripts/run-ci-lint.js-- name: Run client testsif: needs.impact.outputs.client_mode != 'skip'env:@@ -401,6 +395,55 @@ jobs:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}run: node scripts/cancel-current-ci-run.js+ lint:+ # Its own job rather than a step on client shard 1. Lint is unrelated to the+ # tests, and pinning it there made the largest client shard the heaviest job+ # in the matrix — it paid for lint before it even started testing, on the one+ # shard that also builds (issue #7448). Splitting it also stops a lint-only+ # diff from spinning up a whole client test job to run Biome.+ #+ # It cannot instead move to a LATER shard: a scoped plan emits+ # `client_shards: [1]`, so a pin to the second shard would silently skip lint+ # on every impact-scoped pull request.+ #+ # It installs `client/` because Biome and its GritQL plugins are client+ # devDependencies; the npm cache makes that a few seconds.+ name: Lint client+ needs: impact+ if: needs.impact.outputs.lint_mode != 'skip'+ runs-on: ubuntu-latest+ permissions:+ contents: read+ actions: write+ steps:+ - uses: actions/checkout@v7+ with:+ persist-credentials: false+ # Same as every other leaf job: depth 2 is the whole PR merge ref.+ fetch-depth: 2++ - name: Use Node.js 24.x+ uses: actions/setup-node@v7+ with:+ node-version: 24.x+ cache: npm+ cache-dependency-path: client/package-lock.json++ - name: Install client dependencies+ run: npm ci --prefix client++ - name: Lint client+ env:+ CI_LINT_MODE: ${{ needs.impact.outputs.lint_mode }}+ CI_LINT_FILES: ${{ needs.impact.outputs.lint_files }}+ run: node scripts/run-ci-lint.js++ - name: Cancel sibling CI jobs after failure+ if: failure() && github.event_name == 'pull_request'+ env:+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ run: node scripts/cancel-current-ci-run.js+database:name: DB testsneeds: impact@@ -680,7 +723,7 @@ jobs:gate:name: CI Gateif: always()- needs: [impact, server, client, database, windows-server]+ needs: [impact, server, client, lint, database, windows-server]runs-on: ubuntu-lateststeps:# The gate needs the repo only for scripts/ci-gate-report.js, which@@ -705,6 +748,7 @@ jobs:CI_GATE_RESULT_IMPACT: ${{ needs.impact.result }}CI_GATE_RESULT_SERVER: ${{ needs.server.result }}CI_GATE_RESULT_CLIENT: ${{ needs.client.result }}+ CI_GATE_RESULT_LINT: ${{ needs.lint.result }}CI_GATE_RESULT_DATABASE: ${{ needs.database.result }}CI_GATE_RESULT_WINDOWS_SERVER: ${{ needs.windows-server.result }}run: node scripts/ci-gate-report.jsdiff --git a/client/src/components/messages/BeeperTab.test.jsx b/client/src/components/messages/BeeperTab.test.jsxindex 88858dbc05..c1c9aafee2 100644--- a/client/src/components/messages/BeeperTab.test.jsx+++ b/client/src/components/messages/BeeperTab.test.jsx@@ -1440,7 +1440,11 @@ describe('purging one conversation mirror', () => {it('names the conversation and the byte count, and demands the typed word first', async () => {await openThread();- expect(await screen.findByText('Purge this mirror', {}, { timeout: 15000 })).toBeInTheDocument();+ // No inline timeout: an inline bound at or above the per-test budget can+ // never be reached, so the 15000 that used to sit here read as a fix and was+ // not one — the test died at vitest's 5s default naming nothing (#7448). The+ // suite-wide async budget in src/test/timeouts.js is what governs this wait.+ expect(await screen.findByText('Purge this mirror')).toBeInTheDocument();expect(screen.getByText(/4 MB of mirrored attachment bytes/)).toBeInTheDocument();expect(screen.getByText(/across 3 file\(s\)/)).toBeInTheDocument();diff --git a/client/src/pages/Media3DDetail.test.jsx b/client/src/pages/Media3DDetail.test.jsxindex bbd717403e..e7bb1ff935 100644--- a/client/src/pages/Media3DDetail.test.jsx+++ b/client/src/pages/Media3DDetail.test.jsx@@ -1,6 +1,6 @@import { describe, it, expect, vi, beforeEach } from 'vitest';import { useEffect, useRef } from 'react';-import { render, screen, fireEvent, waitFor, within } from '@testing-library/react';+import { act, render, screen, fireEvent, waitFor, within } from '@testing-library/react';import { MemoryRouter, Routes, Route, useNavigate } from 'react-router';import Media3DDetail from './Media3DDetail';@@ -92,6 +92,18 @@ function renderWithSwitcher(id = 'image3d-1') {);}+// `findByText` resolves on the DOM mutation, not on effects settling — and the+// page seeds its option fields from the record in an effect that commits AFTER+// the name renders. Proof: a record whose latest run carries `steps: 48` still+// reads back an EMPTY quality field the moment `findByText('Example Beacon')`+// resolves, which is why the seeding tests below wait for the value explicitly.+//+// A field touched inside that window is overwritten when the seed lands, so the+// re-render body carries the default instead of the choice (#7448). A record with+// no runs seeds to the same values the form starts at, so there is nothing in the+// DOM to wait for — flush the pending effect instead of waiting on its output.+const settleOptionSeed = () => act(async () => {});+function deferred() {let resolve;let reject;@@ -221,6 +233,7 @@ describe('Media3DDetail', () => {generateImageTo3dModel.mockResolvedValue(record({ status: 'generating' }));renderAt();await screen.findByText('Example Beacon');+ await settleOptionSeed();fireEvent.change(screen.getByLabelText(/quality/i), { target: { value: '24' } });fireEvent.click(screen.getByRole('button', { name: /re-render/i }));diff --git a/client/src/pages/Tribe.test.jsx b/client/src/pages/Tribe.test.jsxindex f94872c66e..7099c6dee3 100644--- a/client/src/pages/Tribe.test.jsx+++ b/client/src/pages/Tribe.test.jsx@@ -1,5 +1,5 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import { render, screen, waitFor, fireEvent } from '@testing-library/react';+import { act, render, screen, waitFor, fireEvent } from '@testing-library/react';import { MemoryRouter, useLocation, useSearchParams } from 'react-router';vi.mock('../services/api', () => ({@@ -283,6 +283,12 @@ describe('Tribe shared-identifier banner (#5908)', () => {fireEvent.click(screen.getByRole('button', { name: /dismiss shared contact info/i }));expect(screen.queryByText(/shared contact info/i)).toBeNull();+ // Nothing after the dismiss awaits, and the sibling OutreachQueue's mount+ // fetch is still in flight: when it resolves between this line and cleanup,+ // its setState lands outside act() and setup.js fails the run. Observed once+ // in a full-suite pass while chasing #7448. Settling at the END is the idiom+ // setup.js prescribes for a test that has no later await to ride on.+ await act(async () => {});});});diff --git a/client/src/pages/VideoTimelineEditor.keyboard.test.jsx b/client/src/pages/VideoTimelineEditor.keyboard.test.jsxindex 00eb8999e2..34d497e146 100644--- a/client/src/pages/VideoTimelineEditor.keyboard.test.jsx+++ b/client/src/pages/VideoTimelineEditor.keyboard.test.jsx@@ -1,5 +1,5 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import { render, screen, waitFor } from '@testing-library/react';+import { render, screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react';import { stubSequentialLayout, pressKey, dndAnnouncement } from '../test/dndKeyboardDrag';// Guards #7243. This lives in its own file rather than in VideoTimelineEditor.test.jsx@@ -68,7 +68,15 @@ afterEach(() => restoreLayout());const renderEditor = async () => {render(<VideoTimelineEditor />);- await waitFor(() => expect(screen.queryByText('Loading project…')).not.toBeInTheDocument());+ // Two-sided, and deliberately so. This used to wait for the ABSENCE of+ // 'Loading project…' — a string this page never renders — so the `waitFor`+ // passed on its very first poll and every test below ran against the loading+ // skeleton whenever the mocked fetches had not resolved yet. On a fast machine+ // they always had; on a loaded CI runner they had not, which is how one+ // timing-sensitive test went red per run (#7448). Pinning the skeleton's+ // PRESENCE first is what stops the absence from meaning nothing:+ // `waitForElementToBeRemoved` throws outright if it was never there.+ await waitForElementToBeRemoved(screen.getByLabelText('Loading timeline project'));};// The block is the drag handle, so it is reached through its own removediff --git a/client/src/pages/VideoTimelineEditor.test.jsx b/client/src/pages/VideoTimelineEditor.test.jsxindex 3e201b4987..f9274829ee 100644--- a/client/src/pages/VideoTimelineEditor.test.jsx+++ b/client/src/pages/VideoTimelineEditor.test.jsx@@ -1,5 +1,5 @@import { beforeEach, describe, expect, it, vi } from 'vitest';-import { render, screen, waitFor, fireEvent, within, act } from '@testing-library/react';+import { render, screen, waitFor, waitForElementToBeRemoved, fireEvent, within, act } from '@testing-library/react';// The editor's pure rules live in lib/videoTimelineModel.js and its blocks in// components/media/VideoTimelineLanes.jsx, both tested there. What only exists@@ -87,7 +87,15 @@ beforeEach(() => {const renderEditor = async () => {render(<VideoTimelineEditor />);- await waitFor(() => expect(screen.queryByText('Loading project…')).not.toBeInTheDocument());+ // Two-sided, and deliberately so. This used to wait for the ABSENCE of+ // 'Loading project…' — a string this page never renders — so the `waitFor`+ // passed on its very first poll and every test below ran against the loading+ // skeleton whenever the mocked fetches had not resolved yet. On a fast machine+ // they always had; on a loaded CI runner they had not, which is how one+ // timing-sensitive test went red per run (#7448). Pinning the skeleton's+ // PRESENCE first is what stops the absence from meaning nothing:+ // `waitForElementToBeRemoved` throws outright if it was never there.+ await waitForElementToBeRemoved(screen.getByLabelText('Loading timeline project'));};describe('lane visibility', () => {diff --git a/client/src/test/settledInput.js b/client/src/test/settledInput.jsindex 7d8ca62275..29d5a5d135 100644--- a/client/src/test/settledInput.js+++ b/client/src/test/settledInput.js@@ -12,9 +12,11 @@ import { expect } from 'vitest';// Pinning the settled input value in between turns a load-dependent flake into// either a pass or an honest, immediately-legible failure.-// The timeout `waitFor` uses here comes from the suite-wide-// `configure({ asyncUtilTimeout: 3000 })` in setup.js — testing-library's 1000ms-// default is too tight for these under parallel-worker CPU contention.+// The timeout `waitFor` uses here is the suite-wide `asyncUtilTimeout` configured+// in setup.js from src/test/timeouts.js — testing-library's 1000ms default is too+// tight for these under parallel-worker CPU contention. Deliberately NOT overridden+// per call: a local bound here would silently become the TIGHTER of the two the+// next time the suite-wide budget moves.const settled = (input, value) => waitFor(() => expect(input).toHaveValue(value));// A `type="number"` input reads its value back coerced, and empty as `null`.diff --git a/client/src/test/setup.js b/client/src/test/setup.jsindex c92c0b81e3..9705cbe10e 100644--- a/client/src/test/setup.js+++ b/client/src/test/setup.js@@ -3,14 +3,15 @@ import { afterEach } from 'vitest';import { cleanup, configure } from '@testing-library/react';import { installTestStorage } from './storagePolyfill.js';import { installFormValidityFix } from './formValidityPolyfill.js';+import { ASYNC_UTIL_TIMEOUT_MS } from './timeouts.js';-// testing-library defaults asyncUtilTimeout to 1000ms. Several views debounce at-// 500ms and a couple wait on a debounce plus a retry, so under parallel-worker CPU-// contention that budget produces phantom failures unrelated to the component-// under test (#3474; settledInput.js hit this first for `user.type()`/`user.clear()`-// + re-render settling). Raising it suite-wide beats patching one call site per-// flake — the cost is that a genuinely hung assertion takes 3s instead of 1s.-configure({ asyncUtilTimeout: 3000 });+// testing-library defaults asyncUtilTimeout to 1000ms, which is far too tight for+// this suite: several views debounce at 500ms and a couple wait on a debounce plus+// a retry, so under parallel-worker CPU contention that budget produces phantom+// failures unrelated to the component under test (#3474). The value and its+// relationship to the per-test budget in vitest.config.js live in timeouts.js —+// they are derived from one another on purpose, so read that before changing it.+configure({ asyncUtilTimeout: ASYNC_UTIL_TIMEOUT_MS });// Guarantee a working localStorage/sessionStorage before any test runs, regardless// of how the environment exposes Storage. See storagePolyfill.js / #1438.diff --git a/client/src/test/timeouts.js b/client/src/test/timeouts.jsnew file mode 100644index 0000000000..4068de1621--- /dev/null+++ b/client/src/test/timeouts.js@@ -0,0 +1,35 @@+/**+ * The client suite's two time budgets, defined in ONE place so they can never+ * drift into equality.+ *+ * `ASYNC_UTIL_TIMEOUT_MS` bounds every Testing Library async utility —+ * `waitFor`, `findBy*`, and the `settledInput.js` helpers built on them.+ * `TEST_TIMEOUT_MS` bounds the whole test. The ORDER matters more than either+ * value: an inner bound that meets or exceeds the per-test budget can never+ * report its own failure, because the test dies first with a bare "test timed+ * out" naming nothing. That trap has been hit twice here — `WordplayTrainer`'s+ * 5s drill bound against vitest's 5s default, and `BeeperTab`'s `{ timeout:+ * 15000 }` band-aid, which could never wait more than 5s and so never helped.+ *+ * Values, and why:+ * - 5000ms async. Testing Library defaults to 1000ms; this suite ran at 3000+ * (#3474) because several views debounce at 500ms and some wait on a+ * debounce plus a retry. `client/vitest.config.js` already documented 3s as+ * marginal on the 2-vCPU public runner — that comment is why the client+ * worker cap is 2 — and shard 1 sat over the line: a different `await`-a-+ * mock-call assertion went red on most CI runs while passing locally every+ * time (#7448). A loaded runner should make a test SLOWER, not red.+ * - 15000ms per test, derived as 3x. Large enough that the async bound above+ * always gets to speak, small enough that a genuinely hung test still ends+ * the job. A real hang still reports in ~5s, from the async utility, naming+ * what it was waiting for; the extra 10s is headroom, not latency.+ *+ * Raising the async budget is NOT a substitute for fixing an ordering race. It+ * buys a slow runner room; it cannot rescue an assertion that is waiting on a+ * call which already happened with the wrong argument. See+ * `client/src/test/settledInput.js` for that half.+ */+export const ASYNC_UTIL_TIMEOUT_MS = 5000;++/** Derived, never written as a literal — equality is the failure mode. */+export const TEST_TIMEOUT_MS = ASYNC_UTIL_TIMEOUT_MS * 3;diff --git a/client/src/test/timeouts.test.js b/client/src/test/timeouts.test.jsnew file mode 100644index 0000000000..2802b9a57b--- /dev/null+++ b/client/src/test/timeouts.test.js@@ -0,0 +1,56 @@+import { readFileSync } from 'fs';+import { dirname, join } from 'path';+import { fileURLToPath } from 'url';++import { describe, expect, it } from 'vitest';++import { trackedTestFiles } from './trackedFiles.js';+import { ASYNC_UTIL_TIMEOUT_MS, TEST_TIMEOUT_MS } from './timeouts.js';++const CLIENT_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..');++/**+ * A lone-key `{ timeout: N }` — the shape `waitFor(fn, { timeout })` and+ * `findBy*(text, {}, { timeout })` take. Deliberately does NOT match a fixture+ * object that carries a `timeout` field beside other keys (the provider records+ * in `src/utils/providers.test.js` hold `{ id, timeout }`), which is data rather+ * than an async bound.+ */+const LONE_TIMEOUT_OPTION = /\{\s*timeout:\s*([\d_]+)\s*\}/g;++describe('client suite time budgets', () => {+ it('leaves the async bound strictly inside the per-test budget', () => {+ // Equality is the failure mode, not just excess: a `waitFor` bounded at+ // exactly the per-test budget loses the race to report its own failure, and+ // the run shows a bare "test timed out" naming nothing.+ expect(TEST_TIMEOUT_MS).toBeGreaterThan(ASYNC_UTIL_TIMEOUT_MS);+ });++ it("gives a slow runner real headroom over testing-library's default", () => {+ // Pins the intent rather than the exact number: the whole point of #7448 is+ // that 1000ms (the library default) and the 3000ms this suite ran at both+ // sat under what a 2-vCPU public runner needs for an `await`-a-mock-call+ // assertion, so shard 1 went red on most runs while passing locally.+ expect(ASYNC_UTIL_TIMEOUT_MS).toBeGreaterThanOrEqual(5000);+ });++ it('has no inline async bound that the per-test budget would cut short', () => {+ // An inline `{ timeout: N }` at or above the per-test budget is inert: the+ // test dies first, so the extended wait never happens and the failure names+ // nothing. `BeeperTab.test.jsx` carried `{ timeout: 15000 }` against a+ // 5000ms budget for exactly this reason (#7448) — it read as a fix and was+ // not one. A file that genuinely needs longer raises BOTH, through+ // `vi.setConfig({ testTimeout })`, so those files are skipped here.+ const offenders = [];+ for (const file of trackedTestFiles(CLIENT_ROOT)) {+ const source = readFileSync(join(CLIENT_ROOT, file), 'utf8');+ if (source.includes('vi.setConfig(')) continue;+ for (const [, digits] of source.matchAll(LONE_TIMEOUT_OPTION)) {+ if (Number(digits.replace(/_/g, '')) >= TEST_TIMEOUT_MS) {+ offenders.push(`${file}: { timeout: ${digits} }`);+ }+ }+ }+ expect(offenders).toEqual([]);+ });+});diff --git a/client/src/test/trackedFiles.js b/client/src/test/trackedFiles.jsindex 79b12fd91a..c40906cd52 100644--- a/client/src/test/trackedFiles.js+++ b/client/src/test/trackedFiles.js@@ -39,3 +39,14 @@ export function trackedJsxFiles(clientRoot) {export function trackedSourceFiles(clientRoot) {return gitTracked(clientRoot).filter((f) => /\.jsx?$/.test(f) && !isTest(f));}++/**+ * Git-tracked TEST files under `client/src` — the inverse of the filters above,+ * for a guard whose subject is the tests themselves rather than the app code+ * (`src/test/timeouts.test.js` polices inline async bounds that the per-test+ * budget would cut short). Kept here so "which files count" still has exactly+ * one definition.+ */+export function trackedTestFiles(clientRoot) {+ return gitTracked(clientRoot).filter((f) => /\.test\.[jt]sx?$/.test(f));+}diff --git a/client/vitest.config.js b/client/vitest.config.jsindex 4c6db6338e..d1681681a6 100644--- a/client/vitest.config.js+++ b/client/vitest.config.js@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';import react from '@vitejs/plugin-react';import { vitestCiPool } from '../scripts/vitestCiPool.js';+import { TEST_TIMEOUT_MS } from './src/test/timeouts.js';export default defineConfig({plugins: [react()],@@ -10,10 +11,14 @@ export default defineConfig({dedupe: ['three'],},test: {- // Four DOM workers exhausted Testing Library's existing 3s async budget- // on the public runner before ChiefOfStaff's config panel settled. Keep the- // proven two-worker client cap; the Node/server runner uses all four CPUs.+ // Four DOM workers exhausted Testing Library's async budget on the public+ // runner before ChiefOfStaff's config panel settled. Keep the proven+ // two-worker client cap; the Node/server runner uses all four CPUs....vitestCiPool({ maxWorkers: 2 }),+ // Derived from the Testing Library async budget, never written as a literal:+ // an inner `waitFor` bound that reaches the per-test budget can never report+ // its own failure. See src/test/timeouts.js for the full reasoning.+ testTimeout: TEST_TIMEOUT_MS,// happy-dom, not jsdom (#6144): building the DOM was the client suite's// largest CI phase, and happy-dom cuts it by roughly two thirds for the same// 10k assertions. Files that need no DOM at all still opt out entirely with adiff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.mdindex 2c330919a7..cd6ca2d6b4 100644--- a/docs/GITHUB_ACTIONS.md+++ b/docs/GITHUB_ACTIONS.md@@ -353,9 +353,11 @@ suite, need no diff at all, and get no base.The `main` ruleset — which also covers `release` — requires exactly onecontext: **`CI Gate`**. The workflow used to carry two extra jobs solely to-publish historical required-check names (`lint`, which echoed the client job's-result, and `test (24.x)` on the server job); both are retired. If a required-check is ever added, require `CI Gate`, never a job name.+publish historical required-check names (a `lint` job that only echoed the+client job's result, and `test (24.x)` on the server job); both are retired. A+`lint` job exists again since #7448, but it is the real linter doing real work,+not a name-publishing shim. If a required check is ever added, require+`CI Gate`, never a job name.The selected work is split across parallel jobs:@@ -370,9 +372,18 @@ The selected work is split across parallel jobs:install on every user's machine; without it a lockfile that stopped resolvingshipped green and failed at setup time. (`browser/` gets no such step: zerodependencies, and its lockfile is deliberately gitignored.)-- **Client tests and build** — affected client tests; production build whenever- client source changed; client lint on the same install so Biome does not pay a- second `npm ci`. Lint, build, and the Scalar-removal bundle pin run on shard 1 only.+- **Client tests and build** — affected client tests, plus the production build+ whenever client source changed. Build and the Scalar-removal bundle pin run on+ shard 1 only.+- **Lint client** — Biome over the changed client sources, in its own job. It used+ to be a shard-1 step here, sharing the client install so Biome did not pay a+ second `npm ci` — but that made the largest client shard also the only one+ paying for lint AND the production build, the heaviest job in the matrix and the+ only shard that failed a timing-sensitive test (#7448). It cannot move to a later+ shard instead: a scoped plan emits `client_shards: [1]`, so a second-shard pin+ would skip lint on every scoped pull request. The second `npm ci --prefix client`+ is a few seconds off the npm cache, and a lint-only diff no longer starts a+ client test job at all.- **DB tests** — provisions only the isolated `portos_test` database and runsthe serial DB suite when database-sensitive files changed.- **Windows server tests** — the same server selection, but only on full CI@@ -413,8 +424,9 @@ Vitest's `--shard`, which slices the file list by path hash — every shard is afixed, disjoint subset, and their union is the complete suite. A scoped plannever shards (its handful of files would trip Vitest's shard-count guard) andpasses no flag at all, so its invocation stays identical to a local-`npm run test:ci`. Once-only steps — smoke boot, lint, the client build, the-Scalar-removal bundle pin — pin themselves to shard 1. `CI Gate` sees a matrix job as one+`npm run test:ci`. Once-only steps — smoke boot, the client build, the+Scalar-removal bundle pin — pin themselves to shard 1; lint is not among them,+because it has its own job (see above). `CI Gate` sees a matrix job as one`needs` result, so nothing downstream changes; public-repo runner minutes arefree, so the fan-out costs only concurrency.@@ -435,6 +447,11 @@ September 2026). A full run is **12 jobs / 28.7 runner-minutes**:| DB tests, impact, both gates | 4 | 1.7 | 1.7 || **Total** | **12** | **28.7** | **40.4** |+Measured before lint moved to its own job (#7448), so the client column still+carries the ~31 s of Biome that now runs beside it rather than inside it. The+totals barely move — lint is the same work in a different slot — but shard 1 no+longer runs it, and the matrix is 13 jobs rather than 12.+Windows is 41% of a full run's runner occupancy, and 58% once GitHub's 2x`windows-latest` multiplier is applied. **This repository is public, so thoseminutes are not billed** — the cost that binds is runner occupancy and@@ -549,7 +566,7 @@ Changes to CI/test configuration also force the full suite on their own PR.### Fail-fast sibling cancellation-Each selected leaf job (`server`, `client`, `database`, and+Each selected leaf job (`server`, `client`, `lint`, `database`, and`windows-server`) ends with an `if: failure() && github.event_name =='pull_request'` step that asks GitHub to cancel the current pull-requestworkflow run. The event guard is important because the same workflow is reuseddiff --git a/scripts/ci-base-sha.test.js b/scripts/ci-base-sha.test.jsindex d361e623d1..4d57858625 100644--- a/scripts/ci-base-sha.test.js+++ b/scripts/ci-base-sha.test.js@@ -92,11 +92,15 @@ describe('ci.yml required checks', () => {});it('no longer carries the retired legacy check-name jobs', () => {- // `lint` was a whole runner that echoed the client job's result, and the- // server job wore `test (24.x)`; the ruleset requires neither.- expect(jobs.lint).toBeUndefined();+ // The RETIRED `lint` job was a shim: a whole runner whose only step echoed+ // the client job's result, so a required check named `lint` kept reporting.+ // A `lint` job exists again, but it is the real linter in its own job+ // (#7448) — so this asserts the SHIM's shape is gone, not the name. The+ // server job likewise no longer wears `test (24.x)`; the ruleset requires+ // neither name, only `CI Gate`.+ expect(jobs.lint).toContain('run: node scripts/run-ci-lint.js');+ expect(jobs.lint).not.toContain('CLIENT_RESULT');expect(WORKFLOW).not.toMatch(/name: test \(24\.x\)/);- expect(jobs.gate).not.toMatch(/needs\.lint\b/);});});diff --git a/scripts/run-ci-tests.test.js b/scripts/run-ci-tests.test.jsindex cd26d451c2..a7aff757f7 100644--- a/scripts/run-ci-tests.test.js+++ b/scripts/run-ci-tests.test.js@@ -42,15 +42,36 @@ describe('ci.yml shard wiring', () => {});it('runs once-only steps on the first shard alone', () => {- // Smoke boot, lint, the production build, and the Scalar-removal pin are not+ // Smoke boot, the production build, and the Scalar-removal pin are not// sharded work; on every shard they would triple the cost for no coverage.- for (const step of ['Smoke-boot server', 'Lint client', 'Build client', 'Check API Explorer bundle has no Scalar chunks']) {+ for (const step of ['Smoke-boot server', 'Build client', 'Check API Explorer bundle has no Scalar chunks']) {const start = WORKFLOW.indexOf(`- name: ${step}\n`);expect(start, step).toBeGreaterThan(0);const condition = WORKFLOW.slice(start).match(/\n {8}if: (.*)\n/)[1];expect(condition, step).toMatch(/&& matrix\.shard == 1$/);}});++ it('keeps client lint out of the sharded test jobs entirely', () => {+ // Lint used to be a shard-1 step on the client job, which made the largest+ // client shard also the only one paying for Biome AND the production build —+ // the heaviest job in the matrix, and the only shard that failed a+ // timing-sensitive test (#7448). Its own job is the fix, so this pins BOTH+ // halves: no runner job invokes the linter, and the lint job is not a matrix.+ const jobs = workflowJobs(WORKFLOW);+ for (const [id, body] of runners) expect(body, id).not.toContain('run-ci-lint.js');+ expect(jobs.lint).toBeTruthy();+ expect(jobs.lint).toContain('run: node scripts/run-ci-lint.js');+ expect(jobs.lint).not.toContain('strategy:');+ expect(jobs.lint).not.toContain('matrix.shard');+ // A scoped plan emits `client_shards: [1]`, so a later-shard pin would skip+ // lint on every impact-scoped pull request. Its gate is the plan's lint mode.+ expect(jobs.lint).toContain("if: needs.impact.outputs.lint_mode != 'skip'");+ // The aggregate gate is the single required check, so a job it does not+ // observe can fail without blocking a merge.+ expect(jobs.gate).toContain('CI_GATE_RESULT_LINT: ${{ needs.lint.result }}');+ expect(jobs.gate).toMatch(/needs: \[[^\]]*\blint\b/);+ });});describe('toRunnerPath', () => {