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

address review: consult the trigger list from the App.jsx branch too

[._.]/ Adam Eivy91fb3764188b
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 568811da54..fa90acd0d2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -723,9 +723,9 @@ jobs:
# the trigger was Windows-irrelevant (see the FULL_TRIGGER_RULES
# windowsEscalates flag in the impact planner) — publishing the gate for
# one of those would vouch for Windows coverage that did not run. Every
- # force-full path
- # (nightly, push-to-main, the main -> release PR, release) keeps
- # windows_mode == 'full', so the release optimization is unaffected.
+ # force-full path — nightly, the main -> release PR, release, an explicit
+ # full-CI request — keeps windows_mode == 'full', so the release
+ # optimization is unaffected.
if: always() && needs.impact.outputs.full == 'true' && needs.impact.outputs.windows_mode == 'full'
needs: [impact, gate]
runs-on: ubuntu-latest
diff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.md
index 04e75daabf..55e7f603e6 100644
--- a/docs/GITHUB_ACTIONS.md
+++ b/docs/GITHUB_ACTIONS.md
@@ -434,20 +434,23 @@ concurrent-job slots, which is what makes several simultaneous PR builds queue.
The 2x column is kept because a fork on private billing does pay it.
**Not every full plan needs a full Windows run.** Replaying 250 merge commits
-through `buildCiTestPlan`, 64 went full — and 25 of those (39%) went full for a
+through `buildCiTestPlan`, 64 went full — and 24 of those (38%) went full for a
reason `windows-server` cannot observe:
| Full-plan reason | Runs | Windows-relevant? |
| --- | --- | --- |
| targeted test set exceeded safety cap | 17 | no — capacity, not risk |
| wide change (>30 executable files) | 6 | no — capacity, not risk |
-| client composition root / build config / lint config / test setup | 2 | no — client-only |
-| dependency manifest, server contract, CI pipeline script, workflow, … | 39 | yes |
+| client composition root / build config / lint config / test setup | 1 | no — client-only |
+| dependency manifest, server contract, CI pipeline script, workflow, … | 40 | yes |
So each full trigger in `FULL_TRIGGER_RULES` carries a `windowsEscalates` flag,
and `fullPlan()` escalates Windows to the complete server suite only when **any**
matching trigger is Windows-relevant, the diff touches `WINDOWS_RISK_RULES`, or
-the run is force-full. Otherwise the job drops to **one shard running
+the run is force-full. **Any** is load-bearing: the reason line reports only the
+first match in sorted-path order, and the `client/src/App.jsx` branch returns
+before the trigger loop, so both read the same OR over every match. A diff that
+edits `App.jsx` *and* bumps a lockfile escalates. Otherwise the job drops to **one shard running
`WINDOWS_CONTRACT_TESTS`** — reduced, never skipped, and exactly the depth a
Windows-risk scoped PR already gets.
@@ -467,20 +470,20 @@ Three properties keep that safe, each pinned by `scripts/ci-test-plan.test.js`:
downgraded PR is the next nightly — always before a release, because the
`main` → `release` PR is force-full. That is not a new exposure: it is the
same net every PR touching no `WINDOWS_RISK_RULES` file already relies on,
- which is most of them. This change widens that population by 25 runs in 250.
+ which is most of them. This change widens that population by 24 runs in 250.
**Before / after**, on the same 250-merge sample:
| | Jobs | Runner-min | 2x-equivalent |
| --- | --- | --- | --- |
-| Full run, Windows-relevant (39 of 64) — unchanged | 12 | 28.7 | 40.4 |
-| Full run, downgraded (25 of 64) — before | 12 | 28.7 | 40.4 |
-| Full run, downgraded (25 of 64) — after | **10** | **18.4** | **19.9** |
+| Full run, Windows-relevant (40 of 64) — unchanged | 12 | 28.7 | 40.4 |
+| Full run, downgraded (24 of 64) — before | 12 | 28.7 | 40.4 |
+| Full run, downgraded (24 of 64) — after | **10** | **18.4** | **19.9** |
| Per merged PR, averaged over all 250 — before | — | 10.25 | 13.78 |
-| Per merged PR, averaged over all 250 — after | — | **9.22** | **11.73** |
+| Per merged PR, averaged over all 250 — after | — | **9.26** | **11.81** |
That is −36% runner-minutes on a downgraded full run (−51% at the 2x multiplier),
-and **−10% overall runner-minutes / −15% 2x-equivalent** across the whole sample.
+and **−9.6% overall runner-minutes / −14.3% 2x-equivalent** across the whole sample.
The one estimated input is the baseline Windows shard at ~1.5 min (~0.83 min
measured fixed overhead plus the contract suite); every other figure is measured.
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index eceb281e4e..4de3d95aeb 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -558,27 +558,37 @@ export function buildCiTestPlan(changedFiles, {
return fullPlan(changed, forceFullReason, { appRouteOnly, trackedSet, windowsEscalates: true });
}
- const appCompositionChanged = changed.includes('client/src/App.jsx');
- if (appCompositionChanged && !appRouteOnly) {
- return fullPlan(changed, 'client composition root changed: client/src/App.jsx', { appRouteOnly, trackedSet, windowsEscalates: false });
- }
-
- // EVERY matching trigger, not just the reported one: the reason line is the
- // first match in sorted-path order, but the Windows decision is the OR over
- // all of them. Reporting alone would let an alphabetically earlier
- // client-only trigger (client/vite.config.js) silently downgrade the Windows
- // job on a diff that also changed server/index.js.
+ // EVERY matching trigger, not just the reported one, and computed BEFORE the
+ // first full-plan branch. The reason line is the first match in sorted-path
+ // order, but the Windows decision is the OR over all of them, so a diff that
+ // trips two triggers must escalate if EITHER does. Two ways this goes wrong
+ // if the OR is skipped: an alphabetically earlier client-only trigger
+ // (client/vite.config.js) reported ahead of server/index.js, and the App.jsx
+ // branch below returning before the triggers are even looked at — which
+ // downgraded Windows for an App.jsx PR that also bumped a lockfile.
const fullTriggers = changed
.flatMap((path) => FULL_TRIGGER_RULES
.filter(({ re }) => re.test(path))
.map(({ reason, windowsEscalates }) => ({ path, reason, windowsEscalates })));
const fullTrigger = fullTriggers.at(0);
+ const triggersEscalateWindows = fullTriggers.some((trigger) => trigger.windowsEscalates);
+
+ const appCompositionChanged = changed.includes('client/src/App.jsx');
+ if (appCompositionChanged && !appRouteOnly) {
+ // The composition root itself is client-only, but the rest of the diff may
+ // not be.
+ return fullPlan(changed, 'client composition root changed: client/src/App.jsx', {
+ appRouteOnly,
+ trackedSet,
+ windowsEscalates: triggersEscalateWindows,
+ });
+ }
if (fullTrigger) {
return fullPlan(changed, `${fullTrigger.reason}: ${fullTrigger.path}`, {
appRouteOnly,
trackedSet,
- windowsEscalates: fullTriggers.some((trigger) => trigger.windowsEscalates),
+ windowsEscalates: triggersEscalateWindows,
});
}
diff --git a/scripts/ci-test-plan.test.js b/scripts/ci-test-plan.test.js
index db91e9fe70..0cea8baf6f 100644
--- a/scripts/ci-test-plan.test.js
+++ b/scripts/ci-test-plan.test.js
@@ -870,6 +870,19 @@ describe('Windows escalation on a full plan (#7440)', () => {
expect(mixed.shards.windows).toEqual(shardIndexes('full', FULL_SUITE_SHARDS.windows));
});
+ it('consults the trigger list from the App.jsx branch too', () => {
+ // client/src/App.jsx returns before the trigger loop, so its branch has to
+ // read the same OR — otherwise an App.jsx PR that also bumps a lockfile or
+ // touches server/index.js downgrades Windows on a diff that must escalate.
+ expect(plan(['client/src/App.jsx']).windowsMode).toBe('files');
+
+ for (const escalating of ['server/index.js', 'package-lock.json', 'server/lib/validation.js']) {
+ const combined = plan(['client/src/App.jsx', escalating]);
+ expect(combined.reason, escalating).toContain('client composition root changed');
+ expect(combined.windowsMode, escalating).toBe('full');
+ }
+ });
+
it('escalates when a Windows-risk file rides along with a client-only trigger', () => {
// .ps1 is not in EXECUTABLE_RE, so risk detection must read every changed
// path, not only the executable ones.
@@ -889,9 +902,10 @@ describe('Windows escalation on a full plan (#7440)', () => {
expect(forced.shards.windows).toEqual(shardIndexes('full', FULL_SUITE_SHARDS.windows));
});
- it('fails closed for a trigger nobody classified', () => {
- // fullPlan defaults windowsEscalates to true, so a call site added later
- // without the flag over-tests rather than under-tests.
+ it('fails closed for a call site that passes no windowsEscalates flag', () => {
+ // The unclassified-file branch deliberately omits the flag, so this pins
+ // fullPlan's `windowsEscalates = true` default through a real call site: a
+ // branch added later without the flag over-tests rather than under-tests.
const unclassified = plan(['data.reference/bootstrap.bin']);
expect(unclassified.full).toBe(true);
@@ -948,14 +962,23 @@ describe('Windows escalation on a full plan (#7440)', () => {
expect(uncovered).toEqual([]);
});
- it.each(RISK_SAMPLES)('routes %s to the Windows job', (path) => {
- expect(plan([path]).windows).toBe(true);
+ it.each(RISK_SAMPLES)('gives %s the complete Windows suite, never the baseline', (path) => {
+ // Differential, so it stays load-bearing for every sample. Asserting
+ // `windows === true` on `plan([path])` alone would be vacuous for
+ // .ps1/.cmd/.bat: those are not in EXECUTABLE_RE, so they force a full
+ // plan as an "unclassified changed file", and EVERY full plan sets
+ // `windows: true` whatever the risk rules say. Pairing the sample with a
+ // client-only trigger makes the plan go full for a reason that WOULD
+ // downgrade, so only the risk rule can produce `full` here.
+ expect(plan(['client/vite.config.js']).windowsMode).toBe('files');
+ expect(plan(['client/vite.config.js', path]).windowsMode).toBe('full');
});
- it.each(RISK_SAMPLES)('never downgrades a full plan that touches %s', (path) => {
- // Paired with a client-only trigger so the plan goes full for a reason
- // that WOULD otherwise downgrade — the risk file has to override it.
- expect(plan(['client/vite.config.js', path]).windowsMode).toBe('full');
+ it('routes a scoped Windows-risk change to the Windows job', () => {
+ // The scoped side of the same predicate: no full trigger in sight, so
+ // `windows: true` here is a direct consequence of WINDOWS_RISK_RULES.
+ expect(plan(['server/services/auth.js']).windows).toBe(false);
+ expect(plan(['server/lib/bufferedSpawn.js']).windows).toBe(true);
});
});
});