Expand description
The persistent interaction engine (spec §15, §23 steps C, L and P).
A card is a durable server-owned record, not a model tool call. This module is where the four rules that make that true are enforced against a real store:
- Persistence precedes the sentence.
InteractionEngine::persistwrites every specification the reducer asked for before any block of the response may refer to a card (§15.5). What it could not write is reported inPersistedInteractions::failed, and the caller must then say nothing about a card the user cannot see. - One blocking card per case. A blocking specification goes in through
InteractionWriter::insert_replacing_blocking, so the previous occupant is invalidated and the replacement gets a new identifier (§15.6). AResolvingoccupant is never replaced: its commands are running. - Resolution is compare-and-set.
InteractionEngine::acceptvalidates the client’s answer through core’svalidate_responseand then movesActive → Resolvingthrough the store’s own compare-and-set. A second click loses that race and comes back asResponseAdmission::AlreadyAnswered, carrying the record instead of authorizing a second execution (§15.5, I14). - Resolved means committed. A card becomes
Resolvedonly once the command its answer authorized has committed; otherwise it isFailedor restored toActiveaccording to policy. There is no path here that marks a card resolved on the strength of an intention.
§The channel is part of the authorization
validate_response takes a ResolutionChannel, and so does
InteractionEngine::accept: a structured click, a typed word that matched
a stored alias exactly, and a “yes” the interpreter inferred are three
different authorities, and the stored
TextResolutionPolicy
decides which of them the card admits (§15.7). The channel travels into the
CommandOrigin the answer mints, so a replay can say which one happened
(I20).
Structs§
- Accepted
Interaction - A client answer that passed every §15.5 rule and holds the card in
Resolving. - Interaction
Engine - Reads, writes and settles persisted interactions (spec §15).
- Persisted
Interactions - What
InteractionEngine::persistmanaged to write. - Response
Context - What a client answer is judged against (spec §15.5).
Enums§
- Response
Admission - What happened to a client answer.
Functions§
- derive_
interaction_ id - Derives the identifier of the card
keyofturn. - summarize
- The summary the reducer needs about one stored card.
- summarize_
all - The summaries of a set of stored cards, in the order given.