Repository navigation
Releases
Releases · Kendralabs/korch-sdk
v0.1.0
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 def...