odl-kernel 0.9.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.
- odl_kernel-0.9.0/LICENSE +62 -0
- odl_kernel-0.9.0/PKG-INFO +107 -0
- odl_kernel-0.9.0/README.md +86 -0
- odl_kernel-0.9.0/pyproject.toml +30 -0
- odl_kernel-0.9.0/src/odl_kernel/__init__.py +46 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/analyzer.py +474 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/expansion/__init__.py +28 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/expansion/base.py +75 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/expansion/iterate.py +183 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/expansion/loop.py +119 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/expansion/parallel.py +88 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/expansion/serial.py +103 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/introspection.py +181 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/node_id_generator.py +74 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/transition_rules.py +334 -0
- odl_kernel-0.9.0/src/odl_kernel/engine/logic/variable_resolver.py +180 -0
- odl_kernel-0.9.0/src/odl_kernel/types/__init__.py +74 -0
- odl_kernel-0.9.0/src/odl_kernel/types/entities.py +103 -0
- odl_kernel-0.9.0/src/odl_kernel/types/enums.py +49 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/__init__.py +30 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/input_intervention_intent.py +62 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/input_job_snapshot.py +32 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/input_kernel_event.py +35 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/input_kernel_event_type.py +101 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/output_analysis_result.py +33 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/output_command_type.py +115 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/output_job_update.py +27 -0
- odl_kernel-0.9.0/src/odl_kernel/types/structs/output_runtime_command.py +25 -0
odl_kernel-0.9.0/LICENSE
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters:
|
|
4
|
+
|
|
5
|
+
Licensor: Centillion System, Inc.
|
|
6
|
+
Licensed Work: The ODL Kernel Software and its associated source code,
|
|
7
|
+
as provided in this repository.
|
|
8
|
+
Change Date: Two years from the date of each version release.
|
|
9
|
+
Change License: Apache License, Version 2.0
|
|
10
|
+
Additional Use Grant:
|
|
11
|
+
|
|
12
|
+
You may make use of the Software in a production environment provided that you
|
|
13
|
+
meet ALL of the following conditions:
|
|
14
|
+
|
|
15
|
+
(a) No Managed ODL Service: You do not use the Software to provide a "Managed ODL Service"
|
|
16
|
+
to third parties. A "Managed ODL Service" is defined as any service, platform,
|
|
17
|
+
or product where the primary value proposition derives from the execution,
|
|
18
|
+
orchestration, or hosting of ODL code, OR where the capabilities, logic
|
|
19
|
+
(including the signature-based ID generation), or outputs of the Software
|
|
20
|
+
are exposed via an API or any other interface, functioning as a substitute
|
|
21
|
+
for the Software itself.
|
|
22
|
+
|
|
23
|
+
(b) Revenue Limit and Entity Scope: The total annual gross revenue of your
|
|
24
|
+
Organization (as defined below) is less than $10,000,000 USD (Ten Million
|
|
25
|
+
United States Dollars).
|
|
26
|
+
- "Organization" includes the legal entity using the Software and all of
|
|
27
|
+
its affiliates, parents, and subsidiaries.
|
|
28
|
+
- Revenue shall be calculated on a "Consolidated Basis" including all
|
|
29
|
+
entities under common "Control" (ownership of more than 50% of voting
|
|
30
|
+
interests or the power to direct management).
|
|
31
|
+
- If your Organization exceeds this threshold, you must obtain a
|
|
32
|
+
Commercial License from the Licensor.
|
|
33
|
+
|
|
34
|
+
(c) Academic and Individual Use: Notwithstanding conditions (a) and (b),
|
|
35
|
+
if you are an academic institution, non-profit research organization, or
|
|
36
|
+
an individual using the Software strictly for non-commercial research,
|
|
37
|
+
educational, or personal self-improvement purposes, you may use the
|
|
38
|
+
Software without charge.
|
|
39
|
+
|
|
40
|
+
(d) Audit Rights: Upon reasonable suspicion of non-compliance with the revenue
|
|
41
|
+
limit, the Licensor reserves the right to request, and you agree to provide,
|
|
42
|
+
official financial documentation (such as audited annual reports) to
|
|
43
|
+
verify the consolidated gross revenue of your Organization.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
License Text:
|
|
48
|
+
|
|
49
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
50
|
+
works, redistribute, and make use of the Licensed Work, provided that such
|
|
51
|
+
use is not a production use, and further provided that any such production
|
|
52
|
+
use complies with the Additional Use Grant above.
|
|
53
|
+
|
|
54
|
+
All copies of the Licensed Work and any derivative works made by you must
|
|
55
|
+
contain this license document and all copyright notices.
|
|
56
|
+
|
|
57
|
+
Effective upon the Change Date, or the fifth anniversary of the first public
|
|
58
|
+
release of the Licensed Work, whichever is earlier, the Licensor hereby
|
|
59
|
+
grants you rights under the Change License, and the restrictions set forth
|
|
60
|
+
in this License shall no longer apply.
|
|
61
|
+
|
|
62
|
+
Copyright (c) 2026 Centillion System, Inc. All rights reserved.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: odl-kernel
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: ODL (Organizational Definition Language) Execution Kernel & Physics
|
|
5
|
+
License: BUSL-1.1
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Author: Centillion System, Inc.
|
|
8
|
+
Author-email: odl@centsys.jp
|
|
9
|
+
Requires-Python: >=3.11,<4.0
|
|
10
|
+
Classifier: License :: Other/Proprietary License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Dist: odl-lang (>=0.9.0,<0.10.0)
|
|
17
|
+
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
18
|
+
Project-URL: Homepage, https://centsys.jp/
|
|
19
|
+
Project-URL: Repository, https://github.com/co-crea/odl-kernel
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# ODL Kernel
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<strong>The Physics Engine for AI Agents.</strong><br>
|
|
26
|
+
Deterministic Foundation for Probabilistic Systems.
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="#license--commercial-terms"><img src="https://img.shields.io/badge/License-BSL_1.1-orange.svg" alt="License"></a>
|
|
31
|
+
<img src="https://img.shields.io/badge/Python-3.11+-blue.svg" alt="Python Version">
|
|
32
|
+
<img src="https://img.shields.io/badge/Coverage-100%25-green.svg" alt="Coverage">
|
|
33
|
+
<img src="https://img.shields.io/badge/Determinism-UUID_v5-blueviolet.svg" alt="Determinism">
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
**The Deterministic Execution Engine for Organizational Definition Language (ODL).**
|
|
39
|
+
|
|
40
|
+
`odl-kernel` is the reference implementation of the ODL "Physics." It is a stateless, pure-functional execution engine designed to manage the lifecycle of autonomous AI agents and human-AI collaboration.
|
|
41
|
+
|
|
42
|
+
Unlike traditional workflow engines, the Kernel acts as a rigorous state machine that derives the next organizational state and necessary side effects (Commands) based on a provided `JobSnapshot` and `KernelEvent`.
|
|
43
|
+
|
|
44
|
+
## ⚛️ Core Principles
|
|
45
|
+
|
|
46
|
+
* **Functional Core:** The Kernel is side-effect-free. It does not access databases or external APIs directly; it only calculates the transition.
|
|
47
|
+
* **Deterministic Identity:** Every node is assigned a mathematically derived UUID v5 based on its structural path. This ensures that process IDs remain consistent across restarts, replays, and forks.
|
|
48
|
+
* **Deep Analyze:** The engine performs fixed-point iteration to advance states until a stable equilibrium is reached, allowing the host to observe only meaningful state changes.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
The integration follows a strict **"Load -> Analyze -> Apply"** pattern.
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import odl_kernel
|
|
58
|
+
from odl_kernel.types import JobSnapshot, KernelEvent
|
|
59
|
+
|
|
60
|
+
# 1. Prepare Input (Stateless)
|
|
61
|
+
snapshot = JobSnapshot(job=job_data, nodes=node_map)
|
|
62
|
+
event = KernelEvent(type="TICK", occurred_at=datetime.now())
|
|
63
|
+
|
|
64
|
+
# 2. Analyze (Pure Physics)
|
|
65
|
+
# The Kernel calculates the next state and required commands.
|
|
66
|
+
result = odl_kernel.analyze(snapshot, event)
|
|
67
|
+
|
|
68
|
+
# 3. Apply Output (Side Effects)
|
|
69
|
+
# The Host runtime persists updated_nodes and executes result.commands.
|
|
70
|
+
my_db.save(result.updated_nodes)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> 📖 **Deep Dive: The Physics of Execution**
|
|
74
|
+
>
|
|
75
|
+
> The code above is just the entry point. The Kernel is a stateless, pure-functional "Physics Engine" designed to run inside your application.
|
|
76
|
+
>
|
|
77
|
+
> To understand the architecture (**Functional Core / Imperative Shell**) and how to implement the **Host Runtime** (Database persistence, LLM API connections, and the Event Loop), please read the full implementation guide:
|
|
78
|
+
>
|
|
79
|
+
> **[USAGE.md: The Host Implementation Guide](./USAGE.md)**
|
|
80
|
+
|
|
81
|
+
## 🏗 Relationship with `odl-lang`
|
|
82
|
+
|
|
83
|
+
This repository provides the execution environment. To define the organizational structures and compile them into an executable format, use the **[odl-lang](https://github.com/co-crea/odl-lang)** library.
|
|
84
|
+
|
|
85
|
+
## 🌹 Dedication
|
|
86
|
+
|
|
87
|
+
**Dedicated to the memory of Prof. Kazuhisa Seta, and to all researchers who continue to push the boundaries of Knowledge Engineering in his lineage.**
|
|
88
|
+
|
|
89
|
+
## ⚖️ License & Commercial Terms
|
|
90
|
+
|
|
91
|
+
Copyright (c) 2026 Centillion System, Inc. All rights reserved.
|
|
92
|
+
|
|
93
|
+
* **Licensor:** Centillion System, Inc. (https://centsys.jp/)
|
|
94
|
+
* **Contact:** odl@centsys.jp
|
|
95
|
+
|
|
96
|
+
This software is licensed under the **Business Source License 1.1 (BSL 1.1)**.
|
|
97
|
+
|
|
98
|
+
### Additional Use Grant
|
|
99
|
+
You are authorized to use this software in a production environment under the following conditions:
|
|
100
|
+
1. **Managed Service Restriction:** You may not use this software to provide a competing "Managed ODL Service" to third parties.
|
|
101
|
+
2. **Revenue Limit:** Use is free for individuals, academic institutions, and organizations with annual gross revenue less than **$10,000,000 USD**.
|
|
102
|
+
3. **Transition to OSS:** This software will convert to **Apache License 2.0** exactly two years after the release date of each version.
|
|
103
|
+
|
|
104
|
+
Organizations exceeding the revenue limit or wishing to provide managed services must obtain a commercial license from Centillion System, Inc.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
*The deterministic ID generation logic in this Kernel uses a proprietary signature for provenance tracking and identity verification.*
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# ODL Kernel
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>The Physics Engine for AI Agents.</strong><br>
|
|
5
|
+
Deterministic Foundation for Probabilistic Systems.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="#license--commercial-terms"><img src="https://img.shields.io/badge/License-BSL_1.1-orange.svg" alt="License"></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/Python-3.11+-blue.svg" alt="Python Version">
|
|
11
|
+
<img src="https://img.shields.io/badge/Coverage-100%25-green.svg" alt="Coverage">
|
|
12
|
+
<img src="https://img.shields.io/badge/Determinism-UUID_v5-blueviolet.svg" alt="Determinism">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
**The Deterministic Execution Engine for Organizational Definition Language (ODL).**
|
|
18
|
+
|
|
19
|
+
`odl-kernel` is the reference implementation of the ODL "Physics." It is a stateless, pure-functional execution engine designed to manage the lifecycle of autonomous AI agents and human-AI collaboration.
|
|
20
|
+
|
|
21
|
+
Unlike traditional workflow engines, the Kernel acts as a rigorous state machine that derives the next organizational state and necessary side effects (Commands) based on a provided `JobSnapshot` and `KernelEvent`.
|
|
22
|
+
|
|
23
|
+
## ⚛️ Core Principles
|
|
24
|
+
|
|
25
|
+
* **Functional Core:** The Kernel is side-effect-free. It does not access databases or external APIs directly; it only calculates the transition.
|
|
26
|
+
* **Deterministic Identity:** Every node is assigned a mathematically derived UUID v5 based on its structural path. This ensures that process IDs remain consistent across restarts, replays, and forks.
|
|
27
|
+
* **Deep Analyze:** The engine performs fixed-point iteration to advance states until a stable equilibrium is reached, allowing the host to observe only meaningful state changes.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
The integration follows a strict **"Load -> Analyze -> Apply"** pattern.
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import odl_kernel
|
|
37
|
+
from odl_kernel.types import JobSnapshot, KernelEvent
|
|
38
|
+
|
|
39
|
+
# 1. Prepare Input (Stateless)
|
|
40
|
+
snapshot = JobSnapshot(job=job_data, nodes=node_map)
|
|
41
|
+
event = KernelEvent(type="TICK", occurred_at=datetime.now())
|
|
42
|
+
|
|
43
|
+
# 2. Analyze (Pure Physics)
|
|
44
|
+
# The Kernel calculates the next state and required commands.
|
|
45
|
+
result = odl_kernel.analyze(snapshot, event)
|
|
46
|
+
|
|
47
|
+
# 3. Apply Output (Side Effects)
|
|
48
|
+
# The Host runtime persists updated_nodes and executes result.commands.
|
|
49
|
+
my_db.save(result.updated_nodes)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> 📖 **Deep Dive: The Physics of Execution**
|
|
53
|
+
>
|
|
54
|
+
> The code above is just the entry point. The Kernel is a stateless, pure-functional "Physics Engine" designed to run inside your application.
|
|
55
|
+
>
|
|
56
|
+
> To understand the architecture (**Functional Core / Imperative Shell**) and how to implement the **Host Runtime** (Database persistence, LLM API connections, and the Event Loop), please read the full implementation guide:
|
|
57
|
+
>
|
|
58
|
+
> **[USAGE.md: The Host Implementation Guide](./USAGE.md)**
|
|
59
|
+
|
|
60
|
+
## 🏗 Relationship with `odl-lang`
|
|
61
|
+
|
|
62
|
+
This repository provides the execution environment. To define the organizational structures and compile them into an executable format, use the **[odl-lang](https://github.com/co-crea/odl-lang)** library.
|
|
63
|
+
|
|
64
|
+
## 🌹 Dedication
|
|
65
|
+
|
|
66
|
+
**Dedicated to the memory of Prof. Kazuhisa Seta, and to all researchers who continue to push the boundaries of Knowledge Engineering in his lineage.**
|
|
67
|
+
|
|
68
|
+
## ⚖️ License & Commercial Terms
|
|
69
|
+
|
|
70
|
+
Copyright (c) 2026 Centillion System, Inc. All rights reserved.
|
|
71
|
+
|
|
72
|
+
* **Licensor:** Centillion System, Inc. (https://centsys.jp/)
|
|
73
|
+
* **Contact:** odl@centsys.jp
|
|
74
|
+
|
|
75
|
+
This software is licensed under the **Business Source License 1.1 (BSL 1.1)**.
|
|
76
|
+
|
|
77
|
+
### Additional Use Grant
|
|
78
|
+
You are authorized to use this software in a production environment under the following conditions:
|
|
79
|
+
1. **Managed Service Restriction:** You may not use this software to provide a competing "Managed ODL Service" to third parties.
|
|
80
|
+
2. **Revenue Limit:** Use is free for individuals, academic institutions, and organizations with annual gross revenue less than **$10,000,000 USD**.
|
|
81
|
+
3. **Transition to OSS:** This software will convert to **Apache License 2.0** exactly two years after the release date of each version.
|
|
82
|
+
|
|
83
|
+
Organizations exceeding the revenue limit or wishing to provide managed services must obtain a commercial license from Centillion System, Inc.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
*The deterministic ID generation logic in this Kernel uses a proprietary signature for provenance tracking and identity verification.*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "odl-kernel"
|
|
3
|
+
version = "0.9.0"
|
|
4
|
+
license = "BUSL-1.1"
|
|
5
|
+
description = "ODL (Organizational Definition Language) Execution Kernel & Physics"
|
|
6
|
+
authors = ["Centillion System, Inc. <odl@centsys.jp>"]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
packages = [{include = "odl_kernel", from = "src"}]
|
|
9
|
+
|
|
10
|
+
[tool.poetry.dependencies]
|
|
11
|
+
python = ">=3.11,<4.0"
|
|
12
|
+
pydantic = "^2.0"
|
|
13
|
+
odl-lang = "^0.9.0"
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
17
|
+
build-backend = "poetry.core.masonry.api"
|
|
18
|
+
|
|
19
|
+
[tool.poetry.group.dev.dependencies]
|
|
20
|
+
pytest = "*"
|
|
21
|
+
|
|
22
|
+
[tool.pytest.ini_options]
|
|
23
|
+
pythonpath = [
|
|
24
|
+
"src",
|
|
25
|
+
"."
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.poetry.urls]
|
|
29
|
+
"Homepage" = "https://centsys.jp/"
|
|
30
|
+
"Repository" = "https://github.com/co-crea/odl-kernel"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Copyright (c) 2026 Centillion System, Inc. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# This software is licensed under the Business Source License 1.1 (BSL 1.1).
|
|
4
|
+
# For full license terms, see the LICENSE file in the root directory.
|
|
5
|
+
#
|
|
6
|
+
# This software is "Source Available" but contains certain restrictions on
|
|
7
|
+
# commercial use and managed service provision.
|
|
8
|
+
# Usage by organizations with gross revenue exceeding $10M USD requires
|
|
9
|
+
# a commercial license.
|
|
10
|
+
|
|
11
|
+
from .types import (
|
|
12
|
+
JobSnapshot,
|
|
13
|
+
KernelEvent,
|
|
14
|
+
AnalysisResult
|
|
15
|
+
)
|
|
16
|
+
from .engine.analyzer import OdlAnalyzer
|
|
17
|
+
from .engine.logic.introspection import NodeInspector
|
|
18
|
+
|
|
19
|
+
# Main Entry Point
|
|
20
|
+
def analyze(snapshot: JobSnapshot, event: KernelEvent) -> AnalysisResult:
|
|
21
|
+
"""
|
|
22
|
+
ODLカーネルのメインエントリポイント。
|
|
23
|
+
物理法則に基づき、入力されたSnapshotとEventから次のアクションを導出する純粋関数。
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
import odl_kernel
|
|
27
|
+
result = odl_kernel.analyze(snapshot, event)
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
snapshot: 現在のジョブの状態 (DBからロード済み)
|
|
31
|
+
event: トリガーとなった事象 (Tick, ActionCompleted等)
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
AnalysisResult: 実行すべきコマンドと、更新されたノード状態
|
|
35
|
+
"""
|
|
36
|
+
# Analyzerはステートレスなので、都度インスタンス化して実行する
|
|
37
|
+
# これにより odl.compile(...) と同じような関数的な使い心地を提供する
|
|
38
|
+
return OdlAnalyzer().analyze(snapshot, event)
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"analyze",
|
|
42
|
+
"JobSnapshot",
|
|
43
|
+
"KernelEvent",
|
|
44
|
+
"AnalysisResult",
|
|
45
|
+
"NodeInspector"
|
|
46
|
+
]
|