Skip to main content

Crate kian_loop

Crate kian_loop 

Source
Expand description

kian-loop — LoopDriver seam, built-in ReAct loop.

DESIGN §7 assigns this crate the key interface LoopDriver. The agent loop is just a control flow inside a drain (AGENTS.md preamble): this crate implements the LoopDriver seam and the built-in async ReAct loop; it is a passenger inside the orchestrator’s drain and never drives engine semantics itself.

Termination is honest (AGENTS.md constraint 7): an empty model response is a soft failure routed to the recovery policy, never completed.

Modules:

  • react — the built-in ReAct LoopDriver
  • tools — the built-in local fs/exec ToolProvider + ExecBackend local exec runs via spawn_blocking so a sleeping tool cannot stall concurrent drains
  • evidence — the evidence gate v1: bounded, declarative, pure predicates over the event stream; wired into react’s stop path, default-off

Re-exports§

pub use evidence::BUILTIN_GATE_NAME;
pub use evidence::CheckOutcome;
pub use evidence::CheckSpec;
pub use evidence::EvidenceGateConfig;
pub use evidence::EvidenceGateCounters;
pub use evidence::GateVerdict;
pub use evidence::VerdictCounters;
pub use evidence::evaluate_evidence_gate;
pub use evidence::verdict_payload;
pub use react::BudgetScope;
pub use react::CLASS_EMPTY_RESPONSE;
pub use react::DEFAULT_MAX_ITERATIONS;
pub use react::LoopError;
pub use react::ReActConfig;
pub use react::ReActLoop;
pub use react::to_chat_message;
pub use tools::DEFAULT_EXEC_TIMEOUT_MS;
pub use tools::FilteredTools;
pub use tools::LocalExecBackend;
pub use tools::LocalTools;
pub use tools::unmatched_tool_names;

Modules§

evidence
Evidence gate v1 (SPEC P4/A6): a declarative, bounded, no-model-call gate over the worker’s own event stream.
react
Built-in ReAct loop.
tools
Built-in local ToolProvider + ExecBackend.

Enums§

LoopOutcome
What a loop iteration reports back to the drain. A soft failure is routed to the recovery policy and is never settled as completed (constraint 7).

Traits§

LoopDriver
Seam (DESIGN §6.2): the agent loop as control flow inside a drain. Built-in: the async ReAct loop (kian-loop). The context type is left abstract on purpose — it is the drain handle surface (inbox take, event append, …) that the orchestrator provides; the core does not model execution internals (layered iron rule).