Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

11 Traces

A trace is a JSON file that fixes all inputs of a flow and gives the expected decision. Every implementation replays every trace.

{
  "trace": 1,
  "profile": "AC1",
  "name": "invite signup, cancelled while it runs",
  "namespace": "example/v1",
  "settings": { "rp_id": "login.example.com", "origins": ["https://login.example.com"] },
  "steps": [
    {
      "flow": "signup.start",
      "time": 1700000000,
      "tenant": "t1",
      "draws": [ ["user", "AwQF…"], ["challenge", "AAEC…"] ],
      "reads": [ { "get": "invites", "key": ["…"], "row": { "…": "…" }, "version": 1 } ],
      "input": { "invite": "…" },
      "expect": { "output": { "…": "…" }, "writes": [] }
    }
  ]
}

(The values in this example are shortened.)

State: the format is a draft. Traces are not recorded yet; the Rust tests cover the same flows in memory.

Rules

  • time and draws are the only sources of time and randomness. Draws have a name and a length, and come in order. A step that asks for another draw fails, and so does a step that leaves one unused.
  • reads are in order, with their answers. A row that does not exist is null.
  • Comparison is exact, on canonical JSON (RFC 8785). writes are in order and include preconditions.
  • Signatures in traces are deterministic: Ed25519, and ECDSA as in RFC 6979.
  • A trace MUST NOT have data of a real person or a live key.
  • A refusal replaces output in a refused step. Its code is compared, not its text.

Coverage

Each normative sentence with MUST or MUST NOT that a flow can violate has at least one trace that fails if an implementation ignores it. A trace names the sentence by file and heading.

Storage behavior (races, crashes, preconditions) cannot be a trace. The storage conformance tests cover it.

Black-box runner

conformance/ runs scenarios over HTTP against a live test server: wrong origin, replay, reused codes, mixed tenants, downgraded algorithms, missing nonces. It needs no access to the implementation.