ADR 0015: App-Client Protocol
Status: accepted, 2026-11-26 (the owner approved the scope, P0 and P1a, and the corrections of the client protocol the same day).
Status: accepted, 2026-11-26 (the owner approved the scope, P0 and P1a, and the corrections of the client protocol the same day).
Context
Orquelo's apps (the Flutter desktop, mobile and web clients of orquelo-app) and a remote orquelo tui need one protocol to the Host. plugins/httpapi v1 serves one connection's runs to a trusted proxy that names the user in the body. It has no live stream, no pairing for devices, no uploads or artifact downloads, and no view across channels. A person's task started in Feishu cannot be followed or approved in an app. The Host only offers a transport the runs of its own connection (TransportHost.Run).
Decision
plugin.ClientHost, an optionalTransportHostinterface. Every call names the sender the transport verified, and the Host resolves it on the calling connection. A call answers only with the facts of that person: rows whoseuser_idis the principal's user. A person's linked accounts (ADR 0012,LinkStart/LinkFinish) therefore share their runs, questions, facts and artifacts across connections. Another person's ids answer as unknown (run.unknown,artifact.not_found,delivery.unknown), never as forbidden. The calls areWhoami,Conversations,PersonRun,CancelPersonRun,Questions,Updates,OpenPersonArtifact,Catalog,RunDiff,DeliveriesandRetryDelivery. Answering uses the existingAnswer, whosemayAnsweralready accepts the person's linked accounts.AnswerResultgains a stablereason, so a client can tell a lost race (already_<state>,stale) from a refusal.- The observed-fact log is the stream's replay source.
Updatesreadsobserved_eventsof the person after a seq, and the SSE id is that seq.Last-Event-IDreplays exactly what the log still keeps. A cursor older than the oldest kept fact getsstream.resync_required. No new event bus or buffer is added. Progress, which has no fact, reaches open streams only, without an id. - Steering stays a Trigger decision (ADR 0006). A message posted to a conversation with an active run is steered by the Trigger as on every channel, and no steer endpoint is added.
- Authentication stays in the transport. The static
tokenkeeps its v1 meaning: a trusted proxy names the user in the body,X-Orquelo-Useror?user=. Paired devices are added beside it: a single-use 5-minute code, a token stored only as SHA-256, rate-limited wrong codes, and revocation that also closes the device's streams. A device acts only as its user, and a request naming another is refused. A device's conversations are kept under<user>:. plugin.WorkspaceDiffer, an optional workspace-provider interface: the changes of a task checkout, committed or not.localenvimplements it withgit diffagainst the task's base.plugin.RecordProvider(amendment of 2026-11-26, the owner's choice of a public contract over calling tools). This is an optional plugin interface for records a plugin keeps about people or the deployment:RecordKinds,RecordsandChangeRecord. The Host routesClientHost.RecordsandClientHost.ChangeRecordto the providers of a kind in the uses of the connection's runtime, with the caller's trusted context, and has no branch for a kind.memoryservesmemory,skill-workshopservesskill_draft, and the egress providermihomoservesegress_route; each applies the rules of its own tools.- Facts for the stream (same amendment).
tool.startedis recorded with a call's intent on every ledger path, andquestion.updatedwhen a sign-in view changes. An admin'sUpdatesalso carry the question facts of approvals addressed to admins. - Push through a relay (same amendment). httpapi keeps APNs/FCM registrations and posts a redacted notice (
question_id,kind,title_key,platform,token) to the operator's relay. The Host has no Apple or Google client.
Consequences
- ◆Two optional interfaces, three read queries (runs, interactions, observed facts) and a reason field. Transports that do not use them are unaffected. Process-form transports do not get
ClientHostin this version. - ◆One behavior of v1 changes: a refused answer is now
409(question.already_resolved,question.stale),403or400with the error envelope, where v1 answered200withaccepted: false. Errors use one envelope (code,message_key,params,message,retryable,data). - ◆Facts carry a person only when their run has one. Token deltas and
tool.progressare not part of this version: no runtime or tool reports them, and progress text reaches clients asmessage.progress. - ◆Management writes over HTTP (plugin enable, secrets) need both an admin caller and the operator's
managegrant on the httpapi instance. - ◆This is the fifteenth ADR, beyond the v1 guideline of about ten. The owner approved the protocol that calls for it, and a budget of 82k lines for it, on 2026-11-26.