RFC: REST (v1)
Status: Draft
Version: v1
Scope: HTTP projection of machines and runs
Non-goals: Execution semantics, durability policy
1. Purpose
REST provides an HTTP projection over machines and runs.
REST defines representation only, never execution behavior.
2. Core Principles
- REST is optional
- REST is stream-native
- REST is projection-only
3. Machine Endpoints
GET /m/<machineRef>Content negotiation MAY return:
application/jsontext/markdownapplication/schema+json
4. Run Endpoints
GET /r/<runRef>Default (application/json):
- returns latest snapshot
Streaming (explicit via Accept):
application/x-ndjsontext/event-stream
5. Mutations
PATCH /r/<runRef>Single event
- JSON body
- applies one event
- returns resulting snapshot
Multiple events
- NDJSON body
- atomic
- returns resulting snapshot
PATCH never streams.
6. HTTP Verbs
| Verb | Meaning |
|---|---|
| GET | read / stream |
| POST | create run |
| PATCH | apply events |
| PUT | unused |
7. Invariants
- PATCH always returns snapshot
- Streaming is GET-only
- Content negotiation affects framing only
8. Lock statement
REST is a projection over runs and machines.
It defines representation only.
This is REST v1.