Skip to main content

Harness- and domain-neutral Bayesian tool-call governance — a pure wire consumer of the Credence engine (credence-skin).

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

Not yet on PyPI — install from a clone of the repo. The core depends on the engine's Python wire client (credence-skin-client), also unpublished, so install both editable:

pip install -e packages/governor_core -e ~/git/credence/apps/skin/clients/python
# dev engine: a local checkout of the Credence engine
CREDENCE_ENGINE_DIR=/path/to/credence credence-governor-daemon
# prod: a pinned engine image instead
CREDENCE_SKIN_COMMAND="docker run --rm -i ghcr.io/gfrmin/credence-skin@sha256:<digest>" \
  credence-governor-daemon
# (once published:  pip install credence-governor-core)

The daemon listens on http://127.0.0.1:8787 by default (CREDENCE_GOVERNOR_HOST / CREDENCE_GOVERNOR_PORT).

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.1.0.tar.gz (36.6 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.1.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: credence_governor_core-0.1.0.tar.gz
  • Upload date:
  • Size: 36.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 3c8ca6671e976ff2a003b4c600373fad42208ee034722963f66b65b9761a9b56
MD5 ac4e66edd952dfbb70d4b93fa7b9a083
BLAKE2b-256 d4e39759fca8e18e5863e50ed791b8b8e76b75db9a26df708c2af3be33cdde07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for credence_governor_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1abc601ff2b6ed49ddf3d89471f41f3339d48121ca9ec79ee5d3c1304c45cab
MD5 ab9277efda435634d6d2b5e7f4b2aa8b
BLAKE2b-256 30f3cfac4ea6353f088b8ac82d490363f21fbe06800def0d8cbdebb7b3523538

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