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
docs: document won't-fix policy for free-API-key exposure findings
Adam Eivyca57e91d0d77
diff --git a/CLAUDE.md b/CLAUDE.mdindex 02654ae6b7..0a069666f1 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -41,6 +41,8 @@ The default database password `portos` (in `ecosystem.config.cjs`, `docker-compo**Storage backend policy.** PostgreSQL (system `:5432` or Docker `:5561`) is a **mandatory** dependency for every install and every federated peer — provisioned by `npm run setup:db` (see the ADR `docs/decisions/2026-06-07-postgres-as-primary-datastore.md` and `docs/STORAGE.md`). **`MEMORY_BACKEND=file` is a development/test-only escape hatch, NOT a supported deployment mode** (the creative catalog/pgvector, federation, and backup all assume Postgres and have no file-backed equivalent). When `MEMORY_BACKEND` is unset, `server/services/memoryBackend.js` requires a healthy DB and fails fast with no silent fallback — this is **intentional**; do not "fix" the no-fallback behavior, re-add a file menu choice in `scripts/setup-db.js`, or treat the file backend as a fallback for real installs. The file path stays runnable only because `NODE_ENV=test` selects it (it is guarded from bitrot by the suite, not promoted to a deployment option).+**Third-party API keys for free, non-monetary services are not security findings.** PortOS calls a handful of free external APIs (e.g., CivitAI model downloads) using an API key attached as a query parameter or header. Findings that propose host-allowlisting the download URL before attaching the key, stripping the key across redirects, or similar hardening should be closed as won't-fix: leaking that key to an unintended host has no monetary loss and no meaningful security consequence — worst case is quota abuse against a free service, borne by that service, not the user. This does NOT extend to paid/quota-billed providers (LLM API keys, payment gateways) or to keys that gate money-bearing or destructive actions — those retain full hardening requirements. Precedent: issue #2200 (`ref-watch-phosphene-civitai-token-host-allowlist`, closed 2026-07-04) — a `reference-watch` proposal to allowlist the CivitAI download host before attaching `applyDownloadToken`'s API key in `server/services/loras.js#installFromCivitai`.+**Never run DB-backed tests against the real `portos` database.** There is ONE Postgres per install, shared by every git worktree (including CoS-agent worktrees). The `*.db.test.js` suites `DELETE FROM`/`INSERT` whole tables, so running them against `portos` corrupts the user's real universes/series/writers-room/catalog. They are gated to skip on a non-test DB and run only via `npm run test:db` (→ `portos_test`, provisioned by `npm run setup:db:test`). The gate in `server/lib/db.js` keys on `isTestRunner()` (`NODE_ENV==='test'` **OR** `process.env.VITEST`, not bare `NODE_ENV` — a wrapper that drops `NODE_ENV` must NOT be able to disarm it) and the `query()` backstop refuses ALL row writes (`INSERT`/`UPDATE`/`DELETE`/`TRUNCATE`) to a non-test DB under the runner. Do not weaken either to "just `NODE_ENV`" or "DELETE-only" — that's exactly the hole that wiped real data on 2026-06-13/14. See `server/lib/db.guards.test.js`.## AI Provider Usage Policy