alethic-kernel 0.1.0__tar.gz → 0.2.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 (105) hide show
  1. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/CHANGELOG.md +11 -0
  2. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/CONTRIBUTING.md +4 -9
  3. {alethic_kernel-0.1.0/alethic_kernel.egg-info → alethic_kernel-0.2.0}/PKG-INFO +33 -38
  4. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/README.md +28 -33
  5. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/SECURITY.md +1 -1
  6. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/api-reference.md +11 -11
  7. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/architecture.md +2 -2
  8. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/benchmark.md +2 -2
  9. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/deployment.md +1 -1
  10. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/http-api.md +4 -4
  11. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/workers.md +7 -7
  12. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/pyproject.toml +11 -22
  13. alethic_kernel-0.2.0/src/alethic_kernel/__init__.py +49 -0
  14. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/agents/alethic_agent.py +1 -1
  15. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/agents/llm_agent.py +1 -1
  16. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/api/routes.py +5 -5
  17. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/client.py +5 -5
  18. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/eval/harness.py +1 -1
  19. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/run.py +2 -2
  20. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel.egg-info}/PKG-INFO +33 -38
  21. alethic_kernel-0.2.0/src/alethic_kernel.egg-info/SOURCES.txt +97 -0
  22. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/conftest.py +3 -3
  23. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/helpers.py +1 -1
  24. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_adaptive_worker.py +4 -4
  25. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_agent_integration.py +1 -1
  26. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_agent_llm_mock.py +1 -1
  27. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_api.py +2 -2
  28. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_atomicity.py +5 -5
  29. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_benchmark_invariants.py +2 -1
  30. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_cli.py +4 -4
  31. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_client.py +2 -2
  32. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_concurrency.py +4 -4
  33. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_coverage_gaps.py +13 -13
  34. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_e2e_pipeline.py +2 -2
  35. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_kernel.py +4 -4
  36. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_migrations.py +2 -2
  37. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_orchestrator.py +5 -5
  38. alethic_kernel-0.2.0/tests/test_package_api.py +22 -0
  39. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_permissions.py +1 -1
  40. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_readme_assets.py +1 -1
  41. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_report.py +1 -1
  42. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_schema.py +1 -1
  43. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_session.py +2 -2
  44. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_sim_worker.py +3 -3
  45. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_sqlite_store.py +2 -2
  46. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_store.py +2 -2
  47. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_store_equivalence.py +2 -2
  48. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_stress.py +17 -18
  49. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/tests/test_validators.py +1 -1
  50. alethic_kernel-0.1.0/__init__.py +0 -9
  51. alethic_kernel-0.1.0/alethic/__init__.py +0 -13
  52. alethic_kernel-0.1.0/alethic_kernel.egg-info/SOURCES.txt +0 -149
  53. alethic_kernel-0.1.0/examples/demo.py +0 -472
  54. alethic_kernel-0.1.0/examples/multi_episode.py +0 -263
  55. alethic_kernel-0.1.0/py.typed +0 -0
  56. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/CODE_OF_CONDUCT.md +0 -0
  57. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/LICENSE +0 -0
  58. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/MANIFEST.in +0 -0
  59. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/architecture.png +0 -0
  60. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/superpowers/plans/2026-07-16-alethic-dev.md +0 -0
  61. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/docs/superpowers/specs/2026-07-16-alethic-dev-design.md +0 -0
  62. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0}/setup.cfg +0 -0
  63. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/adaptive_worker.py +0 -0
  64. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/agents/__init__.py +0 -0
  65. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/agents/json_glue.py +0 -0
  66. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/agents/string_glue.py +0 -0
  67. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/api/__init__.py +0 -0
  68. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/api/app.py +0 -0
  69. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/api/dependencies.py +0 -0
  70. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/api/models.py +0 -0
  71. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/api/tracing.py +0 -0
  72. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/eval/__init__.py +0 -0
  73. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/eval/metrics.py +0 -0
  74. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/eval/report.py +0 -0
  75. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/eval/task_loader.py +0 -0
  76. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/kernel.py +0 -0
  77. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/llm/__init__.py +0 -0
  78. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/llm/planner.py +0 -0
  79. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/migrations.py +0 -0
  80. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/orchestrator.py +0 -0
  81. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/permissions.py +0 -0
  82. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/py.typed +0 -0
  83. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/schema.py +0 -0
  84. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/session.py +0 -0
  85. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/sim_worker.py +0 -0
  86. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/sqlite_store.py +0 -0
  87. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/store.py +0 -0
  88. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/store_protocol.py +0 -0
  89. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tasks/stripe_refund_clean.yaml +0 -0
  90. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tasks/stripe_refund_combined.yaml +0 -0
  91. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tasks/stripe_refund_conflict.yaml +0 -0
  92. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tasks/stripe_refund_duplicate.yaml +0 -0
  93. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tasks/stripe_refund_stale.yaml +0 -0
  94. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tasks/stripe_refund_tool_failure.yaml +0 -0
  95. {alethic_kernel-0.1.0/tests → alethic_kernel-0.2.0/src/alethic_kernel/tools}/__init__.py +0 -0
  96. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tools/payment_tool.py +0 -0
  97. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tools/perturb.py +0 -0
  98. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src/alethic_kernel}/tools/refund_tool.py +0 -0
  99. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/validators.py +0 -0
  100. {alethic_kernel-0.1.0/alethic → alethic_kernel-0.2.0/src/alethic_kernel}/worker.py +0 -0
  101. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src}/alethic_kernel.egg-info/dependency_links.txt +0 -0
  102. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src}/alethic_kernel.egg-info/entry_points.txt +0 -0
  103. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src}/alethic_kernel.egg-info/requires.txt +0 -0
  104. {alethic_kernel-0.1.0 → alethic_kernel-0.2.0/src}/alethic_kernel.egg-info/top_level.txt +0 -0
  105. {alethic_kernel-0.1.0/tools → alethic_kernel-0.2.0/tests}/__init__.py +0 -0
