applied-epistemic-engineering 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- applied_epistemic_engineering-1.0.0/.gitignore +13 -0
- applied_epistemic_engineering-1.0.0/.readthedocs.yaml +17 -0
- applied_epistemic_engineering-1.0.0/CHANGELOG.md +20 -0
- applied_epistemic_engineering-1.0.0/LICENSE +22 -0
- applied_epistemic_engineering-1.0.0/PKG-INFO +162 -0
- applied_epistemic_engineering-1.0.0/README.md +126 -0
- applied_epistemic_engineering-1.0.0/docs/api.md +36 -0
- applied_epistemic_engineering-1.0.0/docs/concepts.md +36 -0
- applied_epistemic_engineering-1.0.0/docs/index.md +21 -0
- applied_epistemic_engineering-1.0.0/docs/ledger.md +24 -0
- applied_epistemic_engineering-1.0.0/docs/migration.md +54 -0
- applied_epistemic_engineering-1.0.0/docs/quickstart.md +67 -0
- applied_epistemic_engineering-1.0.0/docs/scoring.md +25 -0
- applied_epistemic_engineering-1.0.0/docs/security.md +25 -0
- applied_epistemic_engineering-1.0.0/docs/spec-kit.md +23 -0
- applied_epistemic_engineering-1.0.0/mkdocs.yml +56 -0
- applied_epistemic_engineering-1.0.0/pyproject.toml +80 -0
- applied_epistemic_engineering-1.0.0/src/aee/__init__.py +55 -0
- applied_epistemic_engineering-1.0.0/src/aee/__main__.py +3 -0
- applied_epistemic_engineering-1.0.0/src/aee/adapters/__init__.py +5 -0
- applied_epistemic_engineering-1.0.0/src/aee/adapters/evaluator.py +180 -0
- applied_epistemic_engineering-1.0.0/src/aee/challenge.py +274 -0
- applied_epistemic_engineering-1.0.0/src/aee/cli.py +177 -0
- applied_epistemic_engineering-1.0.0/src/aee/engine.py +129 -0
- applied_epistemic_engineering-1.0.0/src/aee/extract.py +122 -0
- applied_epistemic_engineering-1.0.0/src/aee/graph.py +137 -0
- applied_epistemic_engineering-1.0.0/src/aee/ledger.py +123 -0
- applied_epistemic_engineering-1.0.0/src/aee/model.py +266 -0
- applied_epistemic_engineering-1.0.0/src/aee/py.typed +1 -0
- applied_epistemic_engineering-1.0.0/src/aee/recovery.py +96 -0
- applied_epistemic_engineering-1.0.0/src/aee/schemas/__init__.py +11 -0
- applied_epistemic_engineering-1.0.0/src/aee/schemas/aee-assessment.schema.json +134 -0
- applied_epistemic_engineering-1.0.0/src/aee/scoring.py +174 -0
- applied_epistemic_engineering-1.0.0/src/aee/session.py +84 -0
- applied_epistemic_engineering-1.0.0/tests/test_challenge.py +102 -0
- applied_epistemic_engineering-1.0.0/tests/test_engine_adapter.py +50 -0
- applied_epistemic_engineering-1.0.0/tests/test_extract_session_cli.py +87 -0
- applied_epistemic_engineering-1.0.0/tests/test_graph.py +50 -0
- applied_epistemic_engineering-1.0.0/tests/test_ledger.py +41 -0
- applied_epistemic_engineering-1.0.0/tests/test_model.py +46 -0
- applied_epistemic_engineering-1.0.0/tests/test_scoring.py +64 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
4
|
+
and [Semantic Versioning](https://semver.org/).
|
|
5
|
+
|
|
6
|
+
## [1.0.0] - 2026-09-04
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Independent Applied Epistemic Engineering domain model.
|
|
11
|
+
- Claim decomposition, evidence/provenance representation, and explicit uncertainty.
|
|
12
|
+
- Deterministic stress testing, contradiction discovery, dependency analysis, and recovery.
|
|
13
|
+
- Evidence-quality scoring with weakest-link propagation.
|
|
14
|
+
- Tamper-evident SHA-256 JSONL ledger with complete-chain verification.
|
|
15
|
+
- Adapter for ElectroHire's Spec Kit Evaluator Contract v1.0.
|
|
16
|
+
- Dependency-free CLI and Python API.
|
|
17
|
+
- Strict Read the Docs/MkDocs documentation and multi-platform CI.
|
|
18
|
+
|
|
19
|
+
[1.0.0]: https://github.com/electrohire/applied-epistemic-engineering/releases/tag/v1.0.0
|
|
20
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ElectroHire Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: applied-epistemic-engineering
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Evidence-centered claim evaluation, adversarial challenge, recovery, and tamper-evident epistemic records.
|
|
5
|
+
Project-URL: Homepage, https://github.com/electrohire/applied-epistemic-engineering
|
|
6
|
+
Project-URL: Documentation, https://applied-epistemic-engineering.readthedocs.io
|
|
7
|
+
Project-URL: Repository, https://github.com/electrohire/applied-epistemic-engineering
|
|
8
|
+
Project-URL: Changelog, https://github.com/electrohire/applied-epistemic-engineering/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Issues, https://github.com/electrohire/applied-epistemic-engineering/issues
|
|
10
|
+
Author: ElectroHire Inc.
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: aee,ai-governance,applied-epistemic-engineering,evidence,provenance,spec-driven-development,uncertainty
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
27
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
31
|
+
Provides-Extra: docs
|
|
32
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
33
|
+
Requires-Dist: mkdocs>=1.6; extra == 'docs'
|
|
34
|
+
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'docs'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# Applied Epistemic Engineering for Python
|
|
38
|
+
|
|
39
|
+
[](https://github.com/electrohire/applied-epistemic-engineering/actions/workflows/ci.yml)
|
|
40
|
+
[](https://applied-epistemic-engineering.readthedocs.io)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
|
|
43
|
+
An evidence-centered Python toolkit for turning important claims into inspectable engineering
|
|
44
|
+
artifacts. It makes boundaries, evidence, provenance, uncertainty, contradictions,
|
|
45
|
+
falsification tests, recovery work, and decision history explicit.
|
|
46
|
+
|
|
47
|
+
This is an original, ground-up ElectroHire implementation. It carries forward the useful AEE
|
|
48
|
+
concepts previously embedded in SpecSmith while removing SpecSmith runtime coupling and aligning
|
|
49
|
+
the result model directly with ElectroHire's Spec Kit Evaluator Contract.
|
|
50
|
+
|
|
51
|
+
## Why it exists
|
|
52
|
+
|
|
53
|
+
Ordinary validation asks whether an artifact is formatted correctly. AEE asks harder questions:
|
|
54
|
+
|
|
55
|
+
- What exactly is being claimed?
|
|
56
|
+
- Under what conditions does it hold?
|
|
57
|
+
- What was observed, inferred, or merely asserted?
|
|
58
|
+
- What evidence would prove the claim wrong?
|
|
59
|
+
- Which claims depend on uncertain foundations?
|
|
60
|
+
- What contradicts the current conclusion?
|
|
61
|
+
- What bounded work would improve the decision?
|
|
62
|
+
|
|
63
|
+
The library does not call a confidence number “truth.” Every score is a transparent decision aid
|
|
64
|
+
derived from recorded evidence and explicit rules.
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install applied-epistemic-engineering
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For development:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install -e ".[dev,docs]"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Five-minute example
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from aee import (
|
|
82
|
+
AEESession,
|
|
83
|
+
ClaimKind,
|
|
84
|
+
ClaimStatus,
|
|
85
|
+
Evidence,
|
|
86
|
+
EvidenceKind,
|
|
87
|
+
SourceQuality,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
session = AEESession(
|
|
91
|
+
"checkout-service",
|
|
92
|
+
phase="after_plan",
|
|
93
|
+
ledger_file=".aee/epistemic-ledger.jsonl",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
claim = session.add_claim(
|
|
97
|
+
"REQ-PERF-001",
|
|
98
|
+
"Checkout p95 latency remains below 300 ms",
|
|
99
|
+
kind=ClaimKind.REQUIREMENT,
|
|
100
|
+
boundary=["production", "nominal load", "30-minute observation window"],
|
|
101
|
+
source_ref="spec.md#REQ-PERF-001",
|
|
102
|
+
)
|
|
103
|
+
claim.status = ClaimStatus.SUPPORTED
|
|
104
|
+
claim.falsification_tests.append("Observe p95 latency at or above 300 ms")
|
|
105
|
+
|
|
106
|
+
session.add_evidence(
|
|
107
|
+
claim.id,
|
|
108
|
+
Evidence(
|
|
109
|
+
ref="reports/load-test-2026-09-04.json",
|
|
110
|
+
kind=EvidenceKind.OBSERVED,
|
|
111
|
+
source_quality=SourceQuality.TEST,
|
|
112
|
+
source_id="load-test-2026-09-04",
|
|
113
|
+
description="Observed p95 latency was 241 ms",
|
|
114
|
+
),
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
assessment = session.assess()
|
|
118
|
+
print(assessment.outcome, assessment.summary)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## CLI
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
aee assess --input claims.json --phase after_plan --output assessment.json \
|
|
125
|
+
--evaluator-output evaluator-result.json --ledger .aee/epistemic-ledger.jsonl
|
|
126
|
+
|
|
127
|
+
aee verify-ledger --ledger .aee/epistemic-ledger.jsonl
|
|
128
|
+
aee graph --input claims.json --output claim-graph.mmd
|
|
129
|
+
aee gate --input assessment.json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Exit codes are CI-friendly: `0` for pass/warn, `1` for iteration/clarification/evidence
|
|
133
|
+
collection, and `2` for a hard block or invalid ledger.
|
|
134
|
+
|
|
135
|
+
## Architecture
|
|
136
|
+
|
|
137
|
+
| Layer | Responsibility |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `aee` Python package | Claims, evidence, scoring, challenge, recovery, graph, ledger |
|
|
140
|
+
| [`spec-kit-aee`](https://github.com/electrohire/spec-kit-aee) | Spec Kit commands, hooks, and artifact discovery |
|
|
141
|
+
| [`spec-kit-evaluator`](https://github.com/electrohire/spec-kit-evaluator) | Shared result envelope, composition, reports, and model routing |
|
|
142
|
+
|
|
143
|
+
## Core principles
|
|
144
|
+
|
|
145
|
+
1. Assertions never become observations because a model repeats them.
|
|
146
|
+
2. Counterevidence and contradictions remain visible.
|
|
147
|
+
3. Unsupported claims remain explicitly unsupported.
|
|
148
|
+
4. Confidence propagates through dependencies by the weakest-link rule.
|
|
149
|
+
5. Every failure produces a bounded recovery proposal with a verification condition.
|
|
150
|
+
6. Deterministic checks run before probabilistic review.
|
|
151
|
+
7. Hash chains establish tamper evidence—not truth, identity, or trusted time.
|
|
152
|
+
|
|
153
|
+
## Documentation
|
|
154
|
+
|
|
155
|
+
Full documentation is configured for Read the Docs at
|
|
156
|
+
[applied-epistemic-engineering.readthedocs.io](https://applied-epistemic-engineering.readthedocs.io).
|
|
157
|
+
Existing SpecSmith AEE users can follow the [migration guide](docs/migration.md).
|
|
158
|
+
|
|
159
|
+
## Ownership and license
|
|
160
|
+
|
|
161
|
+
Designed and implemented by **ElectroHire Inc.** Copyright © 2026 ElectroHire Inc.
|
|
162
|
+
Released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Applied Epistemic Engineering for Python
|
|
2
|
+
|
|
3
|
+
[](https://github.com/electrohire/applied-epistemic-engineering/actions/workflows/ci.yml)
|
|
4
|
+
[](https://applied-epistemic-engineering.readthedocs.io)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
An evidence-centered Python toolkit for turning important claims into inspectable engineering
|
|
8
|
+
artifacts. It makes boundaries, evidence, provenance, uncertainty, contradictions,
|
|
9
|
+
falsification tests, recovery work, and decision history explicit.
|
|
10
|
+
|
|
11
|
+
This is an original, ground-up ElectroHire implementation. It carries forward the useful AEE
|
|
12
|
+
concepts previously embedded in SpecSmith while removing SpecSmith runtime coupling and aligning
|
|
13
|
+
the result model directly with ElectroHire's Spec Kit Evaluator Contract.
|
|
14
|
+
|
|
15
|
+
## Why it exists
|
|
16
|
+
|
|
17
|
+
Ordinary validation asks whether an artifact is formatted correctly. AEE asks harder questions:
|
|
18
|
+
|
|
19
|
+
- What exactly is being claimed?
|
|
20
|
+
- Under what conditions does it hold?
|
|
21
|
+
- What was observed, inferred, or merely asserted?
|
|
22
|
+
- What evidence would prove the claim wrong?
|
|
23
|
+
- Which claims depend on uncertain foundations?
|
|
24
|
+
- What contradicts the current conclusion?
|
|
25
|
+
- What bounded work would improve the decision?
|
|
26
|
+
|
|
27
|
+
The library does not call a confidence number “truth.” Every score is a transparent decision aid
|
|
28
|
+
derived from recorded evidence and explicit rules.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install applied-epistemic-engineering
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For development:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install -e ".[dev,docs]"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Five-minute example
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from aee import (
|
|
46
|
+
AEESession,
|
|
47
|
+
ClaimKind,
|
|
48
|
+
ClaimStatus,
|
|
49
|
+
Evidence,
|
|
50
|
+
EvidenceKind,
|
|
51
|
+
SourceQuality,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
session = AEESession(
|
|
55
|
+
"checkout-service",
|
|
56
|
+
phase="after_plan",
|
|
57
|
+
ledger_file=".aee/epistemic-ledger.jsonl",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
claim = session.add_claim(
|
|
61
|
+
"REQ-PERF-001",
|
|
62
|
+
"Checkout p95 latency remains below 300 ms",
|
|
63
|
+
kind=ClaimKind.REQUIREMENT,
|
|
64
|
+
boundary=["production", "nominal load", "30-minute observation window"],
|
|
65
|
+
source_ref="spec.md#REQ-PERF-001",
|
|
66
|
+
)
|
|
67
|
+
claim.status = ClaimStatus.SUPPORTED
|
|
68
|
+
claim.falsification_tests.append("Observe p95 latency at or above 300 ms")
|
|
69
|
+
|
|
70
|
+
session.add_evidence(
|
|
71
|
+
claim.id,
|
|
72
|
+
Evidence(
|
|
73
|
+
ref="reports/load-test-2026-09-04.json",
|
|
74
|
+
kind=EvidenceKind.OBSERVED,
|
|
75
|
+
source_quality=SourceQuality.TEST,
|
|
76
|
+
source_id="load-test-2026-09-04",
|
|
77
|
+
description="Observed p95 latency was 241 ms",
|
|
78
|
+
),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
assessment = session.assess()
|
|
82
|
+
print(assessment.outcome, assessment.summary)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## CLI
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
aee assess --input claims.json --phase after_plan --output assessment.json \
|
|
89
|
+
--evaluator-output evaluator-result.json --ledger .aee/epistemic-ledger.jsonl
|
|
90
|
+
|
|
91
|
+
aee verify-ledger --ledger .aee/epistemic-ledger.jsonl
|
|
92
|
+
aee graph --input claims.json --output claim-graph.mmd
|
|
93
|
+
aee gate --input assessment.json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Exit codes are CI-friendly: `0` for pass/warn, `1` for iteration/clarification/evidence
|
|
97
|
+
collection, and `2` for a hard block or invalid ledger.
|
|
98
|
+
|
|
99
|
+
## Architecture
|
|
100
|
+
|
|
101
|
+
| Layer | Responsibility |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `aee` Python package | Claims, evidence, scoring, challenge, recovery, graph, ledger |
|
|
104
|
+
| [`spec-kit-aee`](https://github.com/electrohire/spec-kit-aee) | Spec Kit commands, hooks, and artifact discovery |
|
|
105
|
+
| [`spec-kit-evaluator`](https://github.com/electrohire/spec-kit-evaluator) | Shared result envelope, composition, reports, and model routing |
|
|
106
|
+
|
|
107
|
+
## Core principles
|
|
108
|
+
|
|
109
|
+
1. Assertions never become observations because a model repeats them.
|
|
110
|
+
2. Counterevidence and contradictions remain visible.
|
|
111
|
+
3. Unsupported claims remain explicitly unsupported.
|
|
112
|
+
4. Confidence propagates through dependencies by the weakest-link rule.
|
|
113
|
+
5. Every failure produces a bounded recovery proposal with a verification condition.
|
|
114
|
+
6. Deterministic checks run before probabilistic review.
|
|
115
|
+
7. Hash chains establish tamper evidence—not truth, identity, or trusted time.
|
|
116
|
+
|
|
117
|
+
## Documentation
|
|
118
|
+
|
|
119
|
+
Full documentation is configured for Read the Docs at
|
|
120
|
+
[applied-epistemic-engineering.readthedocs.io](https://applied-epistemic-engineering.readthedocs.io).
|
|
121
|
+
Existing SpecSmith AEE users can follow the [migration guide](docs/migration.md).
|
|
122
|
+
|
|
123
|
+
## Ownership and license
|
|
124
|
+
|
|
125
|
+
Designed and implemented by **ElectroHire Inc.** Copyright © 2026 ElectroHire Inc.
|
|
126
|
+
Released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Python API
|
|
2
|
+
|
|
3
|
+
## Session
|
|
4
|
+
|
|
5
|
+
::: aee.session.AEESession
|
|
6
|
+
|
|
7
|
+
## Engine
|
|
8
|
+
|
|
9
|
+
::: aee.engine.AEEEngine
|
|
10
|
+
|
|
11
|
+
::: aee.engine.Assessment
|
|
12
|
+
|
|
13
|
+
## Model
|
|
14
|
+
|
|
15
|
+
::: aee.model.Claim
|
|
16
|
+
|
|
17
|
+
::: aee.model.Evidence
|
|
18
|
+
|
|
19
|
+
::: aee.model.FailureMode
|
|
20
|
+
|
|
21
|
+
## Analysis
|
|
22
|
+
|
|
23
|
+
::: aee.challenge.StressTester
|
|
24
|
+
|
|
25
|
+
::: aee.scoring.ScoringEngine
|
|
26
|
+
|
|
27
|
+
::: aee.graph.ClaimGraph
|
|
28
|
+
|
|
29
|
+
::: aee.recovery.RecoveryOperator
|
|
30
|
+
|
|
31
|
+
## Ledger and adapter
|
|
32
|
+
|
|
33
|
+
::: aee.ledger.HashChainLedger
|
|
34
|
+
|
|
35
|
+
::: aee.adapters.evaluator.EvaluatorAdapter
|
|
36
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Foundations
|
|
2
|
+
|
|
3
|
+
AEE follows four operational stages:
|
|
4
|
+
|
|
5
|
+
1. **Frame** — identify the decision, claim boundaries, actors, and risk.
|
|
6
|
+
2. **Disassemble** — split conclusions into atomic claims and dependencies.
|
|
7
|
+
3. **Stress-test** — seek ambiguity, hidden assumptions, counterexamples, contradictions,
|
|
8
|
+
missing evidence, circular inference, and unfalsifiable claims.
|
|
9
|
+
4. **Reconstruct** — narrow, clarify, gather evidence, resolve contradictions, or supersede.
|
|
10
|
+
|
|
11
|
+
## Claim model
|
|
12
|
+
|
|
13
|
+
A claim separates:
|
|
14
|
+
|
|
15
|
+
- its proposition from its source;
|
|
16
|
+
- its applicable boundary from universal language;
|
|
17
|
+
- observed evidence from inference and assertion;
|
|
18
|
+
- supporting evidence from counterevidence;
|
|
19
|
+
- direct confidence from dependency-propagated confidence; and
|
|
20
|
+
- current status from historical ledger events.
|
|
21
|
+
|
|
22
|
+
## Epistemic invariants
|
|
23
|
+
|
|
24
|
+
- A model's statement about its own work is `asserted`, not `observed`.
|
|
25
|
+
- A supported claim requires inspectable evidence.
|
|
26
|
+
- Contradictions are records to resolve, not noise to average away.
|
|
27
|
+
- An accepted claim needs a falsification condition.
|
|
28
|
+
- A dependent claim cannot be more certain than its weakest required premise.
|
|
29
|
+
- The absence of evidence is represented as insufficient evidence, not a fabricated answer.
|
|
30
|
+
|
|
31
|
+
## Deterministic and probabilistic work
|
|
32
|
+
|
|
33
|
+
The Python engine performs transparent deterministic checks. A model-backed reviewer may enrich
|
|
34
|
+
claims, propose alternatives, or locate counterevidence, but its output enters the same model and
|
|
35
|
+
remains labeled according to how it was obtained.
|
|
36
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Applied Epistemic Engineering
|
|
2
|
+
|
|
3
|
+
Applied Epistemic Engineering (AEE) treats consequential claims as engineering artifacts:
|
|
4
|
+
identifiable, bounded, challengeable, evidence-linked, recoverable, and auditable.
|
|
5
|
+
|
|
6
|
+
The ElectroHire Python package provides:
|
|
7
|
+
|
|
8
|
+
- a typed claim and evidence model;
|
|
9
|
+
- deterministic stress tests;
|
|
10
|
+
- explicit contradictions and dependency graphs;
|
|
11
|
+
- transparent evidence-quality scoring;
|
|
12
|
+
- bounded recovery proposals;
|
|
13
|
+
- a tamper-evident decision ledger; and
|
|
14
|
+
- native conversion to the Spec Kit Evaluator Contract.
|
|
15
|
+
|
|
16
|
+
!!! important
|
|
17
|
+
AEE does not certify truth, compliance, safety, or correctness. It records what is known,
|
|
18
|
+
why it is believed, what remains uncertain, and what evidence would change the decision.
|
|
19
|
+
|
|
20
|
+
Start with the [quickstart](quickstart.md), then read the [foundations](concepts.md).
|
|
21
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Tamper-evident ledger
|
|
2
|
+
|
|
3
|
+
`HashChainLedger` writes canonical JSON Lines. Each entry includes the hash of the previous entry
|
|
4
|
+
and its own canonical SHA-256 digest.
|
|
5
|
+
|
|
6
|
+
```python
|
|
7
|
+
from aee import HashChainLedger
|
|
8
|
+
|
|
9
|
+
ledger = HashChainLedger(".aee/epistemic-ledger.jsonl")
|
|
10
|
+
ledger.append("decision", {"claim_id": "DEC-001", "choice": "Option A"})
|
|
11
|
+
assert ledger.verify().valid
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The chain detects modification, reordering, insertion, and deletion from the middle of the local
|
|
15
|
+
history. It does **not** independently prove:
|
|
16
|
+
|
|
17
|
+
- who wrote an entry;
|
|
18
|
+
- when the event occurred;
|
|
19
|
+
- that the payload is true; or
|
|
20
|
+
- that the ledger head was not replaced wholesale.
|
|
21
|
+
|
|
22
|
+
For stronger guarantees, anchor head hashes externally and add actor signatures, trusted
|
|
23
|
+
timestamps, protected storage, and independent evidence retention.
|
|
24
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Migrating from SpecSmith AEE
|
|
2
|
+
|
|
3
|
+
This package is a ground-up ElectroHire implementation, not a drop-in copy of SpecSmith's
|
|
4
|
+
`epistemic` package. The concepts remain recognizable, while the types, serialization format,
|
|
5
|
+
scoring model, CLI, and Spec Kit boundary are intentionally explicit and independently versioned.
|
|
6
|
+
|
|
7
|
+
## Concept mapping
|
|
8
|
+
|
|
9
|
+
| SpecSmith concept | ElectroHire AEE equivalent | Important change |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| Belief/claim | `aee.Claim` | Stable IDs, sources, boundaries, dependencies, conflicts, and falsifiers are first-class |
|
|
12
|
+
| Evidence refs | `aee.Evidence` | Kind, direction, source quality, independence, observation time, and content hash are separate |
|
|
13
|
+
| Stress tester | `aee.StressTester` | Checks are deterministic and every breakpoint has a stable failure ID |
|
|
14
|
+
| Failure graph | `aee.ClaimGraph` | Missing dependencies, cycles, conflicts, order, and Mermaid rendering share one graph |
|
|
15
|
+
| Certainty engine | `aee.ScoringEngine` | Published weights replace opaque confidence; dependencies use weakest-link propagation |
|
|
16
|
+
| Recovery operator | `aee.RecoveryOperator` | Every recovery includes a verification condition and deterministic priority |
|
|
17
|
+
| AEE session | `aee.AEESession` | Library-first orchestration with an optional append-only ledger |
|
|
18
|
+
| Trace vault | `aee.HashChainLedger` | Canonical JSONL SHA-256 chain establishes continuity, not truth or identity |
|
|
19
|
+
| Result | `aee.Assessment` | Rich output converts to Evaluator Contract 1.0 through `EvaluatorAdapter` |
|
|
20
|
+
|
|
21
|
+
## Minimal migration
|
|
22
|
+
|
|
23
|
+
Instead of importing `epistemic`, install the new distribution and import `aee`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install applied-epistemic-engineering
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from aee import AEESession, ClaimKind
|
|
31
|
+
|
|
32
|
+
session = AEESession("my-system", phase="after_plan")
|
|
33
|
+
session.add_claim(
|
|
34
|
+
"ASM-IDENTITY-001",
|
|
35
|
+
"The upstream identity is verified",
|
|
36
|
+
kind=ClaimKind.ASSUMPTION,
|
|
37
|
+
boundary=["production OAuth callback"],
|
|
38
|
+
source_ref="plan.md#ASM-IDENTITY-001",
|
|
39
|
+
)
|
|
40
|
+
assessment = session.assess()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The initial outcome remains evidence-seeking until independently inspectable evidence and a
|
|
44
|
+
falsification test are attached. That is deliberate.
|
|
45
|
+
|
|
46
|
+
## Deliberate exclusions
|
|
47
|
+
|
|
48
|
+
- No SpecSmith runtime dependency or private backend coupling.
|
|
49
|
+
- No ChronoMemory code or commercial storage integration.
|
|
50
|
+
- No model-generated confidence masquerading as observed evidence.
|
|
51
|
+
- No compatibility aliases that obscure which implementation produced a record.
|
|
52
|
+
|
|
53
|
+
For Spec Kit projects, install `spec-kit-evaluator` and `spec-kit-aee`; keep domain logic in this
|
|
54
|
+
package and lifecycle orchestration in the extension.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
python -m pip install applied-epistemic-engineering
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Assess structured claims
|
|
10
|
+
|
|
11
|
+
Create `claims.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"claims": [
|
|
16
|
+
{
|
|
17
|
+
"id": "REQ-API-001",
|
|
18
|
+
"text": "The API returns within 100 ms",
|
|
19
|
+
"kind": "requirement",
|
|
20
|
+
"status": "supported",
|
|
21
|
+
"boundary": ["p95", "nominal load", "production"],
|
|
22
|
+
"falsification_tests": ["Observe p95 at or above 100 ms"],
|
|
23
|
+
"uncertainty": "low",
|
|
24
|
+
"evidence": [
|
|
25
|
+
{
|
|
26
|
+
"ref": "reports/load-test.json",
|
|
27
|
+
"kind": "observed",
|
|
28
|
+
"direction": "supports",
|
|
29
|
+
"source_quality": "test",
|
|
30
|
+
"source_id": "load-test-001"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Run the assessment:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
aee assess \
|
|
42
|
+
--input claims.json \
|
|
43
|
+
--phase after_plan \
|
|
44
|
+
--output assessment.json \
|
|
45
|
+
--evaluator-output evaluator-result.json \
|
|
46
|
+
--ledger .aee/epistemic-ledger.jsonl
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The assessment retains the rich AEE model. `evaluator-result.json` conforms to the shared
|
|
50
|
+
Evaluator Contract used by Spec Kit.
|
|
51
|
+
|
|
52
|
+
## Extract identified claims from Markdown
|
|
53
|
+
|
|
54
|
+
The parser intentionally extracts only claims with stable identifiers:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## REQ-API-001 — The API returns within 100 ms
|
|
58
|
+
- **Boundary:** p95 under nominal production load
|
|
59
|
+
- **Test:** Observe p95 at or above 100 ms
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
aee assess --input spec.md --phase after_specify
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Unidentified prose is not silently promoted into claims.
|
|
67
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Transparent scoring
|
|
2
|
+
|
|
3
|
+
The default direct confidence score is:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
0.55 × evidence quality
|
|
7
|
+
+ 0.20 × source independence
|
|
8
|
+
+ 0.15 × falsifiability
|
|
9
|
+
+ 0.10 × explicit boundary
|
|
10
|
+
- contradiction penalty
|
|
11
|
+
- freshness penalty
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Evidence quality combines evidence kind and source quality. Multiple supporting sources use a
|
|
15
|
+
bounded cumulative calculation; repeated weak assertions cannot inflate confidence without limit.
|
|
16
|
+
|
|
17
|
+
After direct scoring, required dependencies apply the weakest-link rule:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
propagated(claim) = min(direct(claim), propagated(each required dependency))
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Scores communicate the state of the recorded evidence. They do not measure metaphysical truth,
|
|
24
|
+
legal sufficiency, or safety certification.
|
|
25
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Security and trust boundaries
|
|
2
|
+
|
|
3
|
+
## Data handling
|
|
4
|
+
|
|
5
|
+
The core library is offline and has no network dependencies. It only reads files explicitly
|
|
6
|
+
provided by the caller and writes to explicitly configured output paths.
|
|
7
|
+
|
|
8
|
+
Do not place secrets, export-controlled material, personal data, or privileged evidence in a
|
|
9
|
+
public repository. AEE records may reveal architecture, risks, and unresolved weaknesses.
|
|
10
|
+
|
|
11
|
+
## Model-backed enrichment
|
|
12
|
+
|
|
13
|
+
The core library does not contact a model. Host applications that add model-backed review must:
|
|
14
|
+
|
|
15
|
+
- classify model output as asserted or inferred;
|
|
16
|
+
- avoid sending protected data to an unauthorized provider;
|
|
17
|
+
- retain the model and policy identity in metadata;
|
|
18
|
+
- require independent evidence for high-impact gates; and
|
|
19
|
+
- preserve counterevidence and human overrides.
|
|
20
|
+
|
|
21
|
+
## Cryptographic scope
|
|
22
|
+
|
|
23
|
+
SHA-256 chaining detects local history mutation. It is not a digital signature, trusted timestamp,
|
|
24
|
+
identity proof, or truth oracle. See the [ledger guide](ledger.md).
|
|
25
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Spec Kit integration
|
|
2
|
+
|
|
3
|
+
The Python package owns epistemic analysis. The
|
|
4
|
+
[`spec-kit-aee`](https://github.com/electrohire/spec-kit-aee) extension owns Spec Kit artifact
|
|
5
|
+
discovery, lifecycle hooks, and command UX. The
|
|
6
|
+
[`spec-kit-evaluator`](https://github.com/electrohire/spec-kit-evaluator) extension owns the shared
|
|
7
|
+
result envelope, composition, reports, and routing.
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TD
|
|
11
|
+
SK["Spec Kit artifacts"] --> AEE["spec-kit-aee"]
|
|
12
|
+
AEE --> PY["AEE Python engine"]
|
|
13
|
+
PY --> ER["Evaluator result"]
|
|
14
|
+
ER --> EC["Compose, report, route"]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
An AEE assessment is converted with `EvaluatorAdapter`. Rich claim and score data are preserved
|
|
18
|
+
inside the evaluator contract's opaque `state.aee` field, while actionable failures become normal
|
|
19
|
+
Evaluator Contract findings.
|
|
20
|
+
|
|
21
|
+
This keeps AEE opinionated and independently versioned without forking or weakening the neutral
|
|
22
|
+
Evaluator Contract.
|
|
23
|
+
|