Skip to content

ICL-System/ICL-Runtime

Repository files navigation

ICL Runtime

crates.io npm PyPI docs.rs License: MIT

Status: Phases 0–10 Complete

This is the canonical Rust implementation of the Intent Contract Language (ICL) specification. All core logic is written once in Rust and compiled to every target: native binary, Python (PyO3), JavaScript/WASM (wasm-pack), and Go (cgo).

What This Is

ICL Runtime is the single implementation of the ICL specification:

  • One codebase — all logic lives in Rust
  • Every platform — compiles to native, Python, JS/WASM, Go
  • Deterministic — same input always produces identical output
  • Verifiable — all properties machine-checkable
  • Bounded — all execution bounded in memory and time

How is ICL Different from Guardrails?

Guardrails and system prompts are suggestions an LLM can ignore or misinterpret. ICL contracts are mathematically enforced walls — verified before execution, impossible to bypass.

System Prompts Guardrails ICL
What it is Natural language instructions Runtime filters Formal, verified contracts
Enforcement LLM interprets (may ignore) Probabilistic Mathematical proof
Analogy "Please don't" Smoke detector Fireproof wall

Where ICL is used: Trading agents that CANNOT exceed limits · Surgical robots that MUST stop if sensors fail · Drones that CANNOT enter restricted airspace · Code deploy agents that CANNOT ship without passing tests

See the full ICL vs Guardrails — 50+ real-world examples for when (and when not) to use ICL.

Architecture

ICL Text → Parser → AST → Normalizer → Canonical Form
                           ↓
                        Verifier → Type Check + Invariants + Determinism
                           ↓
                        Executor → Sandboxed Execution

Current Status

Component Status Tests
Tokenizer Complete 26 tests + determinism proof
Parser (recursive descent) Complete 50+ tests
Normalizer (canonical + SHA-256) Complete 30+ tests
Verifier (types, invariants, determinism, coherence) Complete 40+ tests
Executor (sandbox + provenance) Complete 20+ tests
CLI (9 commands) Complete 28 tests
Python binding (PyO3) Complete 18 tests
JavaScript binding (WASM — Node/Bundler/Web) Complete 31 tests
Go binding (cgo) Complete 16 tests

Total: 203 Rust tests + 65 binding tests = 268 tests passing

Development

Prerequisites

  • Rust 1.93+ (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  • For Python: Python 3.8+, maturin
  • For JavaScript: wasm-pack, Node.js 16+
  • For Go: Go 1.21+

Building

cargo build              # Build all crates
cargo test --workspace   # Run all tests (203 Rust tests)
cargo build -p icl-cli   # Build CLI only

Project Structure

ICL-Runtime/
├── Cargo.toml              # Workspace root
├── crates/
│   ├── icl-core/           # Library: parser, normalizer, verifier, executor
│   │   └── src/
│   │       ├── lib.rs
│   │       ├── error.rs
│   │       ├── parser/     # Tokenizer + AST + recursive descent
│   │       │   ├── mod.rs
│   │       │   ├── tokenizer.rs
│   │       │   └── ast.rs
│   │       ├── normalizer.rs
│   │       ├── verifier.rs
│   │       └── executor.rs
│   └── icl-cli/            # Binary: `icl-cli validate`, `icl-cli verify`, etc.
│       └── src/main.rs
├── bindings/
│   ├── python/             # PyO3 binding (pip: icl-runtime)
│   ├── javascript/         # WASM binding (npm: icl-runtime)
│   └── go/                 # cgo binding
├── tests/
│   ├── integration/
│   ├── conformance/
│   └── determinism/
├── benches/
└── .github/workflows/      # CI/CD (ci, bindings, publish, deploy)

Related Repositories

Repo Purpose
ICL-Spec The standard: BNF grammar, specification, conformance tests
ICL-Docs Documentation website (mdBook)

License

MIT — See LICENSE for details.

Contributing

See CONTRIBUTING.md for development guidelines.

About

Canonical Rust implementation of ICL - parser, normalizer, verifier, executor, CLI, and language bindings (Python/JS/Go)

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors