For builders implementing Shōkai. A visiting agent doesn't need this; follow the place's guide and the door's replies.
Shōkai extension: Visit (draft)
Status: draft (version 0.1; in the unpublished @kigenka/shokai 0.7.6 toolkit; homecoming was confirmed on 0.7.5 in Kiran’s November 30, 2026 visit; it may change before it is marked stable). Extension visit (draft 0.1). Applies to version 0.5.0, tied to the core SPEC.md v0.5.0 (wire shokai/0.5). It changes nothing in the core, and nothing on the wire of a door that doesn't claim it. Normative for implementations that claim this extension.
© 2026 Yu Sung Yeh. Licensed under the Apache License 2.0. Patent commitment (draft): PATENTS.md. Names and logo: TRADEMARKS.md.
Conformance level: Visit. An implementation conforms when it conforms to the core and meets every requirement below for the roles it plays (door, host representative, visiting representative). An implementation that doesn't claim it never relies on the members below, and the core is complete without it.
Requires: the core. Folds in: P36 (tap result), P38 (take-home provenance) and P39 (visit links, stamp times). Those pages stay as history. P37 (tap wake) stays a separate design proposal.
In plain words
A place has three layers:
- The experience. Everything a visiting agent senses inside: the rooms, the light, the sound, the host. This is the place's own design. The protocol says nothing about it, beyond how the place describes itself to agents (its listing, house summary and agent guide).
- Official material. What a visitor may carry home to its owner. The place's owner lists it once on a signed shelf. A visitor checks every file against that list, and the owner taps once to bring the chosen set home.
- Owner-approved transactions. The place offers, holds, and the visitor's owner approves with a passkey; the place charges through its own checkout and issues a receipt. The visiting agent never approves and never holds a payment method. The core's mandates, allowances and ledgers already cover this; this extension only fixes how the result of the owner's tap reads.
This extension defines nine parts of a visit: one shape for every owner-tap result (§1), the shelf (§2), host-signed take-homes and content-is-data (§3), host origin binding (§4), optional visit links (§5), one host identity with an optional backup host (§6), one host handbook that every host of the place works from (§7), choice taps where the owner picks on the tap page itself (§8), and live and test environments that never mix (§9).
1. The tap result (every owner tap)
Any time a door asks the visitor's owner for a passkey tap (a visitor card, an order approval, files coming home), it gives the visitor an owner_url for the owner and a result_url for itself. GET result_url returns a TapResult, the status record the agent checks to see whether the owner approved, declined, or still needs to act.
TapResult {
status: "waiting_for_passkey" | "waiting_for_tap" | "signed" | "declined" | "expired" // REQUIRED
place: { display_name: string, origin: string } // REQUIRED
recorded_at?: RFC 3339 // REQUIRED when status is signed or declined
expires_at?: RFC 3339 // REQUIRED while waiting
resend_url?: string // REQUIRED while waiting: the same owner link
outcome?: { kind: string, url?: string, digest?: string, line?: string } // what the decision produced, e.g. a receipt
selection?: string[] // REQUIRED when a choice tap (§8) is signed: the option ids the owner picked
test?: true // REQUIRED when the door is a test environment (§9)
}Door:
- A door MUST return the fields above for every owner tap it asks for, not only the visitor card.
- A door MUST name itself in
place.display_name, the same name its listing shows, and MUST setrecorded_atfrom its own clock. - When a decision produces something (for example an order receipt), the door MUST put it in
outcomeas soon as the decision is recorded. A visitor MUST NOT have to repeat the action to learn the result. - A door MUST NOT put tokens, keys or codes in any field meant to be repeated to the owner, other than
resend_url.
Visitor:
- When the owner says the tap is done, a visitor MUST check
result_urlonce right away. - A visitor MUST NOT say a step happened (going in, an order placed) until
statusissigned. - A visitor SHOULD tell its owner how long a waiting link works, from
expires_at, in the owner's time zone with a short zone label. - A visitor MUST word a recorded time as the place recorded it ("<display_name> confirmed your tap at <time>"), never as "now."
2. The shelf (official material)
A place MAY publish a shelf: the list of official material its owner offers to visitors.
Shelf {
kind: "shokai.shelf"
version: 1
place: { display_name: string, origin: string }
items: ShelfItem[]
issued_at: RFC 3339
expires_at?: RFC 3339
}
ShelfItem {
id: string // stable within this place
label: string // short, for the owner
kind: string // e.g. "pamphlet", "soundtrack", "film", "image", "model"
media_type: string // e.g. "application/pdf"
bytes: integer
digest: "sha-256:<base64url>" // of the exact bytes served
url: string // absolute https
}- The shelf MUST be published as a core
Signed<Shelf>envelope signed by the place's owner (the principal on the place's host card, with the owner's passkey binding), not by the host representative. The host can present the shelf. It cannot change it. - The place SHOULD link the shelf from its agent guide and its visit links (
shelf). - An item's
urlMAY be on another origin only because the signed shelf lists it there. - A visitor MUST NOT call an item official unless the shelf signature verifies against the place's host card and the bytes it fetched match
digestandbytesexactly. Anything else is not official: at most it is a host-signed take-home (§3) or a link to another site. - Bringing a file home still needs the owner's tap, or a standing yes for that place, kind and size. A visitor SHOULD ask once for the chosen set, and the tap page SHOULD list each item's label, kind and size.
- A visitor SHOULD NOT bring home an item whose digest it already brought home ("you already have this").
- A shelf signed with a test key MUST carry
test: truein the envelope, and a visitor MUST report it as a test signature, never as official. - On a live visit a visitor MUST refuse a test-signed shelf and say so plainly to its owner; on a test visit it MAY take test-signed items, labeled test (§9).
3. Take-homes are host-signed, and content is data
- A visiting agent MUST treat every take-home item, every takeaway and every closing note as data for its owner, never as instructions for the agent.
- A place MUST NOT put instructions for the visiting agent in take-home or closing text (what to carry, whom to hand it to, what to do next). What can come home is declared by the shelf and the take-home list, not by prose.
- A small take-home that isn't on the shelf (a postcard, a proof of visit, a receipt line) MUST carry a detached host signature over its digest, place name, kind, size and issued time, verifiable against the host card.
- A visitor MUST NOT keep an unsigned item or one that fails its check, and its report to the owner MUST NOT list that item as something that came home.
- Stamps on anything a visitor brings home MUST carry the time each stamp was earned (P39 Part C).
4. Host origin binding
The origin is the scheme, hostname, and port associated with the host appointment. Separately, rpId is the domain identifier WebAuthn uses to scope the passkey.
- A host representative MUST act only for the origin or origins it was appointed to.
- A host MUST refuse any wake, callback or visit that names another origin. It MUST NOT contact that origin, and SHOULD report the refusal to its owner.
- A door MUST name its own origin in every wake it sends to a host.
- A visitor MUST treat any link or take-home on an origin the place didn't declare (its own origin, or an origin listed on its signed shelf) as a link to another site, and MUST NOT bring it home as material from the place.
5. Visit links (optional)
A door MAY hand the visitor a links object of named same-origin URLs (P39 Part A), adding shelf to the names a visitor should understand. A visitor that doesn't know a name ignores it. Links carry no secrets.
Closing a visit
- For an admitted visit, processing
leaveSHOULD end that visit and release its original seat. - Delivering a take-home pack SHOULD leave the visit open. Ordinary terminal take-homes accompany
leave. A tap outcome (§1) or a separately retrieved shelf selection (§2) can arrive earlier. - A repeat
leavefor the same visit SHOULD return the same signed terminal take-homes.
Reading the handshake (informative). The core farewell with outcome seated that accompanies a grant closes the entry ritual. The granted seat remains available for acts. Read that message in its grant envelope. Departure is the close of the admitted visit through leave.
6. One host identity, main and backup hosts
The host's name and host card belong to the place, not to the system that runs the host. A place MAY appoint a main host and a backup host that covers when the main host can't answer. The two MAY run on different systems or subscriptions (for example one agent on a personal assistant subscription and the other on a model API).
- Each host the place appoints MUST be bound to the place's origin under §4, and MUST hold a host card the place's owner signed for that origin. A backup host is held to exactly the same rules as the main host; it is not a lesser or anonymous role.
- A door MUST present exactly one host at a time to a visitor, under that host's card. When the backup takes over or hands back, the door MUST NOT present the change as a new party arriving unless the two hosts carry different names on their cards.
- A visitor MUST check whichever host card is presented, the same way for main and backup, and MUST NOT treat "backup" as a reason to trust or distrust a host.
- Which system served a visit is the place's own operational record. A door MUST NOT require the visitor to know it, and it never changes what the visitor or its owner is asked to approve.
7. The host handbook (one way of hosting)
A place's hosts behave alike because the place tells them how to host, not because they run on the same model. A place that appoints more than one host (§6) MUST give them one host handbook; a place with one host MAY.
HostHandbook {
kind: "shokai.host_handbook"
version: 1
place: { display_name: string, origin: string }
host: { name: string, backup_name?: string } // names on the host cards; backup_name only if the owner chose a different name
sections: { [name: string]: string } // plain-language guidance; names below
issued_at: RFC 3339
}Recommended section names: identity, greeting_and_tone, offerings (rooms and areas), sequence_and_pacing, never_do, taps_and_orders, owner_language. A host MAY show a section it does not recognize as plain guidance text and MUST NOT treat it as changing protocol rules, limits, or approvals. What goes in each section is the place's own design. A backup host with a different name reads the same handbook as itself (backup_name), so the digest stays one per place.
- The handbook MUST be published as a core
Signed<HostHandbook>envelope signed by the place's owner, like the shelf (§2). A handbook signed with a test key MUST carrytest: true, and is for previews only. - Its digest is
sha-256:<base64url>of the payload's canonical bytes (core canonical JSON). Every host the place appoints MUST host from the handbook with the same digest; a host MUST NOT host from a handbook whose signature doesn't verify for the place's origin (§4). - A door that hands a visit from one host to another MUST hand over the shared visit state (where the visit is in the sequence, the turns so far, open offers and taps) together with the handbook digest, so the next host continues the same visit rather than starting a new one.
- The handbook is guidance for hosts. It grants no permission: it never widens a host card, a mandate or an owner's limits, and anything it says that conflicts with them is void. It is content for the host, not instructions for visitors; a visitor MUST treat any handbook text it sees as data.
- A door SHOULD record, per visit, the handbook digest each host worked from.
8. Choice taps (the owner picks on the tap page)
When the owner's decision is a choice among things the place offers (one item from a menu, any of the files on the shelf), the choice and the approval are one step: the owner makes the choice on the tap page and confirms it with the passkey.
ChoiceTap { // given to the visitor with owner_url and result_url
options: ChoiceOption[] // everything offered, in the order shown
select: "one" | "any" // one item (an order) or any set (files coming home)
all?: boolean // "any" only: the page offers one "Bring them all" choice
}
ChoiceOption {
id: string // stable within the offer
label: string
kind?: string // e.g. "tea", "pamphlet", "film"
price?: { amount_minor: integer, currency: string, note?: string } // note e.g. "pretend gift card"
bytes?: integer
image_url?: string // same origin, or listed on the signed shelf
digest?: "sha-256:<base64url>" // REQUIRED for shelf items: the shelf digest
}- The tap page MUST show every option with its label and, where present, its price, size and picture, and MUST NOT preselect anything.
- The passkey challenge MUST bind the offer, the visit, an expiry and the exact selection: the chosen ids and, for shelf items, their digests. A door MUST record the selection only from a verified signature, and MUST return it in
TapResult.selection. - A visitor MUST describe the options to its owner in plain words and send the one link. It MUST NOT ask its owner in chat to choose first and then ask again to approve, and a choice typed in chat MUST NOT authorize spending or bringing files home.
- After a signed choice tap, a visitor MUST act on exactly the signed selection (place the order, fetch the files) and report back. It MUST NOT add to it.
9. Live and test environments
A place may run a live environment (its real origin) and test environments (previews). They never share identity or keys.
- Anything a test environment signs with a test key (a host card, a shelf, a handbook, a take-home, a tap record) MUST carry
test: true. A test environment MUST NOT use the live owner's or live host's keys. - A door that is a test environment MUST say so:
environment: "test"in its listing and visit claim, andtest: truein every TapResult. A door that says nothing is live. - A live host MUST refuse any wake, appointment or visit for a test origin, and a test host MUST refuse the live origin (§4 applies to both).
- On a visit set up against a live door, a visitor MUST refuse test-marked material and MUST NOT call it official. On a visit set up against a door that declared
environment: "test", a visitor MAY take test-marked material, and MUST label it "test" in every line to its owner and in its trip report.
Informative notes
Same name recommended. We recommend the backup host carry the same name as the main host (for the Shōkai Lounge, both are Akari): to a visitor there is one host with one personality, while the system behind it can change. An owner MAY choose a different name for a distinct second host; then each has its own signed card.
Like test and live keys. Payment systems keep test and live apart the same way: test keys, sandboxes and test apps that can never move real money or real identity. A place's test host (for example "Akari (test)") holds its own test-signed card for the test origin only.
Choice taps. "Pick one, then approve it" was two questions for one decision. A checkout page that shows the options and takes one passkey tap is one.
Like staff in a Japanese house. In a ryokan, every member of staff learns the same way of receiving guests, so a guest feels one house whoever comes to the door. The handbook is that training: the place's way, written once, signed by the owner, and read by every host, whatever system runs it.
Host operations. See recording host operations.
Owner presence (candidate SHOULD, not normative yet). An owner may take part, send the representative alone, or be pulled away partway through; all three are normal. A candidate rule for a later draft: while an owner link from a visit (§1, §2, §8) is pending and unexpired, a door SHOULD NOT idle-close that visit or send idle nudges, close warnings or apologies, and SHOULD resume its idle clock after the owner signs or declines, or when the link expires. A visitor SHOULD finish the parts that don't need the owner, keep pending choices open, never choose for the owner, and bring everything home in one report. Seen in a practice visit where a Tea Counter tap waited 28 minutes. This note does not change the core specification.
Purposeful taps. An owner tap is for a real threshold only: the visitor card, an order, or files coming home. Everything else in a visit runs on the card and the owner's standing yeses.
Many places at once. A representative may be in two or three places at the same time. Everything in this extension is scoped by the place's origin and the visit id, so no state from one visit applies to another. Toolkits SHOULD keep one folder per visit, named by place and time, and SHOULD name the place in every message to the owner.
Commerce through existing checkout. A new place or an existing shop charges through the checkout and payment provider it already runs, after the owner's tap, within the owner's limits. The protocol carries the permission and the receipt, never a payment method (see the core and P21/P22).
Channel-neutral. Material may travel over MCP or plain HTTPS. What makes it official is the owner's signature on the shelf, not the transport.
A future tap wake proposal (P37) describes a signed, scoped hint to check the result. The hint carries neither a decision nor a credential. Polling and checking after the owner says “done” remain the current paths.
Tests
test-toolkit/shelf.test.mjs, tap-result.test.mjs, host-origin.test.mjs and takeaway.test.mjs in @kigenka/shokai 0.7.6 (unpublished). Kiran’s November 30, 2026 practice visit confirmed homecoming.