Expand description
SPDX-License-Identifier: AGPL-3.0-or-later Copyright (C) Alexander R. Croft
Component 03 — The Loop.
Inner LoopRuntime (complete-unit tool reaction) plus the outer
TransactionRuntime composition layer.
See doc/THE_LOOP.md and doc/TRANSACTION_RUNTIME_IMPLEMENTATION.md.
Structs§
- AcpPrompt
Encoder - ACP session/prompt encoder for external-agent Channels.
- Async
Tool Handler - Handler that runs an async body with abortable cancellation.
- Bounded
Event Sender - Bounded event sender: item capacity + byte budget (D-015).
- Callback
Service - Bounded, runtime-owned completion callback executor.
- Canonical
Event Subscription - Lossless subscription owned by one Loop (never shared with Console).
- Capability
Token - 256-bit unguessable capability token (hex in URLs; redacted in diagnostics).
- Capacity
Managers - Capacity counters installed at startup; admission acquires permits later.
- Channel
Binding - One Channel’s static binding (factories realized at runtime start).
- Channel
Registry - Immutable registry of Channel bindings (built before start).
- Default
Loop Runtime - Default runtime factory.
- Default
Transaction Runtime - Production transaction runtime.
- Delivered
Event - One delivered event with explicit delivery sequence.
- Dispatch
Request - Request to dispatch one complete tool call through the linked handler path.
- Dispatcher
Limits - Capacity and payload bounds for one transaction dispatcher (D-015).
- Empty
Bytes Encoder - Encoder returning empty bytes.
- Empty
Tool Registry - Required first implementation: every request is unavailable.
- Encoded
Exchange Params - Parameters for a continuation exchange (fresh identities, pre-encoded body).
- Event
Sequencer - Sole allocator of transaction event sequence numbers (starts at 1).
- Exchange
Outcome - Result of one exchange cycle.
- Exchange
Params - Parameters for running one exchange.
- Finalization
Guard - Atomic exactly-once finalization claim shared by actor and shutdown supervisor.
- Headless
Prompt Encoder - Headless CLI encoder: plain text prompt body for Z.ai / Claude print mode.
- Host
Tool Registry - Immutable host tool definitions available to admission.
- Host
Tool Runtime - Runtime that starts linked tools through the shared dispatcher.
- Immediate
Tool Handler - Handler that completes immediately from a synchronous function.
- Interpretation
End - Exactly one terminal report per interpretation.
- Isolated
Killable Tool Handler - Isolated worker that ignores cooperative cancel until
ToolKillHandle::kill(D-024 tests). - Linked
Tool Execution Handle - Handle returned from
ToolHandler::start. - Live
Channel - Live Channel after connector instance realization at runtime start.
- Loop
Completion - Completion handle.
- Loop
Control - Cancellation control.
- LoopEnd
- Exactly one Loop terminal report.
- Loop
Error - Loop error with safe diagnostics.
- Loop
Handle - Live loop handle.
- Loop
Health - Content-free health.
- LoopId
- Loop instance identity.
- Loop
Limits - Aggregate Loop bounds.
- Loop
Scope - Explicit Loop admission scope (no ambient expansion).
- Lost
Completion Handler - Handler whose completion is never sent (tests).
- McpGateway
- Production MCP gateway: one loopback listener, many capability routes.
- McpGateway
Handle - Cloneable handle for install/activate/revoke without owning the listener.
- McpListener
Shell - Back-compat alias: the MCP gateway owns the loopback listener. Production MCP gateway: one loopback listener, many capability routes.
- McpRoute
Table - Bounded in-memory capability route table.
- Monoloop
RunId - Monoloop run correlation identity.
- NoTool
Runtime - Runtime that asserts it is never started (pairs with EmptyToolRegistry).
- Open
AiChat Completions Encoder - Chat Completions v1 encoder producing
stream: trueJSON bodies. - Open
AiEncoder Options - Options controlling Chat Completions field names and capability gates.
- Outbound
Tool Result - Provider-neutral outbound tool result (Loop product; not dialect-encoded).
- Panic
OnStart Handler - Handler that panics on start (tests).
- Pending
McpBinding - Handle returned when a pending binding is created.
- Queued
Event - Queued event for delivery.
- Registered
Tool - Spec + linked handler pair registered at runtime startup.
- Reject
Encoder - Encoder that rejects all encode calls.
- Resolve
Tool Request - Request to resolve a complete tool by name.
- Resolved
Tool - One tool admitted into a transaction.
- Resolved
Tool Registry - Registry backed by the transaction-resolved allowlist.
- Resolved
Tool Set - Immutable tool set resolved at admission from the host registry.
- Runtime
Bootstrap - Only construction path for
super::DefaultTransactionRuntime. - Runtime
Config - Runtime-wide configuration validated at startup.
- Shared
Tool Capacity - Shared process-wide concurrent tool execution limit.
- Start
Fail Handler - Handler that always fails at start (tests).
- Start
Loop - Start request for one Loop instance.
- Start
Tool Execution - Start request for a tool execution (never called with EmptyToolRegistry).
- Subscriber
Id - Subscriber identity (correlation only).
- Subscription
Gap - Gap details.
- Subscription
Publisher - Publisher half used by the event distributor (testkit / composition).
- Test
Text Encoder - Loop-owned smoke encoder for FakeConnector +
DialectDescriptor::test_raw. - Tool
Action Id - Tool action identity (dialect-provided or interpretation-scoped).
- Tool
Descriptor Ref - Opaque available tool reference (no concrete tool types).
- Tool
Execution Completion - One-shot completion consumer for a linked tool execution.
- Tool
Execution Control - Cancellation control for a running linked tool.
- Tool
Execution Handle - Handle for a running tool.
- Tool
Kill Handle - Force-stop handle for IsolatedKillable / Abortable workers (D-024).
- Tool
Registry Error - Registry error.
- Tool
Runtime Error - Runtime error.
- Tool
Runtime Terminal - Terminal from a host/runtime execution mapped for Loop outbound emission.
- Transaction
McpHandler - MCP handler bound to one transaction capability.
- Transaction
Tool Capacity - Per-transaction tool capacity tracker (item queue + concurrency + per-tool).
- Transaction
Tool Dispatcher - Transaction-owned dispatcher: allowlist, validation, capacity, handler, output check.
Enums§
- AcpPrompt
Wire Shape - How ACP prompt bytes are shaped for the Connector input path.
- Canonical
Unit - Closed top-level canonical unit vocabulary.
- Canonical
Unit Event - Unit lifecycle event (closed vocabulary).
- Dispatch
Outcome - Outcome of a dispatch attempt.
- Event
Queue Full - Event queue rejection.
- Exchange
Failure - Exchange-level failure classification for the actor.
- Input
Validation Failure - Why input validation failed (caller maps to rejected tool result, not txn failure).
- Interpreter
Output Event - Stream events delivered to subscribers (Interpreter output + end).
- Loop
EndKind - Loop terminal kinds.
- Loop
Error Kind - Loop error classification.
- Loop
Output Event - Closed Loop output event vocabulary (initial).
- McpBinding
State - Public lifecycle state of a capability route.
- McpInstall
Error - Errors installing or mutating MCP routes.
- Outbound
Tool Outcome - Terminal outcome of a loop-owned tool action (provider-neutral).
- Output
Validation Failure - Why output validation failed (maps to runtime failure / ToolExchangeFailed).
- Runtime
State - Lifecycle of
super::DefaultTransactionRuntime. - Startup
Error - Failure starting the transaction runtime (no partially started runtime is exposed).
- Subscription
Status - Subscription status / gap notification.
- Tool
Request State - Tool request assembly state.
- Tool
Resolution - Registry resolution result.
- Tool
Unavailable Reason - Why a tool was unavailable.
Traits§
- Tool
Handler - Host-linked tool implementation.
- Tool
Registry - Abstract tool registry.
- Tool
Runtime - Abstract tool runtime.
Functions§
- bound_
diagnostics - Bound a diagnostic list by count and per-message bytes (D-015).
- dispatch_
ready_ tool - Dispatch one ready tool directly through the transaction dispatcher.
- run_
encoded_ exchange - Run one exchange with a pre-encoded body (tool continuation).
- run_
exchange - Run one SendAndFinish exchange end-to-end (no raw bytes enter actor queues).
- tool_
definitions_ from_ resolved - Project resolved tool specs into MCP
tools/listdefinitions (parity with encoders). - validate_
tool_ completion - Validate a handler completion against the tool output contract.
- validate_
tool_ input - Validate raw argument JSON string against size, depth, and schema.
Type Aliases§
- Startup
- Startup future type.