Skip to main content

JEP Reference Runtime

jep-runtime is a runnable reference implementation for the Judgment Event Protocol (JEP). It turns the current JEP Internet-Draft primitives — Judgment (J), Delegation (D), Termination (T), and Verification (V) — into executable accountability semantics: create an event, canonicalize it, hash it, chain it, archive it, replay it, and verify it across neutral profile adapters.

This repository is intentionally not an agent framework, workflow orchestrator, blockchain, consensus layer, payment executor, or production security system. Mock signatures and mock credential references are provided so protocol semantics can be tested before deployment-specific cryptography is plugged in.

Architecture

+-------------------+      +------------------------+      +------------------+
| Event Runtime     | ---> | Canonicalization       | ---> | SHA-256 Hashing  |
| J / D / T / V     |      | UTF-8 sorted JSON      |      | event_hash       |
+---------+---------+      +-----------+------------+      +---------+--------+
          |                            |                             |
          v                            v                             v
+-------------------+      +------------------------+      +------------------+
| Delegation        | ---> | Append-only Archive    | ---> | Verification     |
| scoped authority  |      | JSONL import/export    |      | chain/replay     |
+---------+---------+      +-----------+------------+      +---------+--------+
          |                            |                             |
          v                            v                             v
+-------------------+      +------------------------+      +------------------+
| Profile Adapters  | ---> | Replay Engine          | ---> | Conformance      |
| OAuth/X509/DID/IAM|      | lineage graph/state    |      | vectors/report   |
+-------------------+      +------------------------+      +------------------+

Runtime data flow

  1. A caller creates a JEPEvent with the required core fields.
  2. The event is canonicalized as normalized UTF-8 JSON with stable field ordering and no insignificant whitespace.
  3. event_hash = SHA256(canonical_event_without_event_hash) is assigned once; changing a hashed event requires creating a new event.
  4. New events reference previous_event_hash, producing an append-only event chain.
  5. Delegation events carry bounded authority_scope and delegation_chain entries so authority lineage can be replayed.
  6. JSONL archives append one canonical event record per line.
  7. Verification recomputes hashes, validates nonce uniqueness, checks hash continuity, validates delegation scope, and invokes the configured neutral profile adapter.

Replay flow

archive.jsonl
   |
   v
import events -> verify entire chain -> replay J/D/T/V semantics
   |                  |                    |
   |                  |                    +--> termination_state
   |                  +--> tamper/nonce/profile/delegation errors
   +--> lineage_graph: hash-chain edges + delegation edges

Run it with:

jep replay archive.jsonl

The replay output is a portable event lineage graph plus authority and termination state. It is evidence reconstruction, not workflow execution.

CLI

jep create-event --type J --actor human:alice --subject agent:planner \
  --agent-id agent:planner \
  --scope-json '{"actions":["read"],"resources":["repo:jep"]}' \
  --intent-json '{"task":"summarize JEP"}' \
  --archive archive.jsonl

jep verify event.json
jep archive-verify archive.jsonl
jep replay archive.jsonl
jep conformance-test

Conformance matrix

Capability Runtime check
Canonicalization Stable UTF-8 JSON with sorted keys and normalized strings
Deterministic hashing SHA-256 over canonical event without event_hash
Delegation semantics Parent/child scope and expiration checks
Verification semantics Hash, nonce, timestamp, profile, and chain integrity checks
Profile compatibility Neutral ProfileAdapter contract with mock OAuth/OIDC, X509, DID/VC, Local IAM labels
Replay correctness Archive replay must re-verify the full chain and emit lineage graph/state

jep conformance-test emits test vectors, mock signed vectors, and a compatibility report.

Correspondence with the JEP draft

Draft primitive / concept Runtime implementation
J Judgment EventType.JUDGMENT and create_event("J", ...)
D Delegation delegate_authority(), scoped delegation events, verify_delegation_chain()
T Termination EventType.TERMINATION, replayed into termination_state
V Verification verify_event(), verify_chain(), verify_replay(), verification events
Replay protection Required nonce and duplicate nonce validation
Signed/verifiable event format Immutable hashed event model plus mock profile references
Optional profiles ProfileAdapter interface; provider-neutral mock adapter
Append-only receipts JSONL archive with chain verification on replay

Repository structure

jep_runtime/
  core/                 # immutable event model and JSON schema generation
  events/               # event factories
  canonicalization/     # deterministic JSON + SHA-256 hashing
  delegation/           # authority propagation and scope validation
  verification/         # event, chain, replay, tamper, profile verification
  profiles/             # provider-neutral profile adapter interface and mock adapter
  archive/              # append-only JSONL archive runtime
  replay/               # lineage graph and termination replay
  conformance/          # conformance vectors and matrix
  cli/                  # jep command line entry point
  schemas/              # generated JSON schema
examples/               # example event scenarios
tests/                  # executable conformance/runtime tests

Limitations

  • Signatures are mock/reference only.
  • Profile adapters do not verify real OAuth/OIDC, X509, DID/VC, or IAM credentials.
  • No blockchain, distributed consensus, real payment execution, or production key management is included.
  • The runtime enforces executable protocol invariants, not legal liability, governance policy, or workflow lifecycle orchestration.

Runtime governance extension points

  • Replace MockProfileAdapter with production credential adapters.
  • Add signature suites while preserving the canonicalization boundary.
  • Add draft-version-specific schema adapters without changing the pinned v06 J/D/T/V primitive meaning.
  • Add draft-version-specific schema adapters without changing J/D/T/V primitive meaning.
  • Publish conformance vectors for independent implementations.
  • Add governance-specific validation modules outside the core minimal runtime.

Runtime and verification notes

See HARDENING.md for supported behavior, regression checks, and compatibility boundaries.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jep_runtime-0.1.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

jep_runtime-0.1.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file jep_runtime-0.1.1.tar.gz.

File metadata

  • Download URL: jep_runtime-0.1.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jep_runtime-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e28c9a73703448520ed2a023bc3da0e7c9c758ada4fdad94a1d0ede713e53e73
MD5 18fd80d62d323e6b1c2abdcf73c7995a
BLAKE2b-256 b63dbfeeba2d93f8c3dd3fbed762fbce76464485c2e26c07c55f0839f8725d7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for jep_runtime-0.1.1.tar.gz:

Publisher: release.yml on hjs-spec/jep-runtime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jep_runtime-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jep_runtime-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jep_runtime-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2247883f296eed99d6457dce61a72b969e50c173ab0188fc2ca0b181fd14c33d
MD5 e1cb3a55f4b60ee5aa399d99b2173084
BLAKE2b-256 689f51cbaa21875c88f580af53dd6d0ab73b77e1eecc99a03040f953f32a1805

See more details on using hashes here.

Provenance

The following attestation bundles were made for jep_runtime-0.1.1-py3-none-any.whl:

Publisher: release.yml on hjs-spec/jep-runtime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page