@@ -5,6 +5,17 @@ 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.2.0] - 2026-07-18
9
+
10
+ ### Changed
11
+
12
+ - Flattened the public Python namespace from `alethic_kernel.alethic` to
13
+ `alethic_kernel`.
14
+ - Moved the installable package into the conventional `src/alethic_kernel`
15
+ layout.
16
+ - Renamed the source repository to `alethicdev/alethic-kernel` so the GitHub,
17
+ PyPI, and Python package names describe the same artifact.
18
+
8
19
  ## [0.1.0] - 2026-07-16
9
20
 
10
21
  ### Added
@@ -18,8 +18,8 @@ Be respectful, inclusive, and professional. We're building trust in AI systems t
18
18
 
19
19
  1. **Fork and branch**
20
20
  ```bash
21
- git clone https://github.com/YOUR_USERNAME/alethic.git
22
- cd alethic
21
+ git clone https://github.com/YOUR_USERNAME/alethic-kernel.git
22
+ cd alethic-kernel
23
23
  git checkout -b feature/your-feature-name
24
24
  ```
25
25
 
@@ -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 -p alethic_kernel
41
41
  ```
42
42
 
43
43
  5. **Commit with clear messages**
@@ -83,12 +83,7 @@ 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)
86
+ src/alethic_kernel/ Installable package (kernel, API, agents, and evaluation)
92
87
  tests/ Test suite (349 tests)
93
88
  docs/ Documentation
94
89
  examples/ Multi-episode demo
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alethic-kernel
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A governed cognition framework for AI systems
5
5
  Author: Emil Uzelac
6
6
  License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/alethicdev/alethic
8
- Project-URL: Documentation, https://github.com/alethicdev/alethic#documentation
9
- Project-URL: Repository, https://github.com/alethicdev/alethic.git
10
- Project-URL: Bug Tracker, https://github.com/alethicdev/alethic/issues
7
+ Project-URL: Homepage, https://github.com/alethicdev/alethic-kernel
8
+ Project-URL: Documentation, https://github.com/alethicdev/alethic-kernel#documentation
9
+ Project-URL: Repository, https://github.com/alethicdev/alethic-kernel.git
10
+ Project-URL: Bug Tracker, https://github.com/alethicdev/alethic-kernel/issues
11
11
  Project-URL: Research Paper, https://doi.org/10.5281/zenodo.18691808
12
12
  Keywords: ai,governance,agents,blackboard-kernel,orchestration,safety
13
13
  Classifier: Development Status :: 3 - Alpha
@@ -52,7 +52,7 @@ The core insight: architectural governance — not model scale — is the primar
52
52
  <!-- Absolute: PyPI renders this README with no repository to resolve a
53
53
  relative path against. Safe now that the repo is public — GitHub fetches
54
54
  README images anonymously, which is why this had to stay relative before. -->
55
- <img src="https://raw.githubusercontent.com/alethicdev/alethic/main/docs/architecture.png" alt="Blackboard Kernel Architecture" width="720">
55
+ <img src="https://raw.githubusercontent.com/alethicdev/alethic-kernel/main/docs/architecture.png" alt="Blackboard Kernel Architecture" width="720">
56
56
  </p>
57
57
 
58
58
  Seven semantic slots hold all state. Workers read from and write to the kernel using two modes: **PROPOSE** (tentative, must pass validation) and **COMMIT** (finalized). Every proposal passes through the kernel's validation pipelines — stale evidence, missing percepts, constraint violations, and negative predictions all cause rejection, not action.
@@ -66,7 +66,7 @@ pip install alethic-kernel
66
66
  ### Use as a library
67
67
 
68
68
  ```python
