A complete client needs this contract, WIDGET_HOST_PROTOCOL.md for widgets, and the core's HTTP/WebSocket endpoints; no source imports are needed.
GET /api/contract publishes routes, parameters, headers, statuses (exact codes, then 4xx/5xx fallbacks), WebSocket types and named JSON Schemas from the running core. The live API is authoritative about shapes; this document is authoritative about meaning: ordering, outcomes, identities and safe retries. Fetch that core's contract; versions differ. Report disagreements as defects. Tests cover structural completeness and selected producer/consumer behavior; §17 lists gaps.
- Additive evolution. New fields, routes and message types appear without notice inside an ABI version. Ignore unknown fields and unknown WebSocket message types. Never reject a response because it carries more than you expected.
- Absence means unknown. An optional field that is missing is not
false,0or empty. For example, a missing cost is not a free task, and a missingserved_uimeans the core is older than this contract. - ABI version.
GET /api/healthreturnsabi_version(currently"7.0"). It changes only when something incompatible changes. A core withoutabi_versionand without/api/contractpredates this contract. You can still talk to it, but none of the published facts below are guaranteed. - Feature detection. Check that a route is listed in the contract before relying on it.
- Schemas use a small, draft-agnostic JSON Schema subset:
type,properties,required,enum,anyOfanditems, with nested objects written inline.additionalProperties: trueeverywhere.descriptiontaken from the server-side contract type.
- Opaque values. A property published only as
{"type": "object"}or{"type": "array"}, or with an empty schema, is opaque. Either the core passes it through from another component (the agent engine's own objects, §13), or its keys are open. Read only the keys this document names in it, and show the rest as data. - Methods. The extension catch-all's
ANYmeansGET,HEAD,POST,PUT,DELETEandPATCH, notOPTIONS. A selected skill can still refuse a method it does not handle. - Requests. A request schema lists the keys a route reads, and its
requiredlist the keys it needs. Ordinary JSON APIs accept JSON without a JSONContent-Type, includingcurl -d; their handlers still validate the body. Malformed nonempty bodies do not select an absent-body default action. Empty-body behavior remains route-specific; task cancellation also keeps its legacy whitespace-as-empty behavior. Form login/logout, uploads, extension bodies and widget-lease controls keep their own format contracts. Only some routes check the schema mechanically (unknown keys allowed); others validate fields, so do not depend on particular error wording.headerslists headers a route reads;!marks one as required. The core does not validate its responses against these schemas; check what your client depends on.
A client and the core must share one browser origin, served from the root path. Cross-origin access and mounting under a sub-path are not supported. The browser session cookie and the WebSocket depend on a shared origin.
| Path prefix | Owner | What it serves |
|---|---|---|
/api |
core | HTTP API, including extension routes under /api/extensions/{skill}/… |
/auth |
core | login/logout operations while the network gate is active; optional public login assets (§3) |
/onboarding |
core | the selected setup page or builtin wizard; /onboarding/static/* always serves builtin assets |
/ws |
core | the WebSocket |
/ and /static |
the interface | the main page and its assets |
The contract publishes these as core_paths and interface_paths. A reverse proxy that puts a separately hosted interface in front of a core sends the core prefixes to the core and everything else to the interface host. It must:
- pass WebSocket upgrades on
/wswith the browser's ownHost(port included) and, where the proxy ends TLS, the scheme (§3): a Chromium handshake carriesOriginalone, which must name the scheme and host the core sees; - keep request bodies and server-sent event streams unbuffered;
- never answer a core path with the interface's index page.
| Value | / and /static/* serve |
|---|---|
| empty (the default) | the builtin interface |
none |
nothing. / answers a 404 page and /static/* answers 404. Use this when the interface is hosted elsewhere. Shells that open the core's own / (the desktop window, the Android app, the Telegram Mini App) show that page too |
an absolute or ~/ directory |
that directory, which must contain index.html, laid out like the builtin web/ tree |
The rules for a directory:
- Files are served as they are. Every file is published under
/static/, including dot-files. Point the setting at a dedicated build output, never a home or project folder. - No Telegram script injection. The core never rewrites a directory's HTML. A custom interface that runs as a Telegram Mini App must include Telegram's own script itself.
- macOS title bar. The desktop window keeps its ordinary title bar unless the page's
<head>declares<meta name="ouroboros-window-chrome" content="integrated">; a declaring page must then make room for the title bar the window reports indata-window-chromeand--window-chrome-*(ARCHITECTURE "Navigation and shared UI contracts"). - Fallback to builtin, with an error. The builtin interface is served instead, and
served_ui.errorsays why, when the directory:- is relative, missing or not a directory;
- has no
index.html; - contains the core's data tree, source tree or settings file.
- File permissions remain the operator's responsibility. Selection checks the directory and entrypoint's existence, not whether every resource can be opened later; an unreadable file can fail its HTTP request without selecting builtin.
- The builtin
web/folder counts as builtin. A directory that is physically the builtinweb/tree, under any name, is the builtin interface.
The rules for the setting itself:
- When it applies. The choice applies when the core starts. Saving a value different from the one the core started with lists
OUROBOROS_UI_DIRinrestart_state.restart_keys. The running core keeps serving its current choice until a restart. - Saved value versus environment. A value saved in settings, including an explicitly saved empty value, beats the
OUROBOROS_UI_DIRenvironment variable. The environment applies only while the setting has never been saved. An unrelated settings save never copies the environment's value into the saved settings. - Not the same as
--no-ui. The--no-uicommand-line flag only means "open no desktop window". It does not change what the core serves.
GET /api/state reports what this core actually serves as served_ui: {source: "builtin"|"directory"|"none", error?}. This is the applied choice, not the requested one, and it is not a fingerprint of anyone's asset files.
A valid selected directory may also contain these optional files:
index.html main client
onboarding.html complete setup page
auth/index.html complete sign-in page
auth/... public sign-in assets
GET /onboarding serves onboarding.html; under the active network gate, GET /auth/login serves auth/index.html. Each is returned unchanged. If its optional file is absent or cannot be read, that whole page uses the builtin implementation. The rules apply only to source: "directory"; builtin, none and rejected directory selections keep builtin setup/login.
Setup resources use the selected /static/ tree. Login resources use /auth/, which publishes only the selected auth/ directory, including before sign-in, on loopback and without a password. Relative resources in the login document resolve there. login and logout are reserved names for the gate's operations. Publish only public build assets in auth/, never settings or credentials. Missing custom assets answer 404; they never borrow builtin files. The applied directory remains fixed until restart, just like the main page.
/onboarding?builtin=1 and /auth/login?builtin=1&next=<path> explicitly open the builtin pages without changing settings. The builtin wizard loads its own complete /onboarding/static/ graph; the login form is self-contained. A builtin setup request keeps builtin sign-in when authentication is needed, so it remains recoverable even if both custom pages have broken JavaScript. The server cannot detect a script that fails after the HTML loads: recovery is an explicit action, not an automatic fallback timer.
On macOS launchers containing this change, Help → Open built-in setup works independently of page JavaScript in the setup and main windows. A directory or separately hosted copy of the builtin client offers recovery outside its setup iframe. The core-owned builtin main page omits that extra control: it already opens builtin setup. Other clients own their recovery controls. This change adds no native recovery control to Windows/Linux, Android or Telegram shells; their builtin HTTP URLs remain available, but a shell without an address bar needs its own host action or a browser to open them. The Mac native Reply to quote action also requires a launcher running the updated code and the core-owned chat page. The button beside selected text ships with the web client. Launcher adoption is described in Architecture §2.
In a separately hosted deployment with OUROBOROS_UI_DIR=none, the core's setup/login pages stay builtin. That interface host can supply its own pages at its own interface addresses and call the same APIs (§3–4); these optional files are specifically for a directory served by the core. See the minimal client example.
For a personal version of the builtin application, change its ordinary source through the existing body development and review workflow. A normal merge update brings official changes into those local commits; disjoint edits merge automatically, while textual conflicts and incompatible behavior need the agent or author to resolve and test them. This includes UI code: no separate UI updater or release-note checklist is required. A replacement/reset has different semantics (§15). A separately maintained client owns its releases; updating the core cannot invent that client's new screens. Using the published setup vocabulary (§4) can expose new fields in a data-driven form, but does not automatically implement a new interaction.
The builtin page served by the core carries <meta name="ouroboros-ui-owner" content="core">. It is added to the response and is never part of web/index.html. Pages without it are owned by someone else. Apply these rules after reconnecting to a restarted core:
- If
GET /api/statehas noserved_ui, the core is older than this contract. Keep comparingshaexactly as before: a changedshameans the page's files changed, so reload. - If the page has the marker and
served_ui.sourceisbuiltin, compareshaas above. Any other source means the core no longer serves this page, so navigate to/once. - If the page has no marker (a directory interface or a separately hosted one), the interface owns its own refresh. A changed core
shameans "resynchronize data", not "your files changed".
Nobody tells an unmarked page to reload. A new choice reaches it when someone next loads /.
When the gate applies. The network auth gate applies only when two things are true: the core has a network password (OUROBOROS_NETWORK_PASSWORD), and the core sees the request as coming from a non-loopback address. Loopback requests and cores without a password are not gated. Behind a reverse proxy, the core trusts X-Forwarded-For and X-Forwarded-Proto only from the addresses named in uvicorn's FORWARDED_ALLOW_IPS (default 127.0.0.1):
- Same-machine proxy: it must send
X-Forwarded-For. Otherwise every remote visitor looks like loopback and passes without a password. Have the proxy overwrite the header with the real peer address, rather than trusting a visitor's claim to be loopback. - Proxy on another machine: it must be named in
FORWARDED_ALLOW_IPSfor TLS to be recognised.
Proving identity. Use one of:
- the session cookie set by
/auth/login; - a per-request
X-Ouroboros-Password: <password>header; Authorization: Bearer <password>or Basic.
Refusals. A refused HTTP request answers 401 with {"error": "Authentication required."}. A GET that asks for text/html gets the builtin login form with 401, or redirects to /auth/login?next=… when a selected login page exists. Explicit builtin setup recovery keeps the builtin form. Health, login/logout and GET/HEAD of the selected /auth/ assets are public; the main /static/ tree, APIs, setup bootstrap and extension routes retain the gate. The separate widget asset prefix requires a valid finite-file lease instead (§11, Widgets).
Signing in from a browser interface:
- On 401, go to the login form. When a core route (for example
GET /api/stateorGET /api/onboarding) answers 401, navigate the top-level page to/auth/login?next=<path>. Use the page's own path, query and fragment, URL-encoded. - Return to
next. After a correct password the form answers303tonext. A JSON client posts{"password", "next"?}to/auth/loginand receives200 {ok: true, next}with the cookie. A wrong password answers401and sets no session. - What
nextaccepts. It must be a same-origin path: it starts with one/, and contains no backslash, no control characters (tab and newline included) and no quotes or angle brackets. Anything else becomes/.
A custom login page submits JSON to the same POST /auth/login, displays its 401 error in its own UI and navigates using the successful response's sanitized next. No HTML placeholders or private bootstrap are required. HTML form POST keeps the builtin behavior: a wrong password returns the builtin form with 401, a correct one redirects with 303. GET /auth/login?builtin=1 always opens the builtin form while the gate is active.
The session. An HttpOnly, SameSite=Lax cookie named ouroboros_auth, Secure when the core sees TLS, lasting 30 days; a core that loses its key file signs everyone out.
When a session expires:
- Requests: they start answering 401. Run the same login steps.
- Failed changes: never resend a change that failed before or during sign-in. Read the current state again and let the person decide.
The WebSocket. An unauthenticated /ws is refused at the handshake (HTTP 403), and so is a handshake without Fetch Metadata whose Origin differs from the scheme and host the core sees (§2). Browsers report both as close code 1006: recognise sign-in problems through an HTTP probe, never close codes. A probe that succeeds while the socket keeps failing proves only that, not why.
Signing out. GET or POST /auth/logout revokes that authentication context's widget file leases, deletes the cookie and answers 303 to next. Login/logout answer 404 when the gate is inactive; those names never serve selected files. Other /auth/ paths serve the optional public bundle even without the gate: missing files answer 404, unsupported methods 405. With no bundle those paths answer 404.
- Check the core.
GET /api/healthchecks the core and returnsabi_version.GET /api/contractlists the routes this core offers. - Check whether setup is needed.
GET /api/onboardinganswers204when a usable model provider is configured (nothing to set up), otherwise200with the builtin wizard page. - Load or show setup. Frame or open
/onboarding(the selected complete page when present, otherwise builtin), or render your own setup fromGET /api/onboarding/bootstrap. Force the builtin wizard with/onboarding?builtin=1. The readiness probe's 200 HTML body remains builtin for existing clients.
GET /api/onboarding/bootstrap returns {ready, bootstrap} and writes nothing. bootstrap is exactly what the builtin wizard renders. It contains:
-
contract, the setup vocabulary:providerFields: credential and endpoint inputs;settingKeyis the settings key to send.modelSlots: model roles;settingKey. Amanagedslot is fixed by a deployment policy: show it, send nothing for it.runtimeModes:valueis what the setting stores; under a deployment policy it lists only the Access levels it allows. The review-enforcement fields (reviewModes,initialState.reviewEnforcement) are gone with the retired setting.localRoutingModes.budgetFields: with defaults and minimums.subscriptionFields: declarations the setup call accepts, not settings.- the step texts:
titleheads a step, the one-wordrailTitlenames it in the rail.
-
deployment: what a deployment policy fixes (_meta.policy_state.deploymentofGET /api/settings),nullwithout one. -
initialState, the starting values:- one key per row
stateKey; - some fixed keys, such as
providerProfile.
A credential that is already configured reads as
secretPlaceholder, never the secret itself. - one key per row
-
modelDefaultsper provider profile,modelSuggestionsandlocalPresets. -
freshInstall, display only; completion checks it again. -
stepOrdermay containconsciousness(afterreview_mode): present only whileconsciousnessOffer.offered; andskills(beforebudget): present only while completion honorsstarter_skills, on a data root whose starter list never ran (no starter record yet, or a new one). Elsewhere the choice changes nothing, so offer none. A page that offers no skills choice sends no field, and the recommended list installs (§12). -
consciousnessOffer, display only: the Consciousness step.offered: the next boot mints a first state (a new data root, or one after an owner Reset) and setup has never completed here. Where any state exists, whatever it says, there is no step: setup never changes an existing state, and Dashboard › Consciousness does.enabled:nullon an offered step (no state yet; the switch starts on). Without a step, the control as the state shows it,nullwhen it cannot be read.autonomy,dailyUsdandmaxTasks: the limits consciousness runs under now;words: the host's words for the step (gloss,off,on,meaning,subscriptionCost,door).
The switch's position rides the completion as
consciousness(below). A page that ignores the step sends no field, which changes nothing.
Setup can also check, without saving: POST /api/providers/test probes one provider (a failed probe is 200, ok: false), POST /api/openai-compatible/models lists a compatible endpoint's models, GET /api/model-catalog lists selectable models and the local-model routes start and test a local model (both §14). The first two refuse a kept key for another endpoint (scheme, host, port or path) or, in the test, a weakened TLS check with 400 masked_key_endpoint_changed. For the built-in endpoint they name the key setting of the pair the draft reaches (api_key_setting; listing: apiKeySetting); the test then probes that pair alone and takes its fields as overrides. Unnamed, its blank dedicated address blanks the legacy one too.
To finish setup, send POST /api/onboarding/complete:
- The body: the settings to save, keyed by each row's
settingKey. AddsubscriptionsConnectedandskipSubscriptionPresetsas needed, and optionallyOUROBOROS_SUBAGENTS,allow_empty_review_poolandconsciousness: it counts only while a first state is still to come, judged before the write. Thentruehas the first state born on (no command, no chat row; a pending Panic holds it off) andfalsehas it born off, clearing an earlier attempt'strue. Where a state exists, and when absent, it changes nothing. A credential field left assecretPlaceholderkeeps the stored value. Give each save its ownattempt_id(16–128 letters, digits,-or_), made before you send it: it names this save later. - What it does: this is the only setup writer. Settings, the next-start access mode and the completion record are saved together, or not at all.
- What follows: the completion record is my human's press of Start. A first state minted after it owes one first meeting: the supervisor that starts on that state admits one ordinary root in Main, never an owner chat bound since, whatever
consciousnesssaid. It is the host's prompt for that press (metadata.ui_control.namesetup_start,objective_authorui_control), admitted at most once and never while the chosen access level waits for a restart (restart_required: the restarted process admits it), so it reaches a client like any other root in Main. Setup finished over a state that already exists owes none. - On success:
200 OnboardingCompleteResponse.restart_requiredsays whether access settings apply only after a restart. - If agent accounts can't be checked:
503withcan_skip: true: nothing was saved. Resend withskipSubscriptionPresets: trueto finish without agent defaults. - Other refusals: these follow §9's
savedrules. Setup may preserve an existing Main Ultrafast binding, but cannot enable it or transfer it to a new model or account:400 invalid_onboarding_settings,saved: false. Finish with Default or Standard and confirm Ultrafast in Main or Settings → Models. - When the answer is unknown (
saved: null, a dropped connection, or a reply that is not the endpoint's JSON), read that save back withGET /api/onboarding/complete?attempt=<attempt_id>(OnboardingAttemptResponse, writes nothing).saved: truemeans the settings now hold this attempt's write; itsreceipt, once the whole completion has finished, is the success envelope to act on.saved: falserepeats a refusal recorded before anything was written;nullconfirms nothing: still running, never received, or replaced by a later save.GET /api/onboardingcannot answer this: on a configured install it says 204 whatever happened to this save.
Mapping setup state to the save body. For providerFields, modelSlots and budgetFields, copy initialState[row.stateKey] to row.settingKey. Fixed fields:
| Initial-state field | Completion-body key |
|---|---|
runtimeMode |
OUROBOROS_RUNTIME_MODE |
skillsRepoPath |
OUROBOROS_SKILLS_REPO_PATH |
localSource |
LOCAL_MODEL_SOURCE |
localFilename |
LOCAL_MODEL_FILENAME |
localContextLength |
LOCAL_MODEL_CONTEXT_LENGTH |
localGpuLayers |
LOCAL_MODEL_N_GPU_LAYERS |
localChatFormat |
LOCAL_MODEL_CHAT_FORMAT |
localRoutingMode |
LOCAL_ROUTING_MODE |
modelAccounts |
OUROBOROS_MODEL_ACCOUNTS |
modelContextWindows |
OUROBOROS_MODEL_CONTEXT_WINDOWS |
processingPreference |
OUROBOROS_PROCESSING_PREFERENCE |
modelProcessingPreferences |
OUROBOROS_MODEL_PROCESSING_PREFERENCES |
providerProfile (derived from configured access), localPreset (a localPresets choice) and legacyCompatibleBaseUrl are not save keys; the last, an older install's OPENAI_BASE_URL, pairs with OPENAI_API_KEY while OPENAI_COMPATIBLE_BASE_URL is empty, and only Settings edits it. providerProfiles entries hold display strings label, providerCopy and modelCopy. The model-role maps accept JSON objects or JSON text. Role keys are main, light, vision, consciousness, deep_review, websearch and fallback; fallback holds an ordered array. Processing choices are standard, fast, economy, or empty to inherit; modelProcessingPreferences.main may also be ultrafast.
Keyless endpoint example. On a fresh core this is structurally sufficient for an intended endpoint and model:
{
"OPENAI_COMPATIBLE_BASE_URL": "http://127.0.0.1:11434/v1",
"OPENAI_COMPATIBLE_API_KEY": "",
"OUROBOROS_MODEL": "openai-compatible::<model-id>",
"skipSubscriptionPresets": true,
"allow_empty_review_pool": true
}An empty review pool is an explicit choice, not a production recommendation. Setup validates configuration, not reachability or successful generation; test the provider separately. Optional model slots may be blank to keep inheritance. Completion on an existing install is still a settings write, not an idempotent readiness check. 400 rejects input, 403 is a permission refusal, and 409 onboarding_state_changed means the settings changed before commit.
POST /api/onboarding/subagents/preview takes the same body and returns, unsaved, the agent roster and model settings setup would produce, known_spend_gaps (names the draft's limits cannot count: no known price) and partly_counted_spend ({name, condition}: priced only under it).
POST /api/onboarding/model-catalog takes the same body and answers as GET /api/model-catalog (§14) for the draft's keys, connection rows and local model. Its optional provider_id query reads just that draft connection or local model. It reads only those access fields, so it answers while Main is blank, and it saves and records nothing. A connection whose kept key the draft would send to another address, or to the same address with certificate checking turned off, is not asked: it is an errors row with stage: "kept_key". A key typed in the draft goes where the draft says.
The HTTP completion receipt is the save result. Closing a window or receiving a bridge return value does not prove a save. After a confirmed successful receipt, use the host that actually exists:
- Separate desktop setup window: if present, call
window.pywebview.api.onboarding_finished({ok: true, restart_required, runtime_mode})with the receipt's values. The existing host closes setup and owns a required server restart before opening the main client. The bridge appears asynchronously (pywebviewready); detect the actual method rather than infer it from the core version. The main window does not expose this setup-only method. If it is unavailable, keep the saved/restart state visible and offer the host's normal close/restart path. - A setup iframe inside the builtin or copied builtin client: send
parent.postMessage({type: 'ouroboros:onboarding-complete', restart_required, runtime_mode}, location.origin). That parent's overlay owns its transition and restart display. This is a client convention; another parent can define its own handoff. Do not call the parent's setup-window bridge or close the main window. - A plain top-level page: navigate to
/only when no restart is needed. Otherwise show that setup was saved but the new access mode is pending, and use the ordinary restart workflow (§15). A navigation alone does not apply a boot-pinned setting.
On a failed or unknown save, retain the form and read the attempt back as above; only its receipt is a successful completion. Do not send a completion message for anything else or blindly save again. onboarding_finished only reports the HTTP result; it is no second settings writer.
GET /api/state (StateResponse) contains:
- Readiness:
supervisor_readyandsupervisor_error. - Activity: Render
works,rooms(keyed by chat id),work_summary,works_completeandworks_gaps; clients do not derive state. Each work represents one request, its Continue episodes and live members.activityisworking|queued|waiting|paused|unknown: the current episode's state while alive, otherwise its remaining work. A Continue held for an earlier attempt whose helpers or runs still work reads Working.transition,call,release,live(anything executing),turnand current door-backedcontrolsaccompany it. A work of a correspondent Presence turn saysplace_turn: true; a work with an accepted delegate start no engine run has answered yet saysunbound_start: true— that card's Stop is a request against the recorded request and tree, never a remote run handle: whether such a start ran or stopped is known only once a stop is confirmed, and the Stop confirmation reads this fact. Either flag is absent, never false, where it does not apply. A work whose live episode's record a read could not open lists its addressedgapsand readsconfirmed: false; an address that read could not verify is never shown as a confirmed object: the tail-only work it would stand for is not drawn at all —works_gapsnames it, the roster still says its tree, and a read that succeeds brings the row back.becausegives typed reasons with English text: a decided Pauseby{actor,text,at};sleepingawakeclause{kind,name|count|at}per chosen source, joined with “or”, time last;queuedbehind{task_id,lane,name,folder?}. Before its own Main call a turn names its step (turn_admitted,turn_started,turn_context_building,turn_context_built), including lane-carried turns and pooled workers; once that call starts it reads Working even ahead of the census. A working member's open silence episode leads withno_progressandsince(last progress, epoch seconds), after any recorded Stop, until it next progresses. This grants no turn, amber or control.tailsdescribe helpers, external runs, review work beside a nonexecuting episode, and unconfirmed runs. They qualify the state without replacing it.members.idsnames participants;members.states[id]gives that member'sactivity,transition,call,live(itself executing),release,confirmed,turn,because, attributabletails,mark, observedqueue_attemptwhen known, and optionallast_resume. Activity pairs a helper's phase with elapsed time only for matching queue attempts. A held episode or member'slast_resumenames its latest refusal on the current hold:at,by.actor(owner|ouroboros|host, the last for a Continue's refused start),error,text. This is dated history, not an owner turn or control.markismovingfor working,stillfor queuing or waiting,pausefor paused,ringfor unconfirmed, ornone. A sleep on a paused helper stays waiting: aheldtail names who can resume the helper when known; the waiting work gains no control or turn.roomsgives word inputs, the samemarkandamberwhile something needs the owner.turn.kindisquestion(blocking),action(owner-only) oropen_question(one in Main'scurrent_questions, even while work continues or after it ends). An open question is not the work's state;code: "delivery_unknown"denotes unknown answer delivery. A room's turns carrywork_id, except standalone room questions, so even a resting room can be amber.work_summary.turncounts each work with a turn and each otherwise uncounted standalone question. Rooms are recomputed from each question read. If an incomplete read names that task in its gaps or names no task, retain the known question address asopen_questionand its feed row; a bare wait without a quiz has no address. Drop both when a read vouches for absence.- Compatibility:
active_chat_activitiesis the root census (last_line,last_line_at,tool_calls,detached,place_origin,project_id,project_name; a direct turn's lastturn_phase:accepted,admitted,started,context_building,context_built,requestedordispatched).active_direct_turnsremains. A live inline place turn haskind: "presence"in its conversation's room or, once moved, its Project; never inactive_direct_turns. Its work offers Stop, and Pause once moved as text. A lane-carried turn iscancelablefrom admission; an in-process turn before its first durable write ispreparing,cancelable: false, with no controls. An unknown room makes the body incomplete rather than empty. Recorded Stop contributesbecause: stop_requesteduntil the turn next checks.
The census, task frames/history and GET /api/tasks/{id} may carry place_origin from the work's admitted focus: {place_id, place_label?, provider?, actor?: {id?, label?, owner?, bot?}, wakes: string[], labels?: {kind: declared label}, routed?}. Cards render these facts, never infer an author or wake; other work omits the field. Project completion freezes it with its delivery so the portal keeps it after reload.
A root's census rows and works[] beside its lead also carry processing: {choice, source?, resolved?, last?}: its own tier
(room at admission, owner by a card act; choice: "" is Default), the server resolver’s resolved tier (including an acting fallback’s default), and its newest call's receipt {requested, submitted, submittedNative?, observed, observedNative?, reason} (requested is what the call asked, also when the
host sent it again as Standard), so a choice never reads as what ran.
active_chat_activities[], active_direct_turns[] and works[] optionally carry lead:
{model, use_local, basis, cited?, role?, primary?: {model, use_local, basis, cited?}, since?, cause?, pending?: {model, use_local, basis?}}.
basis names a followed role, room, owner, owner_words, owner_press, place, circle, mind or fallback.
An owner_words primary cites a verified span. An owner_press primary cites the complete option label the owner
pressed. Both carry cited: {text, clipped} with the first 1,024 Unicode characters of the citation and clipped: true
only if more remain. The durable lead keeps the whole citation. The cite sits on lead on the primary and
lead.primary while away, including an accepted primary awaiting application. It never governs the work.
A fallback names its chain row in role (fallback:<index>); equal models on different accounts remain distinct.
primary appears only away from the primary; since and cause date fallback, mind and wait-card departures.
A wait-card switch has basis owner and cause wait_card: the owner moved the acting route without changing
the work's primary. It carries no fallback amber and no pending route unless a later act will actually move it.
A requested return stays fallback until the primary answers. Queued roots use their admitted carrier;
a recorded follow reads Main now. pending names the next route without changing the acting fact. Its basis names a
known next scope (even on the same model if its binding changes); a Return or Wait can retry a primary with an
unpublished override, so no next basis is asserted for that retry. Missing facts remain unknown.
Running and queued roots with a durable record offer {action: "model", target: "<task_id>"} in works[].controls.
POST /api/tasks/{task_id}/model accepts {request_id, action: "set"|"follow"|"return"|"wait"|"keep"|"processing", model?, use_local?, processing?};
only set takes model/locality, only processing takes processing ("" Default, standard, fast, economy, ultrafast).
The response is 200 {ok: true, task_id, applied: "next_step"|"at_start", lead} (processing instead of lead for a tier act).
A tier act is its own decision (owner_processing, metadata.processing): it applies from the next logical call and to
new subagents without a tier of their own, which take the work's tier, Default's (Main's) included; started ones keep
theirs. It never resets the primary, a fallback, a wait, an
account or a window, and a model act never changes it. ultrafast is a room's, a work's, a subagent's or Main's tier,
never the default one or another role's (400:chat_processing_invalid). It is sent natively only on a direct OpenAI
connection's actual Responses API at OpenAI's own origin and on OpenRouter's public transport; other direct APIs,
Anthropic included, get no native field (processing_not_submitted). An engine subscription may submit it as its own
account and adapter state; neither its listing nor that submission is an entitlement or a receipt of the call's tier.
An older build cannot read a saved Main ultrafast: choose Default or Standard for Main before rolling back.
Set/keep make an owner primary and record a recent model; follow returns to Main. Return/wait/keep require a fallback.
The durable record wins over mail order and saved routes; retry the same request_id for the same acknowledgement,
including after another press. Unknown/finished work (task_not_live), children (not_a_root_task), Presence
(presence_model_unsupported), absent durable records (model_control_unavailable), invalid requests/models
(task_model_invalid), missing ids (request_id_required) and incompatible state (model_action_state) are typed refusals.
A failed wake/queue publication or recent-model write answers 503 with model_wake_failed,
model_queue_publish_failed or model_recents_pending; the primary may already be saved, so reuse the request id.
Direct turns without a durable record, Presence and portals offer no model control. The agent browser cannot press
this endpoint or /api/owner/chat-model outside unrestricted agency.
- Projects:
projects(a capped feed; all:GET /api/projects?all=1),project_messages_revision(opaque token of listable Project dates, not Main/place-only messages;nullwhile undated),project_listable_count(listable active/deleting rows;nullwhen unreadable, and whileproject_chat_idsisnull: with no rows inprojects, keep the rows you show; rows it carries are the feed) andproject_chat_ids(every reservation, tombstones too, for room isolation;[]is no Projects,nullis a registry that names no room it can vouch for (unreadable, lost after it was committed, or holding only invalid rows): keep the set you hold). - Task bindings:
task_bindings(bound task → its project: each entry is{project_id, chat_id}; a Project's name is inprojects,GET /api/projectsand a census row'sproject_name, not here) and its opaquetask_bindings_revision, a digest of the map as sent (""after a failed read, of the bindings or of a Projects registry that cannot be read: the map is unknown, not empty; keep the bindings shown and ask for the whole map on the next read). A registry that is lost or holds only invalid rows (project_chat_ids: null) leaves the map and its revision standing: the map names no Project. A body without the revision field (an older server) is applied as sent.?bindings_since=<revision>answerstask_bindings: nullandtask_bindings_unchanged: truewhile a reader's map would be the same, across unrelated writes and a restart; without it the map always comes whole. A reader that reads nothing from the map may name a revision without holding it; one answered unchanged for a map it no longer holds reads again without the parameter. - Main's unread:
main_visible_revision, Main's room revision (its standalone messages, the count a Project'svisible_revisionis;nullwhile unreadable); the shared read cursor ismain_seen_revisionin/api/ui/preferences(nulluntil a client first sets it; a write is clamped to the revision and never moves back). - A message read in another room: a row shown in several rooms carries
room_revisions({"<chat_id>": revision}, each room it counted in). A client that showed it whole posts{"shared_read": ["<row_address>", …]}(at most 64) to/api/ui/preferences; the host records each revision above that room's cursor inread_ahead_revisions({"<chat_id>": [[from, to], …]}, host-owned: posting it answers 400), dropped only when that room's own cursor passes. A room's unread count is its revision past its cursor less these revisions;window.latest_messageskips them. An older core drops the record on its next preferences write: those messages read unread again in the other room. - Observer views:
observer=1suppresses Main/Project read cursors andshared_read. Session storage keeps it untilobserver=0; without storage it lasts only for that document, so reload needsobserver=1again (DESIGN "Unread"). The builtin browser adds it at this installation's/; scripts opt in. Whichever interface is served there must honor it, or those views read for the owner. - Current decisions:
current_questionsspans history pages (Main’s own arenativeidentities without form fields).main_attentionnames Main and Project tasks with owner-required controls, including individually held helpers.*_completeand*_gapsqualify absence. Keep earlier content inert across gaps. - Modes and budget: the access and context modes, and money figures (
nullmeans unknown). - Checkout:
sha, the first 8 characters of the commit on disk (the running core's start commit isrunning_shainGET /api/update/status);branch,nullfor a detached HEAD or unknown branch. served_ui.
Two informative response headers describe the body, never its shape: X-Ouroboros-State-Generation (the server process's publication it came from) and X-Ouroboros-State-Age (seconds since that publication was produced). A fact that changes by clock passage alone refreshes when the next change moves the publication. Clients may ignore both.
A quiz-bound activity may carry owner_wait.quiz_id, the exact question its wait
names, in Main as in a Project; absence supplies no question identity. To open it,
match the exact task and quiz in owner_quiz of GET /api/tasks/{activity_id}.
Its question_rooms[quiz_id], the shared room resolver's projection (not the
task's contextual project_id or immutable publication/reply address), proves
current display membership: state:known supplies chat_id and project_id
(empty for Main) to match Main's chat or the named Project (its Main mirror
included), and for a private Main question also_project_ids, the Project
that shows the same row; unknown or absent proof permits no form, and hidden chat 0 proves
Main only through that exact quiz's recorded Main publication (§7). Opening is a
read, never a decision submission; stale socket epochs authorize nothing. Wait
and quiz state stay separate (resuming the task does not answer the question);
answer through §7.
Format and liveness. One socket per client; JSON text frames carry type. A heartbeat (~15 s) confirms connectivity, not work progress. Reconnect after ~45 s of silence. Restart closes with code 1012.
Message types. ws.messages in the contract lists every built-in type with each direction's shape:
- Client to core:
chatandcommand. - Core to client, stored as history rows:
chat(a message or a progress line),photo,video,document,links,quizandcard(a living card, §5 "Living cards"). - Core to client, signals only:
panic_acceptedconfirms the emergency latch, not process exit (§15).conversation_finishedsays the room's live call ended; it carries the chat, call and task ids and the reason (§5, the call socket).quiz_stateupdates a question card; history shows the merged state.card_statesays a shown living card changed: read it again (§5 "Living cards").logcarries one runtime event row indata(data.typenames the event) for live activity displays; the task's durable facts come from §6.message_annotationis the live counterpart tochat_annotationon the saved owner row; see Annotation receipts below.task_namedgives a card its title; history rows carrysuggested_name.projects_changed,extension_lifecycle,extension_health_changed(§11),ui_preferences_changed(its keys name the changed groups),update_status_ready,update_progress_changed,ui_language_changedandui_i18n_updatedmean "read the named state again".typing(transient) andheartbeat.
Some chat frames are transient, not history: system_type: "initialization_notice" for a refused submission, or a repair/admission receipt with task_id_pending: true (no proof a durable task is readable yet).
Extension messages are namespaced per skill (ext_<n>_<token>_<message>; use ws_prefix from GET /api/widgets, trailing separator included). Send an object with type: ws_prefix + <handler-name> and that handler's fields; the core passes the whole object (no data wrapper required). A non-null handler result returns {type: "<request-type>.reply", data: <result>} to the requesting socket; no result, no reply. The core adds no request correlation id (the skill's format correlates concurrent requests); refusals/failures are log frames with data.level and data.message, without guaranteed request id or refusal code.
Annotation receipts. With source_row_address, only that physical row or its exact retained copy wears the receipt; "" names none. A picker dispatches once its row is readable. An older one naming only a client id stays open while two readable rows of its room carry it. Id-less sources have none. project_chat_id names the destination.
Send {"type": "chat", "content": "...", "client_message_id": "<unique id>", "chat_id": <thread>}:
- Threads.
chat_id1 is Main; a project's thread is itschat_idfromGET /api/projects, sent with itsproject_id. - Attachments. Upload each file with
POST /api/chat/upload(multipart fieldfile), then list it inattachmentsas{filename: <stored id from the upload>, display_name, mime}; the core measures size and checksum itself. - Replies.
reply_to: "<row_address>"(work card:task:<task_id>of its current episode) names the source. For a passage of one authored message or media caption, addreply_excerpt: {text, start_utf16}: complete case-sensitive text and its zero-based UTF-16 offset in the parsed, rendered body (a message the page could not parse offers none). Inline markup joins text, CSS-collapsed spacing takes one space, preserved spacing stays, and line breaks/block boundaries add LF. Mermaid source and rendered math keep the coordinates of the source they replace, also where a parse error shows TeX without its delimiters; only visible text can be selected or highlighted. Soft wraps, controls, nested replies, generated labels and other hidden content have no coordinates. The core resolves the address and author, keeps the sender's citation beside the new words, and refuses a fresh excerpt with no readable source. A direct Reply to a Project's message appears there too (also_rooms), one hop only. - What "sent" means. A socket send only means the socket took the frame; the message is accepted when the core echoes it as a
chatframe fromrole: "user"with yourclient_message_idandingress_accepted: true.ingress_pendingandingress_dispatchedsay what this core process knows of it and are lost on a restart. - Retrying. The same
client_message_idwith the same words, attachments, Reply and execution transport joins the already accepted message; changing these fields is refused, including a changed excerpt or offset. kind: "room_echo"on an accepted web row limits its display, including replay, tochat_idandalso_rooms. The Project form requests this even during a registry outage. The marker grants no routing authority. Unmarked legacy, external and Main frames keep their previous rules.- What is lost. A frame sent while the socket is down is lost unless your client keeps it: the core keeps no client outbox.
- Commands. Slash commands go as
{"type": "command", "cmd": "/restart"}and so on, or throughPOST /api/command(§15).
Refusals and submission correlation. Schema rejection sends {type:"log", data:{level:"warning", message:…}}, without guaranteed correlation. Acceptance failures (reusing an accepted id for different content among them) can send transient chat notices with role:"system", system_type:"initialization_notice", the submitting chat_id and any supplied client_message_id, and command, admission, update and review System replies can name the submission they answer: settle only that submission's Sending indicator, in that room, never a guessed one. A System row alone establishes neither acceptance nor task completion; without an accepted echo, keep the operation unresolved and read history.
Origin correlation. origin_message_ref carries chat_id, client_message_id, ts and text_sha256. New references include row_sha256 for the entire accepted row, including attachments. Follow that source and its task_id. Older references can match a unique row.
Thread filtering. The socket broadcasts several destinations: apply the merge rules below only to stored-row deliveries of the history view being read, never comparing every frame with Main history, inferring Main from a missing chat_id or taking transient notices for missing stored rows.
POST /api/call/open accepts CallOpenRequest:
{chat_id, client_message_id, feature?}. The feature key names a loaded
register_live_conversation registration; its explicit configuration selects
the provider, native model, voice, duration and per-connection exposure reserve.
The beta is off by default. Credentials alone never enable it. Admission uses
the ordinary owner ingress and current common context. Repeating the same
message ID rejoins its existing call; a different message ID in an active room
is refused.
CallOpenResponse returns {call_id, ws_path, vision, joined?}.
Failure returns {ok:false, code, error} with its HTTP status.
The separate /ws/call/{call_id} socket carries JSON controls and
binary PCM16 media. GET /api/contract publishes its header, payload limits
and control-schema names as call_socket (gateway/call_contracts.py; browser twin
web/modules/call_contract_types.js);
call_protocol.py owns the codec. A peer first sends
{type:"hello", protocol:1, role:"owner", mic, speaker, rate, video?}.
Directions may narrow its admitted rights. mute, played, context,
participant and bye are controls, never tool or owner-control authority.
Playback acknowledgements name the item and actual played milliseconds.
max_control_bytes bounds peer messages, in UTF-8.
The server sends state, activity, turn, caption and flush.
Caption text has no byte cutoff. Append a partial caption's text to its item
unless replace:true marks cumulative/revised text that replaces it; a final
caption carries the item's whole text. flush.epoch invalidates older
playback. A closed state carries its reason,
detail and optional next action. The ordinary chat socket also publishes
conversation_finished with chat_id, call_id, task_id and reason.
The host executes native model tool calls through ordinary policy, checkpoints
and effect custody; final captions enter canonical history with provenance and
playback status (spoken: {call_id, item_id, played_ms, status}, with
status: played|generated|interrupted retained on replay).
New typed owner messages reach the same actor. Ordinary Stop,
End, device loss or owner disable end the call. Automatic skill replacement
waits while a call is live; unload cancels without joining teardown. Interrupted generated speech is not labelled heard.
Each renewed connection requires current ordinary context fit and an ordinary
attempt reservation. Unknown modality cost retains exposure. Connection loss
does not authorize an automatic paid retry.
Companions retain POST /call/open and /call/{call_id}/peer on the Host Service.
X-Skill-Token and call_peer grant bind the reviewed payload and media directions.
Opening a Presence call also needs its enabled binding, source event, ceiling
and presence grant. Its existing meeting protocol remains available; external
participants' audio/context stay attributed observations, never owner messages.
The feature page owns Talk in an empty Send slot, same-width Send for text/files, the existing call capsule and collapsed transcript. Empty Enter does not call. Dictation hides during a call and returns without losing the draft. Browser capture uses shared audio/visual leases and releases them on End, Panic, hidden room or contribution disposal.
In a Main or Project response, window.latest_message names the latest eligible non-owner standalone message by stored arrival (card content excluded, and in Main a Project's question copy and a started or handed-over Project's portal row, which have no message of their own there), not necessarily the last row by timestamp; null means unknown, and its out_of_order flag says it sorts above earlier arrivals or lies before the recent read. With a null message, older pages continue the bounded search below the chat offset window.latest_before; window.latest_absent means the search reached the chat's start without a gap and found no eligible message below the frozen upper bound, not that the chat has no stored rows. These are search observations, not a client's read acknowledgement.
GET /api/chat/history?chat_id=<thread> returns ChatHistoryResponse. The selected conversation rows are oldest first; replay evidence can follow them regardless of its timestamp and recur on other pages: apply it to the keyed card or question, never count it as another conversation message. Each row of messages is a ChatHistoryMessage:
- Always present:
text(live frames call itcontent),role(user,assistantorsystem),ts,is_progress,system_type(the row's kind;""for an ordinary message) andtask_id. - Identity: stored rows carry
history_id("<chat|progress>:<offset>", stable on re-read),history_position({source, offset}) and a stablerow_addresscomputed before projection (none without a persisted source).client_message_idis a correlation id for owner messages and some quiz publications, not a row identity.reply_author_labelis whom a Reply to the row names (You,Ouroboros,Systemor its recorded speaker), on live frames and replay alike.reply_excerpt_disabledon live and replay means a wordless or mixed card display, not one authored passage; whole-row Reply still works. An entered quiz comment is its own text. - References:
reply_to(an owner row's: the row he replied to; an Ouroboros answer's: the owner message its turn answers) is{address, chat_id, role, author_label, kind, snippet, chars, ts, task_id, target_home}(snippet: at most 160 whitespace-collapsed characters;chars: the quoted text's whole length, present when the snippet cuts it;target_home:work,roomornone, what decides the quoted row's room; an older reference lacks it, or saysnoneof a private contact, and is decided by the quoted row itself) or{address, unresolved: true}. A recorded card answer addsquote_role: "user"for its ink. A selected Reply also carriesreply_to.excerptin its echo and history, exactly as accepted (§5). A bundled Telegram bridge row may addtelegram_room_chat_id, the Project chat assigned to its turn (0: ordinary conversation;null: refused; absent: undecided or legacy). A row written in one room and shown in another (a Project's notice or private contact in Main, a relay's answer, the owner's direct Reply to a Project message) is one row with one address in both rooms' history; its live frame names the other rooms inalso_rooms. Arelay_entryrow'srelayholds the owner's words passed into the room:quotes, every message passed on, each withtext,attachmentsandsource(where and when he wrote it), the singular fields repeating the first. A reply to a relay, in its source room, carriesreply_to_relay. - Deliveries:
msg_typeisdocument,photo,video,links,quizorcard, withfilename,mime,download_url,captionandsize_bytes;actionsandtitlefor links;quizfor a question (quiz.quiz_id,quiz.state, the recorded answer);cardfor a living card (card.card_id,card.kind,card.title,card.revisionas first published; the row'stextis its plain fallback). - Progress rows (
is_progress: true) carry the task-progress facts of livechatprogress frames (ChatOutbound). - Host notices: a System row's
notice({code, step?, details?, instruction?, template?, values?, line}) means itstextis only the phrase: drawnotice.line(the phrase and its next step, in the install's language) and keepnotice.details(the raw facts) behind a disclosure;notice.instructionis the one line the owner acts on (an exact command), which a surface without that disclosure shows under the line; for a phrase with variable or authored words,templateis the constant English with{name}slots — the part that gets translated — andvalues(string → string) fills them as written, never translated; live frames and search candidates carry the same object. - Rows that are not messages. Do not show these as bubbles:
system_type: "task_summary"withschedule_report_only: trueidentifies a saved report. Its card links to the run's task result; the report is not a history message.- Replay evidence (
system_typequiz_answer,quiz_closed,task_evidence, orsummary_kindwithhistorical_terminal) can serve cards on other pages; it carries recordedsuggested_name,wake_summaryandschedule_name. Answers and closures carry the recordedquizwith its question's currentquestion_delivery. A parent's own row, live state or in-roomtask_evidence(even with zero calls) establishes its card; a child'sparent_task_idalone cannot. Show the child independently until its parent can be placed. A terminal carrier may nametask_terminal_statusandtask_attempt.current_outcomeis the stored result's ending under its owntask_attempt. It revises its row only if both name one attempt or neither names any; otherwise the row keeps its published facts and the outcome is separate, taking no status, words, metrics or clock from the row or another attempt's receipt. Itsterminal_timeis the host's validated fact, else that time is unknown. An older ending cannot settle a reopened attempt. On a revised outcome,terminal_delivery.scope: "task"means the affected answer is unknown; a nullpreserved_pathmeans the copy could not be verified for this answer. Routing refusals, question pointers, answers and closures only reference a task; they never conclude it. system_type: "task_model_wait": a model wait's latest state, inmodel_waits, for the task's card.reasongoverns the wait. An observable row'saccess_reasonnames the confirmed cause; an empty string means none was confirmed. An omitted or null field keeps the legacy interpretation.
- A rebuilt row:
lifecycle_virtual: truedescribes the skill operation running now, rebuilt with a freshtson every read and withouthistory_id: replace it rather than merge it. - Derived and synthesized rows. Main’s
project_question_pointercarriesquiz_idandhistory_id. A Project can show a retained opening (origin_projected: true) when the binding or identified source attests visibility. Optionalopening_input_kinddistinguishes a card (owner_press,owner_card_input,owner_quiz_answerorowner_mailbox) without changing bubbletext, role or address. In a Project binding,source_inputkeeps thatsource, the acceptedcontent,source_task_id(asker), and, when recorded,quiz_idorcard_id,pressedandsubmitted_values;source_textis display, not proof of submitted words. Anorigin_omissionSystem notice covers unknown visibility and omitted archived openings. Both synthesized rows lack a storedhistory_id.
GET /api/chat/search?chat_id=<thread>&q=<words> returns ChatSearchResponse: one bounded read (rows, a soft byte target, never a split row) of the saved messages the room shows, newest first, as ChatSearchCandidate fields their shown words are drawn from; the client reads those words for q. Only an owner's literal ASCII words lacking an ASCII q and a living card (its body is not searched) are left out; never a derived row (Main's Project question pointer is its Project's). row_address lands via around=. Pass next_cursor as cursor with the same q: a page may hold no candidate; newer messages are not mixed in. The whole room was read only when a chain reached beginning without gaps; importing: older history unreadable yet. Errors keep the shape: 400 search_query_invalid/search_cursor_invalid, 409 search_view_changed, 503 migrating/history_source_unavailable.
The core writes each stored row and its live frame with an identical ts string, the same task_id, role, system_type, is_progress, source (when provided) and, for a text row, words, so a live frame and a history row are the same row when:
| Live frame | History row | Same row when |
|---|---|---|
an owner chat (role: "user") |
the owner row | client_message_id is equal |
quiz |
msg_type: "quiz" |
task_id and quiz_id (quiz.quiz_id) are equal |
a Main pointer chat with system_type: "project_question_pointer" |
the pointer row | task_id and quiz_id are equal |
photo, video, document or links |
msg_type equal to the frame's type |
task_id and ts are equal |
card |
msg_type: "card" |
card.card_id is equal |
a chat carrying row_client_message_id (an outgoing row saved under its own name, such as a note between works) |
the row whose client_message_id is that value |
the two names are equal |
any other chat |
a row with the same is_progress, role and system_type |
task_id, ts and content = text are all equal |
Only role:"user" rows merge by client_message_id: on a System frame it only correlates the answered submission and is not persisted, so stored System replies use the other-chat rule. An outgoing row saved under its own name repeats that name on its live frame as row_client_message_id, never as client_message_id. Never match on ts or task_id alone: one task writes many rows with close timestamps, and the same words can come from different tasks.
On every connect and reconnect:
- Open the socket and keep the frames it delivers.
- Read
GET /api/stateand the history of the threads on screen. - Show the history rows, then apply the kept and later frames, skipping a frame that matches a row you already have.
- Recognise a stored row you already have by its
history_idwhen you read history again or page through it.
The socket has no resume cursor: frames sent while you were disconnected are not resent; history and the task reads (§6) are the record.
- How much.
n_human(default 150, at most 1500) bounds conversation rows andn_progress(default 60, at most 600) progress rows. - Paging. While
has_moreis true, passnext_cursorback ascursorto read older rows.page_cursorre-reads the same page. Cursors are opaque. - Main without the Project registry. Main holds every row that belongs to no Project, so while the registry names no room it can vouch for (it cannot be read, was lost after it was committed, or holds only invalid rows) every Main read answers
503 history_source_unavailable(its rows cannot be told from a Project's) withdetailnaming the cause, which the server log also names once; keep what is shown and read again. A registry lost with nothing to rebuild it from, or holding no valid row, stays so until it is repaired. An invalid row beside readable ones is no such case: the rooms the readable rows name are still Projects and Main reads on. A fresh install without a registry reads Main normally. - Rooms with imported history. A place room holding earlier messages its connector imported (stored after newer live rows) reads its conversation by the reading key
[time, order, position]:timeis the provider send time the row's arrival recorded (an import'sts, a live event's readablemessage.sent_at), else itsts;orderis the provider'smessage.source_order, or null, which sorts before every order;positionis the stored position. Each page holds the next older messages in that order, and its cursor continues from the key of a row it delivered. Its chatcoveragecoordinates count the window's frozen rows in that order, one step each down fromupper.chat(0 is the beginning), under the chaindialog-chrono-<end>, where<end>is the window's frozen stored end; a page around a task begins a chain of its own (dialog-chrono-<end>-at-<position>). The chat span also carrieskeys:fromandtoname its lower and upper cuts by the reading key of the first frozen row above each (from: nullthe beginning,to: nullthe frozen present) andfrozenits stored end. Spans frozen at or after the newest read compare by these keys whatever their chain: equal cuts meet, and a smallertoleaves a row neither page delivered; any other span is unknown.history_idandtsstay the row's own. A cursor of an earlier view (before the room's first import, or of an older key form) answers409 history_view_changed; anafterread that would bring newly imported earlier rows answers409 history_delta_reset. - New arrivals. The newest page carries
after_cursor(absent when a read failed part-way or the window holds more tasks than a cursor can name); passed back ascursor, it returns the rows stored since that read with the room's current work (never paging older, ordered by time) and the nextafter_cursor, so a client that keeps a window open reads its new rows instead of the whole window again. In Main or a Project threadwindow.latest_messagenames the newest message among them when one arrived (absent: none did);out_of_orderalso counts the window it continues. - Around a task.
around=task:<task_id>(never together withcursor) reads the page around that task's earliest row of the thread, wherever it lies: about a quarter of each quota before it and the rest after it.anchorsays what was found:{"state": "found", "task_id", "history_id"}with an ordinary page (page_cursorre-reads it,next_cursorcontinues older; it is not the newest page, so it has noafter_cursor), orabsent(the thread's saved history holds no row of it a client could show) ormoved(its rows belong to another thread), both with no rows and no cursors. A source that cannot be read answers503 history_source_unavailable, and a task not found while the saved history is still being upgraded answers503 migrating: unknown, never absent. A stream holding none of the task's rows carries none of its context: the page names it inwindow.truncated_by(chat_around_unpositionedorprogress_around_unpositioned), and on that page and the older pages it continues to, that stream'scoveragespan is null. - Around an exact row.
around=<row_address>uses the same bounded page/cursors, locating the canonical identity in both chat and progress.anchorcarriesrow_addressand eitherfoundwithhistory_idandchat_id, ormovedwith destinationchat_id, orabsent,ambiguous,unavailable, with no rows/cursors. Only complete readable misses in both streams prove absent; an exact match survives the other stream's import/failure. Otherwise an import answers503 migratingand an unreadable source (a same-time different row beside an unreadable line included)503 history_source_unavailable, which may persist: say so rather than promising a retry. Visible current-room occurrences win; answers use their question's visible room. Otherwise home follows the room rule without source references, among the bound room, written room and Main. Unreadable authority for that choice (the registry's room identities, the home's own row, bindings, the row's task lineage) answers503 history_source_unavailable; another room's malformed routing or another row's lineage never does. Inactive/deleted homes and existing rows with no visible home are unavailable; retained context is never the original. For a non-Main destination, read/api/projects?chat_id=…and request the same address there. Land on the exact address or bound history ID, opening and scrolling containing timelines. For an answer, page its question and focus the choice/answer line with itsanswer_row_address; preserve the answer as page-replay evidence outside coverage. A card/portal is insufficient. Only the target's stream is positioned until the newest page is read, as around a task. Showing an old source reads no newer messages. Gestures, newer navigation and leaving invalidate pending reads; a refused or failed read keeps the view and live-edge following; ordinary reopening still shows newest. An unresolved acceptance-time quote retries current state. - Errors. An error answer keeps the same shape, with no rows and
has_moretrue, and echoes the cursor you sent asnext_cursor, so the same request can be repeated:400 history_cursor_invalid, orhistory_around_invalidfor a malformed task/rowaroundor one sent with a cursor;409 history_view_changed: which rows belong to the thread changed (its projects or task bindings); start again without a cursor;409 history_delta_reset: since anafter_cursor, more arrived than one read replays, a stored row could not be read, owner-message annotations changed, a task the window shows settled or changed after it settled, or a shown skill operation ended; read the newest page again (in a busy room this is a common answer, not a rare one);503 history_source_unavailable(an optionaldetailnames the store's cause) ormigrating.
- Incomplete windows.
window.completereports the conversation window's known bounds and gaps;window.truncated_bynames each cause (quota,page,lineage_cap, a stream gap such aschat_malformed_jsonl,chat_appearances_deriving(a Project page may lack a row written elsewhere until the core finishes indexing older rows),chat_reply_target_unreadable(an owner Reply that may belong here stays where it was written: the message it answers cannot be read now), orchat_importing/progress_importing: older rows exist below the archive import's frontier and are not readable yet; the older page that would cross it answers 503reason_code: migrating, retry later). Never treat an incomplete window as an empty conversation.coveragereports delivered coordinates, not chronology (except the time-ordered rows of a room with imported history, above); import gaps use the final spans after quota/lineage deferral. Neithercompletenorhas_more=falsecertifies the entire narration archive: older progress can lie below the conversation floor with no ordinary next page. The builtin client checks older chat spans and recent progress gaps, but does not aggregate older progress-only gaps.
Ouroboros can put an interactive card into its own message: a card frame (CardOutbound), in history a msg_type: "card" row. Both carry only the card's identity card: {card_id, kind, title, revision} and its plain fallback_text (the row's text), which a surface that cannot draw the card shows instead.
- Body.
GET /api/cards/{card_id}(CardResponse) returns the current card with exactly one body:components, a declarative tree drawn like a declarative widget (docs/CREATING_SKILLS.md) withdataas the values its path fields read and no skill route;widget,{skill, tab_id, input?}, that skill's tab fromGET /api/widgetsdrawn inline (it may no longer be live); orapp,{sha256, size, url}. A card that is gone answers404 card_not_found: show the fallback text. - Apps.
GET /api/cards/{card_id}/appreturns the app's HTML astext/plainwithnosniffandno-store. Run it only inside an opaque-origin sandboxed frame built from those bytes (srcdoc, neverallow-same-origin) whose policy blocks fetch, WebSockets and loads, never as a page of the core's origin; navigation and WebRTC are outside any page policy (docs/WIDGET_HOST_PROTOCOL.md§9). What the app produces goes into the owner's draft; only the owner's Send sends it. - Changes. A
card_stateframe (CardStateOutbound) says the card got a new body (card.revisiongrew) or a press was recorded or read (submissions_summary); read the card again. History keeps the row as first published;GET /api/cards/{card_id}is the current card. - Presses on a component card's
actionorformgo toPOST /api/decisions(§7). - Keeping a card.
POST /api/cards/{card_id}/pinkeeps a component card on the Widgets page as a snapshot (CardPinResponse); an app or widget card answers409 card_not_pinnableand the 51st pin409 pins_full.DELETE /api/cards/{card_id}/pinremoves it. Both broadcastextension_lifecyclewithskill: "_cards".GET /api/widgetslists kept cards after the skills' widgets, withskill: "_cards",pinned_card: trueand the snapshot inrender; their presses use the same decisions. - Drawing a card (what the builtin client does). Show the row's
fallback_textuntil the body arrives, and whenever it cannot be read (with a retry for a failure, a plain note for404); never an empty box. Drawcomponentswith no skill route (only inlinedata:media),dataas what path fields read; local components (tabs) never call the core. Each press is a newrequest_idand carries therevisionit was drawn from; a press that got no answer, a5xxor202 owedis retried with the samerequest_idand the same values, and after a reload aoncecontrol's or an action's press recordedowedinsubmissions_summaryis retried under itsrequest_id(a form's next press with values is a new press); aoncecontrol stays locked after its press was delivered or forwarded (here, fromsubmissions_summary, or a409 card_action_once); a409 card_stalereads the card again (a kept copy says it is out of date). Awidgetcard draws the tabGET /api/widgetslists for its{skill, tab_id}, and says the skill is off when there is none. Anappruns only asdocs/WIDGET_HOST_PROTOCOL.md§9 says: an opaqueallow-scriptsframe that cannot fetch or load, whose submit fills the owner's draft and sends nothing; its bridge reports the app's errors, which the card shows. A card's frames in a message are sized and disposed there too. - Starts the page did not outlive. A frame (and a skill's page module, below) shares the page's thread on WebKit, Android WebView and Firefox, so a start that loops takes the page with it. The builtin client writes each start to a local ledger (this browser's or app's storage) before the code runs and clears it once the page outlived the start: a second after it, or when the page hides. An item whose last start the next page finds is not started by itself (its face, its line, the owner's Open or Start; an app opens without its saved state, which it forgets), and
?hold=allin a browser's address holds every item for one load (the page drops it from the address). Not held: a stop later than that second, or WebKit's later memory kill; held although nothing stopped: an app quit before the start settled (quitting ends the page withoutpagehide), or a start another tab of the same browser has in flight when this one opens. A running frame has Close, kept on that device until Open. The page then posts what it found, once:POST /api/ui/holds(UiHoldsRequest:holds: [{key, rev}]withapp:<card_id>,widget:<skill>:<tab_id>ormodule:<contribution key>, and the rawsurfacefactspywebview,telegram) names new holds in one System row (system_type: "ui_hold") per owning chat, the room a card was published in or the owner's chat (UiHoldsResponse:named); a repeat names nothing;503 chat_unavailableand503 in_flight(another tab is naming the same hold now) wrote nothing, after503 not_confirmeda row may be missing, and after any 503 the page reports again. Another client may keep its own ledger and report the same way.
Projects:
- List:
GET /api/projects(ProjectListResponse) returns up to 200 active or deleting projects, newestlast_message_atfirst (original time of the latest qualifying message per DESIGN §10; creation if none,last_active_atwhile undated).?all=1lifts the cap without changing order or shape.?id=<project_id>selects an active or deleting project (lifecycle);?chat_id=<n>selects only its active project. A readable list may have no matches, including tombstones. Fresh absence without a commit witness may be empty; an unreadable registry or one missing beside its witness returns an error. Open references by?id=in the returnedchat_id, never Main. - Create:
POST /api/projects(ProjectCreateRequest→ProjectCreateResponse). One source at most:path(attach a folder),git_url(clone),with_workspaceorno_folder: true, the recorded choice to keep none; a project created without any gets a folder when its first task starts. Creating an existingidwith no source changes nothing and answers the existing row withcreated: false(a flag optional on other responses, whose absence proves neither new creation nor failure); with a source it answers 409. A clone that needs credentials answers 401 witherror_code: "auth_required"(not the network gate). - Turn a task into a project:
POST /api/projects/from-task(ProjectFromTaskRequest) takes no idempotency key: the server deriveshandoff_idfrom the project, the task and its origin message, so repeating the call for the same task returns the samehandoff_id, and with the default project id (task-<task_id>) a repeat also adopts the project the task's work already has (adopted: true). A task bound to another project answers 409. Withoutname, naming may wait for one model call. - Update and delete:
POST /api/projects/{id}/updateacceptsname(at most 80 characters) and/or strict booleanpinned, changing only supplied fields. Old rows read unpinned. Invalid updates answer 400 without writing; missing/inactive rows answer 404, a deletion racing the update 409.POST /api/projects/{id}/deletestarts deletion (a repeat is harmless). Pins affect sidebar selection/order, not list-API recency, activity, routing or read cursors. - Working folder:
GET /api/projects/{id}/folder(ProjectFolderResponse) reads one project's folder: itsstate(usable,missing,unusable,unsetfor no choice yet,nonefor the recorded No folder), theactionsthat state offers (none for a folder in place),workandexpected.POST(ProjectFolderRequest) sendsclear(record No folder) orchoosewith an existingpath, and thatexpected: 409 withreason_codestale,changedornot_offeredmeans read again, 400invalid_foldersays why; a 200 whosefolderis null carriesfolder_error: the change and itsreceiptstand, only the look after it failed, so read again, never re-send. Nothing is created or deleted; work already admitted keeps its folder, andwork.movednames the work that takes the new default at its next start. - Changes from elsewhere:
projects_changedannounces new projects: add theirchat_idto the threads you listen to before reading the list again. - Choosing a folder to attach:
GET /api/fs/dirs?path=lists directories under the home folder only (at most 500,truncatedbeyond that).
Starting a task. POST /api/tasks (TaskCreateRequest). The task_id you choose, or the one returned, is the task's identity.
- Duplicate id: an existing id answers 409, so a retry with the same id cannot start the task twice.
- Outcome unknown:
503withstatus: "unconfirmed"means the task may or may not be queued;GET /api/tasks/{task_id}can answer 404 while it is still queued, so a 404 is no proof it will not run. The sametask_idsent again answers 409 and never starts a second copy. Never resend under a new id; watch the task and let the person decide. - Other 503s: they come before the task is scheduled, and the attempt is cleaned up: nothing runs,
GET /api/tasks/{task_id}answers 404, and the sametask_idcan be sent again. - Host facts in
metadata: who wrote the text and which words a work carries are the host's records, not a caller's: a request'sobjective_author,context_author,owner_corpus,governing_owner_words,governing_owner_words_absent,governing_schedule_textandui_controlare dropped like the other host-owned keys (no error); the task starts without them and keeps the rest ofmetadata.
Reading tasks: GET /api/tasks (filters status, limit, queue_only) and GET /api/tasks/{task_id}. Records identify task_id, status, ts and updated_at; result, artifacts and evidence appear when available. A task that asked to adopt a commit of Ouroboros's own body lists every outcome the next boot settled in body_adoptions (adopted rows name the adopted range in commits, newest first; a cut range says commits_complete: false and counts the rest in commits_omitted), and its review panels name what landed under each record in commit_landings, each with the author decision that governed it (author_disposition, author_reason), the newest 16 per panel with commit_landings_omitted counting older ones the record keeps; neither is a verdict. A root whose review returned FAIL or no verdict, whose author went on over one, or which left a skill on over its review, carries review_overrides: count and latest for those reviews, continued and landed (each {count, latest}) for the author's explicit continuations over one and the commits Git recorded over one, and skills ({count, latest, seen}) for the skills left on although no review passed their current files (latest: skill, reason review_problems or no_review_verdict, door turned_on, after_review or author_finish); an unrecorded part is absent, never zero. Its history summary rows carry the same field. Settled authoring_handovers lists recorded route pairs after tool use (from_model, to_model, status). reply_observed: true attests a successor reply; legacy pairs alone do not. selected with a known selection records that author's accepted choice; work_observed: true attests a successful non-discovery tool call, and a selected row keeps it when the same response worked before choosing — neither attests progress or completion. incomplete does not establish an act. Omitted history is unknown, not empty: an existing card keeps same-attempt facts unless a supplied array replaces them; a newer attempt retires them. Bulky evidence is detail-only. status accepts a comma-separated filter; limit defaults to 50, positive values cap at 500, and 0 requests all rows. queue_only=1 returns {tasks:[], queue} without history.
A Project completion frame/history row may carry the root's closing sentence wake_summary and completion_notice: {neutral: bool, detail: string, phase: string, salvage?: string, cause?: string, undescribed?: string[]}, a transport view, not a verdict: neutral means technical caveats stay in task details, never independently approved success. Full outcome/answer fields remain authoritative; salvage preserves the labelled intermediate excerpt. Main adds the work's task_name and cause, a display sentence whose unknown typed reasons read neutrally, with their exact codes in undescribed for accessible details. Canonical text and detail retain full Project context and codes; authored warning prose stays unchanged. Older rows may omit these fields; replay may derive missing metadata from the canonical result without rewriting retained text. Without recoverable facts, clients retain legacy text rather than parse it into guessed fields.
The terminal lifecycle set is exactly completed, failed, cancelled, rejected_duplicate. Other values, including requested, scheduled, running, interrupted and a pause or pending cancellation, do not prove completion. Terminal lifecycle alone does not mean objective success.
Recent wakes: /api/consciousness includes RecentWakesView: recent_wakes: RecentWake[] | null and recent_wakes_coverage. The category/time-index read yields a page of at most 50 distinct consciousness roots over 48 h, excluding reservations and proven-unsent calls. Own and place wakes each reserve 25 rows, with unused share reassigned; stamped root cause decides, legacy defaults to own. Coverage says “wakes that reached a model call in the last 48 h”; a full page of one kind prefixes “the latest 50”, while a mixed full page says “the latest {n} of its own wakes and {m} wakes in places that reached a model call in the last 48 h”. Busy usage/task/dialogue reads return HTTP 200, null rows and a warning naming that store (unnamed: “data”); other errors propagate. Status and places_brief remain; full Places use /api/places.
task_id identifies the root; chat_id and started_at come from its display document. cause maps metadata.wake_cause to own|focus, falling back to own for legacy category-only roots. conversation copies metadata.focus.conversation_key; place_label resolves the configured metadata.focus.place_id label, and optional place_id carries that id (absent without one) for the Shade's door to the place's sheet. Optional focus first_reply_at is the earliest confirmed receipt or automatic release in the dialogue index, null without evidence; a release alone proves no delivery. ended_at comes only from terminal_time_fact(...).occurred_at, null when unknown. The browser's ouro:open-task {task_id, chat_id} door uses those identities for Main cards (chat_id: 1); a focus row opens its captured conversation in the place sheet through the rooms endpoint below (a focus RecentWake.chat_id is that conversation's room_chat_id).
A focus row optionally carries as: {label: string, owner: boolean}, copied from
metadata.focus.identity.sends_as.label and metadata.focus.identity_owner. It is the credential at focus
time, independent of the incoming actor; own-clock rows and undeclared identities omit as.
live means a matching clock live_wake_task_id or a non-terminal stored status, not proof of execution. Terminal phase uses the card's outcome_phase, including working during open post-task synthesis. Non-terminal rows adapt stored status/wait/stop facts through work_status.classify_member into running|waiting|queued|paused|unknown; only running status or matching clock identity can yield running, and a known wait/queue/pause keeps its word even when the clock names the task. quiet comes from quiet_finish: wake_silent: true, no owner_message_sent and no terminal host notice. Optional said_owner copies the stored owner-message boolean (accepted delivery, not a human-read receipt).
Optional summary copies a non-empty string from the accepted attempt's wake_summary; note is the whole stored result from a PK read. Neither is clipped or synthesized. Optional tool_calls copies the card count; rounds copies loop_outcome.usage.total_rounds. Missing counts stay absent; null stays null. checks: RecentWakeCheck[] copies safety_checks as {chip, tool}, empty when absent. Declared-read and Supervisor-off skips and a message my human's answer sent unjudged share not_checked; the row cannot distinguish them or claim every call was checked. Present TASK_COST_META_FIELDS, including scoped cost_presentation, pass through unchanged to the card renderer; missing money stays missing.
The headline uses status/detail from describe_consciousness_state; unknown/disabled control wins. live_wake_task_id spans binding through settlement: thinking, or wake_paused with live_wake_held (PENDING); neither shows a time. live_wake_hold ({cause, ceiling_usd}, null unless held) is what its records prove (consciousness_view.hold_cause): allowance/allowance_and_cap (the allowance left set its launch ceiling; only these add detail_note and are the owner's move), per_task_cap, launch_ceiling (unstamped; each names its launch limit in detail), owner, sleep, technical, total_budget, per_task_fence or "". allowance_status is the current window's verdict, allowance_open_rows its rows that may still settle (null unknown), allowance_room_after when known spend would fall below the limit if its charges stay as they are ("" withheld). model_route ({value, layer, local}, null when the settings cannot be read) is the route the next wake takes: layer is consciousness when its own slot decides it and main when it follows Main (a place's model_route below is another field, whose consciousness layer means it follows consciousness). owner_turn_live was removed because owner work no longer holds the clock. owner_chat_unknown is a skip whose owner chat binding could not be read, an unconfirmed state and never the owner's move; a known empty binding wakes in Main, so no status waits for a first conversation. Otherwise explained outcomes precede due/sleeping. A past next_wake_at means due, naming appointment_at only when known; legacy state says “Due” without time. Skips/refusals move the next attempt, not the appointment; their explanations label future attempts “at” and past attempts “due since”. Finish sets both times. Host times include a date unless today in the server's zone; the client adds no second clock to the sentence. Host words use tr/fmt; summaries/notes stay authored.
Following a task. Both event methods answer text/event-stream:
id: 12
event: task_event
data: {"seq":12,"type":"task_result","task_id":"…","data":{…}}
data.type, not the SSE event name, identifies the payload. A task_result with terminal data.status proves completion. EOF alone does not: the wait may have ended or the connection failed.
- GET, legacy replay:
cursoris a nonnegative integer, the last processed SSEid/seq, notTaskEvent.event_id.waitdefaults to 30 seconds, clamped to 0–120;0replays the available view without waiting for future work. The deadline can emit: heartbeatand close. - POST, v2 replay: start with
{"v":2,"wait":30}or a null cursor. Return the complete cursor from the last processed frame unchanged to resume.waitmust be an integer 0–120.cursor.viewandcursor.positionsare opaque; this cursor cannot be exchanged with GET's integer. - V2 emits
cursor_checkpointat its deadline, after a silent 10 s slice at the next processed row boundary, or after skipping a replica (REPLICA_RULE). A spent read budget ends that response withouttask_result; resume its cursor. A blocked read can delay a checkpoint. One connection delivers a replica once; resuming between its two frames may deliver the other with anotherevent_id. Changed lineage/view emitscursor_replayand can replay stored events. Diagnostics/checkpoints may reuseseq; replayed events may get a new one. Process their cursor and diagnostics even for a seenseq. Deduplicate stored events by nonemptyevent_id; keep the latesttask_result. V2 is not timestamp-sorted, andseqis not a stored-event identity across replay.
Schedules start ordinary tasks later or repeatedly:
- List:
GET /api/schedules(ScheduledTasksResponse). Each row'sstatusisactive,disabled,consumed,held,waitingordelete_pending(a withdrawn row). Rows also carrydisplay_name,kind(noteortask),timezone,destination,waiting_detailand, once the schedule has run, the last run'soutcome(state,quiet,notice,ended_at,line;stateispending_observationuntil the settled result is read;quietmeans it finished silently with no message sent and no notice;lineis the host notice's last line, else the run's own sentence whole, else its answer's end; a notice or an answer gives at most 160 characters).previous_run_openappears while the host sees the previous run still open; a withdrawn row carrieswithdrawal(at,by,reason,work_in_flight: true, false or null when unknown,restorable). An unreadable table answers 503, never an empty list. - Create or edit:
POST /api/schedules(ScheduleUpsertRequest). An existingidedits that schedule; without anida repeat creates another one.okis true only when the audit record landed (schedule.auditisrecorded). A 409 means nothing was written: the schedule table or its audit could not be used safely. Who supplied each text field and when (task.metadata.objective_author,context_author) and the words a run carried (owner_corpus) are host facts: a field whose text changes is recorded as this door's (kind: schedule_api), unchanged text keeps the current row's supplier, and a copy the request carried is set aside and named inignored_fields, so a row read by GET can be posted back. Text supplied here is the work's assignment and its conditions, carried to the run, its helpers, reviewers and Safety; it is not the owner's personal words and grants no permission only the owner can give.governing_owner_words,governing_schedule_textandui_controlare refused (400). - Disable, delete, restore:
POST /api/schedules/{id}/action(ScheduleActionRequest:actionand a requiredreason);DELETE /api/schedules/{id}also deletes. Delete withdraws (status: withdrawn): the row stays, disabled and restorable, until it is removed after the retention window once its work has settled; Restore cancels the withdrawal once no hold remains on it (withdrawal.restorable), and posting the sameidedits the withdrawn row without restoring it. A refusal is also 200, withok: false:changedis the durable fact andstatussays what happened. An action governs future runs only;running_or_queuedreports a run it already admitted (nullwhen unknown).
Kept services are services a task asked to keep running beyond its own end (keep_alive), read now from process custody: GET /api/services/kept (KeptServicesResponse: each launch_id, name, task_id, task_title, state running, unknown or capture_owed (ended, declared outputs not captured), since, the loopback address its log printed; complete: false means the list may miss one, never "none"). POST /api/services/kept/{launch_id}/stop (KeptServiceStopRequest: a required reason) stops that one launch and keeps its log; outcome is what a fresh read found after it: stopped, not_confirmed (retried at the next start), unknown (also when not listed by a partial read), not_found (nothing signalled); 400 refused without a reason or a launch id. After a confirmed stop outputs says what became of its declared outputs, captured into the task that started it: captured, incomplete, none_declared or unavailable (its start recorded no declaration); ok is true only with captured or none_declared. An ended capture_owed row offers Save outputs through the same endpoint: recheck the launch, stop any remainder and retry capture into its original task.
Downloading a result file:
- Where:
GET /api/tasks/{id}/artifacts/{name}(optionally one ofrelpath,archive,sourceorwrap_up). - Partial downloads:
206is a byte slice, not whole JSON. Wrap up's copy is regenerated per request; never join its ranges across requests. - Checking the bytes: the
x-ouroboros-artifact-sha256header gives the checksum when the core verified the bytes. - Changed after recording:
409 artifact_identity_changedmeans the file changed after it was recorded;410 artifact_released(withreleased) that the owner released it in Storage. A released row keeps its identity and carriesreleased(status_before,bytes_now:staged,deleting,deleted); its bundle status isreleased, never ready or missing. An archive names released members inRELEASED-BY-OWNER.json(headerx-ouroboros-archive-released).
How a question arrives. A task asks the owner through a quiz frame (QuizOutbound), in history a msg_type: "quiz" row, updated by quiz_state frames. Its state is open, answered, closed (explicitly closed without answering), expired_terminal (the task finished; an answer can still be recorded) or superseded.
Private Presence contacts carry presence_contact source facts separately from authored text: on the live quiz or Main report, and inside quiz on a saved question. Main keeps their address; their work's Project shows the same row (live: also_rooms), a place never. The voice line renders its label and optional url; task_id, binding_id and source_event_id retain the source identity. The source grants no owner authority or external reply route.
Answering. Send POST /api/decisions with DecisionRequest and a decision_id of quiz:<task_id>:<quiz_id>:
- What to send:
option_index,comment(nonempty when alone), or both;option_index,answered_indexandrecommended_indexare zero-based positions inoptions. A negative/non-integer index answers400 option_index_invalid, one beyond an open card's options400witherror:"option_out_of_range", and neither index nor comment400 option_index_required. An already closed card can instead return its recorded 409 state; an absent quiz is404 quiz_not_found. - Safe retries: the same
request_idreturns the already recorded answer withduplicate: true, even if the retry's payload differs: display that answer, not the retry's input (a successful replay accepts no changed answer). It also lets the existing delivery-recovery path finish after a partial failure. - First answer wins. A different answer to an already answered question answers
409with the recorded state. - Late answers. An answer after the task ended is still recorded (
answered_after_terminal) and goes to the card'spublication_chat_id, recorded before the card was first shown and never changed, not to its ask-time chat: a question asked in the hidden partition (0) and shown in Main is answered in Main (1), and a converted task keeps that address while history shows its card in the current resolved room.forwarded:trueconfirms the answer entered the ordinary owner-message path there;forwarded:falseis not delivery:hidden_chatanda2a_chathave no owner turn,publication_address_unknown(an older card without a proven address) stays recorded and owed with no guessed room, andlate_answer_delivery_unknownmeans proof of dispatch was lost and nothing is resent. Show this returned outcome; never infer delivery from the room the card appears in. - Recorded but not delivered.
503 quiz_history_write_failed,mailbox_write_failedorlate_answer_not_deliveredmean the answer is recorded but not yet delivered: retry with the samerequest_id. - Not recorded.
503 quiz_answer_unconfirmedmeans no answer was recorded; retry the samerequest_idand answer.
Closing without answering. For a root task's quiz, send the same endpoint and decision_id with a request_id, action: "close" and an optional reason of at most 2000 characters, without option_index or comment; a blank or omitted owner reason records Closed by the owner without an answer., and a non-string or longer one answers 400 close_reason_invalid. Closure shares the first-winner rule with answers; show the returned state, closed_reason and question_delivery: a recorded closure is no proof its author received it.
Removing unknown late delivery from current decisions. For an answered quiz with unknown late-answer delivery, send action: "dismiss" with decision_id and request_id only (no answer, comment or reason). It removes only the outstanding delivery item, neither resending the answer nor marking it delivered; the recorded answer and unknown outcome stay in history. Another, ineligible state is refused; read the returned facts.
Pressing a living card's control. Send the same endpoint with decision_id card:<card_id>:<action_id> (the control's submit.id), a request_id, the card revision the control was drawn from (400 revision_required without it; a card that changed since answers 409 card_stale with the current revision, and nothing is recorded), and for a form its field values as values (field names to text of at most 4000 characters, numbers, booleans or null; at most 50); other values, or values on an action, answer 400 values_invalid. Each press is its own record: the same request_id returns the recorded press with duplicate: true and retries a delivery still owed, whatever the card became since; a control declared once keeps only its first press, and a later one answers 409 card_action_once with winner (its request_id, time and delivery; a winner still owed is retried under its request_id). delivery says where the press went: delivered into the authoring task's mailbox, or its admitted Continue successor's (not proof it was read; a paused, held or queued author keeps it until it continues, reason_code awaiting_recipient_read on the answer and in submissions_summary until it reads it; one that ends first keeps it among its unread mail), forwarded as the owner's own message in the card's chat because that task ended (their words only, the pressed label and each value, as a Reply to the card's row; like a late answer it joins the turn an earlier late answer or press of that task started, never another task's turn), or owed (202 with reason_code: resend the same request_id). 404 card_not_found or action_not_found names a card or control that does not exist now; a replaced card can drop a control.
Secret requests. A quiz whose secret_request ({plugin_name, fields: [{id, setting_key}]}) is present is an integration secret the task asked for with showSecretHitl; it has no options and is not answered here: POST /api/decisions refuses an option or comment for it with 409 secret_request_form_only (the owner's action: "close" is its cancel). It stays usable after its task ends, until saved or cancelled. Use POST /api/decisions/secret (SecretDecisionRequest) with the same decision_id: action: "status" (no request_id) returns keys (per field configured, a boolean, never a value) and consumers (installed skills reading the key: enabled, reads, what their current grant covers). A save (saveSecretToken) sends request_id, values with exactly the asked ids and observed, the configured state the form showed per field; a key set or cleared since answers 409 secret_key_state_changed with fresh keys, so overwriting is an explicit Replace. Settings that exist but cannot be read are keys_unknown to status, and a save answers 409 settings_unreadable without writing. action: "cancel" carries no values. Keep values only in the live controls and reuse a request_id only for unchanged values. saved is present on every save and cancel reply and every refusal (a status read carries only the lifecycle and form facts): 200 carries secret_filled or secret_replaced ({pluginName, fields}) or secret_cancelled, and secret_outcome (replaced_fields, consumers after the save or consumers_unknown when they could not be read, never an empty list instead, late when the task had ended; saving grants, enables, connects and resumes nothing); a refusal carries saved: false, a reason_code and the request's current facts (secret_request_settled, secret_request_stale when the skill maps a field to another key now, secret_value_placeholder for a value Settings would read as a mask); saved: true with secret_save_unverified, secret_not_retained or secret_completion_unrecorded wrote Settings without reporting a save; saved: null is an unknown outcome (secret_save_unconfirmed: the same request_id over an attempt that may already have written is refused, never repeated, and so is every earlier unconfirmed request_id of that question; a cancel after an interrupted attempt saved nothing itself but cannot say nothing is stored). After any of these or an unconfirmed reply, read status first (save_unconfirmed is an attempt of unknown outcome; a set key does not show that this attempt set it); saving again over it is an explicit owner action under a new request_id. Values never appear in any reply, history row, frame or task detail.
Other decisions. Model-wait choices (model_wait:<task_id>:<wait_id>) and persisted routing choices (routing:<client_message_id>:<token>; no new routing pickers are produced) use the same endpoint and idempotency rule.
Stop. POST /api/tasks/{id}/cancel takes an optional TaskCancelRequest: cascade, stop_policy and stop_action_id.
- Safe retries:
stop_action_idnames one Stop action. While that action is pending, an identical request joins it and reusing the id with different arguments answers 409. An immediate Stop records the stop first and answers after it drove the teardown; once the task is no longer active, even an identical retry can answer 404. Read task detail to distinguish the recorded outcome. - Stopped:
200means the teardown settled (withcascade: truewhen the whole tree was stopped). - Recorded, still stopping:
202withcancel_state: "pending"means the stop is recorded and the supervisor finishes it: a graceful stop under way, or an immediate one whose teardown is not confirmed yet (reason_code: "teardown_unconfirmed", with the stop'srequest_id), including an external run whose cancel its engine has not confirmed, or cannot while the engine is unreachable. No retry is needed: readGET /api/tasks/{id}(cancel_state) until it settles; an immediate Stop still hardens a graceful one. - Nothing to stop:
404means the task already finished (completion wins), the id names no task, or a repeated Stop already finished. A task that was created but never started is stopped, not 404, and so is a finished task whose tree acascade: trueStop still finds running (a helper task or an external run). - Nothing recorded:
503 cancel_intent_write_failedmeans nothing was recorded or cancelled, so retry (a server answers it too while the queue that may keep a saved Presence turn is unrestored or unreadable);503 cancel_intent_projection_corruptcannot succeed until the projection file is repaired. - When to offer Stop: chat frames carry
cancelableto say when Stop applies. Do not offer it otherwise.
stop_policy is immediate (also the omitted/empty default) or finalize_then_cancel. A graceful request cannot soften a previously recorded immediate Stop. Task detail has cancel_state:"pending" while cancellation is owed, otherwise the field is absent; there is no public cancel_state:"settled".
An answer delivered before its finalization was cut. A stop that lands after a task's final answer was registered leaves the record failed with outcome_axes.execution.status: "infra_failed" and reason_code: "finalization_incomplete": its review evidence, artifacts and cost accounting were not stored. finalization_recovery then carries answer (delivered, owed, exhausted or unreadable: the custody of that answer when the record was written), cause, delivery_id and attempt. When answer is delivered and terminal_origin is model_final, the owner already has the model's own answer: outcome_phase is done unless another fact of the record fails or warns (a failed objective, review or artifact, a Stop), and the cause sentence says what was not stored. A client that folds status itself reads exactly these three facts; every other finalization_incomplete record stays a failure. The stored record does not change, and Continue is decided as for any failed record.
Partial work. No status:"partial" exists; read result, artifacts and outcome_axes separately. Graceful wrap-up can produce best-effort output, immediate cancellation salvage, and natural completion wins a race with Stop. Wrap up's delegate_terminal_reconciliation.owner_stop_children keeps child/run material and readers on any exit; detail wrap_up_document names its on-read Markdown; terminal execution is not final accounting; engine continuity grants no session transfer. Cancellation keeps recorded evidence; capture can fail or be missing. Artifact states: pending, finalizing, ready, ready_with_changes, ready_no_changes, failed, missing, not_applicable; read the file list.
Pause, continue, resume, hurry:
- Pause:
POST /api/tasks/{id}/pausetakes{request_id}and may declare who pressed: an interface sendsactor: "owner"for the owner's own press, a caller acting for the owner may sendactor: "owner"with areason, and a caller acting for Ouroboros sendsactor: "ouroboros"with one; the owner reads that sentence verbatim after the author's head (You paused it: …). The declaration only names the Pause's author and grants no power; anactorthe core does not know declares nobody, and a Pause that declared nobody is never shown as the owner's. Any other field answers 400.202withlatch_pendingmeans the pause is recorded and still taking hold; repeat the samerequest_id. A live inline Presence turn the owner moved to a Project, carried as text, pauses like other work: its saved work waits in the queue under the same task id, survives a restart and continues on Resume. Any other live inline Presence turn (not moved, or a live call) has no Pause and nothing changes:409 presence_pause_unsupported, or503 presence_liveness_unknownwhile its stack cannot be read;404 task_not_livemeans no such live work. - Continue:
POST /api/tasks/{id}/continuetakes exactly{action_nonce}(on timeout retry the same one: it derives the successor id, no double start); a declared actor (settings headers) reads back ascontinue_requester(owner,ouroboros,unknown).continuation_offercovers a technical interruption or an author's unfinished stop (cause: author_stop), never an ordinary finish. - Resume:
POST /api/tasks/{id}/resumereturns saved work from a budget, owner or technical pause (TaskResumeResponse), after fresh control and money checks. A409can offeracceptable_unknown. Before confirmation, show every affected task and request fromblockers: a helper whose start was not acknowledged might still act or spend money. To accept, send the opaque IDs back unchanged inaccept_unknown, with a nonemptyreason, to the same Resume endpoint. The decision applies to that saved task and pause; it does not replay the start or confirm that the helper stopped. A later positive observation of activity can hold the returned work again.accepted_start_risksidentifies the decisions recorded for delegated starts. A saved or paused Continue whose remaining predecessor work is all observed running or queued answersokwithheld: trueandblockersnaming that work: it is back in its writer wait, offers no Resume and starts by itself once that work settles and the other checks pass; an unknown outcome refuses instead. Unreadable billing refuses with 409code=billing_authority_unavailable, the cause inreason_codeand its sentence inerror(not exhausted money); a refusal may addrefusal_basisnaming the failed check, which changes neither decision nor retention. Not idempotent: a refusal is 409, or 404task_not_pendingonce the queue holds no such task; after an unclear answer, read the task. Only this owner endpoint also moves a moved Presence turn off its admission allowance onto the ordinary project budget, once: spend so far, the tree and shared budgets, deadlines and Stop/Panic still apply; a Resume Ouroboros requests or an automatic return never does. That decision is recorded with the release, so a later Stop, Continue or restart keeps it; a store that cannot record it refuses the Resume and nothing moves. - Hurry:
POST /api/tasks/{id}/hurrytakes exactly{request_id}. A live Presence turn (a correspondent's) takes no Hurry and nothing changes:409 presence_hurry_unsupported;404 task_not_livemeans no such live work.
Reading. GET /api/settings (SettingsReadResponse) returns all settings and _meta (SettingsMeta):
- Network facts:
bind_hostandrecommended_url. restart_state: saved settings awaiting restart;runningholds each pending key's value still in force.effects: when a saved key is consumed:now,next_call,next_wake,next_task,restartorlocal_model(the local model's own Stop, then Start).tokens: one per key that is not a secret, covering its stored value and whether it is stored, for a conditional write.setup_contract: the same vocabulary as setup.- Other facts: policy (
policy_state: Access and Supervisor; its review axis is gone with the retired review enforcement) and agent roster.
Secrets are masked: password types use the configured placeholder; others a short prefix plus ....
Saving. POST /api/settings takes changed keys only (SettingsSaveRequest):
- Masked values: mean "unchanged";
""clears. - Conditions:
if_unchanged: {KEY: token}writes only while each named key still holds the value its token was read with; other keys never matter.connectionis no key: a_meta.connections[].revision(<id>#…, opaque, per process, no secret) checked against that connection now. A mismatch answers409 settings_changed_elsewhere(saved: false, nothing written). An ordinary scalar write sends none (the last writer wins); an edit of a list and an Undo do.unset: [KEY]removes an ordinary non-secret key the same body does not assign (Undo sends its token): a never-stored choice returns unstored.409 settings_precondition_failed: the document kept changing under the save; nothing is written. - Settings with their own writer:
- Language uses only
POST /api/ui/i18n/language; settings saves report it inignored_keys. - The access, context and safety controls go through
POST /api/owner/*.
- Language uses only
- Success:
SettingsSaveResponse;changesholds for each changed key its effectiveoldandnewvalue and the installedtoken(old_absent: truewhen the key was not stored), orwithheld: secret|structurein their place;receipt: "unavailable"stands in when the settings are saved and the receipt could not be taken.restart_state.restart_keyslists settings awaiting restart, includingOUROBOROS_UI_DIR.
All settings writers (Settings, setup, owner controls, language, desktop background) report SettingsWriteRefusal failures; saved records the effect:
saved |
Meaning | What to do |
|---|---|---|
false |
nothing was written | correct the input and retry |
true |
the settings were written; a later step (post_commit_failed) failed |
retry that step; never save the same settings again |
null |
unknown; the writer outlived the wait | read GET /api/settings again before deciding (setup: read the attempt back, §4); an unknown outcome is never a reason to retry |
Only an absent settings document is new: one that exists but cannot be read as an object refuses every writer with 409 settings_unreadable (saved: false, its bytes untouched) until it is repaired or moved aside.
Declared settings origin. POST /api/settings, the Safety owner writes (/api/owner/safety-model, -mode, -rules) and a model_wait decision that saves its model in Settings (POST /api/decisions, the card sends app) read optional X-Ouroboros-Surface (a lowercase token; the app's own pages send app), X-Ouroboros-Actor (owner or ouroboros, as for Pause) and X-Ouroboros-Task-Id. A declaration grants nothing; a missing or malformed part reads api / not declared, never refusing the save, and the client address is never an actor. A save that changed something is recorded once (old → new; secrets and structures by name); one not declared app also adds one quiet System row in Main.
ignored_keys optionally maps skipped keys to their writers (object, not array), the owner-only keys a save outside Cyber Pro skipped included. Unknown ordinary keys may be ignored. immediate_changed and next_task_changed optionally flag any change in that bucket (true, not lists). setup_contract.budgetFields owns budget names, types and minimums. No public request is intended to induce a post-commit failure or unknown save outcome.
Owner controls. Each saves through the same writer and answers the same changes (POST /api/owner/safety-model also takes if_unchanged; a room's Context reports its own old and new without a token); room controls default to Main when project_id is omitted:
POST /api/owner/runtime-mode{mode}:light,advanced,proorcyber_pro; applies when the core next starts.POST /api/owner/context-mode{mode, project_id?}:nano,lowormax, for that room's new participants, others running too.POST /api/owner/safety-mode{mode}:full,lightoroff.POST /api/owner/auto-grant{enabled}.POST /api/owner/effort-range{min, recommended, max, project_id?}: effort tiersnone–ultra, min ≤ max;recommended(primary) is independent. Context/Effort keep actor snapshots.POST /api/owner/subagents-mode{mode, project_id?}:off|auto|swarm. Response:{ok, project_id, subagents_mode, cognition}; invalid choice400:subagents_mode_invalid, missing room404:project_unavailable, each withsaved:false.POST /api/owner/chat-model(OwnerChatModelRequest): a Project choosesmain(follow/reset) ormodelwith a route anduse_local. Unlisted routes pass the grammar. Subscription routes cannot be local. Response:{ok,project_id,model_choice,previous_model_choice}. Without a Project onlymodelis valid. Main returns{ok,project_id:"",main_route,previous_main_route,account,window_reset}. Routes containmodel,use_local. A same-source pin iskept, otherwiseautoon subscription ornone. A model change clears the manual window. Invalid:400:chat_model_invalid; missing room:404:project_unavailable.POST /api/owner/chat-processing(OwnerChatProcessingRequest):{processing,project_id?,if_unchanged?}. A Project sets its new work’s tier (standardexplicit,""inherits) and gets{ok,project_id,processing_choice,previous_processing_choice}. Main gets{ok,project_id:"",main_processing,previous_main_processing,processing_default}. Invalid:400:chat_processing_invalid; missing room:404:project_unavailable. Main model saves can useMainBindingConditions. Enabling or moving Main Ultrafast requires the four shown model/local/account/tier tokens andif_unchanged.ultrafast, JSON text[model,use_local,pin,store,fingerprint]. Only a subscription pin names a store and fingerprint. Auto leaves all three strings empty. On API routes the destination’sconnectionrevision must match before and after the write. To change that connection, save it with Main on Standard or Default, then confirm Ultrafast in Models. A stale read gets409:settings_changed_elsewhere, malformed conditions get 400, and neither saves. A model-only command or persistent Main/reviewer:main wait cannot transfer Ultra. Confirm in Models or switch only the waiting task./api/statecarriesprocessing_tiers:{main, default}(defaultexcludesultrafast) and each Project’sprocessing_choice. Admission stampsmetadata.processingonce beside the lead ({source:"room",tier}or{source:"default"}); client task creation and schedule templates cannot set it.
Room writers return saved cognition (context_mode, effort_range, subagents_mode), also in project summaries. A new room copies Main's Effort and Subagents once and starts its Context in Max; legacy missing Subagents defaults to Auto. A room's model is its own and never copied: /api/state carries main_route:{model,use_local}, each project summary its model_choice (absent on the row reads {kind:"main"}). Owner roots, Project conversation turns, scheduled work and API work capture metadata.lead once at their own admission: {source:"room",model,use_local} or {source:"main"}. A cited model start carries {source:"owner_words"|"owner_press",model,use_local,cited}. An uncited Cyber Pro start carries {source:"mind",model,use_local}. An existing lead wins; Continue, Resume and placement keep it. A separately started root reads its destination anew. A place turn carries its place's or circle's model in the same field as {source:"place"|"circle",model,use_local}, keeping its model_role:"consciousness" metadata. Other Presence turns, delegated children, nannies, autonomous work, role-named tasks and call turns retain their own routing. The lead carrier is host-minted: client task creation strips it and scheduled task templates reject it. Both doors store model_role:"lead", but that selector is inert: it binds no model and bypasses no admission. A carried model runs on the derived role lead with Auto account and no manual window. /api/state reports Main's stored subagents_mode and subagents_availability (available|disabled|unsaved). Settings › Agents, when off or unsaved, withholds the catalog and locks effective Off without losing the saved choice. Off refuses new subagents, continue_from and plan answers (subagents_off_in_room): each starts a run. Running subagents finish; reviews run. Off→on reaches running tasks' next admissions and round facts at once; their catalog, built with context like other entry settings, arrives with the next task. Scheduled work and what carries on from it (metadata.schedule_writer_kind, host-stamped: children, started roots, Continue) reads Swarm as Auto in admission, catalog and round facts, while the room's Off and Settings still stop it, including consciousness-authored and Presence-bound schedules. Without that clock origin, Presence, consciousness and Evolve keep their own controls. Send waits for room saves. Accepted owner rows' subagents_mode:"swarm" labels echo/history only for effective Swarm; retries preserve it. Roots record effective mode too (disabled/unsaved means Off); a root's swarm_receipt.refused_starts lists its tree's definitely refused helper starts (invocation_id, task_id, reason; review seats excluded), which have no actor: [] means the receipt read them and found none, an absent list (an older receipt) proves nothing. ChatInbound.force_plan is deprecated, accepted and ignored for one release; clients omit it. Sending creates no project or plan obligation.
POST /api/owner/capability-ack (CapabilityAckRequest) vouches for one exact route's maximum response or context window. It writes acknowledgement evidence, never settings; a repeat overwrites it and zero revokes that exact route's acknowledgement with an audit.
Other settings routes:
GET /api/settings?response_limit_preview=1&model=…&local=false&account=…&role=main&window=0reads stored API evidence and the selected subscription's local catalog without writing. The catalog supplies account binding and maximum response; stored window evidence uses that binding. Optionalwindowpreviews a role draft; omission uses its saved value.windowreturns tokens, kind, reserve, source (a refusal's with itsbasis:provider_stated,exact_local_count,anchored_estimateorunrecorded), observation date, disagreement, retired history and shared text;window_routepluswindow_acksupports exact-route Clear.GET/POST /api/ui/preferenceshold installation-wide owner preferences shared by windows and devices (including widget arrangement). Unknown keys are refused. These are separate from browser-local appearance; do not initialize shared preferences as if they belonged to one replacement client.POST /api/settings/secretreveals one stored secret on purpose: exactly one of{key},{mcp_server_id}or{mcp_server_id, header_name}. It writes nothing;valueis""when the secret is not set.GET/POST /api/desktop/autostartand/api/desktop/background({enabled}) read and set the desktop app's start-at-login and keep-running choices. Where this host cannot honour one, itsstateisunavailablewith areason.
The interface language:
GET /api/ui/i18nreturns the language and its translation memory.POST /api/ui/i18n/languagechooses a language and broadcastsui_language_changed;ui_i18n_updatedtells every client to read the memory again.GET /api/ui/i18n/exportdownloads a language's memory file;POST /api/ui/i18n/import(UiI18nMemoryDocument) replaces its imported layer, keeping the owner's own entries;POST /api/ui/i18n/regeneratedrops generated entries and generates them again in the background. Each bumps the memory'srevision.
Chat attachments.
- Uploading:
POST /api/chat/upload(multipartfile) returnsUploadResponse.filenameis the stored id;view.urlis the download link. - Lifetime: an upload stays pending until a message accepts it.
- Deleting:
DELETE /api/chat/uploadwith{filename}deletes only pending uploads (otherwise 409); a repeat answers 404. - Downloading:
GET /api/files/download?upload=<id>.
The file browser works inside one root: the configured file-browser folder. Without one, a loopback request browses the home folder and a remote one is refused (400). Every path is relative to that root:
- Reading:
GET /api/files/list(at most 500 entries, directories first),read(text capped at 256 KiB or 120,000 characters),contentanddownloadwith?path=. - Writing:
POST /api/files/upload(multipartfileandpath; at most 100 MiB),mkdir,write,deleteandtransfer. Each answersFileChangeResponse. - Repeating a write:
writeoverwrites, so it is safe to repeat.mkdir,uploadand a repeated copy answer 409 (the target exists); a repeateddeleteormoveanswers 404.
Errors:
.., control characters or escaping links answer 400.- Owner-only files answer 403.
- A target that already exists answers 409.
Files produced by tasks are covered in §6.
What is installed:
GET /api/extensions(ExtensionsIndexResponse) listsInstalledSkillrows without network I/O. Inlive_reason:health_unavailable, background status is unconfirmed;companion_refresh_pending, a settings replacement is pending;retained_unresolved, a companion awaits confirmed exit; a companion failure names only companions the loaded publication registers, or any with none loaded, never one that companion's later start superseded; another folder's publication:health_unavailable, no recorded health.retained_companionsmaps this directory’s pending exits to reasons even with an invalid manifest.collision_row_iddistinguishes displayed namesakes only.manifest_filenames the manifest the loader parsed, even when the payload hash failed;""marks a placeholder row (collision, unreadable or missing manifest) whosepermissionsandgrantsdeclare nothing, so a client states no access for it; an older host omits the field. A lifecycle-queue event is no installation: itssourceis the caller, never the package's origin.- A skill row's
mcp_servers([]if none declared, absent on identity-collision rows) gives{id, title, conflict, bound, configured, tool_count, listed, error, notes}:conflict, another row claims the id;bound, this skill owns the row;configured, binding and MCP are on;listed/tool_count, last listing;error, refusal or failed listing;notes, successful listing diagnostics. GET /api/extensions/{skill}/manifestand/settings_sectionread one skill.GET /api/skills/daemonslists companion processes.
One lifecycle lane handles enable, disable, grant, delete, review, attest and all installs, updates and uninstalls. Toggle, grant, delete and attest default to terminal results, including for older clients and dictation. Prefer: respond-async gives a quick result or, after ~10s, {ok: true, pending: true, job_id, message}: accepted, not finished. Catalog install and replacing update return jobs immediately (§12). Review may take minutes. Jobs survive disconnects. Follow GET /api/skills/lifecycle-queue (running job and last 80, in memory) or system_type: "skill_lifecycle" progress. Reread the listing on settlement. A lost response does not authorize a blind retry.
Revision guard. Actions with expected_content_hash return 409 if content_hash changed. Reread GET /api/extensions and show the revision before retrying.
Owner actions on one skill:
- Enable or disable:
POST /api/skills/{skill}/toggle(SkillToggleRequest). Enable retries missing companions. A load failure returns 409 withenabled, the saved switch: Off again after a first Enable, still On if it was On. A repair left unfinished answers 200, On, with the reconcile'sextension_reason,load_errorandretained_companions. - Grant:
POST /api/skills/{skill}/grants(SkillGrantRequest) grants only current manifest requests, merging repeats.enable_after_grant: truekeeps Enable through a pending job; else install-time turn-on stays. Terminalsetup_error: granted, setup failed. Enable givesenabled,extension_reason,load_error,retained_companionsas Toggle. - Review:
POST /api/skills/{skill}/reviewanswers 200 with the review's outcome (SkillReviewResponse). A review already running for the same revision answersstatus: "pending"with itsjob_id. WithSkillReviewRequestit continues stopped seats of an earlier Skills-page review (askill_review.historyrow'scontinuable_seats) on that review's bytes; any other body answers 400.GET /api/skills/{skill}/review-history/{job_id}renders a finished review. - Attest a review:
POST /api/owner/skills/{skill}/attest-reviewrecords the owner's verdict: 200 withok: true(possibly pending above), otherwise 409. - Delete:
POST /api/skills/{skill}/deleteunloads an external or self-authored skill and removes its payload and state; a repeat answers 404.deleted_stateconfirms state removal. - Publication check:
POST /api/skills/{skill}/publish-preflightis read-only; every status answers the same shape, andstate: "hard_block"is a refusal. An optional body{destination: {source_id, mode}}(SkillPublishPreflightRequest; modeorigin,entryornew_entry) picks where it would go; the answer'srepositoryis that destination (default: where the skill came from, else the hub). Missing publication prerequisites may answer409before the skill is looked up; readreason_code, not an assumed404for an unknown name. - Reconcile:
POST /api/skills/{skill}/reconcileapplies saved state. Its server receipt reads companion failures and observed pending exits (retained_companions; none for a colliding name: read its rows) as the listing does, even if saving health failed; a deferred reload keepslive_call_activeand those words inload_errorunless it has its own. - Connect tools:
GET /api/skills/{skill}/mcp-connectpreviews the declared rows, what runs, theother_serversturning MCP on starts and itssettings_digest, writing nothing.POST(SkillMcpConnectRequest) confirms with that digest,expected_content_hash(the preview’scontent_hash) andconfirm_other_servers: trueif any. A changed document or revision, conflict, unready skill or policy refuses withsaved: false; underPrefer: respond-asyncan unsettled confirm isSkillMcpConnectPending: unconfirmed, follow its job.
Required by a deployment. Under a policy file that requires extensions, GET /api/extensions adds deployment: {when_unmet, required} (each requirement as the server process observes it: state, reason, detail, the observing process; a missing package included), and a required skill's row carries its own deployment row. Its switch and removal are the organization's: Off, delete, uninstall, update, a same-name install and a repair task answer 403 code: managed_by_deployment before any effect; Review, attest and grant stay the employee's. No answer carries a value the file fixes.
SkillActionRefusal: error, status_code, optional facts. A revision mismatch may give only ok, error, status_code; absent review, grants and revision stay unknown. On load/unload, extension_lifecycle {skill, action, reason} refreshes GET /api/extensions and GET /api/widgets. An empty extension_health_changed means background status changed: reread the visible list until one succeeds.
Places: GET /api/places returns places: PlaceSummary[] and connector declarations. place_projection supplies the same summary to write responses and the model's map. connector is the technical skill id; label is the service or saved instance title; icon is sanitized {kind: "host", name}, {kind: "svg", svg} or {}. connector_label is absent. readiness: {text, tone} describes loader availability; the live connector's optional source.url supplies its own status text/tone when read. The summary also carries source, settings and optional declared facts. unanswered counts open focus turns, not owed replies; unknown spent_24h_usd is null. Optional quiet: {cause, word, note, door}, derived on every read and never stored (full views only), names the one cause that keeps a place that is not Paused quiet now: panic, off (it only hears), allowance (the 24-hour allowance is spent, or is $0; nothing there starts a new wake until it has room) or advises (it reads and thinks; what it would say waits for the owner); word is the row's state, note the sheet's sentence and door the Dashboard panel to open (consciousness or costs). It is absent otherwise, an unreadable switch included. The places answer also carries connect_note, the host's sentence for a place added now. GET /api/consciousness?switch=on|off previews a turn: {to, lines, places}, the host's sentences and every place the turn concerns, the busiest first, with the people who wrote there in the last 7 days (people_capped: true when a place's read reached its cap); places is null when the place store could not be read (the app still asks, with the lines), [] when no place concerns the turn. Each place carries circle: PlaceCircleChoice | null (who placed it) and description: PlaceDescription | null (a purpose line, never a rule); the response names each circle once in circles: CircleSummary[] (circle_id, name, text, text_author, text_at, revision, model). PlaceSummary.model is the place's own stored choice; model_route: {value, layer, local} names its current model and scope (place, circle, consciousness) and whether an inherited or alias route is the local runtime. An empty place model inherits its circle's model, then consciousness (an empty role inherits Main); clearing either scope restores inheritance. Old circles without a stored model project model: "". Stored main/light aliases resolve for display now and snapshot at admission; migrated places' explicit aliases remain place overrides until cleared. Circles reads it when shown and after place writes; a Dashboard focus door reads it when pressed.
POST /api/places takes PlaceConnectRequest: {connector, account_id?, conversation_id?, label?, note?, description?, circle_id?} (strings). A new identity starts Silent atomically with the declared wake suggestions and an Add's note, description and circle; repeat Connect preserves existing choices, and one carrying an Add's words answers 409 place_exists with the current place, writing nothing. A nonblank instance label becomes <Service> · <label>. Connect reads optional status-route connect: [{account_id, conversation_id, label}] lazily. Its four states, invalid-row handling and explicit Whole account action are defined in CREATING_SKILLS, “Declaring a place, tool effects and an icon”; null accounts never authorize a wildcard instance. Service, instance and account labels remain authored text.
Full place summaries retain safety_mode: off|light|full from the consciousness Safety setting and
manifest-derived labels: {kind: label}; connector rows also carry those labels. Neither summary carries
identity or can_confirm. The sheet reads identity and labels from the connector's status payload,
using the GET of declared source.url it already performs for readiness. Status labels override manifest
labels; shared core words are the fallback. Identity has optional sends_as: {id, label, kind} and
reads_as: [{id, label, kind}], with kind: user|bot. The browser derives owner only for user identities
matching owner_accounts or shared_owner_accounts in the place's account scope, and can_confirm only for an
unconfirmed user sender. Full summaries carry shared_owner_accounts: each account another place of the same
connector and provider confirms for this place's account scope (platform_actor_id, label, confirmed_at,
account_id, and that place's place_id and place_label); it counts here and is revoked there. The existing confirm writer takes platform_actor_id = identity.sends_as.id; no new writer or
stored Place field is introduced. The server never dispatches a connector route for a place view, a
focus, a Safety check or an own wake. Focus identity is the event's snapshot; other Safety targets and
own-wake text read the first valid identity among the place's newest 50 captured arrivals (of the
call's account, when it names one). Brief views
for status/launch remain unchanged.
The browser's Place identity twins live in web/modules/place_contract_types.js, re-exported by
client_contract_types.js: PlaceIdentity has optional sends_as and reads_as accounts (id, label, kind,
with owner derived by the client only for confirmed user accounts). PlaceSummary keeps optional safety_mode
and manifest labels, without identity or can_confirm. PlaceStatusPayload declares text, tone, optional
identity and labels from the existing status GET. The sheet validates identity, derives its confirm action,
and overlays status labels on manifest labels; absent fields preserve older rendering. RecentWake.as declares
the optional {label, owner} account stamp.
PlaceHistoryFacts, alongside PlaceHistoryAttention in the Place twins, declares optional heard facts,
captured identity, outgoing sends_as / sends_as_owner, held held_text / held / checked, and
reaction ({summary}, host English for a row's typed reaction, never speech; words it sent stay text). These are
retained room facts, not guesses from current settings. Every consumed wire key stays pinned by
tests/test_client_contract_bindings.py.
revision belongs to the record and increases across disconnect/reconnect. POST /api/places/{place_id} (PlaceUpdateRequest) and DELETE /api/places/{place_id} (optional PlaceDisconnectRequest JSON body) accept expected_revision; clients send the revision each edit/disconnect was made on (a draft: its first key's). circle_id ("" none) and description ("" clears) move the place's revision. A stale write returns 409 place_revision_conflict with current place: PlaceSummary | null (null if disconnected). POST /api/circles takes CircleCreateRequest: {name, text?, model?}; POST /api/circles/{circle_id} takes CircleUpdateRequest: {name?, text?, model?, expected_revision?}. Both model fields are strings; blank inherits. Those writes and DELETE /api/circles/{circle_id} (expected_revision; 409 circle_revision_conflict with current circle) answer {ok, circle}; delete adds detached: [{place_id, label}], its places keeping notes, descriptions and states. Repaint current facts, preserve drafts and require a deliberate next save; do not replay a stale draft automatically. A lost response leaves the outcome unknown: re-read before retrying. Disconnect retains room history. Display accounting failures keep spend unknown and do not turn a committed write into a refusal. GET /api/places/{place_id}/rooms (PlaceRoomsResponse) returns arrival-indexed rooms: safe integer room_chat_id, address, nullable label (latest arrival's title/name), conversation_id, thread_id, last_at (latest arrival by its time, imported history included) and nullable unanswered_count (open focus turns); coverage names discovery: arrivals and store-wide chat importing/gaps; legacy/outgoing-only rooms may be absent and no provider completeness is promised; unavailable reads answer 503, an unknown place 404; GET starts no focus. Existing /api/chat/history?chat_id=... cursors carry optional place_history: kind message/notice/delivery; recorded delivery_state authored/accepted/delivered/failed/uncertain; attention heard with its reason or an exact task-backed focus_started; current owner_confirmed only when the captured transport.actor.authenticated is not false (absent preserves legacy behavior); imported rows instead carry historical_import (authorship: participant or platform_account, received_at), without attention or owner confirmation; sent_at is the provider send time a row's arrival recorded (absent when none was); non_text lists an arrival's or receipt's own connector {kind, description} beside its words (state_change: a change, not new words), never speech. Missing facts stay unknown; no exact wake match is inferred. Records and authenticated ingress: CREATING_SKILLS, “Places and focus transport ingress”. Authorship follows role, including v0 sender metadata. Page truncation differs from importing/unavailable spans; partial ranges retry via page_cursor, failures retain the requested cursor.
A Place room's ChatHistoryMessage.place_history contains retained facts. Optional facts: string[]
on heard rows is the connector's declared event facts, empty when none were declared; attention keeps
its decision/reason shape, plus recipient when reason is current_author or conversation_work: the initial author or work that accepted
that arrival, not its current holder after a later handoff and not proof of reading. Focus rows add no facts list.
Captured incoming rows may expose identity: {sends_as?: {id, label, kind}, reads_as?: [{id, label, kind}]},
where kind is user|bot. Receipt rows may expose sends_as: {id, label, kind} and sends_as_owner: boolean,
frozen from the delivering focus's identity/owner metadata; current accounts do not rewrite them, and
connector receipt v1 is unchanged. Hold notices may expose complete held_text: string, held: true and
checked: false: the state/autonomy hold precedes Safety checking. The visible System line stays unchanged.
Older rows acquire no invented identity, facts or hold/check fields.
Widgets:
GET /api/widgets(WidgetsResponse) lists the widget cards. Each card has arender.kind:iframe: frame the extension route named byrender.route.declarative: a component description the interface draws; the components are described indocs/CREATING_SKILLS.md.module: reviewed JavaScript run in a sandboxed frame.WIDGET_HOST_PROTOCOL.mdis the complete host protocol: frame, document policy, message grammar, fetch relay, events, theme, size, downloads, links and the dispose handshake.
GET /api/extensions/{skill}/module/{entry}serves captured classic-widget sources (no-store, any-origin CORS; network auth still applies).render.entry_type: "module"opts into native ESM and a finiterender.assetslist. The parent mints a file lease with{skill, tab_id, generation}atPOST /api/widgets/asset-leases, renews/revokes with{token}at its/renewand/revokecontrols, and follows the full loader/lifetime contract in WIDGET_HOST_PROTOCOL.GET/HEAD /api/widget-assets/{token}/{path}is scoped bearer reading (auth: "asset_lease"in/api/contract); it accepts no cookie fallback or API calls. The same loader works locally and behind the network password. For these entries treatgeneration, alongsiderevision, as a remount signal; classic entries followrevisionalone. Classic module andkind: "iframe"mounts mint a route lease withscope: "routes"instead:GET/HEAD /api/widget-resources/{token}/{path}runs that skill's own GET route without the owner's cookies (alsoauth: "asset_lease"), for the frame's native image, media and font loads and the route page itself. Keep it through a failed renewal and a core restart by posting the mint body again withtoken(410 once that lease was ended). Frames talk to their mount only on theMessageChannelport their document hands over in its hello; a route page gets the bootstrap from the publicGET /api/widget-bridge.js(WIDGET_HOST_PROTOCOL §4).POST /api/widgets/fault(WidgetFaultRequest,WidgetFaultResponse) keeps one fault a running module widget's card shows as awidget_faultrow ofGET /api/logs/events: the card'sskill,tab_idandrevision,where(boardormessage) and the frame'skind,message(at most 500 characters),source(200) andline. The row has no task and is the page's report, not a verified execution. At most 10 rows per widget and 100 together are written per minute; past that the answer islogged: falseand the widget's next row carriessuppressed_count.400another shape,413a body past 8 KiB,503not written. A client may skip reporting.
Contributions (controls, speech engines and places): GET /api/ui/contributions
(UiContributionsResponse, Cache-Control: no-store) returns contributions,
offers.stt, icons, problems (skill → warning strings), preferences and
voice. The same fields appear beside skills/live in GET /api/extensions;
live.contributions contains the loaded extensions' captured entries.
Instruction skills contribute only while enabled and allowed by their current
review gate; extension entries belong to their loaded publication. Invalid
semantic entries are dropped individually and reported, also by skill preflight.
Each contribution has key (<skill>:<id>), skill, skill_label (manifest name),
id, label, title, icon, order, revision and render: {kind, url},
plus either placement or provides. Placement entries carry action and chips
carry source: {url, refresh_s}. For skill.request, action.url and route_url
name the host-computed absolute route; providers use route_url. Optional
provider fields are runtime, destination, languages, formats,
install_size, max_bytes and max_seconds. Place providers require an extension
with the presence permission, id, label, and destination: vendor:<Name>;
scope defaults to account (or conversation), wakes lists typed wake facts,
source uses the chip contract, settings names a section, and read_only: provider
indicates provider support. Their tools list carries full names and declared
effect, target, conversation, thread, message, sends and touches facts. No speech-engine runtime/route
is required. icon_spec is {kind:"host", name} or {kind:"svg", svg} with
sanitized geometry, else {} for the fallback; the icon declaration remains
a host name or ui/icon.svg. SVG assets carry sandbox CSP. Installed and Browse
rows expose connects (boolean) and icon (the same spec); absent catalog fields
remain compatible. icons is the host glyph catalog. offers.stt lists non-live built-in providers as
{skill, skill_label, id, label, destination, install_size, enabled: false, installed};
installed: false names a built-in this install has not installed (clients send the
owner to Extensions › Browse to install it from the built-in source).
There is no marketplace offer until its catalog exposes contribution metadata;
clients can link to the skill's entry in Extensions instead.
render.kind: host runs trusted same-origin code and requires an extension with
page_module permission and its ordinary hash-bound grant/review authority.
GET /api/extensions/{skill}/ui/{revision}/{path} serves only captured ui/
assets of that live revision: .js as text/javascript, CSS, JSON and images by
type, with no-store and nosniff. Example entry:
/api/extensions/voice/ui/<revision>/ui/voice.js; relative imports stay in that
revision. Missing, non-UI, unsupported, unloaded or stale paths answer 404.
Like module/, a GET under ui/<revision>/ is host-owned, never the skill's own
route. These modules are distinct from the opaque-origin widget frame protocol.
The builtin client records each module's start in its start ledger (Living cards above) and does not import a
module again by itself after a start of that revision the page did not outlive; one notice names it with Start it.
GET/POST /api/ui/preferences persist voice: {stt:"", tts:"", tts_voice:""}
(tts_voice: the chosen tts provider's voice id, empty for its own pick),
contributions: {hidden:[], order:[]} in the install-wide preference file. GET carries model_recents:[{model,use_local}], at most four routes,
newest first without duplicates (locality is part of identity). The server records an owner model choice
on a room save or Main write; POST naming model_recents returns 400 without writing, like
read_ahead_revisions. Recents are suggestions, never an allowlist. model_pins:[{model,use_local}] (at most 24, pin
order) changes only by {model_pins:{pin:[route], unpin:[route]}}, applied under the file lock so windows never undo
each other's pins (a list is 400); ui_preferences_changed names model_pins and every window reads them again.
POST merges named nested keys, replaces each supplied list, and rejects unknown
nested keys, non-string keys, strings over 120 characters and lists over 64 items
with 400. contributions.hide / contributions.show (lists of keys) add or remove
single keys of hidden under the file's lock, so concurrent windows keep each
other's choices; a resulting hidden over 64 keys answers 400. A committed
contributions change broadcasts ui_preferences_changed. A missing provider never clears or substitutes a saved key.
The contribution response includes these preferences and voice[kind] as
{key, available, reason}: reason is empty when available, not_selected for an
empty choice or provider_unavailable for a missing chosen engine. Client API
availability is a separate browser fact. Re-read on extension_lifecycle, WS
open, the end of a skill lifecycle job (its chat row with system_type: "skill_lifecycle" and lifecycle.phase completed, failed or cancelled) and
ouro:skill-lifecycle; owner toggles invalidate instruction entries too.
Server STT uses POST of raw audio to route_url, with its recorded Content-Type
and optional ?lang= (the builtin client sends none). Reply: {text}, {text:"", status:"no_speech"} or
{error:{code,message}}. The existing 512 KiB extension-route cap is unchanged.
Optional max_bytes is 1..524288 and max_seconds 1..600; formats is a subset
of audio/webm, audio/ogg, audio/mp4, audio/mpeg, audio/wav. The recorder
honors these limits before upload; 393216 bytes at 32 kbps for 60 seconds is a
provider declaration, never a host exception by skill name.
The skill's own routes: everything else under /api/extensions/{skill}/ belongs to the skill.
- A route that does not exist answers 404, and a skill that is not running answers 409.
- A method the skill did not declare answers 405.
- A request body over 512 KiB answers 413.
- A skill that fails answers 502.
Behind a network password:
- Direct frame loads are not portable. Cookie attachment depends on the browser and request mode. In the separate-host tests, a passive image was refused with 401 in Chromium but sent the session cookie and loaded in WebKit. Do not depend on either outcome for other assets.
- Loading through the host. Such files must be fetched through the widget host and loaded from
blob:URLs, asdocs/CREATING_SKILLS.mddescribes.
Shared controls. The author kit of shared controls always comes from the core's builtin files, whatever interface is selected.
Sources (the owner's list, OUROBOROS_SKILL_SOURCES; while it is unset the list is derived from older settings and not written):
-
GET /api/skill-sources(SkillSourcesResponse) lists the sources with theirtrust(trustedinstalls without review,reviewreviews each skill),confirmed, and readstate(ready,reading,errorwitherror, orsearchfor a registry);managed: truemarks a row a build's settings supplied (it stays editable). A repository row readsref(branch or tag) or a pinnedcommit(neither: the default branch) from its folderpath;problemsnames what its last read could not offer, with exact paths.materializedsays whether the list is saved;problemexplains a saved list that does not validate (the derived list is in use).suggestionslists a build's suggested repositories (OUROBOROS_SKILL_SOURCE_SUGGESTIONS; empty in the open-source build) withconnected; nothing connects or gets a trust until the owner adds it. -
POST /api/skill-sources/probe(SkillSourceProbeRequest:urlwith optionalrevision, a branch, tag or full commit id, andsubfolder; orpath) reads an address once and answers{kind, suggested_name, owner, found, problems, commit}(commit: the exact commit read) (owner: the hub's maintainer, else the account the address names; absent for a folder) or{error}. Plain HTTP is accepted withwarning: "not_encrypted"; embedded passwords and HTTP(S) usernames are refused. Nothing is saved. -
POST /api/skill-sources(SkillSourceAddRequest: the probe's location, a name and a trust; a folder refuses a revision or subfolder),POST /api/skill-sources/{source_id}(SkillSourceChangeRequest:name,trust,confirmed) andPOST .../{source_id}/removeare owner settings writes answeringSkillSourceChangeResponse(400 withcodeinvalid_sourceorunreadable_source). A trust change never rewrites an existing install.POST .../{source_id}/refreshstarts a background fetch. Local sources load in place asuser_repo,.agents/skillsincluded, with ordinary review and global name uniqueness (a name another location already uses is a collision: neither copy runs until one is renamed); removing a row stops loading its folder without deleting it. Install never replaces that owner folder. Reconnecting the default public hub restores missing Official (trusted) and Community (review) rows, both unconfirmed, and preserves any surviving row's choices. -
POST /api/skill-sources/my-skills(MySkillsRequest:{}) uses the GitHub token in Settings to request a private<login>/ouroboros-skillsrepository with an initial commit, or connect an existing repository with its actual visibility; noghCLI is needed. A new git source is named My skills, withtrust: "trusted"andconfirmed: true; reconnecting preserves the owner's name, trust and confirmation of the row that reads the repository's default branch from its top folder (another view of it stays a separate source). Success is HTTP 200{ok: true, created: bool, repository: "<login>/ouroboros-skills", private: bool, source: SkillSourceRow}(MySkillsResponse), whereprivatecomes from GitHub's repository response. Failures have{ok: false, code, error}: HTTP 400no_token, HTTP 403cannot_create(403/404 on creation; the token needs repository-creation permission), or HTTP 502failed. Publishing uses the git destination path and merges when the account can push; HTTPS GitHub source reads retry authentication refusals with the configured token to share private skills between installations.
The catalog shares git clones by repository/ref and snapshots by repository/ref/path. Official/recommended mean exact endorsement through a hub row with part: "official", or the bundled release; other hub repositories keep their entries without these marks. It answers from local data; a stale cache or ?refresh=1 starts a background fetch, and a source never read shows state: "reading":
GET /api/skill-catalog(SkillCatalogResponse):items(SkillCatalogItem, id<source_id>/<name>) withofficial,recommended,category,owner,updated_at(when the release last changed in its source: a git source's newest commit touching it, a registry's update time; absent when unknown),signals(nullmeans no data, never zero),withdrawnandinstalled(installed, orname_takenby another source's skill);categories;sourceswith their read state.GET /api/skill-catalog/search?q=&source=&sort=&cursor=(SkillCatalogSearchResponse) adds registry (ClawHub) results to a text search; with noqonly a registry named bysourceis asked, for one page (sortpopularby default,updatedorrecommended;cursorfromnext_cursor, absent on the last).registry_errorreports an unreachable registry.GET /api/skill-catalog/item/{source_id}/{name}(SkillCatalogItemDetailResponse): the skill's own text, what it can use, versions and links; 404 for an unknown item.
Install, update, uninstall (the lifecycle lane, §11):
POST /api/skill-catalog/install(SkillCatalogInstallRequest:id, optionalreplace,turn_on_when_readydefault true) answers at once with the startedjob_idand the install'sbasis(SkillCatalogInstallResponse). Refusals answer{ok: false, code, error}: 404not_found; 409withdrawn,name_taken(withoccupant;replace: truereplaces it and keeps the replaced copy),update_instead,local_sourceorno_release. The copy must match the release digest, or nothing lands. Areviewinstall starts its review after landing and turns on only when the review leaves no blockers; atrustedone turns on once it is ready.POST /api/skills/{skill}/update(SkillUpdateRequest:modereplace,keepormerge;digest, the candidate shown;local_digest, the local revision shown; optional booleanskip_review).replaceanswers the startedjob_idand keeps the previous copy;keeprecords the skipped release;mergeasks Ouroboros, through the owner's door like Repair, to merge the release into the local changes (three-way only when the original release can be fetched again:base_available).skip_review: trueis the owner's Update without review, valid only for replace: exact-releaseowner_skipacceptance with preflight. A review-basis update stays off during review; if the new bytes cannot run when review ends, the old payload, state and record return withupdate_rejected. Startup restores interrupted updates; an owner Skip during review keeps the new bytes. A later update clears rejection. A different candidate answers 409candidate_changedwith the newcandidate, a changed local copylocal_changed; a withdrawn release or a skill that left its source cannot be updated.POST /api/skills/{skill}/uninstall(SkillUninstallResponse) works for every source; grants and the publication receipt survive. A repeat answers 404.GET /api/extensionsrows carryinstall(source, Official, release,basis,modified,update_availableas{version, digest}ornull,withdrawn,left_source,turn_on_when_ready,installed_by, and the recordedreasonandtask_idwhen there are any) andcategory, from the cached catalogs without network. Optionalinstall.checkis{by, notes, at}for a recordedself_check;pending_updateis{version, digest};update_rejectedis{version, digest, reason, at}, with reasonreview_blockers,review_unfinished,preflight_failedorlanding_failed(the update's files or dependencies could not be installed; the previous version was restored). An update is a different release digest, never a different version string.install.officialrequires unchanged release bytes and a matching current endorsement; with no snapshot only the stored flag for unchanged bytes counts. This also restores the mark for unchanged legacy installs. A hub entry may listwithdrawn_releasesby digest; holders receiveinstall.withdrawn: {reason, version}, while entry-level withdrawal is unchanged.
ClawHub (a third-party registry, also joined into catalog search) keeps its routes:
GET /api/marketplace/clawhub/search: withq, a text search; without it, a registry browse paged bycursorandnext_cursor.official=1keeps official skills only.GET .../info/{slug}and.../preview/{slug}read registry metadata only; nothing is downloaded.POST .../install(MarketplaceInstallRequest:slug, optionalversion,auto_reviewdefault true,overwritedefault false). An existing skill is replaced only withoverwrite.ok: truemeans the skill is installed, even when review found blockers (review_status: "blockers"); such a skill does not run until the owner acts. A dependency failure givesok: falseand rolls the install back.POST .../update/{name}(optionalversion) always reviews and overwrites.POST .../uninstall/{name}; a repeat answers 400.GET .../installed. Registry errors answer{error, code}with 400, 404, 429 or 502.
The retired hub catalog/preview/install/update/uninstall/publication-clear routes and fields use these successors (retirement record); the ABI version is unchanged. GET /api/marketplace/ouroboroshub/installed remains frozen, returning {count, skills} (MarketplaceInstalledResponse) for hub-source installs and the legacy hub bucket. CLI marketplace ouroboroshub aliases sources; install <name> resolves a public hub offer, while <source>/<name> selects a catalog id.
Publication receipt: POST /api/skills/{skill}/publication/clear forgets the local receipt of a publication (expected_published is the receipt as shown; a repeat answers publication_cleared: false). The pull request stays on GitHub.
Starter skills: GET /api/onboarding/starter-skills (StarterSkillsResponse) groups built-in, Official and every configured starter id by category, ticked as the starter list says; catalog_more counts the skills of the sources already read that the step does not offer (null while none is read). An item (StarterSkillItem) may carry the catalog's own words for people: title, a one-line pitch, and needs, the prerequisite in words ("": none; absent or null: the catalog says nothing, and needs_keys names what the skill reads, required or not), with mark, the same in a few words for a row; without them show name and description. A hub entry or a skills/builtin.json row carries them, never a payload manifest; catalog items (SkillCatalogItem) carry the same four. An item may carry connection (StarterConnection): its built-in skill's declared connection card (the manifest's connection_card), where token names the skill's secret field for its token, pairing.link holds {username} and {code}, and title, pitch, steps, pairing.hint, pairing.note and options are the skill's own words; needs_allow (true where this install grants reviewed skills nothing on its own) says the skill starts only once the owner allows it in Extensions, which the card says in place of its outcome. Its token check is POST /api/onboarding/connection/identity (ConnectionIdentityRequest {skill, token} → ConnectionIdentityResponse {ok: true, username} or {ok: false, cause: "refused" | "unreachable"}, where refused is the service's own answer; 400 for a draft that is no token (1 to 512 characters, no space or line break inside), 404 for a skill that declares no card, 500 when the check could not run, 503 when this host's deadline passed before the check finished, so it is not known whether the service was asked and the answer is the generic "could not be checked", never unreachable (which only the skill's own function reports); it writes nothing). The completion carries the card's values as connections ({<skill>: CompletionConnection}: {fields: {<token field>: token}, code: <the minted one-time code, 22-64 of A-Z a-z 0-9 _ ->, options: {<key>: <its on or off value>}}, the code and the options only once the page drew the QR and link that hold that code, else {fields} alone), apart from its settings: the token joins the one write under the key the skill declares, the code and the options never enter Settings, a malformed entry refuses the whole completion (400), and a request from the Telegram Mini App that carries one is refused (403 connection_owner_only), since a code names the account's owner. After the write the host keeps the code and options in the starter record until the skill serves, then posts them once to the skill's declared route (a card that sent its token alone posts nothing). Where reviewed skills are granted automatically, that policy covers the consent: a skill installed but not granted and on (one already on disk, such as a payload a Reset kept) gets the lifecycle's grant of what it asks with enable after grant; where they are not, the card grants nothing and the skill serves once the owner allows it in Extensions. The outcomes stand in the starter record, and none fails the completion. OUROBOROS_STARTER_SKILLS absent or "" uses defaults; [] or "[]" selects none. OUROBOROS_STARTER_SKILLS_TURN_ON (default true) controls first enablement. POST /api/onboarding/complete accepts starter_skills (catalog ids; [] installs nothing) and skill_source_trust ({hub row id: "trusted" | "review"}, which also confirms those rows) in its one write; the ticked skills install once in the background afterwards, only where the setup offers its skills step (§4); a ticked skill already installed (a Reset keeps the payloads) that nobody switched on or off is turned on as a new install is, under the same automatic-grant setting.
Connected coding subscriptions use Claudexor. Its API v2 objects (job, maintenance operation, reset receipt, quota snapshots) pass through; the engine owns vendor maintenance. Pin: ouroboros/claudexor_runtime_pin.json; source: https://github.com/razzant/claudexor. Read published shape keys; treat the rest as data.
Status:
GET /api/claudexor/status(ClaudexorStatusResponse) is passive: it never starts the engine.reads.catalog,reads.accountsandreads.quotaare eachok(authoritative, even when empty),not_read(never asked, or discarded as older than a confirmed account write or a newer held read) orfailed. A facet that was not read freshly serves its last value withfacets.<name>.stale: true.facets.<name>.observed_atdates that value: the catalog's is the engine's composition time (generatedAt; the engine may answer from a composition some minutes old; the read time when the engine sends none or an unreadable one), the others' the read time.harnessesandprofiles.login_capable_harnesseshold the harnesses whose catalog row offers a sign-in on this host (setupLogin), as of the catalog's observation time; when the catalog is not current evidence the manifests decide, andlogin_capable_harnesses: nullis the unread fail-open (harnessesthen unfiltered). Never read an empty list withoutokas "no accounts".?view=quotaanswers the passive quota view (ClaudexorQuotaResponse), described inPASSIVE_QUOTA_READ.md. Checkview: "quota": an older core ignores the parameter.POST /api/claudexor/wakestarts the engine when needed and answers a fresh status.
Restarting the engine: the engine is shared by every program that uses this installation, so restarting Ouroboros keeps it. Quitting the launcher (a desktop Quit or a headless launcher's stop signal) stops it, ending every program's runs; a bare python server.py or ouroboros server keeps it on its stop signal. Restart it only on the owner's confirmation of what ends.
GET /api/claudexor/restart(ClaudexorRestartPreview) is passive.runscounts the live runs a restart ends:ouroboros(delegated by this installation) andother(other programs), with up to 50items.runs.statusisknown,unattributed(a total without owners) orunknown(the engine did not answer or cannot list runs;errorsays why). A null count is a gap: never show it as zero.enginenames the serving engine and the pinned one; show everywarnings[].message(engine_pin_below_serving: the pinned engine is older and may not start again).model_callsare calls in flight; they end too.- Show those facts and ask.
POST /api/claudexor/restartwith{token}from that preview restarts the engine and answers{status, restart}(ClaudexorRestartResponse):restart.stopisstopped,nothing_to_stoporunconfirmed(the old process may still run),restart.servingsays whether an engine answers afterwards andrestart.errorwhy not. Not idempotent; after a lost answer readGET /api/claudexor/status, do not resend. 409withcode: "restart_preview_stale"(ClaudexorRestartProblem) stopped nothing: what would end changed. Show itspreviewand ask again.409 restart_in_progressand503(the engine's typedcode) also stopped nothing.
Signing in an account:
POST /api/claudexor/login(ClaudexorLoginRequest:harness, optionalprofile_id,transport,login_flow) starts a sign-in job and answers{job, job_id, ...}. It can start the engine. It is not idempotent: every call may start a new job. After a lost answer there is no job id to poll; start the sign-in again only when the person asks. A400withcode: "credential_profile_required"asks for a named account (profile_id).- Poll
GET /api/claudexor/login/{job_id}every few seconds: it answers a snapshot{job, cursor, sequence, deviceCode?}.deviceCode(verificationUrl,userCode) is what the person enters at the vendor. In the engine release the core pins,job.stateisqueued,runningorwaiting_for_inputuntil it issucceeded,failed,cancelled,timed_out,interrupted_unknownornot_supported. POST .../login/{job_id}/inputsends one answer the job asked for ({value});DELETE .../login/{job_id}cancels. A finished job whose reason istermination_unconfirmedis not known to have stopped the vendor's process.POST .../login/{job_id}/reconcilechecks again; a409with codesetup_termination_unconfirmedasks you to retry it. The builtin client treats such a job as released only oncejob.terminationReconciliation.statusisempty.- Job errors answer
ClaudexorLoginJobProblemwith the engine'scodeandrequired_actions; 404 or 410 means the job is gone.
Accounts:
PATCH /api/claudexor/credential-profiles/{harness}/{profile_id}with{enabled}turns an account on or off.DELETEon the same path forgets the binding; its receipt says what became of the vendor's sign-in (vendorCredentialDisposition). A 503 on either is an engine refusal or a lost answer; only a 4xx proves no change, so read status again.
Quota and resets:
POST /api/claudexor/quota/refreshrefreshes every account, or one with{target: {harness, profile_id}}. It is passive and safe to repeat;refresh_attemptdates the host attempt,reused: truewhen it joined an identical one in flight.POST /api/claudexor/account-resets(ClaudexorAccountResetRequest) redeems one reset offer. It needs anIdempotency-Keyheader. Keep the key and the body until the reset settles: the same key and body replay the same receipt. Check that the receipt'srequestnames your target and offer. PollGET /api/claudexor/account-resets/{id}whilestateisrunning.- After a lost answer the outcome is unknown: send the same key and body again, or read the receipt by id.
Agent tool maintenance:
- Inventory, operation reads and mutations require handshake engine version 6.0.0 or newer. Older engines receive no requests of this contract; inspection says unavailable and Connect asks for an app/engine update. Inventory failure on a supported engine does not prevent Update.
GET /api/claudexor/maintenance/harnessespassively returnsselection,newest,actions, engineupdateAvailable(yes,no,cannot_tell) and full receipts. Every inventory read re-observes selection;fresh=trueis accepted.checkLatest=trueasks vendor HTTPS; a failed newest read retains an earlier success with its original time. No host version ordering or legacy-contract fallback.POST /api/claudexor/maintenance/operations({harness, target},Idempotency-Key) can start the engine.targetis{kind:"latest"}or{kind:"version",version:"<exact>"}; latest invokes the selected updater or vendor installer when absent. Unavailable actions refuse with the inventory's sentence.202is a durable handle, not completion.409 maintenance_already_active: followcontext.operationId. ReadGET .../operations/{id}while queued/running or termination is unconfirmed.POST .../operations/{id}/cancelrequests cancellation, not proof of termination. Receipts retain actual commands, script URL/size/hash, before/after selection, progress, outcome, mutation, termination and limitations. A replacement can succeed with nonzero installer exit status: show its limitation, not a fabricated failure.ClaudexorMaintenanceProblem.errorretains{code, message, context}. Afteracceptance=unknown, resend the same key/body; a laternot_submittedcovers only that attempt.- Connect repeats unanswered or explicitly retryable receipt reads within one deadline; a definite refusal returns its problem and handle. Expiry cancels nothing: the answer distinguishes a last-confirmed running install from lost contact, retains the last failure, and points to Settings, Accounts. Login errors retain read refusals and failed-install problems, including actions and retryability; only maintenance actions appear as sentences on the card; another Connect joins the active operation returned by the engine, then retries login once after selected-version evidence.
Accounts opening, chooser opening, Check latest and explicit tool inspection request newest; status polls do not. A replacement behind an unchanged wrapper is discovered on opening Accounts/a chooser; a native run also discovers it when the program reports its version at startup. A settlement seen pending or after an earlier inventory view refreshes model catalogs, once per inventory answer; retained receipts first met settled are history. Nothing updates itself. Return uses only a changed receipt's before.version, when actions.exactVersion.available; no stored version history.
A package-manager copy may only advise: display the vendor sentence, never run its suggested command automatically. Cursor cannot launch on Windows (#667); OpenCode uses 1.x with no unattended Windows installer (#668). copilot update can hit GitHub's unauthenticated rate limit; show its refusal without retry or workaround.
The review pool. GET /api/review-pool lists the agent rows that may review work and what one review costs on each. A broken configuration answers a non-empty config_error with an empty pool. A readable catalog with no row marked Reviewer also answers an empty pool: the Main model then reviews alone.
The model catalog. GET /api/model-catalog (ModelCatalogResponse) returns the full catalog by default. The setup contract's scopedModelCatalogs: true advertises these independent reads for forms selecting one source:
view=sourcesreturns the engine's declared subscription transports inmodel_sources, with emptyitems.source_idlists a subscription's models.harness_idreads one agent program's inventory insession_catalog, the same{id, models, model_catalog?, models_error?}row fields as Accounts. Both accept an optionalcredential_profile_id. An engine unable to list models for that pin reports the gap.provider_idasks one configured API connection (such asopenrouter@work) orlocal. The wizard's POST accepts this selector for its draft.
An older core may ignore these selectors. Clients check the advertised capability before issuing a scoped read. A full read collects the declared subscription sources and API connections concurrently within one 20-second budget, returning the local model, completed rows, known subscription descriptors and named errors together (200). If subscription discovery itself times out, its error names Claudexor. A missing inventory is unknown. A model setting stores the item's value.
An OpenRouter row may carry price (USD per 1M tokens, as its catalog states it: input, output, tiers by input length, and cache_write for the prompt-cache tier this install sends, each absent rather than guessed; cache_write_ttl names that tier, and a client says the figure only while the settings document still names it) and context_window (the window its catalog publishes, for display); a DeepSeek row, price_condition: "off_peak_usd" where its published entry prices text alone off-peak on a USD key (a condition, no figure). api_sources names configured API connections by id (kind or kind@name) and display label, even with no model rows. Optional processing_transport is what that exact host adapter and API surface can carry, including for a model typed on that connection; absence is unknown. It does not prove model availability, authentication, or tier entitlement, and a failed list stays in errors. A draft connection refused before its read is not listed. The same field on API model rows stays for older clients; without a source descriptor, use a row only for its own route. model_sources and account_catalogs pass through, an agent row keeps its engine's raw processing with its provenance on either engine path (a list may be bundled and its tier array is optional: even ["standard"] proves neither that other tiers are unsupported nor what an account may use), and store_id names the store the engine's handshake named. A catalog's sourceProgram: {path, version} | null names its actual producer; account catalog and source envelopes carry provenance once, rather than copying it into each model. Null means no proven program producer, never a guessed inventory version. The opened chooser shows that provenance and any engine-offered Update as DESIGN §7 says. Opening compares selected path/version strings with the producer and refreshes mismatched catalogs once; unchanged selections add no catalog read. Choosers subscribe to status only while an operation is pending.
One route's tiers. processing_model=<route> alone answers ModelProcessingResponse for that route without a catalog scan; only a public slug on a configured OpenRouter connection reads its endpoint list. modes are what endpoints' own service_tier reads as (null = Standard, flex, priority, ultrafast; absent, another word or a non-string is no tier; a tag like /fast is a name); complete: every word was read and no provider routing (OUROBOROS_OR_PROVIDER or the connection's) narrows the list. Malformed rows leave uniquely bound peers (complete: false); a repeated tag is not a unique endpoint. A partial list cannot bound a pool's price. [] and false, never Standard-only: a value that reads nothing (empty, non-public, another connection or base), no usable row, or unsupported routing. A supported only filter attests only exact surviving tags; aliases and unresolved tags prove nothing. Each endpoint keeps tag, its stated service_tier, mode and an honest price (none under a fee or time). Tiers are a catalog fact, no key's entitlement.
The local model:
POST /api/local-model/start(LocalModelStartRequest) answers{status: "starting"}after the model is downloaded; the request stays open meanwhile. It is not idempotent. Then pollGET /api/local-model/statusuntilstatusisreadyorerror(offline,downloadingandloadingcome before).412witherror: "runtime_missing"means the local runtime is not installed:POST /api/local-model/install-runtime, then poll status untilruntime_statusisinstall_okorinstall_error.POST /api/local-model/testruns two real completions; a failed probe is still 200.POST /api/local-model/stopstops it (and an install in progress) and is safe to repeat.
MCP servers:
GET /api/mcp/statuslists the configured servers and their last listed tools; it makes no network call. Server rows addskill(owning skill, else"") andskill_error(why its binding is unavailable, else""); configuration-error rows omit both. OneMCP_ID_AMBIGUOUSrow can represent several configured entries: optionalconfigured_countgives their number. None is loaded.POST /api/mcp/refreshlists one server's tools ({server_id}) or every server's ({}); it is safe to repeat.POST /api/mcp/sign-inruns one step of a remote server's sign-in:{action: "begin", server_id}returns the provider'surland theredirect_uriit returns to (an owner's own app addsclient_id,client_secret);{action: "complete", state, code|error, iss}(orreturned_url, the address the browser stopped on) finishes it and lists the server;{action: "sign_out", server_id}forgets the tokens, withrevokedsaying what the provider confirmed. A refusal is 200 withok: false,code: "MCP_AUTH_REQUIRED"and itsreason.POST /api/mcp/testconnects once to a draft server ({server}, withserver_idto fill masked secrets from that saved server) and saves nothing. A failed test is 200 withok: false.POST /api/mcp/import/previewrequires{text, servers}and turns pasted configuration into draft rows without saving.serversis the editor's current draft matching metadata; send[]for an empty editor. An invalid request shape answers400; syntactically invalid pasted configuration answers200withok:false,errorand no entries. HTTP success alone is not a usable preview.
Checking for updates (UpdateStatusResponse):
GET /api/update/statusmakes no network call:running_sha: the captured startup commit (empty when unknown), independent ofafter_update;current_sha: the checkout's;availableandsafe_to_apply;update_tx: the active transaction ({active: false}when none); optionalattempt_idmatches a retained attempt'stx_attempt_id, never itsoperation_id;update_progress: the last admitted update attempt ({}only when absent; unreadable state isoutcome:unknown).operation_idandgenerationidentify it;current_generation,stage,active,result,outcomeandconcluded_byseparate progress from conclusion.base_sha,target_sha,keep_branchandstash_noteretain exact source/local-work facts when known.outcomeis applied/not_applied/rolled_back/failed/unknown, empty while unresolved. It is observation, never recovery authority; a pre-admission refusal remains its HTTP answer;letter: saved prose,key,revision, host-derivedauthor,checked_key, retained non-emptymaterialand latestrequest(timerequested_at, effective status,cancel_state: pendingwhile a Stop is carried out, whether it saved). Before prose,state: none. Unread letters keep prose, provenance and confirmed task ID. A letter-only failure (letter_unavailable: true) leaves transaction facts usable. A failed status read disables Replace and shows the last known attempt without Restore. Previously reported recovery guidance keeps a plain Check until status is readable. A readable null clears the letter. Optionalqualificationcovers first-parent receipts and GitHub runs (covered_shas: covered merges,absent_shas: proven run absences).landed_over_reviewnames this install's commits in range recorded over a review FAIL or no verdict (sha,subject,reason,outcome); absent means unread,[]means none. Missing, unread, unavailable and non-green differ. Only the range determinesdescription_current;after_update: the retained attempt'soperation_id,outcome, base/target and nullablebefore/aftergeneration samples. Each names source SHA, generation, time and server-process scope, RSS bytes withrss_measurecurrent/footprint/peak/unobserved (footprint: macOS's physical footprint now; peak: the lifetime high-water mark where no current figure exists), cumulative CPU seconds and nullable interval percent, duty-overrun counts, and nullable latest direct-message first-dispatch timing with task/attempt identity. These are observations, not an update verdict or chat message;check_ok: null on status.
POST /api/update/checkuses one channel choice for branch and target policy, fetches, records facts only and broadcastsupdate_progress_changed.POST /api/update/description(UpdateDescriptionRequest) admits at most one ordinary Main task to describe a range:write/rewritenamebase_sha,target_shafrom checked facts, retained material or shown text; returntask_id, or 409 with the live task'stask_id/ an unoffered range'slegal_ranges.latest(Check and describe) takes no range. Closing the page leaves it running.UpdateDescriptionLatestResponsecarries the check's pre-admissionupdateand offeredchecked_key. Outcomes:queued(task_id,key),writing(existingtask_idand possibly olderkey),current(saved exact range),no_update,check_failed; 409reason: range_unavailablefor unknown source. A pending press holds every description control. Update and recovery keep priority. An identified writer leaves Check alone until readable status settles it, even with only its receipt. A newer range needs another press.- 503
reason:record_busy,request_not_recorded, ortask_status_unknown(existingtask_id,task_status: unknown) admit nothing. A typed refusal or usable 200 establishes the outcome. After a 500, gateway failure or unusable body (including{}), read status without replaying. Followletter.request.current_task_idacross retries and admitted Continue viaowner_continue_admittedandtask_done.
POST /api/update/preflightreturnsmerge_planwith base and target SHAs and target-boundeffects: merge and replacement engine transitions (action,direction, serving/target pins), observedactive_work(unknown/null when unreadable), and installed interpreter/SQLite versus the target README’s bundle claim (unknown when absent). Engine data is forward-only; in-app Update changes neither interpreter nor SQLite. Preflight attaches only to a provisioned engine, without starting or stopping it. The pure pin rule also governs restart; a lower pin keeps a newer serving engine, but cannot make its data cold-startable by the older engine. Optionalletterandqualificationread saved facts for those pins. Missing facts are unknown. Only exact-range prose enters confirmation. The panel keeps its latest readable text across Cancel.
Applying an update. Send POST /api/update/apply (UpdateApplyRequest) with strategy, expected_base_sha and expected_target_sha from the preflight:
- Managed deployment: 403
code: managed_by_deploymentbefore anything starts; the status then carriesmanaged_by_deployment(why). Restore (/api/git/rollback), recovery points (/api/git/promote) and/api/local-model/install-runtimerefuse the same way; only the administrator replaces the serving program. - Index locked: smart, replace and Restore return 409
reason:index_lock_present,outcome:not_applied, with the observedindex_lock(path,exists,inode,size) before stopping work. The effective index honors linked worktrees andGIT_INDEX_FILE; its lock is untouched. - Release moved: 409
release_movedmeans the release changed since the preflight. Run the preflight again. - Replacement not applied: 409
reason: replace_not_applied,abandoned: truemeans Git refused the first tree-changing command because its index lock was held. The transaction is disarmed without rollback;rescueandkeep_branchdisclose retained preparation artifacts. The lock is untouched. Diagnose it before another deliberate attempt; age alone never authorizes removal. Later smart-update refusals retain fenced recovery and Git’s stderr in the durable rollback row;before_tree_effectsplus verified unchanged checkout meansoutcome:not_applied, not restored. Partial or unknown effects keep fenced recovery. - What
200means: inspectstatus, not HTTP success alone.okwithrestarting:truemeans a restart was requested, not adoption.assisted_startedmeans a supervised task owns resolution.manualreturns a plan without applying or restarting.restart_requiredmeans the restart that finishes the apply could not be requested (a store-less replace has not moved the checkout yet); show its error and offer the ordinary restart control. - Watching it:
update_progress_changedframes mean "read the status again"; stages are live; the saved last admitted attempt and conclusion survive restart.retention_unconfirmed:truereports a failed or refused save without changing the update result; a never-saved attempt cannot be recovered after process loss. An update check does not erase saved results. The indicator may hide a dismissed terminal attempt locally; the panel retains it until the next attempt.- After reconnecting, confirm the executing generation (
running_sha) against the landed transaction/merge_commitidentity reported by the update, not blindly against the preflight's officialtarget_sha. Preserving local commits can create a distinct two-parent merge. Until the landed identity and completed startup are known, adoption remains unconfirmed. - A core whose startup check fails can roll back and restart again. An assisted-resolution rollback completed in the same generation may have no retained conclusion and display an unconfirmed outcome.
- A boot rollback that reports itself unfinished, or raises, records
outcome:failed,reason:rollback_incompletefor its bound attempt, preserving cause and recovery detail without claiming restored files; if that save fails, the running server still serves it withretention_unconfirmed:true. Successful rollback still needs the restored generation's conclusion. While its transaction remains active, show the current recovery instruction once; historical diagnostic text is not action authority. A boot that fails outside its rollback concludes nothing: an attempt whose transaction stays in an assisted phase may still read as resolving. update_status_readyarrives after a fresh start.
- Retrying: there is no idempotency key. A non-manual request can answer 409 while an update is active or its expected base/target no longer matches;
manualmay return another plan. When an outcome is unknown, read status and transaction facts before deciding—never infer failure or resend from a dropped connection.
Restore. POST /api/git/rollback {target} and vcs_rollback share a local-only door: observe the index lock first, interrupt running work, preserve HEAD and dirty work, switch to the exact commit and restart. Nothing is pushed; ordinary interrupt semantics remain (no restart handoffs). The applied-update card offers Restore to its recorded base_sha. This operation is not safe to repeat. Ask the person first; afterwards confirm running_sha. 409 reason: restore_not_applied means Git refused the reset at its held index lock, so the reset changed no checkout file, index entry or ref; the lock, and the keep branch and rescue snapshot made before the reset, are retained. No restart is requested; writers are readmitted through the aborted-update path, which keeps admission closed while an update transaction is active or the stopped work's handoff is unconfirmed.
Promote. POST /api/git/promote moves the local stable branch to the current commit (nothing is pushed).
Reset. POST /api/reset deletes the data folders and the settings, then restarts. It is irreversible: ask the person first, and never resend after a dropped connection.
Commands, restart and Panic. POST /api/command (CommandRequest) or a WebSocket command frame sends a slash command (/restart, /panic, /review, /evolve, /bg, /status); any other text becomes an owner message in Main. An HTTP reply to selected text uses the same citation as chat (§5), e.g. {"cmd":"Explain this.","reply_to":"row:1@2026-10-01T00:00:00Z#0123456789ab","reply_excerpt":{"text":"harbor","start_utf16":8}}.
ui_control(optional,{name, owner_text?}): the producer that composedcmdfrom a control names it. The press is the owner's act and the command is host text, so no owner message is written; the command's own System reply is its one receipt.owner_textis what the owner typed into that control (an Evolution objective) and becomes their message exactly as typed; it rides only beside a slash command, other text with it is refused. Typed chat and CLI commands omit it and stay the owner's words. A malformed value is refused (400, or a warninglogframe on the WebSocket); Panic is handled before it is read.if_boot(HTTP only, optional): theboot.sincefromGET /api/healththat the command is meant for. A value that is not a non-empty string is refused with400; a server that has restarted since refuses with409andreason_code: "boot_changed". Panic ignores it.- Refusals (
400/409,CommandRefusal):accepted: falsemeans the command was refused before anything was queued: an invalidreply_toorif_boot, a changed boot, or no command queue yet (409, as before setup). Withoutaccepted: false, an error raised after queueing or a missing reply leaves the outcome unknown. - What
200means:{status: "ok"}means queued, except Panic acknowledges its immediate emergency latch, not completed shutdown. The samevisible_task_idwithin 5 seconds answers{ok, deduped, task_id}. Either/restartor/paniccan end the connection before or after the answer, so a dropped connection is not a failure. - Panic: stops owned work and exits 99; the launcher never restarts it. Never queue, reconnect-flush or offer resend, including chat frames. Desktop uses
pywebview.api.panic_stop()first, also while the socket reconnects (no veil covers Panic). Panic bypasses confirmations, composer saves/uploads and Telegram command-mode translation. Intercepted typed Panic creates no chat bubble. Only bridge{status: "stopping"}orpanic_acceptedclears unchanged sent command text; unknown/refused delivery keeps it. Newer edits, replies and attachments stay. An attempt ends the composer's pending sends for good, also across a reconnect; a Send made after it is a new message. If the room is closed and reopened before acceptance, the replacement field can retain accepted text even after its saved draft is cleared; this remount edge remains unresolved. Browser uses its captured open socket with no buffered output;panic_acceptedmeans emergency latch, not exit. Missing acceptance says “Panic was not confirmed”: desktop points to its tray/menu bar, browser to the host computer. No clock agreement or preflight request is required; transmitted bytes can arrive later on that connection.client_surfaceis diagnostic, never owner identity. Unavailable HTTP Panic returns503:ErrorResponse; WS sends a declaredlogwarning. Unbound external owners never enter ordinary admission. Telegram sends once without an age expiry; its whole-second message date is compared with the host clock at plugin import. Earlier dates are refused, with previous outcome unknown. This assumes aligned clocks: a host ahead rejects fresh Panic until Telegram reaches the import second; a host behind can accept retained commands. Old/fresh messages in the boundary second are indistinguishable and accepted. - Restart: a restarted core comes back on its own; reconnect and resynchronize (§5).
Spend. GET /api/cost-breakdown reports spend from the physical-attempt ledger. A 503 means the ledger cannot be read: spend is unknown, not zero. ?period=24h|7d|30d adds period: the calls started in that period per model (cost, null when none has a recorded price; calls, tokens and by_class: the recorded cost shared among cache_write, cache_read, output and uncached_input by the model's price list, null when nothing could be split (no price list, token counts or named cache lifetime); tokens_shared are the tokens by_class is of; unshared_cost is what could not be shared; the full shape is CostBreakdownResponse.period in ouroboros/gateway/management_contracts.py) and cache_writes (by what each write followed). Without the parameter the response is unchanged; period.available: false (error_code unknown_period, with the accepted periods, or ledger_unavailable) never takes the totals with it.
Versions and diagnostics:
GET /api/git/loglists recent commits and tags (GitLogResponse), the choices for a rollback.GET /api/logs/{name}tails one log (chat,progress,events,toolsorsupervisor;limit1 to 2000, default 100;task_idfilters). An unknown name answers 404 with the allowed names.chatandprogressare read from the dialogue store:_lineis the row's durable position among every stored object of its stream, and while the archive import has not settled those counts the endpoint answers 503reason_code: migrating(retry shortly), never a guessed number; the file logs'_lineis a position within the read window.- The default and
view=fullretain{name, entries}with complete public fields and the best-effort JSONL parser. Full, compact and Raw share admission-first task scope: canonical records and effective retry/child lineage select recorded placements; child replicas and client hints cannot redirect reads.view=compact(CompactLogTailResponse) explicitly addsview,gapsandskipped_rows. Dialogue rows remain complete and reportgaps: [], skipped_rows: 0for that SQL read, not historical import completeness. File logs skip unaddressable rows while preserving valid rows and exact Raw references. Sorted distinctgapsnamemalformed_jsonl(including non-object/duplicate-member rows),incomplete_live_lineortorn_archive_line.skipped_rowscounts nonblank skipped physical records once within consulted windows, before task filtering and limit slicing; it excludes partial left-edge records and unopened history. An unfinished live row may still be writing. Unreadable sources return 503log_source_unavailable, never an unknown count as zero; unprojectable scope/content returns 400invalid_log_source, unknown views 400invalid_view. - Compact file rows carry
_raw: LogRawReference. Above 16 KiB of serialized public JSON, fields over 4 KiB or exceeding the row's 16 KiB budget are omitted whole._raw.omitted_field_countcounts them;omitted_fieldsnames the first 64 (names capped at 128 characters). Disclose the omissions and offer Raw; never present the preview as the full diagnostic._raw.source(LogRowSource) binds{v:1, kind:"log_row", placement, task_id, log, start, length, sha256}to stored JSONL bytes including the newline. A context view checkpoint whose ownreceipt_sourceandat_sourcevalidly name structures in its task's retainedcandidate_materializationreceipt previews asrepresentation: reconstructed, lists those absent fields inomitted_fieldsand haspublic_bytes: null, because the preview never reads the receipt.placementiscanonicalor an admitted child drive relative to it;task_idis the query scope. Neither_linenor_source_rootidentifies a source.refis that source encoded as base64url, not access authority. Raw rechecks canonical lineage, custody and confined opens. GET /api/logs/{name}/raw?ref=…(LogRawResponse, file logs only) verifies one complete newline-terminated record within one physical segment and its digest, then reapplies the same public projection as full logs. A segment's first row is valid even after a torn older segment; a fabricated cross-segment row is not.representation: storedserves original bytes; when that projection changes the row,public_task_resultserves its full JSON plus newline.reconstructedre-reads that verified final event and adds only the fields its ownat_sourcedeclares and it lacks, from the retained receipt after its stage, task, size and digest checks; no field of the final event is replaced, and the same public projection then covers the whole row. A reference carries no declarations of its own. A receipt that is missing (unavailable_reason: receipt_unavailable) or does not match (receipt_mismatch) adds nothing: the stored event is served whole,unavailable_fieldsnames every declared field it lacks andX-Ouroboros-Raw-Unavailablerepeats the reason; both fields are empty otherwise. Show that gap; never present such a page as the complete reconstruction.source.sha256identifies the stored original; responsesha256identifies the served bytes._raw.public_bytesandrepresentationdescribe that public representation at preview time.offset(default 0) andlimit(default 65,536; 4–1,048,576) count UTF-8 bytes:text,next_offset,total_bytesandhas_moredescribe the bounded page. Continue fromnext_offset; cuts withhold an incomplete character. A mid-character or past-end offset answers 416raw_range_invalid; exact EOF is an empty final page.download=1, without offset/limit, downloads the whole verified representation as an attachment; do not insert that body into the DOM. Successful responses areno-store/nosniffand carryX-Ouroboros-Source-Sha256,X-Ouroboros-Payload-Sha256andX-Ouroboros-Raw-Representation. Ref/bounds errors answer 400invalid_raw_request; missing, shortened, unsafe or no-longer-admitted sources 404log_source_unavailable; changed bytes 409log_source_changed; unavailable scope metadata 503log_source_unavailable. Keep the preview and show the refusal; do not substitute a newer row.- These are read-time addresses over existing log chains, not retention promises. Ordinary append/rotation preserves them while chain bytes remain; removed earlier segments can make an address unavailable even if its row remains elsewhere. Reads create no archive or durable cache. Preview metadata costs the chain's segment count; parsed content follows the existing bounded tail/backfill policy. Each Raw page verifies and projects its whole source row in memory, so server cost remains proportional to that row; download avoids loading it into the browser's rendered view. A reconstruction resolves only the receipt the producer retained in the canonical store before emitting the event (
loop_round_limits); no othertask_sourceaddress in a row is resolved. GET /api/storage(StorageResponse) reads the last finished count of everything Ouroboros owns, a running count's progress, fresh free space, the Temporary space tray and each place'sremovers(the maintenance jobs' last outcomes, withrecord_compression's totals for that place's own plane; the engine's last retention pass, answered within 2 s in all (a record arriving later, within 5 s, is shown by the next poll) and reused for 5 s;unavailableorunsupportedwhen it cannot be read, never a zero), without measuring;?count=<finished_at>omits a count the client already holds.POST /api/storage/measurestarts one complete count in a child process or joins the running one;POST /api/storage/measure/cancelkills it and keeps the saved count (202 either way, the same envelope withstarted). A count carriesdeleted_projects(StorageDeletedProjects), absent on an older count: not counted, never none. A folder inside a place is a slice of its walk; one outside every place is walked after the places and never joinsbytes. Saves follow the places and then each outside folder, each movingfinished_at: a cancel keeps the finished places and folders and leaves the restnot_measured, and before the places finish it keeps the previous count. The folders are found first, with the remaining Projects' folders once any is listed (to relate them), each resolved andstated once before any place, so a mount that does not answer delays the start; cancel still works there, the kill sent at once and the previous count kept (a call blocked on that mount ends when the system returns it). It grants no deletion and promises no space.- Temporary space.
POST /api/storage/free/previewlists, without writes, what the app's own retirers would remove now (finished tasks' work folders, working copies whose work is proven saved, declared temporary environments of finished work) and the leftovers no background pass removes (reviewers' saved files of finished tasks, review copies no task owns, copies no record names, undeclared environments and test-run records, the Git pins of results never applied or rejected; the client starts those holding saved work unchecked) under a plan id; a second preview joins the running one.free.poolsummarizes the ordinary pool and exclusions; its separatemanualcount/bytes names finished copies offered only for explicit discard, session scratch its run marked to keep, and authoredpayloadproposals of a finished task's heavy files.GET /api/storage/free/items?plan=&view=pool|excluded|outcomes|manual&cursor=&limit=&version=(StorageFreeItemsResponse,limit1 to 500) pages every object of that view, eachStorageFreeEntryone filesystem object; send the first page'sversionwith the next pages.409carriesreason_codepreview_outdated,listingorview_changed(restart from cursor 0: outcomes reorder as the trash settles),400isbad_view.eligible_afteris the earliest the background may consider an object, not a promised deletion;bytesis what was observed, not a promise of space freed;kind: environmentis a whole temporary environment, not installed packages. Each entry'savailabilitydistinguishesordinary,saved_group,manual_discardandnone; outcomes retain it. Optionalcausepreserves the retirer code beside compatiblereason; kept summaries can carry countedcauses. Manual rows carrynot_proven_saved_count,not_proven_saved_bytes, the largest 50not_proven_savedpaths,omitted_countandkeeps_commits. These describe absent proof of saving, not proven uniqueness. A payload proposal (payload_release: true,kind: payload) carries its fullconsequence, allfiles(path,bytes,role,loss) andretainedrefs: show all of them.POST /api/storage/freetakes exactly one selection:{plan, items}from the pool,{plan, groups}as before, or{plan, manual: [exact ids], accept_loss: true}. Manual copies start unchecked; explain that the entire selected copy goes and unsaved contents can be lost. Saved results, history and held commits remain; a payload proposal releases only the named files — its report, method and result refs and history stay. Live work, holds and owner keeps still prevent deletion. Payload proposals are owner-only:free_storageand background or group runs cannot choose them;propose_payload_releasecan explicitly replace an open offer (a fresh owner choice) or withdraw it, and old records stay. No background or group operation uses this permission. Ask the person first; never resend after a dropped connection (the plan id makes a repeat harmless: a replaced or missing plan answersstarted: falsewithreason).reasonis one ofbusy,preview_outdated,nothing_selected,unknown_item,not_offered,selection_conflict,unknown_group,loss_not_accepted; any refused id refuses the whole request before any effect. Every object is judged again under its retirer's lock when its turn comes, so a changed one stays.POST /api/storage/free/cancelstops the listing (nothing is kept) or the run (what was freed stays freed, the rest isnot_started). All POSTs answer 202 withStorageResponse;free.runseparates removed, still deleting, stuck, kept, failed and not started objects (an object whose removal failed for no named reason counted underkeptasotherbefore and now counts asfailed). Recovery reconciles pending payloads without repeating moves. The plan and its outcomes live in memory: a restart answerspreview_outdated, and thestorage_freeevent keeps the ids. - Keeping one task's materials.
POST /api/tasks/{task_id}/owner-keepwith{keep, note?}(OwnerKeepRequest) saves or clears the owner's keep on exactly this task, not its children or its line. The server stamps the source as this authenticated request and route; any other field is refused (400unexpected_fields). The answer (OwnerKeepResponse) listsretained(paths,pins:<snapshot>for result pins,saved_states:<folder>while that folder holds a saved state for exact return, andreview_thread:<id>for a reviewer thread no recorded release let go),retired(material gone/accepted for deletion, or a closed future document-ID reuse right) andunknown(classes that could not be read, includingcanonical_payloads, about which nothing is claimed). For a canonical path,releasesdistinguishesheld,queued,moved(seen in staging before accounting),staged,deleting(awaiting trash removal),deleted,missingandunknown; onlydeletedreports completed deletion. Formanaged_import:<key>,future_reuse_releasedinretiredcloses only future ID reuse: accepted commands, turns and history can still hold the bytes.upload_cancelledends an unfinished upload; neither state proves physical deletion. Import outcomesbinding_unavailable:<reason>andrelease_refused:<code>remain inreleaseswithmanaged_importsinunknown, never silently counted as kept or gone. An outstanding import reportsheldorrelease_unconfirmed.releasesalso maps eachreview_thread:<id>(an engine reviewer thread a plan seat of this task named or started, or whose release it recorded) to its release as last observed, never polled:release_unconfirmed(bound, neither kept nor gone),accepted_pending_removalorremoved(only when the engine's own cleanup result said so),purged,not_found(the store asked does not hold it: no purge, in neither list,unknownnamesreview_threads), or, retained,held/refused/abandoned(no accepted release in this record) andunrecorded(no release recorded; nothing is claimed about the engine). A verified export stays readable in the task's sources after release. A keep saved while a release is unconfirmed answersrelease_unconfirmed: the keep is saved for everything else and as the intention to stop that release, which, for reviewer threads, the next pass tries to abandon unless the engine already accepted it; an import request already in flight can still close future reuse.statussays what it could truthfully do:kept,released,partly_retired,already_retired(nothing saved; only when nothing is unknown or unconfirmed),release_unconfirmed(saved; seereleases),inflight(custody_busy: a retirer holds the task now, nothing was saved, ask again);404task_not_found,503task_unreadable. Every retirer of the task's work folders, copies, snapshots, review seats, checkouts and captured checking copies, pins, environments, task trees and call journals reads it at its effect — canonical payloads included — automatic release after an ordinary apply or reject included. Running work, review captures and lossless compression continue. Main writes the same fact with the root-only toolset_task_retention, on an owner message it holds. GET /api/evolution-data(EvolutionDataResponse) answers at once with the saved version history (saved_at,versions, this installation'sinstalljournals) andrefresh(idle,runningorfailed;unmeasuredversions with the first reason): new tags orforce=1start one background re-measurement, which also retries unmeasured versions, and a failure keeps the saved copy. The earlierpoints(one per tag name; null where unmeasured, memory fields null) andcachedstay for older clients. Ask again while it runs; a value nobody measured isnull, never zero.
-
Error bodies are
ErrorResponse:{error}and, when present,codeorreason_code. A route may add facts beside them (for exampleschema_errors,task_idor a skill's current facts). An unexpected failure can also answer500as plain text. Statuses beyond the ones a route lists are those500s, the auth gate's401, and the router's own404and405for an unknown path or method. Agent-engine routes may also pass the engine's own status through (§13). -
Object errors. Maintenance (
ClaudexorMaintenanceProblem) returns an engine or host problem inerror. Accept both strings and objects; showerror.messagefor objects. -
When an outcome is unknown, never resend a change automatically. The unknown-outcome answers:
POST /api/tasks→status: "unconfirmed"(resending the sametask_idis safe; a new id is not);- settings writers →
saved: null; - routing decisions →
dispatch_unconfirmed; POST /api/tasks/{id}/continue→continuation_unconfirmed;- maintenance →
503withcontext.acceptance: "unknown", and account resets after a lost answer (resend the same key and body); - a dropped connection during
/restart,/panic, rollback, reset, a lifecycle-lane job or a local-model start.
Read the state that answers the question, then let the person decide.
-
The idempotency keys:
Operation Key chat messages client_message_idtasks task_idStop stop_action_idPause and Hurry request_idContinue action_noncedecisions request_idaccount resets and agent tool maintenance the Idempotency-KeyheaderKeep each key with its original request. Repeating the same operation is safe only under that operation's documented replay rule; do not infer a universal changed-payload refusal. In particular, quiz decisions replay the recorded answer for the same
request_id, even if later input differs (§7). A different request id does not change an already answered quiz.expected_content_hashandexpected_state_fingerprintare revision guards, not idempotency keys. -
Not idempotent: sign-in jobs, local-model start, task resume, rollback, reset and update apply.
Published: every HTTP route the core indexes (all typed: true) and every built-in WebSocket message type, each with its shapes; the history row and the live/history merge rule; the module widget host protocol. Structural checks cover the indexed routes and builtin client's calls; consumer tests exercise selected actual responses. A declared shape is not proof that every status branch has been exercised.
Known gaps:
- Engine objects. The agent engine's objects (§13, §14) are published only to the keys the core itself reads. Their full schemas are the engine's.
- Open documents.
POST /api/settingsandPOST /api/ui/preferencestake documents of setting keys (published as plainjson);GET /api/settingsand the setup vocabulary name those keys.logframe rows,chat_annotation,review_group,quiz.optionsand the review projections are open objects. - Declarative widgets are drawn by the host from the component vocabulary in
docs/CREATING_SKILLS.md; there is no separate host protocol for them. - Unsupported topologies: a different origin, a sub-path mount, several cores behind one interface, and more than one person.