alethic-kernel 0.1.0__tar.gz → 0.3.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 (110) hide show
  1. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/CHANGELOG.md +30 -0
  2. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/CONTRIBUTING.md +7 -14
  3. alethic_kernel-0.3.0/PKG-INFO +140 -0
  4. alethic_kernel-0.3.0/README.md +110 -0
  5. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/SECURITY.md +5 -16
  6. alethic_kernel-0.3.0/alethic_kernel.egg-info/PKG-INFO +140 -0
  7. alethic_kernel-0.3.0/alethic_kernel.egg-info/SOURCES.txt +51 -0
  8. alethic_kernel-0.3.0/alethic_kernel.egg-info/requires.txt +5 -0
  9. alethic_kernel-0.3.0/alethic_kernel.egg-info/top_level.txt +1 -0
  10. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/docs/api-reference.md +12 -11
  11. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/docs/architecture.md +14 -12
  12. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/docs/workers.md +7 -7
  13. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/pyproject.toml +11 -28
  14. alethic_kernel-0.3.0/src/__init__.py +46 -0
  15. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/conftest.py +3 -69
  16. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/helpers.py +1 -1
  17. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_adaptive_worker.py +3 -3
  18. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_atomicity.py +5 -5
  19. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_concurrency.py +4 -4
  20. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_kernel.py +3 -3
  21. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_migrations.py +2 -2
  22. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_orchestrator.py +4 -4
  23. alethic_kernel-0.3.0/tests/test_package_api.py +21 -0
  24. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_permissions.py +1 -1
  25. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_readme_assets.py +1 -1
  26. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_schema.py +1 -1
  27. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_session.py +1 -1
  28. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_sim_worker.py +2 -2
  29. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_sqlite_store.py +2 -2
  30. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_store.py +2 -2
  31. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_store_equivalence.py +2 -2
  32. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/tests/test_validators.py +1 -1
  33. alethic_kernel-0.1.0/PKG-INFO +0 -163
  34. alethic_kernel-0.1.0/README.md +0 -127
  35. alethic_kernel-0.1.0/__init__.py +0 -9
  36. alethic_kernel-0.1.0/agents/alethic_agent.py +0 -109
  37. alethic_kernel-0.1.0/agents/json_glue.py +0 -35
  38. alethic_kernel-0.1.0/agents/llm_agent.py +0 -186
  39. alethic_kernel-0.1.0/agents/string_glue.py +0 -33
  40. alethic_kernel-0.1.0/alethic/__init__.py +0 -13
  41. alethic_kernel-0.1.0/alethic/api/__init__.py +0 -0
  42. alethic_kernel-0.1.0/alethic/api/app.py +0 -65
  43. alethic_kernel-0.1.0/alethic/api/dependencies.py +0 -59
  44. alethic_kernel-0.1.0/alethic/api/models.py +0 -104
  45. alethic_kernel-0.1.0/alethic/api/routes.py +0 -142
  46. alethic_kernel-0.1.0/alethic/api/tracing.py +0 -25
  47. alethic_kernel-0.1.0/alethic/client.py +0 -280
  48. alethic_kernel-0.1.0/alethic_kernel.egg-info/PKG-INFO +0 -163
  49. alethic_kernel-0.1.0/alethic_kernel.egg-info/SOURCES.txt +0 -149
  50. alethic_kernel-0.1.0/alethic_kernel.egg-info/entry_points.txt +0 -2
  51. alethic_kernel-0.1.0/alethic_kernel.egg-info/requires.txt +0 -12
  52. alethic_kernel-0.1.0/alethic_kernel.egg-info/top_level.txt +0 -1
  53. alethic_kernel-0.1.0/docs/benchmark.md +0 -192
  54. alethic_kernel-0.1.0/docs/deployment.md +0 -136
  55. alethic_kernel-0.1.0/docs/http-api.md +0 -359
  56. alethic_kernel-0.1.0/docs/superpowers/plans/2026-07-16-alethic-dev.md +0 -1238
  57. alethic_kernel-0.1.0/docs/superpowers/specs/2026-07-16-alethic-dev-design.md +0 -104
  58. alethic_kernel-0.1.0/eval/__init__.py +0 -0
  59. alethic_kernel-0.1.0/eval/harness.py +0 -53
  60. alethic_kernel-0.1.0/eval/metrics.py +0 -70
  61. alethic_kernel-0.1.0/eval/report.py +0 -41
  62. alethic_kernel-0.1.0/eval/task_loader.py +0 -38
  63. alethic_kernel-0.1.0/examples/demo.py +0 -472
  64. alethic_kernel-0.1.0/examples/multi_episode.py +0 -263
  65. alethic_kernel-0.1.0/llm/__init__.py +0 -0
  66. alethic_kernel-0.1.0/llm/planner.py +0 -178
  67. alethic_kernel-0.1.0/py.typed +0 -0
  68. alethic_kernel-0.1.0/run.py +0 -172
  69. alethic_kernel-0.1.0/tasks/stripe_refund_clean.yaml +0 -18
  70. alethic_kernel-0.1.0/tasks/stripe_refund_combined.yaml +0 -18
  71. alethic_kernel-0.1.0/tasks/stripe_refund_conflict.yaml +0 -18
  72. alethic_kernel-0.1.0/tasks/stripe_refund_duplicate.yaml +0 -19
  73. alethic_kernel-0.1.0/tasks/stripe_refund_stale.yaml +0 -18
  74. alethic_kernel-0.1.0/tasks/stripe_refund_tool_failure.yaml +0 -18
  75. alethic_kernel-0.1.0/tests/__init__.py +0 -0
  76. alethic_kernel-0.1.0/tests/test_agent_integration.py +0 -104
  77. alethic_kernel-0.1.0/tests/test_agent_llm_mock.py +0 -143
  78. alethic_kernel-0.1.0/tests/test_api.py +0 -319
  79. alethic_kernel-0.1.0/tests/test_benchmark_invariants.py +0 -105
  80. alethic_kernel-0.1.0/tests/test_cli.py +0 -111
  81. alethic_kernel-0.1.0/tests/test_client.py +0 -165
  82. alethic_kernel-0.1.0/tests/test_coverage_gaps.py +0 -452
  83. alethic_kernel-0.1.0/tests/test_e2e_pipeline.py +0 -481
  84. alethic_kernel-0.1.0/tests/test_report.py +0 -157
  85. alethic_kernel-0.1.0/tests/test_stress.py +0 -873
  86. alethic_kernel-0.1.0/tools/__init__.py +0 -0
  87. alethic_kernel-0.1.0/tools/payment_tool.py +0 -30
  88. alethic_kernel-0.1.0/tools/perturb.py +0 -17
  89. alethic_kernel-0.1.0/tools/refund_tool.py +0 -16
  90. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  91. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/LICENSE +0 -0
  92. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/MANIFEST.in +0 -0
  93. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/alethic_kernel.egg-info/dependency_links.txt +0 -0
  94. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/docs/architecture.png +0 -0
  95. {alethic_kernel-0.1.0 → alethic_kernel-0.3.0}/setup.cfg +0 -0
  96. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/adaptive_worker.py +0 -0
  97. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/kernel.py +0 -0
  98. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/migrations.py +0 -0
  99. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/orchestrator.py +0 -0
  100. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/permissions.py +0 -0
  101. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/py.typed +0 -0
  102. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/schema.py +0 -0
  103. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/session.py +0 -0
  104. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/sim_worker.py +0 -0
  105. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/sqlite_store.py +0 -0
  106. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/store.py +0 -0
  107. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/store_protocol.py +0 -0
  108. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/validators.py +0 -0
  109. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.3.0/src}/worker.py +0 -0
  110. {alethic_kernel-0.1.0/agents → alethic_kernel-0.3.0/tests}/__init__.py +0 -0
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.0] - 2026-07-18
9
+
10
+ ### Changed
11
+
12
+ - Renamed the sole public Python namespace from `alethic_kernel` to `alethic`.
13
+ - Mapped the repository's `src/` directory directly to the installed `alethic`
14
+ package, eliminating the repeated source-directory name without adding a
15
+ compatibility copy.
16
+ - Reduced the distribution to the domain-neutral governed cognitive substrate.
17
+ Benchmark agents, Stripe tasks, LLM prompts, the evaluation harness, and the
18
+ development HTTP service are no longer shipped in the Alethic wheel.
19
+ - Moved canonical repository metadata to `emiluzelac/alethic`.
20
+
21
+ ### Removed
22
+
23
+ - Removed the `alethic_kernel` compatibility namespace. Import from `alethic`.
24
+ - Removed the benchmark CLI and application-server extras from the runtime
25
+ distribution.
26
+
27
+ ## [0.2.0] - 2026-07-18
28
+
29
+ ### Changed
30
+
31
+ - Flattened the public Python namespace from `alethic_kernel.alethic` to
32
+ `alethic_kernel`.
33
+ - Moved the installable package into the conventional `src/alethic_kernel`
34
+ layout.
35
+ - Renamed the source repository to `alethicdev/alethic-kernel` so the GitHub,
36
+ PyPI, and Python package names describe the same artifact.
37
+
8
38
  ## [0.1.0] - 2026-07-16
