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

refactor([issue-711]): drop unused isDomain* predicates (simplify)

Adam Eivy544d2a83063a
diff --git a/server/lib/README.md b/server/lib/README.md
index 30b19e7b55..2a733e0162 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -196,7 +196,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
|---|---|
| `asyncMutex.js` | Promise-based async mutex. |
| `authGate.js` | Express + Socket.IO middleware that gates `/api/*` and `/data/*` behind the password set in `settings.secrets.auth`. No-op when auth is off; emits 401 `AUTH_REQUIRED` (or plain text for `/data/*`) when on and the request has no valid session token. |
-| `domainAutonomy.js` | Per-domain autonomy guardrails (pure). `AUTONOMY_DOMAINS`/`DOMAIN_IDS`/`DOMAIN_MODES` (`off`/`dry-run`/`execute`), `getDomainMode(config, id)` + `isDomainOff/DryRun/Execute`, and `normalizeDomainAutonomy(raw)` to coerce a hand-edited/partial map. Default per domain is `execute` (reproduces pre-#711 behavior, so no migration needed). |
+| `domainAutonomy.js` | Per-domain autonomy guardrails (pure). `AUTONOMY_DOMAINS`/`DOMAIN_IDS`/`DOMAIN_MODES` (`off`/`dry-run`/`execute`), `getDomainMode(config, id)`, and `normalizeDomainAutonomy(raw)` to coerce a hand-edited/partial map. Default per domain is `execute` (reproduces pre-#711 behavior, so no migration needed). |
| `errorHandler.js` | `ServerError` + `asyncHandler` middleware. |
| `mapWithConcurrency.js` | Generic bounded-concurrency async mapper that preserves input order while capping in-flight work. |
| `objects.js` | Object utilities — `deepMerge` (recursive merge w/ array replacement), `isPlainObject` (non-null, non-array `object` guard for JSON / LLM payloads), `POLLUTING_KEYS` (shared `__proto__`/`constructor`/`prototype` denylist for sanitizers), `canonicalStringify` (recursive sorted-key JSON serialization for cross-machine content hashing), `isEmptyScalar` (true for null/undefined/whitespace-string/empty-array — merge gap-fill gate). |
diff --git a/server/lib/domainAutonomy.js b/server/lib/domainAutonomy.js
index bc20d68276..5fb96e828d 100644
--- a/server/lib/domainAutonomy.js
+++ b/server/lib/domainAutonomy.js
@@ -84,7 +84,3 @@ export function getDomainMode(config, domainId) {
const candidate = config?.domainAutonomy?.[domainId];
return isValidMode(candidate) ? candidate : DEFAULT_DOMAIN_MODE;
}
-
-export const isDomainOff = (config, domainId) => getDomainMode(config, domainId) === 'off';
-export const isDomainDryRun = (config, domainId) => getDomainMode(config, domainId) === 'dry-run';
-export const isDomainExecute = (config, domainId) => getDomainMode(config, domainId) === 'execute';
diff --git a/server/lib/domainAutonomy.test.js b/server/lib/domainAutonomy.test.js
index 81d2853cf4..a9926d3a52 100644
--- a/server/lib/domainAutonomy.test.js
+++ b/server/lib/domainAutonomy.test.js
@@ -5,10 +5,7 @@ import {
AUTONOMY_DOMAINS,
DOMAIN_IDS,
normalizeDomainAutonomy,
- getDomainMode,
- isDomainOff,
- isDomainDryRun,
- isDomainExecute
+ getDomainMode
} from './domainAutonomy.js';
describe('domainAutonomy constants', () => {
@@ -72,20 +69,3 @@ describe('getDomainMode', () => {
expect(getDomainMode({ domainAutonomy: { brain: 'haywire' } }, 'brain')).toBe('execute');
});
});
-
-describe('mode predicates', () => {
- const config = { domainAutonomy: { brain: 'off', memory: 'dry-run', cos: 'execute' } };
- it('isDomainOff', () => {
- expect(isDomainOff(config, 'brain')).toBe(true);
- expect(isDomainOff(config, 'memory')).toBe(false);
- });
- it('isDomainDryRun', () => {
- expect(isDomainDryRun(config, 'memory')).toBe(true);
- expect(isDomainDryRun(config, 'cos')).toBe(false);
- });
- it('isDomainExecute (incl. default for unset/absent)', () => {
- expect(isDomainExecute(config, 'cos')).toBe(true);
- expect(isDomainExecute(config, 'messages')).toBe(true); // unset → execute
- expect(isDomainExecute(config, 'brain')).toBe(false);
- });
-});