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: bring the autofixer workspace inside the dependency-governance perimeter (#5658)

Adam Eivy0781a6d9dc1e
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index f3a543b15a..05fe740f76 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -5,9 +5,11 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
- # server/ and client/ carry their own package.json + overrides, and their
- # lockfiles are gitignored — without these entries their dependency trees are
- # invisible to Dependabot (a critical node-tar advisory sat unreported).
+ # server/, client/ and autofixer/ each carry their own package.json +
+ # overrides and their own lockfile, so npm resolves each tree separately —
+ # without an entry per directory those trees are invisible to Dependabot (a
+ # critical node-tar advisory sat unreported). browser/ is deliberately absent:
+ # it has zero dependencies and its lockfile is gitignored.
- package-ecosystem: npm
directory: /server
schedule:
@@ -18,6 +20,11 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
+ - package-ecosystem: npm
+ directory: /autofixer
+ schedule:
+ interval: weekly
+ open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: /
schedule:
diff --git a/autofixer/package-lock.json b/autofixer/package-lock.json
index a3d74d724d..23937aa579 100644
--- a/autofixer/package-lock.json
+++ b/autofixer/package-lock.json
@@ -217,9 +217,9 @@
}
},
"node_modules/es-object-atoms": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
- "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
@@ -396,9 +396,9 @@
}
},
"node_modules/hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
@@ -577,9 +577,9 @@
}
},
"node_modules/path-to-regexp": {
- "version": "8.4.0",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.0.tgz",
- "integrity": "sha512-PuseHIvAnz3bjrM2rGJtSgo1zjgxapTLZ7x2pjhzWwlp4SJQgK3f3iZIQwkpEnBaKz6seKBADpM4B4ySkuYypg==",
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
+ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
"license": "MIT",
"funding": {
"type": "opencollective",
@@ -600,12 +600,13 @@
}
},
"node_modules/qs": {
- "version": "6.15.2",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz",
- "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==",
+ "version": "6.15.3",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
+ "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
"license": "BSD-3-Clause",
"dependencies": {
- "side-channel": "^1.1.0"
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
},
"engines": {
"node": ">=0.6"
@@ -712,14 +713,14 @@
"license": "ISC"
},
"node_modules/side-channel": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
- "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
- "object-inspect": "^1.13.3",
- "side-channel-list": "^1.0.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
@@ -731,13 +732,13 @@
}
},
"node_modules/side-channel-list": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
- "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
- "object-inspect": "^1.13.3"
+ "object-inspect": "^1.13.4"
},
"engines": {
"node": ">= 0.4"
diff --git a/autofixer/package.json b/autofixer/package.json
index 41ef4dd6d3..4cee97ee95 100644
--- a/autofixer/package.json
+++ b/autofixer/package.json
@@ -9,5 +9,10 @@
},
"dependencies": {
"express": "5.2.1"
+ },
+ "overrides": {
+ "path-to-regexp": "8.4.2",
+ "body-parser": "2.3.0",
+ "qs": "6.15.3"
}
}
diff --git a/docs/DEPS.md b/docs/DEPS.md
index 542895bd2b..d884fb08ec 100644
--- a/docs/DEPS.md
+++ b/docs/DEPS.md
@@ -19,8 +19,8 @@ Before removing a Tier 3 candidate, run a transitive-dep check (`npm ls <pkg>`).
| Package | Tier | Verdict | Where Used | Notes |
|---------|------|---------|------------|-------|
-| **Root devDeps** | | | | |
-| `pm2` | 1 | KEEP | top-level scripts | Process manager, foundational. Pinned `7.0.4` (aligned with server pin) |
+| **Root deps** | | | | |
+| `pm2` | 1 | KEEP | top-level scripts | Process manager, foundational. Declared in root `dependencies` (the root manifest has no devDependencies). Pinned `7.0.4` (aligned with server pin) |
| **Server deps** | | | | |
| `@novnc/novnc` | 1 | KEEP | PortDeck remote desktop viewer | Mature RFB/VNC protocol implementation; replacing it would require owning multiple security types and framebuffer encodings |
| `@googleapis/calendar` | 1 | KEEP | Calendar integration | Scoped official Google SDK (replaced monolithic `googleapis`) |
@@ -77,6 +77,10 @@ Before removing a Tier 3 candidate, run a transitive-dep check (`npm ls <pkg>`).
| `@testing-library/react` | 1 | KEEP | component tests | |
| `@testing-library/user-event` | 1 | KEEP | interaction tests | |
| `rollup-plugin-visualizer` | 2 | KEEP | bundle-size analysis | Dev-only, opt-in |
+| **Autofixer deps** | | | | |
+| `express` | 1 | KEEP | `autofixer/ui.js` | Same framework and pin (`5.2.1`) as the server workspace, but a separate install prefix with its own lockfile — so it needs its own `overrides` block to inherit the server's express-tree pins |
+| **Browser workspace** | | | | |
+| _(none)_ | — | — | `browser/server.js` | Zero dependencies — Node built-ins only, plus one in-repo import from `server/lib/`. No Dependabot entry, and its lockfile is gitignored |
## Detailed Findings — Tier 2/3 Audits
@@ -119,14 +123,12 @@ This is intentionally NOT done in default mode — current dependency footprint
## Override Pins (`overrides`)
-Defined in `package.json` (root + server + client) — kept current to dodge known upstream advisories:
+Defined in `package.json` (root + server + client + autofixer) — kept current to dodge known upstream advisories:
- `[email protected]` (all three)
- `[email protected]`, `[email protected]` (server + client)
-- `[email protected]` (server only)
-- `[email protected]` (server only)
-- `[email protected]` (server only)
+- `[email protected]`, `[email protected]`, `[email protected]` (server + autofixer — the express-reachable subset; `autofixer/` mirrors only these three because a pin for a package absent from the tree reads as protection that does not exist)
- `[email protected]` (server only)
- `[email protected]` (server only)
- `[email protected]` (server only)
@@ -138,7 +140,7 @@ Defined in `package.json` (root + server + client) — kept current to dodge kno
These exist purely to force-bump transitive deps; revisit if `npm audit` flags new advisories.
-**Keep this list in sync with the manifests** — a stale entry here reads as a pin that exists when it doesn't. `server/dependency-overrides.test.js` guards the pins themselves (cross-manifest version parity, plus a `MINIMUM_SAFE` floor per remediated advisory), but it does not read this document. When a floor moves because a *new* advisory covers the version already pinned — as `[email protected]` did under GHSA-5p4m-2wfm-xmqj — bump the pin, the `MINIMUM_SAFE` row, and this list together.
+**Keep this list in sync with the manifests** — a stale entry here reads as a pin that exists when it doesn't. `server/dependency-overrides.test.js` guards the pins themselves (cross-manifest version parity, a `MINIMUM_SAFE` floor per remediated advisory, that every workspace shipping a tracked lockfile is in the governed manifest list, and that each tracked lockfile actually resolves the pinned version), but it does not read this document. When a floor moves because a *new* advisory covers the version already pinned — as `[email protected]` did under GHSA-5p4m-2wfm-xmqj — bump the pin, the `MINIMUM_SAFE` row, and this list together.
**Not every compromised package warrants a pin.** A pin only helps when the installed version is *below* the top of its permitted range — otherwise there is nothing to force. The August 2026 `keyv` / `flat-cache` / `file-entry-cache` compromise deliberately got **no** pin: each range was already at its ceiling (highest published `[email protected]` *is* `4.5.4`, etc.), so a pin would have been a no-op, and the packages were removed outright instead. Check headroom (`npm view <pkg>@<major> version`) before adding an entry here.
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index 1ea43809b7..ba4fbfbea0 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -12,7 +12,7 @@ const MAX_TARGETED_TEST_FILES = 120;
const FULL_TRIGGER_RULES = [
{ re: /^\.github\/workflows\//, reason: 'workflow definition changed' },
- { re: /^(?:package|server\/package|client\/package)(?:-lock)?\.json$/, reason: 'dependency manifest changed' },
+ { re: /^(?:package|server\/package|client\/package|autofixer\/package)(?:-lock)?\.json$/, reason: 'dependency manifest changed' },
{ re: /^(?:server|client)\/vitest\.config(?:\.db)?\.js$/, reason: 'test runner configuration changed' },
{ re: /^scripts\/vitestCiPool(?:\.test)?\.js$/, reason: 'test runner pool configuration changed' },
{ re: /^server\/vitest\.setup\.js$/, reason: 'server test setup changed' },
@@ -129,6 +129,7 @@ export const ALWAYS_RUN_TESTS = [
'scripts/node-version-drift.test.js',
'scripts/repo-scan-guards.test.js',
'scripts/tailnet-identity-leak.test.js',
+ 'server/dependency-overrides.test.js',
'server/lib/qwenAgentParsers.test.js',
'server/lib/testDataIsolation.guards.test.js',
'server/lib/testHelper.test.js',
diff --git a/server/dependency-overrides.test.js b/server/dependency-overrides.test.js
index c8896736ac..0554f3473a 100644
--- a/server/dependency-overrides.test.js
+++ b/server/dependency-overrides.test.js
@@ -1,21 +1,44 @@
import { describe, it, expect } from 'vitest';
+import { execFileSync } from 'child_process';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
+import { discoverWorkspaces } from '../scripts/trusted-rebuilds.js';
const __dirname = dirname(fileURLToPath(import.meta.url));
const REPO_ROOT = join(__dirname, '..');
-const MANIFESTS = ['package.json', 'server/package.json', 'client/package.json'];
+const MANIFESTS = [
+ 'package.json',
+ 'server/package.json',
+ 'client/package.json',
+ 'autofixer/package.json'
+];
const readOverrides = (rel) => {
const pkg = JSON.parse(readFileSync(join(REPO_ROOT, rel), 'utf8'));
return pkg.overrides ?? {};
};
-// PortOS pins security fixes for transitive dependencies as `overrides` in THREE
-// independent manifests (root, server/, client/) — each with its own lockfile, so
-// npm resolves each tree separately. The recurring failure (issue #2848) is that a
+// Tracked, not on-disk. `browser/package-lock.json` is deliberately gitignored
+// (.gitignore) yet appears the moment anyone runs an install there, so an
+// existsSync() probe would make these assertions depend on the developer's
+// working tree. What ships in the repo is the thing under governance.
+const trackedLockfiles = () =>
+ new Set(
+ execFileSync('git', ['ls-files', '--', '*package-lock.json'], {
+ cwd: REPO_ROOT,
+ encoding: 'utf8'
+ })
+ .split('\n')
+ .filter(Boolean)
+ );
+
+const workspacePrefix = (label) => (label === 'root' ? '' : `${label}/`);
+
+// PortOS pins security fixes for transitive dependencies as `overrides` in FOUR
+// independent manifests (root, server/, client/, autofixer/) — each with its own
+// lockfile, so npm resolves each tree separately. The recurring failure (issue #2848) is that a
// CVE gets pinned in one manifest and the others quietly keep the vulnerable
// version: `brace-expansion` sat at the patched 5.0.6 in server/ while root and
// client/ stayed on the vulnerable 5.0.5, so `npm audit` stayed red in two of three
@@ -111,4 +134,62 @@ describe('dependency override parity across manifests (#2848)', () => {
expect(stale).toEqual([]);
});
+
+ // The three mechanisms that govern a dependency tree — the manifest `overrides`
+ // block, a Dependabot entry, and the assertions above — were all hardcoded to
+ // root/server/client, so `autofixer/` (a fourth npm install prefix with its own
+ // tracked lockfile) sat outside every one of them and quietly resolved
+ // [email protected] / [email protected] while server/ enforced 8.4.2 / 6.15.3
+ // (issue #5658). MANIFESTS is a hand-written list; this derives the roster from
+ // the same `discoverWorkspaces()` the install-script allowlist uses, so a fifth
+ // workspace added later fails here instead of silently inheriting no governance.
+ it('governs every workspace manifest that ships its own lockfile', () => {
+ const tracked = trackedLockfiles();
+ const ungoverned = discoverWorkspaces()
+ .map(workspacePrefix)
+ .filter((prefix) => tracked.has(`${prefix}package-lock.json`))
+ .map((prefix) => `${prefix}package.json`)
+ .filter((manifest) => !MANIFESTS.includes(manifest));
+
+ expect(ungoverned).toEqual([]);
+ });
+
+ // The source-level assertions above compare manifest against manifest and so
+ // cannot see a pin that was declared but never applied: adding an `overrides`
+ // entry without regenerating that workspace's lockfile leaves the vulnerable
+ // version installed while the manifest reads as remediated. Reading the
+ // lockfiles closes that gap in both directions — a workspace that resolves a
+ // package another workspace has pinned must land on the pinned version, whether
+ // it declares the pin itself or has simply never noticed it needs one.
+ it('resolves every pinned package to its pinned version in all tracked lockfiles', () => {
+ const pins = new Map();
+ for (const rel of MANIFESTS) {
+ for (const [name, version] of Object.entries(readOverrides(rel))) {
+ // Nested overrides are scoped to one consumer's subtree — same exclusion
+ // as the parity assertion above.
+ if (typeof version !== 'string') continue;
+ if (!pins.has(name)) pins.set(name, new Set());
+ pins.get(name).add(version);
+ }
+ }
+
+ const NESTED = 'node_modules/';
+ const drift = [];
+ for (const lockRel of [...trackedLockfiles()].sort()) {
+ const packages = JSON.parse(readFileSync(join(REPO_ROOT, lockRel), 'utf8')).packages ?? {};
+ for (const [path, meta] of Object.entries(packages)) {
+ // '' is the workspace itself, workspace-link entries carry no
+ // `node_modules/` segment, and `link: true` entries carry no version.
+ if (!path?.includes(NESTED) || !meta?.version) continue;
+ const name = path.slice(path.lastIndexOf(NESTED) + NESTED.length);
+ const pinned = pins.get(name);
+ // A package with disagreeing pins is already reported by the parity
+ // assertion above; don't double-report it as drift here.
+ if (!pinned || pinned.size > 1 || pinned.has(meta.version)) continue;
+ drift.push(`${lockRel}: ${name}@${meta.version} != pinned ${[...pinned][0]}`);
+ }
+ }
+
+ expect(drift).toEqual([]);
+ });
});