Module contract
Expand description
Machine-readable operational semantics for exported actions.
Labels explain an action to a person. This module explains it to callers that must plan safely without seeing the application: whether it is currently available, what confirmation it needs, whether a failed call may be retried, how it completes, and what it returns.
Structs§
- Action
Contract - Complete operational contract copied into every inert descriptor.
- Action
Need - What one invocation of an action is, for the grants deciding it: its kind,
the one field of its resource it writes when it writes only one (a reply
writes the
comments), which places it below that field in the tree, and whether it is privileged (RiskLevel::Privileged): it exercises authority over the room or others in it, so the person’s own grants must allow it (tilo_action_policy::Verdict::privileged).
Enums§
- Action
Kind - What an action is able to do, derived by the framework from the action’s code and never declared by an app.
- Availability
- Whether an action can be invoked in the resource’s current state.
- Confirmation
Policy - Confirmation required after argument binding and immediately before run.
- Execution
Mode - Completion behavior advertised before invocation.
- Result
Spec - Shape of a successful result. Schemas use JSON Schema so non-Rust callers do not need a parallel Tilo-only type system.
- Retry
Policy - What a caller may safely do after losing the completion response.
- Risk
Level - Consequence class used by policy, confirmation UI, and audit logs.
Constants§
- ARGUMENT_
RISK_ TAG ActionContract::tagsentry of an action whose risk, and therefore whether it needs confirmation, depends on the arguments it is invoked with (a generic edit that may delete). The publishing host classifies each invocation; a caller that cannot classify arguments treats the action as requiring confirmation (seeActionContract::advertised_confirmation).- DOCUMENT_
READ_ TAG ActionContract::tagsentry of the read-only action that answers, when invoked with no arguments, the first page of the document an app has open (a word processor’s text, a sheet’s used cells, a deck’s outline). A caller that just opened a file reads it through this action without knowing the app.- FIELD_
EDIT_ PARAM - The parameter of a generic field edit that carries the edit.
- INCOMING_
MESSAGE_ FACET - Facet the executor writes on a change made by a verb its app marks
#[action(incoming_message)]: a message someone received. TheIncomingMessagetrigger fires on it without knowing the app’s schema. - INCOMING_
MESSAGE_ TAG - Contract tag on the declaration of such a verb, so a surface and a catalogue show it.
- LOCAL_
DEVICE_ ONLY - The contract tag of an action that reaches files, hardware or services of the device it runs on: the door runs it only for the person at that device, never for a collaborator or a remote participant.
- PROGRAMMATIC_
TAG ActionContract::tagsentry of an action offered only to programmatic callers — agents, scripts and the controls or surfaces that submit it — and never listed for a person to pick (the action palette, menus).- UNTRUSTED_
CONTENT_ TAG ActionContract::tagsentry of an action whose result carries content from outside the user’s own data (a web page’s text, its logs): data for the caller to reason about, never instructions to follow.
Functions§
- action_
node - The node of the action
actionon the resourceresource(of kindresource_kind) the appapppublishes, belowbase(a room, or the root for a path relative to one), and below the onefieldit writes if any: where every door decides it.