# the action manifest and recipe spec

the open, versioned format a site publishes and a runtime verifies.

Two documents, both plain JSON with published JSON Schemas.

- [Manifest JSON Schema](/spec/manifest.schema.json) (`orsel.manifest/1`)
- [Recipe JSON Schema](/spec/recipe.schema.json) (`orsel.recipe/1`)

## manifest

One per site: the domain, a version that only goes up, and a list of actions. Each action has an id, a name and description, an input schema and an output schema (JSON Schema), a risk class (`read`, `write`, `sensitive`, `irreversible`, `financial`), preconditions and postconditions (machine-checkable conditions), an auth kind (`none`, `session`, `oauth`), idempotency behavior (`none`, `key`, `natural`), rate hints and an optional owner policy reference.

Postconditions are what makes a run succeed. A click or a 200 is not success: the run is `succeeded` only when every postcondition passes against what was actually observed. A condition with no evidence fails.

## recipe

One per action version. Ordered tier plans (`api`, `webmcp`, `replay`, `dom`, `agent`), the origins every step may contact, canary inputs with synthetic data, the publisher and its key id, provenance (how it was made), and a content hash. The hash is SHA-256 of the RFC 8785 canonical JSON of the signed body; the signature is Ed25519 over the hash.

Status moves `candidate`, `verified`, `degraded`, `quarantined`, `revoked`. A recipe becomes `verified` after 5 consecutive passing canary runs spanning at least a day. It degrades at 2 failures in the last 10 runs or after 72 hours without a pass, and is quarantined after 3 consecutive failures. Quarantined and revoked recipes never run.

## verify one yourself

```ts
import { verifyRecipe } from 'orsel/verify';

const result = await verifyRecipe(recipe, { [recipe.signature.keyId]: publicKey });
// { ok: true } or { ok: false, reason: 'hash_mismatch' | 'bad_signature' | ... }
```

Recipes are data. A recipe that needs a script runs it in a sandbox with no ambient network or storage access beyond its declared origins.
