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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: align npm engine floor with lockfile metadata support
[._.]/ Adam Eivy8b03b19c9a4a
diff --git a/README.md b/README.mdindex bcebd8b818..9cb0f0d963 100644--- a/README.md+++ b/README.md@@ -293,7 +293,7 @@ Track your biological self alongside your digital one.### Requirements- Node.js 22.12 or later (24 is what CI and `.nvmrc` use; Vite 8 requires ≥20.19). `npm run setup`, `npm start` and `npm run dev` check this first and stop immediately on an older Node — a bare `npm install` only warns, so use the commands below.-- npm 12 or later (`npm install -g npm@latest`) for dependency authoring. Older npm installs dependencies correctly, but its lockfile writer omits the `libc` fields npm 12 records, so a direct `npm install` can rewrite `client/package-lock.json` and `server/package-lock.json` — and the next Dependabot PR puts those fields back. PortOS-managed setup, update, and dependency-repair installs preserve the committed lockfiles with `--no-save`; do not commit metadata-only churn from an older npm. Every workspace declares `engines.npm`, so npm warns on any install path; `npm run setup`/`start`/`dev` also print what to do about it. These are warnings, never failures. No Node release bundles npm 12 yet (Node 24.10 ships 11.6.1), so this is a deliberate global upgrade — and worth checking `npm -v` matches, since an old global npm earlier on `PATH` shadows the one Node ships.+- npm 11.11.0 or later for dependency authoring (`npm install -g [email protected]` provides the verified minimum and supports the PortOS Node floor). Its Arborist 9.4.0 lockfile writer preserves `libc` metadata; npm 11.10.1 and earlier omit it. See the [npm 11.11.0 writer](https://github.com/npm/cli/blob/v11.11.0/workspaces/arborist/lib/shrinkwrap.js). npm 12 is not required. PortOS-managed setup, update, and dependency-repair installs preserve committed lockfiles with `--no-save`; do not commit metadata-only churn from older npm. Every workspace declares `engines.npm`, and setup/start/dev print an advisory below that floor. These are warnings, never runtime failures. Check `node -v`, `npm -v`, and executable resolution in the environment running PortOS as well as your shell: a Node version manager can select a different toolchain for agent shells. Avoid blindly upgrading to `npm@latest`, whose own Node requirement may exceed PortOS's.- Git- PostgreSQL, either installed locally or available through Docker. PortOS requires a healthy database; the setup command provisions the supported local or Docker-backed instance.diff --git a/autofixer/package-lock.json b/autofixer/package-lock.jsonindex 476645caf4..8a879522df 100644--- a/autofixer/package-lock.json+++ b/autofixer/package-lock.json@@ -12,7 +12,7 @@},"engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"}},"node_modules/accepts": {diff --git a/autofixer/package.json b/autofixer/package.jsonindex bed0a812f0..c361cdbbfe 100644--- a/autofixer/package.json+++ b/autofixer/package.json@@ -5,7 +5,7 @@"type": "module","engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"},"dependencies": {"express": "5.2.1"diff --git a/client/package-lock.json b/client/package-lock.jsonindex 96e56895fc..49564babd1 100644--- a/client/package-lock.json+++ b/client/package-lock.json@@ -37,7 +37,7 @@},"engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"}},"node_modules/@adobe/css-tools": {diff --git a/client/package.json b/client/package.jsonindex 87a25d2d01..e38608e0a2 100644--- a/client/package.json+++ b/client/package.json@@ -5,7 +5,7 @@"type": "module","engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"},"scripts": {"dev": "vite --host 0.0.0.0 --port 5554",diff --git a/package-lock.json b/package-lock.jsonindex 4532d5e83a..dfa6e3c3f0 100644--- a/package-lock.json+++ b/package-lock.json@@ -13,7 +13,7 @@},"engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"}},"node_modules/@pm2/blessed": {diff --git a/package.json b/package.jsonindex 587d596652..7b1ae454c2 100644--- a/package.json+++ b/package.json@@ -8,7 +8,7 @@"type": "module","engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"},"scripts": {"dev": "node scripts/checkNodeVersion.js && node scripts/checkNpmVersion.js && node scripts/dev-start.js",diff --git a/scripts/checkNpmVersion.js b/scripts/checkNpmVersion.jsindex d3b4305aac..473a4aedb3 100644--- a/scripts/checkNpmVersion.js+++ b/scripts/checkNpmVersion.js@@ -8,19 +8,17 @@** Cause: npm's lockfile writer copies a fixed list of manifest fields into each* entry — `pkgMetaKeys` in `@npmcli/arborist`'s `lib/shrinkwrap.js`. `libc` was- * only added to that list in arborist 10, which ships in npm 12. Dependabot- * runs a current npm, so every lockfile it opens a PR against carries `libc`;- * any install on npm 11 or older then rewrites the file without those fields,- * and the next Dependabot PR puts them back. Neither side is wrong — the two- * npm versions disagree about the schema, so the file ping-pongs forever. The- * same skew drops `peer: true` markers that npm 12 records.+ * added in arborist 9.4.0, shipped by npm 11.11.0. Earlier npm 11 releases+ * omit it, so their installs can churn lockfiles authored by newer npm.+ * npm 11.11.0 also preserves `peer: true`; neither field requires npm 12.+ * Source: https://github.com/npm/cli/blob/v11.11.0/workspaces/arborist/lib/shrinkwrap.js+ * Compare v11.10.1, whose pkgMetaKeys still omits `libc`.** PortOS-managed setup, update, and dependency-repair installs pass `--no-save`* so they honor the committed lockfile without rewriting it. A direct* dependency-authoring `npm install` on an older npm still churns the lockfile.- * No Node release bundles npm 12 yet (Node 24.10 ships npm 11.6.1), so gating- * installs on it would break working installs over a file-formatting difference.- * `npm install -g npm@latest` ends the mismatch for authoring workflows.+ * This is an authoring advisory, not a runtime gate. Recommend the verified+ * floor explicitly: npm@latest may require a newer Node than PortOS does.** This advisory is the explainer, not the whole floor. The four `engines.npm`* fields are the declarative half, and they are what covers the install paths@@ -45,7 +43,7 @@ import { isDirectlyInvoked } from './lib/directInvocation.js';* changing exactly this string — scripts/checkNpmVersion.test.js pins the* arborist/npm reasoning above to it.*/-export const MIN_NPM = '12.0.0';+export const MIN_NPM = '11.11.0';/*** Read the npm version out of the `npm_config_user_agent` npm exports to its@@ -105,7 +103,7 @@ export function npmAdvisory({const lines = [`⚠️ npm ${npmVersion} is below ${MIN_NPM} — direct npm installs can rewrite package-lock.json`,- 'ℹ️ Older npm drops the `libc` fields npm 12 records, so direct installs churn the lockfiles and ping-pong with Dependabot'+ `ℹ️ npm before ${MIN_NPM} drops the libc metadata newer npm records, so direct installs can churn the lockfiles`];// The confusing case: PATH is resolving an older global npm ahead of the one@@ -116,7 +114,7 @@ export function npmAdvisory({);}- lines.push('🔧 Fix: npm install -g npm@latest');+ lines.push(`🔧 Fix: npm install -g npm@${MIN_NPM}`);return lines;}diff --git a/scripts/checkNpmVersion.test.js b/scripts/checkNpmVersion.test.jsindex 49ca854e0e..1b5a847d9c 100644--- a/scripts/checkNpmVersion.test.js+++ b/scripts/checkNpmVersion.test.js@@ -1,8 +1,8 @@/*** Unit tests for the npm floor advisory.*- * The gate exists because a lockfile written by npm 12 and re-written by npm 11- * or older differ by the `libc` fields, so `client/package-lock.json` shows up+ * Lockfiles written by npm >=11.11.0 and re-written by older npm differ in+ * their `libc` fields, so `client/package-lock.json` shows up* modified after every install. These tests pin the three things that make the* advisory useful: it fires only below the floor, it never turns into a hard* failure, and it names the shadowed-global-npm case that makes the version@@ -38,11 +38,10 @@ afterEach(() => {});describe('MIN_NPM', () => {- it('is the npm major whose lockfile writer records `libc`', () => {- // arborist 10 added 'libc' to pkgMetaKeys and ships in npm 12; arborist 9- // (npm 11.6.1, bundled with Node 24.10) strips it. Anything below 12 churns- // the lockfile, so the floor is a whole major and has no patch nuance.- expect(MIN_NPM).toBe('12.0.0');+ it('is the first npm release whose lockfile writer records `libc`', () => {+ // npm 11.11.0 ships arborist 9.4.0, which adds libc to pkgMetaKeys.+ // npm 11.10.1 ships arborist 9.3.1 and still omits it.+ expect(MIN_NPM).toBe('11.11.0');});});@@ -104,6 +103,7 @@ describe('readBundledNpmVersion', () => {describe('npmAdvisory', () => {it('says nothing on npm at or above the floor', () => {expect(npmAdvisory({ npmVersion: MIN_NPM, bundledNpmVersion: '11.6.1' })).toEqual([]);+ expect(npmAdvisory({ npmVersion: '11.12.1' })).toEqual([]);expect(npmAdvisory({ npmVersion: '12.4.0', bundledNpmVersion: '11.6.1' })).toEqual([]);});@@ -114,13 +114,13 @@ describe('npmAdvisory', () => {});it('names the version, the floor, the symptom, and the fix below the floor', () => {- const lines = npmAdvisory({ npmVersion: '11.6.1', bundledNpmVersion: '11.6.1' });+ const lines = npmAdvisory({ npmVersion: '11.10.1', bundledNpmVersion: '11.10.1' });const text = lines.join('\n');- expect(text).toContain('11.6.1');+ expect(text).toContain('11.10.1');expect(text).toContain(MIN_NPM);expect(text).toContain('package-lock.json');expect(text).toContain('libc');- expect(text).toContain('npm install -g npm@latest');+ expect(text).toContain(`npm install -g npm@${MIN_NPM}`);});it('flags a stale global npm shadowing the one Node bundles', () => {@@ -148,7 +148,7 @@ describe('npmAdvisory', () => {it('omits the shadowing line when the bundled npm cannot be read', () => {const lines = npmAdvisory({ npmVersion: '9.6.0', bundledNpmVersion: null });expect(lines.some((line) => line.includes('shadowing'))).toBe(false);- expect(lines.join('\n')).toContain('npm install -g npm@latest');+ expect(lines.join('\n')).toContain(`npm install -g npm@${MIN_NPM}`);});});@@ -208,6 +208,7 @@ describe('the floor is declared where npm itself reads it', () => {it.each(MANIFESTS)('%s declares engines.npm = the floor', (rel) => {expect(readJson(rel).engines?.npm).toBe(`>=${MIN_NPM}`);+ expect(readJson(rel.replace('package.json', 'package-lock.json')).packages[''].engines?.npm).toBe(`>=${MIN_NPM}`);});it.each(MANIFESTS)('%s ships a lockfile that the floor protects', (rel) => {diff --git a/scripts/doctor.js b/scripts/doctor.jsindex 2dbb0c8842..3562a990db 100644--- a/scripts/doctor.js+++ b/scripts/doctor.js@@ -192,8 +192,8 @@ async function probeNode() {}/**- * npm is ADVISORY, never required: no Node release bundles npm 12 yet, so an- * older npm is a correct install that merely churns the lockfiles. Same+ * npm is ADVISORY, never required: npm below the authoring floor can still+ * install dependencies but may churn lockfile metadata. Same* reasoning as `checkNpmVersion.js`, which warns rather than exits.*/async function probeNpm() {@@ -206,7 +206,7 @@ async function probeNpm() {}return compareVersions(version, MIN_NPM) >= 0? { available: true, detail: `${version}` }- : { available: false, detail: `${version} is below ${MIN_NPM} — installs rewrite package-lock.json (npm install -g npm@latest)` };+ : { available: false, detail: `${version} is below ${MIN_NPM} — installs rewrite package-lock.json (npm install -g npm@${MIN_NPM})` };}async function probeSubmodule(root) {diff --git a/server/package-lock.json b/server/package-lock.jsonindex e5f7b5c1d6..1fa94c5b12 100644--- a/server/package-lock.json+++ b/server/package-lock.json@@ -32,7 +32,7 @@},"engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"}},"node_modules/@babel/helper-string-parser": {diff --git a/server/package.json b/server/package.jsonindex 98ccd842de..b530921196 100644--- a/server/package.json+++ b/server/package.json@@ -5,7 +5,7 @@"type": "module","engines": {"node": ">=22.12.0",- "npm": ">=12.0.0"+ "npm": ">=11.11.0"},"scripts": {"dev": "node --watch index.js",diff --git a/server/services/persistentMindWorkspacePreflight.test.js b/server/services/persistentMindWorkspacePreflight.test.jsindex 586388d4b5..0ce3733629 100644--- a/server/services/persistentMindWorkspacePreflight.test.js+++ b/server/services/persistentMindWorkspacePreflight.test.js@@ -1,5 +1,5 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import { mkdir, mkdtemp, rm, writeFile } from 'fs/promises';+import { mkdir, mkdtemp, readFile, rm, writeFile } from 'fs/promises';import { join } from 'path';import { tmpdir } from 'os';@@ -88,6 +88,29 @@ describe('persistent mind workspace preflight', () => {expect(satisfiesVersionRequirement('not-a-version', '>=22.12.0')).toBe(null);});+ // Regression: the shipped authoring floor rejected npm versions that already+ // preserve libc metadata, blocking otherwise compatible workspaces.+ it('accepts the shipped npm floor while retaining npm and Node incompatibility blockers', async () => {+ const { engines } = JSON.parse(await readFile(new URL('../../package.json', import.meta.url), 'utf8'));+ await writeManifest(repoPath, 'package.json', { engines });+ const dependencies = createDependencies();+ for (const [nodeVersion, npmVersion, blocked] of [+ ['24.14.1', '11.11.0', false],+ ['26.0.0', '11.12.1', false],+ ['26.0.0', '11.10.1', true],+ ['22.11.0', '11.11.0', true],+ ]) {+ const snapshot = await readPersistentMindWorkspacePreflight(appFor(repoPath), {+ force: true,+ dependencies,+ runtime: { nodeVersion, packageManagerVersions: { npm: npmVersion } },+ });+ const assessment = assessPersistentMindWorkspaceReadiness(snapshot, ['engines']);+ expect(assessment.blockers.length > 0, `Node ${nodeVersion}, npm ${npmVersion}`).toBe(blocked);+ expect(snapshot.readiness === 'blocked').toBe(blocked);+ }+ });+it('reports npm workspaces, absent dependencies, submodules, engines, forge auth, and reviewers as semantic facts', async () => {await mkdir(join(repoPath, 'packages', 'client'), { recursive: true });await writeManifest(repoPath, 'package.json', {