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

Uploaded Python 3

File details

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

File metadata

  • Download URL: lodestar_runtime_client-0.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 bfac24e225ee6c5a5649db271bc649c920edecb09bd320767568ca6e5977143d
MD5 39c673458ed74d51e1923f0faaeec1d8
BLAKE2b-256 080ca6dafbec67a37a3a3e2cdf21967220b764b7b9a7455646d68761bb6a78b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lodestar_runtime_client-0.5.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.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lodestar_runtime_client-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 993c853b776a57168b68f7269d7d507e965bc0e93295aec673883b215397aa5b
MD5 6b4ca2858c1ebbaedba20966e858492f
BLAKE2b-256 44e81aac414fe92851331da1b23bf99807cc4b7e31cadde2d289cb98ff81b930

See more details on using hashes here.

Provenance

The following attestation bundles were made for lodestar_runtime_client-0.5.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