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 (claude): pin the alwaysOn default, witness the retired seed, fix doc drift

[._.]/ Adam Eivyfda42620a6cb
diff --git a/docs/features/chief-of-staff.md b/docs/features/chief-of-staff.md
index d039d6acb1..14924e330c 100644
--- a/docs/features/chief-of-staff.md
+++ b/docs/features/chief-of-staff.md
@@ -81,7 +81,7 @@ The `selectModelForTask` function routes tasks to appropriate model tiers:
| maxConcurrentAgentsPerProject | 2 | Max parallel agents per project |
| maxProcessMemoryMb | 2048 | Memory alert threshold |
| maxTotalProcesses | 50 | Process-count alert threshold |
-| alwaysOn | true | Start on server boot (`autoStart` is a legacy compatibility alias) |
+| alwaysOn | false | Start on server boot (`autoStart` is a legacy compatibility alias). Off by default so a never-configured install does not begin autonomous LLM-backed work on its own |
| improvementEnabled | true | Allow improvement work for PortOS and managed apps |
| proactiveMode | true | Always find work when idle |
| idleReviewEnabled | true | Review managed apps while user work is idle |
diff --git a/scripts/migrations/340-cos-config-seed-repair.js b/scripts/migrations/340-cos-config-seed-repair.js
index 9ba170fc4d..17526f95ae 100644
--- a/scripts/migrations/340-cos-config-seed-repair.js
+++ b/scripts/migrations/340-cos-config-seed-repair.js
@@ -163,7 +163,10 @@ export default {
return { repaired: 'recovered', keys: Object.keys(quarantined.config).length, source: quarantined.source };
}
- await rm(configPath);
+ // force: an ENOENT here would propagate out of runMigrations() and fail
+ // server boot, and "the file we were about to delete is already gone" is
+ // exactly the outcome this branch wants anyway.
+ await rm(configPath, { force: true });
console.log(`🧹 Removed ${CONFIG_PATH} — it was the shipped seed, so CoS reads its in-code defaults again`);
return { repaired: 'removed' };
},
diff --git a/scripts/migrations/340-cos-config-seed-repair.test.js b/scripts/migrations/340-cos-config-seed-repair.test.js
index dd848779e9..a82c3d36eb 100644
--- a/scripts/migrations/340-cos-config-seed-repair.test.js
+++ b/scripts/migrations/340-cos-config-seed-repair.test.js
@@ -1,14 +1,29 @@
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { mkdtempSync, rmSync, writeFileSync, readFileSync, mkdirSync, existsSync } from 'fs';
import { tmpdir } from 'os';
-import { join } from 'path';
+import { isDeepStrictEqual } from 'util';
+import { dirname, join } from 'path';
+import { fileURLToPath } from 'url';
import migration, { RETIRED_SEED } from './340-cos-config-seed-repair.js';
const writeJson = (path, value) => writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);
const readJson = (path) => JSON.parse(readFileSync(path, 'utf-8'));
+// The retired data.reference/cos/config.json, extracted verbatim from the commit
+// that shipped it (ed19786aa) and checked in here. Every other test writes
+// RETIRED_SEED as its own fixture, so `isDeepStrictEqual` would compare the
+// constant to itself and pass for ANY value it held — the migration would then
+// no-op on 100% of affected installs with the suite still green. This is the
+// independent witness that closes that.
+const retiredSeedPath = join(dirname(fileURLToPath(import.meta.url)), '__fixtures__', 'retired-cos-config-seed.json');
+
describe('migration 340 — repair a CoS config.json overwritten by the shipped seed', () => {
+ it('RETIRED_SEED matches the config.json data.reference actually shipped', () => {
+ const shipped = JSON.parse(readFileSync(retiredSeedPath, 'utf-8'));
+ expect(isDeepStrictEqual(RETIRED_SEED, shipped)).toBe(true);
+ });
+
let rootDir;
let statePath;
let configPath;
diff --git a/scripts/migrations/__fixtures__/retired-cos-config-seed.json b/scripts/migrations/__fixtures__/retired-cos-config-seed.json
new file mode 100644
index 0000000000..8eebdbb4d6
--- /dev/null
+++ b/scripts/migrations/__fixtures__/retired-cos-config-seed.json
@@ -0,0 +1,42 @@
+{
+ "userTasksFile": "data/TASKS.md",
+ "cosTasksFile": "data/COS-TASKS.md",
+ "healthCheckIntervalMs": 900000,
+ "maxConcurrentAgents": 3,
+ "maxConcurrentAgentsPerProject": 2,
+ "maxProcessMemoryMb": 2048,
+ "maxTotalProcesses": 50,
+ "mcpServers": [
+ {
+ "name": "filesystem",
+ "command": "npx",
+ "args": [
+ "-y",
+ "@anthropic/mcp-server-filesystem"
+ ]
+ },
+ {
+ "name": "puppeteer",
+ "command": "npx",
+ "args": [
+ "-y",
+ "@anthropic/mcp-puppeteer",
+ "--isolated"
+ ]
+ }
+ ],
+ "autoStart": false,
+ "alwaysOn": false,
+ "selfImprovementEnabled": true,
+ "dynamicAvatar": true,
+ "persistentMindCapabilities": {
+ "schemaVersion": 5,
+ "createTasks": false,
+ "manageMind": false,
+ "manageEidoverse": false,
+ "callUser": false,
+ "readPortos": false,
+ "writePortos": false,
+ "taskModelAllowlist": []
+ }
+}
diff --git a/server/services/cosState.test.js b/server/services/cosState.test.js
index b9599cb57f..1680ede389 100644
--- a/server/services/cosState.test.js
+++ b/server/services/cosState.test.js
@@ -149,15 +149,30 @@ describe('CoS config lives in its own file', () => {
expect(readJson(STATE_PATH).config).toBeUndefined();
});
+ // The shipped default is the ONLY thing stopping a never-configured install
+ // from auto-starting CoS (server/services/cos.js reads `alwaysOn || autoStart`
+ // at boot) and with it every work-generation flag that defaults on. That used
+ // to be enforced by a data.reference/cos/config.json seed, which was deleted
+ // in #6182's repair (migration 340) — so nothing but this literal enforces
+ // AGENTS.md's "No cold-bootstrap LLM calls" for a fresh install now.
+ it('defaults alwaysOn off so a fresh install never auto-starts CoS', async () => {
+ const { DEFAULT_CONFIG } = await freshModule();
+ expect(DEFAULT_CONFIG.alwaysOn).toBe(false);
+ expect(DEFAULT_CONFIG.autoStart).toBe(false);
+ });
+
// Back-compat: an un-upgraded peer, or a restored pre-split backup, still
// carries `config` inside state.json.
it('falls back to a legacy config slice still sitting in state.json', async () => {
- writeState({ running: false, config: { maxConcurrentAgents: 11, alwaysOn: false }, agents: {} });
+ // alwaysOn is stored as `true` on purpose: DEFAULT_CONFIG ships `false`, so a
+ // stored `false` would assert nothing — it would pass identically if the
+ // legacy fallback were deleted outright.
+ writeState({ running: false, config: { maxConcurrentAgents: 11, alwaysOn: true }, agents: {} });
const { getConfig } = await freshModule();
const config = await getConfig();
expect(config.maxConcurrentAgents).toBe(11);
- expect(config.alwaysOn).toBe(false);
+ expect(config.alwaysOn).toBe(true);
});
it('prefers config.json over a stale legacy slice when both exist', async () => {