Diagrams
Visual explanations and diagrams.
System diagrams
How the whole app connects, verified against code. Companion to the generated file map. Each diagram is single-purpose and tagged by kind — read the one you need, not a wall.
Three tracks:
[Concept]— what the system is (the models you reason with).[Flow]— how work moves (pipelines, state machines, request paths).[UI]— what you see (surface layouts and their component trees).
The whole map in one file: generated ALL.md — every diagram below concatenated in this README's order,
generated by npm run gen:diagrams (do not hand-edit). Use it to paste the entire system into a model
or to review the shape of everything at once; the single-purpose files stay the thing a human reads.
npm run gen:diagrams:mermaid writes the graphs-only variant.
Concepts — the models
| Diagram | The idea |
|---|---|
| Three layers of opinion | Threads (settled) · Streams (present) · Positions (the live forward read) |
| Domain spine | System · World · Fate — the measured substrate opinion is held over |
| Projection anatomy | Reading · Reasoning Graph · Signal — how a live forward read is anchored and re-priced |
| Phase graph | The descriptive working model creativity inherits — one opt-in lever, uniform reach, evidence surfaces excluded |
| Entity Interpretation Graph | foundation — evidence profile → selected ordered context → situated action field, with Will attributable but unstored |
| The Program loop | Research → Opinion → Merge → Position — the machine that keeps all three current |
| Forces — derivations | what is computed on read vs stored — pure derivations over the spine |
| AI model routing | tier · category · profile — how a call picks its model, and how the fleet re-tunes |
| Platform model | Two products · three authorities (platform role / entitlement / people) · one host-agnostic daemon |
| World | direction — Domain + Scenario → preserved branch states → parallel, clocked, multi-camera worlds driven through MCP |
Flows — how work moves
| Diagram | The path |
|---|---|
| Access gate | who gets in, and to what — the decision ladder |
| Navigation | the page graph + the deep-link lifecycle (routes.ts → useUrlIntent → navigateTo → stage history) |
| Reducer taxonomy | one writer, 22 slices, 247 actions — the single-writer terminus + ACTION_META |
| Operation lifecycle | a Tier-2 op from dispatch → streamed events → commit + nextMoves |
| Scheduler | cadence → armed timer → gates (week / spend / serial / concurrency) → fired run |
| Onboarding | 6-step stepper → background runner → live Constellation |
| Domain creation | three on-ramps → one canonical Domain record |
| Human loop | Orient → Judge → Steer → Learn → Refine over the Program |
| Gameplay loop | current loop audit → nested training loop → proof ladder from remembered Domain to trained agency |
| Stream lifecycle | evidence-gathering lifecycle through Merge to canon |
| Position lifecycle | live Position re-pricing, re-grounding, and retirement |
| Directive lifecycle | staged human intent through a later Program run |
| Maintenance run | one converter → the research run (Firecrawl → priors) |
| Research pipeline | the ONE Research driver (op + dashboard via ResearchPort) → Firecrawl → Articles → priors → brief/refine/monitor/tutor |
| Extraction pipeline | corpus → chunk → concurrent extraction → re-extract Fate / System → domain |
| Reasoning graph engine | three entry points → inference-over-substrate graph → sequential path |
| Merge resolution | mature Streams → proposal → Merge → Reasoning Graph → new Arc |
| Story pipeline | Program events → registry → editorial → projection → feed |
| Sync protocol | master ⇄ clients — relayed pushes, echo suppression, catch-up |
| MCP action chains | how an AI navigates the tool surface by affordance — the record chain and the central-plane chain |
| MCP affordance map | generated — the whole tool graph drawn at three altitudes (realm → group → tool) |
| MCP runtime | stdio + HTTP relay, session auth, Director attribution, and the one-writer terminus |
| Engine pipeline | UI → engine/AI → canonical record → cache (one writer) |
| Scenario loop | the game state machine, its engine data-flow, and how to drive the game headless over MCP |
| Cache coherence | hydrate / adopt / live — the disposable-cache invariant |
| Hosted sign-in | one gateway session across each instance's own domain |
| Release & deploy | source → CI → the 3 deploy targets → image maintenance → fleet roll |
| Weekly update | the Friday GitHub business-summary CI pipeline |
Not yet diagrammed (deliberately): World's concrete runtime—turn cadence, per-seat context, information propagation, economies, and scoring—remains product direction. The maintained World diagram maps the concept; the Gameplay loop maps the progression hypothesis without pretending those World mechanics ship. A concrete runtime flow lands when the first build establishes a real path.
UI — what you see
| Diagram | The surface |
|---|---|
| Home console | GatewayShell regions — spine + home tabs |
| Gateway public surfaces | landing reveal, public routes, plans, account handoff, and MCP setup |
| Gateway admin console | GatewayConsoleShell — role-aware Users · Fleet · Devices · Account · Domain |
| Auth & access surfaces | AuthShell — sign-in, Director welcome, MCP credential setup |
| Workspace shell | WorkspaceShell regions — the cockpit around the Stage |
| Center views | SectionRail → StageBar → stageView → component |
| Inspector | the right UtilityRail / UtilityPanel and its detail bodies |
| Domain settings | DomainSettingsModal tabs — Direction (AI profiles) · Style · POV · Audio |
| Onboarding workspace | sidebar progress rail → 6-step container → per-draft switcher |
| Extraction jobs | ExtractionShell — jobs list → live detail → new-job setup |
| Constellation | ConstellationShell tabs — the portfolio container |
| TopBar & run surfaces | menus · modals · capture / generate / explore / review |
| Mobile | the separate focused path — workspace · constellation · home |
| Scenario UI | the poker-table layout + component tree |
Concepts
10 articles- AI model routing — tier · category · profile [Concept]Public
Every LLM call funnels through one boundary (callGenerate) and asks for its model by what kind of work it is , never by a hardcoded id. A three level indirection turns "this is a prose call" into "run it on this OpenRouter model" — and lets the whole fleet re tune with a one line change or a...
- Domain spine — System · World · Fate [Concept]Public
Every expert's canonical state rests on one measured spine. Three kinds of knowledge, kept apart because they answer different questions and are recovered differently. Scene deltas mutate the spine; forces (derivations) are deterministic reads over it — never re parse generated prose to recover...
- Entity Interpretation Graph — evidence into selected context [Concept]Public
The Entity Interpretation Graph (EIG) is an entity scoped, derived explanation over canonical evidence. It reuses the graph family's typed ontology and the Phase graph's immutable snapshot lifecycle, but its terminal is a field of tendencies rather than a plan or action.
- Forces — deterministic derivations [Concept]Public
Half of what an expert "knows" is never stored. Forces are pure, stateless computations recovered on read from the domain's deltas — the inverse of generation. Storing them would create a second source of truth that drifts from the spine, so the domain computes them every time instead.
- Phase graph — the working model creativity inherits [Concept]Public
The Phase Reasoning Graph (PRG; Phase Graph in compact UI copy) is the descriptive layer of graph thinking: a mined working model of the world's meta machinery — its patterns, conventions, attractors, agents, rules, pressures, and landmarks. It answers "how does this world WORK?" where the...
- Platform model — two products, three authorities, one daemon [Concept]Public
The control plane around a running instance. Four ideas that are easy to conflate — kept apart here. Shipped code: src/app/(gateway), src/features/gateway, src/lib/server/gateway, supabase/migrations/, electron/. Design doc: GATEWAY.md. Enforcement: PERMISSIONS.md.
- Projection anatomy — Reading · Graph · Signal [Concept]Public
A Projection is the third layer of opinion (three layers): a live forward read that is never marked true or false — it is the reasoning behind a Position , and it is the Position that gets graded (PIVOT). It is not a single number — it is an assembly of three parts that keep it honest and keep...
- The Program loop [Concept]Public
The Program is the autonomous machine loop that keeps an expert's three layers of opinion current: Research → Opinion → Merge → Position . It runs daily from schedules (manual or autopilot).
- Three layers of opinion [Concept]Public
An expert's opinion is held in three complementary layers, kept distinct. All three are predictive reads over mutually exclusive outcomes, moved by evidence — what separates them is the WRITE PATH , not the question type (outcome first refactor, 2026 08 03): a Thread is canon, a Stream stages a...
- World — the living graph-worldPublic
[Concept · product direction] How a Domain, Scenario, branches, situated context, MCP Will, and parallel Worlds relate. This is a concept map, not shipped runtime wiring. The owning contract is the World specification.
Flows
27 articles- Access gate [Flow]Public
AccessProvider (lib/core/reducer/access context) wraps every route and decides what renders before the page. The decision ladder:
- Cache coherence — server-of-record [Flow]Public
The intricate invariant: serverVersion ≥ cacheVersion, always → the browser is a disposable cache the server can always rebuild, even after the user clears everything (the browser DEK included).
- Directive lifecycle [Flow]Public
A Directive carries human intent into a later Program run. Its state makes the distinction visible between what the operator has staged and what the machine has actually applied.
- Domain creation [Flow]Public
Every on ramp terminates in the same canonical Domain record. The UI's CreationWizard and the headless operations differ only in how they prepare the input; a malformed model response is a failed generation, not a second repair path.
- Engine pipeline — data · AI · persistence [Flow]Public
How a change flows from the UI through the deterministic engine and AI, and how state lands in the canonical record and mirrors to the browser cache. The load bearing rule: the on disk record is canonical; IndexedDB is a rebuildable projection.
- Extraction pipeline — text → domain [Flow]Public
How a raw corpus becomes a measured domain: chunk the source, extract scene structure concurrently, reconcile and assemble it, then enrich the assembled Domain through resumable specialist phases. The imperative shell (a singleton runner) orchestrates; extraction calls pass through the one model...
- Gameplay loop — from retained knowledge to trained agency [Flow · product direction]Public
Meridians does not yet have one complete gameplay loop. It has a strong initial knowledge payoff, a machine maintenance loop, a shipped Scenario turn, an incubating Episode form, and a detached learning surface. This diagram keeps those truths separate, then defines the smallest loop worth...
- Hosted sign-in across instance domains [Flow]Public
Email/mobile stay the sign in methods ; the work is making one gateway session valid on each instance's own hosting domain (subdomain or custom) — via a token hand off , not a shared cookie. Context: the platform model.
- Human loop [Flow]Public
The Program maintains the model through Research → Opinion → Merge → Position . The human loop orients first and escalates only when a consequential judgment is needed.
- Maintenance creation + the research run [Flow]Public
Reminders and research cycles are created the same way across Domain, Constellation, and Onboarding — a method chooser, one shared planned→record converter , then the cycle runs on cadence.
- MCP action chains — how an AI navigates the surface [Flow]Public
The MCP surface shares one bounded static catalog and materialises its first class domain capabilities from the daemon manifest (built from the same QUERY SPECS / OPERATION SPECS / ACTION META the docs use). Every result carries a uniform envelope { ok, working set, result, delta?, affordances?...
- MCP runtime — transports, trust, and attribution [Flow]Public
How local and remote clients reach one generated tool catalog, and where authority becomes an attributed record write. Capability navigation is documented separately in MCP action chains.
- Merge resolution — Streams + Notes → Merge → Graph → Arc [Flow]Public
The Merge task closes the present day layer. On the domain's cadence it folds every mature Stream and every ready Note into canon through one group Merge that synthesises a Reasoning Graph (opt in) and continues the story with a new Arc. It is autonomous — always armed, no per fold approval. The...
- Navigation — pages, deep-links & how you move [Flow]Public
How the app's routes connect, and how a deep link intent travels from the URL to a selected artifact. The URL [id] is the source of truth for the active domain; src/lib/core/routes.ts is the single source of URL truth — every path and query deep link is built there, and consumed through one seam.
- Onboarding — build a Constellation from intent [Flow]Public
A 6 step stepper (ONBOARDING STEPS in lib/core/onboarding.ts) turns interests into a live, maintained Constellation. The document is a proposal the user shapes; a background runner materialises the real records; a completed onboarding is an immutable genesis record.
- Operation lifecycle — a Tier-2 op, dispatch to commit [Flow]Public
A Tier 2 operation is the async, streamed machinery that precedes a mutation: it does the I/O (LLM calls, Firecrawl, media render), streams progress, and ends by dispatching reducer actions. 111 ops across 35 handler modules, each a first class Swagger style contract in one catalog. This is what...
- Position lifecycle [Flow]Public
A Position holds the reasoning and committed consequence together. Evidence can re price or re ground the live read; market outcomes score the commitment across the book without feeding back into model tuning.
- Reasoning graph engine — three entry points [Flow]Public
The causal scaffold that grounds planning, projections, and merges. One graph shape — inference nodes over a spine substrate — generated from three different contexts, then rendered as a sequential path for prose. This is the why behind a Reading (projection anatomy) and a Merge (tutor resolution).
- Reducer taxonomy — one writer, many slices [Flow]Public
State changes only through reducer actions — 247 of them, composed from 22 slices , every one classified in a single exhaustive policy table. This is the single writer discipline made concrete: how a mutation is gated, reduced, and audited without any alternate write path.
- Release & deploy [Flow]Public
One repo, three independent deploy targets — the Vercel gateway , the desktop app, and the Fly instance image — plus the running fleet . This is how a source change reaches each, and why the fleet only moves on a deliberate roll (no commit silently restarts a user's always on expert).
- Research pipeline — sources → Firecrawl → the Research pass [Flow]Public
The Research task's evidence engine, now held in one canonical driver — runResearchPipeline (src/lib/engine/research/run pipeline.ts) — called by both shells (the headless research run op and the interactive ResearchRunDashboard) through a ResearchPort. The shells adapt runtime concerns (commit...
- Scenario — the game loop [Flow]Public
A game is a branch ; a GameRoom runs the turn loop as a phase machine. The player facing loop is Brief → Prepare → Commit → Consequence . Generation alternates with deliberate player action: the engine briefs the seat, the seat prepares its reading, the seat commits, then the world plays the...
- Scheduler — cadence to fired run [Flow]Public
The headless Program scheduler is the time based orchestration layer: it reads enabled schedules from the record, arms Croner timers, and on each tick runs a Research/Opinion/Merge/Position operation to completion — under concurrency, serialization, and spend gates. The pure when to fire logic...
- Story pipeline — events → a legible feed [Flow]Public
Every Program task (program loop) emits a canonical DomainProgramEvent. Turning those into an expert forward feed is a pure pipeline : registry → editorial → projection → surfaces. Stories are a projection, never a second source of truth.
- Stream lifecycle [Flow]Public
A Stream gathers current evidence until it is settled into canon through a Merge, or is closed and later reopened when the question becomes live again.
- Sync protocol — master ⇄ clients [Flow]Public
One daemon owns the record; N browsers connect to it. The sync layer is the two tier replication protocol underneath cache coherence: how a client's optimistic edit reaches the master, how the master's echo suppresses a re write, and how a reconnecting client catches up.
- Weekly update — Friday GitHub business summary [Flow]Public
CI automation, not app runtime: turns a week of git + PR activity into a plain English business update committed to main. Manual dispatch only since 2026 08 13 (the Friday cron is off — unpaid Actions minutes); because every run backfills the missing Fridays, running it on demand loses no week....
Root
0 articlesUi
14 articles- Auth & access surfaces [UI]Public
The sign in and credential surfaces — the doorway into an instance and the gateway. One shared two panel frame (AuthShell) hosts the caller's controls; distinct flows sit behind it for members, Directors, and MCP credentials. Auth is local first; the control plane is a separate, non blocking layer.
- Center views [UI]Public
Navigation is two layers: the SectionRail picks one of 5 sections, the StageBar switches the stageView within it. Stage.tsx is a render switch on state.stageView ( 33 modes); the persisted literals are the source of truth (view state.ts).
- Constellation surface [UI]Public
A constellation is the control panel over a portfolio of member Domains. ConstellationShell tabs group into three bands (TAB GROUPS); on a phone they collapse to seven pill groups around a centre Chat (see ui/mobile).
- Domain settings [UI]Public
The per Domain configuration modal — where a Director tunes how the expert authors : its generation direction, prose style, point of view, audio, and the AI model allocation behind it all. A tabbed DomainSettingsModal; Director gated.
- Extraction jobs [UI]Public
The surface for turning a corpus into a Domain: a jobs list, a per job detail with live progress, and a new job setup. This is the UI over the extraction pipeline — the same runner that onboarding's Build step drives in the background.
- Gateway admin console [UI]Public
The control plane dashboard: one role aware chrome (GatewayConsoleShell) wrapping a set of console pages. What a viewer sees depends on their platform role and entitlement (platform model) — admins run the business, a paying Director manages billing, an unpaid visitor sees plans.
- Gateway public surfaces [UI]Public
The public path explains the outcome first, then reveals the maintained system, its reasoning, the runtime, and the purchase boundary. These routes use the public Gateway shell; authenticated account and host controls continue in the Home console.
- Home console [UI]Public
The regions of GatewayShell — shared by the sign in portal and the home stage, so signing in flows straight into the console (same spine, different stage).
- Mobile [UI]Public
Mobile is a separate focused path, not a squeeze — a different component tree around the same store. Three surfaces collapse to pill navigation.
- Onboarding workspace [UI]Public
The domain genesis surface: a full screen workspace with a progress sidebar and a center step container. Six steps carry a constellation of drafts from an idea to extracted, maintained Domains. Two steps (Capture, Maintain) let you move between drafts in any order; the rest are linear.
- Right inspector [UI]Public
The right popout — UtilityRail (icon strip) picks a tab; the panes render in UtilityPanel.tsx (separate from the center views). The inspector tab body is driven by viewState.inspectorContext via renderInspector(); detail bodies share the DetailKit presentational vocabulary.
- Scenario UI — the poker table [UI]Public
One metaphor, skinned by the app theme: a poker table . The whole game is a single chrome less fullscreen window (ScenarioModal); ScenarioShell lays it out like the domain WorkspaceShell so the two feel like one app. The active tab follows the human loop ( Brief → Prepare → Commit → Consequence...
- TopBar menus & run surfaces [UI]Public
The workspace TopBar's menus and the modals they open, plus the run/output surfaces reachable from the shell.
- Workspace shell [UI]Public
The regions of WorkspaceShell — a stable cockpit around a mutable Stage. Two edge rails share the same RailFrame chrome and each toggle a collapsible pane beside them.