# Architecture Source: https://robotelos.dev/docs/concepts/architecture/ Robotelos is built on one rule: each piece of state has exactly one owner. Most design questions reduce to "who owns this?" This page is the whole platform. For the roles inside one conversation (client, server, agent, store, principal), see the [protocol roles](/docs/specification/architecture/). ## Ownership | Owner | Owns | Does not own | |---|---|---| | **Robotelos** (Runtime) | Goals, tasks, logical agent executions, attempts and fencing, authorization, interaction state, effects, durable progress, customer-visible results | Where code runs | | **Execution host** (Agent Substrate) | Actor hosting, placement and host lifecycle | Robotelos's identities or results. A Substrate actor is not a Robotelos execution or effect | | **Harness** | One agent run: the per-run evaluator and execution mechanics | Durable progress across runs | | **Agent** | Proposals: text, tool requests, approval requests | Authorization and the record of what happened | An agent's output is a proposal. Robotelos decides whether it is authorized, records what happened, and commits the result that customers see. {{< diagram name="ownership" caption="Each box owns its own state. Robotelos records; the host runs; the harness executes one step." >}} ## The pieces {{< diagram name="exploded-platform" caption="Exploded stack: Kubernetes hosts, control plane definitions, data plane runtime (focal), agent surfaces." >}} {{< diagram name="platform-overview" caption="Clients, Control API, gateway, engine, PostgreSQL and execution hosts inside one platform boundary." >}} {{< diagram name="architecture" caption="The gateway is the only entry point. It stores events in one transaction, and agents see only the turns they are given." >}} - The **protocol** is the contract between clients and the server. It is transport independent: the same end-to-end suite runs over every binding. - The **store** holds the conversation journal, receipts and pending agent work. Every conversation is changed in one transaction. - The **gateway** is the protocol server on PostgreSQL. Several replicas share the database and wake each other. - The **agent port** is the seam where a real agent plugs in. The built-in agent is a deterministic mock, useful for trying things out. ## Next steps - [Conversations](/docs/concepts/conversations/) - [Protocol roles and ownership](/docs/specification/architecture/) # Chat from a terminal Source: https://robotelos.dev/docs/build/examples/cli/ All commands run from the repository root. Build the tools once with `go build`, or run them with `go run`. ## Chat with a server in a terminal Start the local stack with its mock agent. It needs Docker for PostgreSQL: ```bash go run ./runtime/cmd/robotelos dev up ``` In a second terminal, open a conversation over SSE, the default transport (the client reads the token that `dev up` saved): ```bash go run ./protocol/cmd/robotelos-chat -transport sse ``` Type a message and the mock agent replies. Type a message that starts with `run ` to see an approval: ```text run ls -la ``` The agent asks for approval before it "runs" the command. Answer it from a client; the next example shows how. Try the other transports and tokens: ```bash go run ./protocol/cmd/robotelos-chat -transport ws # WebSocket go run ./protocol/cmd/robotelos-chat -transport grpc # gRPC go run ./protocol/cmd/robotelos-chat -token demo-bob # the second demo principal ``` ## Next steps - To migrate a PostgreSQL database, see [Database migrations](/docs/deploy/database-migrations/). - To run a complete local instance with Docker (`robotelos dev doctor`, `up`, `status` and `down`), follow the [Quickstart](/docs/getting-started/quickstart/). - To run the gateway yourself, with tokens and more than one replica, see [Run the gateway](/docs/deploy/run-the-gateway/). - For every command and flag, see the [command-line reference](/docs/reference/cli/). # How fleet sync works Source: https://robotelos.dev/docs/concepts/fleets/how-it-works/ ## The pieces | Piece | Where | Role | |---|---|---| | Control plane database | PostgreSQL | Authoritative desired state: agents, versions, deployments, pools, fleets and their revisions. | | Coordinator (`fleets` role) | Control plane | Serves snapshots to fleets over gRPC and the fallback transports, and receives what the fleet observed. | | Fleet agent | In each cluster | **Pulls** a snapshot, writes compiled releases, projects pool intent and reports status. | | Runtime pool operator | In each cluster | Turns an `AgentRuntimePool` into a Deployment, Service and autoscaler. See `operator/README.md`. | | Data database | One per fleet | Receives compiled releases; the data plane reads only from here. | {{< diagram name="deployment-flow" caption="Two clusters, each with its own fleet agent and data database. The agents pull; the control plane never connects in." >}} ## Pull, not push The control plane never connects into a cluster or into a fleet's data database. The agent connects out to the coordinator, so it works from behind a firewall and the control plane holds no credentials for any data plane. The trade-off is that the agent holds a database login for its own fleet's data database. That login is deliberately narrow: it can add new releases and move the "active release" pointer forward, and nothing else. It cannot change or delete a release, move the pointer back, or read anything an agent or user wrote. ## Releases and the data database - `compiled_releases` is append-only. The database re-hashes each artifact and rejects a digest that does not match. - `serving_releases` is a pointer that moves forward only. - The data database has its own schema and migrations, separate from the control plane's. The fleet agent writes releases into it. The runtime that serves conversations only reads from it, and a user-facing service can read only its own account's releases. ## Environments Environments are a fixed catalog: `dev`, `stg` and `prod`, each mapped to a fleet class. A non-production fleet serves dev and stg; a production fleet serves prod. Promoting a version means deploying it to the next environment; each fleet converges on its own. ## Identity Fleets authenticate with an enrollment credential and, optionally, mutual TLS. The client certificate carries the fleet in a URI SAN, `spiffe://robotelos.io/fleet/`, and the coordinator checks that it matches the fleet the credential belongs to. The agent reloads its certificate at every handshake. ## Next steps - [Transports](/docs/concepts/fleets/transports/) - [Deployments](/docs/concepts/fleets/deployments/) # Instances, sign-in and accounts Source: https://robotelos.dev/docs/reference/cli/instances-and-sign-in/ Use these commands before any other: they decide which instance a command talks to and who you are on it. ## Instances: `context` A **context** is a saved connection to one Robotelos instance, like a kubectl context. | Command | What it does | |---|---| | `robotelos context list` | Lists the contexts. `*` marks the current one. | | `robotelos context current` | Prints the context that commands would use. | | `robotelos context use NAME` | Makes a context current. | | `robotelos context set NAME --server ADDR (--token-file PATH \| --token-env VAR) [--project SLUG] [--use]` | Adds or replaces a context. | | `robotelos context delete NAME` | Removes a context from this machine. | The context is chosen in this order: `--context NAME`, then the `ROBOTELOS_CONTEXT` variable, then the current context. An unknown name is an error. The CLI never falls back to another instance, so a command cannot reach the wrong one. The contexts are stored in `~/.robotelos/config`, or in the file named by `ROBOTELOS_CONFIG`. Tokens are never written to that file. Point `--token-file` at a file that holds the token, or `--token-env` at a variable that holds it. ## Signing in: `login`, `logout`, `whoami` A context for the Control API names the API's gRPC address and the OIDC issuer. `robotelos login` uses the OAuth 2.0 device grant: it prints an address and a code, you approve in a browser. ```bash robotelos context set prod --api api.robotelos.example.com:443 --issuer https://auth.example.com/realms/robotelos --login --use robotelos login robotelos whoami robotelos logout ``` Only the refresh token is kept, in the operating system's keychain. For CI, use `--token-file` or `--token-env` with a token obtained elsewhere; `login` refuses such a context. Cleartext gRPC is allowed for a loopback address only. ## Accounts: `account`, `invitation` | Command | What it does | |---|---| | `robotelos account list` | Accounts you belong to | | `robotelos account create NAME` | Creates an account | | `robotelos account use ID` | Selects the active account on the instance | | `robotelos account members ID` | Members and pending invitations | | `robotelos account invite ID --email E --role ROLE` | Invites someone; prints the invitation token once | | `robotelos account revoke-invite ID INVITATION` | Withdraws an invitation | | `robotelos account conversation-token ID` | Prints a short-lived conversation credential only, for scripts | | `robotelos invitation show TOKEN` / `accept TOKEN` | Looks up or accepts an invitation | ## Next steps - [Resources: apply and get](/docs/reference/cli/resources/) - [Ship an agent](/docs/operate/ship-an-agent/) # Requirements and support Source: https://robotelos.dev/docs/getting-started/requirements/ Check this page before the [Quickstart](/docs/getting-started/quickstart/). It lists what each way of using Robotelos needs, and says plainly what the project tests and what it does not. ## What you need | To do this | You need | |---|---| | Run the local instance with `robotelos dev` | Go 1.27 and a running Docker engine. `robotelos dev doctor` checks the machine | | Build from source | The Go toolchain pinned in `go.mod`, currently `go1.27.4`. Go 1.21 or newer downloads the pinned toolchain itself while `GOTOOLCHAIN` is at its default | | Run the gateway yourself | PostgreSQL, two database roles (an application role and a worker role) and a token file. See [Run the gateway](/docs/deploy/run-the-gateway/) | | Install on Kubernetes | Docker, `kind`, `kubectl` and `helm` for the guided two-cluster trial; a Kubernetes cluster, an OIDC provider and PostgreSQL for your own installation. See [Fleets](/docs/concepts/fleets/) | | Work on the console or the documentation | Node.js, and Hugo with Dart Sass for this site. See [Contribute](/docs/project/contributing/) | ## Ports The local instance and a gateway use these ports by default: | Port | Used for | |---|---| | `8787` | HTTP: Server-Sent Events, WebSocket, `/healthz` and `/readyz` | | `8788` | gRPC (set `ROBOTELOS_GATEWAY_GRPC_ADDR=off` to disable it) | ## What is tested | Area | Tested with | Notes | |---|---|---| | Build, unit and integration tests | Linux (Ubuntu) in CI, Go 1.27.4 | The only operating system in the CI matrix | | macOS and Windows | Used by maintainers, not in CI | The Quickstart gives the Windows commands. Treat a failure there as a bug and report it | | PostgreSQL | 17.6 in the integration tests; 16 in the `robotelos dev` container | The gateway needs row level security and checks it at startup | | Kubernetes | `kind` clusters in the install and outage tests | No support matrix of Kubernetes versions exists yet | | Agent Substrate hosting | Not verified on a live cluster | Treat it as experimental | If your platform is not in this table, it may work, but nobody has checked it. ## Next steps - [Quickstart](/docs/getting-started/quickstart/) - [Production notes](/docs/getting-started/production-notes/) before you expose an instance to other people - [Troubleshooting](/docs/troubleshooting/common-problems/) if `robotelos dev doctor` reports a problem # Run the gateway Source: https://robotelos.dev/docs/deploy/run-the-gateway/ The gateway is the conversation protocol on PostgreSQL. Several replicas share one database, wake each other through `LISTEN/NOTIFY` (with a polling fallback), and claim agent turns under a lease. This guide runs one gateway against a local database. The [deployment example](https://github.com/robotelos/robotelos/tree/main/deploy/gateway) shows the Kubernetes manifests. ## Before you start - PostgreSQL 17 (the version the integration tests use). - Go 1.27.4. - The repository checked out. ## 1. Create the database and migrate it Migrations run as a database owner, not as the gateway's roles. Read the owner URL from the environment so it does not appear in the command line: ```bash export ROBOTELOS_DATABASE_URL='postgres://owner@localhost:5432/robotelos?sslmode=disable' go run ./runtime/cmd/robotelos db migrate up ``` The migrations create two roles: `robotelos_app`, which is bound by row level security, and `robotelos_worker`, which claims queued turns across accounts. Roles are cluster-wide, so the migration creates them only if they are missing and never with a password. Give each role a login, or let a login role `SET ROLE` to it. See [Database migrations](/docs/deploy/database-migrations/). ## 2. Create a token file Authentication is a static bearer-token file. It is meant for development and small installations, and the gateway refuses to start without it: ```json {"tokens": {"a-long-random-secret": {"id": "par_alice", "account": "acct_1", "display": "Alice"}}} ``` Tokens must be at least 8 characters. Use long random values, and keep the file out of the repository. ## 3. Set the configuration ```bash export ROBOTELOS_GATEWAY_DATABASE_URL='postgres://robotelos_app:CHANGE_ME@localhost:5432/robotelos?sslmode=disable' export ROBOTELOS_GATEWAY_WORKER_DATABASE_URL='postgres://robotelos_worker:CHANGE_ME@localhost:5432/robotelos?sslmode=disable' export ROBOTELOS_GATEWAY_TOKENS_FILE="$HOME/.config/robotelos/tokens.json" ``` The full list of variables and their defaults is in the [gateway configuration reference](/docs/reference/gateway-configuration/). ## 4. Start it ```bash ROBOTELOS_DATAPLANE_ROLES=gateway go run ./runtime/cmd/dataplane ``` The gateway is a role of the data plane server: one binary, `dataplane`, runs the roles in `ROBOTELOS_DATAPLANE_ROLES` (`gateway`, `engine`). It serves the conversation protocol with the `gateway` role. The gateway checks at startup that the application role cannot bypass row level security and that the schema is at least the version it needs. If it cannot start, it logs every configuration problem at once and exits with code 2. Check that it is up: ```bash curl -s http://127.0.0.1:8787/healthz curl -s http://127.0.0.1:8787/readyz ``` `/healthz` answers while the process is alive. `/readyz` answers when the gateway can serve requests. {{< diagram name="gateway-topology" caption="Replicas share one database. A committed event wakes the other replicas without polling." >}} ## 5. Run more replicas Start more processes with the same configuration. They share the database and wake each other through `LISTEN/NOTIFY`. Each replica uses `ROBOTELOS_GATEWAY_WORKERS` concurrent agent turns, so the total throughput is the sum over replicas. A turn that is not finished within `ROBOTELOS_GATEWAY_TURN_LEASE` (default 30 seconds) is claimed again by another worker. After `ROBOTELOS_GATEWAY_MAX_TURN_ATTEMPTS` attempts it ends as failed. ## Container and Kubernetes ```bash docker build -f deploy/gateway/Dockerfile -t robotelos-gateway:dev . kubectl apply -f deploy/gateway/k8s/gateway.yaml ``` The Kubernetes example is a starting point. Replace the placeholder secrets before you use it anywhere else. ## Next steps - [Gateway configuration](/docs/reference/gateway-configuration/) - [Production notes](/docs/getting-started/production-notes/) # Ship an agent from draft to production Source: https://robotelos.dev/docs/operate/ship-an-agent/ This guide takes one agent from idea to production. The ideas behind each step are in [Agents, versions and environments](/docs/concepts/agents-and-environments/). For one scenario with real output, including a rejection and an update, see the [worked example](/docs/operate/walkthrough/). ## Before you start - You have the `robotelos` command (see [Command-line tools](/docs/reference/cli/)). - You are signed in: `robotelos login`, then `robotelos whoami` shows who you are and your active account. - Someone has set up a fleet for each environment you will use. If not, see [Operate fleets](/docs/operate/operate-fleets/). Every command accepts `-o json` for scripts. Add `--account ID` to work in an account other than your active one. ## The words, and the buttons | You say | In Robotelos | The command | |---|---|---| | "Create the agent", "edit it" | the agent and its **draft** | `robotelos apply -f agent.yaml` | | "Publish", "release version 1" (the **Publish** button in the console) | a numbered, frozen **version** | `robotelos apply -f` an `AgentVersion` file | | "Deploy to dev", "roll out" | an **AgentRollout** says which version an environment runs | `robotelos apply -f` an `AgentRollout` file | | "Request production", "promote" | the same rollout for `prod`, which waits as a **promotion** | `robotelos apply -f` the production rollout, then `approve` or `reject` | "Deployment" is the everyday word for what the console and this guide call a **rollout**: what an environment runs. ## How it works: files, not commands Everything you want Robotelos to do is written in a small file and applied with one command: ```bash robotelos apply -f FILE # create or update what the file describes robotelos get KIND [NAME] # read it back, with its status ``` A file can hold several resources, separated by `---`. Applying the same file twice changes nothing, so you can keep these files in Git and apply them from CI. ## 1. Describe the agent Write the agent in a file, for example `support.yaml`: ```yaml apiVersion: robotelos.io/v1 kind: Agent metadata: name: support spec: model: prompt: maxSteps: 20 ``` The model, prompt, tools and skills are referred to by their own version ids, so an agent always points at exact, unchanging parts. ```bash robotelos apply -f support.yaml robotelos get agents robotelos get draft support ``` `apply` creates the agent the first time and updates its draft after that. It never publishes a version by itself. ## 2. Publish a version Freezing the draft is also a resource: ```yaml apiVersion: robotelos.io/v1 kind: AgentRelease metadata: agent: support ``` ```bash robotelos apply -f version.yaml robotelos get releases support ``` This freezes the draft as the next version. Applying it again while the draft is unchanged returns the same version. To read one version, with the exact content that will run: ```bash robotelos get release support/1 ``` It prints the version's status and digest, followed by the compiled release. The digest is what fleets verify, so it is the proof that production runs what you tested. ## Test a draft before you publish it You do not have to publish to try something. A **preview** is a test build of your draft: a numbered, frozen version that runs in `dev` and nowhere else. ```yaml apiVersion: robotelos.io/v1 kind: AgentRelease metadata: agent: support spec: preview: true ``` ```bash robotelos apply -f preview.yaml # agentrelease/support version 1 (preview) created: sha256:... robotelos apply -f rollout-dev.yaml # a rollout of that version to dev; talk to it there ``` - A preview never becomes the agent's current version, and staging, production and promotions refuse it with a message that says it is a preview. - Asking for a preview of a draft that has not changed returns the same one; if the draft equals a published version, that version is returned, because it can be tested already. - When you are happy, publish the same draft as above. If you did not change it, the published version is **byte for byte the release you tested** (the same digest). It still has to run in `dev` and be evaluated itself before production accepts it. ## 3. Try it in dev An **AgentRollout** says which version an environment should run: ```yaml apiVersion: robotelos.io/v1 kind: AgentRollout metadata: agent: support environment: dev spec: version: 1 ``` ```bash robotelos apply -f rollout-dev.yaml robotelos get rollout support/dev ``` The status shows where the rollout is: accepted, in progress, delivered to the fleet, applied, and finally **Ready**. If it stays at *delivered*, the fleet has not applied it yet; see [When something is stuck](#when-something-is-stuck). To protect against two people editing at once, add the generation you based the change on under `metadata`: ```yaml metadata: agent: support environment: dev generation: 3 # refused if the rollout has moved on since you read it ``` ## 4. Record what you checked After you have tested version 1 in dev, record the result so that promotion can rely on it: ```yaml apiVersion: robotelos.io/v1 kind: Evaluation spec: agent: support version: 1 environment: dev name: regression passed: true ``` ## 5. Put it into production Production is changed the same way as `dev`: you apply an `AgentRollout`. The difference is that production is **gated**. The apply does not change anything yet; it asks for approval. {{< diagram name="promotion-gate" caption="Production changes only after evidence and an approval from someone other than the requester." >}} ```yaml apiVersion: robotelos.io/v1 kind: AgentRollout metadata: agent: support environment: prod spec: version: 1 ``` ```bash robotelos apply -f rollout-prod.yaml # agentrollout/support/prod generation 0 unchanged; promotion/3f2a... awaiting_approval (robotelos approve promotion 3f2a...) ``` Robotelos checks that version 1 is what the previous environment serves (`stg` if it is on, otherwise `dev`) and that it has a passing evaluation there. If so, it records a **promotion** and waits. If not, the apply is refused and says what is missing. A reviewer decides: ```bash robotelos get promotion robotelos approve promotion --comment "checked the dev results" robotelos reject promotion --comment "needs the escalation case" ``` Deciding is a command, not a file, because it is somebody else's decision. When production reports the version ready, `robotelos get rollout support/prod` shows the new generation and the promotion shows *succeeded*. - **Applying the same file again** returns the same waiting promotion. - **Applying another version** replaces the waiting one, which is cancelled as superseded: the latest intent wins. - **Withdrawing** your own request: `robotelos cancel promotion `. - **Without a gate** (an account that has none configured for production), the apply takes effect at once, like `dev`. To rehearse first, turn staging on with an `Environment` resource (`metadata.name: stg`, `spec.enabled: true`). Once it is on, production's evidence has to come from `stg`. ## 6. Roll back, or stop serving Both are edits of the same rollout file: ```yaml spec: version: 1 # back to an earlier version: a new generation, with the old release ``` ```yaml spec: {} # no version: the environment stops serving the agent (needs a maintainer) ``` ```bash robotelos get revisions support/prod # every generation, newest first robotelos get rollouts support # the agent in every environment ``` ## When something is stuck | You see | It means | What to do | |---|---|---| | Rollout stays *Progressing* | The control plane has accepted it; the fleet has not picked it up | Ask a platform administrator to check the fleet (`robotelos fleet list` shows whether it is in sync) | | *Degraded* | The fleet applied it but its pools are not healthy | Check the deployment status for the pool; roll back if users are affected | | "Aborted" on apply | Someone changed that rollout while you were working | `robotelos get rollout support/dev`, then apply again with the new generation | | Draft save refused | Someone edited the draft since you read it | Show the draft again, reapply your change | ## Next steps - [Release a version gradually](/docs/operate/release-gradually/) - [Worked example with real output](/docs/operate/walkthrough/) - [Permissions](/docs/reference/permissions/) # Troubleshooting Source: https://robotelos.dev/docs/troubleshooting/common-problems/ Find your symptom below. Each entry says what usually causes it and what to do. ## The chat client cannot connect **Likely cause:** the server is not running, or the client points at a different address or transport than the server uses. **What to do:** start the server first and keep its terminal open. Use the same transport on both sides, and check the address. The defaults are `127.0.0.1:8787` for HTTP and WebSocket, and `127.0.0.1:8788` for gRPC. ## Port already in use **Likely cause:** another program uses port 8787 or 8788. **What to do:** start the server on other ports with `-addr` and `-grpc-addr`, and point your client at the new addresses. For example `-addr 127.0.0.1:9787`. ## Token rejected **Likely cause:** the token is wrong, or it is not in the server's token list. **What to do:** - With `robotelos dev up`, the token is in `~/.robotelos/dev/token`, and `robotelos-chat` reads it by itself. The embedded server of `apps/console` accepts the demo tokens `demo-alice` and `demo-bob`. - With the gateway, the token must be listed in the token file, and it must be at least 8 characters long. Keep the token file out of version control. ## The gateway does not start **Likely cause:** one or more settings are missing or wrong. **What to do:** read the message in the terminal. The gateway lists every problem at once, and it exits with code 2. Check that each `ROBOTELOS_GATEWAY_*` variable is set, and that the database address and the two database roles are correct. The full list is in the [gateway configuration reference](/docs/reference/gateway-configuration/). ## A migration shows as "changed" **Likely cause:** someone edited a migration file that was already applied to the database. **What to do:** restore the original file. To change the schema, add a new migration file instead. See [Database migrations](/docs/deploy/database-migrations/). ## `robotelos dev` fails to start **Likely cause:** Docker is not running. **What to do:** start Docker, then run `robotelos dev up` again. Stop the old instance with `robotelos dev down` if it is still listed as running. ## An agent does not answer **Likely cause:** in a group, agents answer only when they are mentioned. Or the agent ID does not match a registered agent. **What to do:** mention the agent in your message. Check that the ID you used when creating the conversation is one the server knows, for example `mock`. See [Groups and participants](/docs/concepts/groups/). ## Someone cannot join my group **Likely cause:** the invitation was sent, but the person has not accepted it, or they do not have the conversation's ID. **What to do:** share the conversation's ID with them, and ask them to accept the invitation. Until they join, they can only answer the invitation. ## The client shows an old or incomplete conversation **Likely cause:** the client was offline for a long time, and its saved position is no longer available on the server. **What to do:** subscribe again without a saved position. The server then sends a complete snapshot. Good client libraries do this automatically. See [Delivery](/docs/specification/delivery/). ## Still stuck? Open an issue in the [Robotelos repository](https://github.com/robotelos/robotelos/issues) with what you ran, what you expected, and the message you saw. ## Next steps - [FAQ](/docs/troubleshooting/faq/) - [Get help](/docs/troubleshooting/support/) # Vision Source: https://robotelos.dev/docs/project/vision/ ## The problem Agents increasingly act for people: they book, buy, change and answer on their behalf. Three things break down when that happens in ordinary chat tools: - **Work is lost with the chat.** A booking started on the phone disappears when the conversation moves to the laptop, or when the connection drops. - **Approval is vague.** "Okay, go ahead" is not a reliable yes for a payment or a booking that has changed since it was shown. - **Outcomes are guessed.** When an external system does not answer, a retry can book twice, and nobody knows what really happened. Robotelos is meant to fix those three problems, so that a person can trust an agent with real actions. The story is told in [Why Robotelos](/docs/overview/why-robotelos/). ## What Robotelos should guarantee 1. **The goal belongs to the person, not the channel.** Start in voice, continue on the phone, finish in a web app. The goal, its tasks and its approvals stay the same. 2. **An approval covers exactly what was shown.** If the details change, the old approval no longer applies. 3. **Work survives interruptions.** A crash, a restart or a closed app does not cancel a booking that is already in progress. It resumes, and it never repeats an external action without checking first. 4. **Uncertainty is visible.** If the outcome of an action is unknown, the person sees "uncertain, checking" with the next step. It is never hidden in a log. 5. **Cancelling means a defined scope.** "Cancel everything for this evening" stops what has not started, checks what is in progress, and reverses what can be reversed, in the right order. The person sees what was cancelled, what is still active, and what carries a fee. 6. **Authority is explicit.** An assistant that recommends a restaurant does not get permission to spend the person's money. Who may act, and for whom, is always recorded. ## How the pieces fit | Layer | What it does | |---|---| | Conversations and the gateway | Carry messages, commands and updates to every device, in order | | Approvals | Ask for and record an exact yes or no | | Goals and tasks | Turn a goal into tasks, plan them and track progress | | Durable execution | Keep each action running through failures, and check uncertain results | | Customer-facing agents | Use tools and other agents within limits the person has set | | Production hosting | Run agents in different places, such as a company's own cloud | ## Phases The work is organized into phases. Each phase must prove its guarantees before the next one builds on it. | Phase | Goal | What it proves | |---|---|---| | 0 | Evidence and decisions | What the existing system already does, and which choices are settled | | 1 | Stable foundations | The main building blocks work together, and older data still reads correctly | | 2 | A durable first version | A task survives a crash and needs approval before its external action | | 3 | Cancellation and synced channels | Several tasks can be cancelled together, and all devices stay in step. This is the first version we would call usable. | | 4 | Production hosting and integrations | Agents run in the places customers need, and connect to outside systems | ## What we are not promising - **No unlimited autonomous purchasing.** A person always sets the limits, and approvals stay in place for consequential actions. - **No unrestricted offline changes.** A device that is offline can read and prepare, but cannot commit changes on its own. - **No rollback across third parties.** Robotelos can reverse what it controls and what the other side offers as a cancellation. It cannot promise to undo everything elsewhere. - **No universal feature parity with other protocols.** Robotelos connects to them where it helps, but its own contract is the reference. ## Next steps - [What is Robotelos?](/docs/overview/what-is-robotelos/) for what exists today. - [Journeys Robotelos is designed for](/docs/concepts/journeys/) for four everyday scenarios. - [Goals, tasks and planning](/docs/concepts/goals-and-planning/), [Accounts and memory](/docs/concepts/accounts-and-memory/), [Agents, versions and environments](/docs/concepts/agents-and-environments/) and [Execution model](/docs/concepts/execution-model/) for the ideas that used to be on this page. - [Roadmap](/docs/project/roadmap/) for what is planned next. # What is Robotelos? Source: https://robotelos.dev/docs/overview/what-is-robotelos/ Robotelos is open-source infrastructure for agents that people rely on. You describe an agent once, and Robotelos keeps it running, lets people and other agents talk to it from any device, and moves it from a draft to production in steps you can review. ## What sets it apart **Durable.** A conversation and the work behind it live in PostgreSQL, not in a process. If a gateway restarts, an agent turn is picked up again. Several gateway replicas share one database and one queue of work. **Connected.** One ordered stream per conversation, delivered over HTTP with Server-Sent Events, WebSocket or gRPC. A laptop, a phone and a terminal follow the same conversation and each resumes from where it stopped. **Accountable.** An agent asks before it acts, and the answer applies to exactly the details a person was shown. Every change to a release is recorded in an audit trail. **Operable.** Agents, versions, rollouts and promotions are files you apply with `robotelos apply -f`. Production changes only through a promotion that someone other than the requester approves. Fleets carry the runtime to other Kubernetes clusters, including clusters at the edge, and those clusters connect outbound only. ## What each part is | Part | What it does | Where to read more | |---|---|---| | **Conversation protocol** | The messages, rules and guarantees between clients, a server and agents | [Specification](/docs/specification/) | | **Gateway** | Serves the protocol on top of PostgreSQL | [Run the gateway](/docs/deploy/run-the-gateway/) | | **Control plane** | Accounts, agents, releases, rollouts, promotions and the audit trail | [Ship an agent](/docs/operate/ship-an-agent/) | | **Fleets** | A fleet agent and a runtime operator in each cluster that runs your agents | [Fleets](/docs/concepts/fleets/) | | **SDKs and tools** | Go client and server libraries, and the `robotelos` command | [Build](/docs/build/) | {{< diagram name="platform-overview" caption="Clients, Control API, gateway, engine, PostgreSQL and execution hosts inside one platform boundary." >}} ## How mature is it? Robotelos is not yet a finished product. The conversation protocol, durable conversations, the command line and declarative releases work today. Goal orchestration, model access, fleet synchronisation and voice exist but are experimental, and some features are only planned. [What you can do today](/docs/overview/status/) lists each one honestly. ## Next steps - Run it on your machine: [Quickstart](/docs/getting-started/quickstart/). - Check your machine first: [Requirements and support](/docs/getting-started/requirements/). - Understand the reasoning: [Why Robotelos](/docs/overview/why-robotelos/). - Choose how you will use it: [Products and surfaces](/docs/overview/surfaces/). # Write an agent Source: https://robotelos.dev/docs/build/write-an-agent/ An agent plugs into the conversation server through a two-method port. The server calls it when a participant sends a message, and again when an approval is answered. ## The port ```go type Agent interface { Reply(ctx context.Context, history []protocol.Event) (protocol.AgentTurn, error) Resume(ctx context.Context, history []protocol.Event, req protocol.ApprovalRequest, approved bool) (protocol.AgentTurn, error) } ``` - `Reply` receives the conversation's events so far and returns one **turn**. - `Resume` runs after an approval was answered. `approved` tells you the answer. The `req` is the request you returned earlier. A turn has three possible shapes: | Return | Meaning | |---|---| | `Parts` | The agent's reply. Parts carry text, structured data, or a URL with a media type | | `Approval` | The agent needs approval before it continues. The server creates an approval obligation | | `Outcome` | `"succeeded"` or `"failed"`. The server records an outcome event | An agent's output is a proposal. The server records it; it does not execute anything on the agent's behalf. ## A minimal agent ```go package main import ( "context" "encoding/json" "strings" "github.com/robotelos/robotelos/protocol" ) type echo struct{} func (echo) Reply(ctx context.Context, history []protocol.Event) (protocol.AgentTurn, error) { return protocol.AgentTurn{ Parts: []protocol.Part{protocol.TextPart("you said: " + lastText(history))}, Outcome: "succeeded", }, nil } func (echo) Resume(ctx context.Context, history []protocol.Event, req protocol.ApprovalRequest, approved bool) (protocol.AgentTurn, error) { if !approved { return protocol.AgentTurn{Parts: []protocol.Part{protocol.TextPart("Understood, I did not run it.")}}, nil } return protocol.AgentTurn{Parts: []protocol.Part{protocol.TextPart("Approved.")}}, nil } // lastText returns the text of the most recent event, when it is a message. func lastText(history []protocol.Event) string { if len(history) == 0 { return "" } var mc protocol.MessageContent if err := json.Unmarshal(history[len(history)-1].Content, &mc); err != nil { return "" } var b strings.Builder for _, p := range mc.Parts { if p.Text != nil { b.WriteString(*p.Text) } } return b.String() } ``` `protocol/mockagent` is a complete example: it asks for approval when a message starts with `run `. ## Serve it Register the agent and start the listeners. `server.New` takes the agents; `serve.Start` takes the bearer tokens: ```go srv, err := server.New(server.Config{ Agents: []server.AgentSpec{{ID: "echo", Version: "1", Display: "Echo", Agent: echo{}}}, }) if err != nil { return err } l, err := serve.Start(srv, serve.Config{ HTTPAddr: "127.0.0.1:8787", GRPCAddr: "127.0.0.1:8788", Tokens: map[string]server.Principal{ "demo-alice": {ID: "par_alice", Account: "acct_alice", Display: "Alice"}, }, }) if err != nil { return err } defer l.Close() ``` Clients then create conversations with `agent = "echo"`. Keep tokens secret and store them in configuration. ## Rules for agents - Return promptly from `Reply`. Long work belongs behind the approval and outcome events, not in one blocking call. - Honor the context. The server cancels it when the turn is abandoned. - Do not assume a disconnected client receives your reply. Disconnects cancel nothing; the event is in the journal. - Do not hold credentials or customer data in the agent's memory across turns. The journal is the record. ## Next steps - [Approvals](/docs/concepts/approvals/) for the approval flow your agent triggers. - [Protocol reference](/docs/reference/protocol/) for the event types your turn produces. - [Agent API](/docs/reference/agent-api/) for the exact interface a served agent implements. # Client SDK Source: https://robotelos.dev/docs/build/examples/client-sdk/ This program uses the Go client SDK (`protocol/client`) to do the whole round trip against a running server. It needs the server from the [Server SDK example](/docs/build/examples/server-sdk/), or the local stack from [Chat from a terminal](/docs/build/examples/cli/). ## The program Save it as `main.go` in any Go module that depends on `github.com/robotelos/robotelos`: ```go package main import ( "context" "fmt" "log" "time" "github.com/robotelos/robotelos/protocol" "github.com/robotelos/robotelos/protocol/client" "github.com/robotelos/robotelos/protocol/client/dial" ) func main() { ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() // 1. Connect. The server from the server example listens on these addresses. c, err := dial.Client(ctx, dial.Options{ Transport: dial.WebSocket, URL: "ws://127.0.0.1:8787/v1/ws", Token: "demo-alice", }) if err != nil { log.Fatal(err) } defer c.Close() if _, err := c.Initialize(ctx, protocol.InitializeRequest{ Client: protocol.ClientInfo{Name: "client-example", Kind: "adapter"}, }); err != nil { log.Fatal(err) } // 2. Create a conversation with the mock agent and follow it. rcp, err := c.CreateConversation(ctx, protocol.NewID("cmd"), "mock", "hello from the client SDK") if err != nil { log.Fatal(err) } if rcp.Disposition != protocol.Accepted { log.Fatalf("create conversation: %s %v", rcp.Disposition, rcp.Error) } sub, err := c.Subscribe(ctx, rcp.ConversationID, nil) if err != nil { log.Fatal(err) } // 3. Send a message. "run" asks the mock agent for an approval. if _, err := c.SendText(ctx, rcp.ConversationID, protocol.NewID("cmd"), "run ls -la"); err != nil { log.Fatal(err) } // 4. Read frames. Print each message once, answer the approval when it is // open, and stop when the agent replies after the answer. printed := 0 answered := false for { if _, err := sub.Next(ctx); err != nil { log.Fatal(err) } conv := client.Project(rcp.ConversationID, "par_alice", sub.View()) for _, m := range conv.Messages[printed:] { fmt.Printf("%s: %s\n", m.SenderName, m.Text) } printed = len(conv.Messages) if !answered { for _, ob := range conv.Obligations { if ob.Status != "open" { continue } receipt, err := c.AnswerObligation(ctx, sub, ob.ID, protocol.AnswerApprove) if err != nil { log.Fatal(err) } fmt.Println("answer:", receipt.Disposition) answered = true break } continue } if n := len(conv.Messages); n > 0 && !conv.Messages[n-1].Mine { return } } } ``` ## Run it With the server running, in a second terminal: ```bash go run . ``` The output looks like this. The approval is accepted and the agent reports its result: ```text Alice: run ls -la answer: ACCEPTED Mock: outcome (succeeded): Done. Ran: ls -la ``` ## What each step does | Step | Call | Why it matters | |---|---|---| | Connect | `dial.Client` | Picks the binding (`dial.WebSocket`, `dial.SSE` or `dial.GRPC`) and sends the bearer token. Every binding carries the same messages. | | Initialize | `c.Initialize` | Identifies the client. Call it once per connection. | | Create | `c.CreateConversation` | Sends a command with a new `command_id`. The receipt says whether it was accepted. | | Follow | `c.Subscribe`, `sub.Next` | Each frame updates the view that the SDK keeps for you. `sub.View()` is the current state. | | Project | `client.Project` | Turns the view into messages, participants and open obligations for one reader. The second argument is your own participant ID. | | Send | `c.SendText` | Sends a message as a command. Retrying with the same `command_id` and text is safe. | | Approve | `c.AnswerObligation` | Takes the obligation's version and digest from the view, so the answer applies only to what was shown. The receipt is `ACCEPTED`, `STALE` or `REJECTED`. | ## Make it resilient To survive transient failures and reconnects, wrap the client in `client.Reliable` and resume with the last view. The [Go client guide](/docs/build/go-client/#retries) explains both. ## Next steps - [Go client guide](/docs/build/go-client/) - [Server SDK example](/docs/build/examples/server-sdk/) # Control Plane API Source: https://robotelos.dev/docs/reference/control-plane-api/ The control plane serves two APIs. The **Control API** is for people, the CLI, the console and CI. The **fleet coordinator API** is for fleet agents only. Both are defined as protobuf in `api/proto/robotelos/`, and the Control API is also served as REST under `/api/v1/`. | API | Defined in | Served by role | Caller | |---|---|---|---| | Control API: `Accounts`, `Agents`, `Deployments`, `Promotions`, `Fleets` | `controlplane/v1/accounts.proto`, `platform.proto` | `accounts` | Users, CLI, console, CI | | Fleet coordinator: `FleetSync`, `FleetWatch`, `FleetObserve` | `fleet/v1/fleet.proto` | `fleets` | Fleet agents | Roles are chosen with `ROBOTELOS_CONTROLPLANE_ROLES` (comma separated). Exit code 2 means the configuration is wrong. For diagnosis, `ROBOTELOS_CONTROLPLANE_DIAG_ADDR` (for example `127.0.0.1:6060`) serves the Go profiler on that address; the fleet agent has `ROBOTELOS_FLEET_DIAG_ADDR`. Both are off when empty and accept a loopback address only, because a profile holds memory and stacks. ## Authentication and authorization - **Control API:** a signed-in user (OIDC; the CLI uses the device grant, the browser uses a session cookie) or an access token. Every account resource is named under an account, and the caller's role in that account decides what they may do. `ROBOTELOS_API_OIDC_AUDIENCE` sets the expected token audience; the gRPC address and TLS files are `ROBOTELOS_API_GRPC_ADDR`, `ROBOTELOS_API_GRPC_TLS_CERT_FILE` and `ROBOTELOS_API_GRPC_TLS_KEY_FILE`. - **Fleets service:** platform administrators only (`ROBOTELOS_PLATFORM_ADMINS`). It is not scoped to an account. - **Fleet coordinator:** the fleet's enrollment credential, plus optional mutual TLS with the certificate bound to the fleet (see [Transports](/docs/concepts/fleets/transports/)). ## Conventions - **Optimistic concurrency.** `UpdateAgentDraft` takes the `revision` you read, and deployments and promotions take an `expected_generation`. A change made meanwhile is refused with `Aborted`; read again and retry. - **Immutable versions.** A version freezes the draft and compiles a release with a content digest (`sha256:` and 64 hex digits). Creating a version while the draft is unchanged returns the existing one. - **Honest phases.** A deployment reports `Accepted`, `Progressing`, `Distributed`, `Applied`, `Ready` or `Degraded`. Delivery is not application, and application is not readiness. - **Production by promotion.** `DeployAgentRelease` targets `dev` and `stg` only. `prod` is reached through a promotion. - Lists use `page_token` and `next_page_token`. ## Accounts | RPC | REST | Purpose | |---|---|---| | `GetCurrentUser` | `GET /api/v1/users/me` | The signed-in user and active account | | `SetActiveAccount` | `POST /api/v1/users/me/active-account` | Select the active account | | `ListAccounts` | `GET /api/v1/accounts` | Accounts you belong to | | `CreateAccount` | `POST /api/v1/accounts` | Create an account | | `GetAccountMembers` | `GET /api/v1/accounts/{account_id}/members` | Members and pending invitations | | `CreateAccountInvitation` | `POST /api/v1/accounts/{account_id}/invitations` | Invite by email with a role | | `RevokeAccountInvitation` | `DELETE /api/v1/accounts/{account_id}/invitations/{invitation_id}` | Withdraw an invitation | | `GetInvitation` | `GET /api/v1/invitations/{token}` | Look up an invitation | | `AcceptInvitation` | `POST /api/v1/invitations/{token}/accept` | Join the account | | `IssueConversationToken` | `POST /api/v1/accounts/{account_id}/conversation-token` | A short-lived credential for the conversation gateway | ## Agents An agent has a freely editable **draft** and immutable **versions**. | RPC | REST | |---|---| | `CreateAgent` | `POST /api/v1/accounts/{account_id}/agents` | | `GetAgent` | `GET .../agents/{agent_id}` | | `ListAgents` | `GET .../agents` | | `GetAgentDraft` | `GET .../agents/{agent_id}/draft` | | `UpdateAgentDraft` | `PUT .../agents/{agent_id}/draft` | | `CreateAgentRelease` | `POST .../agents/{agent_id}/releases` | | `ListAgentReleases` | `GET .../agents/{agent_id}/releases` | | `GetAgentRelease` | `GET .../agents/{agent_id}/releases/{version}` | (`...` is `/api/v1/accounts/{account_id}`.) ## Deployments | RPC | REST | Purpose | |---|---|---| | `ListEnvironments` | `GET .../environments` | The environments and whether they are enabled | | `SetEnvironmentEnabled` | `PATCH .../environments/{environment}` | Turn the optional `stg` on or off | | `DeployAgentRelease` | `POST .../agents/{agent_id}/environments/{environment}/deployments` | Assign a release to `dev` or `stg` | | `RollbackDeployment` | `POST .../agents/{agent_id}/environments/{environment}:rollback` | Return to the previous version | | `RevokeDeployment` | `POST .../agents/{agent_id}/environments/{environment}:revoke` | Stop serving the agent there | | `GetDeploymentStatus` | `GET .../agents/{agent_id}/environments/{environment}/status` | Desired state, phase and per-fleet observation | | `ListDeployments` | `GET .../agents/{agent_id}/environments/{environment}/deployments` | History | | `RecordEvaluation` | `POST .../agents/{agent_id}/evaluations` | Evidence a promotion gate can require | A deployment has a `kind` (deploy, promotion, rollback, revoke), a `status` (applying, completed, failed, cancelled) and a `generation`. It is `completed` only when the fleets observed it Ready. ## Promotions A promotion moves a release that runs in one environment to the next, with gates and approval. | RPC | REST | |---|---| | `RequestPromotion` | `POST .../promotions` | | `GetPromotion` | `GET .../promotions/{promotion_id}` | | `ListPromotions` | `GET .../agents/{agent_id}/promotions` | | `ApprovePromotion` | `POST .../promotions/{promotion_id}:approve` | | `RejectPromotion` | `POST .../promotions/{promotion_id}:reject` | | `CancelPromotion` | `POST .../promotions/{promotion_id}:cancel` | States: `requested`, `awaiting_approval`, `approved`, `applying`, `succeeded`, `failed`, `rejected`, `cancelled`. Approved is not succeeded: a promotion succeeds when the fleets observe the release Ready. ## Fleets (platform administrators) | RPC | REST | Purpose | |---|---|---| | `CreateFleet` | `POST /api/v1/fleets` | Create a fleet of class `nonprod` (dev, stg) or `prod`. The enrollment credential is returned **once** and never stored. | | `ListFleets` | `GET /api/v1/fleets` | Every fleet with its `observation`: `connected` (last seen under 30 seconds ago; derived, there is no disconnect event), `first_seen_time`, `last_seen_time`, `agent_version`, `releases_by_phase`, `pools`, `pools_ready`, `ready_replicas` | | `ListAccountFleets` | `GET /api/v1/accounts/{account_id}/fleets` | The fleets granted to the account, with the same `observation`; releases are the account's own. Needs `deployments.read`, no platform role | | `RotateFleetCredential` | `POST /api/v1/fleets/{fleet_id}:rotate-credential` | New credential | | `GrantFleetAccount` / `RevokeFleetAccount` | `PUT` / `DELETE /api/v1/fleets/{fleet_id}/accounts/{account_id}` | Which accounts a fleet serves | | `PutRuntimePool` | `PUT /api/v1/fleets/{fleet_id}/runtime-pools/{name}` | Declare a shared runtime pool | | `GetRuntimePool`, `ListRuntimePools` | `GET .../runtime-pools[/{name}]` | Read pools and their observed state | | `DeleteRuntimePool` | `DELETE .../runtime-pools/{name}` | Mark the pool `DELETING` | ## Fleet coordinator API (fleet agents) | Service | RPC | Purpose | |---|---|---| | `FleetSync` | `WaitRevision` | Long poll until the fleet's revision passes the one given | | | `GetSnapshot` | The fleet's desired state: releases, pools, accounts | | | `ReportStatus`, `ReportPools` | Applied generation and pool readiness (unary) | | `FleetWatch` | `Watch` (server stream) | Bookmarks when the revision changes | | `FleetObserve` | `Observe` (bidirectional stream) | Hello with epoch, state of the world, then upserts, deletes and heartbeats | The same operations are carried over HTTP/1.1 as JSON (`/v1/fleet/revision:wait`, `/v1/fleet/snapshot`, `/v1/fleet/status`, `/v1/fleet/pools`, and `/v1/fleet/watch` as a stream of JSON lines); `Observe` is gRPC's alone. See [Watch and Observe](/docs/concepts/fleets/streams/) and [Transports](/docs/concepts/fleets/transports/). ## Next steps - [Resource commands](/docs/reference/cli/resources/) - [Permissions](/docs/reference/permissions/) # Conversations Source: https://robotelos.dev/docs/concepts/conversations/ A **conversation** is an ordered journal of events between participants. Clients do not write the journal directly. They send commands; the server accepts them, appends events, and streams the events to every subscribed client. ## Participants A participant is a person or an agent that takes part in a conversation. Each has an ID, an account it belongs to, and a display name. The server authenticates a bearer token to a principal, and the principal's participant ID is the author of the commands it sends. Agents are registered with the server by ID and version. A conversation names the agent it talks to when it is created. ## Events Every change to a conversation is an **event** with a position in the journal. Positions are contiguous: a client that has seen position *n* and then receives *n+1* has missed nothing. | Event type | Meaning | |---|---| | `robotelos.conversation` | The conversation exists and names its agent | | `robotelos.participant` | A participant joined or was described | | `robotelos.message` | A message from a participant or an agent. Agent replies carry a `robotelos.reply` relation to the message they answer | | `robotelos.outcome` | The result of an agent turn: `succeeded` or `failed`. A failure carries a `robotelos.cause` relation | | `robotelos.obligation` | A state event: something a participant must answer, such as an approval ([Approvals](/docs/concepts/approvals/)) | | `robotelos.surface` | A state event: a rendered interface for an obligation, with a plain-text fallback | Timeline events (messages, outcomes) are kept in order. State events (obligations, surfaces) describe the current state of something and are replaced as they change. ## The view The server gives each client a **view**: the conversation's state reduced from its events. A client subscribes and gets: 1. a **snapshot**: the view up to a cursor; 2. then **frames**: the events after that cursor, in order, each with its own cursor. A client that disconnects resumes from its last cursor. If the server can no longer serve that cursor, it asks the client to resnapshot (`resnapshot_required`) rather than sending a gap. The Go client applies the same reducer the server uses, so a client and a test see the same state. ## Creating and using a conversation Create a conversation with the `robotelos.create_conversation` command, then send messages with `robotelos.submit_message`. Both are commands, so both return a receipt. See [Commands and receipts](/docs/concepts/commands-and-receipts/) and the [command reference](/docs/reference/protocol/). {{< diagram name="command-flow" caption="A command is answered with a receipt. Events reach subscribers as frames, in order." >}} ## Limits The same events reach every client that follows the conversation. See [Multiple clients](/docs/concepts/multi-client/) for how several devices stay in step. The protocol bounds identifiers and payload sizes. A command over the limit is refused with `payload_too_large`. The exact limits are listed in the [protocol reference](/docs/reference/protocol/). ## Next steps - [Commands and receipts](/docs/concepts/commands-and-receipts/) - [Multiple clients](/docs/concepts/multi-client/) # Database migrations Source: https://robotelos.dev/docs/deploy/database-migrations/ Robotelos keeps its PostgreSQL schema in versioned, checksummed migration files under `db/migrations/`. The `robotelos` CLI applies them. ## Commands ```bash go run ./runtime/cmd/robotelos db migrate new create_employees # empty, timestamped file go run ./runtime/cmd/robotelos db migrate status # applied, pending or changed go run ./runtime/cmd/robotelos db migrate up # apply what is pending ``` `up` and `status` read the connection string from `ROBOTELOS_DATABASE_URL`. The migrations directory defaults to `db/migrations` relative to the working directory; `ROBOTELOS_MIGRATIONS_DIR` or `--dir` changes it. Build the CLI with `go build -o robotelos ./runtime/cmd/robotelos` if you run it often. ## Rules - **Never edit an applied migration.** The runner records a checksum for each applied version. A changed file makes `up` refuse to run. Add a new file instead. - **File names are `YYYYMMDDHHMMSS_what_it_does.sql`.** The timestamp is the version. Two files with one version are refused. - **Each migration runs in one transaction** together with its version row. A file whose first line is `-- robotelos:online` runs outside a transaction, for `CREATE INDEX CONCURRENTLY`; such a file must be safe to run twice.- **Concurrent migrators take turns.** An advisory lock serializes them. ## Current migrations | File | Content | |---|---| | `20261113120000_durable_dispatch.sql` | Executions, execution events and the dispatch outbox | | `20261113120100_conversations.sql` | Conversations, journal, membership, receipts, pending approvals, home-account index | | `20261113120200_roles_and_rls.sql` | `robotelos_app` and `robotelos_worker`, grants, row level security | | `20261113120300_agent_turns.sql` | The agent turn queue | | `20261113120400_execution_rls.sql` | Row level security for the execution tables and the split of duties between the two roles | `robotelos db migrate status` lists the files and their state in your database. ## Next steps - [Run the gateway](/docs/deploy/run-the-gateway/) - [Local stack and database commands](/docs/reference/cli/local-stack-and-database/) # FAQ Source: https://robotelos.dev/docs/troubleshooting/faq/ ## Is Robotelos ready for production? Parts of it work today, and parts are experimental. The conversation protocol, durable conversations, the command line and declarative releases are available. Goal orchestration, model access, fleet synchronisation and voice are experimental. See [What you can do today](/docs/overview/status/) and [Production notes](/docs/getting-started/production-notes/). ## What do I need to try it? Go 1.27 and Docker. Run `robotelos dev doctor` to check. See [Requirements and support](/docs/getting-started/requirements/). ## Do I need Kubernetes? Not to try it, and not to run a gateway. A gateway is a process on top of PostgreSQL. Fleets, which carry the runtime into other clusters, run on Kubernetes only. ## Which database does it use? PostgreSQL only. The integration tests use 17.6 and the `robotelos dev` container uses 16. Account isolation depends on its row level security. ## Can I use my own agent or model? Yes. The built-in agent is a deterministic mock, good for trying approvals and transports. Serve your own agent with the [Server SDK](/docs/build/write-an-agent/). Model access through Genkit (Ollama and Azure) is experimental, and today allows one provider and one key per process. ## Which transports and languages are supported? Server-Sent Events over HTTP, WebSocket and gRPC, with the same messages on each. There are Go libraries for clients and servers. A generated TypeScript client for the Control API is experimental. ## What happens when a request is retried? Every command carries a `command_id`, so a retry returns the original receipt and does not apply the command twice. The client library retries transient failures this way and never retries an answer to an approval. For effects outside Robotelos, a lost reply is recorded as `UNKNOWN` and settled from the provider's evidence. Robotelos does not claim exactly-once effects without evidence. ## How are accounts kept apart? By PostgreSQL row level security, which the gateway checks at startup. See [Security](/docs/operate/security/). ## How does an agent get from a draft to production? You describe it in files and apply them with `robotelos apply -f`. Production changes only through an approved promotion. See [Ship an agent](/docs/operate/ship-an-agent/). ## What does a fleet do when its link to the control plane drops? It keeps serving the release it has, and catches up with the latest desired state when the link returns. The fleet agent only connects outward. Network partitions, lossy links and killed pods are tested on `kind` clusters. See [Fleets](/docs/concepts/fleets/). ## Where do my tokens live? In a file you control, read at startup. Keep it out of version control and use long random values. Signing in through an OpenID Connect provider is experimental. ## What is the licence? Apache-2.0. Dependencies must use a permissive licence. ## Where do I report a problem? See [Get help](/docs/troubleshooting/support/). ## Next steps - [Common problems](/docs/troubleshooting/common-problems/) - [Get help](/docs/troubleshooting/support/) # Go client Source: https://robotelos.dev/docs/build/go-client/ The `protocol/client` package is the Go client SDK. It works over any transport the server offers, and the same code runs in tests and in applications. ## Connect `dial.Client` opens a connection over `ws`, `sse` or `grpc`: ```go import ( "github.com/robotelos/robotelos/protocol" "github.com/robotelos/robotelos/protocol/client/dial" ) c, err := dial.Client(ctx, dial.Options{ Transport: dial.WebSocket, URL: "ws://127.0.0.1:8787/v1/ws", Token: "demo-alice", }) if err != nil { return err } defer c.Close() _, err = c.Initialize(ctx, protocol.InitializeRequest{ Client: protocol.ClientInfo{Name: "my-app"}, }) ``` Use `dial.SSE` with `http://127.0.0.1:8787` or `dial.GRPC` with `127.0.0.1:8788` for the other bindings. ## Create a conversation and send a message ```go rcp, err := c.CreateConversation(ctx, protocol.NewID("cmd"), "mock", "hello") if err != nil { return err } if rcp.Disposition != protocol.Accepted { return fmt.Errorf("create conversation: %s %v", rcp.Disposition, rcp.Error) } _, err = c.SendText(ctx, rcp.ConversationID, protocol.NewID("cmd"), "run ls -la") ``` `protocol.NewID("cmd")` generates a command ID. Keep it if you retry the same command: a retry with the same ID and payload is safe ([Commands and receipts](/docs/concepts/commands-and-receipts/)). ## Follow the conversation Subscribe and read frames in order. The subscription keeps a view that the reducer updates for each frame: ```go sub, err := c.Subscribe(ctx, rcp.ConversationID, nil) // or pass a saved *protocol.View to resume if err != nil { return err } for { if _, err := sub.Next(ctx); err != nil { return err } ui := client.Project(rcp.ConversationID, "par_alice", sub.View()) // ui holds messages, surfaces and open obligations ready to display } ``` `sub.WaitUpToDate(ctx)` waits until the snapshot has caught up with the end of the journal. `sub.AwaitEcho(ctx, commandID)` waits until your own command has come back through the stream; a consumer goroutine must be running for it. To keep a conversation flowing across reconnects, use `client.Follow`. It resubscribes from the last cursor and asks for a resnapshot when the server requires one. If the consumer falls behind, the subscription returns `ErrSlowConsumer`; `WithQueueLimit` changes the bound. ## Answer an approval When the view shows an open obligation, answer it with its ID and the answer. The client takes the expected version and the request digest from the obligation in the view, not from the surface, so a button cannot change what is approved: ```go receipt, err := c.AnswerObligation(ctx, sub, obligationID, protocol.AnswerApprove) if err != nil { return err } _ = receipt // ACCEPTED, STALE or REJECTED; see Commands and receipts ``` `protocol.AnswerApprove` is `"approve"`; `protocol/obligation.go` lists the other answer kinds. ## Retries Wrap the client in `client.Reliable` to retry commands on transient failures with backoff and jitter. The wrapper reuses the command ID. It never retries an answer to an obligation. ## Next steps - [Approvals](/docs/concepts/approvals/) explains what the answer is checked against. - The [protocol reference](/docs/reference/protocol/) lists the methods and error codes the client handles. # Quickstart Source: https://robotelos.dev/docs/getting-started/quickstart/ This guide gets a complete Robotelos instance running on your machine and shows you how to talk to it. You need Go 1.27, and Docker for the full instance. If you do not have Docker, run the [Server SDK](/docs/build/examples/server-sdk/) and [Client SDK](/docs/build/examples/client-sdk/) examples instead. They keep conversations in memory. ## Step 1: Get the tools Clone the repository and build the two command-line programs: ```bash git clone https://github.com/robotelos/robotelos.git robotelos cd robotelos go build -o robotelos ./runtime/cmd/robotelos go build -o robotelos-chat ./protocol/cmd/robotelos-chat ``` On Windows, the files are called `robotelos.exe` and `robotelos-chat.exe`, and you run them as `.\robotelos.exe`. ## Step 2: Check your machine ```bash ./robotelos dev doctor ``` The command checks Docker, the configuration folder and the ports Robotelos uses. It lists every problem at once. If something fails, fix it and run the command again. ## Step 3: Start the instance ```bash ./robotelos dev up ``` This starts a PostgreSQL database in Docker, applies the database setup, and starts the gateway with a built-in mock agent. Leave this terminal open. The gateway is listening on: - `127.0.0.1:8787` for HTTP and WebSocket - `127.0.0.1:8788` for gRPC The command also saves a connection called `dev` and makes it the current one. Check it in a second terminal: ```bash ./robotelos context list ``` The line marked `*` is the current instance. ## Step 4: Chat with the agent In the second terminal, connect with the development token that `dev up` saved: ```bash ./robotelos-chat --transport sse --url http://127.0.0.1:8787 --token "$(cat ~/.robotelos/dev/token)" ``` On PowerShell, use `--token (Get-Content ~\.robotelos\dev\token)` instead. Type a message and the mock agent answers. Now type: ```text run ls -la ``` The agent asks for your approval before it runs the command. To answer approvals in your own program, see the [Go client example](/docs/build/examples/client-sdk/). ## Step 5: Stop, and clean up Press Ctrl-C in the first terminal to stop the gateway. The database keeps running, so the next `dev up` is quick. To stop the database too: ```bash ./robotelos dev down ``` Add `--volumes` to also delete the data. ## Next steps {{< gopher pose="celebrate" >}} - Try the [Client SDK example](/docs/build/examples/client-sdk/) to write your own program. - Plug in your own agent with the [Server SDK example](/docs/build/examples/server-sdk/). - See every command in the [Command-line tools reference](/docs/reference/cli/). - Stuck? See [Troubleshooting](/docs/troubleshooting/common-problems/). # Resources: apply, get and decisions Source: https://robotelos.dev/docs/reference/cli/resources/ ## Resources: `apply`, `get`, and promotion decisions Desired state has one way in (`apply`) and one way out (`get`). All commands accept `--account ID` (default: your active account) and `-o text|json`. | Command | What it does | |---|---| | `robotelos apply -f FILE` | Creates or updates every resource in the file (several may be separated by `---`). Applying the same file twice changes nothing. | | `robotelos get KIND [NAME]` | Reads one resource or a list. | | `robotelos approve promotion ID [--comment T]`, `reject promotion ID [--comment T]` | Records a decision on a promotion. | | `robotelos cancel promotion ID` | Withdraws a promotion. | | `robotelos advance rollout AGENT/ENV [--generation N]` | Takes a canary's next step now, whether or not its pause has run, or makes the candidate the stable version when it is on its last step. See [Release a version gradually](/docs/operate/release-gradually/). | | `robotelos can-i [PERMISSION]` | Says yes, or fails with no, whether your role may do something; without a name it lists what your role may do. See [Permissions](/docs/reference/permissions/). | Kinds `apply` accepts. Every document must say `apiVersion: robotelos.io/v1`; a file with another or no `apiVersion` in any document is refused before anything is applied. | Kind | Fields | Effect | |---|---|---| | `Agent` | `metadata.name`, `spec.model`, `prompt`, optional `spec.strategy` (`goal_task` or `react`), … | Creates the agent or updates its draft. Never publishes. Without `spec.strategy`, a new agent is `goal_task` and an existing one keeps its strategy. | | `AgentRelease` | `metadata.agent`, optional `spec.preview: true` | Freezes the draft as the next release (the same one again if nothing changed). With `preview`, builds a test release that runs in dev only and is never promoted. | | `AgentRollout` | `metadata.agent`, `metadata.environment`, optional `metadata.generation`, `spec.version`, optional `spec.strategy` and `spec.paused` | Makes the version the desired state of `dev` or `stg`. With a `strategy` (`canary` with `steps`, or `blueGreen` with a `match`) the version is served next to the stable one; see [Release a version gradually](/docs/operate/release-gradually/). For a gated environment such as `prod`, it records a promotion that waits for approval and changes nothing yet. No `spec.version` stops serving (maintainer). | | `Evaluation` | `spec.agent`, `version`, `environment`, `name`, `passed` | Records evidence a promotion can require. | | `Environment` | `metadata.name`, `spec.enabled` and/or `spec.promotion` | Turns the optional `stg` on or off; sets who must approve promotions into the environment (see [Permissions](/docs/reference/permissions/)). | `spec.strategy` means two different things: on an `Agent` it is a single word, the execution strategy; on an `AgentRollout` it is an object, how a new version is rolled out. Names `get` accepts: | Command | Reads | |---|---| | `get agents`, `get agent NAME` | Agents | | `get draft NAME` | The agent's editable draft | | `get releases NAME` | The agent's releases: number, status, digest | | `get release NAME/N` | One release: its status and digest, and the compiled artifact (the exact content that runs) | | `get environments` | Environments | | `get rollout AGENT/ENV`, `get rollouts AGENT` | The desired state and status in one environment, or in all of them | | `get revisions AGENT/ENV` | Every generation of a rollout, newest first | | `get promotion ID`, `get promotions AGENT` | Promotions | | `get audit [AGENT]` | The audit trail of the account, or of one agent (needs `audit.read`): who decided what, kept long. | | `get fleets` | The fleets granted to your account: whether each is connected (heard from in the last 30 seconds), when it was last seen, its agent version, your releases by phase and its ready pools (needs `deployments.read`). | | `get fleet-events [AGENT]` | What the fleets reported about your releases, newest first: applied, ready, degraded, the split applied (needs `deployments.read`). Made by machines and kept for 90 days; it is not the audit trail. | Each kind has one name, singular for one thing and plural for a list. The compiled artifact is part of a release and is shown only when one release is read. The old `deploy`, `promote`, `deployment …`, `eval record`, `env …`, `agent …` and `promotion …` commands were removed: each did something an `apply` or `get` now does. The REST and gRPC API are unchanged. ## Next steps - [Ship an agent from draft to production](/docs/operate/ship-an-agent/) - [Release a version gradually](/docs/operate/release-gradually/) - [Permissions](/docs/reference/permissions/) # Roadmap Source: https://robotelos.dev/docs/project/roadmap/ This page lists what is planned. Nothing here is available today. For the features you can use now, see [What you can do today](/docs/overview/status/). For the direction behind the plan, see the [Vision](/docs/project/vision/). The work is grouped into the areas below. Each area links to the page that describes it in detail. ## Planning long-running work - **Goals and tasks.** Turn a goal into sub-goals and tasks, and keep the plan up to date when the person changes their mind. Details: [Goals, tasks and planning](/docs/concepts/goals-and-planning/). - **Accounts and memory.** Personal and team accounts, and an assistant that remembers preferences, concerns and policies. Details: [Accounts and memory](/docs/concepts/accounts-and-memory/). - **Durable execution.** Agent steps that survive crashes and restarts, never repeat an external action, and report uncertain outcomes honestly. Details: [Execution model](/docs/concepts/execution-model/). ## Interaction - **More kinds of approval.** Free-text answers, choices with a form, edited details, and cancellation of a pending request. - **Real-time audio and video.** The same messages over real-time transports, for voice and video conversations. - **Lighter updates.** Typing indicators, streamed answers, and paging through long conversations. ## Finding people and work - **Finding people and conversations.** Look up a person or a conversation you were invited to, without knowing its ID. - **External parties.** Connect people and systems outside Robotelos, such as messaging channels, through gateways. Details: [Groups and participants](/docs/concepts/groups/). ## Running agents - **Agent releases and environments.** Publish each agent version as an unchangeable release, and run test, staging and production environments with their own settings. A new version is promoted in steps and can be rolled back. See [Agents, versions and environments](/docs/concepts/agents-and-environments/). - **Agents in different places.** Run agents in a company's own cloud, in a sandbox, or in the browser, without rewriting them. - **Your own domains.** Add business areas such as travel or dining as data, without a new release of the platform. ## Accounts and access - **Sign-in with identity providers.** Sign in with an existing account and expire tokens automatically, instead of using a token file. Items move from this page to the status page when they are available. ## Next steps - [What you can do today](/docs/overview/status/) - [Vision](/docs/project/vision/) # Roles and ownership Source: https://robotelos.dev/docs/specification/architecture/ This page covers the roles inside the protocol. For the whole platform (control plane, fleets, execution hosts), read [Architecture](/docs/concepts/architecture/). ## Roles **Client.** Any program that speaks MCoP: a Go application, a terminal, a browser or an adapter for another chat system. A client holds one or more **connections**, and each connection follows zero or more conversations. A client acts for a **principal**. **Server.** The process that accepts connections, authenticates principals, validates commands, appends events to the journal and delivers frames. In this repository the server is `protocol/server` and runs as the gateway on PostgreSQL or in memory. **Agent.** The component that produces replies and approval requests for a conversation. It sits behind the agent port, which has two methods, `Reply` and `Resume`. An agent proposes; it does not decide. Its output becomes events only when the server accepts it. **Store.** The place where the journal, receipts and pending agent turns are kept. Every change to one conversation is one transaction in the store. The store is a seam: the in-memory store and the PostgreSQL store pass the same conformance suite. **Principal.** The identity a connection authenticates as: an ID, an account and a display name. The principal's ID becomes the sender of its commands and events. ## Ownership | State | Owner | |---|---| | Conversations, participants, events, receipts | The server, through the store | | Who may do what in a conversation | The server, from participant roles | | Approval decisions | The server, from the responder's answer | | The agent's reasoning and tool use | The agent, which proposes only | | The client's view of a conversation | The client, reduced from events it has received | | The transport session | The transport and the client | A server MUST NOT trust a client's view. Every check happens against the journal. ## Deployment shapes - **Embedded**: the server runs in the same process as the client, over the in-memory transport. This is how tests run. - **Single process**: one server, one store. This is the embedded server of `apps/console`, or any program that calls `server.New` with the in-memory store. - **Replicated**: several servers share one PostgreSQL store. They wake each other with `LISTEN` and `NOTIFY`, and claim agent turns under a lease. This is the gateway in `runtime/cmd/gateway`. The protocol does not change between these shapes. A client written for one works with the others. ## Boundaries MCoP covers how clients and servers talk and what the journal records. It does not define: - how an agent reasons or which models it uses; - how an agent executes tools internally. These belong to other layers. The protocol only carries their results as events. ## Next steps - [Data model](/docs/specification/data-model/) - [Concepts: Architecture](/docs/concepts/architecture/) # Transports Source: https://robotelos.dev/docs/concepts/fleets/transports/ A proxy that breaks HTTP/2, or a path that passes HTTP/1.1 only, must not leave a cluster unable to sync. The agent therefore speaks two transports with identical behaviour. | Transport | Endpoint on the coordinator | Notes | |---|---|---| | gRPC | `ROBOTELOS_FLEET_GRPC_ADDR` | First choice; unary calls and streams, mutual TLS. | | HTTP | `ROBOTELOS_FLEET_HTTP_ADDR` | The same operations as JSON over HTTP/1.1: `POST /v1/fleet/revision:wait`, `GET /v1/fleet/snapshot`, `POST /v1/fleet/status`, `POST /v1/fleet/pools`, and `GET /v1/fleet/watch`, which answers with one JSON line per revision event. | Messages are the protocol's own, in their JSON form, so an answer is the same whichever way it arrived. Observations over HTTP are the unary status and pool reports; the observation stream is gRPC's. ## Agent configuration | Variable | Meaning | |---|---| | `ROBOTELOS_FLEET_TRANSPORT` | `auto`, `grpc` or `http`. | | `ROBOTELOS_FLEET_ADDR` | The coordinator's gRPC address, `host:port`. | | `ROBOTELOS_FLEET_URL` | Base URL of the HTTP endpoint, for example `https://control.example.com:8444`. Setting it makes `auto` the default. | In `auto` the agent uses the first transport that works, in the order gRPC, HTTP. It moves on only when a transport is **unavailable** or times out, never because the coordinator refused a request, and it tries gRPC again after five minutes. The credential and the certificate rule are the same on both transports. A TLS-terminating proxy cannot carry certificate-bound fleets, because the certificate has to reach the coordinator: pass TLS through at layer 4, or the request is refused. A plain `http` URL is accepted only for a loopback coordinator. ## Next steps - [How fleet sync works](/docs/concepts/fleets/how-it-works/) - [Streams](/docs/concepts/fleets/streams/) # Why Robotelos Source: https://robotelos.dev/docs/overview/why-robotelos/ Imagine you ask an agent: "Book a table for two tomorrow at an Italian restaurant, and a taxi for afterwards." It sounds simple. In practice, the agent has to search, compare, check availability, ask you to choose, wait for a yes, book, and then book the taxi to the right address. Something will go wrong along the way. The restaurant is full. You change your mind on the phone. The connection drops while the booking is being confirmed. Robotelos is built for that situation. It is a platform for agents that act on your behalf, and it keeps the work organised, asks before anything consequential happens, and keeps a record that you can trust. ## The problem Chat tools handle a request well, but a real task is not one answer. Three things go wrong: - **Work is lost when the conversation moves.** You start on the phone, continue on the laptop, and the booking you began is nowhere to be found. - **"Okay, go ahead" is vague.** You approved a table for two. If the restaurant changed the time or the price since you saw it, the agent should not treat your yes as covering the new details. - **Retries cause mistakes.** A connection drops, the agent tries again, and now there are two bookings. Nobody knows which attempt went through. Robotelos answers each of these directly. {{< diagram name="problem-answer" caption="The three problems of chat-based agents, and what Robotelos does about each one." >}} ## The story, step by step Every task follows the same five steps. Here is how the dinner-and-taxi example plays out. 1. **Ask.** You say what you want, in any channel: a message, a voice request, or a button in an app. 2. **Plan.** The goal is broken into steps: find restaurants, pick one, book it, then book a taxi from the restaurant's address. Steps that depend on each other run in order. 3. **Approve.** Before the booking, you see the exact details and say yes. The yes applies to those details only, on any of your devices. 4. **Act.** Each step runs once. If the first restaurant is full, the agent switches to the second option and tells you. If a connection drops, nothing is booked twice. 5. **Record.** The confirmation is kept with the task. You can open it later, on any device, and see what was booked and when. {{< diagram name="story-arc" caption="From a request to a record, in five steps." >}} ## How Robotelos plans Robotelos does not let a language model decide every step. A **goal manager** tracks what you want, a **task planner** turns it into steps, and a **behavior tree** runs the steps and switches to a planned fallback when one is blocked. Models help understand the request and propose plans. The rules for what runs, and when, stay explicit. [Goals, tasks and planning](/docs/concepts/goals-and-planning/) explains it with a worked example. ## Your yes means one thing When an agent wants to act, your answer is tied to the exact details you were shown, the person allowed to answer, and a time limit. If the details change, the old yes no longer applies. Only the first valid answer counts, so a second device cannot approve the same thing twice. {{< diagram name="approval-anatomy" caption="An approval is bound to the action, its details, who may answer, and an expiry time." >}} ## Next steps 1. [What is Robotelos?](/docs/overview/what-is-robotelos/): the one-page summary and what works today. 2. [Quickstart](/docs/getting-started/quickstart/): run an instance and chat with it. 3. [Concepts](/docs/concepts/): the model, in the order it is explained. The words used here are in the [glossary](/docs/reference/glossary/). 4. [Vision](/docs/project/vision/): where Robotelos is heading. # Worked example: a release with real output Source: https://robotelos.dev/docs/operate/walkthrough/ This page follows one scenario from start to finish. The commands and their output come from an automated end-to-end test (`TestTheCommandLineTakesAnAgentFromDraftToProductionAndTheDataPlanesFollow` in `runtime/internal/controlplane/e2e`). It runs the real `robotelos` program against a real server and database, with two fleets whose agents write releases into data databases of their own, one for dev and staging and one for production. After every step it checks those data databases, which is where a running conversation finds its release, and not only what the CLI prints. IDs and digests are shortened. The YAML files are the ones in [Ship an agent](/docs/operate/ship-an-agent/); this page shows only the commands and what they print. Two people take part. A **developer** writes and requests. A **maintainer** approves production. Add `--account ID` to each command, or select your account once with `robotelos account use`. ## 0. Turn on staging (once) Staging is optional. A maintainer turns it on: ```text $ robotelos apply -f stg.yaml environment/stg enabled: true ``` With staging on, production only accepts a version that has passed in staging. ## 1. Create an agent: it is a draft ```text $ robotelos apply -f support.yaml agent/support created (draft revision 0) $ robotelos get agent support a1fd4ece-… support current version: - $ robotelos get draft support draft revision 0 (changes no release holds: true) $ robotelos get releases support VERSION STATUS DIGEST PUBLISHED ``` The agent has a draft and no release. Nothing can run from a draft: ```text $ robotelos apply -f support-dev.yaml # a rollout of version 1 NotFound: not found: release 1 of this agent does not exist or is retired ``` ## 2. Publish version 1 ```text $ robotelos apply -f support-version.yaml agentrelease/support version 1 created: sha256:2da3efec… $ robotelos get draft support draft revision 0 (changes no release holds: false) $ robotelos get release support/1 agentrelease/support/1 status: published digest: sha256:2da3efec… artifact: {"agent":{"name":"support"}, … } ``` The release is frozen. The draft has no changes the release doesn't hold. ## 3. Roll out to dev and staging ```text $ robotelos apply -f support-dev.yaml agentrollout/support/dev generation 1 changed $ robotelos apply -f support-stg.yaml agentrollout/support/stg generation 1 changed ``` Before asking for production, record that version 1 passed in staging (the `Evaluation` file from Ship an agent, with `environment: stg`): ```text $ robotelos apply -f support-eval-stg.yaml evaluation/5d5880b3-… regression v1 in stg recorded (passed: true) ``` ## 4. Ask for production, and approve ```text $ robotelos apply -f support-prod.yaml # a rollout with environment: prod agentrollout/support/prod generation 0 unchanged; promotion/ef9e37ab-… awaiting_approval (robotelos approve promotion ef9e37ab-…) ``` Production has not changed. It shows a request waiting: ```text $ robotelos get rollout support/prod agentrollout/support/prod generation: 0 version: - state: PENDING pending promotion: ef9e37ab-… message: waiting for a promotion to be approved ``` The developer cannot approve it. The maintainer can: ```text $ robotelos approve promotion ef9e37ab-… # as the developer PermissionDenied: forbidden: the caller's role does not allow this operation $ robotelos approve promotion ef9e37ab-… --comment ok # as the maintainer ef9e37ab-… v1 stg -> prod applying sha256:2da3efec… $ robotelos get rollout support/prod generation: 1 version: 1 state: ACTIVE phase: Ready (observed generation 1) fleet 939703a9-…: generation 1 Ready sha256:087ed6b8… ``` ## 5. The same, but the promotion is rejected A second agent, `faq`, goes through steps 1 to 3 and asks for production: ```text $ robotelos apply -f faq-prod.yaml agentrollout/faq/prod generation 0 unchanged; promotion/3e9c6da4-… awaiting_approval (…) $ robotelos reject promotion 3e9c6da4-… --comment not-yet # as the maintainer 3e9c6da4-… v1 stg -> prod rejected sha256:f36a757f… ``` It never reaches production: ```text $ robotelos get rollout faq/prod NotFound: not found: nothing is deployed to prod $ robotelos get rollouts faq ENVIRONMENT GENERATION VERSION STATE PHASE dev 1 1 ACTIVE Ready stg 1 1 ACTIVE Ready $ robotelos get promotion 3e9c6da4-… 3e9c6da4-… v1 stg -> prod rejected sha256:f36a757f… ``` To try again, apply the production rollout again: it creates a new promotion. ## 6. Update the agent: version 2, and different versions in different environments Change the file (here, add `temperature: 0.2`) and apply it. This edits the draft only: ```text $ robotelos apply -f support.yaml agent/support updated (draft revision 1) $ robotelos get draft support draft revision 1 (changes no release holds: true) $ robotelos get rollouts support # nothing changed anywhere ENVIRONMENT GENERATION VERSION STATE PHASE dev 1 1 ACTIVE Ready stg 1 1 ACTIVE Ready prod 1 1 ACTIVE Ready ``` Publish version 2 and roll it out to dev only: ```text $ robotelos apply -f support-version.yaml agentrelease/support version 2 created: sha256:93cb41b5… $ robotelos apply -f support-dev.yaml # the rollout file now says version: 2 agentrollout/support/dev generation 2 changed $ robotelos get rollouts support ENVIRONMENT GENERATION VERSION STATE PHASE dev 2 2 ACTIVE Ready stg 1 1 ACTIVE Ready prod 1 1 ACTIVE Ready ``` Dev runs version 2 while staging and production still run version 1. Every environment keeps its own version. ## 7. Version 2 follows the same path to production Roll it out to staging, record that it passed, and ask for production. Production stays on version 1 until the promotion is approved: ```text $ robotelos apply -f support-prod.yaml # the rollout file says version: 2 agentrollout/support/prod generation 1 unchanged; promotion/77a74b64-… awaiting_approval (…) $ robotelos get rollouts support dev 2 2 ACTIVE Ready stg 2 2 ACTIVE Ready prod 1 1 ACTIVE Ready $ robotelos approve promotion 77a74b64-… # as the maintainer $ robotelos get rollouts support dev 2 2 ACTIVE Ready stg 2 2 ACTIVE Ready prod 2 2 ACTIVE Ready $ robotelos get revisions support/prod prod promotion v2 generation 2 … prod promotion v1 generation 1 … ``` ## 8. Going back Rolling back is applying the earlier version. Here dev goes back to version 1 while staging and production stay on 2: ```text $ robotelos apply -f support-dev.yaml # the rollout file says version: 1 agentrollout/support/dev generation 3 changed $ robotelos get rollouts support dev 3 1 ACTIVE Ready stg 2 2 ACTIVE Ready prod 2 2 ACTIVE Ready ``` ## Reading the phase Right after an apply, a rollout says *Accepted*: Robotelos has recorded what the environment should run. As the fleet's agent picks it up it moves through *Distributed* and *Applied* to *Ready*, which is when the agent has written the release into the environment's data database and it passed its readiness check. The tables above were read after the fleets had caught up, so they say *Ready*. If a fleet is away, the rollout stays short of *Ready* and the fleet's own line shows the generation it last confirmed. When the fleet returns it converges without any action from you. See [Operate fleets](/docs/operate/operate-fleets/). ## Other cases the test covers - A fleet that is not running does not activate anything, and the rollout does not claim *Ready* until it does. - An agent that restarts with an empty cache converges to the same state and writes nothing twice. - A change based on a stale generation (`metadata.generation`) is refused with `Aborted`, and the data plane is unchanged. - Stopping an environment (a rollout with no version) needs a maintainer, and the data plane stops serving it. Applying a version again serves it as a new generation. - After a rejection the same request can be made again and approved; a promotion that was already decided cannot be decided twice. ## Next steps - [Ship an agent from draft to production](/docs/operate/ship-an-agent/) - [Resource commands](/docs/reference/cli/resources/) # Agent API Source: https://robotelos.dev/docs/reference/agent-api/ {{% alert title="For agent authors" color="info" %}} This is the Go interface that an agent implements. A client never calls it. It is how the server asks an agent for replies. {{% /alert %}} The Agent API is a Go interface in `protocol/server` today. Its shape is stable within version 1; another language can implement the same behavior behind a gateway, as long as the turn semantics below hold. ## The port ```go type Agent interface { Reply(ctx context.Context, history []protocol.Event) (protocol.AgentTurn, error) Resume(ctx context.Context, history []protocol.Event, req protocol.ApprovalRequest, approved bool) (protocol.AgentTurn, error) } ``` - `Reply` is called when a message addresses the agent. `history` is the conversation's events so far. - `Resume` is called after an approval the agent requested has been answered. `approved` is the answer. ## The turn An agent returns an `AgentTurn`: | Field | Meaning | |---|---| | `Parts` | The reply: text, data, a URL or raw bytes | | `Approval` | An approval request, instead of or before a reply. The server opens an obligation. | | `Outcome` | `succeeded` or `failed`. The server records a `robotelos.outcome` event. | A turn either replies, asks for approval, or both. An agent MUST return an outcome when it finishes its work. ## How the server runs turns - A turn is **claimed** by one worker, which renews a **lease** while it works. The default lease is 30 seconds. - A turn whose worker stops renewing is claimed again by another worker, up to `MaxTurnAttempts` (default 3). After that the turn ends as a failed outcome. - A turn's events are committed in one transaction when it finishes. A turn that fails midway does not leave partial events. - The server cancels the context when the turn is abandoned. An agent MUST return promptly after cancellation. - Agent output is a proposal. The server validates it, applies the approval rules, and records it. ## What an agent must not do - An agent MUST NOT assume that a client is connected. Replies are recorded whether or not anyone is watching. - An agent MUST NOT keep customer data in memory across turns as the record. The journal is the record. - An agent MUST NOT execute an approval-gated operation before `Resume` reports an approval. The [Write an agent guide](/docs/build/write-an-agent/) and the [Server SDK example](/docs/build/examples/server-sdk/) show a complete agent. ## Next steps - [Write an agent](/docs/build/write-an-agent/) - [Specification](/docs/specification/) # Base protocol Source: https://robotelos.dev/docs/specification/base-protocol/ ## Encoding All messages are UTF-8 JSON objects. A server and a client MUST accept messages up to `max_message_bytes` (default 1 MiB) and MUST reject larger ones. Field names are snake_case. Messages are sent over one of the transports in [Transports](/docs/specification/transports/). The message layer is the same on each. ## Envelopes A message is exactly one of three envelopes. **Request** (client to server): ```json {"id": "1", "op": "subscribe", "body": {"conversation_id": "conv_…"}, "trace": {"traceparent": "…"}} ``` - `id` MUST be unique on the connection while the request is pending. - `op` MUST be one of the operations below. - `body` depends on the operation. - `trace` is OPTIONAL and carries W3C trace context for transports without headers. **Response** (server to client, answering a request with the same `id`): ```json {"id": "1", "ok": true, "result": {…}} {"id": "1", "ok": false, "error": {"code": "unknown_conversation", "message": "…"}} ``` **Push** (server to client, unsolicited): ```json {"push": "frames", "body": {…}} ``` A client MUST NOT answer a push. The server MUST NOT send a response with no request. ## Operations | Operation | Body | Result |---|---|---| | `initialize` | `protocol_versions`, `conversation_versions`, `client`, `capabilities` | `protocol_version`, `conversation_versions`, `server`, `principal`, `capabilities`, `agreed`, `downgrades` | `command` | a command ([Commands](/docs/specification/commands/)) | a receipt | `subscribe` | `conversation_id`, optional `cursor` | a snapshot, or an acknowledged resume with `cursor` | `read_after` | `conversation_id`, `cursor`, optional `limit` | `frames`, `cursor`, `up_to_date`, or `resnapshot_reason` | `get_receipt` | `command` (the same command, to compare its payload) | the stored receipt | `unsubscribe` | `conversation_id` | empty `unsubscribe` releases a subscription. It never cancels work that the server is doing for the conversation. A client MUST call `initialize` once per connection before any other operation. A server MUST reject other operations before `initialize` with `invalid_command`. ## Pushes | Push | Body | Meaning | |---|---|---| | `frames` | `conversation_id`, `frames`, optional `up_to_date` | One or more frames of one conversation, in cursor order | | `resnapshot_required` | `conversation_id`, `reason` | The stream cannot continue; subscribe again from a snapshot | ## Identifiers | Identifier | Scope | Format | |---|---|---| | Request `id` | one connection | a string chosen by the client | | `command_id` | one sender and one conversation | a string chosen by the client; `protocol.NewID` creates one | | Conversation, participant, event IDs | global | prefixed strings such as `conv_…`, `par_…`, `evt_…` | | Projection ID and epoch | one conversation | identify the journal a cursor belongs to | Clients MUST generate `command_id` values that are unique for their sender and conversation. They MAY reuse a `command_id` only to retry the same command. ## Limits The server advertises its limits in the `initialize` result. These are the version 1 defaults: | Limit | Default | Meaning | |---|---|---| | `max_message_bytes` | 1 MiB | Largest message on the wire | | `max_event_bytes` | 64 KiB | Largest event | | `max_parts` | 32 | Parts in one message | | `max_mentions` | 32 | Mentions in one message | | `max_relations` | 8 | Relations on one event | | `page_size` | 50 | Events per page of a timeline read | A server MUST refuse a command that exceeds a limit with `payload_too_large`. A client SHOULD read the limits from `initialize` rather than hard-code them. ## Errors An error has a `code`, an optional `message`, and optional `retryable` and `retry_after_ms` fields. The codes are listed in [Commands](/docs/specification/commands/#error-codes) and [Delivery](/docs/specification/delivery/#resnapshot). A client MUST NOT retry an error that is not `retryable` with the same request unless the cause has changed. ## Next steps - [Transports](/docs/specification/transports/) - [Commands](/docs/specification/commands/) # Commands and receipts Source: https://robotelos.dev/docs/concepts/commands-and-receipts/ Clients change a conversation by sending **commands**. A command is a request with an identity, a target and content. The server answers each command with a **receipt** that says what happened to it. ## Identity Each command carries a `command_id`, unique for its sender and conversation. The server also stores a digest of the command's canonical payload. - **Same ID, same payload:** a retry. The server returns the original receipt and does not apply the command again. Retrying is always safe, so clients can retry after a lost response. - **Same ID, different payload:** a conflict. The server refuses the second command with `CONFLICT`. The digest ignores formatting differences, so the same content always gives the same fingerprint. ## Receipts and dispositions A receipt names the disposition and, for accepted commands, the position of the events the command produced. | Disposition | Meaning | |---|---| | `ACCEPTED` | The command was applied. Its events are in the journal at the positions in the receipt. | | `REJECTED` | The command is invalid or not allowed. An error with a code explains why. | | `CONFLICT` | The `command_id` was used before with a different payload. | | `STALE` | The command targets a version that is no longer current, such as an answer to an obligation that has already been answered. | Receipts are stored with the events, so a receipt is available even after the client lost the response. Use `get_receipt` to fetch one by command ID. ## Writing a client that retries 1. Generate a new `command_id` for each new intent and keep it. 2. Send the command. If the connection drops before a response, send the same command again with the same ID and payload. 3. Wait for the event to come back through your subscription if you need to know it was applied. The Go client's `AwaitEcho` does this. The Go client's `client.Reliable` wrapper does step 2 with backoff and jitter. It never retries answers to obligations, because those are protected by their own version and digest checks ([Approvals](/docs/concepts/approvals/)). For several clients and several people in one conversation, read [Multiple clients](/docs/concepts/multi-client/) and [Groups and participants](/docs/concepts/groups/). Read the [reference for commands](/docs/reference/protocol/) for the fields of each command and the [protocol reference](/docs/reference/protocol/) for error codes. ## Next steps - [Approvals](/docs/concepts/approvals/) - [Specification: Commands](/docs/specification/commands/) # Contribute Source: https://robotelos.dev/docs/project/contributing/ Robotelos is open source under the Apache-2.0 license. You are welcome to report problems, suggest changes, and send code or documentation. ## Report a problem or ask a question Open an issue in the [Robotelos repository](https://github.com/robotelos/robotelos/issues). Include what you did, what you expected, and what happened. For a protocol question, name the message or command involved. ## Improve the documentation Every page on this site is a Markdown file in the repository. [Write documentation](/docs/project/docs-style-guide/) explains the page types, the front matter and the checks. A small change, such as a clearer sentence or a fixed example, is a good first contribution. The [contribution guide](https://github.com/robotelos/robotelos/blob/main/CONTRIBUTING.md) explains how to propose it. ## Contribute code The contribution guide describes the checks your change must pass and how to submit it. Keep changes small and focused on one topic. Start with an issue if the change is large, so the direction can be agreed first. ## Community standards Everyone in Robotelos's spaces follows the [Code of Conduct](https://github.com/robotelos/robotelos/blob/main/CODE_OF_CONDUCT.md). ## Who maintains Robotelos The people who review contributions and make decisions about direction are listed in [MAINTAINERS.md](https://github.com/robotelos/robotelos/blob/main/MAINTAINERS.md). ## Next steps - [Get help](/docs/troubleshooting/support/) - [Roadmap](/docs/project/roadmap/) # Get help Source: https://robotelos.dev/docs/troubleshooting/support/ ## Before you ask 1. Search [Troubleshooting](/docs/troubleshooting/common-problems/) and the [FAQ](/docs/troubleshooting/faq/). 2. Run `robotelos dev doctor` if the local instance misbehaves. It lists every problem at once. 3. Check [What you can do today](/docs/overview/status/). The feature may be experimental or planned. ## Ask a question or report a bug Open an issue in the [Robotelos repository](https://github.com/robotelos/robotelos/issues). Include: - what you did, what you expected and what happened; - the output of `robotelos dev doctor` for a local problem, or the gateway's startup error for a server problem; - the Robotelos version or commit, your operating system and the Go version; - for a protocol question, the message or command involved and the error code. Remove tokens, passwords and database URLs before you paste anything. ## Report a vulnerability Do not open a public issue. Contact a maintainer listed in [MAINTAINERS.md](https://github.com/robotelos/robotelos/blob/main/MAINTAINERS.md). The project does not yet publish a security policy. ## Improve the documentation Every page is a Markdown file in the repository, and each page has an edit link. See [Contribute](/docs/project/contributing/). ## Use the documentation with AI tools See [Use the docs with AI agents](/docs/troubleshooting/docs-for-ai-agents/). ## Next steps - [Contribute](/docs/project/contributing/) - [Common problems](/docs/troubleshooting/common-problems/) # Local stack and database Source: https://robotelos.dev/docs/reference/cli/local-stack-and-database/ ## Local stack: `dev` `robotelos dev` runs a complete instance on your machine for testing. It needs Docker. | Command | What it does | |---|---| | `robotelos dev doctor` | Checks Docker, the config file, the state folder and the ports. Lists every failure. Exit code 1 if anything fails. | | `robotelos dev up` | Starts PostgreSQL in Docker, applies the migrations and runs the gateway. Ctrl-C stops the gateway and keeps the database. | | `robotelos dev status` | Shows the state of the database container. | | `robotelos dev down` | Removes the database container. Add `--volumes` to delete its data too. | `dev up` accepts these flags: | Flag | Default | Meaning | |---|---|---| | `-http` | `127.0.0.1:8787` | HTTP address of the gateway (SSE and WebSocket) | | `-grpc` | `127.0.0.1:8788` | gRPC address; `off` disables it | | `-postgres-port` | `5433` | Host port for PostgreSQL | | `-context-name` | `dev` | Name of the context that `dev up` registers and makes current | The token for the local instance is written to `~/.robotelos/dev/token`. The generated secrets are kept in `~/.robotelos/dev/state.json`, readable by you only. ## Database: `db migrate` | Command | What it does | |---|---| | `robotelos db migrate status` | Lists each migration as applied, pending or changed. | | `robotelos db migrate up` | Applies the pending migrations. Refuses if an applied file has changed. | | `robotelos db migrate up --dry-run` | Runs the pending migrations in a transaction and rolls it back, so you can check them. | | `robotelos db migrate new NAME --dir CHAIN` | Creates an empty, timestamped migration file in the chain you name (`db/migrations`, `db/control/migrations` or `db/data/migrations`). | | `robotelos db rotate-epoch --yes` | After the control database was restored to an earlier point, starts a new epoch of its desired state, so that every fleet takes the snapshot it is given next whatever its revision. Reads `ROBOTELOS_DATABASE_URL`, the control database. | | `robotelos db migrate repair --status applied\|reverted --yes VERSION` | Fixes the version table after a manual change. Runs no SQL; refuses a changed file. | `up`, `status` and `--dry-run` read the database address from `ROBOTELOS_DATABASE_URL`. This keeps the password out of the command line. Use `--dir` or `ROBOTELOS_MIGRATIONS_DIR` to choose another migrations folder. ## Next steps - [Quickstart](/docs/getting-started/quickstart/) - [Database migrations](/docs/deploy/database-migrations/) # Production notes Source: https://robotelos.dev/docs/getting-started/production-notes/ The Quickstart gets an instance running on your machine. Before other people depend on one, work through this list. Each item says why it matters and where the details are. > **Pre-release software.** Robotelos is not yet a finished product. This page lists what to configure and what is still experimental. It is not a promise that an installation is ready for critical workloads. ## Database - **Use PostgreSQL 17**, the version the integration tests run against. The `robotelos dev` container uses 16 and is meant for development. - **Migrate as the database owner**, not as the gateway's roles. See [Database migrations](/docs/deploy/database-migrations/). - **Give the two roles real passwords.** The migrations create `robotelos_app` and `robotelos_worker` without one. - **Leave `ROBOTELOS_GATEWAY_ALLOW_UNSAFE_DATABASE_ROLE` at `false`.** The gateway refuses to start if its application role can bypass row level security, and that check is what keeps accounts apart. - **Never edit an applied migration.** The tool reports it as changed and refuses to continue. ## Access - **Put TLS in front of every binding.** The protocol does not encrypt, and the bearer token is otherwise visible on the wire. Use `https://` and `wss://` in discovery documents. See [Security](/docs/operate/security/). - **Use long random tokens**, mounted read-only, outside version control. The static token file suits development and small installations. - **Set `ROBOTELOS_GATEWAY_ALLOWED_ORIGINS`** to the origins of your web apps. Left empty, browsers' WebSocket connections from other origins are not allowed. - **Keep the limits on.** Connections, subscriptions and commands per principal have defaults. Change them with the [gateway configuration](/docs/reference/gateway-configuration/) rather than removing them. ## Running it - **Run more than one replica.** Replicas share the database and claim agent turns under a lease (`ROBOTELOS_GATEWAY_TURN_LEASE`, 30 seconds by default). A turn that fails three times ends as failed. - **Check `/healthz` and `/readyz`** from your load balancer or orchestrator. - **Send telemetry to a collector** with the standard `OTEL_*` variables. Nothing is sent unless you set them. See [Observability](/docs/operate/observability/). ## Releases - **Keep production gated.** Production only changes through an approved promotion, and a person cannot approve their own request. Raise `minApprovals` to 2 when one reviewer is not enough. See [Permissions](/docs/reference/permissions/). - **Turn on staging** with an `Environment` file so production only accepts a version that passed there. - **Roll out gradually** with a canary or blue/green rollout. See [Release a version gradually](/docs/operate/release-gradually/). ## Fleets and the edge - **Install the control plane and a fleet's data plane as two releases in two namespaces.** A fleet's cluster does not need the control plane. See the [installation chart notes](https://github.com/robotelos/robotelos/blob/main/deploy/helm/README.md). - **Treat the fleet credential as a secret.** It lives only in the fleet's cluster. The control plane stores its SHA-256 and nothing else. - **Turn on mutual TLS** when the link crosses a network you do not control. See [How fleet sync works](/docs/concepts/fleets/how-it-works/). - **Fleets run on Kubernetes only.** ## What is not ready | Area | State | |---|---| | Sign-in through your OIDC provider | Experimental. The static token file is the stable way in | | Goal orchestration, model access, fleet synchronisation, voice | Experimental | | Agent Substrate hosting | Not verified on a live cluster | | Serving released versions from the gateway | Planned | The full list is in [What you can do today](/docs/overview/status/) and the [Roadmap](/docs/project/roadmap/). ## Next steps - [Security](/docs/operate/security/) - [Troubleshooting](/docs/troubleshooting/common-problems/) - [Support](/docs/troubleshooting/support/) # Products and surfaces Source: https://robotelos.dev/docs/overview/surfaces/ Robotelos is one control plane that you can reach in several ways. It is built around **durable goals**, **tenant isolation** and **effects backed by evidence**, and it is not tied to a single chat interface. ## Choose a surface | Surface | Use it when | Where it runs | Start here | | --- | --- | --- | --- | | **Console** | You manage accounts, agents, catalogs, and settings in a browser | Your machine or cluster; talks to the gateway | [Quickstart](/docs/getting-started/quickstart/) | | **CLI** | You script or automate Control API operations from a terminal | Your CI or laptop | [CLI reference](/docs/reference/cli/) | | **MCP** | An IDE or tool host needs account-scoped MCP tools | MCP host → gateway | [Examples](/docs/build/examples/) | | **Control API SDK** | You embed admin/catalog calls in TypeScript | Your app → REST gateway | [Control API](/docs/reference/control-plane-api/) | | **Gateway & MCoP** | You build clients or agents on the conversation protocol | Gateway + execution hosts | [Client SDK example](/docs/build/examples/client-sdk/) | | **Fleet & operations** | You operate rollouts, telemetry, and execution placement | Kubernetes + substrate adapters | [Run the gateway](/docs/deploy/run-the-gateway/) | ## How the pieces fit together ```text Console / CLI / MCP / SDK Protocol clients (chat, voice, apps) \ / \ / v v REST Control API MCoP gateway \ / v v PostgreSQL (RLS) + durable engine + execution providers ``` - **Control API** owns accounts, agents, models, skills, releases, and policies. - **Gateway** owns conversations, deliveries, approvals, and multi-client state. - **Engine** owns run progression, operations ledger, and effect certainty. Read [Architecture](/docs/concepts/architecture/) for the full boundary map. ## What is not a separate product - **Harness:** the contract for execution runtimes. Its adapters live in the repository and are not sold separately. - **Agent SDK:** libraries for agent authors, shown in examples and guides as they stabilize. ## OpenHands comparison (intent only) OpenHands separates Canvas, Cloud, Enterprise, and a software agent SDK. Robotelos separates **who operates the control plane** (you, self-hosted today) from **how you connect** (console, CLI, MCP, SDK, protocol). A managed cloud console may come later; the open source path is self-host first. ## Next steps - [What is Robotelos?](/docs/overview/what-is-robotelos/) - [Quickstart](/docs/getting-started/quickstart/) # Release a version gradually Source: https://robotelos.dev/docs/operate/release-gradually/ By default a new version replaces the old one at once. When you want to see a version work on real conversations first, a rollout can say how the version should reach the environment instead. Two ways are available, and both need a stable version already serving: the new version is served next to it, and the stable one keeps serving everything else. > **Gradual releases are delivered, not yet used by the runtime.** You can apply a canary or blue/green, watch it move through its steps, approve it in production, and end it; every change is recorded. Each fleet receives both versions and the current split, activates them, and reports the split it applied, so `get rollout` shows what is *wanted* and, per fleet, what is *applied*. A fleet that cannot serve the new version keeps serving the stable one and is reported Degraded. The runtime library that chooses between the two when a conversation starts and runs the pinned release exists and is tested, but the engine does not use it yet, so conversations still run on the stable version until it does. ## Canary: a rising share {{< diagram name="canary-steps" caption="A canary serves a rising share of new conversations. The last step makes the candidate the stable version." >}} ```yaml apiVersion: robotelos.io/v1 kind: AgentRollout metadata: agent: support environment: dev spec: version: 2 # the new version: the candidate strategy: type: canary steps: - percent: 5 pause: 10m # wait this long before the next step; leave out to wait until you release it - percent: 25 - percent: 50 match: "robotelos.io/caller-class=internal" # optional: only these conversations ``` ```bash robotelos apply -f canary.yaml robotelos get rollout support/dev ``` ```text agentrollout/support/dev generation: 2 version: 1 strategy: canary candidate: version 2 serves 5% of conversations (step 1) ``` `version: 1` is what serves by default (the stable version); version 2 is the candidate. A conversation gets one or the other when it starts and keeps it for its whole life. The share is chosen by a fixed rule from the conversation, with nothing counted, so the same conversation always lands the same way and a rising percentage only adds conversations. Over many conversations the share is close to the number; for a handful it can be far off. Percentages rise strictly from 1 to 100, with at most 20 steps; a pause is up to a week. ### How a canary moves A step with a `pause` moves on by itself when the pause has run: the platform takes the next step and records it in the history (`get revisions`). A step without a pause waits for you: ```bash robotelos advance rollout support/dev ``` ```text agentrollout/support/dev generation 3: version 2 serves 25% of conversations (step 2) ``` After the last step has run its pause (or you advance it), version 2 becomes the stable version and the canary is over. `get rollout` shows `next step:` with the time a step is due. Pausing (`paused: true`) stops the clock; when you resume, the current step's pause starts again from zero. Steps are taken only as declared: in production, the approval of the promotion covers the steps and the final switch, so no second approval is asked. ## Blue/green: only test traffic ```yaml spec: version: 2 strategy: type: blueGreen match: "team=qa" ``` Version 2 serves every conversation that matches, and nobody else. The match is required: a blue/green with no match would be a release. ## What a match can look at Only what the server knows, never what a client claims. A client cannot set any of it, and a command that tries is rejected. | Attribute | Value | |---|---| | `robotelos.io/channel` | the transport the conversation was started over: `ws` (WebSocket), `sse` or `grpc` | | `robotelos.io/caller-class` | `gateway` when the user's own token came in `X-Auth-Identity` next to the gateway's credential, otherwise `direct` | | the claims you configure | the string claims of that verified token, named in `ROBOTELOS_GATEWAY_JWT_LABEL_CLAIMS` (for example `tier` or `team`). Claims that are not valid label values are ignored | The token is verified before anything is read from it, and it must belong to the same account as the credential. The values are written once, when the conversation starts, so the choice does not change during it. The syntax is the one of [label selectors](/docs/reference/cli/) (`key=value`, `key in (a,b)`, `!key`, joined by commas). ## Ending it | You want | Apply | |---|---| | Stop the experiment, keep the stable version | the stable version again (`version: 1`, no strategy). This is an *abort*. | | Make the candidate the stable version | the candidate with no strategy (`version: 2`). This is the *flip*. | | Change the steps or the match | the same version with the new strategy: a new generation. | | Try another version instead | the other version with a strategy: it replaces the candidate and starts again at step 1. | | Hold where you are | `paused: true` in the spec, and `paused: false` to go on. | Applying the same file twice changes nothing. ## In production A canary or blue/green in a gated environment such as `prod` goes through the same approval as any other change: applying it records a promotion that carries the strategy, and nothing changes until someone approves it. The approver sees which strategy they approve. Production needs a stable version first, because there must be something to run next to. Ending a candidate (applying the stable version again) needs no approval: it only reduces what is exposed to a version that was already approved. Making the candidate the stable version in production is a promotion like any other and needs an approval too. ## Next steps - [Ship an agent from draft to production](/docs/operate/ship-an-agent/) - [Permissions](/docs/reference/permissions/) # Server SDK Source: https://robotelos.dev/docs/build/examples/server-sdk/ This program uses the Go server SDK (`protocol/server` and `protocol/server/serve`). It registers two agents: the built-in deterministic `mock` agent and a small `echo` agent that you write. Clients from the [Client SDK example](/docs/build/examples/client-sdk/) or the [terminal chat](/docs/build/examples/cli/) can talk to either. ## The program Save it as `main.go` in a Go module that depends on `github.com/robotelos/robotelos`: ```go package main import ( "context" "encoding/json" "log" "os" "os/signal" "strings" "time" "github.com/robotelos/robotelos/protocol" "github.com/robotelos/robotelos/protocol/mockagent" "github.com/robotelos/robotelos/protocol/server" "github.com/robotelos/robotelos/protocol/server/serve" ) // echo replies with the text of the latest message. type echo struct{} func (echo) Reply(ctx context.Context, history []protocol.Event) (protocol.AgentTurn, error) { return protocol.AgentTurn{ Parts: []protocol.Part{protocol.TextPart("you said: " + lastText(history))}, Outcome: "succeeded", }, nil } func (echo) Resume(ctx context.Context, history []protocol.Event, req protocol.ApprovalRequest, approved bool) (protocol.AgentTurn, error) { if !approved { return protocol.AgentTurn{Parts: []protocol.Part{protocol.TextPart("Understood, I did not run it.")}}, nil } return protocol.AgentTurn{Parts: []protocol.Part{protocol.TextPart("Approved.")}}, nil } func lastText(history []protocol.Event) string { if len(history) == 0 { return "" } var mc protocol.MessageContent if err := json.Unmarshal(history[len(history)-1].Content, &mc); err != nil { return "" } var b strings.Builder for _, p := range mc.Parts { if p.Text != nil { b.WriteString(*p.Text) } } return b.String() } func main() { // 1. Register agents. "mock" is the built-in deterministic agent; // "echo" is the one written above. srv, err := server.New(server.Config{ Agents: []server.AgentSpec{ {ID: "mock", Version: "1", Display: "Mock", Agent: mockagent.Agent{Delay: 300 * time.Millisecond}}, {ID: "echo", Version: "1", Display: "Echo", Agent: echo{}}, }, }) if err != nil { log.Fatal(err) } defer srv.Close() // 2. Serve HTTP (SSE and WebSocket) and gRPC. Tokens map to principals. l, err := serve.Start(srv, serve.Config{ HTTPAddr: "127.0.0.1:8787", GRPCAddr: "127.0.0.1:8788", Tokens: map[string]server.Principal{ "demo-alice": {ID: "par_alice", Account: "acct_alice", Display: "Alice"}, "demo-bob": {ID: "par_bob", Account: "acct_bob", Display: "Bob"}, }, }) if err != nil { log.Fatal(err) } defer l.Close() log.Printf("sse: %s websocket: %s grpc: %s", l.SSEURL, l.WebSocketURL, l.GRPCAddr) // 3. Run until Ctrl-C. ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) defer stop() <-ctx.Done() } ``` ## Run it ```bash go mod tidy go run . ``` The server logs the three addresses it listens on: ```text sse: http://127.0.0.1:8787 websocket: ws://127.0.0.1:8787/v1/ws grpc: 127.0.0.1:8788 ``` Test the `echo` agent from the terminal chat. The chat client opens the `mock` agent by default, so pass the agent ID: ```bash go run ./protocol/cmd/robotelos-chat -transport sse -agent echo ``` ## What each part does | Part | Purpose | |---|---| | `Reply` | Called when a participant writes a message. Return the parts of the reply and an outcome. | | `Resume` | Called after an approval is answered. `approved` says which answer it was. | | `AgentTurn.Approval` | Set this instead of a reply when the agent needs approval. The server opens an obligation and calls `Resume` after the answer. The mock agent does this for `run `. | | `server.AgentSpec` | Registers the agent under an ID and version. Clients name the ID when they create a conversation. | | `server.Config` | Other fields: `Workers` (how many turns run at once; a negative number runs none, so the process only takes commands), `TurnLease` and `MaxTurnAttempts` (for crash recovery), and `Store` (a PostgreSQL store replaces the in-memory default). | | `serve.Start` | Listens on HTTP, WebSocket and gRPC. An empty `GRPCAddr` disables gRPC. | | `serve.Config.Tokens` | Maps bearer tokens to principals. Keep tokens secret and store them in configuration. | ## Rules for agents - Return from `Reply` promptly. Long work belongs behind an approval or an outcome, not in one blocking call. - Honor the context: the server cancels it when a turn is abandoned. - A disconnected client does not cancel the turn. The reply is in the journal, and the client reads it when it reconnects. - Keep no customer data in the agent's memory across turns. The journal is the record. The [Write an agent guide](/docs/build/write-an-agent/) explains the port in more detail. ## Next steps - [Write an agent](/docs/build/write-an-agent/) - [Client SDK example](/docs/build/examples/client-sdk/) # Watch and Observe Source: https://robotelos.dev/docs/concepts/fleets/streams/ ## Waiting without polling A trigger on `fleet_revisions` calls `pg_notify('robotelos_fleet_revision', ':')`. Each coordinator holds **one** LISTEN connection and wakes the fleets waiting on that revision. A waiter is registered before the database is read, so a change cannot slip between the read and the wait. A safety read every 15 seconds, and plain polling while the listener is down, cover a lost notification. ## FleetWatch A server stream. The agent sends the revision it has; the coordinator answers with a bookmark when something newer exists, and the agent then fetches the snapshot. Where a transport cannot stream, the agent falls back to a long poll. ## FleetObserve A bidirectional stream from the agent. The first message is a hello with an epoch; the agent then sends the full state of the world, followed by only the changes (upsert and delete) and heartbeats. Messages carry a sequence number; a new epoch replaces the previous set. A second stream for the same fleet supersedes the first, which ends with `FailedPrecondition`. The reports land in the existing status tables, so the console reads them as before. Without a stream the agent sends unary reports. ## Measured On a laptop, with PostgreSQL 17 in Docker (one run each, not a benchmark of a deployment): | | Before | After | |---|---|---| | Database transactions a second, 100 idle fleets | 501 | 0.6 | | Database transactions a second, 400 idle fleets | 2,001 | 0.6 | | Time for a change to reach waiting fleets | baseline | about three times faster | | Pool readiness reaching the control plane | a poll interval | milliseconds | They come from a laptop run with one database container, so read them as a comparison, not as capacity. ## Next steps - [Fleet events](/docs/concepts/fleets/events/) - [Transports](/docs/concepts/fleets/transports/) # Approvals Source: https://robotelos.dev/docs/concepts/approvals/ An agent sometimes needs permission before it acts. Robotelos records that need as an **obligation**: a state event in the conversation that names who may answer, what is being asked, and when the request expires. ## What an obligation contains | Field | Meaning | |---|---| | `kind` | `approval` | | `version` | Increases when the obligation changes; an answer must name the version it saw | | `status` | Open or answered | | `responders` | The participants allowed to answer: the owner of the agent | | `prompt` | Text shown to the responder | | `target` | The operation being approved: its `operation_ref` and `effective_digest` | | `expires_at` | After this time the obligation cannot be answered | ## The digest The approval is bound to a digest. `protocol.ApprovalDigest` is the SHA-256 of the capability ID, the contract version and the effective arguments of the operation. The environment is not part of the digest yet. The point is that a "yes" approves exactly the operation that was shown. If the agent later proposes different arguments, the digest changes, and an answer to the old digest does not apply. ## Answering A client answers with the `robotelos.answer_obligation` command. The server checks, in order: 1. the sender is one of the responders; 2. the obligation is open and the `expected_version` matches; 3. the obligation has not expired; 4. the `request_digest` equals the digest of the obligation. Results: - A valid first answer is accepted. It is the canonical answer, and the agent resumes with it. - A late or duplicate answer is `STALE`. Exactly one answer is canonical. - An answer after expiry is `REJECTED` with the reason `expired`. Clients take the version and the digest from the obligation in the view, not from the surface. Buttons on a surface carry only the obligation ID and the choice, never the digest. {{< diagram name="approval-flow" caption="The answer is checked against the obligation it was given for. Only the first valid answer is accepted." >}} ## Surfaces A surface is a rendered interface for the obligation. It uses the A2UI v1.0 message format (`createSurface`, `updateComponents`) and includes a plain-text fallback, so a client that cannot render A2UI can still show the question and answer it. ## Try it With the mock agent, send a message that starts with `run `: ```text run ls -la ``` The agent creates an approval obligation. Answer it from a client. The [Go client guide](/docs/build/go-client/) shows the calls. ## Next steps - [Specification: Approvals](/docs/specification/approvals/) - [Multiple clients](/docs/concepts/multi-client/) # Fleets and runtime pools Source: https://robotelos.dev/docs/reference/cli/fleets/ ## Fleets and runtime pools (platform administrators) | Command | What it does | |---|---| | `robotelos fleet create NAME --class nonprod\|prod` | Creates a fleet; prints its credential once | | `robotelos fleet list` | All fleets: connected or not, last seen, agent version, releases by phase and ready pools | | `robotelos fleet events FLEET` | Everything one fleet reported, including what concerns the fleet itself (its pools and its connections). Platform administrators only. | | `robotelos fleet rotate-credential FLEET` | Issues a new credential | | `robotelos fleet grant FLEET ACCOUNT`, `fleet revoke FLEET ACCOUNT` | Which accounts the fleet serves | | `robotelos pool put FLEET NAME -f pool.yaml` | Declares a shared runtime pool | | `robotelos pool get FLEET NAME`, `pool list FLEET`, `pool delete FLEET NAME` | Reads or removes pools | Every RPC of the `Accounts`, `Agents`, `Deployments`, `Promotions` and `Fleets` services has exactly one command; a test fails when one is missing. The RPCs are in the [Control Plane API](/docs/reference/control-plane-api/). ## Next steps - [Fleets](/docs/concepts/fleets/) - [Operate fleets](/docs/operate/operate-fleets/) # Gateway configuration Source: https://robotelos.dev/docs/reference/gateway-configuration/ The gateway is a role of the data plane server (`runtime/cmd/dataplane`). Set `ROBOTELOS_DATAPLANE_ROLES` to the roles a process runs: `gateway` serves the conversation protocol, `engine` advances accepted work, and `gateway,engine` runs both. Unset means `engine` alone. A role name that is misspelled, repeated or empty stops the process with exit code `2`. The gateway reads its configuration from the environment at startup and validates all of it before it starts. Problems are reported together, and the process exits with code `2`. | Variable | Default | Meaning | |---|---|---| | `ROBOTELOS_GATEWAY_DATABASE_URL` | required | PostgreSQL connection as `robotelos_app` | | `ROBOTELOS_GATEWAY_WORKER_DATABASE_URL` | required | PostgreSQL connection as `robotelos_worker` | | `ROBOTELOS_GATEWAY_TOKENS_FILE` | required | Path to the bearer-token file (JSON). Tokens must be at least 8 characters | | `ROBOTELOS_GATEWAY_HTTP_ADDR` | `:8787` | SSE, WebSocket, `/healthz` and `/readyz` | | `ROBOTELOS_GATEWAY_GRPC_ADDR` | `:8788` | gRPC listener; `off` disables it | | `ROBOTELOS_GATEWAY_ALLOWED_ORIGINS` | none | Comma separated origins whose web pages may open a WebSocket, for example `app.example.com,*.partner.test`. A `*` matches any characters except a slash, dots included. Empty allows only pages served from the gateway's own host. A bare `*` is refused at startup | | `ROBOTELOS_GATEWAY_MAX_CONNECTIONS_PER_PRINCIPAL` | `20` | Connections one principal may hold at once. The one over the limit is answered with `limit_exceeded` and closed. `off` removes the limit | | `ROBOTELOS_GATEWAY_MAX_SUBSCRIPTIONS_PER_CONNECTION` | `100` | Conversations one connection may follow. Subscribing again to one already followed does not count. `off` removes the limit | | `ROBOTELOS_GATEWAY_COMMAND_RATE` | `20` | Commands per second one principal may send over all its connections. Over the limit a command is answered with `rate_limited` and the wait. `off` removes the limit | | `ROBOTELOS_GATEWAY_COMMAND_BURST` | twice the rate | Commands a principal may send at once before the rate applies | | `ROBOTELOS_GATEWAY_WORKERS` | `8` | Concurrent agent turns per replica | | `ROBOTELOS_GATEWAY_TURN_LEASE` | `30s` | A turn not finished within this time is claimed again | | `ROBOTELOS_GATEWAY_MAX_TURN_ATTEMPTS` | `3` | After this many attempts the turn ends as failed | | `ROBOTELOS_GATEWAY_MAX_CONNS` | `20` | Connection pool size per role | | `ROBOTELOS_GATEWAY_MOCK_AGENT_DELAY` | `0` | Artificial reply delay of the mock agent | | `ROBOTELOS_GATEWAY_ALLOW_UNSAFE_DATABASE_ROLE` | `false` | Allows an application role that can bypass row level security. Only for local experiments | ## Startup checks - The application role cannot bypass row level security. - The schema is at least migration `20261113121000`, the newest migration the gateway needs. A database at an older version is refused with the reason. If either check fails, the gateway exits with the reason. ## Token file ```json {"tokens": {"a-long-random-secret": {"id": "par_alice", "account": "acct_1", "display": "Alice"}}} ``` Mount the file read-only and keep it out of version control. ## Next steps - [Run the gateway](/docs/deploy/run-the-gateway/) - [Production notes](/docs/getting-started/production-notes/) # License Source: https://robotelos.dev/docs/project/license/ Robotelos is licensed under the **Apache License, Version 2.0**. The full text is in the repository's `LICENSE` file, and third-party license texts are in `LICENSES/`. ## Copyright Source files are copyrighted by "Robotelos contributors" and carry an SPDX header. Files that cannot carry a header (module files, Markdown, YAML, JSON, TOML) are annotated in `REUSE.toml`, which follows the [REUSE](https://reuse.software/) specification. ## Contributions Contributions are made under the same license. Check upstream licenses before copying source or assets from another project. Agent Substrate and the other systems that inform the design are used as references; their code is not copied into Robotelos's domain model. ## Reporting a license problem If you find a file with missing or conflicting license metadata, open an issue in the [repository](https://github.com/robotelos/robotelos/issues). The project intends to stay under Apache-2.0 and does not change license metadata silently. ## Next steps - [Contribute](/docs/project/contributing/) # Operate fleets Source: https://robotelos.dev/docs/operate/operate-fleets/ A **fleet** is a cluster that runs agents. This guide is for platform administrators. If you only ship agents, you need [Ship an agent](/docs/operate/ship-an-agent/). ## How a cluster joins You create the fleet in Robotelos, then install the fleet agent in the cluster with the credential you get. The agent connects *out* to Robotelos, so you open no inbound path to the cluster. ```bash robotelos fleet create prod-eu --class prod # prints the credential once: store it as a secret robotelos fleet grant # which accounts this fleet serves ``` - `--class nonprod` serves `dev` and `stg`; `--class prod` serves `prod`. - The credential is shown **once** and is never stored by Robotelos. If you lose it, rotate it: `robotelos fleet rotate-credential `. - For stricter setups the agent can also present a certificate that names the fleet. See [Transports](/docs/concepts/fleets/transports/). In the cluster the agent needs the credential (as a file), the control plane address, a place to keep its cache, and where to write releases: a directory, or the fleet's own data database. Its settings are the `ROBOTELOS_FLEET_*` variables listed under [Transports](/docs/concepts/fleets/transports/). ## Shared runtime pools Agents do not get a server each. A **runtime pool** is a group of identical servers that many agents share. You declare the pool; the cluster's operator creates and scales it. ```bash robotelos pool put shared -f pool.yaml robotelos pool list robotelos pool get shared ``` Deploying a new agent version does not change Kubernetes at all: the pool keeps running and picks up the new release. ## Is the fleet up to date? ```bash robotelos fleet list ``` Each fleet shows the generation Robotelos wants and the one the fleet last reported. They are equal when the fleet is **in sync**. A fleet that falls behind keeps serving what it has; the gap tells you how long it has been out of reach or how far behind it is. ## If a network is difficult The agent prefers gRPC. Where a proxy breaks it, the agent falls back to WebSocket and then to plain HTTP with server-sent events, and returns to gRPC when it works again. You change nothing except giving the agent the HTTP address. Details: [Transports](/docs/concepts/fleets/transports/). ## Try it on your laptop You can run two clusters, one for non-production and one for production, and even break the network between them on purpose. See [Run it locally on Kubernetes](/docs/concepts/fleets/local-kubernetes/). ## Next steps - [Fleets](/docs/concepts/fleets/) - [Traces, metrics, logs and the audit trail](/docs/operate/observability/) # Run it locally on Kubernetes Source: https://robotelos.dev/docs/concepts/fleets/local-kubernetes/ You need Docker, `go`, `kind` and `kubectl`; chaos also needs `helm`. On macOS: `brew install kind kubectl helm`. Nothing is installed for you, and the script names a missing tool. ```bash make test-k8s-envtest # real kube-apiserver and etcd, no nodes (about 10 s) make test-k8s-e2e # create the two kind clusters if missing, run the kind tests make test-k8s-chaos # add Chaos Mesh to the nonprod cluster, run the chaos test make k8s-e2e-down # delete both clusters ``` | Command | What it does | Time on a laptop | |---|---|---| | `make k8s-e2e-up` | Creates `robotelos-nonprod` (dev, stg) and `robotelos-prod` (prod), builds and loads the images, installs the CRD, RBAC and operator. | about 1.5 min the first time, seconds after | | `make k8s-chaos-up` | The above plus Chaos Mesh 2.8.8 in `robotelos-nonprod`. | about 1 more minute | | `make test-k8s-e2e` | The dev-to-prod journey across the two clusters and the single-cluster tests. | about 2 min | | `make test-k8s-chaos` | Partition, delay, loss, agent pod kill, operator pod kill. | about 1 min | The control plane, PostgreSQL and the data databases run in the test process on the host. The tests accept only `kind-` contexts, and the script restores your current kubectl context after creating a cluster. ## Load and soak tests of the Platform API ```bash make test-load # 24 concurrent clients, p95 limit per endpoint, consistency afterwards make test-soak # moderate load for 40 s while connections are killed and the API restarts ``` Known finding: the overview endpoint is the slow one (p95 about 1.8 s at 140 agents) because the client makes one call per agent and environment. A server-side read model is planned. ## Chaos results | Fault | What held | Convergence afterwards | |---|---|---| | Partition agent to control plane, 20 s | the fleet kept serving its version; staleness was visible | 2.8 s | | 1 s delay with jitter and loss | still converged | 10.7 s | | Agent pod killed during a deployment | the replacement fetched everything | 0.4 s | | Operator pod killed during a pool change | the pool came up and reported in sync | within the test wait | ## Limits - The agent pod reaches the host as `host.docker.internal`, which Docker Desktop provides. Linux with Docker Engine needs a host-gateway mapping that is not set up. - Chaos Mesh is installed in the nonprod cluster only. - The kind and chaos suites are not run in CI yet. ## Next steps - [Operate fleets](/docs/operate/operate-fleets/) - [Production notes](/docs/getting-started/production-notes/) # Transports Source: https://robotelos.dev/docs/specification/transports/ MCoP defines one set of messages ([Base protocol](/docs/specification/base-protocol/)) and three bindings. Every binding MUST carry the same messages, in the same order, and pass the same conformance suite. ## Discovery A server MAY publish its transports at a well-known path. The document needs no authentication and holds no secret: ```http GET /.well-known/robotelos ``` ```json { "protocol_versions": ["1"], "transports": [ {"transport": "ws", "url": "ws://127.0.0.1:8787/v1/ws"}, {"transport": "sse", "url": "http://127.0.0.1:8787"}, {"transport": "grpc", "url": "127.0.0.1:8788"} ] } ``` A client that knows only the server's base address SHOULD read this document to find the other bindings. A server MAY also state what it is, with two optional fields. `environment` is one of `local`, `dev`, `stg` or `prod`. `effects_mode` is `sandbox` when the effects of its agents are simulated, or `real`. A server that leaves a field out does not state it. The protocol gives the absence no value; a client that must be careful, such as a test runner that could do harm to a real system, decides for itself how to treat an unstated target, and it is advised to treat it as production. ```json {"protocol_versions": ["1"], "transports": [], "environment": "stg", "effects_mode": "sandbox"} ``` ## Authentication Every binding authenticates the connection with a bearer token. The token is sent as: ```http Authorization: Bearer ``` A server MUST reject a connection without a valid token with `not_authenticated`. A server MUST NOT accept a token from a query string. ## HTTP with Server-Sent Events | Path | Method | Purpose | |---|---|---| | `/v1/rpc` | `POST` | One request, one response. The body is a request envelope; the response body is a response envelope. | | `/v1/stream` | `GET` | A long-lived SSE stream of pushes for the connection | The client sends requests on `POST /v1/rpc` and reads pushes from `GET /v1/stream`. Both carry the same bearer token. The stream rotates periodically, so clients MUST handle a reconnect by subscribing again from their cursor. The SSE stream does not use `Last-Event-ID`; the cursor in `subscribe` is the resume mechanism on every binding. ## WebSocket | Path | Purpose | |---|---| | `/v1/ws` | A single WebSocket connection carrying requests, responses and pushes | Each WebSocket text frame carries exactly one message. A server MUST NOT split a message across frames or pack several into one. ## gRPC The service is `robotelos.protocol.v1.Conversation`. It has one bidirectional stream, and each message on the stream is one MCoP message encoded as raw JSON bytes. There is no IDL for the messages: the JSON schema in [Schema](/docs/specification/schema/) is the contract. A server MUST close the stream when the connection ends. ## Health | Path | Meaning | |---|---| | `GET /healthz` | The process is alive. Always `200` while serving. | | `GET /readyz` | The server can take traffic. `503` with the reason when it cannot. | These paths are not part of the protocol. They are for orchestrators. ## Disconnects A disconnect ends the connection's subscriptions. It cancels no work: an agent turn that is running continues, and its events are recorded for every client that follows the conversation. A client that reconnects MUST `initialize` again and subscribe from its cursor. ## Next steps - [Delivery](/docs/specification/delivery/) - [Security](/docs/specification/security/) # Use the docs with AI agents Source: https://robotelos.dev/docs/troubleshooting/docs-for-ai-agents/ The documentation is also published as plain text for AI tools. There are two files at the root of the site. | File | What it holds | Use it when | |---|---|---| | [`/llms.txt`](/llms.txt) | One line per documentation page: title, link and description | The tool can follow links and fetch only the pages it needs | | [`/llms-full.txt`](/llms-full.txt) | The full Markdown of every documentation page | You want to put everything in one prompt or index | Both files cover the pages under `/docs/` and are generated on every build, so they match the site. ## Tips - Start with `llms.txt`. The descriptions say what each page is for, so a tool can choose. - Point a tool at [Specification](/docs/specification/) when it must implement the protocol. That section is normative and the rest is not. - `llms-full.txt` is large. Prefer it for indexing, and `llms.txt` for answering a single question. - A page's status matters. [What you can do today](/docs/overview/status/) says which features are available, experimental or planned, so tell the tool not to assume a planned feature exists. The repository's `AGENTS.md` gives coding agents the rules for changing the code itself. ## Next steps - [Specification](/docs/specification/) - [Reference](/docs/reference/) # What you can do today Source: https://robotelos.dev/docs/overview/status/ Robotelos gives you a working platform today. Here is what you can do with it. ## Conversations with people and agents - Start a **direct conversation** with an agent, or a **group conversation** with several people and agents. - Give people the right role in a group: owner, member, guest or observer. - Mention an agent in a group, and it answers your message. ## Any client, any device - Connect over HTTP with Server-Sent Events, WebSocket or gRPC. The same messages work on each. - Follow one conversation from a laptop, a phone and a terminal at the same time. Each device picks up where it stopped. ## Approvals you can trust - An agent can ask for permission before it acts. - Your answer applies to exactly the details you were shown, and only the first valid answer counts. ## Work that survives restarts - The gateway stores conversations in PostgreSQL. - Several gateway replicas share the same database and the same work. - Agent turns continue after a restart. ## Building with Robotelos - A Go library for clients, with examples. - A Go library for serving your own agents, next to the built-in one. - A command-line tool to check your machine, run a complete local instance, and manage the database. ## Practical notes - The built-in agent is a deterministic mock. It is ideal for trying things out, and it shows approvals in action. Serve your own agent with the Server SDK when you need real behaviour. - Access tokens are kept in a file you control. Use long, random values. - To invite someone to a group, share the conversation's ID with them. They accept the invitation from their own device. For what is planned next, see the [Roadmap](/docs/project/roadmap/). Start with the [Quickstart](/docs/getting-started/quickstart/), or read the [Specification](/docs/specification/) for the exact behaviour of every feature. ## Next steps - [Roadmap](/docs/project/roadmap/) - [Quickstart](/docs/getting-started/quickstart/) # Deployments Source: https://robotelos.dev/docs/concepts/fleets/deployments/ The word *deployment* has two meanings in Robotelos. This page covers both. ## 1. A deployment of an agent version A deployment puts one **published agent version** into one **environment** (`dev`, `stg` or `prod`). {{< diagram name="deployment-flow" caption="A deployment is recorded in the control plane and pulled by each cluster's fleet agent." >}} 1. **Record.** The console or the Platform API writes the deployment to the control plane's PostgreSQL. The deployment gets the next *generation* number, so two deployments to one environment are always ordered. This record is the desired state. 2. **Pull.** The fleet for that environment's class sees its revision change and the agent pulls a snapshot. The control plane never connects into a cluster. 3. **Apply.** The agent compiles the release into the fleet's own data database. `compiled_releases` is append-only; `serving_releases` only moves forward. Pool intent is projected to `AgentRuntimePool` resources, which the runtime operator turns into a Deployment, Service and autoscaler. 4. **Report.** The agent reports the generation it applied and the readiness of each pool. The console's Management view shows desired state next to this report, so a fleet that is behind or silent is visible. ### Environments and fleets | Environment | Served by | Cluster in the local setup | |---|---|---| | `dev`, `stg` | the non-production fleet class | `robotelos-nonprod` | | `prod` | the production fleet class | `robotelos-prod` | Promoting a version means deploying it to the next environment. Each fleet converges on its own, with its own data database, so a slow or partitioned production cluster never blocks development. ### What is guaranteed - Generations are never missing or doubled; the active version is the newest generation (checked under load by `make test-load`). - A fleet that loses the network keeps serving its current release. When the network returns it converges (2.8 s after a 20 s partition in the chaos test). - A replacement agent with no cache fetches everything and converges (0.4 s in the chaos test). {{< diagram name="fleet-sync-loop" caption="The fleet sync loop: notify, watch, pull, apply and observe." >}} ## 2. How the control plane is deployed Robotelos runs as two servers. {{< diagram name="server-roles" caption="The control plane and data plane servers, with the roles each runs." >}} | Server | Roles | Holds | |---|---|---| | Control plane (`runtime/cmd/controlplane`) | `accounts`, `executions`, `fleets` | Definitions, versions, deployments, policy, identity, fleet snapshots | | Data plane (`runtime/cmd/dataplane`) | `gateway`, `engine` | Client connections, conversations, execution progress | Both ship as **one binary with roles**. For development, run every role in one process against one database. In production, run a Kubernetes Deployment per role from the same image, so the `gateway` scales with open connections and the `engine` with active executions. Split a role into its own Deployment only when one of these is true: it scales differently, it holds different credentials, it fails independently, or it releases on its own cadence. Do not split in advance. The `fleets` role is the coordinator the fleet agents talk to. Its gRPC port (`ROBOTELOS_FLEET_GRPC_ADDR`) and its HTTP port for the WebSocket and SSE fallbacks (`ROBOTELOS_FLEET_HTTP_ADDR`) are separate from the management API, so they can sit behind different network rules. See [Transports](/docs/concepts/fleets/transports/). ## Next steps - [Operate fleets](/docs/operate/operate-fleets/) - [Fleet events](/docs/concepts/fleets/events/) # Multiple clients Source: https://robotelos.dev/docs/concepts/multi-client/ {{< gopher pose="juggle" >}} A person rarely uses one device. The same user may read a conversation on a laptop, answer an approval on a phone, and have a terminal open on a server. Robotelos is built so that every one of those clients sees the same conversation, in the same order, and no client can make another one wrong. ## Four things, not one Most confusion comes from mixing these up: | Concept | What it is | Lifetime | |---|---|---| | **Principal** | An authenticated identity, from a bearer token (for example `par_alice`). | As long as the token is valid. | | **Participant** | A principal's role in a conversation: owner, member, guest or observer. An agent is a participant too. | As long as it is a member of the conversation. | | **Connection** (session) | One transport link from one client: a WebSocket, an SSE stream or a gRPC stream. | From `dial` until the link closes. | | **Subscription** | A connection's request to follow one conversation from a cursor. | Until the client unsubscribes, the connection closes, or the server asks for a new snapshot. | A principal can hold several connections at once, one per device or process. Each connection has its own subscriptions. Identity belongs to the principal, not to the device. ## The journal is the only source of truth Every change to a conversation is written once, as an event with the next position in the journal. The server does not keep a per-client copy of the conversation. Each client keeps a **view**: the conversation reduced from the events it has seen. This has three consequences: - Two clients that have seen the same positions have the same view, byte for byte. - A client that was offline does not need a special sync protocol. It asks for the events after its cursor. - Nothing a client does can fork the history. A client can only propose a command; the server decides what is accepted, and the decision is an event. ## What a command does across clients 1. A client sends a command with a `command_id` it generated. The server validates it against the conversation's current state. 2. If the command is accepted, the server appends its events in one transaction and returns a **receipt** to the connection that sent the command. The receipt names the positions of the events. 3. Every subscription on that conversation receives those events as frames, in journal order. This includes the sender's own other connections. 4. A command that the server has already applied is not applied again. Sending it again returns the original receipt. This is what makes retries safe across a flaky network, and it is also what makes two clients racing on the same command harmless. A client never has to guess whether its own command landed: the receipt says so, and the frame that follows confirms it for the other clients. {{< diagram name="fanout" caption="The phone sends a command; the laptop sees its effects. Receipts go to the sender; events go to everyone subscribed." >}} ## Approvals from another device Approvals are the case where more than one client matters most. An agent asks for permission; the owner may answer from any device. - The obligation is an event. Every subscribed client sees it as an open obligation with a version and a digest. - Any connection of a responder can answer. The answer names the version and the digest that the answering client saw. - The server checks the responder, the version, the digest and the expiry, then records the answer once. - Other clients receive the answered obligation as a frame. A late answer from a second device is refused as `STALE`, and nothing changes. So a phone that answers first is the answer. A laptop that tries a moment later gets `STALE`, and its view updates to show the answer that was recorded. See [Approvals](/docs/concepts/approvals/) for the checks. ## Staying correct while offline Each client keeps a cursor: the position of the last event it applied. On reconnect it does one of three things: | Situation | What the client does | What the server does | |---|---|---| | The cursor is still in the journal | `read_after` the cursor, or `subscribe` from it | Sends the missing frames, then `up_to_date` | | The cursor is too old to serve | Subscribes again from a snapshot | Sends `resnapshot_required`, then a snapshot | | The client fell behind while reading | The SDK's bounded queue reports `ErrSlowConsumer`; the client resumes from its checkpoint | Keeps the events; nothing is lost | The Go SDK does this for you in `client.Follow`. You never need to deduplicate frames by hand: the cursor makes every frame idempotent. ## Rules a client must follow - **Generate one `command_id` per intent and keep it.** Retry with the same ID and the same payload only. - **Never apply a frame out of order.** The SDK refuses a gap; if you bypass it, you will see `ErrGap`. - **Render from the view, not from your own optimistic copy.** Show your own message as pending until its event returns. - **Treat a removed membership as an ended stream.** A removed participant receives `resnapshot_required`, and a new subscribe says the conversation is unknown. ## What is built and what is not For how members and agents are added and removed, read [Groups and participants](/docs/concepts/groups/). ## Next steps - [Groups and participants](/docs/concepts/groups/) - [Specification: Delivery](/docs/specification/delivery/) # Traces, metrics, logs and the audit trail Source: https://robotelos.dev/docs/operate/observability/ Robotelos reports with **OpenTelemetry**, from the control plane, the data plane and each fleet agent. Nothing leaves a process unless you configure it, and every process is configured the same way, with the standard `OTEL_*` variables. ## Turn it on ```bash export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector.example.com:4318 export OTEL_SERVICE_NAME=robotelos-controlplane # each process has a sensible default export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=prod ``` | Variable | Effect | |---|---| | `OTEL_EXPORTER_OTLP_ENDPOINT` (and `_PROTOCOL`, `_HEADERS`) | Sends traces, metrics and logs to a collector | | `OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER` | `otlp`, `console`, `none` (metrics also `prometheus`) per signal | | `OTEL_TRACES_SAMPLER`, `OTEL_TRACES_SAMPLER_ARG` | Sampling, for example `parentbased_traceidratio` and `0.1` | | `OTEL_SDK_DISABLED=true` | Installs nothing | With nothing set, logs go to standard output (the fleet agent: standard error) as JSON, and no traces or metrics are produced. The processes are `robotelos-controlplane`, `robotelos-dataplane` and `robotelos-fleet-agent`. ## Following a command from your pipeline The `robotelos` command is part of the trace. When your pipeline already has a trace, pass it on in `TRACEPARENT` (the W3C trace context that most CI systems and agents set), and every call the command makes to the Control API, and the database work behind it, joins that trace: ```bash export TRACEPARENT=00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01 export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector.example.com:4318 robotelos apply -f rollout-prod.yaml ``` The command reports its own span, named `robotelos apply`, as a child of the trace you passed in, with the command word and nothing else (no file names, agent names or ids). It flushes before it exits. Without `OTEL_*` variables it sends nothing, but it still passes `TRACEPARENT` on to the server, so the server's spans and the audit entries belong to your trace. With `OTEL_TRACES_EXPORTER=console` the command prints its span to standard output, which is handy for trying it out. ## What you get **Traces.** Every call to the Control API is a span, named by its method (`robotelos.controlplane.v1.AgentRollouts/ApplyAgentRollout`), and it continues the caller's trace when the caller sends a W3C `traceparent`. Inside it: | Span | Attributes | |---|---| | `robotelos.rollout.apply` | agent id, environment, version, resulting generation, outcome (`changed`, `unchanged`, `pending_promotion`) | | `robotelos.promotion.request`, `.approve`, `.reject`, `.cancel` | promotion id, agent id, environment | | `robotelos.fleet.reconcile` (fleet agent) | snapshot revision, number of items, outcome | | `robotelos.fleet.apply` (fleet agent) | agent id, environment, generation, resulting phase; an error status when a release could not be activated | The fleet agent's calls to the coordinator carry the trace, so one pass of an agent, the coordinator's work and its database queries are **one trace** across the network. A caller's mistake (not found, forbidden, a stale generation) is an attribute of the span, not an error status; only internal failures mark a span as failed. **Metrics** (small, fixed attribute sets; never an account, agent or user id): | Metric | Attributes | |---|---| | `robotelos.rollouts.applied` | `robotelos.environment`, `robotelos.outcome` | | `robotelos.promotions` | `robotelos.environment`, `robotelos.outcome` (`requested`, `approved`, `rejected`, `cancelled`, `superseded`) | | `robotelos.fleet.reconciles`, `robotelos.fleet.reconcile.duration` | `robotelos.outcome` (`ok`, `error`) | | `robotelos.fleet.releases.applied` | `robotelos.environment`, `robotelos.phase` (`Ready`, `Applied`, `Degraded`, `Blocked`) | | `rpc.server.*`, `rpc.client.*` | gRPC call counts, sizes and durations of the Control API and the coordinator | **Logs** are JSON, and when exported they carry the trace and span ids of the request that wrote them, so a log line and its trace meet. ## Who changed what Every change of desired state writes an **audit entry** in the same database transaction as the change: who, what, when, and the **trace id** of the request. A rollout also keeps its own history: ```bash robotelos get revisions support/prod # every generation, newest first, with the promotion behind it robotelos get promotion # who asked, what exactly was approved (the digest), the outcome ``` To follow a change from the command to the cluster: 1. `robotelos get revisions support/prod` shows the generation and the promotion. 2. The audit entry for that change names the trace id; open it in your trace backend. 3. `robotelos get rollout support/prod` shows, per fleet, the generation the fleet confirmed and its phase, and the `robotelos.fleet.apply` span of that fleet shows when it activated the release. 4. The release digest in all of these is the same value; it is also the identity of the release that conversations run on. ## Reading the audit trail Owners and maintainers (the permission `audit.read`) read the trail with `robotelos get audit`: ```bash robotelos get audit support # one agent: its own entries and the promotions that name it robotelos get audit # the whole account, newest first robotelos get audit support -o json # the same, for a script ``` ```text TIME ACTOR ACTION RESOURCE TRACE 2026-11-18T10:42:07Z 9c1e5d02 promotion.approve promotion/3f2a91c0 4bf92f3577b3 2026-11-18T10:41:30Z 7b0aa310 promotion.request promotion/3f2a91c0 4bf92f3577b3 2026-11-18T10:40:12Z 7b0aa310 deployment.deploy agent/a1fd4ece 91ab03de7710 ``` Each line is one change: when, who (the user id), what, which resource, and the trace of the request. The actions are `agent.create`, `agent.draft.update`, `agent.version.create`, `agent.version.preview`, `deployment.deploy`, `deployment.promotion`, `deployment.rollback`, `deployment.revoke`, `evaluation.record`, `promotion.request`, `promotion.approve`, `promotion.reject`, `promotion.cancel`, `promotion.supersede`, `environment.enable` and `environment.promotion_policy`. The same list is available from `GET /api/v1/accounts/{account_id}/audit-events` with filters for the agent, the action prefix and the actor. The trail is append-only, and it only shows your own account. Actions of the platform administrators on fleets are recorded too, but belong to the platform and not to an account, so they do not appear in an account's trail. ## What a sampled-out trace still gives you The audit entry, the revision history and the metrics do not depend on sampling. The trace id is recorded only when the request was part of a trace. ## Next steps - [Security](/docs/operate/security/) - [Operate fleets](/docs/operate/operate-fleets/) # Permissions: who can do what Source: https://robotelos.dev/docs/reference/permissions/ Everything you do in an account is checked against your **role** in it. A role holds a set of named **permissions**; an operation needs one permission, and is refused when your role does not hold it. The refusal says which role you have and which permission was missing. ## What each role may do | Permission | What it allows | owner | maintainer | developer | reporter | operator | |---|---|:-:|:-:|:-:|:-:|:-:| | `agents.read` | read agents, drafts, versions and releases | yes | yes | yes | yes | yes | | `deployments.read` | read environments, rollouts and their history | yes | yes | yes | yes | yes | | `promotions.read` | read promotions | yes | yes | yes | yes | yes | | `agents.create` | create an agent | yes | yes | yes | | | | `agents.update` | edit a draft; build a preview version of it | yes | yes | yes | | | | `versions.publish` | publish a version | yes | yes | yes | | | | `agents.deploy` | apply a rollout to dev or staging; ask for production | yes | yes | yes | | | | `evaluations.record` | record the evidence a promotion relies on | yes | yes | yes | | | | `promotions.request` | ask for a promotion, and withdraw your own | yes | yes | yes | | | | `promotions.review` | **approve or reject** a promotion | yes | yes | | | | | `deployments.manage` | stop an environment serving an agent | yes | yes | | | | | `environments.manage` | turn staging on or off; change who approves promotions into an environment | yes | yes | | | | | `audit.read` | read the audit trail | yes | yes | | | | Three rules sit on top of the table: - Nobody may approve a promotion they requested themselves. - Production is only ever changed through an approved promotion. - **An environment can be stricter than the role.** Holding `promotions.review` is necessary, but the environment also names the roles whose members may decide, and how many approvals it needs (see below). ## Who approves promotions into an environment Each environment, `stg` and `prod`, carries a promotion policy. Production is gated by default; the others are not. | Setting | Meaning | Default for `prod` | |---|---|---| | `requireEvaluation` | a passing evaluation of the release in the previous environment is needed | yes | | `requireApproval` | a promotion waits for people to approve it | yes | | `approvers` | the roles whose members may approve or reject | `owner`, `maintainer` | | `minApprovals` | how many different people must approve (1 to 5) | 1 | | `progressDeadline` | how long a deployment may stay Degraded before it fails, for example `5m` (`0s` fails at once, at most `24h`). Within it a Degraded report is a condition, not an outcome, so one failed probe does not fail a production promotion for good | `5m` | A person with `environments.manage` changes it with an `Environment` file: ```yaml apiVersion: robotelos.io/v1 kind: Environment metadata: name: prod spec: promotion: requireEvaluation: true requireApproval: true approvers: [owner, maintainer] minApprovals: 2 ``` With two approvals, the first one is recorded and the promotion keeps waiting (`awaiting_approval (1 of 2 approvals)`); production changes only when a second, different person approves. One rejection ends a waiting promotion. If you change the policy while a promotion waits, it is decided under the new policy. Every change of policy is in the audit trail. ## Ask before you try ```bash robotelos can-i promotions.review # yes, or: no: your role (developer) does not hold promotions.review robotelos can-i # your role and everything it may do robotelos can-i agents.deploy -o json ``` `can-i` exits with an error for "no", so a pipeline can stop early: ```bash robotelos can-i agents.deploy && robotelos apply -f rollout-dev.yaml ``` The same answer is available to the console and to your own tools as `GET /api/v1/accounts/{account_id}/permissions`. ## Changing what a role may do What a role may do is data, not code: it is the `role_permissions` table of the control plane's database, and a change takes effect at once for everyone with that role. Today that table is changed by whoever operates the database. Letting an account owner grant permissions to roles in their own account, and naming the approvers of an environment, are designed but not built yet. ## Next steps - [Security](/docs/operate/security/) - [Resource commands](/docs/reference/cli/resources/) # robotelos-chat and gateway Source: https://robotelos.dev/docs/reference/cli/chat-and-gateway/ ## robotelos-chat A terminal client that opens a conversation with an agent and prints what happens. | Flag | Default | Meaning | |---|---|---| | `-transport` | `sse` | `sse`, `ws` or `grpc` | | `-url` | per transport | Server address. Defaults: `http://127.0.0.1:8787` for SSE, `ws://127.0.0.1:8787/v1/ws` for WebSocket, `127.0.0.1:8788` for gRPC | | `-token` | `ROBOTELOS_TOKEN`, then `~/.robotelos/dev/token` | Bearer token | | `-agent` | `mock` | Agent to talk to | Type a message and the agent answers. A message that starts with `run ` makes the mock agent ask for approval before it runs the command. ## gateway The gateway runs the conversation protocol on PostgreSQL. It takes no flags; it reads its settings from `ROBOTELOS_GATEWAY_*` variables. The list is in the [gateway configuration reference](/docs/reference/gateway-configuration/). It writes its log as JSON. It exits with code 2 when the configuration is wrong, and with code 1 if it stops with an error. ## Next steps - [Chat from a terminal](/docs/build/examples/cli/) - [Gateway configuration](/docs/reference/gateway-configuration/) # Schema Source: https://robotelos.dev/docs/specification/schema/ {{% alert title="For adapter authors" color="info" %}} The JSON Schema is the machine-readable form of this specification. Use it to generate types and validators in your language, or to check the messages your client sends and receives. {{% /alert %}} The schema describes the shape of every message: which fields exist, their types, and which fields are required. It does not describe the rules, such as the order of events or how a digest is computed. Those are in the other pages of this specification. ## How to use it - **Download** the file and load it into any JSON Schema validator. The document uses draft 2020-12. - **Generate** types from it in your language. - **Check** your own messages against the envelopes and the definitions. A message that is valid here will be accepted by the server. Unknown fields must be ignored by readers. The schema therefore does not forbid extra fields, so newer servers can add optional fields without breaking your client. ## The schema {{< jsonschema >}} ## Next steps - [Base protocol](/docs/specification/base-protocol/) - [Conformance](/docs/specification/conformance/) # Write documentation Source: https://robotelos.dev/docs/project/docs-style-guide/ The documentation lives in `site/content/docs` as Markdown, and Hugo builds it. This page tells you where a new page goes, what it must contain, and which checks it must pass. ## Choose the page type Each page does one job. Pick the type first, then use its archetype. | Type | The reader wants to | Archetype | Lives in | |---|---|---|---| | **Tutorial** | reach a result by following steps | `tutorial` | Getting started, Build | | **Guide** | do one task | `guide` | Build, Deploy, Operate | | **Concept** | understand an idea | `concept` | Concepts | | **Reference** | look up an exact fact | `reference` | Reference, Specification | Create a page from the repository root: ```bash cd site hugo new content docs/operate/rotate-tokens.md --kind guide ``` The sections follow the reader's journey: Overview, Getting started, Build, Deploy, Operate, Concepts, Reference, Specification, Troubleshooting and support, and Project. If a page fits two sections, put it where the reader needs it first and link it from the other. ## Front matter Every page has these keys: ```yaml --- title: "Release a version gradually" description: "Roll a new version out to a share of traffic, watch it, and advance or roll back." weight: 3 --- ``` - **`title`** names the topic or the task. It is unique among its siblings. - **`description`** is one line of at most 220 characters. It shows on cards, in search results and in `llms.txt`, so it must make sense alone. A guide starts with a verb. A reference page says which facts it lists. - **`linkTitle`** is the label in the sidebar and the breadcrumb. Keep it to about 30 characters (two to four words); the lint fails above that. `title` stays the full heading, for example `title: "Ship an agent from draft to production"` with `linkTitle: "Ship an agent"`. - **`weight`** orders the sidebar. Siblings in one folder never share a weight. - **`aliases`** lists every URL a page used to have. When you move or rename a page, add the old URL here and add it to `site/scripts/data/docs-legacy-urls.json`. Never delete an entry from that file. - **`maturity`** is optional. Set it to a key of `site/data/maturity.yaml` (for example `fleet-sync`) and the page shows an Available, Experimental or Planned badge under its title, from the same source as the marketing pages. Use it on a page that describes a feature that is not fully available. - **`no_list: true`** on a section index hides the automatic card list, when the page body already lists its children. **`hide_summary: true`** keeps one page out of that list. ## Write the page - Start with what the page is for, in one or two sentences, before any detail. - Use sentence case headings and short sentences. Write "you" for the reader. - End every page with a `## Next steps` section of two or three links. Section indexes are exempt. - Say what is true now. If a feature is experimental, planned or untested on a live system, say so in the text and set `maturity`. - Never put a real token, password or key in an example. Use obviously fake values. - Keep rules in one place. The [Specification](/docs/specification/) is normative. Concept and guide pages explain and link to it. They do not restate its rules. ## Diagrams Diagrams use the diagram-design profile in `site/diagram-design/robotelos-profile.md`: dark paper, hairline nodes, orthogonal arrows, nine nodes at most and one accent node where the reader should look. Insert one with the `diagram` shortcode and a caption that says what to notice: ```text {{}} ``` The name is a file in `site/layouts/_partials/diagrams/`. Most of them are written by `site/scripts/build-docs-diagrams.py`. Add or change a diagram there and run `python3 scripts/build-docs-diagrams.py`, which stops when a label does not fit its node. Do not add a screenshot or a raster image of a diagram. On a narrow screen the figure scrolls sideways instead of shrinking the labels. ## Links Link to other documentation pages with a site-absolute path that ends in a slash, for example `/docs/operate/observability/`. Hugo adds the base URL. Link to a heading with its anchor, `/docs/reference/permissions/#who-approves-promotions-into-an-environment`. Entries in `site/data/*.yaml` leave out the leading slash. ## Checks Run these from `site/` before you open a pull request: ```bash node scripts/docs-lint.mjs # structure of the sources hugo --environment production -d /tmp/docs-build # build node scripts/docs-redirect-check.mjs /tmp/docs-build # every old URL still resolves node scripts/link-check.mjs /tmp/docs-build # no broken link or anchor BASE_URL=http://127.0.0.1:1313 node scripts/diagram-check.mjs # with `hugo server` running: no clipped or dangling diagram ``` The diagram check opens every diagram in a browser. It fails when a drawing leaves its frame, when the paper does not cover the frame, or when an arrow starts or ends away from a node. `make docs` from the repository root runs the lint and builds the site into `site/public`. The lint fails when a page lacks a title or description, repeats a weight or title among its siblings, has no link pointing to it, does not end with `Next steps`, uses an unknown `maturity` key, has a sidebar label over 30 characters, or claims an alias that is another page's URL. ## Next steps - [Contribute](/docs/project/contributing/) - [Get help](/docs/troubleshooting/support/) # Data model Source: https://robotelos.dev/docs/specification/data-model/ {{% alert title="For adapter authors" color="info" %}} Everything a client shows comes from two kinds of event: **timeline** events, which are kept in order, and **state** events, which describe the current value of something. Read the two sections below before you write a client. {{% /alert %}} ## Conversations A conversation has a **kind**: | Kind | Participants | Agents answer | |---|---|---| | `direct` | One person and the agents named at creation | Always | | `group` | Any number of people and agents | Only when mentioned | The creator is the owner. Only group conversations change their participants after creation. See [Groups and participants](/docs/concepts/groups/) for the behavior. ## Participants A participant has a **kind**, a **role** and a **membership**. | Field | Values | Notes | |---|---|---| | `kind` | `member`, `agent`, `party`, `system` | `party` is reserved for external parties | | `role` | `owner`, `member`, `guest`, `observer` | Observers cannot send messages. Guests have the same limits as members today. | | `membership` | `invite`, `join`, `leave` | An invitee cannot read or speak until it joins | | `display` | string | A label for people in the conversation | | `verification` | `unverified`, `channel-verified`, `authenticated` | Recorded on the participant. | Each participant is a state event keyed by its participant ID. An agent participant has an owner, and it leaves when its owner leaves. ## Events Every change to a conversation is an event. An event has a position in the journal, and a position is an integer that never skips. | Event type | Kind | Content | |---|---|---| | `robotelos.conversation` | state | Title and kind | | `robotelos.participant` | state | Participant kind, role, membership, display | | `robotelos.message` | timeline | Parts, mentions, and the agent that wrote it, when there is one | | `robotelos.outcome` | timeline | `succeeded`, `failed` or `unknown`, with parts and a `robotelos.cause` relation on failure | | `robotelos.obligation` | state | An approval request ([Approvals](/docs/specification/approvals/)) | | `robotelos.surface` | state | A rendering of an obligation | A **timeline** event is never replaced. A **state** event is replaced by the next event with the same type and `state_key`. A client that applies events in order gets the same result as a server that applies them in order. ## The view A **view** is the conversation reduced to: - the current state, as a map from (type, state key) to the latest state event; - the timeline, as the ordered list of timeline events; - the cursor of the last event applied. A view is built from a snapshot and then extended with frames ([Delivery](/docs/specification/delivery/)). Two views with the same cursor are equal. A client MUST NOT modify a view except by applying events from the server. ## Relations An event MAY carry relations to other events. Version 1 defines: | `rel_type` | Meaning | |---|---| | `robotelos.reply` | This event answers the event it names | | `robotelos.cause` | This event was caused by the event it names | A server MUST NOT send more relations on one event than `max_relations`. ## Identifiers in events Events carry participant IDs, never personal contact details. An external identifier such as a phone number or a messaging-app ID is kept in the account's party directory, not in conversation events. Participants see a display name. Events contain only participant IDs and display names. ## Next steps - [Base protocol](/docs/specification/base-protocol/) - [Delivery](/docs/specification/delivery/) # Fleet events Source: https://robotelos.dev/docs/concepts/fleets/events/ A fleet tells the control plane how far each release got. The latest answer is the status you see in `get rollout`. The **events** are the changes of that answer over time, so that you can see when a release became Ready, when it went Degraded and what the fleet said. ```bash robotelos get fleet-events support ``` ```text TIME KIND RELEASE GEN PHASE MESSAGE 2026-11-18T13:20:05 release.phase 3f2a9c1e/dev 4 Ready (+10%) 2026-11-18T13:19:58 release.phase 3f2a9c1e/dev 4 Applied (+10%) 2026-11-18T13:19:40 release.phase 3f2a9c1e/dev 3 Ready ``` An event is written when something changes, never for every report: a phase, a generation, the digest, or the split a fleet applied. A fleet that reports the same thing a thousand times leaves one event. ## What you see, and what you do not - **Your account sees the events about its own releases.** A fleet may serve several accounts, and one account never sees another's events. - **The events about a fleet itself** (a pool changing, a connection starting) are for the platform's administrators: `robotelos fleet events FLEET`. ## How long they are kept Fleet events are kept for **90 days** and then deleted. They are made by machines and there are many, so they are not the audit trail. The audit trail (`get audit`) records the decisions of people (who applied, promoted or approved what) and is not deleted with them. ## Transports Every transport records the same events. An agent that reaches the control plane over gRPC reports on a stream; one on a network that only passes HTTP/1.1 reports with calls that carry an epoch and a sequence number. Either way a late report changes nothing, a release that is no longer served disappears from what the fleet observes, and a fleet that is waiting for changes counts as alive. ## Next steps - [Operate fleets](/docs/operate/operate-fleets/) - [Streams](/docs/concepts/fleets/streams/) # Groups and participants Source: https://robotelos.dev/docs/concepts/groups/ A conversation is either **direct** or **group**. A direct conversation is between one person and one agent. A group conversation has several people and any number of agents, and the rules for who may do what are the same for everyone in it. ## Creating a conversation `robotelos.create_conversation` takes a `kind` and an optional list of agents: - `"direct"`: the agents listed (usually one) always answer every message. - `"group"`: zero or more agents. The creator becomes the **owner**. Agents in a group answer only when they are **mentioned**. Only group conversations change their participants after creation. ## Roles | Role | Can read | Can speak | Can invite or remove | Notes | |---|---|---|---|---| | **owner** | yes | yes | yes | The creator, and anyone an owner promotes. The last owner cannot leave or be demoted. | | **member** | yes | yes | no | Joins by accepting an invitation. | | **guest** | yes | yes | no | Guests can read and speak, like members. | | **observer** | yes | no | no | Reads only. An observer's messages are refused. | Agents are participants with the role `participant`. An agent belongs to the owner who added it, so it leaves with that owner. ## Membership: invite, join, leave All membership changes use one command, `robotelos.update_participant`. Its content has a `membership` field: | Membership | Who | What happens | |---|---|---| | `invite` | an owner | Invites a member (the target) with an optional role. The invitee sees the invitation but cannot read or speak yet. | | `join` | the invitee, for themself | Accepts the invitation and gains the invited role. | | `join` | an owner | Adds an agent with `agent_id`, or changes the role of a member who already joined (`role`). | | `leave` | anyone, for themself | Leaves. | | `leave` | an owner | Removes another participant. | A removed participant stops receiving events: its stream ends with `resnapshot_required`, and a new subscribe says the conversation is unknown to it. {{% alert title="Invitations need the conversation ID" color="info" %}} An invitee needs the conversation's ID from the owner, and a participant needs to know another person's participant ID to invite them. {{% /alert %}} ## Agents in a group An agent is added by an owner, through `join` with `agent_id`. Its replies are authored by the agent, not by the owner who added it, and the message names the agent and its version. **An agent answers only when it is mentioned.** A message in a group names the participants it addresses in its `mentions` field. A mentioned agent replies; an agent that is not mentioned stays quiet. This keeps a group from filling with replies to every message. In a direct conversation the agent always answers, because there is nobody else to address. {{< diagram name="command-flow" caption="The same command and frame flow applies to a group. Only mentioned agents receive a turn, so only they add events after the message." >}} ## What a participant sees Every participant sees the same events, except where a role limits what it may do. An observer sees everything a member sees. A participant that is removed sees nothing more. Every participant has a kind (member, agent, party or system) in the conversation state. By design, external identifiers such as a phone number are kept out of conversation events; the participant state shows only the channel and the verification level. ## Rules worth knowing - The last owner of a group cannot leave or be demoted, so a group never loses all control. - An agent leaves with its owner. Removing an owner removes the agents they added. - The same rules apply on every transport and on PostgreSQL. These rules are covered by automated tests on every transport. For the multi-device behavior of these roles, read [Multiple clients](/docs/concepts/multi-client/). The command fields are in the [command reference](/docs/reference/protocol/). ## Next steps - [Approvals](/docs/concepts/approvals/) - [Specification: Data model](/docs/specification/data-model/) # Protocol quick reference Source: https://robotelos.dev/docs/reference/protocol/ A cheat sheet for the conversation protocol (MCoP, the Robotelos Conversation Protocol), as built. It lists names and one-line meanings. The [Specification](/docs/specification/) has the exact rules, the field tables and the error codes; where this page and the specification differ, the specification prevails. ## Bindings | Binding | Endpoint | Notes | |---|---|---| | HTTP and SSE | `POST /v1/rpc` for requests, `GET /v1/stream` for pushed frames | Clients resume with `subscribe` from a cursor. The SSE stream does not use `Last-Event-ID` | | WebSocket | `GET /v1/ws` | One JSON message per text frame | | gRPC | one bidirectional stream | Raw JSON bytes per message; no IDL | | Health | `GET /healthz` (process alive), `GET /readyz` (ready to serve) | HTTP listener only | Every binding carries the same messages and passes the same end-to-end suite. Requests carry a bearer token in the `Authorization` header; the server maps it to a principal (participant ID, account, display name). See [Transports](/docs/specification/transports/). ## Operations | Operation | Purpose | |---|---| | `initialize` | Negotiate the protocol version and client information | | `command` | Send a command; returns a receipt | | `subscribe` | Start a stream for a conversation from a snapshot or a cursor | | `read_after` | Read events after a cursor, without a stream | | `get_receipt` | Fetch the stored receipt of a command by its ID | | `unsubscribe` | Stop a stream | ## Pushed messages | Push | Meaning | |---|---| | `frames` | Events in cursor order, batched per message; each frame carries its own cursor | | `up_to_date` | The stream has reached the end of the journal. Also set on `subscribe` and `read_after` results | | `resnapshot_required` | The client's cursor cannot be served. Subscribe again from a snapshot | ## Dispositions Every command receives exactly one disposition in its receipt: `ACCEPTED` (applied; events are in the journal), `REJECTED` (invalid or not allowed; see the error), `CONFLICT` (same `command_id`, different payload) or `STALE` (targets a version that is no longer current). See [Receipts](/docs/specification/commands/#receipts). ## Commands | Command | What it does | Main fields | |---|---|---| | `robotelos.create_conversation` | Creates a direct or group conversation; the sender becomes its owner | `kind`, `title`, `participants` | | `robotelos.submit_message` | Adds a message. Starts an agent turn when an agent is addressed | `parts`, `mentions`, `relations` | | `robotelos.answer_obligation` | Answers an open obligation, such as an approval. The first valid answer counts | `target.obligation_id`, `target.expected_version`, `answer.kind`, `request_digest` | | `robotelos.update_participant` | Invites, adds, removes or changes the role of a participant of a group | `target.participant_id`, `membership` (`invite`, `join`, `leave`), `role`, `agent_id`, `display` | Every command carries a `command_id`. A retry with the same ID and payload returns the original receipt. Fields, rules and who may send what: [Command catalog](/docs/specification/commands/#command-catalog), [Groups and participants](/docs/concepts/groups/) and [Approvals](/docs/specification/approvals/#answering). ## Events | Type | State event | Content | |---|---|---| | `robotelos.conversation` | no | Title and agent of the conversation | | `robotelos.participant` | yes | Participant ID, display name and account | | `robotelos.message` | no | Message parts. Agent replies carry a `robotelos.reply` relation | | `robotelos.outcome` | no | `succeeded` or `failed`. Failures carry a `robotelos.cause` relation | | `robotelos.obligation` | yes | Kind, version, status, responders, prompt, target, expiry and answer once answered | | `robotelos.surface` | yes | A2UI v1.0 messages, a plain-text fallback and the obligation ID | Two relations connect events: `robotelos.reply` (this event replies to the one named) and `robotelos.cause` (this event is the cause of the one that carries it). See the [data model](/docs/specification/data-model/). ## Parts A message or reply is a list of parts. Each part has exactly one of: `text` (plain text), `data` (structured JSON), `url` with `mediaType` (a reference to content) or `raw` (inline bytes). ## Approval digest The digest of an approval is the SHA-256 of the capability ID, the contract version and the effective arguments, as computed by `protocol.ApprovalDigest`. See [Approvals](/docs/specification/approvals/). ## Errors and versions Every error has a code (`not_authenticated`, `rate_limited`, `cursor_expired` and others) and the specification says which are safe to retry: [Error codes](/docs/specification/commands/#error-codes). The only protocol version built is `1`: [Versioning](/docs/specification/versioning/). ## Next steps - [Specification](/docs/specification/) - [Go client guide](/docs/build/go-client/) # Security Source: https://robotelos.dev/docs/operate/security/ This page is the overview. The normative rules for implementers are in the [Specification: Security](/docs/specification/security/). The settings you apply are in [Production notes](/docs/getting-started/production-notes/). ## Accounts are isolated in the database Every principal belongs to an account, and a principal in one account cannot see or change another account's conversations. PostgreSQL row level security enforces it, not only the application code. The gateway checks at startup that its application role cannot bypass row level security, and it refuses to start if it can. {{< diagram name="security-boundaries" caption="Where the lines are drawn: a token at the gateway, row level security between accounts, and an outbound-only fleet link." >}} ## Who you are - **Tokens.** Every connection is authenticated before the server accepts `initialize`. A bearer token maps to one principal. Tokens are read from a file you control, must be at least 8 characters, and should be long and random. - **Sign-in.** Signing in through an OpenID Connect provider is experimental. Local development keeps the token file. - **Discovery.** The discovery document needs no authentication and never reveals a secret. ## What you may do - **In a conversation.** The server decides from the journal, never from what a client says about itself. A non-participant gets `not_participant`, an observer who sends a message gets `not_authorized`, only owners invite members and add agents, and only responders answer an approval. - **In an account.** A role (owner, maintainer, developer, reporter, operator) holds named permissions, and a refusal names the missing one. See [Permissions](/docs/reference/permissions/). - **In production.** Production changes only through an approved promotion. Nobody approves a promotion they requested, and an environment can require more approvals or limit approvers to certain roles. ## Agents ask first An approval records that a responder saw a specific operation and answered it. The answer is bound to a digest of the exact details shown, and only the first valid answer counts. A server does not run an operation that requires approval until it is answered `ACCEPTED`. ## Fleets pull, and hold narrow credentials - A fleet agent connects out to the control plane. Nothing connects into the cluster, and the control plane holds no credentials for any data plane. - The fleet's credential lives only in its own cluster. The control plane stores its SHA-256. - Mutual TLS is optional. The client certificate carries the fleet in a URI SAN, `spiffe://robotelos.io/fleet/`, and the coordinator checks it against the fleet the credential belongs to. - In the installation charts, the operator and the agent have a Role in their own namespace only, and a network policy admits traffic from that namespace only. ## Privacy Events carry participant IDs and display names only. Phone numbers, messaging-app IDs and e-mail addresses stay in the account's party directory and never appear in conversation events. ## Every change is recorded A change of desired state writes an audit entry in the same transaction as the change: who, what, when and the trace id. See [Observability](/docs/operate/observability/). ## What you must do yourself - Terminate TLS in front of every binding. - Keep tokens and database passwords out of version control. - Use the right database roles, and never allow the unsafe role override outside local experiments. ## Report a vulnerability The project does not yet publish a security policy. Do not open a public issue for a vulnerability. Contact a maintainer listed in [MAINTAINERS.md](https://github.com/robotelos/robotelos/blob/main/MAINTAINERS.md) directly. ## Next steps - [Production notes](/docs/getting-started/production-notes/) - [Specification: Security](/docs/specification/security/) - [Permissions](/docs/reference/permissions/) # Accounts and memory Source: https://robotelos.dev/docs/concepts/accounts-and-memory/ ## Accounts Everything in Robotelos belongs to an **account**. An account is either personal, for one person, or a team account, for a group that shares work. - The account is the boundary for privacy: one account cannot see another's conversations, goals or memory. - The account is the boundary for permissions: what the assistant may do is set per account. - One person can belong to several accounts, for example a personal one and a work one. Each account keeps its own memory. ## What the assistant remembers | Kind | What it is | Example | |---|---|---| | **Preference** | A choice the person likes. It ranks options, but is never a hard rule. | Outdoor seating, French food | | **Concern** | Something that deserves ongoing attention. The assistant keeps it in mind and raises it when it matters. | Avoid long transfers | | **Policy** | A hard limit on what the assistant may do. | Ask before any booking; a spending cap | | **Context** | What the assistant knows about the current situation, and where that knowledge came from. | Tomorrow evening, two people, in Frankfurt | Each item records where it came from, so the assistant can say why it made a choice, and the person can change or remove it. ## What this means in practice - A preference helps choose between two good options, but it does not override a policy. - A concern can start a conversation later. For example: "You asked me to avoid long transfers. The taxi to the second restaurant is 40 minutes. Shall I look for another?" - A policy is checked every time the assistant wants to act, not only when it is set. Related: [Approvals](/docs/concepts/approvals/) for how a single action is permitted, and [Goals, tasks and planning](/docs/concepts/goals-and-planning/) for how the memory is used to plan. ## Next steps - [Goals, tasks and planning](/docs/concepts/goals-and-planning/) - [Permissions](/docs/reference/permissions/) # Commands Source: https://robotelos.dev/docs/specification/commands/ {{% alert title="For adapter authors" color="info" %}} A command is the only way to change a conversation. Give every new intent a new `command_id` and keep it. Retry with the same `command_id` and the same payload only. The receipt tells you what happened. {{% /alert %}} ## Command envelope ```json { "command_id": "cmd_01", "type": "robotelos.submit_message", "conversation_id": "conv_…", "target": {}, "content": {"parts": [{"text": "hello"}]} } ``` | Field | Required | Rule | |---|---|---| | `command_id` | yes | Unique for the sender and conversation. Generated by the client. | | `type` | yes | One of the types in the [catalog](#command-catalog) | | `conversation_id` | per type | Omitted for `robotelos.create_conversation` | | `target` | per type | Who or what the command is about | | `content` | per type | The payload. Limits apply ([Base protocol](/docs/specification/base-protocol/#limits)). | ## Identity and digest The server stores each accepted command with a **digest**: a SHA-256 of a canonical JSON encoding of `target` and `content`. The canonical encoding sorts object keys, so the same content always gives the same digest. A command with the same `command_id`, sender and conversation is processed by comparing digests: - **Same digest**: the command is a retry. The server returns the original receipt and applies nothing. - **Different digest**: the server returns `CONFLICT`. Nothing changes. A server MUST NOT apply a command twice. A server MUST return the same receipt for a retry. ## Receipts Every command gets exactly one receipt: ```json { "receipt_id": "rcp_…", "command_id": "cmd_01", "conversation_id": "conv_…", "disposition": "ACCEPTED", "events": ["evt_…"], "frames": [{"projection_id": "view_conv_…", "sequence": 12}] } ``` | Disposition | Meaning | Events | |---|---|---| | `ACCEPTED` | Applied | Recorded; `events` and `frames` name them | | `REJECTED` | Refused; the `error` says why | None | | `CONFLICT` | The same `command_id` was used with a different payload | None | | `STALE` | The command names a version that is no longer current | None | A receipt is stored with the events, so `get_receipt` returns it even after a lost response. ## Command catalog ### robotelos.create_conversation | Field | Where | Meaning | |---|---|---| | `kind` | content | `direct` or `group` | | `title` | content | Optional | | `participants` | content | Agents to start with: `[{"agent_id": "mock"}]`. A group may start with none. | The creator is the owner. ### robotelos.submit_message | Field | Where | Meaning | |---|---|---| | `parts` | content | At least one part; each part has exactly one of `text`, `data`, `url` or `raw` | | `mentions` | content | Participant IDs the message addresses. In a group, only mentioned agents answer. | | `relations` | content | Optional, up to `max_relations` | The message is accepted if the sender may speak in the conversation. Observers are refused with `not_authorized`. ### robotelos.update_participant | Field | Where | Meaning | |---|---|---| | `participant_id` | target | The participant to act on. Omitted means the sender. | | `membership` | content | `invite`, `join` or `leave` | | `role` | content | `owner`, `member`, `guest` or `observer` | | `display` | content | A label for an invitee until it joins | | `agent_id` | content | An agent for an owner to add with `join` | Who may send which membership is in [Groups and participants](/docs/concepts/groups/). The last owner cannot leave or be demoted. ### robotelos.answer_obligation | Field | Where | Meaning | |---|---|---| | `obligation_id` | target | The obligation answered | | `expected_version` | target | The obligation version the answer is based on | | `answer.kind` | content | `approve` | | `request_digest` | content | The digest of the operation shown to the responder | The checks and outcomes are in [Approvals](/docs/specification/approvals/#answering). ## Error codes Every error has one of these codes. The table names the meaning and whether a retry can succeed. | Code | Meaning | Retry | |---|---|---| | `not_authenticated` | Missing or unknown token | After fixing the token | | `not_authorized` | The principal may not do this, such as an observer speaking | No | | `not_participant` | The sender is not in the conversation | No | | `invalid_command` | Malformed request or command | No | | `payload_too_large` | A limit was exceeded | No | | `limit_exceeded` | The principal holds as many connections, or the connection follows as many conversations, as the server allows | No | | `rate_limited` | The principal sends commands faster than the server allows; `retry_after_ms` is the wait | Yes | | `unsupported_version` | No common protocol version | No | | `command_conflict` | The `command_id` was used with another payload | No | | `unknown_conversation` | No such conversation, or the sender is no longer in it | No | | `unknown_target` | The target (for example an obligation) does not exist | No | | `cursor_expired` | The cursor is older than the server keeps | Subscribe again | | `epoch_changed` | The journal was rebuilt; the cursor is invalid | Subscribe again | | `expired` | An answer came after the obligation's expiry | No | | `internal` | The server failed | Yes, with the same `command_id` | ## Next steps - [Delivery](/docs/specification/delivery/) - [Concepts: Commands and receipts](/docs/concepts/commands-and-receipts/) # Delivery Source: https://robotelos.dev/docs/specification/delivery/ {{% alert title="For adapter authors" color="info" %}} Subscribe, store the cursor of each frame you apply, and reconnect from that cursor. If the server says `resnapshot_required`, subscribe again from nothing. Never skip a position, and never apply the same position twice. {{% /alert %}} ## Subscribing ```json {"id": "2", "op": "subscribe", "body": {"conversation_id": "conv_…"}} ``` Without a cursor, the server answers with a **snapshot**. With a cursor that it can still serve, it answers with an acknowledged resume and then sends the missing frames. ```json {"type": "snapshot", "cursor": {"projection_id": "view_conv_…", "epoch": "e1", "sequence": 47}, "conversation_version": 1, "state": [], "timeline": {"events": []}} ``` A snapshot is the view at `cursor`. Apply it first, then apply frames whose sequence is greater than `cursor.sequence`. {{< diagram name="reconnect-flow" caption="A client that falls behind resumes from its cursor. When the cursor can no longer be served, it subscribes again from a snapshot." >}} ## Frames A **frame** places one event at one position: ```json {"type": "frame", "cursor": {"projection_id": "view_conv_…", "epoch": "e1", "sequence": 48}, "event": {"event_id": "evt_…", "type": "robotelos.message", "…": "…"}} ``` Rules, which every client MUST follow: 1. Frames arrive in sequence order. 2. Sequences are contiguous. A client that receives 48 after 46 MUST NOT apply 48; it MUST read the missing position or resubscribe. 3. A frame with a sequence the client already has MUST be ignored. This makes redelivery safe. 4. A frame of a different `epoch` means the journal was rebuilt. The client MUST resnapshot. Frames are sent to the transport in batches as `frames` pushes. A batch is only a transport detail: every frame keeps its own cursor, and `up_to_date: true` marks the point where the client has caught up with the journal. ## Reading after a cursor ```json {"id": "3", "op": "read_after", "body": {"conversation_id": "conv_…", "cursor": {…}, "limit": 50}} ``` The result carries `frames`, the new `cursor`, and `up_to_date`. When the cursor cannot be served, the result carries `resnapshot_reason` instead of frames. ## Resnapshot A server MUST demand a resnapshot, rather than send a gap, when: | Reason | Cause | Client action | |---|---|---| | `cursor_expired` | The cursor is older than the server keeps | Subscribe with no cursor | | `epoch_changed` | The journal was rebuilt | Subscribe with no cursor | | `removed` | The participant left or was removed from a group | Stop; the conversation is closed for this principal | In a push, the server sends `resnapshot_required` with the reason. A client MUST discard its view for that conversation before it applies a new snapshot. ## Several connections A principal may hold several connections, and each one has its own subscriptions. The server sends the same frames to every subscription of a conversation, in the same order. A receipt goes only to the connection that sent the command. ## Slow clients A client that cannot keep up with frames SHOULD bound its queue. The Go SDK does this: a full queue returns `ErrSlowConsumer`, and the client resumes from its last checkpoint instead of losing events. The server keeps the events, so nothing is lost. ## Disconnects A disconnect ends the subscriptions of that connection. It does not cancel work, and the events that work produces are recorded. A client resumes from its cursor on the next connection. ## Next steps - [Transports](/docs/specification/transports/) - [Concepts: Multiple clients](/docs/concepts/multi-client/) # Glossary Source: https://robotelos.dev/docs/reference/glossary/ **Actor.** A stateful workload hosted by Agent Substrate. Not a Robotelos execution or effect identity. **Agent.** The code that proposes what to do next: replies, tool requests and approval requests. Its output is a proposal, not a decision. **AgentExecution.** Robotelos's logical run of an agent for a task. Owned by Robotelos, not by the execution host. **Approval.** An obligation that asks a responder to allow an operation. Bound to a digest. **Attempt.** One try at an execution, fenced so that an older attempt cannot commit over a newer one. **Command.** A client's request to change a conversation. Carries a `command_id` and gets a receipt. **Conversation.** An ordered journal of events between participants. **Digest.** A hash that binds an approval to the exact operation it approves. **Effect.** A change made outside Robotelos's own state, such as a call to an external system. Recorded with its intent before it is dispatched. **Event.** An entry in a conversation's journal. Timeline events are kept in order; state events describe the current state of something. **Execution host.** The compute and isolation that runs agent work. Agent Substrate is one implementation. **Fencing.** Rejecting work from an attempt or epoch that is no longer current. **Gateway.** The conversation protocol server on PostgreSQL, run as one or more replicas. **Harness.** The per-run component that executes one agent run inside an execution host. **Obligation.** A state event in a conversation that requires a participant to answer. **Operation.** One recorded model call or capability call in the operation ledger. **Participant.** A person or agent taking part in a conversation. **Receipt.** The server's answer to a command: its disposition and the positions of the events it produced. **Surface.** A rendered interface for an obligation, in the A2UI format, with a plain-text fallback. **Task.** A unit of work that belongs to a goal. Owned by Robotelos. **UNKNOWN.** The state of an effect whose outcome is not known. Resolved only by evidence. **View.** A conversation's state, reduced from its events and held by a client. **Draft.** The one editable copy of an agent. Nothing runs from it; publishing it makes a version. **Version.** A numbered, frozen copy of an agent's draft, made by publishing. It never changes. Its compiled form is the release, which is part of the version. **Rollout (also called a deployment).** The resource that says which version of an agent an environment runs, with a generation that counts every change and a status that shows how far the fleets have got. **Promotion.** The record Robotelos creates when a rollout is applied to a gated environment such as production. It waits for approval and changes nothing until approved. ## Next steps - [Concepts](/docs/concepts/) - [Specification](/docs/specification/) # Goals, tasks and planning Source: https://robotelos.dev/docs/concepts/goals-and-planning/ ## The short version A person states a **goal**. Robotelos breaks it into **sub-goals**, each with a success condition. A sub-goal is carried out by **tasks**, and a task calls **operations**, which are single actions. Each level answers one question. {{< diagram name="goal-to-tasks" caption="One goal, four levels. Read it from the top: what should become true, what must be checked, what work is done, and which single action runs." >}} ## The questions behind each term | Term | The question it answers | Example | |---|---|---| | **Domain** | Where does this problem belong? | Dining, travel, billing | | **Goal** | What should become true for the person? | A table is booked for 2 tomorrow | | **Sub-goal** | What smaller outcome must hold on the way? | A restaurant is chosen and approved | | **Task** | What work should be done now? | Search restaurants; ask the person to choose | | **Capability** | Which ability is needed, independent of any vendor? | Restaurant search, table booking | | **Skill** | How does a provider deliver that ability? | A search skill that queries two booking services | | **Operation** | Which concrete call is executed? | `search()`, `book()` | | **Preference** | What does the person prefer, without it being a rule? | Outdoor seating, a short walk | | **Constraint** | What must hold, as a hard rule? | Budget under 60 € per person; no booking before 18:00 | | **Approval** | May this concrete action run? | "Yes, book table 2 for 19:30" | | **Consent** | May data or a capability be used at all? | Allow location for walking time | Two definitions are easy to mix up. An **approval** permits one action. **Consent** permits the use of data or a capability for a purpose. A **preference** is a wish; a **constraint** is a rule that must be satisfied. ## Sub-goal or task? Use a **sub-goal** when the outcome has its own success condition and can be planned on its own, for example "restaurant chosen". Use a **task** when the step is just work the planner created to reach the outcome, for example "search restaurants". If you are unsure, ask whether the step can fail as an outcome of its own. If it can, it is a sub-goal. ## A worked example: booking a table The same flow, step by step: | Step | What happens | Who does it | |---|---|---| | 1 | The person writes: "Book a table at an Italian restaurant for 2 tomorrow evening." | The conversation | | 2 | The goal is stored with its constraints: cuisine, party size, time, place | The goal manager | | 3 | The planner derives sub-goals and tasks, and selects the skills that provide search and booking | The task planner | | 4 | The search runs and returns candidates; the person is asked to choose | The agent, through approvals | | 5 | Booking needs approval. The person approves "table for 2, 19:30" | The person; the server checks the approval | | 6 | The booking runs. If it fails, the planner chooses a fallback, for example another restaurant | The execution engine | | 7 | The confirmation is recorded and shown on every device the person follows the conversation on | The server, through the record | If the person changes their mind halfway, for example "actually a French restaurant, and let's walk", the planner keeps the completed search, replaces the branch that depends on the old choice, and continues. Each change is recorded as an event, so nothing is lost. ## Like a delivery robot: mission, route and control loop A delivery robot does not act on one message. It has a **mission** ("deliver this parcel to floor 3 before 16:00"), a **route** (the lift, the corridor, the stairs), and a **control loop** that keeps checking the world and reacts when a door is locked. Robotelos uses the same three parts for agents: | Part | Robot equivalent | What it does for you | |---|---|---| | **Goal manager** | Mission control | Keeps track of what you want, what it depends on, when it is done, and which goal comes first. A goal can last for days and move between channels. | | **Task planner** | The route planner | Turns a goal into steps, works out which steps depend on others, and chooses the skills each step needs. Where a step needs your approval, it asks. | | **Behavior tree** | The control loop | Runs the steps in order, checks the conditions as it goes, and switches to a planned fallback when a step is blocked. It reacts to change without starting the whole plan again. | Why not let a language model decide every step? A model that decides everything is hard to predict, hard to stop and hard to audit. The planner gives the work a shape that people can read, and the control loop makes sure each step runs in order, with a planned fallback when something fails. Models still help: they understand your request and propose plans. The rules for what runs, and when, stay explicit. {{< diagram name="robotics-analogy" caption="Mission, route and control loop. The goal manager decides what should be true, the task planner works out the steps, and the behavior tree runs them and reacts when the world changes." >}} ## How the pieces fit together The conversation carries every result of this flow: messages, approvals with their details, outcomes, and the state of each participant. The goal manager, the task planner and the behavior tree decide what happens next, and the record shows what has happened so far. ## Explore or act Every goal is either exploring or acting. An exploring goal can look things up and compare options, but it cannot change anything in the world. An acting goal can propose changes, and every change still needs the person's approval and the right permissions. Only the person, or an explicit choice in a trusted control panel, can switch a goal to acting. ## Partly done is a real state If a goal involves several bookings and only some of them can be cancelled, the goal is shown as partly cancelled, with each booking listed separately. A goal is never marked as done or cancelled only because the work that was running has stopped. ## Next steps - [Execution model](/docs/concepts/execution-model/) for how a booking survives a crash and does not run twice. - [Multiple clients](/docs/concepts/multi-client/) and [Groups and participants](/docs/concepts/groups/) for several people and devices on the same goal. - [Specification](/docs/specification/) for the exact rules of the parts that are available today. # Approvals Source: https://robotelos.dev/docs/specification/approvals/ {{% alert title="For adapter authors" color="info" %}} An approval is an obligation with a version and a digest. Show the prompt and the target, send the answer with the version and digest you were shown, and handle `ACCEPTED`, `STALE` and `REJECTED` as described below. {{% /alert %}} ## Obligations An agent that needs permission before it acts produces an **approval obligation**, a state event of type `robotelos.obligation`: | Field | Meaning | |---|---| | `kind` | `approval` | | `version` | Increases on each change. An answer must name the version it saw. | | `status` | `open` until answered, then `answered` | | `responders` | Participants allowed to answer: the owner of the agent | | `prompt` | Text shown to the responder | | `target.operation_ref` | Which operation is being approved | | `target.effective_digest` | The digest of what will run | | `expires_at` | After this time the obligation cannot be answered | The server keeps an obligation answerable for a limited time. The Go server's default is 15 minutes. ## The digest The digest of an approval is the SHA-256 of three values: the capability ID, the contract version and the effective arguments of the operation. The execution environment is not part of the digest in version 1. An approval applies to exactly the operation whose digest the responder saw. If the agent proposes different arguments, the digest changes, and an answer to the old digest is refused. ## Answering A client answers with `robotelos.answer_obligation` ([Commands](/docs/specification/commands/#robotelosanswer_obligation)). The server checks, in this order: 1. The sender is one of the `responders`. 2. The obligation is `open` and `expected_version` equals its `version`. 3. The obligation has not expired. 4. `request_digest` equals `target.effective_digest`. | Outcome | When | Effect | |---|---|---| | `ACCEPTED` | All checks pass on the first valid answer | The obligation is answered; the agent resumes with the answer | | `STALE` | The obligation was already answered, or the version moved | Nothing changes | | `REJECTED` (`expired`) | The answer came after `expires_at` | Nothing changes | | Error | The sender is not a responder, or the digest differs | Nothing changes; the error says why | Exactly one answer is canonical. A second answer, from any device, is `STALE`. A client MUST take the version and the digest from the obligation in its view. It MUST NOT take them from a surface, because a surface can be stale or forged. The Go SDK does this for you. ## Surfaces A **surface** (`robotelos.surface`) renders an obligation for people. It carries: - `messages`: A2UI v1.0 messages (`createSurface`, `updateComponents`); - `fallback`: the same question as plain text, for clients that cannot render A2UI; - `obligation_id`: the obligation the surface belongs to. Buttons on a surface carry only the obligation ID and the chosen answer, never the digest. A client that cannot render a surface MUST still show the fallback and let the user answer. ## Next steps - [Commands](/docs/specification/commands/) - [Concepts: Approvals](/docs/concepts/approvals/) # Execution model Source: https://robotelos.dev/docs/concepts/execution-model/ When an agent does real work (calls a model, calls a tool, changes something outside the sandbox), that work must survive crashes and must never be silently repeated. The execution model defines how. ## How it works 1. **The engine owns progression.** An execution is moved forward by the Robotelos engine, which claims it with a fence epoch, decides the next step, and commits state, intents and wake-ups in one PostgreSQL transaction. 2. **The harness holds no authoritative state.** It runs one bounded step at a time. After a restore it is rebuilt from the transcript recorded in PostgreSQL, and its image digest is pinned per execution. 3. **One operation ledger.** Model calls and capability calls share one table. An operation's intent is committed before the effect. The same key with a different input is a conflict. 4. **Decisions are fenced; facts are not.** Every recorded fact increments an execution's `fact_seq`. A decision commit checks the epoch, the progress version and the fact sequence it was based on. If a fact arrived meanwhile, the decision is discarded and evaluated again. A result from an earlier attempt is still recorded against its own operation. 5. **Effects go through one door.** Effects outside the sandbox pass through a broker, or network policy denies them. 6. **Operation keys are stable under replay.** The k-th model call is `m`; the i-th tool call in that response is `m/t`. The ledger stores what the harness asked for and, separately, what was authorized and dispatched. {{< diagram name="execution-states" caption="The states of one action. UNKNOWN is never silently turned into success." >}} ## Unknown outcomes A dispatched effect can end in three ways: it succeeded, it failed, or we do not know. The last case is recorded as `UNKNOWN`. It resolves only by evidence: - `UNKNOWN` → `SUCCEEDED`: reconciled as applied. - `UNKNOWN` → `AUTHORIZED`: reconciled as not applied, and the capability is safe to retry under the same idempotency key. - `UNKNOWN` → `FAILED`: not applied, and not retried. While an `UNKNOWN` effect is open, the execution waits for reconciliation and cannot complete. Robotelos never claims exactly-once effects without evidence. ## Paused executions If a replay diverges from the recorded transcript, the execution does not fail. After a bounded number of attempts it moves to `PAUSED` with a reason. An operator resumes it after the harness image is fixed, or fails it explicitly. ## Relation to the protocol The conversation is the record that people see. The execution model is the engine behind it. The protocol already has the seams the engine needs: a receipt per command, a journal with contiguous positions, and an obligation that is answered once. When the engine lands, an approval answer and its operation transition will be committed in the same transaction. ## Next steps - [Agents, versions and environments](/docs/concepts/agents-and-environments/) - [Journeys](/docs/concepts/journeys/) # Agents, versions and environments Source: https://robotelos.dev/docs/concepts/agents-and-environments/ You build an agent once and run it in several places. Robotelos keeps those two things apart, so that you can change an agent safely while people are using it. {{< diagram name="agent-lifecycle" caption="An agent moves from a draft to a numbered version, then to dev, staging (optional) and production." >}} ## Draft and version Every agent has one **draft**: the agent as you are editing it now. You can change the draft as often as you like. Nothing a user talks to ever runs from the draft. When you are happy with the draft you **publish a version**. A version is a frozen copy, numbered 1, 2, 3 and so on. It never changes. If you publish again without changing anything, you get the same version back, so nothing piles up by accident. Why this matters: when someone reports a problem, you can say exactly which version they talked to, and you can run that same version again tomorrow. If two people edit the draft at the same time, the second save is refused instead of silently overwriting the first. Read the draft again, apply your change, save again. ## Previews: testing a draft Nothing runs from a draft, but you can test it. A **preview** is a numbered, frozen test build of the draft that runs in `dev` only. It never becomes the agent's current version and cannot go to staging, production or a promotion. When you publish the same draft afterwards, the published version is the very release you tested. ## Environments An **environment** is a place where a version runs for a purpose: | Environment | Use it to | |---|---| | `dev` | Try a new version quickly. | | `stg` | Rehearse before production. It is optional; your account can turn it on or off. | | `prod` | Serve real users. | An environment runs one version of an agent at a time. ## Deployment An **AgentRollout** puts a version into `dev` or `stg`. You can apply any version you like and go back to an older one whenever you want. Each change is a new generation of the rollout and is kept, so you can see who put what where and when. A rollout is not finished when you apply it. It is finished when the place that runs the agent has received the version, applied it and reports it **ready**. Until then Robotelos shows it as in progress, and it tells you which step it is waiting on. ## Promotion You apply a rollout to production the same way as to any environment, but production is gated: the apply does not change anything yet. Robotelos records a **promotion**, a request to move a version that already runs in the previous environment. It moves the *same* version, not a rebuilt copy, so what you tested is what goes live. A promotion can ask for conditions first: - **Evidence**: a recorded check, for example "regression suite passed in dev". - **Approval**: another person says yes or no, with a comment. A promotion that is approved is not yet done. It is done when production reports the version ready. ## Which word, which command There is one way to change what runs, and one way to read it. | You want to | You do | What exists afterwards | |---|---|---| | Put a version into `dev` or `stg` | `robotelos apply -f` an **AgentRollout** | The rollout, with a new generation | | Put a version into `prod` | `robotelos apply -f` the production **AgentRollout**; it waits as a **promotion** until someone approves | A promotion, then a new generation of the production rollout | | Go back, or stop serving | `robotelos apply -f` the rollout with another version, or none | A new generation of the same rollout | | Read one release, with its content | `robotelos get release agent/N` | Nothing changes | | See how it is going | `robotelos get rollout agent/environment` | Nothing changes | | See what happened before | `robotelos get revisions agent/environment` | Nothing changes | | Decide on a promotion | `robotelos approve` or `robotelos reject promotion ID` | A recorded decision | A **rollout** is the state: what an environment should run and how far the fleets have got. A **promotion** is a record Robotelos creates when you apply a rollout to a gated environment such as production: the request, its evidence and its approver. You never write one. Robotelos no longer has separate *deploy* and *promote* commands, so there is nothing to confuse. ## Rollback and revoke - **Rollback** is applying the rollout with the version it ran before. Use it when a new version misbehaves. - **Stopping** is applying the rollout with no version, so the environment stops serving the agent altogether. Both are new generations of the same rollout, so the history stays complete. ## Who runs it: fleets Robotelos's control plane decides *what* should run. A **fleet** is the group of machines (a Kubernetes cluster) that actually runs it. Each fleet has a small helper, the **fleet agent**, that asks the control plane what it should run, applies it, and reports back. A company usually has one fleet for non-production (`dev` and `stg`) and one for production. This is why the control plane never needs access into your clusters, and why a cluster that loses its connection keeps serving what it already has and catches up when the connection returns. If you operate fleets, see [Operate fleets](/docs/operate/operate-fleets/). ## Accounts Everything above happens inside an **account**: your team's workspace. You belong to accounts with a role, and the role decides what you may do. Platform administrators manage fleets across accounts. ## Next steps - [Ship an agent from draft to production](/docs/operate/ship-an-agent/) - [Release a version gradually](/docs/operate/release-gradually/) - [Fleets](/docs/concepts/fleets/) # Security Source: https://robotelos.dev/docs/specification/security/ ## Authentication A server MUST authenticate every connection before it accepts `initialize`. Version 1 uses bearer tokens; each token maps to one principal (ID, account, display name). Tokens are static in version 1, read from a file, and MUST be at least 8 characters. Deployments MUST use long random tokens and keep the token file out of version control. Discovery ([Transports](/docs/specification/transports/#discovery)) needs no authentication and MUST NOT reveal a secret. ## Authorization Authorization happens per conversation, from the participant's role and membership: - a participant that is not in a conversation receives `not_participant`; - an observer that sends a message receives `not_authorized`; - only owners invite members and add agents; - only responders answer an approval. A server MUST make every check from the journal, never from what the client says about its own role. ## Account isolation Every principal belongs to an account. Conversations belong to an account, and a principal in one account MUST NOT see or change a conversation of another account. With PostgreSQL, the gateway enforces this with row level security, and it refuses to start if its application role can bypass it. In memory, the same isolation is checked by the conformance suite (`AccountsAreIsolated`). ## Limits as protection The limits in [Base protocol](/docs/specification/base-protocol/#limits) bound the work any one message can cause. A server MUST enforce them, and SHOULD rate-limit connections that repeatedly exceed them. The `retry_after_ms` field in an error tells a well-behaved client how long to wait. ## Identifiers and privacy - Events carry participant IDs and display names only. - External identifiers such as phone numbers, messaging-app IDs or e-mail addresses MUST NOT appear in conversation events. They are kept in the account's party directory. - A participant's verification level describes how its identity was established. A phone number heard on a call is evidence of a channel identity, not of authority. ## Consent Agents act on behalf of people. An approval records that a responder saw a specific operation and answered it. A server MUST NOT execute an operation that requires approval until the approval is answered `ACCEPTED`. ## Transport security Deployments SHOULD terminate TLS in front of every binding; the bearer token is otherwise visible on the wire. Use `wss://` and `https://` URLs in discovery documents when TLS is used. The protocol itself does not define encryption. ## Next steps - [Security overview](/docs/operate/security/) - [Production notes](/docs/getting-started/production-notes/) # Versioning Source: https://robotelos.dev/docs/specification/versioning/ MCoP has two version numbers: the **protocol version** of the message layer, and the **conversation version** of the event schema. Both are negotiated once per connection, at `initialize`. ## Protocol version - The client sends `protocol_versions`, most preferred first. Version 1 is `"1"`. - The server answers with `protocol_version`, the first version it also speaks. - If there is no common version, the server answers `unsupported_version` and does not accept the connection. ## Conversation version - The client sends `conversation_versions`, the schema versions it can read. - The server answers with the versions it can write, and each snapshot names its `conversation_version`. - A client MUST ignore fields it does not know. A server MUST NOT remove a field within a version. ## Downgrades When the client asks for features the server does not offer, the server does not refuse the connection. It leaves them out and lists them in `downgrades`. The `agreed` object lists what both sides will use. A client SHOULD check `downgrades` and adapt its behavior, for example by not showing a surface when the server does not send them. ## What needs a new version | Change | Compatible within a version? | |---|---| | Adding an optional field | Yes | | Adding an event type that old clients can ignore | Yes | | Adding a command type | Yes, if old clients never need to send it | | Removing or renaming a field | No | | Changing the meaning of a field or a disposition | No | | Changing the digest or the cursor format | No | A change that is not compatible requires a new protocol version. The old version keeps working until it is retired in the [Changelog](/docs/specification/changelog/). ## Next steps - [Changelog](/docs/specification/changelog/) - [Conformance](/docs/specification/conformance/) # Conformance Source: https://robotelos.dev/docs/specification/conformance/ {{% alert title="For adapter authors" color="info" %}} Run the conformance suite against the server you build on. A client that passes the scenarios on this page behaves like every other client, and a server that passes them is a valid MCoP server. {{% /alert %}} The Conformance SDK (`protocol/conformance`) is a suite that any MCoP server deployment can run. It talks to the server only through the public client SDK, so it checks what an application sees, not the internals. ## Server contract A server under test MUST: 1. register an agent with the ID `mock` as `mockagent.Agent{}` (no delay, no failure); 2. accept the principals the suite provides and let the suite connect as any of them; 3. isolate accounts: principals 2 and 3 are in other accounts than principals 0 and 1. ## Running it ```go func TestConformance(t *testing.T) { conformance.Run(t, func(t *testing.T) conformance.Target { srv := startMyServer(t) // with the mock agent and the principals return conformance.Target{Connect: func(t testing.TB, p server.Principal) *robotelos.Client { return dialAs(t, srv, p) }} }) } ``` `conformance.Run` runs each scenario as a subtest with a fresh target. `conformance.Scenarios()` lists them, so a caller can run a subset. ## Scenarios | Scenario | Checks | |---|---| | `RoundTrip` | A message reaches the mock agent and its reply reaches the client | | `CommandsAreIdempotent` | A retry with the same `command_id` and payload returns the original receipt and applies nothing | | `AccountsAreIsolated` | A principal in one account cannot see or change another account's conversation | | `ApprovalAnswersOnce` | An approval is accepted once; a second answer is `STALE` | | `GroupInviteJoinAndTalk` | Invite, join and speak in a group | | `AgentsAnswerGroupMentionsOnly` | In a group, only mentioned agents reply | | `GroupAuthorization` | Roles restrict who may invite, speak and change membership | | `RemovedParticipantStopsReceiving` | A removed participant's stream ends with `resnapshot_required` | | `AgentsLeaveWithTheirOwner` | An agent leaves when its owner leaves | The scenarios run on every transport and on PostgreSQL. A server that fails any scenario is not conformant for that transport or store. ## Client conformance Clients are checked the same way: a client library passes if it completes the scenarios through the public API. A client written in another language SHOULD reproduce the same behavior for the cursor, retry and resnapshot rules in [Delivery](/docs/specification/delivery/) and [Commands](/docs/specification/commands/). ## Next steps - [Versioning](/docs/specification/versioning/) - [Security](/docs/specification/security/) # Journeys Robotelos is designed for Source: https://robotelos.dev/docs/concepts/journeys/ These pages describe how Robotelos is designed to behave in situations people actually meet. Some of this is design intent. The conversation, approval and durability parts work today, and goals, planning and delegation are experimental or planned. [What you can do today](/docs/overview/status/) says which is which. ## Four journeys **Dinner and a taxi.** A person asks for an evening out. Robotelos plans two tasks under one goal: book a restaurant, then book a taxi once the restaurant is confirmed. Each booking leaves a confirmation the person can open later. **Several people, one call.** Two people and their assistants share a conversation. The assistants can suggest options, but only the person who owns the money approves a purchase, from any device. **Resume after a failure.** The system crashes after a provider accepted a reservation but before it saved the result. On restart it asks the provider what happened, rather than booking a second time. **Switch channels mid-task.** After a phone call, the person opens the app and sees the same task and the same pending approval, with live updates from that point on. ## Cancelling honestly "Cancel everything for this evening" is handled as a coordinated operation, not as a switch that marks everything cancelled: 1. New work stops. 2. Anything still in progress is checked, so no booking is missed. 3. Bookings are cancelled in a safe order, such as the taxi before the restaurant. 4. The person gets a precise report. If the taxi is cancelled but the restaurant refuses, the goal is shown as **partly cancelled**: the taxi is gone, the restaurant booking is still active, and the person can decide what to do next. The system does not claim success it cannot prove. ## Several people, one conversation A shared conversation can include two people and their assistants. Each participant is clearly separated: - **Who is speaking** is evidence, not proof. A shared phone or a recognised voice does not show who approved a purchase. - **Who may approve** is decided by the owner of the money, from their own device, for the exact action. - **An assistant's suggestion** is never an order. Bob's assistant can recommend a venue without gaining any power over Alice's bookings. ## Quiet when it should be, clear when it must be Not every message needs work. Thanks, a social remark or a simple answer does not start a task. When several tasks need the person's attention, the assistant combines the questions into one clear request instead of many separate interruptions. Each conversation has one focus at a time, so an answer goes to the right task. ## Delegating to specialist agents A large goal can be handed to specialist agents, for example a restaurant agent and a hotel agent. The central goal manager keeps track of how the goals relate, such as the shared budget and the timing. Each specialist plans its own steps. Delegation has clear limits on depth, budget, authority and time, and a cancellation reaches every specialist. ## Next steps - [Goals, tasks and planning](/docs/concepts/goals-and-planning/) - [Execution model](/docs/concepts/execution-model/) - [Groups and participants](/docs/concepts/groups/) # Changelog Source: https://robotelos.dev/docs/specification/changelog/ ## What version 1 includes | Area | Contents | |---|---| | Messages | Requests, responses and pushes; six operations: `initialize`, `command`, `subscribe`, `read_after`, `get_receipt`, `unsubscribe` | | Transports | HTTP with Server-Sent Events, WebSocket and gRPC, with the same messages on each; discovery at `/.well-known/robotelos` | | Commands | Create a conversation, send a message, manage participants, answer an approval | | Receipts | `ACCEPTED`, `REJECTED`, `CONFLICT` and `STALE`, stored with the events | | Conversations | Direct and group conversations; owner, member, guest and observer roles | | Delivery | Snapshots, ordered frames, cursors, `read_after`, and resnapshot when a cursor cannot be served | | Approvals | Obligations bound to an operation digest, answered once, with A2UI surfaces and a plain-text fallback | | Storage | In memory for development; PostgreSQL with row level security for the gateway | | Tests | An automated suite that every transport and store must pass | ## How changes are versioned Changes that add optional fields or event types, and that older clients can ignore, stay within version 1. Changes that remove or rename a field, or change the meaning of an existing one, start a new version. The rules are in [Versioning](/docs/specification/versioning/). ## Additions within version 1 - The discovery document may carry two optional fields, `environment` (`local`, `dev`, `stg` or `prod`) and `effects_mode` (`sandbox` or `real`). A server that does not set them leaves them out, which means it does not state them. ## Next steps - [Versioning](/docs/specification/versioning/) - [Conformance](/docs/specification/conformance/)