Appearance
V2 Clarity Plan
This document is a clarity-first snapshot of the current Soma repo. It combines:
- the current architecture as implemented today
- the main sources of confusion and drift
- a documentation cleanup plan
- a split-readiness plan for backend vs desktop repos
The goal is not to describe the ideal future system. The goal is to describe the system that actually exists now, identify what is transitional, and define how to make the repo legible again.
Executive Summary
The repo is not random chaos. It is a real, multi-surface system carrying several active transitions at once.
Today the project is effectively three things in one repository:
- a backend/distributed systems platform under
backend/ - a substantial Electron desktop app under
desktop/soma - a second, less mature desktop app under
desktop/tapia
The main clarity problem is not absence of structure. The main problem is that current docs, plans, historical notes, and unfinished migrations are mixed together and presented with similar weight.
The result is that a reader cannot quickly tell:
- what is implemented
- what is transitional
- what is historical
- what is only planned
That is the core problem this plan addresses.
Current Architecture
Top-Level Shape
The repo is physically organized in a mostly sensible way:
backend/: Rust workspace for peer, daemon, server, infra, storage, and networkingdesktop/: Electron apps and shared desktop packagesproto/: shared contracts for daemon, agent, and membership conceptsdocs/: user-facing and developer-facing documentationdeploy/: infrastructure manifestsprd/: product requirement placeholders and drafts
The problem is not top-level shape. The problem is that the repo root and docs mix code-adjacent truth with planning and migration artifacts.
Backend Reality
The backend is real and already substantial.
Implemented backend binaries include:
soma-daemon: the desktop backend; owns UDS gRPC, local peer identity, SQLite, blobs, spaces, pages, documents, and join flowssoma-botd: a hosted peer/bot with read-only bot mode and admin modesoma-agentd: a local UDS gRPC worker for chat, embeddings, rerank, and Yjs merge/drift handlingsoma-relayd: relay infrastructure servicesoma-rendezvousd: rendezvous discovery servicesoma-bffd: HTTP backend-for-frontend for model/provider accesssoma-serverd: currently a thin wrapper runner, not a true unified backend
Important backend ownership lines:
soma-peerowns shared libp2p runtime and peer protocolssoma-membershipowns join/membership/issuer/mailbox logicsoma-storageowns persistence for memberships, requests, decisions, documents, pages, blobs, and peer keyssoma-vdfsowns content-addressed blob primitives and filesystem blob storage
Implemented backend features that appear genuinely end-to-end:
- join request and join decision flows
- daemon-managed spaces, memberships, pages, and documents
- daemon-managed blob upload/read/list/metadata
- peer blob fetch by CID
- bot manual approval and mailbox retry paths
- agent chat/embed/rerank/drift flows
- relay/rendezvous connectivity services
Desktop Reality
The desktop side is uneven.
desktop/soma is the real product UI today. It includes:
- startup gating on daemon readiness
- Electron main/preload/renderer boundary
- space list/settings/member flows
- page tree and editor flows
- blob upload and custom
soma-blob://rendering - settings and local AI UI
- daemon event consumption and cache invalidation
desktop/tapia is real as a desktop shell, but its feature depth is far behind Soma. It still uses local/stubbed exercise and leaderboard logic in places where Soma already relies on daemon-backed state.
Shared desktop packages exist, but several still carry migration residue:
desktop/desktp-proto: real and importantdesktop/desktp-config: useful, but docs and package scripts are drifteddesktop/desktp-data: real but still part of an unfinished persistence storydesktop/desktp-editor: real shared editor packagedesktop/desktp-ui: useful, but still contains Tauri-era leftovers
Shared Contract Reality
The strongest coupling between backend and desktop is not accidental code import. It is the shared runtime contract:
proto/daemon/v1/daemon.protoproto/agent/v1/agent.proto- daemon event stream semantics
- socket naming and stage conventions
- blob URL shape and daemon read semantics
That shared contract layer is currently real, but it is not yet treated as a clean, versioned product boundary.
What Is Making the Repo Feel Chaotic
The repo is carrying multiple transitions at the same time.
1. Yoopta -> TipTap Is Incomplete
There is a real editor transition in progress. New editor work is TipTap-based, but names in proto, events, and some storage surfaces still refer to Yoopta.
Examples:
proto/daemon/v1/daemon.protobackend/bins/daemon/src/grpc.rsdesktop/soma/src/main/services/daemon-client.tsplanning/active/plan-02-tiptap-editor.mdplanning/active/weekend-task-list-tiptap-cutover.md
This creates a semantic mismatch between current UI reality and contract naming.
2. Frontend Persistence Is Mid-Migration
Persistence still spans multiple concepts:
- daemon-owned canonical state
- Electron main
electron-store - React DB projections and local UI state
- some historical or compatibility layers
This is documented in planning/active/plan-03-tanstack-db-migration.md and visible in desktop/soma/src/main/services/app-data-store.ts.
3. Tauri -> Electron History Still Leaks Into Current Code
Tauri-era concepts are still visible in code and docs, especially in shared UI and historical docs.
Examples:
desktop/desktp-ui/package.jsondesktop/desktp-ui/src/hooks/use-tauri-store.tsdesktop/desktp-ui/src/components/layout/window-chrome.tsxdocs/src/archive/tauri-commands.md
Even if they no longer define the runtime, they still consume attention and erode trust.
4. Docs Present Different Time Horizons As If They Were Equal
The current docs mix:
- current implementation truth
- migration notes
- planning docs
- TODO-only PRDs
- stale references
This is the biggest documentation problem in the repo.
5. Names and Ownership Boundaries Drift
Several names require historical explanation before they make sense:
desktp-*VDFvsVDFSserver-daemon- lingering
Yoopta*event names
None of these are fatal individually. Together they create constant low-grade uncertainty.
Current Weak Points and Transitional Seams
The following areas should be considered transitional or suspicious until cleaned up.
Contracts Ahead of Implementations
Some proto surfaces describe APIs that are not implemented or not fully real yet.
Examples include:
IssueIssuerCapabilityDiscoverSpaces- service definitions in
proto/space/v1/membership.protothat do not appear to be bound as live servers
This creates false confidence when reading contracts.
Partial or Uneven Enforcement
Some security and lifecycle behavior appears asymmetric or partial:
- signature verification differs across surfaces
- revocation is incomplete as a distributed concept
- deletion cleanup appears incomplete for pages/blobs/blob refs
- local socket permissions are broader than expected
This does not mean the system is fake. It means the contracts and operational guarantees need a sharper distinction between implemented and planned.
Desktop Shell and Placeholder Features
Soma still includes visible shell-stage areas and placeholders:
- placeholder join screen
- sparse home screen
- command palette filler/demo items
- TODO comments in feature-adjacent UI
Tapia is even more transitional in scope.
Docs and Code Drift
Some docs already describe behavior that is no longer current, especially around:
- bot auto-approval behavior
- agentd access topology
- desktop config build assumptions
- Tapia scope
- blob behavior history
The Documentation Strategy Going Forward
The repo needs one rule:
Visible docs should describe only current, working, or finished behavior.
Anything else should be moved out of the main docs surface.
What Should Stay In Docs
Docs should contain only:
- current architecture that matches implementation
- current developer workflows that work today
- current operations/deployment guidance
- current contracts that desktop/backend depend on
- ADRs that still explain live constraints
What Should Not Stay In Docs
The main docs surface should not contain:
- speculative future architecture
- migration notes presented as current truth
- TODO-only PRDs
- abandoned or stale design notes
- historical Tauri or cutover guidance unless clearly archived
New Documentation Model
Recommended structure:
docs/src/00-overview.md: short repo and product overviewdocs/src/01-glossary.md: shared language onlydocs/src/02-v2.md: this clarity map and restructuring plandocs/src/architecture/: only current, implementation-matching architecture docsdocs/src/development/: only current development workflowsdocs/src/operations/ordocs/src/deployment/: current operational guidancedocs/src/archive/: optional; only if historical material is still usefulplanning/: active plans, migrations, spikes, and cutover notes
File-by-File Documentation Disposition
This section is the concrete cleanup table.
Keep
Keep, but verify accuracy and tighten language where needed:
docs/src/00-overview.mddocs/src/01-glossary.mddocs/src/index.mddocs/src/security/threat-model.md- architecture docs that still reflect implementation, especially peer connectivity, relay/rendezvous, and deployed backend/runtime behavior
- ADRs that explain still-visible design choices
Rewrite
These should remain but be rewritten to match current truth:
README.mdAGENTS.mddocs/src/getting-started/index.mddocs/src/development/daemon-grpcurl.mddocs/src/development/agentd-ipc.mddocs/src/development/desktop-config.md- any docs that still present Tapia as backend-integrated to the same degree as Soma
- any docs that present
Yooptaterms as if they are still the UI/editor truth rather than contract residue
Move To Planning
These should no longer be treated as docs. They are planning artifacts:
planning/active/plan-01.mdplanning/active/plan-02-tiptap-editor.mdplanning/active/plan-03-tanstack-db-migration.mdplanning/active/plan-04-command-palette-cmdk.mdplanning/active/plan-05-space-enrollment-settings-mvp.mdplanning/active/weekend-task-list-tiptap-cutover.md
Recommended destination:
planning/active/for still-relevant workplanning/done/for completed plans worth retaining briefly
Archive
Archive only if the document still explains a strange current constraint or migration legacy:
docs/src/archive/tauri-commands.mddocs/src/archive/backend-refactor-notes.md- old cutover notes that explain naming or packaging compatibility
Recommended destination:
docs/src/archive/
If a historical doc has no ongoing explanatory value, delete it instead of archiving it.
Delete
Delete or replace these unless they are actively being filled with real product truth:
prd/000-overview.mdprd/010-spaces-topics.mdprd/020-docs-realtime.mdprd/030-chat.mdprd/040-agent.mdprd/050-permissions-sharing.mdprd/900-nonfunctional.md
As they currently stand, these files mostly create the impression that product truth exists somewhere else when it does not.
Recommended Documentation Rules
Adopt the following rules for all docs work.
Rule 1: Current Docs Must Match Running Code
If a feature is not implemented or not operable today, it should not appear in current docs as a normal documented feature.
Rule 2: Plans Are Not Docs
Plans belong in planning/, not in docs nav and not at the repo root.
Rule 3: Historical Notes Must Be Explicitly Archived
If a document describes prior architecture, it must live under archive/ and say so in the title.
Rule 4: Contracts Need Their Own Section
Daemon proto, agent proto, event streams, socket conventions, and packaging/release conventions should be documented as shared contracts, separate from product prose.
Rule 5: Delete Aggressively
If a document is stale, misleading, TODO-only, or duplicated, delete it unless it explains a live compatibility constraint.
Split Readiness: Backend vs Desktop
The repo can probably split in the future, but it should not split yet.
Why Not Yet
The split blockers are not physical directory layout. The blockers are shared contracts and release coupling.
Current hard coupling points:
- shared
proto/source used by both Rust and TypeScript - direct desktop use of daemon and agent gRPC contracts
- socket/stage naming assumptions shared across repos
- daemon event stream semantics consumed by desktop
- bundle packaging that depends on both backend and desktop release outputs
- root tooling and docs that assume one checkout
Preconditions Before Splitting
Before any repo split, do the following:
- make
proto/a versioned contract surface - decide whether desktop talks to both daemon and agentd, or only daemon
- define artifact naming and manifest contracts for packaging
- isolate desktop-only tooling from backend workspace assumptions
- split docs into backend-owned, desktop-owned, and shared-contract docs
- ensure desktop can test against released backend artifacts instead of same-commit source
Recommendation
Recommended sequence:
- first: clean docs and contracts
- second: stabilize shared interfaces
- third: simplify ownership and release boundaries
- fourth: evaluate repo split
So the recommendation is:
split later, after a contract-extraction phase; do not split now
Concrete Cleanup Phases
Phase 1: Truth Inventory
Create a single tracked inventory of:
- implemented features
- transitional features
- planned-only surfaces
- stale docs
- ownership boundaries
This file is the starting point for that inventory.
Phase 2: Root Cleanup
Reduce visual noise at the repo root.
Actions:
- move plan files into
planning/ - move local runtime state into one ignored runtime directory convention
- keep root focused on code roots, top-level config, and a small number of canonical entry docs
Phase 3: Documentation Cleanup
Actions:
- remove TODO-only or misleading docs
- archive truly historical notes
- rewrite current docs to match implementation
- ensure nav points only to trusted, current material
Phase 4: Contract Cleanup
Actions:
- document what parts of proto are implemented vs declared-only
- document daemon event semantics as a contract
- document socket/stage conventions as a contract
- document packaging artifact expectations as a contract
Phase 5: Naming Cleanup
Actions:
- decide the long-term strategy for
desktp-* - decide the long-term strategy for
VDFvsVDFS - reduce lingering
Yooptanaming once contract migration is safe
Phase 6: Split Readiness Review
Only after the previous phases, reassess:
- backend repo viability
- desktop repo viability
- whether
proto/should live in a shared contracts package/repo
Suggested Immediate Actions
If the goal is maximum clarity with minimum disruption, do these first:
- add this file and make it part of the docs entry flow
- move all root
plan-*.mdfiles intoplanning/ - remove or archive historical docs from
docs/src/development/ - delete TODO-only PRD files unless they are about to be actively maintained
- rewrite
README.md,docs/src/index.md, anddocs/src/getting-started/index.mdso they only describe current working behavior - create one follow-up contract doc for shared backend/desktop interfaces
Final Position
The repo is complex, but not fundamentally incoherent.
Its main problem is that implementation truth, migration state, and historical residue are not clearly separated. The documentation cleanup should therefore be treated as architecture work, not cosmetic work.
Once the docs reflect only current and working reality, the codebase will feel dramatically less chaotic even before any structural split happens.