Edit the graph from natural language
Run the kernel agent server-side: describe the change in prose and the agent authors it, then the SAME fail-closed kernel gate every deterministic write passes must bless the result before it persists. This is real LLM spend — one unit is reserved against your daily edit quota BEFORE the agent runs, and refunded on a validation reject, agent error, or concurrency conflict. RESULT-ONLY: the response is exactly world, diagnostics, and reply — the agent’s system prompt, op grammar, lexicon, model id, and raw op trace are never exposed. If the agent needs clarification it returns the question in reply and leaves the world unchanged. Pass an Idempotency-Key so a retry doesn’t double-charge.
Authorizations
An app API key, e.g. Authorization: Bearer sk_live_…. Secret (sk_) for writes/sessions; publishable (pk_) for read/embed.
Headers
The rev you last read. Mismatch returns 409.
A retried edit with the same key returns the original result without a second LLM spend.
Path Parameters
Body
A natural-language edit instruction for the server-side kernel agent. Either instruction or message is required.
What to change, in prose — e.g. "add a locked vault behind the cellar and wire a key to open it".
Alias for instruction (accepted for convenience).
Optional grounding hints (named objects the agent may reference).
Optional optimistic-concurrency token; alternative to the If-Match header.
Response
Edit applied (or a clarifying question in reply with no change). The new rev is the ETag.
The RESULT-ONLY response from a kernel-agent edit. It carries the validated world, advisory diagnostics, and the agent's natural-language reply, and NOTHING else — the agent's system prompt, op grammar, lexicon, model id, and raw op trace are never exposed. When the agent needs clarification it returns its question in reply and leaves the world unchanged.
A playable world. The full contract is published as JSON Schema at https://alakazam.gg/schema/smworld-1.0.json (see schema/COMPATIBILITY.md). Additional optional properties are allowed (forward-compatible).
The full validateWorld set (advisory warning/info findings) for the persisted world.
The agent's natural-language summary of what it did, or a clarifying question when no change was made.