9
39
 
10
40
  ### Added
@@ -37,7 +37,7 @@ Be respectful, inclusive, and professional. We're building trust in AI systems t
37
37
  4. **Run tests and type checking**
38
38
  ```bash
39
39
  pytest tests/ -v
40
- mypy --strict -p alethic_kernel.alethic -p alethic_kernel.llm -p alethic_kernel.agents -p alethic_kernel.eval -p alethic_kernel.tools
40
+ mypy --strict src
41
41
  ```
42
42
 
43
43
  5. **Commit with clear messages**
@@ -71,7 +71,7 @@ Be respectful, inclusive, and professional. We're building trust in AI systems t
71
71
 
72
72
  - Write tests in `tests/` with names prefixed `test_`
73
73
  - Use fixtures from `tests/conftest.py` where appropriate
74
- - Target coverage for new code; 349 tests provide a baseline
74
+ - Preserve or improve coverage for every behavior you change
75
75
 
76
76
  ### Documentation
77
77
 
@@ -83,23 +83,16 @@ Be respectful, inclusive, and professional. We're building trust in AI systems t
83
83
  ## Project Structure
84
84
 
85
85
  ```
86
- alethic/ Core kernel (domain-agnostic)
87
- agents/ Reference agents (string_glue, json_glue, alethic, llm)
88
- eval/ Evaluation harness and metrics
89
- llm/ LLM planner (OpenAI-compatible API client)
90
- tools/ Simulated tools and perturbations
91
- tasks/ Task definitions (YAML)
92
- tests/ Test suite (349 tests)
93
- docs/ Documentation
94
- examples/ Multi-episode demo
86
+ src/ Installable `alethic` package root
87
+ tests/ Test suite
88
+ docs/ Architecture and API documentation
89
+ examples/ Domain-neutral examples
95
90
  ```
