genesis_consent library
The enforce/reject action substrate: action validation IS hit-testing the live tree.
genesis_consent is the world-side end of the agent↔surface dialogue.
genesis_dialogue decodes a client action message into an
ActionEvent (parse only); consent routes it:
- ConsentRouter hit-tests the event against the live
Component/Elementtree (walked fresh per call, never cached) and the catalog-declared affordances, in three gates: exists/mounted, catalog-declared, payload. - A valid intent is enforced through the target state's Actionable seam, so the rebuild flows through the standard dirty/flush pipeline and exactly the target subtree invalidates.
- An invalid intent is refused with a structured, side-effect-free
ConsentOutcome: one of four RejectionKinds, the tree left byte-for-byte
untouched.
staleUnmounted— consent revoked because the projection moved under the actor — is the agent-async-gap case made first-class.
The moat: a2ui_core has no element tree to hit-test against and no unmount lifecycle, so this enforce/reject layer is genuinely genesis-native. consent depends only on genesis seams.
Classes
- Actionable
-
Implemented by a domain's stateful component
Stateto afford client actions. The router invokes these only for a mounted component whose catalog type declares the action name. - ActionChange
- The before/after provenance of a state change an action produced — the last-write-wins audit trail. from and to are the domain's own representation of the value that changed.
- Applied
- The action passed every gate and was enforced through the target state. change carries the before/after provenance.
- ConsentOutcome
- The result of routing one action through the enforce/reject substrate.
- ConsentRouter
-
Routes parsed A2UI actions onto a live
DialogueSurface, enforcing or rejecting each by hit-testing the mounted tree. - Rejected
- The action was refused; the tree is byte-for-byte untouched. message is the LLM-feedback-ready explanation.
Enums
- RejectionKind
- Why an action was refused. Four kinds; the load-bearing distinction is unknownComponent vs staleUnmounted — a boolean rejection would erase it (the feedback channel).
Exceptions / Errors
- ActionPayloadException
- Thrown by Actionable.validateAction to reject a payload (gate 3).