Applied Epistemic Engineering for Python
An evidence-centered Python toolkit for turning important claims into inspectable engineering artifacts. It makes boundaries, evidence, provenance, uncertainty, contradictions, falsification tests, recovery work, and decision history explicit.
This is an original, ground-up ElectroHire implementation. Its result model aligns directly with ElectroHire's Spec Kit Evaluator Contract while the domain engine remains independently packaged.
Why it exists
Ordinary validation asks whether an artifact is formatted correctly. AEE asks harder questions:
- What exactly is being claimed?
- Under what conditions does it hold?
- What was observed, inferred, or merely asserted?
- What evidence would prove the claim wrong?
- Which claims depend on uncertain foundations?
- What contradicts the current conclusion?
- What bounded work would improve the decision?
The library does not call a confidence number “truth.” Every score is a transparent decision aid derived from recorded evidence and explicit rules.
Installation
pip install applied-epistemic-engineering
Requires Python 3.11 or later; tested on Linux, macOS, and Windows with Python 3.11, 3.12, and 3.13.
Using Spec Kit? You don't need to install this
package yourself. Install the Spec Kit extension, which installs a compatible engine
(applied-epistemic-engineering>=1.5.0,<2, the latest available) and its other
dependencies automatically on first use:
specify extension add aee --from https://github.com/electrohire/spec-kit-aee/archive/refs/tags/v1.5.1.zip
The example pins spec-kit-aee 1.5.1, the extension release tested with this engine; check
its releases for newer versions.
spec-kit-aee is a Spec Kit extension distributed as a GitHub release archive, not a PyPI
package, and is versioned independently of this engine.
For development:
pip install -e ".[dev,docs]"
Five-minute example
from aee import (
AEESession,
ClaimKind,
ClaimStatus,
Evidence,
EvidenceKind,
SourceQuality,
)
session = AEESession(
"checkout-service",
phase="after_plan",
ledger_file=".aee/epistemic-ledger.jsonl",
)
claim = session.add_claim(
"REQ-PERF-001",
"Checkout p95 latency remains below 300 ms",
kind=ClaimKind.REQUIREMENT,
boundary=["production", "nominal load", "30-minute observation window"],
source_ref="spec.md#REQ-PERF-001",
)
claim.status = ClaimStatus.SUPPORTED
claim.falsification_tests.append("Observe p95 latency at or above 300 ms")
session.add_evidence(
claim.id,
Evidence(
ref="reports/load-test-2026-09-04.json",
kind=EvidenceKind.OBSERVED,
source_quality=SourceQuality.TEST,
source_id="load-test-2026-09-04",
description="Observed p95 latency was 241 ms",
),
)
assessment = session.assess()
print(assessment.outcome, assessment.summary)
CLI
aee assess --input claims.json --phase after_plan --output assessment.json \
--evaluator-output evaluator-result.json
# assess ledgers by default (Spec 002 FR-8.1): the assessment above was
# also appended to .specify/extensions/aee/ledger/epistemic-ledger.jsonl
# under the project root (the CWD, or --project-root when given) — the
# same default the spec-kit-aee runner uses. --ledger <path> selects a
# different ledger; --no-ledger opts out, and the choice is echoed into
# the assessment metadata either way.
aee verify-ledger --ledger .specify/extensions/aee/ledger/epistemic-ledger.jsonl
aee challenge --input claims.json --phase after_plan --output challenge.json
aee validate claims.json # strict load + structural checks (CI: 0 valid, 2 invalid)
aee verify-evidence claims.json --project-root . # refs resolve, hashes recompute, quality is derived vs declared
aee assess --input claims.json --verify-evidence --project-root . # the same checks, folded into the assessment
aee gaps --matrix specs/verification-matrix.md --evidence evidence/ --output GAPS.md
aee graph --input claims.json --output claim-graph.mmd
aee gate --input assessment.json
aee demo # self-contained demonstration assessment
# With the epistemic-ledger policy gates and measured source reliability:
aee assess --input claims.json --policy --reliability reliability.json
# Diff two assessments into a materiality-filtered review queue:
aee review --previous assessment-t1.json --current assessment-t2.json
Exit codes are CI-friendly: 0 for pass/warn, 1 for iteration/clarification/evidence
collection/abstention, and 2 for a hard block or invalid ledger.
The ledger is the record; the JSON is a working copy (Spec 002 FR-8.3). Each ledger
entry stores the assessment's SHA-256 alongside its project, phase, outcome, and claim
ids, so the entry — not the assessment file, which tools routinely overwrite on the
next run — is the durable record of what was assessed. The documented loop is
aee assess → aee verify-ledger --ledger <path>; the CLI and the spec-kit-aee
runner describe identical semantics (ledger by default, same default path,
--no-ledger as the explicit opt-out).
Architecture
| Layer | Responsibility |
|---|---|
aee Python package |
Claims, evidence, scoring, challenge, recovery, graph, ledger |
spec-kit-aee |
Spec Kit commands, hooks, and artifact discovery |
spec-kit-evaluator |
Shared result envelope, composition, reports, and model routing |
Core principles
- Assertions never become observations because a model repeats them.
- Counterevidence and contradictions remain visible.
- Unsupported claims remain explicitly unsupported.
- Confidence propagates through dependencies by the weakest-link rule.
- Every failure produces a bounded recovery proposal with a verification condition.
- Deterministic checks run before probabilistic review.
- Hash chains establish tamper evidence—not truth, identity, or trusted time.
Documentation
Full documentation is published on Read the Docs at applied-epistemic-engineering.readthedocs.io. Users adopting AEE from another implementation can follow the migration guide. How the engine, extension, and catalog versions relate is specified in the version policy.
Ownership and license
Designed and implemented by ElectroHire Inc. Copyright © 2026 ElectroHire Inc. Released under the MIT License.
Metadata
Release files for applied-epistemic-engineering 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| applied_epistemic_engineering-1.5.2.tar.gz | 260.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| applied_epistemic_engineering-1.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 410.9 kB
Release files / applied_epistemic_engineering-1.5.2.tar.gz
| Download URL | applied_epistemic_engineering-1.5.2.tar.gz |
|---|---|
| Size | 260.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5e05617edbcfedbdf1467a802d171a235ef04031cd71e21dfa8a9dbd2cddd5f
|
|
BLAKE2b-256 checksum How to use checksums |
02a95ddb8924587f726899b078ea776cf60125e55dee21c9006fda119abd9f9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / applied_epistemic_engineering-1.5.2-py3-none-any.whl
| Download URL | applied_epistemic_engineering-1.5.2-py3-none-any.whl |
|---|---|
| Size | 150.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59376463b041d9aa0a3932addb0ef0d5be074d48f0b57165bdc11875f7b89371
|
|
BLAKE2b-256 checksum How to use checksums |
5d113b7ab34eaa8442dee4537a25856796a6721421042a65ebcb40c2a9aa10f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency log