Reference-grade DBL implementation: deterministic governance over non-deterministic execution.
Project description
ENSdg
Executable Normative Semantics for Deterministic Governance
ensdg exists to make the DBL papers executable, testable, and falsifiable.
It defines the normative upper bound of the DBL model in code.
ENSdg was previously developed under the working name "dbl-reference".
The rename reflects the stabilized scope and role as a semantic anchor.
This repository is not a product, framework, SDK, or integration layer.
What this repository is
ensdg serves exactly three purposes:
-
Executable reference model
A minimal implementation of the DBL axioms with no discretionary behavior. -
Invariant oracle
A canonical baseline against which other DBL-based systems can be validated. -
Semantic anchor
A fixed point that prevents drift as higher-level tooling evolves.
If another implementation disagrees with ensdg, either the implementation is wrong or the papers are.
Normative guarantees
The following properties are normative and enforced by structure and tests:
- Append-only, totally ordered event stream V
- Event kinds: INTENT, DECISION, EXECUTION, PROOF
- DECISION primacy: only DECISION events are normative
- Governance consumes authoritative inputs only
- Pre-execution decision:
DECISION precedes EXECUTION for the same
correlation_id - Normative replay depends exclusively on DECISION events
- Observational non-interference: EXECUTION and PROOF events cannot affect normative state
These guarantees correspond directly to the axioms and claims of the DBL papers.
For the precise boundary of what is normative vs observational, see
docs\normative_bounds.md.
What this repository is not
ensdg intentionally does not provide:
- Policy languages or DSLs
- Workflow engines or orchestration
- Network, infrastructure, or side effects
- Adaptive, learning, or feedback-driven policies
- Production-grade persistence or scalability
- UI, UX, or convenience abstractions
Anything that introduces implicit normativity is explicitly out of scope.
The example_* modules are test fixtures only.
Position in the DBL ecosystem
ensdg is intentionally small and strict.
Other repositories may build around it without extending its scope.
-
dbl-core / kernel-logic
Define execution primitives and invariants.
ensdgassumes these as given. -
dbl-vlog
Event stream and persistence abstractions.
ensdgaligns conceptually but does not provide storage backends. -
dbl-main
Integration and composition layer.
Real-world wiring, adapters, and domain runners belong there.
dbl-mainSHOULD be validated againstensdg.
Educational repositories (dbl-tutorial, dbl-simple) may trade strictness for clarity,
but MUST NOT weaken DBL invariants.
How this repository is used
Typical uses:
- Validate that a DBL-based system preserves:
- DECISION primacy
- pre-execution decision ordering
- observational non-interference
- normative replay equivalence
- Detect semantic drift during refactors or evolution
- Ground DBL discussions in executable semantics rather than interpretation
This repository answers one question only:
What does DBL mean under a minimal, interference-free implementation?
Validation workflow
Use this repo to validate an external DBL system:
- Export the system's event stream as JSONL.
- Run
ensdg --mode validateto check invariants. - Run
ensdg --mode replayto compute the normative projection. - Run
ensdg --mode replay --digestto compute the normative digest. - Compare projections/digests across runs to confirm stability.
CLI contract (normative)
The CLI is a validator/oracle surface, not a runtime or integration API. Any deviation is a bug unless the DBL papers changed. InvariantError and ReplayError are normative validator errors; AdmissionRejected is demo-only and non-normative.
Modes
--mode demo
Emits a minimal valid DBL event stream (JSONL).--mode replay
Emits the normative replay projection (single JSON object), unless--digestis set.--mode validate
Emits nothing on success unless--digestis set.
Exit codes
| Code | Name | Meaning |
|---|---|---|
| 0 | RC_OK | Success |
| 2 | RC_USAGE | Argument or usage error |
| 3 | RC_PARSE | Invalid JSON/JSONL input |
| 4 | RC_INVARIANT | Invariant violation |
| 5 | RC_REPLAY | Replayability failure |
| 6 | RC_ADMISSION | Demo admission rejected |
On failure:
- stdout MUST be empty
- stderr MUST contain exactly one prefixed error line
Normative replay projection
Replay emits:
{"decisions": {"<correlation_id>": "<ALLOW|DENY>"}}
Richer projections are allowed elsewhere, but they MUST be reducible to this form for equivalence checks.
Normative digest
The normative digest is computed over:
{
"decisions": {
"<correlation_id>": {
"decision": "<ALLOW|DENY>",
"policy_version": "<int>",
"authoritative_digest": "<sha256>"
}
}
}
Boundary configuration is excluded by definition. Differences in rationale or execution artifacts are observational only.
Stability
This repository is stable by design.
Changes should be rare and only justified by explicit changes to the DBL papers themselves.
References
Execution Without Normativity - A Minimal Theory of Deterministic Execution and Observation
https://github.com/lukaspfisterch/execution-without-normativity
Deterministic Boundary Layers - Governing Non-Deterministic Execution
https://github.com/lukaspfisterch/dbl-paper
Stability policy
This repository is a specification anchor and regression oracle. It is intentionally small, strict, and stable.
It is not intended as a runtime dependency for production systems. Changes should be rare and justified by explicit changes to the DBL papers or dbl-core invariants.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ensdg-0.4.0.tar.gz.
File metadata
- Download URL: ensdg-0.4.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35a62b6b1cf58da13d02c3e23118178e880f821a6b32eea9b8bcabcccc75ef19
|
|
| MD5 |
66fac01c62719ded0d20ad4f6eb16842
|
|
| BLAKE2b-256 |
75e86dc86f943b8791944f3632bb53d657355dfea6ec571e93035015998b3ac6
|
File details
Details for the file ensdg-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ensdg-0.4.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30532efe0952ea8bcccc02c9db6692f39442c314660f340254037b9dc13b0b04
|
|
| MD5 |
018d41c2df6d23dac2b224b9e638abb5
|
|
| BLAKE2b-256 |
8012040f1556d1d3667c1914eba887372e4b82f63830c5fda6b243391c9a5382
|