Skip to main content

Module workflow

Module workflow 

Source

Modules§

engine
gate
The workflow tool gate: the one decision both call paths apply — the direct call (server/call_tool/policy.rs::guard_workflow) and the inner tool of ctx_call (server/dispatch/mod.rs). They pass the active run and the tool name and act on the answer; neither decides anything itself.
store
types

Structs§

EvidenceItem
StateSpec
TransitionRecord
TransitionSpec
WorkflowRun
WorkflowSpec

Enums§

ToolGate
What the gate answers for one tool call under an active run.

Constants§

WORKFLOW_PASSTHROUGH_TOOLS
Tools that always pass through the workflow gate regardless of state. Read-only tools should never be blocked — agents need them for context recovery after crashes or session transitions. The server passes this list to tool_gate on both call paths.
WORKFLOW_TTL_SECS
TTL for expired workflow files (24 hours).

Functions§

allowed_transitions
can_transition
cleanup_expired
Remove workflow files older than WORKFLOW_TTL_SECS.
clear_active
clear_active_for_agent
find_transition
is_run_stale
Whether run has been inactive for longer than the stale threshold. The one stale rule, for the store and for both tool gates (workflow::gate). The stand-in for a withheld workflow is never stale: it ends when the stored workflow loads again or is stopped explicitly, not by the passing of time.
is_withheld_sentinel
Whether run is the stand-in withheld_sentinel builds. The one test for it: the store, the stale rule and the tool gate all ask here. The marker is the reserved name pair, which no stored workflow can carry — save_active_for_agent refuses to write a run that has it.
load_active
load_active_for_agent
missing_evidence_for_state
save_active
save_active_for_agent
tool_gate
Decide tool under run. passthrough is the server’s list of tools a real run never blocks.
validate_spec