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: explain development dependency requirements (#12248)

Adam Eivyab33a63a9cfc
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
index 7fb7f2999a..e8dddfd99e 100644
--- a/docs/CONTRIBUTING.md
+++ b/docs/CONTRIBUTING.md
@@ -87,7 +87,7 @@ See [VERSIONING.md](./VERSIONING.md) for full details.
3. Push `main` to `release` branch to trigger GitHub Release workflow
4. Before pushing, follow [Regular Development](./VERSIONING.md#regular-development): verify your branch/upstream and working-tree state, preserve unrelated work, and explicitly fetch the intended base for comparison (the tracking branch may differ); integrate it only for conflicts, enforced branch policy, or evidenced integration risk. Run `npm run pregate` after any rebase and before every push. See [AGENTS.md's Git Workflow](../AGENTS.md#git-workflow) for the full contract.
-Pregate first checks installed package versions against all four workspace lockfiles without modifying dependency trees. Stale, missing, or unreadable evidence stops lint/tests with a reconciliation diagnostic. Ordinary worktree links must be repaired only in their owning source checkout; a separate clone with its own locked installs is also suitable for validation. `--plan-only` prints the plan without checking installed dependencies.
+Pregate first checks installed package versions against all four workspace lockfiles without modifying dependency trees. Stale, missing, or unreadable evidence stops lint/tests with a reconciliation diagnostic. Pregate requires development dependencies (`npm ci --include=dev` in an owning workspace); a production-only installation cannot run its checks. Ordinary worktree links must be repaired only in their owning source checkout; a separate clone with its own locked installs is also suitable for validation. `--plan-only` prints the plan without checking installed dependencies.
Pregate proves only the stages it runs; it does not replace required CI or resource-dependent checks. A full-suite plan runs only the always-run guards unless `--full` is supplied; DB suites, Windows, client build, and boot smoke are reported but not run by pregate.
diff --git a/scripts/lib/workspaceDependencies.js b/scripts/lib/workspaceDependencies.js
index 16d4393263..4af8cbc3e8 100644
--- a/scripts/lib/workspaceDependencies.js
+++ b/scripts/lib/workspaceDependencies.js
@@ -53,7 +53,7 @@ export function inspectWorkspaceDependencies({ dir, label }) {
const installed = readJson(join(dir, path, 'package.json'));
if (installed.error) {
if (installed.error === 'missing' && expected.optional) continue;
- issues.push(`${path}: ${installed.error} package.json (${installed.code}); expected ${expected.version}`);
+ issues.push(`${path}: ${installed.error} package.json (${installed.code}); expected ${expected.version}${expected.dev || expected.devOptional ? ' — pregate requires development dependencies (--include=dev)' : ''}`);
} else if (typeof installed.value?.version !== 'string') {
issues.push(`${path}: unreadable package version; expected ${expected.version}`);
} else if (installed.value.version !== expected.version) {
diff --git a/scripts/pregate.js b/scripts/pregate.js
index a9c0673937..187c9bd17e 100644
--- a/scripts/pregate.js
+++ b/scripts/pregate.js
@@ -393,8 +393,8 @@ async function main() {
for (const { label, linked, owner, issues } of dependencyProblems) {
console.error(` ${label} (${linked ? 'linked' : 'owned'} node_modules):\n${issues.map(issue => ` ${issue}`).join('\n')}`);
console.error(linked
- ? ` Reconcile dependencies in the owning source checkout (${owner}), or validate in a separate clone with its own locked installs. Never run npm install/ci through worktree links.`
- : ` Reconcile this checkout's dependencies from its committed lockfiles (npm ci in the owning workspace), then rerun pregate.`);
+ ? ` Reconcile dependencies in the owning source checkout (${owner}), with a full development install (npm ci --include=dev), or validate in a separate clone with its own locked installs. Never run npm install/ci through worktree links.`
+ : ` Reconcile this checkout's dependencies from its committed lockfiles (npm ci --include=dev in the owning workspace), then rerun pregate.`);
}
process.exit(1);
}
diff --git a/scripts/pregate.test.js b/scripts/pregate.test.js
index 4634c669e8..c2c6666282 100644
--- a/scripts/pregate.test.js
+++ b/scripts/pregate.test.js
@@ -225,6 +225,18 @@ describe('pregate hidden-content invocation', () => {
},
);
+ it('diagnoses a production-only install before spawning development checks', () => {
+ write('server/package-lock.json', JSON.stringify({ packages: {
+ '': {}, 'node_modules/vitest': { version: '5.0.4', dev: true },
+ } }));
+ write('scripts/run-ci-tests.js', 'throw new Error("unexpected test stage");');
+ const result = run();
+ expect(result.status).toBe(1);
+ expect(result.stderr).toContain('node_modules/vitest: missing package.json');
+ expect(result.stderr).toContain('pregate requires development dependencies (--include=dev)');
+ expect(result.stderr).not.toContain('unexpected test stage');
+ });
+
it('refuses missing and unreadable lock evidence rather than calling it a match', () => {
rmSync(join(root, 'client', 'package-lock.json'));
write('autofixer/package-lock.json', '{invalid');