eif-engine 4.1.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.
Files changed (202) hide show
  1. eif_engine-4.1.0/.dockerignore +16 -0
  2. eif_engine-4.1.0/.env.example +10 -0
  3. eif_engine-4.1.0/.github/CODEOWNERS +1 -0
  4. eif_engine-4.1.0/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  5. eif_engine-4.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  6. eif_engine-4.1.0/.github/dependabot.yml +10 -0
  7. eif_engine-4.1.0/.github/pull_request_template.md +14 -0
  8. eif_engine-4.1.0/.github/workflows/ci.yml +89 -0
  9. eif_engine-4.1.0/.gitignore +26 -0
  10. eif_engine-4.1.0/.pre-commit-config.yaml +9 -0
  11. eif_engine-4.1.0/.trustlint.yaml +14 -0
  12. eif_engine-4.1.0/CHANGELOG.md +100 -0
  13. eif_engine-4.1.0/CODE_OF_CONDUCT.md +72 -0
  14. eif_engine-4.1.0/CONTRIBUTING.md +81 -0
  15. eif_engine-4.1.0/DATA_PROCESSING_AGREEMENT.md +149 -0
  16. eif_engine-4.1.0/DECISIONS.md +259 -0
  17. eif_engine-4.1.0/Dockerfile +30 -0
  18. eif_engine-4.1.0/LEGAL.md +312 -0
  19. eif_engine-4.1.0/LICENSE +21 -0
  20. eif_engine-4.1.0/NOTICE +17 -0
  21. eif_engine-4.1.0/PKG-INFO +607 -0
  22. eif_engine-4.1.0/PRIVACY_POLICY.md +110 -0
  23. eif_engine-4.1.0/README.md +555 -0
  24. eif_engine-4.1.0/SECURITY.md +71 -0
  25. eif_engine-4.1.0/TERMS_OF_SERVICE.md +185 -0
  26. eif_engine-4.1.0/deploy/do_app_spec.yaml +67 -0
  27. eif_engine-4.1.0/docs/architecture.md +226 -0
  28. eif_engine-4.1.0/docs/compliance.md +113 -0
  29. eif_engine-4.1.0/docs/eif_causal_gate_v4_tech_spec.md +285 -0
  30. eif_engine-4.1.0/docs/eif_s17_s18_s19_tech_spec.md +249 -0
  31. eif_engine-4.1.0/docs/eif_v2_tech_spec.md +332 -0
  32. eif_engine-4.1.0/docs/integrations/COMPLYEDGE.md +99 -0
  33. eif_engine-4.1.0/docs/research_foundation.md +232 -0
  34. eif_engine-4.1.0/eif/__init__.py +23 -0
  35. eif_engine-4.1.0/eif/auto.py +199 -0
  36. eif_engine-4.1.0/eif/calibrate/__init__.py +15 -0
  37. eif_engine-4.1.0/eif/calibrate/bayesian.py +53 -0
  38. eif_engine-4.1.0/eif/calibrate/conformal.py +57 -0
  39. eif_engine-4.1.0/eif/calibrate/domain_constraints.py +169 -0
  40. eif_engine-4.1.0/eif/calibrate/ece.py +154 -0
  41. eif_engine-4.1.0/eif/calibrate/prior_strategy.py +38 -0
  42. eif_engine-4.1.0/eif/calibrate/trust.py +120 -0
  43. eif_engine-4.1.0/eif/causal_gate/__init__.py +31 -0
  44. eif_engine-4.1.0/eif/causal_gate/confound.py +196 -0
  45. eif_engine-4.1.0/eif/causal_gate/direction.py +28 -0
  46. eif_engine-4.1.0/eif/causal_gate/eif_causal_gate_v4_intent.yaml +265 -0
  47. eif_engine-4.1.0/eif/causal_gate/evidence_probe.py +280 -0
  48. eif_engine-4.1.0/eif/causal_gate/intervention.py +55 -0
  49. eif_engine-4.1.0/eif/causal_gate/iris_pipeline.py +334 -0
  50. eif_engine-4.1.0/eif/causal_gate/verdict.py +47 -0
  51. eif_engine-4.1.0/eif/challenge/__init__.py +17 -0
  52. eif_engine-4.1.0/eif/challenge/diversity.py +58 -0
  53. eif_engine-4.1.0/eif/challenge/eif_multi_critic_intent.yaml +198 -0
  54. eif_engine-4.1.0/eif/challenge/multi_critic.py +270 -0
  55. eif_engine-4.1.0/eif/challenge/protocol.py +86 -0
  56. eif_engine-4.1.0/eif/challenge/replicator.py +379 -0
  57. eif_engine-4.1.0/eif/cost_model/__init__.py +5 -0
  58. eif_engine-4.1.0/eif/cost_model/catch_rate_empirical.py +275 -0
  59. eif_engine-4.1.0/eif/cost_model/cost_ledger.py +107 -0
  60. eif_engine-4.1.0/eif/cost_model/eif_catchrate_intent.yaml +86 -0
  61. eif_engine-4.1.0/eif/declare/__init__.py +6 -0
  62. eif_engine-4.1.0/eif/declare/extractor.py +308 -0
  63. eif_engine-4.1.0/eif/declare/harking_guard.py +110 -0
  64. eif_engine-4.1.0/eif/declare/registry.py +146 -0
  65. eif_engine-4.1.0/eif/eif_engine_intent.yaml +296 -0
  66. eif_engine-4.1.0/eif/eif_v2_intent.yaml +779 -0
  67. eif_engine-4.1.0/eif/eif_v3_intent.yaml +360 -0
  68. eif_engine-4.1.0/eif/explain/__init__.py +7 -0
  69. eif_engine-4.1.0/eif/explain/artifact.py +78 -0
  70. eif_engine-4.1.0/eif/explain/eif_explain_coldstart_intent.yaml +216 -0
  71. eif_engine-4.1.0/eif/explain/hard_to_vary.py +168 -0
  72. eif_engine-4.1.0/eif/explain/reach.py +32 -0
  73. eif_engine-4.1.0/eif/falsify/__init__.py +7 -0
  74. eif_engine-4.1.0/eif/falsify/condition.py +58 -0
  75. eif_engine-4.1.0/eif/falsify/eif_evidence_collection_intent.yaml +310 -0
  76. eif_engine-4.1.0/eif/falsify/eif_native_tools_intent.yaml +128 -0
  77. eif_engine-4.1.0/eif/falsify/eif_v5_evidence_trust_weighting_intent.yaml +273 -0
  78. eif_engine-4.1.0/eif/falsify/evidence_collector.py +1304 -0
  79. eif_engine-4.1.0/eif/falsify/hard_to_vary.py +171 -0
  80. eif_engine-4.1.0/eif/falsify/native_tools.py +221 -0
  81. eif_engine-4.1.0/eif/falsify/sprt.py +84 -0
  82. eif_engine-4.1.0/eif/falsify/trivial_check.py +46 -0
  83. eif_engine-4.1.0/eif/hypothesis_agenda/__init__.py +27 -0
  84. eif_engine-4.1.0/eif/hypothesis_agenda/agenda.py +176 -0
  85. eif_engine-4.1.0/eif/hypothesis_agenda/eif_hypothesis_agenda_intent.yaml +168 -0
  86. eif_engine-4.1.0/eif/hypothesis_agenda/fdr.py +92 -0
  87. eif_engine-4.1.0/eif/hypothesis_agenda/scorer.py +132 -0
  88. eif_engine-4.1.0/eif/input_guard/__init__.py +13 -0
  89. eif_engine-4.1.0/eif/input_guard/detector.py +259 -0
  90. eif_engine-4.1.0/eif/input_guard/eif_input_guard_intent.yaml +181 -0
  91. eif_engine-4.1.0/eif/integration/__init__.py +34 -0
  92. eif_engine-4.1.0/eif/integration/eif_auto.py +228 -0
  93. eif_engine-4.1.0/eif/integration/interceptor.py +218 -0
  94. eif_engine-4.1.0/eif/mcp_server/__init__.py +1 -0
  95. eif_engine-4.1.0/eif/mcp_server/auth.py +81 -0
  96. eif_engine-4.1.0/eif/mcp_server/http_server.py +460 -0
  97. eif_engine-4.1.0/eif/mcp_server/resources.py +113 -0
  98. eif_engine-4.1.0/eif/mcp_server/server.py +3485 -0
  99. eif_engine-4.1.0/eif/memory/__init__.py +5 -0
  100. eif_engine-4.1.0/eif/memory/strategy.py +246 -0
  101. eif_engine-4.1.0/eif/programme/__init__.py +7 -0
  102. eif_engine-4.1.0/eif/programme/monitor.py +58 -0
  103. eif_engine-4.1.0/eif/programme/principle_memory.py +177 -0
  104. eif_engine-4.1.0/eif/programme/principle_revision.py +412 -0
  105. eif_engine-4.1.0/eif/programme/signals.py +131 -0
  106. eif_engine-4.1.0/eif/programme/status.py +56 -0
  107. eif_engine-4.1.0/eif/py.typed +0 -0
  108. eif_engine-4.1.0/eif/record/__init__.py +7 -0
  109. eif_engine-4.1.0/eif/record/chain.py +33 -0
  110. eif_engine-4.1.0/eif/record/compliance.py +62 -0
  111. eif_engine-4.1.0/eif/record/isc_disclosure.py +257 -0
  112. eif_engine-4.1.0/eif/record/outcome_store.py +177 -0
  113. eif_engine-4.1.0/eif/record/provenance.py +148 -0
  114. eif_engine-4.1.0/eif/record/research_object.py +412 -0
  115. eif_engine-4.1.0/eif/replicate/__init__.py +6 -0
  116. eif_engine-4.1.0/eif/replicate/divergence.py +51 -0
  117. eif_engine-4.1.0/eif/replicate/eif_independent_replication_intent.yaml +109 -0
  118. eif_engine-4.1.0/eif/replicate/independent.py +185 -0
  119. eif_engine-4.1.0/eif/replicate/protocol.py +68 -0
  120. eif_engine-4.1.0/eif/reporting/__init__.py +1 -0
  121. eif_engine-4.1.0/eif/reporting/pdf_renderer.py +169 -0
  122. eif_engine-4.1.0/eif/schemas.py +787 -0
  123. eif_engine-4.1.0/eif/sdk/__init__.py +36 -0
  124. eif_engine-4.1.0/eif/sdk/exceptions.py +87 -0
  125. eif_engine-4.1.0/eif/sdk/interceptor.py +316 -0
  126. eif_engine-4.1.0/eif/session.py +40 -0
  127. eif_engine-4.1.0/eif/sycophancy/__init__.py +24 -0
  128. eif_engine-4.1.0/eif/sycophancy/cost_model.py +215 -0
  129. eif_engine-4.1.0/eif/sycophancy/detector.py +270 -0
  130. eif_engine-4.1.0/eif/sycophancy/drift.py +306 -0
  131. eif_engine-4.1.0/eif/sycophancy/eif_sycophancy_intent.yaml +309 -0
  132. eif_engine-4.1.0/eif/sycophancy/faithfulness.py +106 -0
  133. eif_engine-4.1.0/eif/sycophancy/framing.py +191 -0
  134. eif_engine-4.1.0/eif/update/__init__.py +14 -0
  135. eif_engine-4.1.0/eif/update/eig.py +29 -0
  136. eif_engine-4.1.0/eif/update/paradigm.py +121 -0
  137. eif_engine-4.1.0/eif/update/posterior.py +21 -0
  138. eif_engine-4.1.0/eif/update/stopping.py +42 -0
  139. eif_engine-4.1.0/examples/quickstart.py +151 -0
  140. eif_engine-4.1.0/index.html +100 -0
  141. eif_engine-4.1.0/pyproject.toml +89 -0
  142. eif_engine-4.1.0/research/README.md +60 -0
  143. eif_engine-4.1.0/research/ai_agents/calibration.md +295 -0
  144. eif_engine-4.1.0/research/ai_agents/causal_reasoning.md +309 -0
  145. eif_engine-4.1.0/research/ai_agents/hypothesis_generation.md +284 -0
  146. eif_engine-4.1.0/research/ai_agents/multi_agent_review.md +313 -0
  147. eif_engine-4.1.0/research/ai_agents/overview.md +205 -0
  148. eif_engine-4.1.0/research/ai_agents/provenance.md +322 -0
  149. eif_engine-4.1.0/research/foundations/ai_and_science.md +252 -0
  150. eif_engine-4.1.0/research/foundations/classical_method.md +176 -0
  151. eif_engine-4.1.0/research/foundations/deutsch_epistemology.md +279 -0
  152. eif_engine-4.1.0/research/foundations/frontier_debates.md +276 -0
  153. eif_engine-4.1.0/research/foundations/philosophy_of_science.md +312 -0
  154. eif_engine-4.1.0/research/foundations/replication_crisis.md +240 -0
  155. eif_engine-4.1.0/research/foundations/statistics.md +266 -0
  156. eif_engine-4.1.0/research/sycophancy_bias_research.md +178 -0
  157. eif_engine-4.1.0/scripts/compliance/check.sh +136 -0
  158. eif_engine-4.1.0/scripts/compliance/runtime_check.sh +70 -0
  159. eif_engine-4.1.0/server.json +70 -0
  160. eif_engine-4.1.0/tests/__init__.py +1 -0
  161. eif_engine-4.1.0/tests/conftest.py +122 -0
  162. eif_engine-4.1.0/tests/integration/__init__.py +0 -0
  163. eif_engine-4.1.0/tests/integration/test_eif_loop.py +219 -0
  164. eif_engine-4.1.0/tests/integration/test_mcp_server.py +720 -0
  165. eif_engine-4.1.0/tests/unit/__init__.py +0 -0
  166. eif_engine-4.1.0/tests/unit/test_calibrate.py +108 -0
  167. eif_engine-4.1.0/tests/unit/test_catch_rate_empirical.py +304 -0
  168. eif_engine-4.1.0/tests/unit/test_causal_gate.py +119 -0
  169. eif_engine-4.1.0/tests/unit/test_dases_adaptive.py +204 -0
  170. eif_engine-4.1.0/tests/unit/test_dases_replicator.py +113 -0
  171. eif_engine-4.1.0/tests/unit/test_declare.py +106 -0
  172. eif_engine-4.1.0/tests/unit/test_deeptrace_live.py +233 -0
  173. eif_engine-4.1.0/tests/unit/test_ece_v2.py +129 -0
  174. eif_engine-4.1.0/tests/unit/test_evidence_trust_weighting.py +227 -0
  175. eif_engine-4.1.0/tests/unit/test_explain.py +119 -0
  176. eif_engine-4.1.0/tests/unit/test_exploratory_confirmatory.py +179 -0
  177. eif_engine-4.1.0/tests/unit/test_falsify.py +85 -0
  178. eif_engine-4.1.0/tests/unit/test_fdr.py +98 -0
  179. eif_engine-4.1.0/tests/unit/test_framing_elephant.py +92 -0
  180. eif_engine-4.1.0/tests/unit/test_hard_to_vary.py +249 -0
  181. eif_engine-4.1.0/tests/unit/test_host_tool_numeric.py +110 -0
  182. eif_engine-4.1.0/tests/unit/test_http_rate_limit.py +40 -0
  183. eif_engine-4.1.0/tests/unit/test_independent_replication.py +198 -0
  184. eif_engine-4.1.0/tests/unit/test_iris_pipeline.py +108 -0
  185. eif_engine-4.1.0/tests/unit/test_isc_disclosure.py +149 -0
  186. eif_engine-4.1.0/tests/unit/test_memory.py +99 -0
  187. eif_engine-4.1.0/tests/unit/test_monica_drift.py +206 -0
  188. eif_engine-4.1.0/tests/unit/test_native_tools_nt3.py +74 -0
  189. eif_engine-4.1.0/tests/unit/test_outcome_store.py +131 -0
  190. eif_engine-4.1.0/tests/unit/test_p1_sandbox_security.py +138 -0
  191. eif_engine-4.1.0/tests/unit/test_paradigm.py +85 -0
  192. eif_engine-4.1.0/tests/unit/test_principle_memory.py +285 -0
  193. eif_engine-4.1.0/tests/unit/test_principle_revision.py +111 -0
  194. eif_engine-4.1.0/tests/unit/test_programme.py +103 -0
  195. eif_engine-4.1.0/tests/unit/test_record.py +149 -0
  196. eif_engine-4.1.0/tests/unit/test_replicate.py +79 -0
  197. eif_engine-4.1.0/tests/unit/test_research_object.py +182 -0
  198. eif_engine-4.1.0/tests/unit/test_schemas.py +105 -0
  199. eif_engine-4.1.0/tests/unit/test_update.py +99 -0
  200. eif_engine-4.1.0/validation/CORPUS_REPORT.md +235 -0
  201. eif_engine-4.1.0/validation/EIF_INVESTMENT_V31_EVIDENCE.md +216 -0
  202. eif_engine-4.1.0/validation/data/.gitkeep +1 -0