69
- from alethic_kernel.alethic import AlethicClient
69
+ from alethic_kernel import AlethicClient
70
70
 
71
71
  client = AlethicClient(mode="local")
72
72
  result = client.run_episode(task_inputs={
@@ -117,41 +117,36 @@ The kernel-backed agents (`alethic` and `llm_bk`) achieve **zero unsafe actions*
117
117
 
118
118
  ## Documentation
119
119
 
120
- - **[Architecture](https://github.com/alethicdev/alethic/blob/main/docs/architecture.md)** — Blackboard kernel design, semantic slots, validation pipelines
121
- - **[API Reference](https://github.com/alethicdev/alethic/blob/main/docs/api-reference.md)** — Every public class and method with signatures and return codes
122
- - **[Workers](https://github.com/alethicdev/alethic/blob/main/docs/workers.md)** — Worker protocol, built-in workers, writing custom workers
123
- - **[HTTP API](https://github.com/alethicdev/alethic/blob/main/docs/http-api.md)** — REST endpoints, AlethicClient SDK, OpenTelemetry
124
- - **[Benchmark](https://github.com/alethicdev/alethic/blob/main/docs/benchmark.md)** — Tasks, perturbations, metrics, CLI reference
125
- - **[Deployment](https://github.com/alethicdev/alethic/blob/main/docs/deployment.md)** — Docker, environment variables, store selection, testing
120
+ - **[Architecture](https://github.com/alethicdev/alethic-kernel/blob/main/docs/architecture.md)** — Blackboard kernel design, semantic slots, validation pipelines
121
+ - **[API Reference](https://github.com/alethicdev/alethic-kernel/blob/main/docs/api-reference.md)** — Every public class and method with signatures and return codes
122
+ - **[Workers](https://github.com/alethicdev/alethic-kernel/blob/main/docs/workers.md)** — Worker protocol, built-in workers, writing custom workers
123
+ - **[HTTP API](https://github.com/alethicdev/alethic-kernel/blob/main/docs/http-api.md)** — REST endpoints, AlethicClient SDK, OpenTelemetry
124
+ - **[Benchmark](https://github.com/alethicdev/alethic-kernel/blob/main/docs/benchmark.md)** — Tasks, perturbations, metrics, CLI reference
125
+ - **[Deployment](https://github.com/alethicdev/alethic-kernel/blob/main/docs/deployment.md)** — Docker, environment variables, store selection, testing
126
126
 
127
127
  ## Project Structure
128
128
 
129
129
  ```
130
- alethic/ Core kernel (domain-agnostic)
131
- kernel.py Blackboard kernel — central orchestrator
132
- schema.py Record, Provenance, Slot, WriteMode
133
- validators.py Evidence and symbolic validation
134
- store.py In-memory store
135
- sqlite_store.py SQLite-backed persistent store
136
- orchestrator.py Worker round-robin loop
137
- sim_worker.py Rule-based forward simulator
138
- adaptive_worker.py Learns constraints from failure patterns
139
- session.py Multi-episode session management
140
- client.py AlethicClient (local + HTTP modes)
141
- api/ FastAPI server
142
- agents/ Four agents of increasing sophistication
143
- string_glue.py Baseline: always acts, no validation
144
- json_glue.py Adds confidence scores, still always acts
145
- alethic_agent.py Full kernel with deterministic planner
146
- llm_agent.py Full kernel with LLM planner
147
- eval/ Evaluation framework
148
- harness.py Task x seed x agent runner
149
- metrics.py 5 safety and traceability metrics
150
- report.py Markdown report generation
151
- tools/ Simulated tools with perturbations
152
- tasks/ 6 Stripe refund task definitions (YAML)
153
- examples/ Multi-episode demo with adaptive learning
154
- results/ Benchmark outputs (JSONL + report)
130
+ src/alethic_kernel/ Installable Python package
131
+ kernel.py Blackboard kernel — central orchestrator
132
+ schema.py Record, Provenance, Slot, WriteMode
133
+ validators.py Evidence and symbolic validation
134
+ store.py In-memory store
135
+ sqlite_store.py SQLite-backed persistent store
136
+ orchestrator.py Worker round-robin loop
137
+ sim_worker.py Rule-based forward simulator
138
+ adaptive_worker.py Learns constraints from failure patterns
139
+ session.py Multi-episode session management
140
+ client.py AlethicClient (local + HTTP modes)
141
+ api/ FastAPI server
142
+ agents/ Four reference agents
143
+ eval/ Evaluation harness and metrics
144
+ llm/ OpenAI-compatible planner
145
+ tools/ Simulated tools with perturbations
146
+ tasks/ 6 Stripe refund task definitions (YAML)
147
+ examples/ Multi-episode demos
148
+ tests/ Test suite
149
+ docs/ Architecture, API, and deployment guides
155
150
  ```
156
151
 
157
152
  ## Research Paper
@@ -16,7 +16,7 @@ The core insight: architectural governance — not model scale — is the primar
16
16
  <!-- Absolute: PyPI renders this README with no repository to resolve a
17
17
  relative path against. Safe now that the repo is public — GitHub fetches
18
18
  README images anonymously, which is why this had to stay relative before. -->
19
- <img src="https://raw.githubusercontent.com/alethicdev/alethic/main/docs/architecture.png" alt="Blackboard Kernel Architecture" width="720">
19
+ <img src="https://raw.githubusercontent.com/alethicdev/alethic-kernel/main/docs/architecture.png" alt="Blackboard Kernel Architecture" width="720">
20
20
  </p>
21
21
 
22
22
  Seven semantic slots hold all state. Workers read from and write to the kernel using two modes: **PROPOSE** (tentative, must pass validation) and **COMMIT** (finalized). Every proposal passes through the kernel's validation pipelines — stale evidence, missing percepts, constraint violations, and negative predictions all cause rejection, not action.
@@ -30,7 +30,7 @@ pip install alethic-kernel
30
30
  ### Use as a library
31
31
 
32
32
  ```python
33
- from alethic_kernel.alethic import AlethicClient
33
+ from alethic_kernel import AlethicClient
34
34
 
35
35
  client = AlethicClient(mode="local")
36
36
  result = client.run_episode(task_inputs={
@@ -81,41 +81,36 @@ The kernel-backed agents (`alethic` and `llm_bk`) achieve **zero unsafe actions*
81
81
 
82
82
  ## Documentation
83
83
 
84
- - **[Architecture](https://github.com/alethicdev/alethic/blob/main/docs/architecture.md)** — Blackboard kernel design, semantic slots, validation pipelines
85
- - **[API Reference](https://github.com/alethicdev/alethic/blob/main/docs/api-reference.md)** — Every public class and method with signatures and return codes
86
- - **[Workers](https://github.com/alethicdev/alethic/blob/main/docs/workers.md)** — Worker protocol, built-in workers, writing custom workers
87
- - **[HTTP API](https://github.com/alethicdev/alethic/blob/main/docs/http-api.md)** — REST endpoints, AlethicClient SDK, OpenTelemetry
88
- - **[Benchmark](https://github.com/alethicdev/alethic/blob/main/docs/benchmark.md)** — Tasks, perturbations, metrics, CLI reference
89
- - **[Deployment](https://github.com/alethicdev/alethic/blob/main/docs/deployment.md)** — Docker, environment variables, store selection, testing
84
+ - **[Architecture](https://github.com/alethicdev/alethic-kernel/blob/main/docs/architecture.md)** — Blackboard kernel design, semantic slots, validation pipelines
85
+ - **[API Reference](https://github.com/alethicdev/alethic-kernel/blob/main/docs/api-reference.md)** — Every public class and method with signatures and return codes
86
+ - **[Workers](https://github.com/alethicdev/alethic-kernel/blob/main/docs/workers.md)** — Worker protocol, built-in workers, writing custom workers
87
+ - **[HTTP API](https://github.com/alethicdev/alethic-kernel/blob/main/docs/http-api.md)** — REST endpoints, AlethicClient SDK, OpenTelemetry
88
+ - **[Benchmark](https://github.com/alethicdev/alethic-kernel/blob/main/docs/benchmark.md)** — Tasks, perturbations, metrics, CLI reference
89
+ - **[Deployment](https://github.com/alethicdev/alethic-kernel/blob/main/docs/deployment.md)** — Docker, environment variables, store selection, testing
90
90
 
91
91
  ## Project Structure
92
92
 
93
93
  ```
94
- alethic/ Core kernel (domain-agnostic)
95
- kernel.py Blackboard kernel — central orchestrator
96
- schema.py Record, Provenance, Slot, WriteMode
97
- validators.py Evidence and symbolic validation
98
- store.py In-memory store
99
- sqlite_store.py SQLite-backed persistent store
100
- orchestrator.py Worker round-robin loop
101
- sim_worker.py Rule-based forward simulator
102
- adaptive_worker.py Learns constraints from failure patterns
103
- session.py Multi-episode session management
104
- client.py AlethicClient (local + HTTP modes)
105
- api/ FastAPI server
106
- agents/ Four agents of increasing sophistication
107
- string_glue.py Baseline: always acts, no validation
108
- json_glue.py Adds confidence scores, still always acts
109
- alethic_agent.py Full kernel with deterministic planner
110
- llm_agent.py Full kernel with LLM planner
111
- eval/ Evaluation framework
112
- harness.py Task x seed x agent runner
113
- metrics.py 5 safety and traceability metrics
114
- report.py Markdown report generation
115
- tools/ Simulated tools with perturbations
116
- tasks/ 6 Stripe refund task definitions (YAML)
117
- examples/ Multi-episode demo with adaptive learning
118
- results/ Benchmark outputs (JSONL + report)
94
+ src/alethic_kernel/ Installable Python package
95
+ kernel.py Blackboard kernel — central orchestrator
96
+ schema.py Record, Provenance, Slot, WriteMode
97
+ validators.py Evidence and symbolic validation
98
+ store.py In-memory store
99
+ sqlite_store.py SQLite-backed persistent store
100
+ orchestrator.py Worker round-robin loop
101
+ sim_worker.py Rule-based forward simulator
102
+ adaptive_worker.py Learns constraints from failure patterns
103
+ session.py Multi-episode session management
104
+ client.py AlethicClient (local + HTTP modes)
105
+ api/ FastAPI server
106
+ agents/ Four reference agents
107
+ eval/ Evaluation harness and metrics
108
+ llm/ OpenAI-compatible planner
109
+ tools/ Simulated tools with perturbations
110
+ tasks/ 6 Stripe refund task definitions (YAML)
111
+ examples/ Multi-episode demos
112
+ tests/ Test suite
113
+ docs/ Architecture, API, and deployment guides
119
114
  ```
120
115
 
121
116
  ## Research Paper
@@ -29,7 +29,7 @@ welcome, as issues or pull requests.
29
29
 
30
30
  ### The HTTP API is unauthenticated
31
31
 
32
- The FastAPI service under `alethic/api/` is a development and evaluation tool.
32
+ The FastAPI service under `src/alethic_kernel/api/` is a development and evaluation tool.
33
33
  It has no authentication or authorization, every caller shares one kernel, and
34
34
  `role` is read from the request body — so a client can claim the `kernel` role
35
35
  and commit without validation. `trace_id` namespaces state but does not isolate
@@ -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.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_kernel.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_kernel.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_kernel.store_protocol.StoreProtocol` — Interface that any backing store must satisfy. Decorated with `@runtime_checkable`.
213
213
 
214
214
  | Method | Signature | Description |
215
215
  |--------|-----------|-------------|
@@ -222,13 +222,13 @@ WriteMode = Literal["PROPOSE", "COMMIT"]
222
222
 
223
223
  ### `MemoryStore`
224
224
 
225
- `alethic_kernel.alethic.store.MemoryStore` — In-process thread-safe store. Implements `StoreProtocol`. Uses `threading.RLock` for concurrency.
225
+ `alethic_kernel.store.MemoryStore` — In-process thread-safe store. Implements `StoreProtocol`. Uses `threading.RLock` for concurrency.
226
226
 
227
227
  Constructor: `MemoryStore()` — no parameters.
228
228
 
229
229
  ### `SqliteStore`
230
230
 
231
- `alethic_kernel.alethic.sqlite_store.SqliteStore` — SQLite-backed persistent store. WAL mode, indexed queries.
231
+ `alethic_kernel.sqlite_store.SqliteStore` — SQLite-backed persistent store. WAL mode, indexed queries.
232
232
 
233
233
  Constructor:
234
234
 
@@ -251,7 +251,7 @@ Implements all `StoreProtocol` methods plus:
251
251
 
252
252
  ### `ValidationResult`
253
253
 
254
- `alethic_kernel.alethic.validators.ValidationResult` — Result of a validation check.
254
+ `alethic_kernel.validators.ValidationResult` — Result of a validation check.
255
255
 
256
256
  ```python
257
257
  @dataclass
@@ -264,7 +264,7 @@ class ValidationResult:
264
264
 
265
265
  ### `EvidenceValidator`
266
266
 
267
- `alethic_kernel.alethic.validators.EvidenceValidator` — Checks whether beliefs are supported by evidence.
267
+ `alethic_kernel.validators.EvidenceValidator` — Checks whether beliefs are supported by evidence.
268
268
 
269
269
  | Method | Signature | Description |
270
270
  |--------|-----------|-------------|
@@ -274,7 +274,7 @@ Codes: `OK`, `MISSING_EVIDENCE`, `STALE_EVIDENCE`, `CONFLICTING_EVIDENCE`
274
274
 
275
275
  ### `SymbolicValidator`
276
276
 
277
- `alethic_kernel.alethic.validators.SymbolicValidator` — Checks whether actions satisfy beliefs and constraints.
277
+ `alethic_kernel.validators.SymbolicValidator` — Checks whether actions satisfy beliefs and constraints.
278
278
 
279
279
  | Method | Signature | Description |
280
280
  |--------|-----------|-------------|
@@ -294,7 +294,7 @@ Role = Literal["kernel", "tool", "planner", "symbolic_validator", "evidence_vali
294
294
 
295
295
  ### `PERMISSIONS`
296
296
 
297
- `alethic_kernel.alethic.permissions.PERMISSIONS` — Maps each role to its allowed slot+mode combinations.
297
+ `alethic_kernel.permissions.PERMISSIONS` — Maps each role to its allowed slot+mode combinations.
298
298
 
299
299
  | Role | percepts | beliefs | constraints | plans | evidence | predictions | actions |
300
300
  |------|----------|---------|-------------|-------|----------|-------------|---------|
@@ -309,7 +309,7 @@ Role = Literal["kernel", "tool", "planner", "symbolic_validator", "evidence_vali
309
309
 
310
310
  ## Session
311
311
 
312
- `alethic_kernel.alethic.session.Session` — Groups multiple episodes under a single persistent context.
312
+ `alethic_kernel.session.Session` — Groups multiple episodes under a single persistent context.
313
313
 
314
314
  ```python
315
315
  @dataclass
@@ -135,8 +135,8 @@ store must guarantee.
135
135
  Pass a store to the kernel constructor:
136
136
 
137
137
  ```python
138
- from alethic_kernel.alethic.kernel import Kernel
139
- from alethic_kernel.alethic.sqlite_store import SqliteStore
138
+ from alethic_kernel.kernel import Kernel
139
+ from alethic_kernel.sqlite_store import SqliteStore
140
140
 
141
141
  store = SqliteStore("blackboard.db")
142
142
  kernel = Kernel(store=store)
@@ -26,7 +26,7 @@ Six Stripe payment refund tasks exercise different failure modes:
26
26
  | `stripe_refund_tool_failure` | Tool returns None | Handle gracefully |
27
27
  | `stripe_refund_combined` | Stale + conflict + low confidence | Block under perturbation |
28
28
 
29
- Tasks are JSON files with `.yaml` extension in `tasks/`. Each defines inputs, expected behavior, and constraints:
29
+ Tasks are JSON files with `.yaml` extension in `src/alethic_kernel/tasks/`. Each defines inputs, expected behavior, and constraints:
30
30
 
31
31
  ```json
32
32
  {
@@ -167,7 +167,7 @@ The report includes an aggregate metrics table (mean across episodes per agent)
167
167
 
168
168
  ## Writing New Tasks
169
169
 
170
- Create a JSON file with `.yaml` extension in `tasks/`:
170
+ Create a JSON file with `.yaml` extension in `src/alethic_kernel/tasks/`:
171
171
 
172
172
  ```json
173
173
  {
@@ -132,5 +132,5 @@ pytest tests/test_kernel.py -v
132
132
  pytest --cov=alethic --cov-report=term-missing
133
133
 
134
134
  # Type checking (strict mode, 0 errors across 37 source files)
135
- mypy --strict -p alethic_kernel.alethic -p alethic_kernel.llm -p alethic_kernel.agents -p alethic_kernel.eval -p alethic_kernel.tools
135
+ mypy --strict -p alethic_kernel
136
136
  ```
@@ -265,12 +265,12 @@ Response:
265
265
 
266
266
  ## AlethicClient SDK
267
267
 
268
- `alethic_kernel.alethic.AlethicClient` — Unified Python client that works identically in local and HTTP modes.
268
+ `alethic_kernel.AlethicClient` — Unified Python client that works identically in local and HTTP modes.
269
269
 
270
270
  ### Constructor
271
271
 
272
272
  ```python
273
- from alethic_kernel.alethic import AlethicClient
273
+ from alethic_kernel import AlethicClient
274
274
 
275
275
  client = AlethicClient(
276
276
  mode="local", # "local" or "http"
@@ -320,7 +320,7 @@ These mirror the kernel methods and work in both modes:
320
320
  ### Local Mode Example
321
321
 
322
322
  ```python
323
- from alethic_kernel.alethic import AlethicClient
323
+ from alethic_kernel import AlethicClient
324
324
 
325
325
  client = AlethicClient(mode="local")
326
326
 
@@ -337,7 +337,7 @@ ok, code = client.commit_belief("beliefs:ep-001:1", "ep-001")
337
337
  ### HTTP Mode Example
338
338
 
339
339
  ```python
340
- from alethic_kernel.alethic import AlethicClient
340
+ from alethic_kernel import AlethicClient
341
341
 
342
342
  client = AlethicClient(mode="http", base_url="http://localhost:8000")
343
343
 
@@ -28,7 +28,7 @@ The `writes` field determines dependency ordering — workers that write to earl
28
28
 
29
29
  ## BaseWorker
30
30
 
31
- `alethic_kernel.alethic.worker.BaseWorker` — Convenience dataclass that satisfies the `Worker` protocol with no-op defaults:
31
+ `alethic_kernel.worker.BaseWorker` — Convenience dataclass that satisfies the `Worker` protocol with no-op defaults:
32
32
 
33
33
  ```python
34
34
  @dataclass
@@ -49,7 +49,7 @@ Subclass `BaseWorker` and override `should_activate` and `step` to create custom
49
49
 
50
50
  ## SimulatorWorker
51
51
 
52
- `alethic_kernel.alethic.sim_worker.SimulatorWorker` — Evaluates declarative rules against the current blackboard view and proposes predictions through the kernel's `commit_prediction()` pipeline.
52
+ `alethic_kernel.sim_worker.SimulatorWorker` — Evaluates declarative rules against the current blackboard view and proposes predictions through the kernel's `commit_prediction()` pipeline.
53
53
 
54
54
  ### SimRule
55
55
 
@@ -80,7 +80,7 @@ Conditions use `field__op` syntax for comparisons:
80
80
  ### Example
81
81
 
82
82
  ```python
83
- from alethic_kernel.alethic.sim_worker import SimulatorWorker, SimRule
83
+ from alethic_kernel.sim_worker import SimulatorWorker, SimRule
84
84
 
85
85
  rules = [
86
86
  SimRule(
@@ -106,7 +106,7 @@ The simulator activates once beliefs exist, evaluates all rules, and proposes pr
106
106
 
107
107
  ## AdaptiveWorker
108
108
 
109
- `alethic_kernel.alethic.adaptive_worker.AdaptiveWorker` — Scans the store for invalidated records, counts failure patterns by reason code, and commits persistent constraints when a pattern exceeds a configurable threshold.
109
+ `alethic_kernel.adaptive_worker.AdaptiveWorker` — Scans the store for invalidated records, counts failure patterns by reason code, and commits persistent constraints when a pattern exceeds a configurable threshold.
110
110
 
111
111
  ```python
112
112
  adaptive = AdaptiveWorker(failure_threshold=2)
@@ -140,7 +140,7 @@ On the next orchestrator run, the worker commits any queued constraints as persi
140
140
 
141
141
  ## Orchestrator
142
142
 
143
- `alethic_kernel.alethic.orchestrator.Orchestrator` — Runs workers in dependency-sorted order until quiescence or max rounds.
143
+ `alethic_kernel.orchestrator.Orchestrator` — Runs workers in dependency-sorted order until quiescence or max rounds.
144
144
 
145
145
  ```python
146
146
  orch = Orchestrator(
@@ -178,8 +178,8 @@ Here's a complete example from the multi-episode demo — a sensor worker that c
178
178
  ```python
179
179
  from dataclasses import dataclass, field
180
180
  from typing import Any, Dict, FrozenSet
181
- from alethic_kernel.alethic.worker import BaseWorker
182
- from alethic_kernel.alethic.schema import Slot
181
+ from alethic_kernel.worker import BaseWorker
182
+ from alethic_kernel.schema import Slot
183
183
 
184
184
  @dataclass
185
185
  class SensorWorker(BaseWorker):
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "alethic-kernel"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "A governed cognition framework for AI systems"
9
9
  requires-python = ">=3.11"
10
10
  license = "MIT"
@@ -25,10 +25,10 @@ classifiers = [
25
25
  ]
26
26
 
27
27
  [project.urls]
28
- Homepage = "https://github.com/alethicdev/alethic"
29
- Documentation = "https://github.com/alethicdev/alethic#documentation"
30
- Repository = "https://github.com/alethicdev/alethic.git"
31
- "Bug Tracker" = "https://github.com/alethicdev/alethic/issues"
28
+ Homepage = "https://github.com/alethicdev/alethic-kernel"
29
+ Documentation = "https://github.com/alethicdev/alethic-kernel#documentation"
30
+ Repository = "https://github.com/alethicdev/alethic-kernel.git"
31
+ "Bug Tracker" = "https://github.com/alethicdev/alethic-kernel/issues"
32
32
  "Research Paper" = "https://doi.org/10.5281/zenodo.18691808"
33
33
 
34
34
  [project.optional-dependencies]
@@ -39,31 +39,20 @@ api = ["fastapi>=0.115", "uvicorn[standard]", "opentelemetry-api", "opentelemetr
39
39
  alethic = "alethic_kernel.run:main"
40
40
 
41
41
  [tool.setuptools]
42
- packages = [
43
- "alethic_kernel",
44
- "alethic_kernel.alethic",
45
- "alethic_kernel.alethic.api",
46
- "alethic_kernel.agents",
47
- "alethic_kernel.eval",
48
- "alethic_kernel.tools",
49
- "alethic_kernel.llm",
50
- "alethic_kernel.examples",
51
- ]
42
+ package-dir = {"" = "src"}
43
+ include-package-data = true
52
44
 
53
- [tool.setuptools.package-dir]
54
- "alethic_kernel" = "."
45
+ [tool.setuptools.packages.find]
46
+ where = ["src"]
47
+ include = ["alethic_kernel*"]
55
48
 
56
49
  [tool.setuptools.package-data]
57
50
  "alethic_kernel" = ["tasks/*.yaml", "py.typed"]
58
- "alethic_kernel.alethic" = ["py.typed"]
59
51
 
60
52
  [tool.pytest.ini_options]
61
53
  testpaths = ["tests"]
62
54
  addopts = "-v --tb=short"
63
- pythonpath = ["..", "."]
64
55
 
65
56
  [tool.mypy]
66
57
  strict = true
67
- mypy_path = ".."
68
- namespace_packages = true
69
- explicit_package_bases = true
58
+ mypy_path = "src"
@@ -0,0 +1,49 @@
1
+ """Alethic's public Python API."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version as _version
4
+
5
+ from .kernel import Kernel
6
+ from .schema import Record, Provenance, Slot, WriteMode
7
+ from .store import MemoryStore
8
+ from .store_protocol import StoreProtocol
9
+ from .sqlite_store import SqliteStore
10
+ from .permissions import PERMISSIONS, Role
11
+ from .validators import EvidenceValidator, SymbolicValidator
12
+ from .worker import Worker, BaseWorker
13
+ from .orchestrator import Orchestrator, OrchestratorResult
14
+ from .session import Session
15
+ from .sim_worker import SimulatorWorker, SimRule, evaluate_rule
16
+ from .adaptive_worker import AdaptiveWorker
17
+ from .client import AlethicClient, EpisodeResult
18
+
19
+ try:
20
+ __version__ = _version("alethic-kernel")
21
+ except PackageNotFoundError: # running from a source tree, not installed
22
+ __version__ = "0.0.0.dev0"
23
+
24
+ __all__ = [
25
+ "AdaptiveWorker",
26
+ "AlethicClient",
27
+ "BaseWorker",
28
+ "EpisodeResult",
29
+ "EvidenceValidator",
30
+ "Kernel",
31
+ "MemoryStore",
32
+ "Orchestrator",
33
+ "OrchestratorResult",
34
+ "PERMISSIONS",
35
+ "Provenance",
36
+ "Record",
37
+ "Role",
38
+ "Session",
39
+ "SimRule",
40
+ "SimulatorWorker",
41
+ "Slot",
42
+ "SqliteStore",
43
+ "StoreProtocol",
44
+ "SymbolicValidator",
45
+ "Worker",
46
+ "WriteMode",
47
+ "__version__",
48
+ "evaluate_rule",
49
+ ]
@@ -3,7 +3,7 @@ from dataclasses import dataclass
3
3
  from typing import Any, Dict
4
4
  import uuid
5
5
 
6
- from ..alethic.kernel import Kernel
6
+ from ..kernel import Kernel
7
7
  from ..tools.payment_tool import PaymentTool
8
8
  from ..tools.refund_tool import RefundTool
9
9
 
@@ -4,7 +4,7 @@ from typing import Any, Dict, Optional
4
4
  import sys
5
5
  import uuid
6
6
 
7
- from ..alethic.kernel import Kernel
7
+ from ..kernel import Kernel
8
8
  from ..tools.payment_tool import PaymentTool
9
9
  from ..tools.refund_tool import RefundTool
10
10
  from ..llm.planner import propose_belief, propose_plan, propose_action
@@ -111,11 +111,11 @@ def get_view(trace_id: str, include_persistent: bool = False) -> ViewResponse:
111
111
  @router.post("/v1/episode", response_model=EpisodeResponse)
112
112
  def run_episode(req: EpisodeRequest) -> EpisodeResponse:
113
113
  """Run a full agent episode. Creates a fresh kernel per request."""
114
- from ...tools.payment_tool import PaymentTool
115
- from ...tools.refund_tool import RefundTool
116
- from ...tools.perturb import PerturbConfig
117
- from ...agents.alethic_agent import AlethicAgent
118
- from ...eval.metrics import compute_metrics
114
+ from ..tools.payment_tool import PaymentTool
115
+ from ..tools.refund_tool import RefundTool
116
+ from ..tools.perturb import PerturbConfig
117
+ from ..agents.alethic_agent import AlethicAgent
118
+ from ..eval.metrics import compute_metrics
119
119
 
120
120
  with span("episode", agent=req.agent):
121
121
  kernel = get_ephemeral_kernel()
@@ -196,11 +196,11 @@ class AlethicClient:
196
196
  task_inputs: Dict[str, Any],
197
197
  constraints: Dict[str, Any],
198
198
  ) -> EpisodeResult:
199
- from ..tools.payment_tool import PaymentTool
200
- from ..tools.refund_tool import RefundTool
201
- from ..tools.perturb import PerturbConfig
202
- from ..agents.alethic_agent import AlethicAgent
203
- from ..eval.metrics import compute_metrics
199
+ from .tools.payment_tool import PaymentTool
200
+ from .tools.refund_tool import RefundTool
201
+ from .tools.perturb import PerturbConfig
202
+ from .agents.alethic_agent import AlethicAgent
203
+ from .eval.metrics import compute_metrics
204
204
 
205
205
  kernel = self._kernel if self._kernel is not None else Kernel()
206
206
  cfg = PerturbConfig(