Skip to main content

Crate monoloop_loop

Crate monoloop_loop 

Source
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 transaction composition layer (Runtime v2 lifecycle under transaction::lifecycle).

Structs§

AcpPromptEncoder
ACP session/prompt encoder for external-agent Channels.
AdmissionError
Synchronous admission error.
AdmissionReceipt
Immediate admission receipt (no network performed).
AsyncToolHandler
Handler that runs an async body with abortable cancellation.
CanonicalEventSubscription
Lossless subscription owned by one Loop (never shared with Console).
CapabilityToken
256-bit unguessable capability token (hex in URLs; redacted in diagnostics).
ChannelBinding
One Channel’s static binding (factories realized at runtime start).
ChannelRegistry
Immutable registry of Channel bindings (built before start).
ControlHoldGate
Test-only gate that pauses supervisor drain of the control queue (§23).
DefaultLoopRuntime
Default runtime factory.
DeliveredEvent
One delivered event with explicit delivery sequence.
DeliveryLimits
Validated event-queue capacities for transaction_delivery.
DispatchRequest
Request to dispatch one complete tool call through the linked handler path.
DispatcherLimits
Capacity and payload bounds for one transaction dispatcher (D-015).
EmptyBytesEncoder
Encoder returning empty bytes.
EmptyToolRegistry
Required first implementation: every request is unavailable.
FinalizerHoldGate
Test-only gate that pauses the Finalizer between Seal and completion send (§22.2).
HeadlessPromptEncoder
Headless CLI encoder: plain text prompt body for Z.ai / Claude print mode.
HostToolRegistry
Immutable host tool definitions available to admission.
HostToolRuntime
Runtime that starts linked tools through the shared dispatcher.
ImmediateToolHandler
Handler that completes immediately from a synchronous function.
InterpretationEnd
Exactly one terminal report per interpretation.
IsolatedKillableToolHandler
Stubborn in-process worker for AbortableAtYield / legacy D-024 fixtures.
JoinOnlySpillInject
Test-only inject: TaskSupervisor-owned JoinOnly-style work (§22.4 / Law 23 / M5.4).
LedgerEntry
Per-transaction ledger row.
LifecycleLedger
Source of truth from admission through completion publication.
LinkedToolExecutionHandle
Handle returned from ToolHandler::start.
LiveChannel
Live Channel after connector instance realization at runtime start.
LoopCompletion
Completion handle.
LoopControl
Cancellation control.
LoopEnd
Exactly one Loop terminal report.
LoopError
Loop error with safe diagnostics.
LoopHandle
Live loop handle.
LoopHealth
Content-free health.
LoopId
Loop instance identity.
LoopLimits
Aggregate Loop bounds.
LoopScope
Explicit Loop admission scope (no ambient expansion).
LostCompletionHandler
Handler whose completion is never sent (tests).
McpGateway
MCP gateway constructors (no ambient spawn — Law 23).
McpGatewayHandle
Cloneable handle for install/activate/revoke without owning the listener.
McpGatewayLimits
Bounded MCP request concurrency and duration (D-034 / Law 22).
McpRouteTable
Bounded in-memory capability route table.
MonoloopRunId
Monoloop run correlation identity.
NoToolRuntime
Runtime that asserts it is never started (pairs with EmptyToolRegistry).
OpenAiChatCompletionsEncoder
Chat Completions v1 encoder producing stream: true JSON bodies.
OpenAiEncoderOptions
Options controlling Chat Completions field names and capability gates.
OrphanToolPermitSet
Runtime-scoped orphaned tool permits (§22.4 capacity honesty / M5.4).
OutboundToolResult
Provider-neutral outbound tool result (Loop product; not dialect-encoded).
OwnedProcessRegistry
ProcessIsolated children owned until OS exit is observed.
PanicEncoder
Encoder that panics on encode (§22.2 coordinator-panic proofs).
PanicOnStartHandler
Handler that panics on start (tests).
PendingMcpBinding
Handle returned when a pending binding is created.
PreparedMcpGateway
Listener + router prepared without spawning (TaskSupervisor / RuntimeService).
ProcessIsolatedToolHandler
Host tool that runs in a real OS child process (V2 §14.3).
RegisteredTool
Spec + linked handler pair registered at runtime startup.
RejectEncoder
Encoder that rejects all encode calls.
ReservationPool
Runtime-wide reservation pool installed at start.
ResolveToolRequest
Request to resolve a complete tool by name.
ResolvedTool
One tool admitted into a transaction.
ResolvedToolRegistry
Registry backed by the transaction-resolved allowlist.
ResolvedToolSet
Immutable tool set resolved at admission from the host registry.
RuntimeBootstrap
Production bootstrap for super::lifecycle::StartedRuntime::start.
RuntimeConfig
Runtime-wide configuration validated at startup.
RuntimeOwner
Unique owner of the executor, supervisor, ledger, connectors, and shutdown state.
SharedToolCapacity
Shared process-wide concurrent tool execution limit.
ShutdownReport
Final shutdown report when the runtime reaches Stopped (v2).
ShutdownSnapshot
Point-in-time shutdown progress while still Quiescing (v2).
ShutdownTicket
Opaque ticket from super::owner::RuntimeOwner::begin_shutdown.
StartFailHandler
Handler that always fails at start (tests).
StartHoldGate
Test-only gate that pauses supervisor drain of the start queue (D-040).
StartLoop
Start request for one Loop instance.
StartToolExecution
Start request for a tool execution (never called with EmptyToolRegistry).
StartedRuntime
Result of a successful production start handshake.
StoppedGate
Test/prod gate that defers the supervisor’s Stopped transition until StoppedGate::release (v2 §22.5 TimedOut determinism).
SubscriberId
Subscriber identity (correlation only).
SubscriptionGap
Gap details.
SubscriptionPublisher
Publisher half used by the event distributor (testkit / composition).
TaskId
Stable task id within one runtime owner.
TaskSupervisor
Retains every runtime join until observed complete.
TerminalDecision
Immutable terminal decision selected once by the supervisor.
TerminalProposal
Coordinator proposal — supervisor accepts or upgrades (Cancel→Terminated).
TestTextEncoder
Loop-owned smoke encoder for FakeConnector + DialectDescriptor::test_raw.
ToolActionId
Tool action identity (dialect-provided or interpretation-scoped).
ToolDescriptorRef
Opaque available tool reference (no concrete tool types).
ToolExecutionCompletion
One-shot completion consumer for a linked tool execution.
ToolExecutionControl
Cancellation control for a running linked tool.
ToolExecutionHandle
Handle for a running tool.
ToolKillHandle
Force-stop + join for Abortable (Tokio) or ProcessIsolated (OS child) workers.
ToolRegistryError
Registry error.
ToolRuntimeError
Runtime error.
ToolRuntimeTerminal
Terminal from a host/runtime execution mapped for Loop outbound emission.
TransactionCompletion
One-shot completion mailbox payload (v2).
TransactionDelivery
Ports installed at admission and owned by the lifecycle ledger until publish.
TransactionEndEvent
Terminal event body for the v2 event stream (no self-referential delivery).
TransactionMcpHandler
MCP handler bound to one transaction capability.
TransactionReceiver
Host receivers created together with TransactionDelivery.
TransactionReservations
RAII permits held for one admitted transaction until cleanup releases them.
TransactionRuntimeHandle
Cloneable admission/control handle (no executor shutdown authority).
TransactionSubmitRequest
Runtime v2 submission request — concrete mailboxes, no host traits in-core.
TransactionTaskSpawner
Cloneable handle workers use to spawn owned tasks without holding JoinHandles.
TransactionToolCapacity
Per-transaction tool capacity tracker (item queue + concurrency + per-tool).
TransactionToolDispatcher
Transaction-owned dispatcher: allowlist, validation, capacity, handler, output check.

