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

fix: scope the Windows dependency escalation to workspaces it installs (#12283)

[._.]/ Adam Eivyc1bf8dd52f7a
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index 47b2a8b5f8..68abb4fe96 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -95,6 +95,13 @@ const fansOut = (runner, { mode, files }, excludedFiles) => {
const DEPENDENCY_MANIFEST_RE = /^(?:package|server\/package|client\/package|autofixer\/package)(?:-lock)?\.json$/;
+// Workspaces the windows-server job installs (`npm ci --prefix <dir>`). Only
+// their manifests and .npmrc can change what that job runs, so a dependency or
+// npm-config change elsewhere keeps the Windows baseline. ci-test-plan.test.js
+// pins this list to the job's install steps in ci.yml.
+export const WINDOWS_INSTALLED_WORKSPACES = ['server'];
+const windowsInstalls = (path) => WINDOWS_INSTALLED_WORKSPACES.some((dir) => path.startsWith(`${dir}/`));
+
// Packages whose installed files differ per platform although their lockfile
// entry may carry no os/cpu/install-script metadata: runtime dispatchers that
// pick a prebuilt binary (their per-platform children ARE os/cpu-tagged, and
@@ -1006,7 +1013,13 @@ function buildSuitePlan(changedFiles, {
.flatMap((path) => FULL_TRIGGER_RULES
.filter(({ re }) => re.test(path))
.map(({ reason, windowsEscalates }) => {
- if (windowsEscalates !== 'dependencies') return { path, reason, windowsEscalates };
+ const scopedToWindows = windowsEscalates === 'dependencies' || (windowsEscalates === true && /(?:^|\/)\.npmrc$/.test(path));
+ if (!scopedToWindows) return { path, reason, windowsEscalates };
+ if (!windowsInstalls(path)) {
+ dependencyVerdicts.push(`${path} keeps the Windows baseline: the Windows job does not install that workspace`);
+ return { path, reason, windowsEscalates: false };
+ }
+ if (windowsEscalates === true) return { path, reason, windowsEscalates };
const verdict = dependencyChanges[path] ?? escalated('no manifest comparison available');
dependencyVerdicts.push(describeDependencyVerdict(path, verdict));
return { path, reason, windowsEscalates: verdict.escalate };
diff --git a/scripts/ci-test-plan.test.js b/scripts/ci-test-plan.test.js
index 8709bb9f7c..a26c33e205 100644
--- a/scripts/ci-test-plan.test.js
+++ b/scripts/ci-test-plan.test.js
@@ -19,6 +19,7 @@ import {
BROWSER_SUITES,
buildCiTestPlan,
classifyDependencyChange,
+ WINDOWS_INSTALLED_WORKSPACES,
collectPlanInputs,
emitGitHubPlan,
forceFullReasonFor,
@@ -1000,7 +1001,7 @@ describe('CI test impact planner', () => {
});
it('keeps an independent lockfile full-CI trigger authoritative', () => {
- const plan = buildCiTestPlan([REVIEW_LOOP_SNAPSHOT, 'package-lock.json'], {
+ const plan = buildCiTestPlan([REVIEW_LOOP_SNAPSHOT, 'server/package-lock.json'], {
trackedFiles: [...REVIEW_LOOP_TRACKED, ...WINDOWS_CONTRACT_TESTS],
});
@@ -1494,7 +1495,7 @@ describe('Windows escalation on a full plan (#7440)', () => {
expect(plan(['client/src/App.jsx']).windowsMode).toBe('files');
// package-lock.json carries no manifest comparison here, so it fails closed.
- for (const escalating of ['server/index.js', 'package-lock.json', '.npmrc']) {
+ for (const escalating of ['server/index.js', 'server/package-lock.json', 'server/.npmrc']) {
const combined = plan(['client/src/App.jsx', escalating]);
expect(combined.reason, escalating).toContain('client composition root changed');
expect(combined.windowsMode, escalating).toBe('full');
@@ -1834,7 +1835,7 @@ describe('dependency manifest Windows escalation', () => {
// The lockfile mirrors engines into its root entry.
expect(classifyDependencyChange(LOCK, BASE, lockfile(BASE_PACKAGES, { engines: { node: '>=26' } })).escalate).toBe(true);
- for (const npmrc of ['.npmrc', 'server/.npmrc']) {
+ for (const npmrc of ['server/.npmrc']) {
const plan = planFor([npmrc], {});
expect(plan.full, npmrc).toBe(true);
expect(plan.reason, npmrc).toContain('npm configuration changed');
@@ -1842,6 +1843,27 @@ describe('dependency manifest Windows escalation', () => {
}
});
+ it('keeps the Windows baseline for platform-sensitive changes in workspaces the job does not install', () => {
+ const unsafe = lockfile({ ...BASE_PACKAGES, 'node_modules/@scope/binding-win32-x64': { version: '1.0.0', os: ['win32'], cpu: ['x64'] } });
+ for (const path of ['package-lock.json', 'client/package-lock.json', 'autofixer/package-lock.json']) {
+ const plan = planFor([path], { [path]: classifyDependencyChange(path, BASE, unsafe) });
+ expect(plan.full, path).toBe(true);
+ expect(plan.windowsMode, path).toBe('files');
+ expect(plan.suiteReasons.windows, path).toContain('the Windows job does not install that workspace');
+ }
+ for (const path of ['.npmrc', 'client/.npmrc']) {
+ expect(planFor([path], {}).windowsMode, path).toBe('files');
+ }
+ // The same diff in the server lockfile still escalates.
+ expect(lockPlan(unsafe).windowsMode).toBe('full');
+ });
+
+ it('pins the Windows-installed workspaces to the windows-server install steps in ci.yml', () => {
+ const job = workflowJobs(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '.github', 'workflows', 'ci.yml'), 'utf8'))['windows-server'];
+ const installed = [...job.matchAll(/npm (?:ci|install)\b[^\n]*/g)].map(([cmd]) => cmd.match(/--prefix\s+(\S+)/)?.[1] ?? '.');
+ expect(installed.sort()).toEqual([...WINDOWS_INSTALLED_WORKSPACES].sort());
+ });
+
it('runs the shared server contracts as a full plan on the Windows baseline', () => {
for (const path of ['server/lib/validation.js', 'server/lib/schemaVersions.js']) {
const plan = planFor([path], {});