A minimal reference implementation for deterministic decision equivalence verification.
This verifier does NOT define equivalence as structural or hash equality. This repository is a minimal reference scaffold, not a complete implementation of Guardian v0.2.
Decision equivalence is determined by invariant boundary equality, as defined in Guardian v0.2.
Canonicalization is used only as a deterministic encoding step, not as a semantic equivalence criterion.
- Exposes
POST /verify - Accepts
decision_aanddecision_b - Performs deterministic canonicalization:
- Sorts dictionary keys
- Removes unnecessary whitespace
- Performs deterministic normalization (current implementation)
- Uses canonical hashing as a temporary comparison mechanism
- NOTE: This is NOT the final equivalence model (see Guardian v0.2)
equivalentcanonical_hash_acanonical_hash_b⚠️ Current implementation uses structural comparison as a placeholder. Semantic invariant-based equivalence is defined in Guardian v0.2 and will replace this.
- No policy engine
- No DID / signature / receipt / attestation
- No runtime integration
- No database
This project is intentionally minimal and intended as a reference implementation.
python -m venv .venv
. .venv/Scripts/activate
pip install -r requirements.txt
uvicorn app.main:app --reloadRequest body:
{
"decision_a": {"id": "D-001", "result": "allow"},
"decision_b": {"result": "allow", "id": "D-001"}
}Response body:
{
"equivalent": true,
"canonical_hash_a": "<sha256-hex>",
"canonical_hash_b": "<sha256-hex>"
}pytestexamples/equal_a.jsonexamples/equal_b.jsonexamples/different.json