Skip to main content

Harness- and domain-neutral Bayesian tool-call governance — a pure wire consumer of the Credence engine (credence-skin). Run credence-governor-daemon to serve it on :8787.

Project description

credence-governor-core

The harness- and domain-neutral Bayesian tool-call governance core for credence-governor — a pure wire consumer of the Credence engine (credence-skin). It carries no probabilistic code: all inference runs server-side in the engine, reached over the protocol-versioned JSON-RPC skin wire; this package only extracts features from a neutral event and drives proceed / block / ask decisions.

What's in it

  • schema.py — the harness-neutral contract: AgentToolEvent, Session, Message. Every adapter translates its native events into these shapes.
  • features/ + safety.py — the single source of truth for feature & taint extraction (waste loops, repetition, taint-flow, exfil chains). Adapters carry none of this; they send a Session and the daemon extracts.
  • session.py (BrainSession) — boots the warm beliefs and drives the engine's structure_bma / structure_observe / structure_decide / routing_* verbs.
  • daemon.py — the HTTP surface: POST /decide (synchronous, for subprocess-hook adapters), POST /sensor + GET /signals (SSE, for in-process plugins), /report, /ready. stdlib http.server; one lock serialises engine calls.
  • data/ — "coding-ness" as data: the bdsl/ feature schema + utility, the brain/*.counts.json warm beliefs, and profiles/. Swappable.

Install & run

Zero-config — with docker or podman on PATH, the daemon auto-runs the published engine image (ghcr.io/gfrmin/credence-skin:latest); no env vars needed:

pip install credence-governor-core   # pulls the engine's wire client (credence-skin-client)
credence-governor-daemon             # zero-config: auto-runs the engine via docker/podman

Overrides (resolution order: CREDENCE_SKIN_COMMANDCREDENCE_ENGINE_DIR → zero-config):

# prod: pin the engine image by digest (reproducible) — highest precedence
CREDENCE_SKIN_COMMAND="docker run --rm -i ghcr.io/gfrmin/credence-skin@sha256:<digest>" \
  credence-governor-daemon
# dev engine: a local checkout of the Credence engine
CREDENCE_ENGINE_DIR=/path/to/credence credence-governor-daemon

The daemon listens on http://127.0.0.1:8787 by default (CREDENCE_GOVERNOR_HOST / CREDENCE_GOVERNOR_PORT). Every adapter is a fail-open silent no-op until this daemon answers on :8787 — verify with curl -s localhost:8787/ready.

POST /decide {tool_name, input, session:{cwd, project_root, messages}}{action, features, event_id}.

Tests

python -m pytest tests -q   # parity tests; no engine needed (pure extractor/manifest code)

License

AGPL-3.0-or-later.

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

credence_governor_core-0.2.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

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

credence_governor_core-0.2.0-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

Details for the file credence_governor_core-0.2.0.tar.gz.

File metadata

  • Download URL: credence_governor_core-0.2.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for credence_governor_core-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6f23617c6099aff6c3879b9cdf5fa6dd06deb5001ba4a7734ef866aa4037dc71
MD5 6a99d060c1396c85642d07ba3980db9e
BLAKE2b-256 66262435e137a715e643ca093ae4e57e8d3d3adafbd542321c9a722dcb3f78a2

See more details on using hashes here.

File details

Details for the file credence_governor_core-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for credence_governor_core-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17e77f9f2e6b9fc3ab53107f8b24e5c2510df01da1d3e403d7b97ac27674190c
MD5 89a0cc2c5b120c76ba483c7c86d62cbe
BLAKE2b-256 36c59cf92008a8e7d77b894dbb6a6ad448b911a8cc51fe7849cadb0a94898bd7

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