Expand description
SPEC-019 R.7: the state-layer exports, as one implementation every binding wraps (SPEC-010 REQ-002: a binding adds term translation and crash containment, never semantics).
Frames are S-expressions, like every other export; state, schema, and
rejections come back as canonical JSON (SPEC-019 R.3), a canonical act as
its wire text, and a self-address as f1220<hex>.
(fold <dialect> <thread> (acts (<signer> <message>) …)) → state JSON
(intend <dialect> <thread> (acts …) <signer> <verb> (:k v …)) → canonical act
(verify-state-shape <dialect> <message>) → "ok"
(state-schema <dialect>) → schema JSON
(may-send <dialect> <thread> (acts …) <signer>) → JSON array of verbs
(frontier <dialect> <thread> (acts …)) → {"instance","frontier"}
(admit <dialect> <thread> (acts …) (<signer> <message>)) → {"verdict":…}
(define …) → f1220<hex> (dialect_hash)<dialect> is a (define …) or a (dialects <ancestor>* <leaf>) chain,
installed through the full R1–R7 pipeline by parse_and_install_dialect;
the leaf is the dialect judged. Each act entry is the complete received
message with the signer the host authenticated; the cast is read from the
root among the acts and never supplied.
Enums§
- Admission
- One message’s admission verdict against an accepted set.
Functions§
- admit
- Admission as a consumer runs it (SPEC-019 R.4; SPEC-002 R5; SPEC-014 R6):
the shape stage judges the message alone (R5 shape, R7 state shape); the
causal stage judges it against the accepted set of its thread, under the
cast when the thread has an accepted root, and is
Pendingwhile a predecessor is missing.acceptedis the accepted set so far; the caller retriesPendingmessages as it grows. One implementation for every binding and for the corpus runner, so the accepted set a consumer folds is the one the corpus expects. - admit_
str (admit <dialect> <thread> (acts …) (<signer> <message>))→ JSON{"verdict":"accepted"},{"verdict":"pending"}, or{"verdict":"rejected","reason":…}. The acts are the accepted set so far.- dialect_
hash_ str - A
(define …)→ its self-addressed namef1220<hex>(SPEC-019 R.6). - fold_
str (fold <dialect> <thread> (acts …))→ the state as canonical JSON.- frontier_
str (frontier <dialect> <thread> (acts …))→{"instance":…,"frontier":[…]}.- intend_
str (intend <dialect> <thread> (acts …) <signer> <verb> (:k v …))→ the canonical act for the host to sign, orErrwith a JSON rejection.- may_
send_ str (may-send <dialect> <thread> (acts …) <signer>)→ a JSON array of verbs.- parse_
and_ install_ dialect - Parse a dialect S-expression, or a
(dialects <ancestor>* <leaf>)chain, and install each into a fresh registry through the full R1–R7 pipeline, checking a declared:hashagainst the canonical hash of the installed dialect. Ancestors precede the leaf so R5 resolves parent performatives. - resource_
check_ str - Pure escrow authorization, separate from
admit. Both are required before an external effect. Supplied history and signer identities must already be authenticated by the host. A locally ready result does not rule out a fork that a remote owner has withheld. - resource_
check_ value - The native result before JSON rendering, for hosts with limited integer precision.
- state_
schema_ str (state-schema <dialect>)→ the schema as JSON.- verify_
state_ shape_ str (verify-state-shape <dialect> <message>)→"ok", orErrwith a REQ-233 blame S-expression.