Artist Without A Canvas Studio

The surface in five calls — the chronicle record

You will found the chronicle's canonical record, append its six facts, collapse a recipe twice (watching the counter refuse to move), and verify the standing claim. Every value below is deterministic: your run prints the same hashes, because the record is the same record.

2.1 — Read the domains. curl -s $B/domains returns, per domain: its id and schema, founding fields, fact types, and recipe pins — followed by the refusalLaw and guarantees arrays, on the record. On a fresh tree the domain ids are chronicle and monster-forks. (The guarantees array is §7 of this guide, verbatim.)

2.2 — Found the record. Founding is an event: it happens once, and the moment is a fact you supply — the service never reads a clock to found a record.

curl -s -X POST $B/records -H 'content-type: application/json' -d '{
  "domain": "chronicle",
  "subject": "mara-voss",
  "moment": 1795334400000,
  "founding": {"hero": "Mara Voss", "calling": "the Tide Bell", "motif": "brass", "home": "Kettle Harbour"}
}'

Expected: HTTP 201, and a body whose load-bearing fields are:

{
 "recordId": "rec_93f8ca2648b73b25",
 "domain": "chronicle",
 "schema": "chronicle@1",
 "founding": {"v": 1, "schema": "chronicle@1", "foundingSeed": 3168402008, "foundedAt": 0},
 "head": 0,
 "hash": "sha256:93f8ca2648b73b2592b4953976e713e3bac3e78c34ee6d216ac0a414e61edc1d",
 "created": true
}

The founding fields ride the log as fact 0, typed founding. The record id is derived from the founding hash: the same founding always names the same record. Save the id for the next steps:

RID=rec_93f8ca2648b73b25

(Or read it out of your own response: jq -r .recordId. Yours will match the value above — that is the point of the exercise.)

2.3 — Append the six facts. Each append is one POST; each returns the position the fact was committed at. Run all six:

curl -s -X POST $B/records/$RID/facts -H 'content-type: application/json' -d '{"type":"deed","what":"rang the tide bell at the harbour mouth"}'
curl -s -X POST $B/records/$RID/facts -H 'content-type: application/json' -d '{"type":"panel-choice","panel":3,"choice":"she answers the bell herself"}'
curl -s -X POST $B/records/$RID/facts -H 'content-type: application/json' -d '{"type":"witness","who":"Old Tam","saw":"the water stand still"}'
curl -s -X POST $B/records/$RID/facts -H 'content-type: application/json' -d '{"type":"panel-choice","panel":7,"choice":"she gives the brass key to the keeper"}'
curl -s -X POST $B/records/$RID/facts -H 'content-type: application/json' -d '{"type":"deed","what":"carried the lamp down to the drowned steps"}'
curl -s -X POST $B/records/$RID/facts -H 'content-type: application/json' -d '{"type":"witness","who":"the keeper","saw":"a light under the water"}'

Expected: HTTP 201 each time; position and head climb 1, 2, 3, 4, 5,

  1. After the sixth, the record's head hash is

sha256:af86965ecba461ddf892f4f78dbf13753c30f9ac12b97ad62fe45f93f4c0c6da. Facts are append-only: a correction is a new fact, never an edit.

2.4 — Collapse, twice. A collapse names a registered recipe pin and derives at the record's head (or at a position you state):

curl -s -X POST $B/records/$RID/collapse -H 'content-type: application/json' -d '{"pin":"hero-founding@1","params":{}}'

Expected: HTTP 200 with "executed": true, "entry": 0, and:

{
 "contentKey": "sha256:9545dab3d3e5f5955064e6c83e3d50789fbc4e4616d82dc50c3d700d261b9995",
 "artifact": {"hero": "Mara Voss", "alias": "Mara the Brass", "power": "brass-shaping", "motif": "brass", "home": "Kettle Harbour"},
 "manifest": {
  "recordHash": "sha256:af86965ecba461ddf892f4f78dbf13753c30f9ac12b97ad62fe45f93f4c0c6da",
  "position": 6,
  "recipe": "hero-founding@1",
  "engine": "quantum-engine-core/0.1.0",
  "outputHash": "sha256:3471b834a25cb82ae5e420b076443a7d2989fa10656c053eba07a6d7ee97bf30"
 }
}

(The artifact also carries embodiment and costume fields; they are part of the hash, elided here only for print.) Now curl -s $B/stats: executions is 1. Send the identical collapse again. Expected: "executed": false, the same "entry": 0, the same content key — and /stats still shows executions 1. The identical collapse returns the standing ledger entry; it is never re-executed and never re-billed. That frozen counter is the fourth refusal law working, not an error.

2.5 — Verify. Re-derive the standing claim and compare:

curl -s -X POST $B/proof/verify -H 'content-type: application/json' -d '{"entry":0}'

Expected: "verdict": "MATCH", with expected and actual manifests carrying the identical output hash (sha256:3471b834…6d7ee97bf30). GET $B/proof/0 returns the ledger entry itself — inputs, hashes, manifest, artifact. And curl -s -X POST $B/records/$RID/replay re-derives every standing claim on the record: "allMatch": true. Note that verify and replay each moved executions (to 2, then 3): they execute re-derivations. Only the identical collapse is free.

You have now used the whole surface. The rest of the guide is about making the record yours.

← Start the service · The worked example — replay-verify, in process →