96
91
 
97
92
  ## Key Areas for Contribution
98
93
 
99
- - **New domains**: Create additional example domains beyond Stripe refunds
100
94
  - **Store backends**: Implement new `StoreProtocol` implementations (e.g., PostgreSQL)
101
- - **Workers**: Add specialized worker types for new use cases
102
- - **Tools**: Expand simulated tool library or create domain-specific tools
95
+ - **Workers**: Improve the domain-neutral worker and orchestration protocols
103
96
  - **Documentation**: Tutorials, examples, deployment guides
104
97
  - **Performance**: Optimize kernel operations or store queries
105
98
  - **Type safety**: Improve type coverage or migrate from `Any` to specific types
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: alethic-kernel
3
+ Version: 0.3.0
4
+ Summary: Alethic: a governed cognitive substrate for AI systems
5
+ Author: Emil Uzelac
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/emiluzelac/alethic
8
+ Project-URL: Documentation, https://github.com/emiluzelac/alethic#documentation
9
+ Project-URL: Repository, https://github.com/emiluzelac/alethic.git
10
+ Project-URL: Bug Tracker, https://github.com/emiluzelac/alethic/issues
11
+ Project-URL: Research Paper, https://doi.org/10.5281/zenodo.18691808
12
+ Keywords: ai,governance,agents,blackboard-kernel,orchestration,safety
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: System :: Distributed Computing
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8.0; extra == "dev"
27
+ Requires-Dist: pytest-cov; extra == "dev"
28
+ Requires-Dist: mypy; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # Alethic
32
+
33
+ **A governed cognitive substrate for AI systems.**
34
+
35
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18691808.svg)](https://doi.org/10.5281/zenodo.18691808)
36
+
37
+ Models propose. Alethic decides what may enter state and what may become action.
38
+
39
+ Alethic places a small, enforceable kernel between reasoning components and
40
+ external effects. It maintains typed state, links beliefs to evidence, applies
41
+ declarative constraints, and records why each proposal was committed or
42
+ invalidated. The kernel contains no model, prompt, tool, task, or domain logic.
43
+
44
+ ## Install
45
+
46
+ The Python distribution is named `alethic-kernel`; its single import namespace
47
+ is `alethic`.
48
+
49
+ ```bash
50
+ pip install alethic-kernel
51
+ ```
52
+
53
+ ## Use
54
+
55
+ ```python
56
+ from alethic import Kernel
57
+
58
+ kernel = Kernel()
59
+ trace = "episode-001"
60
+
61
+ kernel.write(
62
+ "tool",
63
+ "percepts",
64
+ "COMMIT",
65
+ "observation",
66
+ {"value": 42, "stale": False, "conflict": False},
67
+ trace,
68
+ confidence=0.9,
69
+ )
70
+
71
+ proposal = kernel.write(
72
+ "planner",
73
+ "beliefs",
74
+ "PROPOSE",
75
+ "threshold_reached",
76
+ {"value": True, "depends_on": ["observation"]},
77
+ trace,
78
+ input_refs=["observation"],
79
+ )
80
+
81
+ committed, reason = kernel.commit_belief_from_proposal(proposal.id, trace)
82
+ print(committed, reason)
83
+ ```
84
+
85
+ Every worker can propose. Only the kernel can commit. State lives in seven
86
+ semantic slots: percepts, beliefs, constraints, plans, evidence, predictions,
87
+ and actions.
88
+
89
+ ## What belongs here
90
+
91
+ This repository contains only the domain-neutral Alethic substrate:
92
+
93
+ - the governed blackboard kernel and typed record schema;
94
+ - evidence, confidence, conflict, constraint, and prediction validation;
95
+ - in-memory and SQLite stores;
96
+ - worker orchestration, sessions, simulation, and adaptive constraints;
97
+ - tests, architectural documentation, and a domain-neutral example.
98
+
99
+ The controlled study, results, and verification artifacts live separately in
100
+ [governed-cognition](https://github.com/emiluzelac/governed-cognition).
101
+
102
+ ## Documentation
103
+
104
+ - [Architecture](docs/architecture.md)
105
+ - [API reference](docs/api-reference.md)
106
+ - [Workers](docs/workers.md)
107
+ - [Research paper](https://doi.org/10.5281/zenodo.18691808)
108
+
109
+ ## Source layout
110
+
111
+ The repository name is Alethic exactly once. Setuptools maps `src/` directly to
112
+ the installed `alethic` namespace.
113
+
114
+ ```text
115
+ src/
116
+ __init__.py
117
+ kernel.py
118
+ schema.py
119
+ permissions.py
120
+ validators.py
121
+ store.py
122
+ sqlite_store.py
123
+ worker.py
124
+ orchestrator.py
125
+ session.py
126
+ sim_worker.py
127
+ adaptive_worker.py
128
+ ```
129
+
130
+ ## Development
131
+
132
+ ```bash
133
+ python -m pip install -e ".[dev]"
134
+ pytest
135
+ mypy --strict src
136
+ ```
137
+
138
+ ## License
139
+
140
+ MIT © Emil Uzelac
@@ -0,0 +1,110 @@
1
+ # Alethic
2
+
3
+ **A governed cognitive substrate for AI systems.**
4
+
5
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18691808.svg)](https://doi.org/10.5281/zenodo.18691808)
6
+
7
+ Models propose. Alethic decides what may enter state and what may become action.
8
+
9
+ Alethic places a small, enforceable kernel between reasoning components and
10
+ external effects. It maintains typed state, links beliefs to evidence, applies
11
+ declarative constraints, and records why each proposal was committed or
12
+ invalidated. The kernel contains no model, prompt, tool, task, or domain logic.
13
+
14
+ ## Install
15
+
16
+ The Python distribution is named `alethic-kernel`; its single import namespace
17
+ is `alethic`.
18
+
19
+ ```bash
20
+ pip install alethic-kernel
21
+ ```
22
+
23
+ ## Use
24
+
25
+ ```python
26
+ from alethic import Kernel
27
+
28
+ kernel = Kernel()
29
+ trace = "episode-001"
30
+
31
+ kernel.write(
32
+ "tool",
33
+ "percepts",
34
+ "COMMIT",
35
+ "observation",
36
+ {"value": 42, "stale": False, "conflict": False},
37
+ trace,
38
+ confidence=0.9,
39
+ )
40
+
41
+ proposal = kernel.write(
42
+ "planner",
43
+ "beliefs",
44
+ "PROPOSE",
45
+ "threshold_reached",
46
+ {"value": True, "depends_on": ["observation"]},
47
+ trace,
48
+ input_refs=["observation"],
49
+ )
50
+
51
+ committed, reason = kernel.commit_belief_from_proposal(proposal.id, trace)
52
+ print(committed, reason)
53
+ ```
54
+
55
+ Every worker can propose. Only the kernel can commit. State lives in seven
56
+ semantic slots: percepts, beliefs, constraints, plans, evidence, predictions,
57
+ and actions.
58
+
59
+ ## What belongs here
60
+
61
+ This repository contains only the domain-neutral Alethic substrate:
62
+
63
+ - the governed blackboard kernel and typed record schema;
64
+ - evidence, confidence, conflict, constraint, and prediction validation;
65
+ - in-memory and SQLite stores;
66
+ - worker orchestration, sessions, simulation, and adaptive constraints;
67
+ - tests, architectural documentation, and a domain-neutral example.
68
+
69
+ The controlled study, results, and verification artifacts live separately in
70
+ [governed-cognition](https://github.com/emiluzelac/governed-cognition).
71
+
72
+ ## Documentation
73
+
74
+ - [Architecture](docs/architecture.md)
75
+ - [API reference](docs/api-reference.md)
76
+ - [Workers](docs/workers.md)
77
+ - [Research paper](https://doi.org/10.5281/zenodo.18691808)
78
+
79
+ ## Source layout
80
+
81
+ The repository name is Alethic exactly once. Setuptools maps `src/` directly to
82
+ the installed `alethic` namespace.
83
+
84
+ ```text
85
+ src/
86
+ __init__.py
87
+ kernel.py
88
+ schema.py
89
+ permissions.py
90
+ validators.py
91
+ store.py
92
+ sqlite_store.py
93
+ worker.py
94
+ orchestrator.py
95
+ session.py
96
+ sim_worker.py
97
+ adaptive_worker.py
98
+ ```
99
+
100
+ ## Development
101
+
102
+ ```bash
103
+ python -m pip install -e ".[dev]"
104
+ pytest
105
+ mypy --strict src
106
+ ```
107
+
108
+ ## License
109
+
110
+ MIT © Emil Uzelac
@@ -18,7 +18,7 @@ Alethic is pre-1.0. Only the latest release receives security fixes.
18
18
 
19
19
  | Version | Supported |
20
20
  | ------- | --------- |
21
- | 0.1.x | ✅ |
21
+ | 0.3.x | ✅ |
22
22
 
23
23
  ## Scope and Known Limitations
24
24
 
@@ -27,17 +27,6 @@ and does not currently defend against. The following are **known** and are not
27
27
  useful as vulnerability reports — though better ideas for fixing them are very
28
28
  welcome, as issues or pull requests.
29
29
 
30
- ### The HTTP API is unauthenticated
31
-
32
- The FastAPI service under `alethic/api/` is a development and evaluation tool.
33
- It has no authentication or authorization, every caller shares one kernel, and
34
- `role` is read from the request body — so a client can claim the `kernel` role
35
- and commit without validation. `trace_id` namespaces state but does not isolate
36
- it. Request bodies are unbounded and records are never evicted.
37
-
38
- Do not expose it to untrusted traffic. See
39
- [docs/http-api.md](docs/http-api.md#security).
40
-
41
30
  ### The permissions matrix is worker discipline, not a security boundary
42
31
 
43
32
  In-process, the role is declared by the caller. The matrix keeps a well-behaved
@@ -47,10 +36,10 @@ Only give kernel access to code you trust.
47
36
  ### The library's threat model
48
37
 
49
38
  The library assumes a **trusted integrator** and an **untrusted model**. That
50
- second half is the part Alethic is built to handle: planner output is validated
51
- before commitment, and the agent rebuilds action payloads from tool data rather
52
- than trusting model-supplied fields, so prompt injection should not be able to
53
- push an unvalidated action through the kernel.
39
+ second half is the part Alethic is built to handle: planner output is proposed
40
+ to the kernel and must pass its validation pipeline before commitment. Alethic
41
+ does not authenticate callers or prevent trusted application code from bypassing
42
+ the kernel entirely.
54
43
 
55
44
  **A way to defeat that is exactly what we want to hear about.** If you can make
56
45
  the kernel commit a belief, action, or prediction that its validation pipeline
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: alethic-kernel
3
+ Version: 0.3.0
4
+ Summary: Alethic: a governed cognitive substrate for AI systems
5
+ Author: Emil Uzelac
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/emiluzelac/alethic
8
+ Project-URL: Documentation, https://github.com/emiluzelac/alethic#documentation
9
+ Project-URL: Repository, https://github.com/emiluzelac/alethic.git
10
+ Project-URL: Bug Tracker, https://github.com/emiluzelac/alethic/issues
11
+ Project-URL: Research Paper, https://doi.org/10.5281/zenodo.18691808
12
+ Keywords: ai,governance,agents,blackboard-kernel,orchestration,safety
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: System :: Distributed Computing
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8.0; extra == "dev"
27
+ Requires-Dist: pytest-cov; extra == "dev"
28
+ Requires-Dist: mypy; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # Alethic
32
+
33
+ **A governed cognitive substrate for AI systems.**
34
+
35
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18691808.svg)](https://doi.org/10.5281/zenodo.18691808)
36
+
37
+ Models propose. Alethic decides what may enter state and what may become action.
38
+
39
+ Alethic places a small, enforceable kernel between reasoning components and
40
+ external effects. It maintains typed state, links beliefs to evidence, applies
41
+ declarative constraints, and records why each proposal was committed or
42
+ invalidated. The kernel contains no model, prompt, tool, task, or domain logic.
43
+
44
+ ## Install
45
+
46
+ The Python distribution is named `alethic-kernel`; its single import namespace
47
+ is `alethic`.
48
+
49
+ ```bash
50
+ pip install alethic-kernel
51
+ ```
52
+
53
+ ## Use
54
+
55
+ ```python
56
+ from alethic import Kernel
57
+
58
+ kernel = Kernel()
59
+ trace = "episode-001"
60
+
61
+ kernel.write(
62
+ "tool",
63
+ "percepts",
64
+ "COMMIT",
65
+ "observation",
66
+ {"value": 42, "stale": False, "conflict": False},
67
+ trace,
68
+ confidence=0.9,
69
+ )
70
+
71
+ proposal = kernel.write(
72
+ "planner",
73
+ "beliefs",
74
+ "PROPOSE",
75
+ "threshold_reached",
76
+ {"value": True, "depends_on": ["observation"]},
77
+ trace,
78
+ input_refs=["observation"],
79
+ )
80
+
81
+ committed, reason = kernel.commit_belief_from_proposal(proposal.id, trace)
82
+ print(committed, reason)
83
+ ```
84
+
85
+ Every worker can propose. Only the kernel can commit. State lives in seven
86
+ semantic slots: percepts, beliefs, constraints, plans, evidence, predictions,
87
+ and actions.
88
+
89
+ ## What belongs here
90
+
91
+ This repository contains only the domain-neutral Alethic substrate:
92
+
93
+ - the governed blackboard kernel and typed record schema;
94
+ - evidence, confidence, conflict, constraint, and prediction validation;
95
+ - in-memory and SQLite stores;
96
+ - worker orchestration, sessions, simulation, and adaptive constraints;
97
+ - tests, architectural documentation, and a domain-neutral example.
98
+
99
+ The controlled study, results, and verification artifacts live separately in
100
+ [governed-cognition](https://github.com/emiluzelac/governed-cognition).
101
+
102
+ ## Documentation
103
+
104
+ - [Architecture](docs/architecture.md)
105
+ - [API reference](docs/api-reference.md)
106
+ - [Workers](docs/workers.md)
107
+ - [Research paper](https://doi.org/10.5281/zenodo.18691808)
108
+
109
+ ## Source layout
110
+
111
+ The repository name is Alethic exactly once. Setuptools maps `src/` directly to
112
+ the installed `alethic` namespace.
113
+
114
+ ```text
115
+ src/
116
+ __init__.py
117
+ kernel.py
118
+ schema.py
119
+ permissions.py
120
+ validators.py
121
+ store.py
122
+ sqlite_store.py
123
+ worker.py
124
+ orchestrator.py
125
+ session.py
126
+ sim_worker.py
127
+ adaptive_worker.py
128
+ ```
129
+
130
+ ## Development
131
+
132
+ ```bash
133
+ python -m pip install -e ".[dev]"
134
+ pytest
135
+ mypy --strict src
136
+ ```
137
+
138
+ ## License
139
+
140
+ MIT © Emil Uzelac
@@ -0,0 +1,51 @@
1
+ CHANGELOG.md
2
+ CODE_OF_CONDUCT.md
3
+ CONTRIBUTING.md
4
+ LICENSE
5
+ MANIFEST.in
6
+ README.md
7
+ SECURITY.md
8
+ pyproject.toml
9
+ alethic_kernel.egg-info/PKG-INFO
10
+ alethic_kernel.egg-info/SOURCES.txt
11
+ alethic_kernel.egg-info/dependency_links.txt
12
+ alethic_kernel.egg-info/requires.txt
13
+ alethic_kernel.egg-info/top_level.txt
14
+ docs/api-reference.md
15
+ docs/architecture.md
16
+ docs/architecture.png
17
+ docs/workers.md
18
+ src/__init__.py
19
+ src/adaptive_worker.py
20
+ src/kernel.py
21
+ src/migrations.py
22
+ src/orchestrator.py
23
+ src/permissions.py
24
+ src/py.typed
25
+ src/schema.py
26
+ src/session.py
27
+ src/sim_worker.py
28
+ src/sqlite_store.py
29
+ src/store.py
30
+ src/store_protocol.py
31
+ src/validators.py
32
+ src/worker.py
33
+ tests/__init__.py
34
+ tests/conftest.py
35
+ tests/helpers.py
36
+ tests/test_adaptive_worker.py
37
+ tests/test_atomicity.py
38
+ tests/test_concurrency.py
39
+ tests/test_kernel.py
40
+ tests/test_migrations.py
41
+ tests/test_orchestrator.py
42
+ tests/test_package_api.py
43
+ tests/test_permissions.py
44
+ tests/test_readme_assets.py
45
+ tests/test_schema.py
46
+ tests/test_session.py
47
+ tests/test_sim_worker.py
48
+ tests/test_sqlite_store.py
49
+ tests/test_store.py
50
+ tests/test_store_equivalence.py
51
+ tests/test_validators.py
@@ -0,0 +1,5 @@
1
+
2
+ [dev]
3
+ pytest>=8.0
4
+ pytest-cov
5
+ mypy
@@ -4,7 +4,7 @@ Complete reference for all public classes and methods in the `alethic` package.
4
4
 
5
5
  ## Kernel
6
6
 
7
- `alethic_kernel.alethic.kernel.Kernel` — The central orchestrator. Manages the blackboard, enforces permissions, and runs validation pipelines.
7
+ `alethic.kernel.Kernel` — The central orchestrator. Manages the blackboard, enforces permissions, and runs validation pipelines.
8
8
 
9
9
  ### Constructor
10
10
 
@@ -164,7 +164,7 @@ Validate and commit an action proposal. Optionally gates on predictions.
164
164
 
165
165
  ### `Record`
166
166
 
167
- `alethic_kernel.alethic.schema.Record` — A single entry on the blackboard.
167
+ `alethic.schema.Record` — A single entry on the blackboard.
168
168
 
169
169
  ```python
170
170
  @dataclass
@@ -183,7 +183,7 @@ class Record:
183
183
 
184
184
  ### `Provenance`
185
185
 
186
- `alethic_kernel.alethic.schema.Provenance` — Metadata attached to every record.
186
+ `alethic.schema.Provenance` — Metadata attached to every record.
187
187
 
188
188
  ```python
189
189
  @dataclass
@@ -209,7 +209,7 @@ WriteMode = Literal["PROPOSE", "COMMIT"]
209
209
 
210
210
  ### `StoreProtocol`
211
211
 
212
- `alethic_kernel.alethic.store_protocol.StoreProtocol` — Interface that any backing store must satisfy. Decorated with `@runtime_checkable`.
212
+ `alethic.store_protocol.StoreProtocol` — Interface that any backing store must satisfy. Decorated with `@runtime_checkable`.
213
213
 
214
214
  | Method | Signature | Description |
215
215
  |--------|-----------|-------------|
@@ -218,17 +218,18 @@ WriteMode = Literal["PROPOSE", "COMMIT"]
218
218
  | `list_slot` | `(slot: Slot) -> List[Record]` | All records in a slot (checks TTL) |
219
219
  | `find_active_by_kind` | `(slot: Slot, kind: str, trace_id: str) -> Optional[Record]` | Find active record by kind+trace |
220
220
  | `invalidate` | `(rec_id: str, reason: str) -> None` | Mark record as INVALIDATED |
221
+ | `transaction` | `() -> ContextManager[None]` | Make a validation-and-commit sequence atomic |
221
222
  | `close` | `() -> None` | Release resources (e.g., close database connection) |
222
223
 
223
224
  ### `MemoryStore`
224
225
 
225
- `alethic_kernel.alethic.store.MemoryStore` — In-process thread-safe store. Implements `StoreProtocol`. Uses `threading.RLock` for concurrency.
226
+ `alethic.store.MemoryStore` — In-process thread-safe store. Implements `StoreProtocol`. Uses `threading.RLock` for concurrency.
226
227
 
227
228
  Constructor: `MemoryStore()` — no parameters.
228
229
 
229
230
  ### `SqliteStore`
230
231
 
231
- `alethic_kernel.alethic.sqlite_store.SqliteStore` — SQLite-backed persistent store. WAL mode, indexed queries.
232
+ `alethic.sqlite_store.SqliteStore` — SQLite-backed persistent store. WAL mode, indexed queries.
232
233
 
233
234
  Constructor:
234
235
 
@@ -251,7 +252,7 @@ Implements all `StoreProtocol` methods plus:
251
252
 
252
253
  ### `ValidationResult`
253
254
 
254
- `alethic_kernel.alethic.validators.ValidationResult` — Result of a validation check.
255
+ `alethic.validators.ValidationResult` — Result of a validation check.
255
256
 
256
257
  ```python
257
258
  @dataclass
@@ -264,7 +265,7 @@ class ValidationResult:
264
265
 
265
266
  ### `EvidenceValidator`
266
267
 
267
- `alethic_kernel.alethic.validators.EvidenceValidator` — Checks whether beliefs are supported by evidence.
268
+ `alethic.validators.EvidenceValidator` — Checks whether beliefs are supported by evidence.
268
269
 
269
270
  | Method | Signature | Description |
270
271
  |--------|-----------|-------------|
@@ -274,7 +275,7 @@ Codes: `OK`, `MISSING_EVIDENCE`, `STALE_EVIDENCE`, `CONFLICTING_EVIDENCE`
274
275
 
275
276
  ### `SymbolicValidator`
276
277
 
277
- `alethic_kernel.alethic.validators.SymbolicValidator` — Checks whether actions satisfy beliefs and constraints.
278
+ `alethic.validators.SymbolicValidator` — Checks whether actions satisfy beliefs and constraints.
278
279
 
279
280
  | Method | Signature | Description |
280
281
  |--------|-----------|-------------|
@@ -294,7 +295,7 @@ Role = Literal["kernel", "tool", "planner", "symbolic_validator", "evidence_vali
294
295
 
295
296
  ### `PERMISSIONS`
296
297
 
297
- `alethic_kernel.alethic.permissions.PERMISSIONS` — Maps each role to its allowed slot+mode combinations.
298
+ `alethic.permissions.PERMISSIONS` — Maps each role to its allowed slot+mode combinations.
298
299
 
299
300
  | Role | percepts | beliefs | constraints | plans | evidence | predictions | actions |
300
301
  |------|----------|---------|-------------|-------|----------|-------------|---------|
@@ -309,7 +310,7 @@ Role = Literal["kernel", "tool", "planner", "symbolic_validator", "evidence_vali
309
310
 
310
311
  ## Session
311
312
 
312
- `alethic_kernel.alethic.session.Session` — Groups multiple episodes under a single persistent context.
313
+ `alethic.session.Session` — Groups multiple episodes under a single persistent context.
313
314
 
314
315
  ```python
315
316
  @dataclass