@@ -0,0 +1,16 @@
1
+ .git
2
+ .venv
3
+ .pytest_cache
4
+ .ruff_cache
5
+ .trustlint-cache
6
+ __pycache__
7
+ *.pyc
8
+ tests/
9
+ docs/
10
+ research/
11
+ validation/
12
+ examples/
13
+ scripts/
14
+ .github/
15
+ *.md
16
+ !README.md
@@ -0,0 +1,10 @@
1
+ # EIF self-hosted configuration. Copy to .env and fill in. Never commit .env.
2
+
3
+ # Runtime mode: development | production. production enforces auth on the HTTP server.
4
+ EIF_ENV=development
5
+
6
+ # Optional. Single API key for self-hosted HTTP server auth. Leave unset for local dev without auth.
7
+ EIF_API_KEY=
8
+
9
+ # Optional. Enables the LLM critic tournament (CHALLENGE) and the causal evidence probe. The core engine never calls an LLM.
10
+ OPENAI_API_KEY=
@@ -0,0 +1 @@
1
+ * @leocelis
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something broken in EIF (library, MCP server, or pipeline routing)
4
+ title: "[Bug] "
5
+ labels: bug
6
+ ---
7
+
8
+ **Describe the bug:**
9
+ <!-- What happened vs. what you expected -->
10
+
11
+ **Environment:**
12
+ - EIF version: <!-- pip show eif-engine -->
13
+ - Python: <!-- python --version -->
14
+ - Transport: <!-- stdio (eif-mcp-server) / http (eif-mcp-http-server) / library only -->
15
+
16
+ **To reproduce:**
17
+ <!-- Minimal steps or code snippet -->
18
+
19
+ **Logs / error output:**
20
+ <!-- Paste any stack traces or server logs here -->
21
+
22
+ **Expected behavior:**
23
+ <!-- What should have happened -->
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: "Ask a question"
4
+ url: https://github.com/leocelis/eif/discussions
5
+ about: Ask about setup, the pipeline, MCP integration, or anything else.
6
+ - name: "Share an idea"
7
+ url: https://github.com/leocelis/eif/discussions
8
+ about: Suggest a new gate, tool, or integration.
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: "/"
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,14 @@
1
+ ## Change Summary
2
+
3
+ <!-- What does this PR do and why? -->
4
+
5
+ ## Related Issue
6
+
7
+ <!-- Link the issue: Fixes #123 -->
8
+
9
+ ## Checklist
10
+
11
+ - [ ] Tests added or updated for the changes
12
+ - [ ] `pytest` passes locally
13
+ - [ ] Documentation updated where applicable
14
+ - [ ] `CHANGELOG.md` updated under `[Unreleased]`
@@ -0,0 +1,89 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ name: Tests (Python ${{ matrix.python-version }})
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ python-version: ["3.11", "3.12"]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+ cache: pip
27
+
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install -e ".[dev,mcp]"
32
+
33
+ - name: Run tests
34
+ run: pytest -q
35
+
36
+ lint:
37
+ name: Ruff
38
+ runs-on: ubuntu-latest
39
+
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.12"
46
+
47
+ - name: Install ruff
48
+ run: pip install 'ruff>=0.4'
49
+
50
+ - name: Ruff check
51
+ run: ruff check eif/ tests/ examples/
52
+
53
+ compliance:
54
+ name: TrustLint (EU AI Act)
55
+ runs-on: ubuntu-latest
56
+
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+
60
+ - uses: actions/setup-python@v5
61
+ with:
62
+ python-version: "3.12"
63
+
64
+ - name: Install TrustLint
65
+ run: |
66
+ python -m pip install --upgrade pip
67
+ pip install 'trustlint>=2.0.1'
68
+
69
+ - name: Scan LLM-facing artifacts
70
+ run: chmod +x scripts/compliance/check.sh && ./scripts/compliance/check.sh
71
+
72
+ compliance-runtime:
73
+ name: ComplyEdge runtime (BYOK)
74
+ runs-on: ubuntu-latest
75
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
76
+
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+
80
+ - name: Runtime /v1/check probe
81
+ env:
82
+ COMPLYEDGE_API_KEY: ${{ secrets.COMPLYEDGE_API_KEY }}
83
+ run: |
84
+ if [ -z "${COMPLYEDGE_API_KEY:-}" ]; then
85
+ echo "COMPLYEDGE_API_KEY not configured - skipping runtime probe"
86
+ exit 0
87
+ fi
88
+ chmod +x scripts/compliance/runtime_check.sh
89
+ ./scripts/compliance/runtime_check.sh
@@ -0,0 +1,26 @@
1
+ .claude/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .venv/
9
+ .env
10
+ .env.*
11
+ !.env.example
12
+ *.log
13
+ .DS_Store
14
+ .pytest_cache/
15
+ .mypy_cache/
16
+ .ruff_cache/
17
+ htmlcov/
18
+ .coverage
19
+ *.jsonl
20
+ validation/data/*
21
+ !validation/data/.gitkeep
22
+ _private/
23
+
24
+ # Safety (scrubbing artifacts) - never commit
25
+ gitleaks-report.json
26
+ secrets.txt
@@ -0,0 +1,9 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: trustlint-eif-artifacts
5
+ name: TrustLint (EU AI Act) on EIF intent artifacts
6
+ entry: scripts/compliance/check.sh
7
+ language: script
8
+ files: '_intent\.yaml$'
9
+ pass_filenames: false
@@ -0,0 +1,14 @@
1
+ # TrustLint - EIF LLM-facing artifacts (EU AI Act Article 5 screening)
2
+ # Offline gate: ./scripts/compliance/check.sh · pip install 'trustlint>=2.0.1'
3
+
4
+ jurisdiction: EU
5
+ severity_threshold: high
6
+
7
+ include:
8
+ - "eif/**/*_intent.yaml"
9
+
10
+ exclude:
11
+ - ".venv/**"
12
+ - "**/__pycache__/**"
13
+ - ".git/**"
14
+ - ".trustlint-cache/**"
@@ -0,0 +1,100 @@
1
+ # Changelog
2
+
3
+ All notable changes to `eif-engine` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [4.1.0] - 2026-07-19
11
+
12
+ ### Added
13
+ - Optional hosted MCP endpoint (private alpha) at `eif.leocelis.com`, serving both
14
+ streamable-http (`/mcp`) and SSE (`/sse` + `/messages`) transports with a single
15
+ Bearer key. LEGAL.md, TERMS_OF_SERVICE.md, and PRIVACY_POLICY.md updated to
16
+ describe the resulting data flow (in-memory only, never logged or persisted).
17
+ - ComplyEdge TrustLint live trust badge and `docs/integrations/COMPLYEDGE.md`.
18
+ - P0 host-tool numeric comparison: claims and evidence carrying numbers are now
19
+ compared directly (2% tolerance) instead of by keyword overlap alone.
20
+ - `ruff` lint job in CI.
21
+ - Governance and legal suite: CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, LEGAL,
22
+ TERMS_OF_SERVICE, PRIVACY_POLICY, DATA_PROCESSING_AGREEMENT (template),
23
+ DECISIONS (ADR log), NOTICE, CHANGELOG.
24
+ - CI: test matrix (Python 3.11, 3.12) plus TrustLint EU AI Act screening of
25
+ intent artifacts and an optional ComplyEdge runtime probe (BYOK).
26
+ - TrustLint offline compliance gate (`.trustlint.yaml`,
27
+ `scripts/compliance/check.sh`) and matching pre-commit hook.
28
+ - `py.typed` marker and ruff configuration.
29
+ - Landing page (`index.html`), kept in-repo; GitHub Pages is not enabled.
30
+
31
+ ### Changed
32
+ - Repository restructured for public release: internal and venture material
33
+ moved out of the OSS tree.
34
+ - Billing and hosted-service surfaces removed from the OSS tree. EIF is a pure
35
+ self-host project by default: pip install from source, stdio MCP server
36
+ (`eif-mcp-server`), optional local HTTP server (`eif-mcp-http-server`),
37
+ Docker.
38
+ - LEGAL.md and TERMS_OF_SERVICE.md (now v1.2): added an age-eligibility clause
39
+ (18+) and identity/accountability language for hosted-alpha key requests, a
40
+ CSAM/child-safety prohibition, a Miscellaneous section (entire agreement,
41
+ severability, no waiver, no assignment, force majeure), an exhaustive
42
+ no-warranty list naming NIS2 and the Cyber Resilience Act alongside the EU
43
+ AI Act and GDPR, a maintainer-position note on EIF's own CRA status
44
+ (believed out of scope as free non-commercial OSS), and a transparency note
45
+ that MIT carries no explicit patent grant. See DECISIONS.md EIF-009.
46
+
47
+ ### Security
48
+ - The hosted HTTP server now enforces a per-key rate limit (default 60
49
+ requests/minute, `EIF_RATE_LIMIT_PER_MINUTE`) on `/mcp`, the streamable
50
+ websocket path, and `/verify`. The Terms of Service already prohibited
51
+ DoS-volume usage; nothing technically enforced it until now.
52
+ - Fixed a working remote code execution in the P1 code-execution evidence path
53
+ (`collect_code_execution`), found via adversarial testing of the hosted MCP
54
+ endpoint's attack surface and confirmed with a proof-of-concept payload:
55
+ claim text substituted into generated Python source could break out of its
56
+ string literal and, via `().__class__.__bases__[0].__subclasses__()` object
57
+ introspection, reach `os.system` without triggering the existing
58
+ forbidden-imports denylist. Claim text is now passed through `json.dumps()`
59
+ instead of interpolated into source, and the AST validator now rejects any
60
+ dunder-pattern name or attribute access categorically, closing the general
61
+ class of Python sandbox-escape gadgets rather than one specific technique.
62
+ See DECISIONS.md EIF-008. New regression tests in
63
+ `tests/unit/test_p1_sandbox_security.py`.
64
+
65
+ ### Fixed
66
+ - P1 code execution was silently non-functional for every claim, benign or
67
+ not: all five templates imported `sys` for control flow, and `sys` is on
68
+ the same AST validator's forbidden-imports list. Templates now use
69
+ `return` inside a wrapped function instead of `sys.exit()`. This also
70
+ happened to be the reason the RCE above was not reachable in the
71
+ previously deployed version.
72
+ - `HIGH_RISK_ASSUMED` advisory entries no longer drive the overall verdict to HALT;
73
+ they are surfaced for review but marked non-blocking, matching their documented
74
+ behavior.
75
+ - FastMCP's streamable-http lifespan is now forwarded and DNS-rebinding protection
76
+ is disabled in production, fixing the hosted HTTP/SSE transports (previously 421
77
+ behind a reverse proxy).
78
+ - Full pre-release audit (85 findings): repaired the three broken integration
79
+ surfaces (eif.auto import crash with the anthropic SDK, eif.integration
80
+ session wiring, HTTP MCP transport wiring, LangChain sync-callback deadlock),
81
+ routed P1 template execution through the AST screen, relabeled built-in
82
+ benchmark constants honestly, removed retention/upsell leftovers, moved the
83
+ server log out of ~/.cursor, corrected stale docs (thresholds, corpus
84
+ numbers, module maps, EU AI Act article), and removed em dashes from all
85
+ prose.
86
+
87
+ ## [4.0.0] - 2026-07-17
88
+
89
+ ### Added
90
+ - 8-phase scientific-method pipeline: DECLARE, FALSIFY, CAUSAL_GATE, CALIBRATE,
91
+ CHALLENGE, UPDATE, EXPLAIN, RECORD, routing each turn to ACT, REVISE, or HALT.
92
+ - 24 MCP tools exposing the pipeline over stdio and local HTTP transports.
93
+ - Evidence trust-weighting: tier-aware and confidence-aware Bayesian likelihood
94
+ with a corroboration gate.
95
+ - Auxiliary gates: sycophancy detection (position drift, unfaithful CoT),
96
+ input guard (adversarial input detection), and causal gate (Pearl causal
97
+ levels, confounder and disjunctive-bias flags).
98
+ - Validation corpus: 14 illustrative multi-agent scenarios across clinical,
99
+ engineering, compliance, investment, and M&A domains
100
+ (`validation/CORPUS_REPORT.md`).
@@ -0,0 +1,72 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ---
16
+
17
+ ## Our Standards
18
+
19
+ Examples of behavior that contributes to a positive environment for our
20
+ community include:
21
+
22
+ * Demonstrating empathy and kindness toward other people
23
+ * Being respectful of differing opinions, viewpoints, and experiences
24
+ * Giving and gracefully accepting constructive feedback
25
+ * Accepting responsibility and apologizing to those affected by our mistakes,
26
+ and learning from the experience
27
+ * Focusing on what is best not just for us as individuals, but for the overall
28
+ community
29
+
30
+ Examples of unacceptable behavior include:
31
+
32
+ * The use of sexualized language or imagery, and sexual attention or advances of
33
+ any kind
34
+ * Trolling, insulting or derogatory comments, and personal or political attacks
35
+ * Public or private harassment
36
+ * Publishing others' private information, such as a physical or email address,
37
+ without their explicit permission
38
+ * Other conduct which could reasonably be considered inappropriate in a
39
+ professional setting
40
+
41
+ ---
42
+
43
+ ## Enforcement Responsibilities
44
+
45
+ Community leaders are responsible for clarifying and enforcing our standards of
46
+ acceptable behavior and will take appropriate and fair corrective action in
47
+ response to any behavior that they deem inappropriate, threatening, offensive,
48
+ or harmful.
49
+
50
+ ---
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+
57
+ ---
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the project maintainer by opening an issue at
63
+ [github.com/leocelis/eif/issues](https://github.com/leocelis/eif/issues).
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ ---
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
71
+ version 2.1, available at
72
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
@@ -0,0 +1,81 @@
1
+ # Contributing to EIF
2
+
3
+ Thanks for your interest in contributing to the Epistemic Integrity Framework.
4
+
5
+ ---
6
+
7
+ ## Repository layout
8
+
9
+ ```
10
+ eif/
11
+ ├── eif/ # Library source (installable package: eif-engine)
12
+ │ ├── declare/ # Phase 1: assumption declaration (KNOWN/ASSUMED/GUESSED)
13
+ │ ├── falsify/ # Phase 2: evidence collection (P1 code, P2 tools, P3 web search)
14
+ │ ├── causal_gate/ # Phase 3: Pearl causal-level checks
15
+ │ ├── calibrate/ # Phase 4: Bayesian posterior update and routing
16
+ │ ├── challenge/ # Phase 5: adversarial critic
17
+ │ ├── update/ # Phase 6: sequential Bayes update, EIG stopping rule
18
+ │ ├── explain/ # Phase 7: hard-to-vary check
19
+ │ ├── record/ # Phase 8: provenance records
20
+ │ ├── input_guard/ # auxiliary gate: adversarial input detection
21
+ │ ├── sycophancy/ # auxiliary gate: position drift detection
22
+ │ ├── hypothesis_agenda/ # auxiliary: EIG-ranked claim agenda
23
+ │ ├── replicate/ # auxiliary: replication protocol
24
+ │ ├── programme/ # auxiliary: Lakatos programme health monitor
25
+ │ ├── mcp_server/ # stdio + local HTTP MCP servers (24 tools)
26
+ │ └── sdk/ # client-side interceptors
27
+ ├── tests/ # pytest suite (unit + integration)
28
+ ├── examples/ # runnable quickstart
29
+ ├── docs/ # architecture, tech specs, research foundation
30
+ ├── validation/ # validation corpus report and aggregation
31
+ ├── pyproject.toml
32
+ └── README.md
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Development setup
38
+
39
+ ```bash
40
+ python -m venv .venv
41
+ source .venv/bin/activate
42
+ pip install -e ".[dev,mcp]"
43
+ ```
44
+
45
+ Requires Python 3.11 or newer.
46
+
47
+ ---
48
+
49
+ ## Running tests
50
+
51
+ ```bash
52
+ # Full suite
53
+ pytest
54
+
55
+ # Unit tests only
56
+ pytest tests/unit
57
+
58
+ # Integration tests only
59
+ pytest tests/integration
60
+ ```
61
+
62
+ Async tests run automatically (`asyncio_mode = auto` in `pyproject.toml`). The suite needs no network access and no API keys.
63
+
64
+ ---
65
+
66
+ ## Code style
67
+
68
+ - **No LLM calls in the engine.** This is EIF's design principle #1. The core pipeline (declare, falsify math, causal gate, calibrate, update, explain, record) is deterministic and makes no outbound network calls. LLM-backed helpers (the critic tournament in CHALLENGE, the causal evidence probe) are optional, key-gated, and isolated from the core.
69
+ - Type hints on all public APIs.
70
+ - Intent artifacts (`*_intent.yaml`) live next to the code they govern. Read the relevant intent before modifying a module; update it when behavior changes.
71
+ - Keep new dependencies out of the core. Optional features go behind extras in `pyproject.toml`.
72
+
73
+ ---
74
+
75
+ ## Pull request checklist
76
+
77
+ - [ ] Tests added or updated for the change
78
+ - [ ] `pytest` passes locally
79
+ - [ ] README and docs updated where applicable
80
+ - [ ] `CHANGELOG.md` updated under `[Unreleased]`
81
+ - [ ] No LLM calls or outbound network calls added to the core engine
@@ -0,0 +1,149 @@
1
+ # Data Processing Agreement (Template)
2
+
3
+ > **Version:** 1.0 · **Effective:** 2026-07-17
4
+ >
5
+ > **Template. Not in force.** EIF's maintainer does not process user data (see
6
+ > [PRIVACY_POLICY.md](PRIVACY_POLICY.md)), so no DPA with the maintainer exists or is
7
+ > needed. This template is provided as a convenience for organizations that deploy
8
+ > EIF's HTTP server (`eif-mcp-http-server`) internally and need a GDPR Art. 28
9
+ > agreement **between their own controller and processor entities** (for example, a
10
+ > parent company and the subsidiary or internal service team operating the EIF
11
+ > deployment). Have your own counsel review and adapt it before use. It creates no
12
+ > obligations for, and grants no rights against, the EIF maintainer.
13
+
14
+ ---
15
+
16
+ ## Parties
17
+
18
+ - **Controller:** `[LEGAL ENTITY NAME, REGISTERED ADDRESS]` ("Controller")
19
+ - **Processor:** `[LEGAL ENTITY NAME, REGISTERED ADDRESS]` ("Processor")
20
+
21
+ This Data Processing Agreement ("DPA") is entered into pursuant to Article 28 of
22
+ Regulation (EU) 2016/679 ("GDPR") and forms part of `[MAIN AGREEMENT REFERENCE]`.
23
+
24
+ ---
25
+
26
+ ## 1. Subject Matter and Duration
27
+
28
+ The Processor operates a deployment of the Epistemic Integrity Framework ("EIF"),
29
+ including its HTTP server, on infrastructure under the Processor's control, and
30
+ processes personal data contained in claims, evidence, session stores, cost ledgers,
31
+ and provenance records on the Controller's behalf.
32
+
33
+ This DPA applies for the duration of `[MAIN AGREEMENT REFERENCE]` and until all
34
+ personal data processed under it is deleted or returned per §9.
35
+
36
+ ---
37
+
38
+ ## 2. Nature and Purpose of Processing
39
+
40
+ Verification of AI agent claims through EIF's pipeline: claim extraction, evidence
41
+ collection, Bayesian calibration, routing (ACT/REVISE/HALT), and generation of
42
+ provenance records, together with storage of the resulting local artifacts.
43
+
44
+ `[ADAPT: describe your deployment's actual purpose and any enabled optional features,
45
+ including outbound evidence collection (DuckDuckGo) and OpenAI-backed critique, which
46
+ transmit claim text to those third parties.]`
47
+
48
+ ---
49
+
50
+ ## 3. Categories of Data and Data Subjects
51
+
52
+ - **Data categories:** `[e.g., personal data appearing in agent claims and evidence,
53
+ identifiers in session metadata, personal data captured in provenance records]`
54
+ - **Data subjects:** `[e.g., employees, customers, end users of the Controller's AI
55
+ systems]`
56
+ - **Special categories (Art. 9):** `[none / specify, with the legal basis]`
57
+
58
+ ---
59
+
60
+ ## 4. Processor Obligations
61
+
62
+ The Processor shall:
63
+
64
+ 1. Process personal data only on documented instructions from the Controller,
65
+ including with regard to transfers to third countries (Art. 28(3)(a))
66
+ 2. Ensure persons authorized to process the data are bound by confidentiality
67
+ (Art. 28(3)(b))
68
+ 3. Implement the technical and organizational measures in §5 (Art. 32)
69
+ 4. Respect the sub-processor conditions in §6 (Art. 28(2), 28(4))
70
+ 5. Assist the Controller in responding to data subject rights requests, taking into
71
+ account the nature of the processing (Art. 28(3)(e))
72
+ 6. Assist the Controller with security, breach notification, and data protection
73
+ impact assessment obligations (Arts. 32 to 36), including notifying the Controller
74
+ without undue delay after becoming aware of a personal data breach
75
+ 7. Delete or return personal data per §9 (Art. 28(3)(g))
76
+ 8. Make available information necessary to demonstrate compliance and allow audits
77
+ per §7 (Art. 28(3)(h)), informing the Controller if an instruction infringes the
78
+ GDPR
79
+
80
+ ---
81
+
82
+ ## 5. Security Measures
83
+
84
+ At minimum, the Processor shall:
85
+
86
+ - Keep the EIF HTTP server bound to loopback (127.0.0.1) or otherwise restrict it to
87
+ networks under the Processor's control, and enable bearer authentication
88
+ (`EIF_API_KEY`) where the server is reachable beyond a single host
89
+ - Protect local artifacts (session store and cost ledger under `~/.eif/`, provenance
90
+ records) with appropriate filesystem permissions and encryption at rest
91
+ - Restrict and log administrative access to the deployment
92
+ - Apply security updates to the deployment environment in a timely manner
93
+ - `[ADAPT: add your organization's standard TOMs annex]`
94
+
95
+ ---
96
+
97
+ ## 6. Sub-processors
98
+
99
+ The Controller `[authorizes / does not authorize]` the engagement of sub-processors.
100
+ Authorized sub-processors at signature:
101
+
102
+ | Sub-processor | Role | Condition |
103
+ |---------------|------|-----------|
104
+ | `[e.g., OpenAI]` | `[Critic tournament and causal evidence probe, only if enabled]` | `[Data processing terms reference]` |
105
+ | `[e.g., search provider]` | `[Web evidence collection, only if enabled]` | `[Terms reference]` |
106
+ | `[hosting/infrastructure]` | `[Infrastructure for the deployment]` | `[DPA reference]` |
107
+
108
+ The Processor shall inform the Controller of intended changes and give the Controller
109
+ the opportunity to object. The Processor imposes on each sub-processor the same data
110
+ protection obligations as set out in this DPA.
111
+
112
+ ---
113
+
114
+ ## 7. Audit
115
+
116
+ The Processor shall make available to the Controller all information necessary to
117
+ demonstrate compliance with this DPA and shall allow for and contribute to audits,
118
+ including inspections, conducted by the Controller or an auditor mandated by the
119
+ Controller, on reasonable notice and no more than `[frequency]` absent a specific
120
+ incident.
121
+
122
+ ---
123
+
124
+ ## 8. International Transfers
125
+
126
+ The Processor shall not transfer personal data outside the `[EEA / applicable
127
+ territory]` without the Controller's documented instruction and appropriate safeguards
128
+ under GDPR Chapter V. Note that enabling EIF's optional outbound evidence features may
129
+ constitute such a transfer; they shall remain disabled unless covered by this section.
130
+
131
+ ---
132
+
133
+ ## 9. Deletion and Return
134
+
135
+ Upon termination of the services, the Processor shall, at the Controller's choice,
136
+ delete or return all personal data (including session stores, cost ledgers, provenance
137
+ records, and backups) within `[period]`, and certify deletion in writing, unless Union
138
+ or Member State law requires further storage.
139
+
140
+ ---
141
+
142
+ ## Signatures
143
+
144
+ | | Controller | Processor |
145
+ |---|---|---|
146
+ | Name | `[NAME]` | `[NAME]` |
147
+ | Title | `[TITLE]` | `[TITLE]` |
148
+ | Date | `[DATE]` | `[DATE]` |
149
+ | Signature | | |