Skip to main content

The shared pure-stdlib Python RPC client for Lodestar runtime hooks — spawns the `lodestar runtime gate` sidecar and remotes native tool calls through the Action Kernel over NDJSON-RPC (ADR-0024 / ADR-0028).

Project description

lodestar-runtime-client

The shared pure-stdlib Python RPC client for the Lodestar runtime hooks — the open epistemic-governance framework for AI agents.

GateClient spawns the TypeScript governance-gate sidecar (lodestar runtime gate) as a child process and speaks newline-delimited JSON-RPC to it over stdin/stdout — the same framing MCP uses, with zero runtime dependencies. Each native tool call is remoted through the Lodestar Action Kernel: two-phase propose → arbitrate → execute, the signed policy gate, cognitive-core ingestion, sentinel arbitration, and the signed-approval L4 hold path (ADR-0024). The channel is bidirectional — the gate calls back to run a tool body, so the body runs only inside the gate's execute phase, never before approval.

This is the framework-agnostic spine the per-framework hooks build on. You usually don't depend on it directly — install the hook for your framework instead:

It was extracted from those three hooks in #128 (ADR-0028); before that it was a verbatim copy vendored inside each.

Install

pip install lodestar-runtime-client
# and the Lodestar CLI (Bun/npm), which provides `lodestar runtime gate`:
npm install -g @qmilab/lodestar-cli   # or: bun add -g @qmilab/lodestar-cli

Use (low-level)

from lodestar_runtime_client import GateClient

with GateClient("runtime-gate.config.json") as gate:
    gate.register_tool("search_web", lambda args: {"output": do_search(args["q"])})
    result = gate.govern("search_web", {"q": "lodestar"})
    # result is the govern_result: completed | pending_approval | rejected | failed

For a real framework, reach for the matching hook above — it registers and wraps the framework's toolset for you (govern_tools) and surfaces holds idiomatically.

Scope (honest, ADR-0004 lineage)

This is governance over declared actions, not OS containment of the process. A call for an unregistered tool is denied (fail closed). Pair with network/filesystem controls for defense in depth.

Apache-2.0. Part of the Lodestar monorepo (runtimes/runtime-client/).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lodestar_runtime_client-0.4.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lodestar_runtime_client-0.4.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file lodestar_runtime_client-0.4.0.tar.gz.

File metadata

  • Download URL: lodestar_runtime_client-0.4.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lodestar_runtime_client-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8e7e942cd5c6f809f4ed5bb538e18b37c6003724be36e49a40521403aaba87f2
MD5 9900f2886eda80fea13d9f9031b508e9
BLAKE2b-256 99802b5d028b24bb1a4937420d75d7321206a2667c3af56e1c6c3eab7415f71a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lodestar_runtime_client-0.4.0.tar.gz:

Publisher: publish-pypi.yml on qmilab/lodestar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lodestar_runtime_client-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lodestar_runtime_client-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7883ca5435f9eb959eda03c3e039330f54b8f881ccb193001b9bd93c2bd57ef8
MD5 b46fff60b6fa4eb9d27d2471683338a2
BLAKE2b-256 7ee7265137e30cdcf6afd721071881edeaa21d532a10ecb6e19b619d04727359

See more details on using hashes here.

Provenance

The following attestation bundles were made for lodestar_runtime_client-0.4.0-py3-none-any.whl:

Publisher: publish-pypi.yml on qmilab/lodestar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page