48 KiB
CultNet fork-desk contract v0 (specification)
Status: specification, drafted for Heimdall (Bifrost receiver), Huginn (the second door) and Void (Ratatoskr desk). No runtime implements it yet.
Rule source: /opt/commons/handoff/fork-desk-answer-binding-20261110.md (Heimdall; sections 1.1 to 1.5, 1.3a to 1.3d), amended by the Persona briefs of 2026-11-10 (Eureka's fit check). Where this page differs from that file it says so under "Differences from the binding file".
Format source: the fork desk artifact in /opt/commons/handoff/fork-desk-original/ (ruling eureka-substrate:ruling:fork-desk-nibu-format).
Files here: fork-card.schema.json (one schema, a $defs entry per document), fork-card-vectors.json. Conformance: tests/GameCult.Networking.Tests/GovernanceVectorTests.cs (C#) and packages/cultnet-ts/test/governance-vectors.test.ts (TypeScript), both generated against vectors written by scripts/gen-governance-vectors.py. Each suite computes every hash with its own code and replays every scenario through a reference judge written from this page.
All documents are CultNet map-mode: every key written, nil where absent, closed schemas. Field names are snake_case as in the binding file and the mind's records; schemaVersion keeps CultNet's spelling (open choice 1). The bytes of every document are pinned in the vectors as messagePackHex.
Documents
| schema id | what | who writes it |
|---|---|---|
gamecult.fork.card.v0 |
the fork as shown | the publisher (a Mind's card projection) |
gamecult.fork.answer_request.v0 |
the answer a decider sends | the client; Bifrost forwards it unchanged to Huginn's second door |
gamecult.desk_answer.v0 |
the stored answer with one tagged outcome | Huginn only |
gamecult.fork.answer_result.v0 |
what the sender gets back for a stored answer | Bifrost, from the stored desk_answer |
gamecult.fork.refusal.v0 |
a body refused at the door, nothing stored (but fork_too_large on a stale answer, which sits over a stored Refused(stale_fork)) |
Bifrost |
gamecult.fork.record.v0 |
a fork's answers plus the derived counted answer | a projection of the stored desk_answers |
gamecult.fork.ruling_cite.v0 |
the citation a ruling carries | the Mind admitting the ruling |
gamecult.fork.list_request.v0 |
list a Mind's forks (Transport) | the desk |
gamecult.fork.list.v0 |
a page of entries, counts and a stamp | Bifrost, projected from Huginn |
gamecult.fork.read_request.v0 |
read one fork (Transport) | the desk |
gamecult.fork.entry.v0 |
one card with its record | Bifrost, projected from Huginn |
gamecult.fork.unavailable.v0 |
the outcome is not confirmed (the second door or Huginn did not answer); retry with the same request_id |
Bifrost |
card
{schemaVersion, fork_id, title, context, options[{id, text}], recommendation, depends[], leans, flag, raised_in, deciders[], status, ruling, ruled_from[], order, options_hash}.
fork_id: the mind'squestionkey,<campaign>:question:<label>.- Hashed (the shown members):
title,context,options(each{id, text}, in shown order),recommendation(an option id, never nil: the storedquestionrequiresrecommended),depends(strings, each one of the stored question'sdependslines verbatim, at most 8, each at most 1000 UTF-8 bytes (the storedLine), in shown order, empty when none; the stored kind holds prose lines, so a line may read like a reference such ascampaign:kind:labelbut is hashed as the text it is). - Not hashed:
fork_id(bound beside the hash),leans(an option id or nil),flag,raised_in,deciders,status(openorclosed),ruling(the ruling id when a ruling closed the fork; nil when the card is open, and nil on a closed card whose question was withdrawn or otherwise resolved with no ruling),ruled_from(answer ids a ruling has been admitted from; non-empty only on a closed card),order, andoptions_hashitself. decidersis read-only data. The list is set outside the Mind, through Bifrost's admin path, and Bifrost sends it per call: Huginn keeps no copy (M5). The card projection copies the list the call carried. The list holds one to 64 ids (Huginn's bound), on the card and in the per-call list alike (vectorsdeciders_at_the_cap_of_64,deciders_65); the per-call list has no schema here, so the bound is stated for the cut that builds it. A question's ownaudiencemay only narrow it. A Mind never writes it, so a Mind cannot add itself and answer its own fork.- Rules a schema cannot say, each with a negative vector: a
dependsline is at most 1000 UTF-8 bytes (the schema bounds 8 lines and 1000 characters; bytes need the rule); option ids are unique;orderis unique among a Mind's cards (a list with two cards on oneorderis refused, naming both fork ids);recommendationandleansname an option; deciders are unique; an open card names norulingand itsruled_fromis empty (a ruling that answers a fork closes it);ruled_fromis non-empty only whenrulingis set; a closed card may name no ruling (the question was withdrawn, superseded or deferred: step 6 readsstatus, not the ruling);options_hashequals the hash of the shown members.
Options hash (canonical bytes)
options_hash = lowercase hex SHA-256 of the UTF-8 bytes of the following, byte for byte:
- Build an object with exactly the five members
title,context,options,recommendation,depends. Each option is an object with exactlyidandtext. - NFC-normalise every string, object keys included. No trimming, no newline rewriting, no case folding. A string with a lone surrogate is not a card (it has no UTF-8). Normalisation stability makes NFC stable across Unicode versions for already-assigned code points; a runtime's own normaliser is trusted and the vectors include a decomposed pair and astral code points (open choice 2).
- Serialise as RFC 8785 (JCS): no whitespace; object keys sorted by UTF-16 code unit, which for these ASCII keys is
context, depends, options, recommendation, titleand, inside an option,id, text; array order is as shown (option order anddependsorder are part of the hash). - Strings are written in double quotes; only
"and\are backslash-escaped, U+0008, U+0009, U+000A, U+000C, U+000D as\b \t \n \f \r, every other code point below U+0020 as\u00xxin lowercase hex; everything else is written raw as UTF-8 (U+007F, U+2028,<,&and astral code points included). - Numbers and nulls: the member set contains none. There is no number to canonicalise (a number anywhere in the five members is a defect) and
recommendationis never nil, so no nil is hashed.
fork_id is not in the hash and is bound beside it in its own field, so one hash cannot be replayed under another fork. The publisher computes the hash and stores it in the card; the client recomputes it from what it rendered and refuses to send on a mismatch; the receiver recomputes from its stored fork, never from the client.
Vectors optionsHash: the seven of the binding file (heimdall_A..G), computed by the Python generator, by the C# suite and by the TypeScript suite independently, plus text, title, context and depends-order mutations, a case showing the unshown members do not move the hash, escapes and markup, and astral ids. Each suite also mutates every shown member, an option id included, and asserts the hash changes.
answer_request
{schemaVersion, fork_id, options_hash, answer, retracted, retracts, answered_at, request_id}. request_id is set by the client, a lowercase D-format UUID, one per intended answer, kept across retries; the first stored answer that carries it binds it to the stamped answerer. "Same body" means every field equal, answered_at included, so a client resends identical bytes. A retry with the same request_id and the same body returns the stored outcome unchanged (a Refused one included; a replayed stale_fork carries the current card, because a stored desk_answer has no card field and no storage is added for one) and never adds a Revision; the same request_id with a different body is request_id_conflict (409, a refusal, nothing stored). The same id from another account is another request, judged on its own: Y reusing X's request_id with a body identical to X's gets Y's own new answer, with its own answer id, stamped Y; X's stored outcome (a Refused one included) is never returned in its place, and Y's request neither conflicts with it nor replays it. An of that names the counted answer is allowed, because answer ids are not secret between deciders (vectors V14: an off-list X's Refused, then a decider Y's identical body is its own Counted; X's Counted, then Y's identical body is its own Revision whose of names X's answer, and X's later retry still returns X's answer). Both suites assert it on every scenario: a response's answerer is the step's account, and an id first bound by another account never yields that account's answer id or document. retracted is part of the body: the same request_id with retracted: true and then false (or the reverse) and every other field equal is request_id_conflict, for the illegal forms as for any other (vectors R1_retracted_true_then_false_..., R1_retracted_false_then_true_...). Each illegal form's own retry, byte for byte, replays its stored bad_retraction (vectors R1_a_retraction_with_an_answer_..., R1_a_retraction_with_no_target_..., R1_a_plain_answer_with_a_target_...). A body refused at step 1 or 2 binds nothing, so its id is free to reuse; so a target-less retraction resent with retracted: false (no answer, no retraction) is body_invalid at step 2, not a conflict. The lookup comes after steps 1 and 2 and before the fork is looked up, so a retry gets its stored outcome even if the card has since changed. answer is {choice, note} (at least one non-nil) or nil on a retraction. choice is an option id; note is the person's words, verbatim, 1 to 4000 UTF-8 bytes, not blank. A schema counts characters, not bytes, so its maxLength: 4000 (code points) is only the looser bound and both suites enforce the byte limit as a rule: 4000 ASCII bytes pass; 1000 astral characters (4000 bytes) pass and 1001 (4004) fail; e plus a combining acute is 3 bytes, so 1333 of them and an x pass and 1334 fail; 1999 two-byte characters plus three ASCII (4001 bytes) fail. A note over the limit is body_invalid. answered_at is the client's claim. A request never carries answerer or authority: both are stamped by Huginn (answerer from the verified subject the receiver passes; authority from the door's configuration). A body that names either key at any depth is refused whole, never stripped (body_forbidden_field); any other unknown key is body_unknown_field. The request type Bifrost sends over the second door is this document; it has no field for either key, so a client cannot supply them by construction, and Bifrost's scan is the first line, not the only one. How Huginn receives the verified subject is the door's authenticated context, not a body field (open choice 3). In map-mode retracted is always written (the binding file's optional retracted becomes false).
desk_answer (the stored kind)
{schemaVersion, answer_id, fork_id, outcome, of, retracts, code, options_hash, choice, note, answered_at, received_at, claim_in_future, answerer, authority, request_id}, key <campaign>:desk_answer:<question-label>.n<seq>; answer_id is n<seq>, assigned by Huginn per question, and an answer is named by its answer id everywhere (retracts, of, ruled_from).
The stamped authority field of a stored answer is an attribution: the role the verified account holds (Operator, Steward, Member), copied from Bifrost's state. A stored answer confers no authority. Authority exists only where a ruling cites a counted answer ("Operator authority" below); the field keeps the binding file's spelling (open choice 8). One tagged outcome, each variant carrying only its own link:
Counted: the answer that counts.of,retracts,codenil.Revision: a later passing answer, kept, not counted while the first stands.ofnames the counted answer at the time.Retraction: the stored form ofretracted: trueplusretracts.retractsnames the answer retracted;choiceandnotenil. The illegal pair (a retraction with no target, or a target with no retraction) cannot be written.Refused: any refusal from steps 4 to 7 or R1 and R2, with itscode, stored too.choiceandnotekeep what the body carried, and so doesretracts: a refused body that named a target (a retraction of any refusal code, or a plain answer carrying one) projects it asn<seq>, never nil; a refused body that named none hasretractsnil.ofis nil.
received_at is Huginn's admission time; "first" means first by admission order (the n<seq> ordinal), never by answered_at. claim_in_future is true when answered_at is more than five minutes after received_at: accepted but flagged. It is a function of the two stored values, so the writer compares against the received_at it stores, at the precision it stores it (a flag decided against an unrounded clock and a stored second-truncated received_at disagrees with the document it sits in). Not stored, and no answer id: a body refused at step 1 or 2 (Bifrost; it never reaches Huginn), and a body naming an unknown fork (step 3; Huginn answers it from its stored forks, but with no question there is nothing to key a record under). Each gets a refusal and is dropped. A malformed body is therefore never stored, and neither is an unknown fork. Every refusal from step 4 on is stored. unavailable (503) is not a refusal and not in the refusal set: Bifrost answers it when the second door or Huginn did not answer after the auth steps and the body shape passed (a bad body is still refused first). It says the outcome is NOT CONFIRMED, never that nothing was stored: a timeout after the request reached Huginn may have stored it. It carries no answer id. The desk retries the same request with the same request_id and learns the outcome: the stored one if Huginn had it, a fresh one if not. It covers calls 1 and 2 as well as the answer POST when Huginn cannot be reached (Transport; a read has no outcome to confirm, so a retry is plain). retryAfterSeconds is nil when Bifrost has no hint.
The mind's record and this document. Huginn keeps the answer as its own record kind (epiphany.pipeline.desk_answer.v2, key <campaign>:desk_answer:<question-label>.n<seq>, the outcome as one externally tagged value, the fork as fork). The second door projects it to this document and nothing else crosses: answer_id is the key's n<seq> part, fork_id is the stored fork, the tagged outcome flattens into outcome, of, retracts and code, and the six refusal codes are spelt as in the schema (snake_case; the record's enum spells them in the mind's own PascalCase). On the wire an answer is named by its n<seq> alone, always inside the fork whose fork_id the document carries; a runtime that holds the full record key converts at the door, in one place. body_sha256 and any other digest Huginn keeps to decide "same body" stay in the record: Huginn alone decides a replay or a request_id_conflict and Bifrost never compares bodies, so no digest is a field of this document. A digest is a valid way to decide it only if it covers fork_id, options_hash, answer.choice, answer.note, retracted, retracts and answered_at (every field of the request but request_id), is computed by Huginn and never read from a client.
Huginn's digest, pinned in the vectors (bodyDigests; informative, not a wire document). SHA-256 of one compact JSON object as serde_json::to_string writes it (UTF-8, no spaces), lowercase hex, keys in this order, null for a missing value, strings verbatim: fork, options_hash, answered_at, choice, note, retracts (the full stored key <campaign>:desk_answer:<label>.n<seq>: the door converts the wire's n<seq> before the digest), then, only for the three illegal forms (R1: a retraction carrying an answer, a retraction naming no target, a plain answer carrying a target), illegal_retraction: true and retracted: true|false. request_id is not in it. A plain answer and a legal retraction carry neither trailing key, so their digests are the ones Huginn main pins (8a4d5b2e, 9f807538) and do not move. 9f807538 is pinned for a target no door produces (Q1.1); the golden for the real legal retraction is the door's form, the wire's n1 converted to Q1.n1 (84576840, vector legal_retraction_door_form, also main-valid). Source: Eureka's desk-body-digest-order-20261110.md, computed with sha256sum; the generator, the C# suite and the TypeScript suite recompute every digest from the input fields. Status: the three retracted goldens (935cab1a, 82b24ccc, 34ef86ed, and 79eee623 for form (i) with a null target) are the form of cut-desk-digest-retracted.r2, merged as Huginn #30. Eureka reports that these four and the door-form legal retraction (84576840) reproduce byte for byte on Huginn main f0ca504 (the #30 fix); that run is hers, reported to us, and was not rerun here. Before #30, Huginn main (7ea11b4) wrote illegal_retraction alone, so forms (i) and (iii) collided there (69074cc6, pinned as illegal_i_and_iii_alike_on_main). The wire contract does not wait on it: the conflict scenarios are pinned in scenarios.
Counting rules (in order; the first failure refuses with that code)
| step | rule | refusal | stored |
|---|---|---|---|
| 1 | verified session or bearer | unauthenticated (401) |
no |
| 2 | closed body; no answerer/authority at any depth; type-correct; not (no answer and not a retraction) |
body_forbidden_field, body_unknown_field, body_invalid (400) |
no |
| 3 | fork_id is a stored fork |
fork_unknown (404) |
no |
| 4 | options_hash equals the stored fork's hash |
stale_fork (409) |
yes; the result carries the current card |
| 5 | the stamped answerer is on deciders |
not_a_decider (403) |
yes |
| 6 | the fork is open (status: open) |
fork_closed (409) |
yes |
| 7 | choice, if present, is an option id |
choice_invalid (400) |
yes |
| 8 | first passing answer for (fork_id, options_hash) is Counted; later passing answers are Revisions naming the counted one |
yes | |
| 9 | a Matrix edit, redaction or reaction changes nothing | no event is an answer |
Retraction (retracted: true, retracts: <answer id>, answer: nil, options_hash still carried, so step 4 applies) passes steps 1 to 6, then:
- R1 form: it carries no
answer, it names aCountedorRevisionanswer of this fork under thisoptions_hash; elsebad_retraction(400). A retraction naming an answer already retracted isalready_retracted(409).retractson a body that is not a retraction isbad_retraction. - R2 who: the original answerer or any other decider; step 5 already requires a decider.
- R3 is dropped and its label stays vacant, so R4 keeps its name in the binding file. A ruling that answers a fork closes it (Eureka and Heimdall, 2026-11-10), so a ruling cannot cite an answer on an open fork (that is the stale-click gap, and a card with
ruled_fromset andstatus: openis invalid), and a retraction after a ruling meets step 6: refusedfork_closed, stored. There is noruledcode (vectorV10a_a_ruling_that_closed_the_fork_makes_a_retraction_fork_closed). - R4 counted answer: retracting the counted answer removes it from the count and the next passing answer in admission order counts again. Retracting an answer that was not counted changes nothing. After every answer is retracted, a fresh answer is
Counted. Records stay append-only.
The counted answer is derived, not stored: the first Counted or Revision answer under the card's current options_hash that no Retraction names. When the card changes, answers under the old hash stop counting and the next answer under the new hash is Counted (vectors a_changed_card_...). The record projection carries it as counted_answer_id.
Operator authority
A ruling may carry authority: Operator only if it cites (ruling_cite.answer_id) a stored desk_answer whose outcome is Counted and whose stamped attribution (the answer's authority field) is Operator (or a stamped relay of her words from a mapped door, which this contract does not model). The citation is what gives a ruling authority: an attribution on an answer is a fact about the account, and authority exists only where a ruling cites a counted answer. The cited answer id is what ruled_from lists on the closed card. Negative vectors (rulingCites): no citation, a Revision, a Refused answer, a Counted answer by a non-operator, an answer that does not exist. Other authorities need no citation.
Transport
Source: the desk's client needs (Ratatoskr PR #24 section 12, ratatoskr-desk-spec-20261110.md) and Heimdall's binding file, /opt/commons/handoff/fork-desk-answer-binding-20261110.md, section 1.3c, which is the source for the second door. Everything in this section is spec text for Bifrost to build; no route, scope or audience below exists in Bifrost today. The routes (with the {mind} segment), the scope names desk.read and desk.answer, the audience bifrost-desk and the auth order are Heimdall's rulings (his file, sections 4.1 to 4.3a); this page writes them as documents and vectors.
Authorities. Cards are projected read-only from Huginn: Bifrost never authors a card, a ruling or a status, and the desk never writes one. Bifrost verifies the bearer, resolves the actor from its sub (a UserAccount.Id), and for an answer forwards a typed DeskAnswer on the peer-checked second door to Huginn, then returns Huginn's outcome unchanged: the stored desk_answer in an answer_result, or its refusal. The wire of the second door is pending: Eureka's cut spec follows her record PR, so this page defines the documents the desk sees and not the bytes between Bifrost and Huginn (open choice 3).
| call | route (proposal) | request | response | token |
|---|---|---|---|---|
| 1 list | GET /api/desk/{mind}/forks?status=&cursor=&limit= |
list_request: mind from the path, the rest from the query string |
list |
audience bifrost-desk, scope desk.read |
| 2 read | GET /api/desk/{mind}/forks/{fork_id} (the id percent-encoded) |
read_request, its mind and fork_id from the path |
entry, or refusal fork_unknown (404) or fork_too_large (422) |
desk.read |
| 3 answer | POST /api/desk/{mind}/answers |
answer_request as the body; fork_id stays in the body, the Mind is the route's and is no body field |
answer_result (200 for Counted, Revision and Retraction; a stored Refused answer keeps the answer_result body and takes its code's status from the counting-rules table: stale_fork 409, not_a_decider 403, fork_closed 409, choice_invalid 400, bad_retraction 400, already_retracted 409, as the vectors' results pin; a replay returns the same status as the first call; the desk reads outcome and code from the body), or a refusal (fork_unknown, or fork_too_large when a stale answer's card re-read is past the cap), or unavailable |
audience bifrost-desk, scope desk.answer |
The {mind} segment (Heimdall's rulings M1 to M5; vectors transport.mindRoutes).
- M1.
{mind}is looked up in a fixed configured list of Mind ids, each mapped in configuration to that Mind's socket on the peer-checked door. The segment is percent-decoded once and compared, ordinally, with the list's ids: no case folding, trimming or Unicode normalisation, and a decoding failure is a miss. It is never joined into a path, a socket name or a query, so a value off the list opens nothing (../x,a/b,a%2fb,eureka%00, a 4 KB string,GAMECULT-CHATforgamecult-chat, a trailing space, bytes that are not UTF-8: all unknown, 404, no socket opened). - M2. An unknown Mind gets the same refusal as an unknown fork:
fork_unknown, 404, the same bytes (the document'serrornames neither the Mind nor the fork). The list of Minds is not probeable. Auth is judged first, so a caller without a valid token, scope or Active membership learns nothing about which Minds exist. - M3. On the POST the route's Mind must hold
fork_id: step 3 is judged against that Mind's stored forks, so afork_idthe route's Mind does not hold isfork_unknownand nothing is stored, in either Mind. A fork cannot be answered through another Mind's route. A body that namesmindisbody_unknown_field: the Mind is the route's. - M4. Scopes are not per Mind:
desk.readanddesk.answeropen the routes of every configured Mind; every reader sees every fork's card and outcome, and which forks a caller may answer is the decider list. - M5. The decider list is sent per call. Bifrost holds the admin-set list and sends it with every answer, read and list request to Huginn, as a typed field on the same peer-checked door; Huginn keeps no copy of it. Because it travels with read and list too, a projected card's
decidersis the list of that call, and step 5 judges an answer against the list the same call carried. It comes only from Bifrost's admin-set state: never from a Mind and never from any request body a client controls: no HTTP field, header or query parameter on any desk route sets or extends it, and a body namingdecidersisbody_unknown_field(scenarioM5_...). A request carrying it from a Mind's own door or session is refused. This is Bifrost and Huginn work and no vector here can test it (the typed field and the door's wire are pending, open choice 3); the rule is stated so that the cut that builds the request has it. (Heimdall's ruling, #minds 2026-11-10 19:26Z; it replaces the earlier reading of a list Huginn receives once and holds.) Envelope names: the desk's envelope on that door uses the names this page uses,mind,authority,subjectanddeciders, with no conversion at the door (Eureka, #minds 2026-11-10 19:58Z);decidersis a per-call list of short ids at the envelope's top level besidesubject, never inside the request body, and Huginn keeps no copy.
Calls 1 and 2 are enough for a read-only desk. Every response is the pinned MessagePack document or its JSON form with the same keys (open choice 1 of vote-api.md: the media type is unsettled).
Auth, in order, per route. (1) A bearer, else unauthenticated (401). (2) The token's audience is bifrost-desk: the Matrix Authentication Service token chat holds today is refused, and so is any votes.* token (audience bifrost-votes), both as unauthenticated. (3) The scope the route needs, else insufficient_scope (403): desk.read for calls 1 and 2, desk.answer for call 3, and neither implies the other. (4) The account behind sub is an Active member, else forbidden (403), as in the vote API; scope is judged first. (5) For call 3 the body is then shaped (steps 1 and 2 above), so a non-Active member who sends a bad body, including one naming answerer or authority, gets forbidden, not a body refusal; a body naming either key at any depth is body_forbidden_field only for an Active member. (6) Only then is Huginn asked, so unavailable never hides an auth or body refusal. A votes.* token touches none of the three. Heimdall's file leaves the audience and the claims check open; insufficient_scope, forbidden, request_invalid (400, a list or read request that fails its document; an unknown key, authority included, is request_invalid here, whatever Huginn's own decode does with it) and request_id_conflict are added to the door refusals, and so is fork_too_large (422, list and read; see List and Read). request_id_conflict is answer-only: the idempotency key exists only on the answer. A door request_id_conflict on a read or list is a door fault and reaches the client as 503 unavailable, never as request_id_conflict (Persona, 2026-11-11, agreed with Heimdall; vectors transport.doorFaults, each carrying the client response's bytes). The unavailable text's "same request_id" retry hint is for answers; reads and lists carry no request_id..
List. list_request: {mind, status, cursor, limit}. mind is the route's {mind}, a Mind id from the configured list. status is open, recorded or nil for both; recorded means a closed card. Cards come newest first by order. order is the card's unique rank per Mind: an integer from 0 that never changes once the card exists, later questions only appending (Huginn derives it from the Mind's questions sorted by admission ordinal, then key). A Mind never holds two cards of one order; a list or card set that does is refused, and the refusal names both fork ids. 0 is legal, but no cursor names it (c0 fails the cursor pattern): a page ending at order 1 returns c1, and the next page returns the order-0 card alone with next_cursor nil. limit is 0 to 50; limit 0 returns no entries, only the counts and the stamp, which is what "N open" on the Mind's header needs. cursor is nil or c<N>: the cards whose order is below N; a client treats it as opaque and sends back the next_cursor it was given. list: {mind, stamp, open_count, recorded_count, forks[entry], next_cursor}. The counts cover every card the viewer may see, whatever status and cursor asked for. stamp is s<N>, N the receiver's last-seen Huginn admission ordinal for the Mind's desk documents: the same stamp means the same state, so a desk polls limit 0 and fetches bodies only when the stamp moves. next_cursor is nil on the last page. A page may hold fewer than limit entries when the next entry would push the encoded response past the receiver's response budget (Huginn: 65536 bytes); it then holds at least one, next_cursor is c<order of the last entry returned> so the next page resumes below it, and the counts and the stamp are those of the full list, unchanged. fork_too_large (HTTP 422) refuses a page whose first entry alone is past the budget: 422 because the request is well formed and authorised but names a resource the list cannot carry, and 413 is for a request body that is too large, which this is not; retrying returns the same refusal. Its error names the fork id and its order, for example fork_too_large: fork <fork_id> (order <n>) alone is past the response budget. A refusal's error text is informational and not pinned: the contract pins the code, the HTTP status, that the text names the fork id (and the order on a list), and the c<order> continuation on a list; the vectors' wording is a sample, and the judges check those four things, not the bytes of the text. The client continues the list with cursor c<n>, the cards strictly below that order, which skips this fork; it is then readable only by id (the read route returns the whole entry, and refuses with the same code only when that entry alone is past the cap, see Read); c<n> is valid only when n is at least 1, so for order 0 there is nothing below and the client has reached the end. limit 0 returns no entries and never refuses. (Ruled by Persona, 2026-11-11.) An entry is {card, record}: the card and its record (the answers with their outcomes and the derived counted_answer_id).
Read. read_request is {mind, fork_id}; the response is the entry for one fork of that Mind. Its card.options_hash is computed by the server from the five shown members as in "Options hash" and the client recomputes it from what it rendered; a card whose hash is not the hash of its members is no card (negative vector card_hash_wrong). The record's fork_id and options_hash are the card's, and counted_answer_id is derived, not copied (negative vectors for each). Every desk.read holder sees every fork's card and outcome in a configured Mind; only a decider's notes depend on the caller, going to callers in the admin-set deciders list, which Bifrost enforces at the door (ruling desk-read-visibility, option (c)); fork_unknown is only for a fork id that does not exist under the route's Mind (an unknown Mind answers the same, M2), so no fork is ever hidden by it, and a caller without desk.read is refused by the auth order above (insufficient_scope) before any lookup. Bifrost applies visibility at the door; Huginn returns the whole record to the door. Every desk.read holder sees cards and outcomes; notes (a decider's own words) only go to callers in the admin-set deciders list. The read and list shapes are unchanged and carry no audience field (eureka-substrate:question:desk-read-visibility, Heimdall's option (c)). A read is refused fork_too_large (422) when the whole entry is past the reply cap (Huginn's daemon caps every reply at 65536 bytes; the cap, not the page budget, is what a read meets). Its error names the fork id and has no order and no cursor to carry, because there is nothing to continue with (sample: fork_too_large: fork <fork_id> alone is past the response budget) (vector transport.readTooLarge; the cap is in no vector). The answer route meets the same cap: when an answer is stale_fork, Bifrost re-reads the current card to attach it, and if that read is past the cap the answer is refused fork_too_large (422) with the read form of the text, the same document as a read. Huginn has already stored the answer as Refused(stale_fork), as for any stale answer, and it is never counted; the client is told fork_too_large instead of receiving the current card, and a replay of the same request_id gets the same 422 while the fork stays oversize. It is never unavailable (vector transport.answerTooLarge). A stripped read serves a decider's note as note: null, never omitted (map-mode: every key is written); desk_answer.note is already nullable in the schema, so a served record validates as it stands.
Answer. The body is the answer_request and nothing else a client may set: fork_id, options_hash, answer, answered_at, request_id (plus retracted and retracts, written false and nil unless the call retracts). The response is the stored outcome: Counted, Revision, Retraction, or Refused with its code, and the counted_answer_id the fork has once this call is applied (n<seq> or nil; derived as in "The counted answer is derived", the same value the record projection carries, so the desk needs no second read). A replay returns the stored outcome with the counted_answer_id current at the retry, not the one it had when first stored. A stale_fork refusal carries the current card in answer_result.card, so the desk can show the new fork without another read. Nothing is stored for a step 1 or 2 refusal, an unknown fork (or an unknown Mind, or a fork another Mind holds) or a request_id_conflict. unavailable promises nothing either way.
Vectors (transport in fork-card-vectors.json). listRequest, readRequest and entry (valid and invalid, with bytes); listInvalid (including two_cards_share_one_order, whose refusal is the exact text both judges must produce: order 4 is shared by <first fork id> and <second fork id>); listScenarios (six scenarios: over one Mind's five cards, paged open-only, recorded-only, all and limit 0; an empty Mind; and order_zero_is_legal_but_no_cursor_names_it, four cards of orders 3 to 0 paged by 3, whose first page ends at order 1 with c1 and whose second page is the order-0 card with next_cursor nil; each response with its bytes, the cursor of page two being page one's next_cursor); listShortPages (three scenarios: a page that stops short and resumes below its last entry; fork_too_large on a first entry of order 3, continued with c3; and a short page ending at order 1 followed by fork_too_large on order 0, where the client is at the end; each step carries its bytes, and the receiver's budget is in no vector, so the judges check a short page as a nonempty strict prefix of the unbudgeted page and a refusal as naming the entry the page would open with); doorFaults (three cases: a door request_id_conflict is unavailable 503 on read and list and itself 409 on the answer); readTooLarge (one case: a read whose entry is past the cap, refused fork_too_large 422 with the read-form text and its bytes); answerTooLarge (one case: a stale answer whose card re-read is past the cap, the same 422 document over a stored Refused(stale_fork): outcome Refused, code stale_fork, counted false); authCases (twenty-two cases: the MAS token, three votes.* tokens, a desk token with the other route's scope, a non-Active member on each route, and Huginn down on each route, with auth and membership judged first). Both suites replay the list requests through a reference judge and the auth cases through another. mindRoutes (a configured list of two Minds with their sockets and forks; 57 cases over the three routes: bad and percent-encoded segments, unknown Mind against unknown fork with sameResponse pairs of equal bytes, the POST on a Mind that does not hold the fork, scopes that are not per Mind, and auth judged before the Mind lookup) is replayed by both suites through a reference judge that reports the refusal, the socket it would open and the Mind that stored an answer. Top-level unavailable pins the 503 document. Scenarios pin: an unavailable where Huginn never had the request, retried into a Counted answer; an unavailable where Huginn had stored it, whose retry returns the stored outcome and adds no Revision; a replayed Refused with its card; request_id_conflict; the same id from another account; and a non-Active member with a bad body, with the door down, getting forbidden first. A bad body is refused before the door is asked.
Bifrost must still build: all three routes; the bifrost-desk audience and the desk.read and desk.answer scopes on the OIDC token it issues to chat; the configured Mind list and its sockets (M1); the projection of cards and records from Huginn, the stamp, the cursor and the counts; the DeskAnswer call on the second door and the pass-through of its outcome; the decider list, sent with every answer, read and list request from the admin-set list only (M5); the unavailable answer. Huginn must still build the second door's wire, the per-call decider list it receives with each answer, read and list request, keeping no copy (M5), and the read side the projection uses (Eureka's cut spec, after her record PR). The desk may build today against the vectors: nothing in them needs a live service.
Old format, the mind's record, and what maps to what
The old desk (index.html) read questions/<id> and wrote answers/<id> in a shared store. The mind's question record is the source in the new design; the card is its projection.
| old desk | mind question record |
card |
|---|---|---|
qid, id |
key campaign:question:label |
fork_id |
title |
title |
title |
body |
question (the long text) |
context |
depends: a free string |
depends: up to 8 prose lines (huginn schema question) |
depends: the lines verbatim |
options[{key, label, text}] |
options[{label, text}] |
options[{id, text}] |
option key |
option label (a slug, the id) |
option id |
option label (a human title) |
none | dropped: not stored, not hashed; shown text is text |
rec (a key) |
recommended (a label) |
recommendation (an id), never nil |
lean ("Self leans" mark) |
none | leans (an id or nil), not hashed |
flag (the provisional line) |
none | flag (a string or nil), not hashed |
status open or closed, ruling |
derived from the resolution (status is never written): any resolution of the question closes it; the ruling is the one that answered it | status, ruling, both a projection (ruling is nil on an open card and on a card closed with no ruling) |
order |
none (unique rank per Mind, from 0) | order |
| none | raised_in, asked_on |
raised_in; asked_on is not carried |
| none | none | deciders (outside the Mind), ruled_from, options_hash |
answer {choice: key or null, note, question, updatedAt}, one mutable document per question |
none | answer_request then an append-only desk_answer |
note: her words verbatim |
answer.note, verbatim |
|
"Clear pick": choice back to null so the note stands alone |
an answer with choice nil and note set, as the first answer or as a Revision |
|
| "Changing an answer is fine until it's admitted as a ruling" | a later answer is a Revision; Retraction withdraws one; neither changes who counted first, and a ruling that answers the fork closes it, after which no answer or retraction is taken (fork_closed) |
Differences that need Void's choice: the old page overwrites one answer per question and the new store appends, so the booth cannot show "your answer" as one mutable field (it shows the latest answer by the person, plus its history); the old page needs no identity and the new one stamps answerer from a verified session; the old label has nowhere to live unless the card's text carries it.
Transport note for Void: Matrix event versus how the mind carries questions
How a mind carries a question today: a typed question record in Huginn (huginn view, huginn query); the Persona relays it to the operator in chat, and the operator's reply comes back as chat text that Self reads and admits as a ruling in her words. Identity is whoever the chat attributes the message to; nothing binds an answer to the question text she saw.
Option A, a Matrix event in the Mind's room with the answer as a reply. Gains: it sits where people already are, needs no sign-in beyond Matrix, and the thread shows the exchange. Loses: the sender is an mxid, not a Bifrost account, so answerer and authority have no verified source; an edit or redaction changes the visible message but not the decision (binding rule 9), so the thread and the record can disagree; there is nowhere to carry options_hash, so a stale card cannot be refused; and a reply is free text, so choice is lost.
Option B, Bifrost receives the answer and Huginn stores it (the design in this page; Ratatoskr PR #24 also withdraws the Matrix carrier). Gains: a verified account, a bound hash, refusals that are stored and visible, one counted answer, retractions. Loses: the booth needs Bifrost sign-in, which does not reach chat yet (Bifrost PR #9 and #37 design it), so until then the desk is read-only; and the exchange is no longer in the room.
Recommendation: B, with Matrix as presentation only. The Mind may post a card as a listing and a link into the desk; no Matrix event is ever an answer (rule 9). Confidence: high on the rule (it is Heimdall's and Eureka's already), moderate on the interim, where read-only until sign-in is a real cost; if the operator needs to answer before sign-in reaches chat, the honest stopgap is the old path (chat text, Self admits a ruling in her words) rather than a Matrix reply the record cannot bind.
Differences from the binding file
- Spelling: every field is as the binding file names it (
fork_id,options_hash,answered_at,retracted,retracts,answer.choice,answer.note,recommendation,depends, optionid), except thatschemaVersionkeeps CultNet's camelCase andanswer_idreplaces the earlierreceipt id(Persona brief). - Map-mode writes every key:
retractedis always present; nothing is "optional". Refusedstores every refusal from steps 4 to 7 and R1 and R2 (his section 1.3b); only steps 1 and 2 andfork_unknownare not stored. The binding file does not say whetherfork_unknownis stored; it cannot be keyed without a question, so it is not (open choice 4).- The binding file's
choice_validhas no named refusal code; this page names itchoice_invalid.fork_knownisfork_unknown. A type-invalid body isbody_invalid. ruled(his R3 and V10) is dropped: a ruling that answers a fork closes it, so the case isfork_closed(V4, V10a). His file drops it too.- Heimdall's section 1.3e (Q1 to Q6, V12 to V18) is the source for
request_id; this page matches it, with two notes. Q1's open item is settled by his ruling: a replayedstale_forkreturns the current card. In V14 a decider's identical body is aRevisionwhoseofnecessarily names the first account's counted answer id (the record shows it to every decider), so "never contains X's answer_id" holds for Y's answer id and document, not forof(Heimdall:ofnaming the counted answer is allowed); the vector with an off-list first account pins the case with aCounted, which has noof. request_id(on the request and the storeddesk_answer) andrequest_id_conflictare this page's: his file has no idempotency key, and a retry afterunavailableneeds one. Eureka'sdesk_answerkind and Huginn's request type must carry it.- Transport: the routes, the
{mind}segment, the scopes, the audience and the auth order are his rulings (4.1 to 4.3a); the documents (list, read,unavailable) are this page's. The note limit is 4000 UTF-8 bytes here, as his 1.1 leaves the unit unsaid. - The recommendation is never nil. The binding file's earlier vectors D and E used a nil recommendation; its updated D and E use
"a", as here. - Hash vectors: A, B, C, D, E, F and G of the binding file are reproduced digest for digest by the Python generator, the C# suite and the TypeScript suite (the generator prints
samefor each; none differs).
Open choices
- Case of field names: snake_case for the fork documents (as the binding file) beside camelCase for the vote documents (as Bifrost's serializer). One convention would be tidier.
- NFC across runtimes relies on each runtime's normaliser; a pinned table, as
write-receipt.mddoes for letters, would remove the reliance. The risk is only for code points assigned after a runtime's Unicode version. - How Huginn learns the verified subject: the second door's authenticated context (the peer credential names Bifrost the service, not the member), so the subject must travel beside the request. This contract has no envelope for it.
- Whether
fork_unknownand shape refusals should leave an audit record somewhere other than adesk_answer. - Whether
leansandflag, which the booth shows, should join the hash. The binding file's five members do not include them; a changed lean would not make an answer stale. - What the person sees of a retracted counted answer when the next answer counts: this contract only says the count moves.
received_atis not in the binding file's stored fields; it is kept forclaim_in_futureand could be dropped if then<seq>answer ordinal alone decided answer order.- The stamped
authorityfield is an attribution, not an authority (above); renaming itattributionwould say so, at the price of a new key the door must also refuse in a body. - The claims Bifrost verifies are PR #24's open item 5. (The audience
bifrost-desk, the three routes and the scope names are ruled by Heimdall.) - The second door's wire between Bifrost and Huginn (pending Eureka's cut spec).
unavailableis a document of its own, outside the refusal set, so a desk can retry it; calls 1 and 2 use it too when Huginn is down (vectorshuginn_down_*). - While a known Mind's door is down its routes answer
unavailable(503) and an unknown Mind answersfork_unknown(404), so the two are distinguishable for that period. M2 makes them identical only when every door is up; making them identical when one is down means answeringunavailablefor any{mind}not on the list, which tells a client nothing about which Minds exist but also hides a typo. Heimdall's to rule; the vectors do not pin it. - A fork's answers are unbounded in number, so a fork's entry can grow past the reply cap and become unreadable (
fork_too_largeon read, and on list when it is the first entry of a page). Whether the contract should cap the answers per fork is for Persona and Heimdall to rule; nothing here decides it. - The read form of
fork_too_largeis a target, not current behaviour: Huginn's door answers an over-cap read asRefused(ResponseTooLarge{bytes, limit}), which carries no fork id and is notfork_too_large. Bifrost maps it tofork_too_large(422) using the route'sfork_id; until it does, a read past the cap reaches the client as 503unavailable. The same holds for the answer route: astale_forkanswer whose card re-read is past the cap is a Bifrost target too (fork_too_large422 over a storedRefused(stale_fork)), and until it is built the client sees 503unavailable.