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
ADR: Tribe Relationship Graph + Universe Render-Runs Stay Machine-Local
- Date: 2026-06-26
- Status: Accepted
- Related: issue #1724 (folded from the #1561 full-sync gap matrix),
server/services/tribe.js,server/services/universeBuilder/db.js,server/services/memorySync.js,docs/STORAGE.md.
Context
Epic #1561 ("full-sync federated node pairs") audited every data domain for
whether it mirrors across a federated peer pair. Two db-primary PostgreSQL
domains were left undecided and folded into #1724 for a sync-vs-local call:
- Tribe / relationship graph —
tribe_people,tribe_touchpoints,tribe_memory_links. Not inPEER_SUBSCRIBABLE_KINDS(server/services/sharing/peerSync.js) and not adataSyncsnapshot category. Local-only today. - Universe render-runs —
universe_runs(one row per render, capped at 200 globally). Read through Postgres bydataSyncwhen it loads universes, but the run rows themselves are never included in any snapshot or push.
The acceptance criterion is a documented decision for each, with anything that stays local recorded in the #1561 gap matrix as intentionally-excluded.
Decision
Both stay machine-local. Neither is federated.
Tribe graph — local, by precedent
PortOS already federates memory nodes (memories, via the sync_sequence
pull-cursor in server/services/memorySync.js) but deliberately keeps the
relationship graph between them instance-local. memorySync.js states it
plainly:
memory_links (relationships) are not synced — only the memories table is replicated. Relationship data is instance-local.
The Tribe graph is the same shape — a personal relationship/CRM graph — and is structurally coupled to two domains PortOS holds machine-local on purpose:
tribe_memory_linksis a relationship layer overmemories, directly analogous to thememory_linkstable that is already, by design, not federated. Syncing tribe's memory cross-links while the brain's ownmemory_linksstay local would be internally inconsistent.tribe_touchpointscarrycalendar_account_id/calendar_event_idpointing at a per-machine connected-calendar OAuth integration. Those refs do not resolve on a peer that has a different (or no) calendar connection, so a touchpoint synced verbatim would carry dangling, machine-specific provenance.
Federating people + touchpoints while silently dropping the memory links and calendar refs would produce a lossy, incoherent partial mirror; federating them faithfully would first require federating the calendar-account integration layer, which is inherently machine-local. Keeping the whole Tribe graph local is consistent with the established "relationship data is instance-local" boundary.
Universe render-runs — local, regenerable cache
universe_runs is a regenerable render-output cache, not durable source
data. The durable source — the universe record itself — already federates via
the dataSync snapshot/push model, so a peer reconstructs its own run history
by rendering. Two properties make federation actively wrong rather than merely
unnecessary:
- The cap is 200 rows globally (newest-across-all-universes, trimmed inside
appendRun), not per-universe. Two peers each generating runs would continuously evict each other's rows to honor one shared cap — churn with no durable value. - Runs are append-only outputs of a deterministic-enough render step; there is nothing in a run a peer cannot reproduce locally on demand.
This matches the existing classification in docs/STORAGE.md, which already
describes universe_runs as "local-only, capped 200, never federated."
Consequences
- No new
PEER_SUBSCRIBABLE_KINDSentries, nodataSynccategories, and no newPORTOS_SCHEMA_VERSIONSkeys — so none of the schema-version coverage guards (peerSyncRECORD_KIND_SCHEMA_CATEGORIES, dataSync,schemaVersions) are touched. - The decision is pinned by a guard test — the "keeps the Tribe graph +
universe render-runs intentionally OUT of the sync graph" case in
server/services/sharing/peerSync.test.js(alongside the other gate-map completeness guards) — assertingtribe_*anduniverse_runsare absent from the sync graph. Federating either later is a conscious act: update that test and this ADR alongside the wiring. - If the brain
memory_linksrelationship graph and the calendar-account layer are ever federated, revisit Tribe — at that point the coupling argument no longer holds and people + touchpoints could mirror cleanly.
Alternatives considered
- Federate the Tribe graph now (mirror the authors/artists record-kind pattern). Rejected: it crosses the deliberate "relationship data is instance-local" boundary, and the memory-link + calendar-ref coupling makes a faithful mirror impossible without first federating two other machine-local layers.
- Federate
universe_runsas append/LWW with the 200-cap honored on the receiver. Rejected: a global cap shared by two independent producers guarantees mutual eviction churn, and the data is regenerable, so the mirror buys nothing the universe-record sync doesn't already provide.