jsonllm-kernel 0.1.1__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.
- jsonllm_kernel-0.1.1/PKG-INFO +117 -0
- jsonllm_kernel-0.1.1/README.md +106 -0
- jsonllm_kernel-0.1.1/pyproject.toml +37 -0
- jsonllm_kernel-0.1.1/setup.cfg +4 -0
- jsonllm_kernel-0.1.1/src/event_pipeline.py +947 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/__init__.py +6 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/conformance.py +193 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/contracts.py +332 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/module_api.py +161 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/module_loader.py +136 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/project_init.py +63 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/scaffold.py +97 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/catalog/allowed-actions.json +44 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/catalog/intent-routes.json +68 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/catalog/policy-config.json +18 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/modules/core_builtin/module.py +155 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/modules/core_builtin/module.toml +13 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/modules/math_sum/module.py +118 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel/templates/modules/math_sum/module.toml +13 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel.egg-info/PKG-INFO +117 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel.egg-info/SOURCES.txt +23 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel.egg-info/dependency_links.txt +1 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel.egg-info/entry_points.txt +2 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel.egg-info/requires.txt +5 -0
- jsonllm_kernel-0.1.1/src/jsonllm_kernel.egg-info/top_level.txt +2 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jsonllm-kernel
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Deterministic event-sourced kernel for modular LLM automation
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: openai>=1.0.0
|
|
8
|
+
Requires-Dist: pydantic>=2.0.0
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
11
|
+
|
|
12
|
+
# JSONLLM Kernel
|
|
13
|
+
|
|
14
|
+
Deterministic event-sourced kernel for modular LLM automation.
|
|
15
|
+
|
|
16
|
+
`LLM ingress -> strict events -> deterministic module policy/planner/executor -> append-only JSONL`
|
|
17
|
+
|
|
18
|
+
## What this is
|
|
19
|
+
|
|
20
|
+
- A kernel that enforces deterministic invariants (schema, lineage, provenance, idempotency).
|
|
21
|
+
- A module system where third parties implement domain logic.
|
|
22
|
+
- A self-serve workflow to scaffold and validate modules without maintainer support.
|
|
23
|
+
|
|
24
|
+
## Core guarantees
|
|
25
|
+
|
|
26
|
+
- LLM only emits `IntentNormalized` (`module_id=kernel.ingress`).
|
|
27
|
+
- Side effects run only in deterministic workers.
|
|
28
|
+
- Mandatory lineage: `IntentNormalized -> IntentAccepted/Rejected -> ActionProposed -> ActionOutcome`.
|
|
29
|
+
- `ActionProposed.action_id` must be allowlisted.
|
|
30
|
+
- `actor` authority and `module_id` provenance are validated.
|
|
31
|
+
|
|
32
|
+
## Repository layout
|
|
33
|
+
|
|
34
|
+
- `src/event_pipeline.py`: CLI orchestrator
|
|
35
|
+
- `src/jsonllm_kernel/contracts.py`: event/config contracts
|
|
36
|
+
- `src/jsonllm_kernel/module_api.py`: module SDK (`BaseModule`, types)
|
|
37
|
+
- `src/jsonllm_kernel/module_loader.py`: `module.toml` loader/validator
|
|
38
|
+
- `src/jsonllm_kernel/scaffold.py`: module scaffolding templates
|
|
39
|
+
- `src/jsonllm_kernel/conformance.py`: module conformance suite
|
|
40
|
+
- `src/jsonllm_kernel/project_init.py`: workspace bootstrap from packaged templates
|
|
41
|
+
- `src/jsonllm_kernel/templates/`: packaged default catalog and modules
|
|
42
|
+
- `modules/`: example modules
|
|
43
|
+
- `catalog/`: allowlist + security configs
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python3 -m pip install -r requirements.txt
|
|
49
|
+
export OPENAI_API_KEY="your_key"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or install as package/CLI:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python3 -m pip install -e .
|
|
56
|
+
jsonllm --help
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Start in a brand-new directory
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
mkdir /tmp/my-jsonllm-workspace
|
|
63
|
+
jsonllm init-project /tmp/my-jsonllm-workspace
|
|
64
|
+
jsonllm --workspace /tmp/my-jsonllm-workspace list-modules
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`--workspace` (or env `JSONLLM_WORKSPACE`) controls where `catalog/`, `modules/`, and `data/` are read/written.
|
|
68
|
+
|
|
69
|
+
## CLI
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
jsonllm --workspace /path/to/workspace list-modules
|
|
73
|
+
jsonllm --workspace /path/to/workspace init-module my_domain
|
|
74
|
+
jsonllm --workspace /path/to/workspace test-module --module-id my_domain
|
|
75
|
+
jsonllm --workspace /path/to/workspace new-intent --request-text "..." --aggregate-id req-1
|
|
76
|
+
jsonllm --workspace /path/to/workspace run-policy
|
|
77
|
+
jsonllm --workspace /path/to/workspace run-planner
|
|
78
|
+
jsonllm --workspace /path/to/workspace run-executor
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Equivalent while developing in this repo:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
python3 src/event_pipeline.py --workspace . list-modules
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Module self-serve workflow
|
|
88
|
+
|
|
89
|
+
1. Scaffold module:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
jsonllm --workspace /path/to/workspace init-module my_domain
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
2. Implement `policy/plan/execute` in `modules/my_domain/module.py`.
|
|
96
|
+
3. Update `modules/my_domain/module.toml` (intents/actions/permissions).
|
|
97
|
+
4. Ensure actions are in `catalog/allowed-actions.json`.
|
|
98
|
+
5. Run conformance:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
jsonllm --workspace /path/to/workspace test-module --module-id my_domain
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
6. Run end-to-end pipeline.
|
|
105
|
+
|
|
106
|
+
## Compatibility and standards
|
|
107
|
+
|
|
108
|
+
- Module API version is declared by `module_api_version` in `module.toml`.
|
|
109
|
+
- Loader rejects incompatible module API versions.
|
|
110
|
+
- See:
|
|
111
|
+
- `docs/MODULE_COMPATIBILITY.md`
|
|
112
|
+
- `docs/MODULE_COOKBOOK.md`
|
|
113
|
+
|
|
114
|
+
## Example modules
|
|
115
|
+
|
|
116
|
+
- `modules/core_builtin`: generic routes for search/extraction/classification.
|
|
117
|
+
- `modules/math_sum`: tangible deterministic computation (`math.sum.v1`) writing outputs to `data/outputs/`.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# JSONLLM Kernel
|
|
2
|
+
|
|
3
|
+
Deterministic event-sourced kernel for modular LLM automation.
|
|
4
|
+
|
|
5
|
+
`LLM ingress -> strict events -> deterministic module policy/planner/executor -> append-only JSONL`
|
|
6
|
+
|
|
7
|
+
## What this is
|
|
8
|
+
|
|
9
|
+
- A kernel that enforces deterministic invariants (schema, lineage, provenance, idempotency).
|
|
10
|
+
- A module system where third parties implement domain logic.
|
|
11
|
+
- A self-serve workflow to scaffold and validate modules without maintainer support.
|
|
12
|
+
|
|
13
|
+
## Core guarantees
|
|
14
|
+
|
|
15
|
+
- LLM only emits `IntentNormalized` (`module_id=kernel.ingress`).
|
|
16
|
+
- Side effects run only in deterministic workers.
|
|
17
|
+
- Mandatory lineage: `IntentNormalized -> IntentAccepted/Rejected -> ActionProposed -> ActionOutcome`.
|
|
18
|
+
- `ActionProposed.action_id` must be allowlisted.
|
|
19
|
+
- `actor` authority and `module_id` provenance are validated.
|
|
20
|
+
|
|
21
|
+
## Repository layout
|
|
22
|
+
|
|
23
|
+
- `src/event_pipeline.py`: CLI orchestrator
|
|
24
|
+
- `src/jsonllm_kernel/contracts.py`: event/config contracts
|
|
25
|
+
- `src/jsonllm_kernel/module_api.py`: module SDK (`BaseModule`, types)
|
|
26
|
+
- `src/jsonllm_kernel/module_loader.py`: `module.toml` loader/validator
|
|
27
|
+
- `src/jsonllm_kernel/scaffold.py`: module scaffolding templates
|
|
28
|
+
- `src/jsonllm_kernel/conformance.py`: module conformance suite
|
|
29
|
+
- `src/jsonllm_kernel/project_init.py`: workspace bootstrap from packaged templates
|
|
30
|
+
- `src/jsonllm_kernel/templates/`: packaged default catalog and modules
|
|
31
|
+
- `modules/`: example modules
|
|
32
|
+
- `catalog/`: allowlist + security configs
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 -m pip install -r requirements.txt
|
|
38
|
+
export OPENAI_API_KEY="your_key"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or install as package/CLI:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python3 -m pip install -e .
|
|
45
|
+
jsonllm --help
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Start in a brand-new directory
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
mkdir /tmp/my-jsonllm-workspace
|
|
52
|
+
jsonllm init-project /tmp/my-jsonllm-workspace
|
|
53
|
+
jsonllm --workspace /tmp/my-jsonllm-workspace list-modules
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`--workspace` (or env `JSONLLM_WORKSPACE`) controls where `catalog/`, `modules/`, and `data/` are read/written.
|
|
57
|
+
|
|
58
|
+
## CLI
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
jsonllm --workspace /path/to/workspace list-modules
|
|
62
|
+
jsonllm --workspace /path/to/workspace init-module my_domain
|
|
63
|
+
jsonllm --workspace /path/to/workspace test-module --module-id my_domain
|
|
64
|
+
jsonllm --workspace /path/to/workspace new-intent --request-text "..." --aggregate-id req-1
|
|
65
|
+
jsonllm --workspace /path/to/workspace run-policy
|
|
66
|
+
jsonllm --workspace /path/to/workspace run-planner
|
|
67
|
+
jsonllm --workspace /path/to/workspace run-executor
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Equivalent while developing in this repo:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
python3 src/event_pipeline.py --workspace . list-modules
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Module self-serve workflow
|
|
77
|
+
|
|
78
|
+
1. Scaffold module:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
jsonllm --workspace /path/to/workspace init-module my_domain
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
2. Implement `policy/plan/execute` in `modules/my_domain/module.py`.
|
|
85
|
+
3. Update `modules/my_domain/module.toml` (intents/actions/permissions).
|
|
86
|
+
4. Ensure actions are in `catalog/allowed-actions.json`.
|
|
87
|
+
5. Run conformance:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
jsonllm --workspace /path/to/workspace test-module --module-id my_domain
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
6. Run end-to-end pipeline.
|
|
94
|
+
|
|
95
|
+
## Compatibility and standards
|
|
96
|
+
|
|
97
|
+
- Module API version is declared by `module_api_version` in `module.toml`.
|
|
98
|
+
- Loader rejects incompatible module API versions.
|
|
99
|
+
- See:
|
|
100
|
+
- `docs/MODULE_COMPATIBILITY.md`
|
|
101
|
+
- `docs/MODULE_COOKBOOK.md`
|
|
102
|
+
|
|
103
|
+
## Example modules
|
|
104
|
+
|
|
105
|
+
- `modules/core_builtin`: generic routes for search/extraction/classification.
|
|
106
|
+
- `modules/math_sum`: tangible deterministic computation (`math.sum.v1`) writing outputs to `data/outputs/`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "jsonllm-kernel"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Deterministic event-sourced kernel for modular LLM automation"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"openai>=1.0.0",
|
|
13
|
+
"pydantic>=2.0.0",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[project.optional-dependencies]
|
|
17
|
+
dev = ["pytest>=8.0.0"]
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
jsonllm = "event_pipeline:main"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools]
|
|
23
|
+
package-dir = {"" = "src"}
|
|
24
|
+
py-modules = ["event_pipeline"]
|
|
25
|
+
include-package-data = true
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
28
|
+
where = ["src"]
|
|
29
|
+
include = ["jsonllm_kernel*"]
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.package-data]
|
|
32
|
+
jsonllm_kernel = [
|
|
33
|
+
"templates/*",
|
|
34
|
+
"templates/catalog/*",
|
|
35
|
+
"templates/modules/*",
|
|
36
|
+
"templates/modules/*/*",
|
|
37
|
+
]
|