Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 1.98 KB

File metadata and controls

50 lines (40 loc) · 1.98 KB

Development

How to run the tests, and what lives where.

python3 -m venv .venv && .venv/bin/pip install -e '.[dev]'
.venv/bin/python -m pytest

The tests stub the Hermes internals the adapter imports (tests/hermes_stub.py) so the ingest path — verification, dedup, admission control, ack modes, outcome reporting — is exercised without a Hermes checkout.

The dashboard bundle is JavaScript, so pytest cannot see it. It has its own suite, run by node's built-in test runner:

node --test "tests/dashboard/*.test.mjs"

No package.json, no install, nothing to build. The bundle takes React, its hooks and its fetch from the injected window.__HERMES_PLUGIN_SDK__, so tests/dashboard/harness.mjs fakes that SDK and runs the shipped file under node:vm — the real dist/index.js, byte for byte. createElement returns plain objects instead of rendering, because the questions worth asking are which endpoint a button posts to and whether it is disabled, and neither needs a DOM.

Code layout

Module What lives there
adapter.py The platform adapter: lifecycle, the delivery pipeline, outcome reporting
settings.py Every knob, resolved once from config + env, validated before start
routing.py Which route a delivery belongs to, and what event it is
payload.py Bytes → payload, including the encoding rules that bite
verify.py The one signature scheme
state.py The SQLite delivery ledger
api.py A thin async client for the Hookdeck API
provision.py Building the connection Hookdeck should have
cli.py hermes hookdeck …
tools.py The agent-facing toolset
dashboard/ The dashboard tab: manifest, backend routes, and a no-build bundle

routing.py, payload.py, verify.py, provision.py and settings.py are pure — no Hermes, no HTTP, no state — so the rules they encode can be read and tested on their own. adapter.py is the only module that needs a gateway.