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
address review (codex round 2): say allowlisted, not enrolled
[._.]/ Adam Eivy425d1eba370f
diff --git a/CLAUDE.md b/CLAUDE.mdindex d5b01e1040..ead14573c5 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -28,7 +28,7 @@ npm run test:db # DB-backed suites → portos_test ONLY (see Se- **Auth** — an optional instance password (`server/services/auth.js`, enforced by `server/lib/authGate.js`) gates all of `/api/*` and `/data/*` when set, with a small always-public set (`/api/auth/status`, `/api/system/health`). Peers reach a password-gated instance via a per-peer Basic credential on the peer record, attached to every outbound hop by `peerFetch` (`server/lib/peerHttpClient.js`).- **HTTPS** — provisioned by `npm run setup:cert`; `:5555` flips to TLS with a loopback-only HTTP mirror on `:5553`. Peer hops set `rejectUnauthorized: false` ("Tailnet is the trust boundary") — between two tailnet nodes WireGuard already supplies mutual auth, but a non-tailnet peer (plain LAN IP / non-`.ts.net` host, see `peerRequiresTailscale()`) gets no server authentication.-Because both are off by default, **never treat "the password is set" as an available guarantee** when designing a feature — gate on it explicitly, or design for the default posture. **PII must not ride the federation layer at all** — see ADR [privacy records machine-local](docs/decisions/2026-08-08-privacy-records-machine-local.md). That rule governs *records* and *status/capability payloads*; its one scoped carve-out — a submitted image/video job body carrying the prompt an enrolled peer is being asked to render — is ADR [federated visual prompts](docs/decisions/2026-08-20-federated-visual-prompts.md).+Because both are off by default, **never treat "the password is set" as an available guarantee** when designing a feature — gate on it explicitly, or design for the default posture. **PII must not ride the federation layer at all** — see ADR [privacy records machine-local](docs/decisions/2026-08-08-privacy-records-machine-local.md). That rule governs *records* and *status/capability payloads*; its one scoped carve-out — a submitted image/video job body carrying the prompt an allowlisted peer is being asked to render — is ADR [federated visual prompts](docs/decisions/2026-08-20-federated-visual-prompts.md).**Distribution model (across installs).** PortOS is distributed software: many independent people each run their own install, on their own machine(s), each upgrading on their own schedule — and a single user commonly runs **several machines federated as sync peers**. Backward/forward compatibility across installs and versions is first-class, NOT optional:diff --git a/docs/decisions/2026-08-08-privacy-records-machine-local.md b/docs/decisions/2026-08-08-privacy-records-machine-local.mdindex 1c7fcee584..6600ac5db3 100644--- a/docs/decisions/2026-08-08-privacy-records-machine-local.md+++ b/docs/decisions/2026-08-08-privacy-records-machine-local.md@@ -91,8 +91,8 @@ another, and what a status or capability payload may disclose about the datathis machine holds. It is not a rule that no user-authored text may ever beaddressed to a peer: a federated media job body carries the prompt the userasked to render, because the render is not possible otherwise. That single-scoped carve-out — submitted image/video job bodies travelling to an-explicitly enrolled peer — is recorded in ADR+scoped carve-out — submitted image/video job bodies travelling to a peer this+install has allowlisted for that work — is recorded in ADR[federated visual prompts](./2026-08-20-federated-visual-prompts.md) (#4682),which also fixes what stays absolutely prompt-free (status and capabilitypayloads) and why audio is restricted to a fixed vocabulary instead. Read thediff --git a/docs/decisions/2026-08-20-federated-visual-prompts.md b/docs/decisions/2026-08-20-federated-visual-prompts.mdindex a4d6987b4f..bab0590d6d 100644--- a/docs/decisions/2026-08-20-federated-visual-prompts.md+++ b/docs/decisions/2026-08-20-federated-visual-prompts.md@@ -72,22 +72,27 @@ Concretely:registered peer (`authorizeFederatedMediaPeer`), which means an install withthe optional instance password *off* cannot accept a federated job at all.That is what makes the carve-out scoped rather than general: it authorizes- sending a prompt to a machine the local user enrolled and allowlisted for- this kind of work, not to the internet and not to a cloud provider's account.+ sending a prompt to a peer this install's own settings enable and allowlist+ for this kind of work, not to the internet and not to a cloud provider's+ account. The *record* alone is not the consent — an inbound announce can+ create an enabled peer row on its own. The allowlist is, because an announced+ peer arrives with no media-provider config and stays refused until the local+ user gives it one.Two limits of that identity are real and are not fixed by this ADR: the Basiccredential authenticates *the install*, not one peer, and the`X-PortOS-Instance-Id` header naming which registered peer is calling isself-asserted. So the guarantee is "a holder of this provider's instance- password, on this private network" rather than a cryptographic binding to one- enrolled machine — a least-disclosure boundary between cooperating peers, as- `docs/FEDERATED_MEDIA_PROVIDERS.md` already states. Tightening it benefits- every federated surface and is tracked with the transport work, not here.+ password, on this private network" rather than a cryptographic binding to+ one allowlisted machine — a least-disclosure boundary between cooperating+ peers, as `docs/FEDERATED_MEDIA_PROVIDERS.md` already states. Tightening that+ benefits every federated surface and is tracked with the transport work, not+ here.5. **Unattended routing does not widen this boundary.** A configured route namesone peer, one kind and one model; the operator opts in per kind, exactly asthey opt in per job today. What changes is review cadence, not audience — the- same prompts go to the same enrolled machine. An unattended route may never+ same prompts go to the same allowlisted machine. An unattended route may neverfan out to peers the user did not name, may never fall back to a differentpeer on failure, and may never relax rules 1–3.@@ -98,10 +103,11 @@ Concretely:`rejectUnauthorized: false` ("Tailnet is the trust boundary"): between twotailnet nodes WireGuard already supplies mutual authentication, but aplain-LAN or non-`.ts.net` peer gets **no server authentication** — nothing- proves the far end is the machine the user enrolled. Authentication does not- save this: the prompt rides the request body, so an impostor holding the- connection reads it before it fails to answer. That is an acceptable risk for- a per-job human decision and not for a standing one. When unattended+ proves the far end is the machine whose record the user allowlisted.+ Authentication does not save this: the prompt rides the request body, so an+ impostor holding the connection reads it before it fails to answer. That is+ an acceptable risk for a per-job human decision and not for a standing one.+ When unattendedrouting ships, configuring a route to a peer that`peerRequiresTailscale()`-style detection does not recognize as a tailnet hostmust be refused, naming the reason. Interactive routing is unchanged.@@ -143,8 +149,8 @@ later slice of #4348 and must revisit this ADR before shipping.- **Forbid federated visual rendering entirely.** Rejected: it deletes thefeature to protect data from the user's own second machine, which is where the- data already lives — the peer is enrolled precisely because it is trusted with- this project's work.+ data already lives — the peer is allowlisted for this work precisely because+ it is trusted with it.## Consequences@@ -168,7 +174,8 @@ later slice of #4348 and must revisit this ADR before shipping.## RevisitingThis carve-out is scoped to submitted image/video job bodies travelling to an-enrolled peer on a private network. Widening it — input-asset transfer, routing-to peers the user did not enroll, relaying through a non-PortOS service, or any-path where the counterparty is not the user's own registered instance — requires-a new ADR, not a reading of this one.+peer this install has enabled and allowlisted for that kind, on a private+network. Widening it — input-asset transfer, routing to peers the local+allowlist does not cover, relaying through a non-PortOS service, or any path+where the counterparty is not one of the user's own registered instances —+requires a new ADR, not a reading of this one.