Metadata-Version: 2.5
Name: clm-kernel
Version: 0.0.1
Summary: Card Lifecycle Manager (CLM) Kernel — Sovereign Functional Agentic Operating System
Author: GovTech Digital Identity & Autonomous Systems
License: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Interpreters
Requires-Python: >=3.11
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: aiosqlite>=0.17.0
Requires-Dist: base58>=2.1.1
Requires-Dist: blake3>=0.4.0
Requires-Dist: chardet>=5.1.0
Requires-Dist: cryptography>=44.0.0
Requires-Dist: duckdb>=1.0.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: jsonschema>=4.26.0
Requires-Dist: networkx>=3.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dateutil>=2.9.0
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: pyyaml>=6.0
Requires-Dist: reportlab>=4.0.0
Requires-Dist: requests>=2.28.0
Requires-Dist: result>=0.17.0
Requires-Dist: scipy>=1.14.0
Requires-Dist: sqlalchemy>=1.4.0
Requires-Dist: typing-extensions>=4.5.0
Requires-Dist: uvicorn>=0.20.0
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: hatchling>=1.20.0; extra == 'dev'
Requires-Dist: hypothesis>=6.100.0; extra == 'dev'
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Provides-Extra: native
Description-Content-Type: text/markdown

# clm-kernel

Card Lifecycle Manager (CLM) Kernel — Sovereign Functional Agentic Operating System.

`clm-kernel` is the foundational Python implementation of the Cubical Logic Model (CLM), providing a stratified 5-layer architecture for sovereign, functional, deterministically auditable agentic execution.

## Architectural Layers

- **Layer 0: Cryptographic Substrate & Storage**
  - Content-addressable storage via BLAKE3 hashing
  - Merkle DAG tree synthesis and verification
  - TriDatabase manager and multi-agent Vector Clocks
- **Layer 1: Type Lattice & Schema Model**
  - Pydantic-backed invariant validation
  - Deterministic AST transformations and MCard schemas
- **Layer 2: Reactive Graph & CPN-VM**
  - Coloured Petri Net (CPN) virtual machine
  - Token passing, transition firings, and concurrency invariants
- **Layer 3: Cordis Spatiotemporal Actor Model**
  - Effect isolation, savepoints (`SavepointGuard`), and cleanup scopes (`DisposableList`)
  - Monadic execution with rollback guarantees
- **Layer 4: Sovereign Execution & Gateway**
  - Full CLI (`clm`, `clmEval`)
  - Triad Gateway and Model Context Protocol (MCP) server integration

## Installation

```bash
pip install clm-kernel
```

## CLI Usage

```bash
# Display CLI help
clm --help

# Evaluate an action or workflow manifest
clm evaluate --file workflow.yaml

# Initialize TriDatabase storage
clm init-tridb --path ./data
```

## Python API Quick Start

```python
from clm.layer0.merkle import MerkleTree
from clm.layer4 import SovereignExecutor

# Create and verify Merkle DAG
tree = MerkleTree()
tree.insert("card-1", b"payload data")
root_hash = tree.compute_root()
print(f"Merkle Root: {root_hash}")
```

## License

MIT License. See [LICENSE](https://github.com/xlp0/CLM/blob/main/LICENSE) for details.

## Monorepo & Documentation

Source code, formal proofs, and multi-language kernels (Rust, JavaScript/TypeScript, WASM) are maintained in the main [CLM Repository](https://github.com/xlp0/CLM).
