Skip to content

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

ci: install the autofixer workspace so a broken lockfile cannot ship green (#5779)

Adam Eivyefbf6d1d49a4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dc9a4f2be4..bab7471dfb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -247,6 +247,30 @@ jobs:
vitest-server-${{ runner.os }}-${{ hashFiles('server/package-lock.json') }}-
vitest-server-${{ runner.os }}-
+ # `autofixer/` is a real install target — its own package.json, its own
+ # tracked lockfile, its own .npmrc — installed by `npm run setup` and by
+ # scripts/ensure-deps.js on every `npm start`. Nothing else in CI resolves
+ # it, so a lockfile that no longer installs (a yanked version, a corrupted
+ # integrity hash, a manifest/lockfile mismatch) would ship green and only
+ # break on a user's machine at setup time. The parity assertions in
+ # server/dependency-overrides.test.js are static — they parse the JSON;
+ # only `npm ci` proves the tree still resolves.
+ #
+ # Deliberately uncached and deliberately ungated within the job: a cache
+ # hit that skipped the install would skip the very check this step exists
+ # for, and the job as a whole already gates on the planner's server_mode
+ # (autofixer/ is one of the server runner's roots in ci-test-plan.js, so a
+ # change here selects this job). Unlike the once-only steps that pin to
+ # shard 1, it runs on every shard: autofixer/*.test.js is globbed by the
+ # server runner, and which shard picks up a file that imports `express` is
+ # not knowable from here. 67 packages, well under a second.
+ #
+ # No rebuild step follows. autofixer/.npmrc pins ignore-scripts=true and
+ # scripts/trusted-rebuilds.js deliberately lists no rebuilds for this
+ # workspace, because nothing it depends on ships a native addon.
+ - name: Install autofixer dependencies
+ run: npm ci --prefix autofixer
+
- name: Check server entry-point syntax
run: node --check server/index.js
diff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.md
index eceb636aed..83d57f88d1 100644
--- a/docs/GITHUB_ACTIONS.md
+++ b/docs/GITHUB_ACTIONS.md
@@ -213,7 +213,13 @@ The selected work is split across parallel jobs:
the server on the same job when server source changed (the smoke path uses the
file backend under `NODE_ENV=test` and does not need Postgres). The install
and the native-addon rebuild are skipped when a `server/node_modules` cache is
- restored and its trusted-rebuild mark checks out.
+ restored and its trusted-rebuild mark checks out. This job also runs
+ `npm ci --prefix autofixer` — uncached and never skipped, because resolving
+ that workspace's tracked lockfile *is* the check. It is the only CI step that
+ installs `autofixer/`, which `npm run setup` and `scripts/ensure-deps.js`
+ install on every user's machine; without it a lockfile that stopped resolving
+ shipped green and failed at setup time. (`browser/` gets no such step: zero
+ dependencies, 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 bundle budget run on shard 1 only.
diff --git a/scripts/ci-base-sha.test.js b/scripts/ci-base-sha.test.js
index 97325c6888..15b579344e 100644
--- a/scripts/ci-base-sha.test.js
+++ b/scripts/ci-base-sha.test.js
@@ -215,3 +215,39 @@ describe('ci.yml server node_modules cache', () => {
}
});
});
+
+describe('ci.yml autofixer workspace install', () => {
+ const jobs = workflowJobs(WORKFLOW);
+
+ /** Every job that resolves the autofixer lockfile. */
+ const installers = Object.entries(jobs)
+ .filter(([, body]) => body.includes('npm ci --prefix autofixer'));
+
+ it('resolves the autofixer lockfile on the job that runs the server suite', () => {
+ // autofixer/ carries its own package.json, its own tracked lockfile, and
+ // its own .npmrc, and `npm run setup` / scripts/ensure-deps.js install it
+ // on every user's machine. When no CI job ran `npm ci` against it, a
+ // lockfile that stopped resolving shipped green and failed at setup time
+ // instead — the static parity checks in dependency-overrides.test.js only
+ // parse the JSON. The server job is the one that already globs
+ // autofixer/*.test.js, so it is where the tree belongs.
+ // Named, so the loop below is never vacuously green on a deleted step.
+ expect(jobs.server).toMatch(/- name: Install autofixer dependencies\n {8}run: npm ci --prefix autofixer/);
+ });
+
+ it('never lets a cache hit skip the resolution it exists to prove', () => {
+ // The server tree is cached and its `npm ci` is skipped on a hit, which is
+ // fine because that job's job is to run tests. This step's whole purpose is
+ // the install, so caching it (or gating it on a cache outcome) would put
+ // the hole straight back. The job-level `server_mode != 'skip'` is what
+ // keeps a docs-only plan from paying for it.
+ for (const [id, body] of installers) {
+ const step = body.match(
+ /- name: Install autofixer dependencies\n(?<between>(?: {8}.*\n)*?) {8}run: npm ci --prefix autofixer/,
+ );
+ expect(step, id).not.toBeNull();
+ expect(step.groups.between, id).not.toMatch(/^ {8}if:/m);
+ expect(body, id).not.toMatch(/path: autofixer\/node_modules/);
+ }
+ });
+});