01 / QUICKSTART
Submit a contract, inspect the outcome.
Start with a task and explicit checks. The API returns an Oath envelope that can be read until it is fulfilled, failed, cancelled, or needs review.
curl -X POST http://localhost:3000/api/v1/oaths
-H "Content-Type: application/json"
-H "Origin: http://localhost:3000"
-H "Idempotency-Key: docs-demo-1"
--data @contract.json
# Requires explicit local MOCK + LOCAL_DEMO settings; hosted calls use identity/API key.The API is D1-backed when configured. Seeded records are shown only as an explicitly labelled showcase when the API cannot be reached; reads never resume or mutate execution.
02 / CONTRACT
Inputs are the promise.
These fields describe the result and conditions that must be satisfied. The builder sends scenario shortcuts only in explicit MOCK mode; LIVE requests omit them and this build rejects LIVE Oath creation until a provider is configured.
{
"title": "Find 20 qualifying companies",
"input": {
"output_format": "table",
"required_fields": [
"company",
"website",
"fit",
"source"
],
"conditions": [
{
"key": "count",
"name": "Minimum result count",
"kind": "min_items",
"definition": {
"path": "/items",
"value": 20
}
},
{
"key": "evidence",
"name": "Evidence required",
"kind": "evidence_per_item",
"definition": {
"path": "/items",
"minimum": 1
}
}
],
"allowed_domains": [
"company.example"
],
"freshness": "14 days"
},
"max_attempts": 2
}| Field | Purpose | Required |
|---|---|---|
title | Plain-language outcome request. | Yes |
output_format | Table, JSON, CSV, or Markdown. | Yes |
conditions | Canonical allowlisted checks with bounded operands. | Yes |
allowed_domains | Optional source boundary. | No |
freshness | Maximum source age for a check. | No |
03 / LIFECYCLE
Every state is inspectable.
Work is executing under bounded attempts and provider-call limits.
Result and all configured deterministic conditions passed and a receipt was issued.
An attempt ended without satisfying the contract and no retry remains.
A condition is intentionally uncertain; no receipt is issued.
{
"oath": {
"id": "oath_…",
"status": "fulfilled",
"mode": "MOCK"
},
"attempts": [
{
"number": 2,
"status": "succeeded"
}
],
"receipt": {
"id": "rcpt_…",
"settlement": "issued"
}
}04 / AUTHENTICATION
Use workspace identity and scoped credentials.
The hosted app uses private Sites/workspace identity. The API-key settings panel creates and revokes D1-backed credentials; plaintext is returned only by the first create response and is never listed.
Authorization: Bearer <oathwork-api-key>External public access depends on the deployment’s access policy. Oathwork does not bypass workspace membership or invite controls.
05 / PREVIEW LIMITS
What this build does not claim.
- Sites can bind D1 and R2, but this repo does not provision a durable Cloudflare Workflow.
- MOCK execution is deterministic with bounded
waitUntilcheckpoints; there is no live provider or evidence retrieval. - Receipt preimages are tamper-evident record hashes, not independent evidence attestations.
- There is no MCP/invite/review-decision flow; identity, privacy, and production controls remain deployment work.
CLOUDFLARE REFERENCES
D1 documentation ↗R2 documentation ↗Workflows documentation ↗waitUntil runtime API ↗