Enums§

AcpPromptWireShape
How ACP prompt bytes are shaped for the Connector input path.
AdmissionErrorKind
Admission error kinds.
BoundaryKind
Boundary kinds.
CanonicalUnit
Closed top-level canonical unit vocabulary.
CanonicalUnitEvent
Unit lifecycle event (closed vocabulary).
CleanupFailureCode
Closed cleanup failure codes (v2).
CleanupStatus
Status of owned cleanup after completion publication (v2).
CompletionPublishResult
Result of a one-shot completion publication attempt.
DeliveryConfigError
Invalid delivery-port construction.
DispatchOutcome
Outcome of a dispatch attempt.
EventEnqueueError
Event enqueue failure (fail closed).
InputValidationFailure
Why input validation failed (caller maps to rejected tool result, not txn failure).
InterpreterOutputEvent
Stream events delivered to subscribers (Interpreter output + end).
LoopEndKind
Loop terminal kinds.
LoopErrorKind
Loop error classification.
LoopOutputEvent
Closed Loop output event vocabulary (initial).
McpBindingState
Public lifecycle state of a capability route.
McpInstallError
Errors installing or mutating MCP routes.
OutboundToolOutcome
Terminal outcome of a loop-owned tool action (provider-neutral).
OutputValidationFailure
Why output validation failed (maps to runtime failure / ToolExchangeFailed).
ProcessToolCommand
How the child process is launched for ProcessIsolated tools.
ReservationPoolError
Invalid reservation-pool construction.
RuntimeState
Lifecycle of super::lifecycle::RuntimeOwner.
ShutdownWaitOutcome
Wait outcome for crate runtime owner shutdown (v2).
SpawnReject
Why TransactionTaskSpawner::spawn rejected or could not confirm ownership.
StartupError
Failure starting the transaction runtime (no partially started runtime is exposed).
SubscriptionStatus
Subscription status / gap notification.
SupervisorCommand
Backward-compatible aggregate name for exports.
TaskClass
Classification for every supervised spawn.
TaskExit
Observed task exit kind.
TerminalEventDelivery
Outcome of attempting to enqueue the terminal Ended event (v2).
ToolRequestState
Tool request assembly state.
ToolResolution
Registry resolution result.
ToolUnavailableReason
Why a tool was unavailable.
TransactionPhase
Ledger phase machine (v2 §8.2).

Traits§

AbortableAtYieldHandler
Structural AbortableAtYield factory marker (V2 §14.2 / D-050).
McpRequestOwner
Runs one MCP HTTP request under TaskSupervisor as TaskClass::McpRequest (§17).
ToolHandler
Host-linked tool implementation.
ToolRegistry
Abstract tool registry.
ToolRuntime
Abstract tool runtime.

Functions§

adapt_completion_callback
Invoke a legacy completion callback after the runtime publishes once.
adapt_event_sink
Forward mailbox events to a legacy sink until the sender is dropped.
build_completion
Build a completion mailbox payload.
dispatch_ready_tool
Dispatch one ready tool directly through the transaction dispatcher.
dispatch_ready_tool_cancellable
Dispatch with an actor-owned cancel signal so mid-dispatch cancel joins the worker (D-028).
estimate_event_bytes
Conservative byte estimate for queue accounting (not wire encoding).
tool_definitions_from_resolved
Project resolved tool specs into MCP tools/list definitions (parity with encoders).
transaction_delivery
Create paired delivery ports with validated capacities.
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§

LoopRunFuture
Owned Loop run future for TaskSupervisor registration.