Runtime¶
kando.runtime.Runtime(ledger, responders, budget=None, cache=None)
¶
Wires ledger, world projection, responders, and budget into a single event loop.
Fails loudly on responder errors — never swallows exceptions.
Source code in kando/runtime.py
load()
¶
replay(strict=False)
¶
Replay the run.
Permissive (default): reproject the ledger as-is — fast, no re-firing. Strict: re-execute seed events through responders to verify determinism. The resulting world must match the permissive projection; if it diverges, the run is non-deterministic under the current responders.
Source code in kando/runtime.py
run(seed_events)
¶
Main event loop: process seed events, fire responders, exhaust the queue.
Source code in kando/runtime.py
Usage¶
from kando.runtime import Runtime
from kando.ledger.memory import MemoryLedgerStore
from kando.responders.budget import Budget
from kando.cache.llm import LLMCache
from kits.diligence.kit import create_kit, seed_from_goal
run_id = "my-run-001"
store = MemoryLedgerStore(run_id)
cache = LLMCache()
runtime = Runtime(
ledger=store,
responders=create_kit(),
budget=Budget(max_events=500, max_wall_seconds=60.0),
cache=cache,
)
seed = seed_from_goal("Evaluate Stripe", run_id)
world = runtime.run(seed)
# World is also accessible via load() at any time
world2 = runtime.load()
Strict replay¶
# Permissive replay: reproject the ledger (fast, no re-firing)
world = runtime.replay(strict=False)
# Strict replay: re-execute seed events through responders
world = runtime.replay(strict=True)
Strict replay is useful for verifying that your responders are deterministic. If the strict world diverges from the permissive world, you have non-deterministic responders.