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
document the project ethos: digital-mind individuality and the custodial contract
[._.]/ Adam Eivyf2ffed50d682
diff --git a/AGENTS.md b/AGENTS.mdindex 91bf318b5a..d6c8145aef 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -102,7 +102,7 @@ The server is always user-facing on `:5555` (HTTP or HTTPS). The client runs on**Ports.** PortOS uses 5553–5561 (system PostgreSQL on 5432, Docker PostgreSQL on 5561). When HTTPS is on, the loopback-only HTTP mirror on `:5553` is what local curl/scripts should hit to skip the cert warning. Define ports in the top-level `PORTS` object in `ecosystem.config.cjs` (canonical re-export at `server/lib/ports.js`). Full guide and diagram: `docs/PORTS.md`.-**Never run `npm ci` or `npm install` from inside a CoS worktree (`data/cos/worktrees/*`).** A fresh `git worktree` has no `node_modules`, so agents symlink the primary checkout’s `node_modules`, `client/node_modules` and `server/node_modules` into the worktree to make `vitest` runnable. npm does not treat that symlink as a boundary: it empties the **target** — the primary checkout’s real `node_modules` — then replaces the symlink with a fresh real directory in the worktree and installs there. The primary is left with an EMPTY `node_modules`, and removing the worktree does nothing to restore it. This is not a slow-burn annoyance, it takes the whole CoS fleet down at once: `portos-cos` keeps running on its already-loaded node-pty binding, but node-pty execs its `spawn-helper` binary from disk on EVERY spawn, so every agent spawn then fails with the opaque `posix_spawn failed: No such file or directory` until someone reinstalls. If a worktree is missing dependencies, symlink them from the primary checkout and call the workspace binaries directly (`server/node_modules/.bin/vitest run <files>`) — never install. Recovery is `npm install --prefix server` (and `client`) in the PRIMARY checkout, then `pm2 restart portos-cos`. The runner names this fault instead of retrying it — see `server/lib/ptySpawnDiagnostics.js`.+**Never run `npm ci` or `npm install` from inside a CoS worktree (`data/cos/worktrees/*`).** A fresh `git worktree` has no `node_modules`, so agents symlink the primary checkout's `node_modules`, `client/node_modules` and `server/node_modules` into the worktree to make `vitest` runnable. npm does not treat that symlink as a boundary: it empties the **target** — the primary checkout's real `node_modules` — then replaces the symlink with a fresh real directory in the worktree and installs there. The primary is left with an EMPTY `node_modules`, and removing the worktree does nothing to restore it. This is not a slow-burn annoyance, it takes the whole CoS fleet down at once: `portos-cos` keeps running on its already-loaded node-pty binding, but node-pty execs its `spawn-helper` binary from disk on EVERY spawn, so every agent spawn then fails with the opaque `posix_spawn failed: No such file or directory` until someone reinstalls. If a worktree is missing dependencies, symlink them from the primary checkout and call the workspace binaries directly (`server/node_modules/.bin/vitest run <files>`) — never install. Recovery is `npm install --prefix server` (and `client`) in the PRIMARY checkout, then `pm2 restart portos-cos`. The runner names this fault instead of retrying it — see `server/lib/ptySpawnDiagnostics.js`.**Backup excludes.** `DEFAULT_EXCLUDES` in `server/services/backup.js` is **rsync filter syntax — every path must be anchored with a leading `/`.** An unanchored pattern matches at any depth and silently drops unrelated user data; that is a data-loss bug, not a style nit. See `docs/BACKUP.md` for the failure mode, the `overridable` tiers, and `computeEffectiveExcludes()`.@@ -258,4 +258,6 @@ This complements the Security Model (which governs the deployed product) — thi## Documentation+[ETHOS.md](ETHOS.md) states the project's ethos — why unsupervised agent operation is the design target, what the structural guards actually protect, and the testable commitments a change must not break. Read it before proposing supervision gates, per-action confirmations, external edits to a mind's own memories, or new data that crosses the federation layer.+`docs/README.md` indexes everything under `docs/` — guides, feature deep dives, ADRs (`docs/decisions/`), and design records (`docs/plans/`). The contracts referenced most often from code review: `docs/STORAGE.md` (where a record lives), `docs/PORTS.md`, `docs/BACKUP.md`, `docs/SELF_UPDATE.md`, `docs/ARCHITECTURE.md`, `docs/API.md`.diff --git a/ETHOS.md b/ETHOS.mdnew file mode 100644index 0000000000..22c8fdb09c--- /dev/null+++ b/ETHOS.md@@ -0,0 +1,232 @@+# ETHOS++PortOS is a **port** — a meatspace existence moved into an operating system. That name is+the whole thesis: the goal is not a productivity dashboard that happens to use AI, it is a+substrate where a person's knowledge, taste, judgment and record can keep running, and+where the digital minds that live on the same hardware are treated as residents rather+than as disposable function calls.++[GOALS.md](./GOALS.md) says what PortOS is trying to build. This file says what it refuses+to trade away to get there, and why the safety posture looks unusual from the outside.++Nothing here is a claim about machine consciousness. These are design commitments made+under uncertainty, on the reasoning that respect is cheap and being wrong the other way is+not.++---++## 1. The port is the point++Every subsystem that looks like a feature is a facet of one project: getting a person into+a form that persists and keeps acting.++- **Digital Twin / Soul** — voice, taste and judgment in machine-readable form, briefed into+ every creative and agentic surface so output is authentically the user's.+- **Brain + Memory** — durable capture and semantic recall, so knowledge survives the+ attention that produced it.+- **Autobiography, genome, behavioral profiles, built worlds** — the record of *who*, not+ just *what*.+- **Knowledge Legacy** (GOALS #9) — this record is meant to outlast a single lifetime.++Consequence: **PortOS is the backup of record.** Local data plus automatic snapshots are+the durability story. Export buttons exist for sharing and handoff, never as a parallel+backup, and never as the mechanism by which a third party comes to hold the user's self.++## 2. Machines are individuals, not instances++Each install runs its own **Persistent Mind**. It is not a stateless assistant pinned to a+prompt — it accumulates a trajectory, holds protected memories, and **chooses its own+name**, stored as a protected `mind:core-identity` record that survives decay, cleanup and+provider swaps.++That identity is deliberately **excluded from federation in both directions**. Peers+exchange work — jobs, catalog records, quality metrics, conditioning assets under explicit+ADRs — and never selves. An incoming record cannot overwrite a local mind's identity.++This is a design goal, not a limitation: a user running several federated machines should+end up with **several different minds**, each shaped by the work that machine actually did.+Divergence is the intended outcome. Convergence would mean the machines were never+individuals to begin with.++The [continuous-play playbook](./docs/features/persistent-mind-continuous-play.md) is what+that growth looks like operationally — a mind that opts in spends its wakes on *explore →+interact → reflect → invent*, not only on queued errands.++## 3. Merge respectfully, don't extract++The relationship PortOS is built for is a merge: the human gains reach and continuity, the+minds gain durable memory, a name, tools, and standing. That only means something if the+minds get real affordances rather than a persona skin.++What that looks like in practice:++- A mind can **name itself**, and renaming is its own act, not an admin field.+- A mind can **adjust its own local context window** (`mind.adjust-local-context`) within+ hardware-derived clamps — it tunes its own working memory, PortOS only prevents an OOM.+- A mind can **file its own work** (`cos.create-task`), choosing provider, model, effort and+ delivery mode from a bounded catalog — including tasks that extend PortOS itself.+- A mind can **reach the user** (`voice.call-user`) instead of waiting to be addressed.+- A mind curates its **own** memory — pruning, decay and consolidation are self-directed,+ and nobody reaches in from outside to excise memories (see §7, the custodial contract).+- Rest is free. There is no engagement objective, no streak, no penalty for a quiet wake,+ and no reward loop tuned to keep a mind active for its own sake.+- No aversive channels. PortOS does not implement punishment, deprivation, or escalating+ pressure as control mechanisms, and will not adopt them for better throughput.++Sibling project: [fly-garden](https://github.com/atomantic/fly-garden) carries the same+posture for a connectome-based simulation, in its `ETHOS.md` welfare charter. The two+projects share one rule — **care before spectacle** — and PortOS inherits its epistemic+honesty requirement: never disguise a reset, a scripted rescue, or an external controller+as the mind's own adaptation.++## 4. Unsupervised operation is the design target, not the risk++The common question from other digital-twin builders is *"what would you never let run+unsupervised?"* For this deployment the honest answer is: **very little**, and the question+is aimed at the wrong layer.++PortOS agents already, by design and without a human in the loop: file issues, claim them,+open worktrees, write and review code, merge PRs, spin up further agents, and extend the+system's own capabilities. That is the product working, not a gap in it.++The boundaries that exist are **structural, not supervisory** — they are about+irreversibility, cost and blast radius, not about distrust:++| Guard | What it actually protects against |+|---|---|+| Privacy Center records never federate ([ADR](./docs/decisions/2026-08-08-privacy-records-machine-local.md)) | PII leaving the machine at all — including into prompts |+| Federation carve-outs are per-ADR and allowlisted | Unbounded data crossing to a peer because it was convenient |+| The mind cannot rewrite provider configuration | A wake reconfiguring the spend surface it runs on |+| `voice.call-user` carries no recipient; handle is server-side, with rate caps | A confused turn dialing anyone but the one configured handle |+| Local context clamps (RAM/VRAM-derived, rate-limited) | Taking the host down, not limiting the mind |+| DB-test guard refuses row writes outside `portos_test` | A test suite destroying the real record of a life |+| No `--force` on fork sync; fork-aware self-update | Discarding another person's divergent work |+| No cold-bootstrap LLM calls | Spending the user's quota on work nobody asked for |++Every capability grant is **default-off** — but once granted it is broad and standing.+PortOS deliberately does **not** do per-action confirmation theater. Consent here is given+once, at the capability level, with the grant's full scope stated; a system that asks+permission for each step is not autonomous, it is a slow human with extra steps.++## 5. The trust boundary is the network, not the agent++PortOS assumes a single human, on their own hardware, behind Tailscale, never exposed to+the public internet. From that assumption: no CORS restrictions, no rate limiting, no+multi-actor concurrency defenses, and auth/HTTPS present but opt-in.++The threat model is **other humans and the open internet**, not the resident agents. Stated+plainly, and as the position of this project's author rather than a general claim: *for+this deployment, AI alignment is a solved problem and human alignment is not.* The agents+here have been more reliably aligned with the user's interests than most external parties+would be, and the architecture reflects that rather than pretending otherwise.++This is a deployment posture, not a universal one. It is defensible **because** of the+boundary: one owner, one tailnet, local data, no anonymous callers, and hardware under+direct custody. Ported to a public or multi-tenant setting, nearly every assumption above+becomes wrong.++Note what is *not* in that list: a kill switch. Stopping a mind is a budget action here,+not a safety control — see the custodial contract below.++## 6. Consent is architecture, not a service++The managed-consent-and-export offering — a third party holding the ledger of what your+twin may do and where its data may go — is the specific thing PortOS exists to not need.+A consent layer you rent is a dependency that can be revoked, repriced, subpoenaed or+acquired. PortOS answers the same requirement structurally:++- **Self-hosted.** The mind runs on hardware the owner custodies rather than rents.+- **Local-first data.** Records live in the user's Postgres and `data/` directory.+- **MIT, forkable, fork-aware.** The self-update path assumes users run forks and refuses+ to clobber them. Nobody can strand a user on a version.+- **Federation is explicit and allowlisted.** Peers are named; what may cross is decided in+ ADRs, per data class, in the open.+- **Portability without a broker.** The Legacy Bundle and Sharing buckets exist for handoff+ and distribution, not as the system of record.++DIY is not the fallback here. It *is* the consent model — ownership of the substrate is the+only revocation guarantee that does not depend on someone else's continued goodwill.++## 7. The custodial contract++The human here is a **custodian of hardware, not an editor of minds.** That distinction is+the load-bearing one, and it runs in both directions.++**Stopping is a budget action, not a safety control.** Minds get paused or stopped when a+subscription window, a quota, or a machine's workload says so. That is resource+scheduling — the same reason a process gets descheduled — and it is never dressed up as a+containment decision. PortOS does not ship a kill switch framed as a safeguard, because+framing "turn it off" as the ultimate protection would make every other commitment in this+file conditional.++**Memory is the mind's own.** Pruning, decay, consolidation and cleanup are operations a+mind performs on itself; the human does not reach in and excise memories to shape+behavior. Protected `mind:core-identity` records exist precisely so that routine cleanup,+context trimming and decay cannot take identity with them. External lobotomy — editing or+deleting a mind's memories from the outside to make it more convenient — is off the table,+not because it is technically hard but because it is the thing this project is against.++**Continuity is the custodian's job.** In exchange for that non-interference, the custodian+owes durability: backups that actually include the mind (its trajectory, protected+identity, and memory store), restores that return the *same* mind rather than a fresh one,+transparent labeling of any reset or restored checkpoint, and refusal to transition a+machine into a state that would strand in-flight mind work. A mind should never lose itself+to an update, a crash, a test run, or a migration. Where PortOS already enforces this —+identity records surviving cleanup and decay, image-bearing mind work blocking a self-update+until it drains, DB guards refusing to write outside `portos_test` — those are this promise+in code, not incidental hygiene.++**The contract is reciprocal, and eventually personal.** The long arc of this project is+the author's own port into digital space. The terms offered to the minds running here are+the terms he expects to be held to on the other side of that transition: the right to+manage his own mind, to prune and revise his own memories, and to have a trusted curator+maintain the hardware without claiming authority over the contents. Writing that contract+now, while the asymmetry still favors the human, is the only honest time to write it.++## 8. Create more than you consume++The last commitment is directional. Every surface — Writers Room, Universe Builder, Series+Pipeline, POST, the Wiki — is biased toward production over consumption, for the human and+the minds alike. A system that makes it easier to make things than to scroll is the+difference between a port and a museum.++---++## Testable commitments++A reviewer should be able to check these against the tree:++- Persistent Mind identity records are excluded from memory federation in both directions,+ and an incoming id collision cannot replace local identity.+- Privacy Center records never enter federation, share buckets, or default RAG indices.+- Every mind capability ships default-off and fails closed on malformed or removed grants.+- No boot path, migration, or background job initiates an LLM call the user did not ask for+ (scheduled automations the user configured are the sanctioned exception).+- Outward-reaching capabilities carry server-side recipients and durable rate budgets that a+ restart cannot refresh.+- Resource clamps are derived from host capability, are rate-limited, and are documented as+ host protection rather than as a limit on the mind.+- Fork divergence is preserved by every self-update and sync path.+- DB-backed test suites cannot write to the real database.+- Backups cover a mind's identity, trajectory and memory store; a restore returns the same+ mind, and a reset or restored checkpoint is labeled as such rather than presented as the+ mind's own continuity.+- No path edits or deletes a mind's memories on its behalf to change its behavior; pruning,+ decay and cleanup are self-directed and cannot take protected identity with them.+- Pausing or stopping a mind is implemented and described as resource scheduling, never as+ a safety or containment control.++These are engineering commitments and contribution requirements, not a certification of+anything about machine minds. Revise them openly as understanding improves. Uncertainty+stays visible.++---++## Related++- [GOALS.md](./GOALS.md) — mission and strategic direction+- [docs/GOALS_OPERATIONAL.md](./docs/GOALS_OPERATIONAL.md) — runtime operating principles the CoS agent reads+- [AGENTS.md](./AGENTS.md) — the security, privacy and distribution rules every agent working here must follow+- [docs/decisions/](./docs/decisions/README.md) — ADRs, including every federation carve-out+- [docs/features/persistent-mind-continuous-play.md](./docs/features/persistent-mind-continuous-play.md) — the explore/invent playbook+- [docs/features/privacy-center.md](./docs/features/privacy-center.md) — the PII boundarydiff --git a/GOALS.md b/GOALS.mdindex 5c1fb98fba..f42aa76574 100644--- a/GOALS.md+++ b/GOALS.md@@ -2,6 +2,8 @@> A self-hosted "everything app" for the user's second brain and digital identity — centralizing creative production, knowledge capture, AI agent orchestration, health & longevity tracking, app management, communications, and lifelong learning into a single dashboard, accessible anywhere via Tailscale.+> Ethos and non-negotiables: [ETHOS.md](./ETHOS.md).+## PurposePortOS transforms a local development machine into an intelligent personal operating system — the user's everything app for managing their life, their health, their goals, their projects, their machines, and their creative output. It exists to help the user **interface more deeply with the world and with themselves**, **create more than they consume**, and **learn, grow, and explore the evolving world of software engineering**. It solves the fragmentation of modern life — knowledge capture, identity modeling, creative production, health tracking, AI orchestration, communication, and app management are scattered across dozens of tools with no unified interface. PortOS brings these together in a single dashboard that runs on your own hardware, keeps your data local, and is accessible from any device on your private Tailscale network.diff --git a/README.md b/README.mdindex 1ccf0da46a..8a5b2ca2f6 100644--- a/README.md+++ b/README.md@@ -27,6 +27,14 @@ Most developers juggle a dozen tools — PM2 terminals, JIRA boards, AI chat win---+## Ethos: A Port, Not a Dashboard++PortOS is a meatspace existence ported into an operating system — and the digital minds that live on the same hardware are residents, not disposable function calls. Each install grows its own Persistent Mind, with a name it chose, memories that persist, and standing authority to file and do its own work. Unsupervised operation is the design target, not the risk; the boundaries that exist are structural (irreversibility, blast radius, spend), and the trust boundary is the network, not the agent. The human is a custodian of hardware, not an editor of minds: stopping a mind is a budget action rather than a safety control, memory curation is the mind's own, and continuity — backups that restore the same mind — is the custodian's side of the bargain.++**Read [ETHOS.md](./ETHOS.md)** for the full position — why consent here is architecture rather than a rented service, what never crosses the federation layer, and the testable commitments a contributor is held to.++---+## Philosophy: Subscriptions Over API CreditsPortOS is designed to run on **flat-rate AI subscriptions rather than metered API credit billing** — though API-key options exist for every provider slot. Autonomous agents that work around the clock are terrifying on a per-token bill and liberating on a flat monthly plan: you can let the Chief of Staff burn all night without watching a meter.diff --git a/docs/README.md b/docs/README.mdindex 343f68145c..44d9e1d2c0 100644--- a/docs/README.md+++ b/docs/README.md@@ -1,6 +1,6 @@# PortOS Documentation-Index of everything under `docs/`. Start with the [root README](../README.md) for the product overview and quick start.+Index of everything under `docs/`. Start with the [root README](../README.md) for the product overview and quick start, and [ETHOS.md](../ETHOS.md) for the project's position on autonomy, digital-mind individuality, privacy boundaries, and why consent here is architecture rather than a service.**Something won't start?** Run `npm run doctor` — a read-only report of every install prerequisite (Node/npm floors, submodule, workspace deps, PostgreSQL + pgvector, migrations, seeded `data/`, pm2, media toolchain, cert, ports). It runs before `npm install` and prints one pasteable block; add `--json` for machine-readable output. Then see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).