{
  "protocol": "shokai/0.5",
  "sdk": "@kigenka/shokai 0.5.1 (with the red-team round 3 fixes; 0.5.0 lacks them)",
  "note": "The protocol calls the grant a pass. On the wire the field is still seat.",
  "steps": [
    {
      "who": "Kettle & Leaf",
      "what": "opens on loopback (state file and keys in a temp folder)",
      "result": "pid <pid>"
    },
    {
      "who": "Aya's visiting representative",
      "what": "granted a pass; orders tea for 6.00 of 20.00 USD",
      "result": "order ok"
    },
    {
      "who": "Bo's owner",
      "what": "withdraws Bo's card during Bo's visit",
      "result": "Bo's next act: deny/not_now"
    },
    {
      "who": "the computer",
      "what": "the tea house's server stops abruptly (SIGKILL to its exact pid; nothing else touched)",
      "result": ""
    },
    {
      "who": "Aya's visiting representative",
      "what": "tries to act while the place is down",
      "result": "SHOKAI_PLACE_UNREACHABLE: the place is unreachable"
    },
    {
      "who": "Kettle & Leaf",
      "what": "starts again from its state file, same keys",
      "result": "pid <pid>"
    },
    {
      "who": "Aya's visiting representative",
      "what": "acts on its old pass",
      "result": "deny/not_a_fit/SEAT_SCOPE_EXCEEDED"
    },
    {
      "who": "Aya's visiting representative",
      "what": "knocks again: granted a pass, orders 6.00, then tries 9.00 (would pass 20.00)",
      "result": "act_result; then deny"
    },
    {
      "who": "Bo's visiting representative",
      "what": "knocks again with the withdrawn card",
      "result": "deny"
    },
    {
      "who": "Aya's visiting representative",
      "what": "reports home about the first visit",
      "result": "report written"
    },
    {
      "who": "Kettle & Leaf",
      "what": "stopped (exact pid); the temp folder is removed",
      "result": ""
    }
  ],
  "checks": [
    {
      "ok": true,
      "what": "while it is down, the visitor gets a clear error and marks the visit interrupted"
    },
    {
      "ok": true,
      "what": "the old pass gets a polite 'interrupted, please knock again' (not_a_fit, §3.6/§7.2)"
    },
    {
      "ok": true,
      "what": "the visit completes, and no door message id repeats across the restart"
    },
    {
      "ok": true,
      "what": "order references, passes and encounters differ before and after the restart"
    },
    {
      "ok": true,
      "what": "the mandate's ledger survived the restart (6 + 6 spent; 9 more refused)"
    },
    {
      "ok": true,
      "what": "Bo's withdrawn card stays withdrawn after the restart"
    }
  ],
  "report_home": "On <date> at <time> I visited the place with key …(this run's key) (claims to be \"Kettle & Leaf (demo)\"; not verified) for you. The place with key …(this run's key) (claims to be \"Kettle & Leaf (demo)\"; not verified) admitted me with a pass for \"menu.view\" and \"order.place\", up to 20.00 USD. I did 1 action; none were refused. This was visit 2 under the mandate you signed. Earlier: here, 1 action done, 1 refused, 6.00 USD spent. In all under this mandate: 2 actions done, 1 refused; spent 12.00 USD of the 20.00 USD allowed, 8.00 USD left. One action wasn't carried out: the place no longer knew my pass (probably a restart). One action got no answer (the place may have been restarting), so I can't tell whether it went through. The visit was interrupted. I'll knock again for a new visit, and won't repeat a purchase until I've checked; what was spent under your mandate still counts. I showed them the card you signed (your display name \"Aya Linden\" and your owner ID) and one mandate. Its listing said these actions ask you for nothing beyond the card. If you don't reply, nothing happens.",
  "ok": true,
  "place": "Kettle & Leaf (demo, fictional)"
}
