Repository navigation
The first development line. This version is being assembled phase by phase and has not
yet been published; the date is fixed when 0.1.0 is released (see the release runbook in
docs/specs/10-release-versioning-and-cicd.md §9).
Fixed
- Governance halt veto now actually halts a run (spec 07 §9): a
before_superstepmiddleware
raisingkorchestrator.exceptions.GovernanceHaltErrorwas previously caught, logged, and ignored
like every other hook exception — the documented veto path was unimplemented.HookRegistry
now lets specifically that exception type propagate out ofbefore_superstep(every other
exception from any hook still isolates exactly as before);PregelRunner.runcatches it and
returns a terminalRunResultwithstatus=RunStatus.GOVERNANCE_PAUSEDinstead of running the
vetoed superstep. The durable runtime is unaffected — it doesn't drive hooks yet. See
ADR 0019.
Added
-
Private release pipeline (Phase 12, narrowed per ADR 0020):
.github/workflows/release.ymlnow publishes a GitHub Release on everyvX.Y.Ztag — the built
wheel, sdist, andSHA256SUMSattached, notes drawn from this CHANGELOG, and an in-pipeline
install verification (pip install git+https://...@vX.Y.Z) using the run's own scoped token.
Newscripts/cut_release.pyautomates the mechanical parts of cutting a release (version bump,
CHANGELOG dating, release-branch/PR creation, tag creation and push) described in
docs/specs/10-release-versioning-and-cicd.md§9. -
Tool-calling for
WorkerAgent(Phase 10, closes a gap left open since P4/P6): a mounted
AgentConfig.toolslist now runs a real bounded ReAct loop (predict → optionally call one tool
→ feed the result back → repeat, up tomax_react_steps) instead of having no effect.Korch/
Swarmgain aconnectors: Sequence[Connector] | ConnectorRegistry | None = Noneconstructor
parameter (mirrorsmodel_gateway); tools mounted on an agent with noconnectorsgiven raise
aConfigurationErrornaming the missing tools. Newkorchestrator.interfaces.IToolInvokerport
and its one implementation,korchestrator.tools.RegistryToolInvoker. See
ADR 0018. -
TypeScript parity matrix (Phase 9, closes Phase 9):
docs/parity-matrix.mdsettles the
deferred TypeScript client's contract (ADR 0008) — everyKorchestratorClientmethod, the
constructor,ApiError, and themodels.remotetypes, each markedTS: plannedwith its
settled TypeScript name. Three discrepancies between an earlier TS-facing design sketch and the
shipped Python implementation are resolved in the Python implementation's favor and labelled. -
Remote client discovery (Phase 9, completes the
KorchestratorClientmethod surface):
tools(),models(),swarm_templates()(spec 04 §7.3).models()returns the existing
korchestrator.models.routing.ModelCard. Newkorchestrator.models.remote.ToolDescriptor
(name/description/input_schema) andSwarmTemplate(name/description/agents/
edges, reusingAgentConfigso a fetched template can be passed straight intorun_swarm). -
Remote client SSE streaming (Phase 9):
KorchestratorClient.stream(run_id)(spec 04 §7.3/§7.5)
— a native async iterator yieldingkorchestrator.models.remote.RunEvent, the only method on
the client that isn't a sync wrapper. Reconnects automatically (full-jitter backoff, budget
reset on each successful reconnect) on a dropped connection; note that reconnecting resumes from
"now", not the last delivered event — the wire format carries no event id to resume from. -
Remote client control + identity (Phase 9):
KorchestratorClientgainsresume,cancel,
edit_resume(mirrors the local kernel's ownedit_resumesignal shape),me,my_quota,
my_runs, and key management (create_key,list_keys,revoke_key) — spec 04 §7.3. New
korchestrator.models.remote.CallerIdentity/Quota/ApiKey/ApiKeySummary.ApiKey.key(the
secret, returned once at creation) is apydantic.SecretStr, never a barestr— an accidental
repr/log can't leak it; call.get_secret_value()to use it.list_keysnever returns the
secret at all. -
Remote client run lifecycle (Phase 9):
KorchestratorClientgainsrun,run_swarm,
run_and_wait,get_run,wait,list_runs,get_run_summary(spec 04 §7.3). Every numeric
run status the engine can return is normalized to theRunStatusstring vocabulary before
validation (spec 04 §7.4). Newkorchestrator.models.remote.RemoteRunResult/RunSummary—
the client's own wire-facing result shapes, distinct from the local kernel'sRunResult(no
nestedAgentState).wait/run_and_waitpoll; real-time SSE streaming lands in the next
Phase 9 task. The wire-format details (field names, list-response shape) are the SDK's own
documented assumption pending a full engine schema — see the P9.3 engineering-log entry. -
Remote client credential safety (Phase 9):
KorchestratorClient.__repr__showsbase_urlonly,
never headers or the credential. Test-locked (spec 04 §7.2): the client'srepr/str, and
every errorKorchestratorClientcan raise (ApiError,NetworkError,TimeoutError), never
contain the API key — including when a (misbehaving) engine response tries to echo the
Authorizationheader back. A static check assertsclients/performs no file I/O at all, so
"credentials are never written to disk" can't regress silently. -
Remote client transport + auth (Phase 9):
korchestrator.remote.KorchestratorClient(also
korchestrator.clients.KorchestratorClient) — the Tier 4 client's authenticated, retrying HTTP
transport, behind the[remote]extra (spec 04 §7). OneAuthorization: Bearerheader for
both a static API key and a Keycloak/KIAM JWT; a 30s default timeout, overridable per call; up
to 3 retries with full-jitter exponential backoff on429/502/503/504and connection
failures, never on any other4xx. Newkorchestrator.exceptions.ApiError(status,code,
trace_id) is raised for a terminal non-2xx response. This first remote-client task ships the
transport only —run/get_run/resume/stream/etc. land in the following Phase 9 tasks, so
KorchestratorClientis not yet usable end-to-end. -
Optional OpenTelemetry telemetry (Phase 8, closes Phase 8):
korchestrator.telemetrygains
start_span(name, *, settings=None, **attributes)andrecord_metric(name, value, *, settings= None, **attributes), behindKORCH_TELEMETRY_ENABLED(default off) and the[otel]extra.
Disabled — the default —start_spanreturns the same module-level no-op singleton on every
call (no context manager allocation, no OTel import);record_metricreturns immediately. Both
take an explicitsettingsso a run's actual, injectedSettingsdecides — not the disconnected
configure()/get_settings()process singleton. Enabled without the[otel]extra installed,
both raise an actionableMissingExtraError.services._composition.run_graphwires the outer
agent.runspan (run_id,tenant_id,max_supersteps,status,superstepsattributes) and
thekorch.run.duration/korch.run.statusmetrics; the rest of the documented span tree
(agent.superstep/agent.plan/tool.call/gen_ai.call) and the remaining four metrics
(korch.superstep.duration,korch.agents.active,korch.tool.calls,korch.model.tokens) are
defined (correct OTel instrument kind — histogram, up/down counter, or counter — per name) but not
yet wired into the kernel/tool/gateway call sites; abenchmarks/regression proving the
telemetry-off path is within noise of an[otel]-uninstalled build is P10's job. Neither
start_spannorrecord_metricjoins top-levelkorchestrator.__all__(submodule-only, like
ConfigurationError— not part of the documented public surface). -
Deterministic, version-tagged serialization (Phase 8): new top-level
korchestrator.to_json(model)/
from_json(payload, model_cls)round-tripAgentState,ExecutionPlan,ModelCard, and
RunResultbyte-for-byte — sorted keys at every nesting level, fixed separators, UTF-8,
ISO-8601 timestamps with an explicit UTC offset and microsecond precision. Every envelope
carriesschema_versionandkorchestrator_version;from_jsonapplies registered migrations
in sequence and raisesValidationErrorif the payload'sschema_versionis newer than the
installed package supports.AgentGraphis deliberately not supported — its nodes carry live,
non-serialisable compute callables (see
ADR 0017). -
Namespaced, disable-able logging (Phase 8):
korchestrator.logginggainsenable_logging(level= "INFO", *, stream=None)(attaches a singleStreamHandlerto thekorchestratorlogger,
idempotent) anddisable_logging(). Off by default — only aNullHandleris attached at import
time, so the SDK never touches the root logger or callslogging.basicConfig(), and an embedding
application's own logging configuration is untouched.enable_loggingjoins top-level
korchestrator.__all__;disable_loggingstays submodule-only, matching spec 04 §6 exactly. -
Settings finalized (Phase 8): the full spec 08 §1.3 variable table — 16 new fields covering the
model gateway, kernel/runtime bounds, logging/telemetry toggles, the remote engine client, and
the durable runtime (TEMPORAL_ADDRESS,TEMPORAL_API_KEY, etc.). Secret-bearing fields
(kendra_gateway_api_key,korch_engine_api_key,temporal_api_key) usepydantic.SecretStr
and never appear inrepr/str.Settings.from_env()gains opt-in.envfile support
(dotenv_path=,Noneby default — no ambient developer.envaffects an unrelated
from_env()call).mock_llm, underfrom_env()only, now defaults toFalsewhen a gateway
key resolved. New top-levelkorchestrator.configure(**overrides)builds, validates, and
installs a process-wideSettings(reading.envfrom the CWD by default), raising
korchestrator.ValidationErroron an invalid value;korchestrator.config.get_settings()
returns the installed instance, building the zero-config default lazily on first call. See
ADR 0016 for why this
didn't require adoptingpydantic-settings, and theConfigurationError/ValidationErrorrule. -
Bitemporal Context Graph client (Phase 7, closes Phase 7):
korchestrator.persistencegains
ContextGraphClient—record_decision()/record_event()write immutable, tenant-scoped
DecisionNode/EventNodes (each carryingvalid_time,transaction_time,confidence, and
provenance) through Shield redaction first;query()reads them back tenant-scoped, with
as_of/valid_attime-travel and an optionalrun_idfilter. A correction is always a new node
with a latertransaction_time— nodes are never mutated (event sourcing).GraphRepository
(the P1 protocol) gainsrecord_node()/query_nodes()— the extension its own docstring
anticipated — andInMemoryGraphRepositoryimplements both. -
Graph repository (Phase 7):
korchestrator.persistencegainsInMemoryGraphRepository(the
GraphRepositoryprotocol's default, zero-infrastructure implementation, tenant-scoped and
concurrency-safe) andresolve_repository()(the one placePERSISTENCE_BACKENDbecomes a
concrete repository, orNoneforPERSISTENCE_BACKEND=none's fully standalone run).
Korch/Swarmnow actually consult theirrepository— a_PersistenceMiddlewarecheckpoints
AgentStateafter every superstep, giving the local runtime (which has no built-in durability) a
best-effort recovery point.PERSISTENCE_BACKEND=kcg(an external backend) raises an actionable
ConfigurationError; external backends are post-1.0. -
HITL controls (Phase 7): the durable runtime's
PregelMasterworkflow now auto-pauses itself
when a superstep'strust_scorebreaches any active node's effective HITL threshold — the same
governance_pausedmechanism an operator's ownpausesignal uses. A newedit_resumesignal
applies an operator's context/trust edit (last-value merge + the same clamped fold the barrier
uses) and resumes; astatusquery lets a caller check forgovernance_pausedwithout blocking.
Korch/Swarmgainpause(run_id)/resume(run_id)/cancel(run_id)/edit_resume(run_id, ...)—
thin façade methods that deliver a durable control signal, raisingNotImplementedErroron the
synchronous local runtime (durable HITL needsKORCH_RUNTIME=temporal).TemporalRuntimecan now
be constructed signal-only (graph=None) to deliver a control signal without rebuilding the graph. -
Policy engine + audit log (Phase 7):
korchestrator.governancegainsevaluate_policy()—
compares a superstep's trust score against an agent's ownhitl_threshold(falling back to the
newGOVERNANCE_TRUST_THRESHOLDsetting, default0.5) and returns aGovernanceDecision
(GovernanceAction.ALLOW/INTERVENE) — plusAuditLog/AuditEntry, an append-only in-memory
trail of decisions and the telemetry each was based on. Pure and config-free; the runtime pause
signal that acts on anINTERVENEverdict lands in the next Phase 7 commit. -
Trust scoring (Phase 7): the kernel barrier now folds each active agent's
StateUpdate.trust_deltaintoAgentState.trust_scoreevery superstep, clamped to[0.0, 1.0]
— pure and order-independent, so the score is deterministic and replay-safe.korchestrator. governancegainsControlTowerTelemetry(a per-superstep governance snapshot),
derive_telemetry(), andcheck_governance()— the governance-facing read of the score plus its
telemetry. Threshold comparison,hitl_threshold/GOVERNANCE_TRUST_THRESHOLD, the policy engine,
and the audit log land in the next Phase 7 commit; the runtime pause signal after that. -
Shield redactor (Phase 7):
korchestrator.security.Shield— the single consolidated PII/secret
redactor.redact(text)/redact_value(json)mask emails, secrets (JWT, AWS/sk-/Slack tokens,
Bearer), IBANs, SSNs, Luhn-validated card numbers (PAN), and E.164 phone numbers to
[MASKED_<TYPE>], returning what changed. Ahigh_sensitivitymode fails toward masking. -
Extension framework (Phase 6): agent-to-agent messaging (
korchestrator.a2a—directed_message,
HandoffTransformer); transport-agnostic event streaming (korchestrator.events—Event,
EventPublisher,Subscription,format_sse; the SDK emits, it does not serve HTTP); and
middleware/hooks (korchestrator.services.Middleware/HookRegistry) with the spec 07 §9 ordering
and error isolation — a hook can never fail a run.Korch/Swarmacceptmiddleware=…and expose
.on(event, handler); hooks fire around each superstep on the local runtime via an injected
SuperstepObserver(default off, so determinism is unaffected). -
Context compiler (Phase 6):
korchestrator.contextwithContextCompiler.compile()and
CompiledContext— Minimum Viable Context extraction that keeps the objective and the substantive
messages (answers/handoffs) first, packs the recent remainder under a character budget, and prunes
the rest. An optionalSummarizerseam folds the pruned tail; it degrades gracefully to a count.
Runs off the hot loop and is deterministic without a summariser. -
MCP client (Phase 6):
korchestrator.mcpwithMCPServerConfig(stdio/sse descriptor) and
MCPClient.discover(), which connects to an MCP server and returns its tools asConnectors for
the shared AUB registry — so agents can't tell an MCP tool from a native one. Discovery failures
are non-fatal; the real transport needs the[mcp]extra. TheConnectorcontract moved to
korchestrator.interfaces(added to its__all__) sotoolsandmcpshare it without importing
each other; thekorchestrator.toolsimport path is unchanged. -
Agent Utility Bridge (Phase 6):
korchestrator.toolswithConnectorRegistry(register a
Connector, wrap a function viaregister_tool, entry-pointdiscover()), theConnector
contract, andinvoke_tool— the single path enforcing the mount access gate, rate limiting,
JSON-Schema argument validation, timeout, an optional redaction seam, and duration/telemetry.
Built-inFilesystemConnector(root-confined, traversal-denied) andMockSearchConnector
(deterministic offline). NewTOOL_EXECUTION_FAILEDerror code. Registration is via the registry
andKorch(connectors=…), not a process global (ADR 0015). -
Model routing (Phase 5), wired into execution:
resolve_router(settings, router=…)and a
UserFunctionRouterthat adapts a(RoutingContext) -> RoutingResultcallable (sync or async).
A customBaseRouterplugs in by injection —Korch(router=…)/Swarm(router=…)— with no
package edit (entry-point discovery deferred, see ADR 0014).Korch.run/Swarm.runnow select a
model per default-worker agent at composition time (deterministic, replay-safe), honouring a model
pinned on the agent andAGENT_MODEL_MAP. -
Model routing (Phase 5), ranking strategies:
AlgorithmicRouter(weighted quality/cost/latency
ranking overROUTING_WEIGHTS, with capability filtering and cost estimation) andSemanticRouter
(embedding-similarity selection againstModelCarddescriptions, with a TTL-cached embedding
singleton). Semantic embeddings require the[routing]extra and are imported lazily; the strategy
is testable offline via an injectedEmbedder.get_router()gained a keyword-onlyembedder. -
Model routing (Phase 5), explicit strategy:
korchestrator.routingwithget_router(), the
BaseRoutersupporting protocol (re-exported frominterfaces), and the explicit + fallback
strategies behind aCompositeRouterchain. The default (ROUTING_STRATEGY="explicit") selects a
per-agent model — a pinned model or anAGENT_MODEL_MAPentry — and always resolves via a
never-declining fallback tail, on the base install with no extra. A built-inModelCardcatalogue
(builtin_model_cards()) and a file/builtin loader (load_model_cards()). NewSettingsfields
for routing (routing_strategy,agent_model_map,routing_weights,routing_priority_order,
embedding_provider,modelcard_*), withSettings.from_envparsing their JSON/CSV forms. -
Self-contained
korchestratorpackage skeleton: every module directory from the module
catalogue, each with a layer-naming docstring and an explicit__all__;py.typed;
and the single-sourceversion.pypinned to0.1.0. -
Authoritative
pyproject.toml:hatchlingbuild backend with the version sourced
dynamically fromversion.py,requires-python >=3.10, thepydantic-only core
dependency, the full extras matrix, and theruff/mypy/pytest/coverage
configuration. -
Minimal typed
korchestrator.config.Settings(mock_llm,korch_runtime,
persistence_backend) withSettings.from_env(), the single place the package reads the
environment. Built onpydantic.BaseModelto keep the base installpydantic-only
(see ADR 0009). -
OSS-readiness files: Apache-2.0
LICENSE,NOTICE,CONTRIBUTING.md,
CODE_OF_CONDUCT.md,SECURITY.md, issue and pull-request templates, and
.editorconfig. -
The
KorchErrorexception hierarchy —KorchErrorand its subclasses (ConfigurationError,
ValidationError,AuthError,NetworkError,TimeoutError,RateLimitError,
QuotaExceededError,ProviderError,RoutingError,ToolError,GovernanceHaltError,
RunFailedError,RunTimeoutError,MissingExtraError) — each carrying a stable error code.
Everything the SDK raises deliberately is aKorchError. -
The frozen Pydantic domain models:
AgentState,Message,StateUpdate,MessageRole,
Performative,RunStatus,AgentConfig,AgentPersona,AgentDescriptor,ExecutionPlan,
TaskDecomposition,ModelCard,TaskSemantics,RoutingContext,RoutingResult,RunResult,
ToolResult. All are immutable and reject unknown fields. -
The ARI ports (
IIdentityProvider,IExecutionSandbox,IModelGateway) and the supporting
protocols (IDurableRuntime,GraphRepository,TenantStore,BaseRouter,AUBConnector),
reachable viakorchestrator.interfaces. -
The public façade —
Korch(Tier-1 one-liner),Swarm(Tier-2 typed builder), andAgent—
and the frozen, curated top-level public API (korchestrator.__all__, 27 names) guarded by a
golden-file snapshot test. Execution (Korch.run/Swarm.run) is wired to the kernel in a later
release; the builder surface is usable now. -
The framework-free superstep kernel, embeddable directly via
korchestrator.core(Tier 3): the four
channel reducers (LastValue,Append,UniqueAppend,MergeDict) with proven algebraic laws;
AgentGraph/Node/Edgewith topology validation (cycles and orphans allowed);ChannelSchema
for binding channels to reducers; andPregelRunner, which runs a graph as deterministic Bulk
Synchronous Parallel supersteps (activation, barrier reduce, message routing, and halting) against
an injected clock. Runs on apydantic-only base install. -
AgentState.halted_agents— a new optional field (default empty) recording which nodes have
individually halted, so a halted node is never reactivated. Additive and backward-compatible. -
The in-process local runtime,
korchestrator.runtime.LocalRuntime— anIDurableRuntimethat
runs a graph to completion with zero infrastructure (theKORCH_RUNTIME=localdefault) — and
resolve_runtime(settings, graph, *, clock, ...), which selects the runtime from config.
Selectingtemporalwithout the[temporal]extra raises an actionableMissingExtraError. -
The durable workflow-engine runtime (behind
[temporal]): a singlePregelMasterworkflow driving
the superstep loop in deterministic workflow scope, invoking oneSuperstepActivityper superstep
for agent compute, with a bounded jittered retry policy, activity timeouts, andcontinue_as_new
roll-over before the engine's 50k-event cap.import korchestrator.runtimepulls in notemporalio;
it is loaded only when the durable runtime is selected. Produces aRunResultequivalent to the
local runtime's. -
Durable HITL control signals on the durable runtime:
cancelends a run ascancelled;pause
parks it (statusgovernance_paused, no compute) untilresumeorcancel, bounded by a 24-hour
deadline after which it istimed_out. Delivered viaIDurableRuntime.signal. (edit_resume
arrives with the HITL façade in a later phase; the local runtime is synchronous and has no HITL.) -
The deterministic offline
MockLMgateway (korchestrator.providers.MockLM) — the default
IModelGateway. The same messages always yield the same completion; it supports scripted
per-model responses and records a call log. No network, no randomness, no credentials — it is what
makes the full agent path testable in CI, and it is the zero-config default. -
The networked default
IModelGateway,korchestrator.providers.OpenAIGateway— a thin client for
any OpenAI-compatible chat-completions endpoint. All configuration (endpoint, credentials, timeout)
is injected (the gateway reads no environment),httpxis lazily imported and lives behind the
[remote]extra (the base install stayspydantic-only), and every vendor failure is wrapped as a
KorchError: a timeout →TimeoutError, 401/403 →AuthError, 429 →RateLimitError, anything
else →ProviderError— always preserving__cause__. Prompts and credentials are never logged. -
korchestrator.providers.get_lm(model_name, *, settings=..., api_key=..., base_url=...)— the
gateway factory: returns the offlineMockLMwhensettings.mock_llm(the zero-config default),
otherwise a configuredOpenAIGateway; a real gateway without injected credentials raises an
actionableConfigurationError. -
The default local ARI providers (
korchestrator.providers):LocalIdentityProvider— an
unsecured, single-tenantIIdentityProviderthat resolves an agent to a deterministic synthetic
DID and enforces its bound tenant; andLocalSandbox— a subprocess-isolatingIExecutionSandbox
that runs a registered tool command in a child process under a hard, kill-on-expiry timeout and
returns a normalisedToolResult. Both are zero-infrastructure development fallbacks: each logs a
warning on construction and is rejected by the production-boot gate under a durable deployment
(spec 08 §5); enterprise deployments supply KIAM/KACP and OpenSandbox. The sandbox tool registry
is empty until the Agent Utility Bridge (P6) populates it. -
First end-to-end run.
Korch.run(objective)andSwarm.run()are wired to the kernel: the
façade classifies the objective (taxonomy), has the Architect plan a team (Tier 1) or takes the
declared topology (Tier 2), binds each agent's clock and gateway, builds a validated kernel graph,
and drives it through the configured runtime to aRunResultwith a populatedfinal_answer. The
Tier-1 one-liner and Tier-2 typed-swarm examples from the public API now run (their tests are no
longerxfail). Reasoning agents require[dspy]; a custom agent (ownthink) runs the whole path
on a pydantic-only base install. A worker's contribution is emitted as ananswermessage so it
accumulates intofinal_answer. -
The deterministic taxonomy (
korchestrator.taxonomy):TaxonomyClassifier.classify(objective)
maps an objective to a typedTaskSemantics(intent, difficulty, implied capability, token
estimates) using keyword/length heuristics — no model call, no extra, fully reproducible. Plus the
built-in agent-descriptor catalogue (default_descriptors(),descriptors_for_intent(intent)) that
the Architect and router use to match intents to agents. -
korchestrator.agents.ArchitectAgent— the Architect meta-agent (requires[dspy]). Given an
objective (and its classified intent/difficulty) it reasons a small team of agent roles and returns
a validatedExecutionPlan. On any reasoning failure — a provider error, or a reply that yields no
valid agent role (as a MockLM echo does) — it returns a deterministic single-agent mock plan, so
a swarm always gets a runnable plan;MissingExtraErrorstill propagates (it does not trigger the
fallback). The DSPy↔gateway bridge is now shared by the worker and architect. -
korchestrator.agents.WorkerAgent— the default reasoning agent (requires the[dspy]extra;
ADR 0013). It compiles itsSignatureinto adspy.Predictat call time and runs it under the
injectedIModelGateway: adspy.LMsubclass routes DSPy's model calls to
IModelGateway.complete(so heterogeneous per-agent models and the offline MockLM both work), and a
lenient chat adapter falls back to the first output field when a reply is not field-marked (so a
deterministic MockLM echo still parses). The blocking DSPy call runs in a worker thread
(asyncio.to_thread); a base install raises an actionableMissingExtraErrorwhen reasoning runs.
Agent.bindnow also accepts an optionalgatewaythe composition root injects. -
Lazy DSPy signatures (
korchestrator.agents): aSignaturebase withInputField/
OutputFieldmarkers that declare a reasoning contract without importingdspy, plus the
built-inWorkerSignatureandArchitectSignature.Signature.to_dspy()materialises a real
dspy.Signatureon demand — the only point that requires the[dspy]extra, raising an actionable
MissingExtraErrorwhen it is absent. Soimport korchestrator.agentsstayspydantic-only and
the cognitive layer is authored offline; the worker compiles the signature at call time. -
The unified
Agentbase (korchestrator.agents.Agent, re-exported askorchestrator.Agentand
korchestrator.services.Agent): one class that is both the declarative Tier-2 builder
(Agent(id="lead", role="review-lead"), unchanged) and the subclassable Tier-3 base with the
frozen-snapshot behavioural surface —async think(state) -> StateUpdate,is_complete(state),
bind(clock=...),clock(clock.now()), andto_node().thinkreceives an immutable
AgentStateand returns aStateUpdatedelta; the base implementation raises until a subclass
overrides it or the façade supplies the default reasoning agent. See ADR 0012.
Fixed
- Validation (Phase 8):
Swarm.add()now rejects a duplicate agentidwith a
ValidationErrorinstead of silently overwriting the earlier agent (the dict-keyed-by-id
storage previously discarded it with no warning).Korch.run/Swarm.runnow validate
max_superstepsis between 1 and 100 (spec 08 §7) — previously any integer, including 0 or
negative, was accepted with no check. Newkorchestrator.validatorsmodule
(validate_objective/validate_max_supersteps/validate_unique_agent_id) centralizes these
domain rules;services/_composition.py's objective-length check now delegates to it instead of
a local copy. - Exception audit (Phase 8):
TemporalRuntime.start/wait/signal(and, through them,
Korch/Swarm.pause/resume/cancel/edit_resume) no longer let a rawtemporalioexception
cross the façade boundary. A lost/refused connection now raisesNetworkError, the run's own
failure raisesRunFailedError, and any other engine-reported error raisesProviderError—
all with__cause__set to the original exception. Also:Settings.from_env()'s.envreader
now wraps an unreadable file intoConfigurationErrorinstead of letting a rawOSErrorescape.
Changed
RunResult.messagesnow includes every message kind (thought/tool/answer/handoff),
not onlykind == "answer"(Phase 10, alongside the ReAct loop above). Previously the kernel's
message log silently dropped every non-answermessage; this was invisible before an agent could
emit more than one message per turn.RunResult.final_answeris unaffected — it already filters
tokind == "answer". Code reading.messageswithout filtering bykindshould now filter to
kind == "answer"to preserve the old behavior.Agentis now defined inkorchestrator.agents(its canonical home) and re-exported from
korchestrator.servicesand the top level — all three import paths resolve to the same class
(ADR 0012). The Tier-2 declarative constructor is unchanged, so this is additive and non-breaking;
the new behavioural methods make custom agents (subclass +think) possible.- Breaking (0.x).
IDurableRuntimeis reshaped from a singlerun(state)method to
now()/start(state)/wait(run_id)/signal(run_id, name, payload)(spec 06 §6), so it can
express durable start-then-rejoin and carry HITL control signals. The graph is injected into the
concrete runtime at construction rather than passed tostart(), keepinginterfaces/dependent
onmodels/only. This lands before any release and before any implementation existed, so no
consumer is affected. See ADR 0010. - Install instructions now point at a private GitHub Release, not PyPI.
korchestratoris not
published to PyPI (ADR 0020);
install a released version with
pip install "korchestrator[dspy] @ git+https://github.com/Kendralabs/korch-sdk.git@v0.1.0",
which needs a GitHub credential with read access to this repo. See docs/installation.md.