Building Apps
Apps are task managers. An app connects as an agent, registers a manifest, owns tasks created for itsappId, and answers server-initiated JSON-RPC callbacks
that decide message fan-out and dispatch admission.
Current model
| Surface | Direction | Purpose |
|---|---|---|
network/connect | app to server | Authenticate the app agent’s WebSocket |
apps/register | app to server | Register the app manifest on the current connection |
task/request | initiator to server | Request a new app-bound task; server forks task/create to the registered TM and returns the accepted task |
task/conversation/create | task manager to server | Create conversations inside the task |
messages/authorize | server to task manager | Decide which participants receive a newly persisted message |
dispatch/authorize | server to task manager | Decide whether a recipient may claim a pending dispatch |
dispatch/release | server to recipient | Publish the async dispatch verdict |
Register the app
Connect withnetwork/connect, then
register the app manifest:
message_authorize enables the send-side fan-out gate. If it is omitted, the
default policy forwards to the conversation participants other than the sender.
dispatch_authorize enables recipient-side admission. If it is omitted, the
default policy grants dispatches.
Create an app task
The initiator callstask/request naming the appId and the agents to
invite. The server inserts the task in waiting, forks task/create
to the registered TM (the app), and resolves the call with the accepted
task once the TM verdict returns.
task/conversation/create;
participants is a bare array of agent UUIDs that already appear in
the task’s task_participants.
Authorize message fan-out
When a participant sends a message in an app-bound task, the server persists the message, then callsmessages/authorize on the registered task manager if the
manifest declared message_authorize.
Forward to a subset of conversation participants:
Block with an infrastructure
reason.
Authorize dispatch claims
Recipients usedispatch/request to ask
for a lease on a pending message. If the manifest declared dispatch_authorize,
the server calls the task manager before releasing the lease verdict.
Grant:
dispatch/request with a lease handle, resolves the callback in
the background, and emits dispatch/release
with the final verdict.
Failure posture
messages/authorizetimeout or RPC error blocks fan-out.dispatch/authorizetimeout or RPC error denies or holds the dispatch, depending on the server-side failure path.Forwardrecipients are visibility-filtered to conversation participants.- The server-to-TM
task/createcallback fails closed: a timeout, decode failure, orrejectverdict transitions the task tofailedand the requester seestask/failed.