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.3.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.3.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lodestar_runtime_client-0.3.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lodestar_runtime_client-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c5d84fed5c485c2b58a815e9e51c7b662a282cd0b81dc787fc3a5cd0c8d2f8a1
MD5 bd8c47c6f827bc929f1d15b2d07240e4
BLAKE2b-256 c61a8b6d338e0a4edb3b64c4127c38d49f7a61ed59db252c26baae35ccc67797

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lodestar_runtime_client-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lodestar_runtime_client-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b100c3e93131f5dc94437f93ed1c27bd452e377566f8d92184252377277e583b
MD5 66e0e9bbefede62beb8e04ae3d22b31d
BLAKE2b-256 4656228c9d3c0b683ade69b801d6b7bb64ef6d7921cdfd63778ca3730eb42f4e

See more details on using hashes here.

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