One client. One replayable execution truth
Kyormar is a local-first Agent workspace and IM collaboration client. App owns the service lifecycle, Agent owns execution truth, and every other surface consumes typed contracts
STARTUP / COMPLETE BINDINGS OR NOTHING
Start the complete service before handing a handle to the interface
The App shell can show login and IM before opening the Agent store; UI receives AgentRuntimeBindings only after the authenticated session generation is complete and every startup stage succeeds
- 01
CONFIGRuntime configurationResolve the approved local identity and runtime root without guessing external identity from defaults
- 02
STOREStore and leaseCreate the canonical Agent store and hold the single cross-process store lease
- 03
PROFILELocal identity bindingDevice, local profile, and namespace must match completely
- 04
CAPABILITYCapability catalogAssemble the typed registry for tools, Skills, MCP, and host capabilities
- 05
PROVIDERModel and tool compositionConnect provider, context, tooling, and execution policy to the same service
- 06
EXECUTORBackground executorStart the single Tokio runtime, executor, and owner thread together
- 07
RECOVERYRecoveryRestore tasks, processes, approvals, and visible views from durable commits
- 08
MEDIA ROOTMedia cache rootInstall the app media-cache path last, then publish complete bindings to UI
CANONICAL CHAIN / HOT AND COLD
Every visible state begins with one durable commit
This chain serves both regular Agent and Coding Agent. Tools, approvals, workflows, multi-Agent execution, and managed processes create no parallel writer, projector, or replay truth
UI and CLI submit only complete intents
Commands must carry explicit identity, selectors, and closed payloads; current selection, titles, text, and array positions are not business identity
The cloneable handle is the only business entry point
App retains the non-Clone AgentService; UI, CLI, and DevTools receive only bounded typed handles from the same authority
All semantics converge inside Agent
Regular Agent, Coding Agent, tools, approvals, workflows, and multi-Agent execution share the same transition without a second state machine
commit_seq exists only after the transaction succeeds
commit_seq records commit order only and cannot replace complete business identity for sessions, tasks, turns, tools, or effects
Each domain has exactly one projector
Domains such as SessionView and Knowledge each have one reducer; hot updates and cold replay read the same durable facts
Receipts, views, replay, and observation come from the same commit
Publication failures become typed Gap or Unavailable states; consumers cannot synthesize empty, completed, or compatibility fallback states
CONSUMERS / MECHANICAL ONLY
Every surface knows what it may read—and what it must never own
IM, Server, and DevTools are not backup storage or failure fallbacks for Agent; every cross-boundary path has explicit input, output, and prohibited ownership
typed commandreceipt / session viewOwns only drafts, selections, expansion state, and other UI-only state
typed commandreceipt / bounded viewMaintains no independent runtime transport, store, or state machine
observation requestcommit / view / receiptRead-only; owns no writer, projector, cursor, transport, or canonical cache
explicit shareauthorized content copyConsumes content-free control state by default and does not own Agent execution truth
verified bindingauth / catalog / billing / policy / relayStores no regular prompts, reasoning, timelines, tool arguments or outputs, or file content
TEN CRATES / ONE COMPOSITION ROOT
Ten specialized crates do not mean ten runtimes
crates/agent is only a physical grouping directory. The facade package kyormar-agent is the single composition API; App does not assemble implementation crates directly
facadecomposition rootThe single assembly point for AgentService, AgentHandle, executor supervision, and host bindings
contract + pathstyped boundaryCommands, views, receipts, identity, failure codes, and controlled path policy
coredurable truthstore, transition, commit, per-domain projectors, replay, memory, and compaction truth
context + providermodel turnContext assembly, memory consumption, provider loops, model capabilities, and streaming-response normalization
tooling + tools + mcpcapability executionPolicy, approval, scheduling, built-in tools, and the MCP lifecycle all return to durable receipts
workerdangerous isolationStarts only for one dangerous action and owns no session, task, provider, projector, or replay truth
INVARIANTS / FAIL CLOSED
Use these invariants to detect architectural drift
These matter more than having many modules, using Rust, or presenting a consistent interface because they determine recoverability, trustworthy identity, and whether dangerous actions can repeat
- ONE SERVICE
- The App composition root owns exactly one AgentService lifecycle
- ONE STORE LEASE
- The service owner thread holds the single store lease until the runtime has fully stopped
- COMMIT BEFORE PUBLISH
- Receipts, views, and observations are published only after the transaction succeeds
- SAME HOT / COLD PATH
- Live updates and cold-start replay use the same facts and the same domain projector
- FAIL CLOSED
- Missing, conflicting, or gapped state returns a typed failure and is never inferred from text or cache
- NO CONTENT SERVER
- Regular local Agent content stays local; the remote side handles only the content-free control plane
