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: run client convention guards before pushing full-plan changes (#10539)

[._.]/ Adam Eivy13bb91a56915
diff --git a/scripts/pregate.js b/scripts/pregate.js
index d24013c50b..e59f821286 100644
--- a/scripts/pregate.js
+++ b/scripts/pregate.js
@@ -123,11 +123,14 @@ export function resolvePlanStages(plan, { skipLint = false, baseSha } = {}) {
*/
export function downgradeFullPlan(plan, trackedFiles) {
const tracked = new Set(trackedFiles);
+ // Discover convention guards so new client scanners join the local gate
+ // without a second hand-maintained list (including guards under hooks/).
+ const clientGuards = trackedFiles.filter((path) => /^client\/src\/.*Conventions\.test\.js$/.test(path));
return {
...plan,
full: false,
server: { mode: 'files', files: ALWAYS_RUN_TESTS.filter((path) => tracked.has(path)), sources: [] },
- client: { mode: 'skip', files: [], sources: [] },
+ client: { mode: clientGuards.length > 0 ? 'files' : 'skip', files: clientGuards, sources: [] },
lint: { mode: 'full', files: [] },
};
}
diff --git a/scripts/pregate.test.js b/scripts/pregate.test.js
index 254172f12c..e25c3a4eaf 100644
--- a/scripts/pregate.test.js
+++ b/scripts/pregate.test.js
@@ -263,11 +263,25 @@ describe('pregateWorkerEnv', () => {
describe('downgradeFullPlan', () => {
it('replaces the full suite with the tracked always-run guards', () => {
- const tracked = ALWAYS_RUN_TESTS.slice(0, 3);
+ const serverGuards = ALWAYS_RUN_TESTS.slice(0, 3);
+ const clientGuards = [
+ 'client/src/asyncEffectDisposalConventions.test.js',
+ 'client/src/fooConventions.test.js',
+ 'client/src/hooks/mountedRefConventions.test.js',
+ ];
+ const tracked = [...serverGuards, ...clientGuards,
+ 'client/src/App.test.jsx', 'client/src/fooConventions.js',
+ 'server/fooConventions.test.js',
+ ];
const downgraded = downgradeFullPlan(planWith({ full: true }), tracked);
expect(downgraded.full).toBe(false);
- expect(downgraded.server).toEqual({ mode: 'files', files: tracked, sources: [] });
- expect(downgraded.client.mode).toBe('skip');
+ expect(downgraded.server).toEqual({ mode: 'files', files: serverGuards, sources: [] });
+ expect(downgraded.client).toEqual({ mode: 'files', files: clientGuards, sources: [] });
+ const stages = resolvePlanStages(downgraded);
+ expect(stages.map((stage) => stage.name)).toContain('client tests');
+ expect(stages.find((stage) => stage.name === 'client tests').env).toMatchObject({
+ CI_TEST_MODE: 'files', CI_TEST_FILES: JSON.stringify(clientGuards), CI_TEST_SOURCES: '[]',
+ });
});
it('drops a guard this checkout does not track, so Vitest is never given a missing path', () => {