Skip to main content

UNI — Native Intent Language Runtime

Project description

UNI — Native Intent Language

A deterministic runtime where declarative Laws govern state transformations.

Quick Start

pip install -e .

# Create a new app
uni init my-app

# Run it
uni run my-app --law MyApp.Initialize
uni run my-app --law MyApp.SetMessage --set text=hello
uni status my-app

# Serve over HTTP
uni serve my-app --port 8080
# GET  /state, GET /laws, POST /law/SetMessage

Writing a .uni App

module Counter

state CounterState:
    fields:
        value: number

law Initialize:
    intent: "Reset counter"
    effects:
        - ReadState CounterState as s
        - WriteState CounterState
    logic:
        s.value = 0

law Increment:
    intent: "Add one"
    effects:
        - ReadState CounterState as s
        - WriteState CounterState
    logic:
        s.value = s.value + 1

CLI Reference

Command Description
uni init <name> Scaffold a new app
uni run <path> --law Name Execute a law
uni run <path> --law Name --set k=v Execute with inputs
uni serve <path> --port 8080 HTTP server
uni status [path] Show current state
uni build <file> --emit-uir out.json Compile to UIR
uni validate <path> Run compliance checks

Architecture Overview

┌─────────────────────────────────────────────────────────┐
│  .uni Source Files (Laws, States, Computes, Queries)    │
└───────────────┬─────────────────────────────────────────┘
                ▼
┌──────────────────────────────────────┐
│  Compiler (Lexer → Parser → SA → UIR)│  src/uni/compiler/
└───────────────┬──────────────────────┘
                ▼
┌──────────────────────────────────────┐
│  Kernel (RuntimeOrchestrator)        │  src/uni/kernel/
│  ├── BaseExecutor (UIR VM)           │
│  ├── LawSolver (Intent → Mutation)   │
│  ├── AuditBus (Event Broadcasting)   │
│  └── Timeline (State History)        │
└───────────────┬──────────────────────┘
                ▼
┌──────────────────────────────────────┐
│  SemanticGraph (Single Source of     │  src/uni/ontology/
│  Truth — STRUCTURAL + CAUSAL +      │
│  EPISTEMIC nodes with Identity)      │
└───────────────┬──────────────────────┘
                ▼
┌──────────────────────────────────────┐
│  Observers (89 files)                │  src/uni/observers/
│  ├── structural/ (Graph Analysis)    │
│  ├── causal/ (Ancestry, Validation)  │
│  └── epistemic/ (Repair, Learning)   │
└───────────────┬──────────────────────┘
                ▼
┌──────────────────────────────────────┐
│  Evolution Engine                    │  src/uni/evolution/
│  ├── MetaValidator (Holy Invariants) │
│  ├── EntropyGate / CoherenceGate     │
│  ├── SimulationFork (Sandboxed Test) │
│  └── Explain-to-Repair Pipeline      │
└───────────────┬──────────────────────┘
                ▼
┌──────────────────────────────────────┐
│  Autonomous Sandbox                  │  src/uni/autonomous/
│  ├── 72h Campaign Harness            │
│  ├── Budget Governance               │
│  └── Checkpoint / Rollback / Quarantine│
└──────────────────────────────────────┘

Quick Start

# Run the autonomous evolution campaign
$env:PYTHONPATH="src"; python src/uni/autonomous/run_harness.py

# Run the web app hub (Tic-Tac-Toe, Snake, Todo)
python src/uni/cli/main.py serve
# Visit: http://localhost:8080/

# Run integration tests
$env:PYTHONPATH="src"; python tests/test_reflex_arc.py
$env:PYTHONPATH="src"; python tests/test_lineage_integrity.py

Key Modules

Module Path Purpose
Compiler src/uni/compiler/ Lexer → Parser → Static Analysis → UIR assembly
Kernel src/uni/kernel/ RuntimeOrchestrator, BaseExecutor, LawSolver, AuditBus, Timeline
Ontology src/uni/ontology/ SemanticGraph, CausalAtoms, SemanticIdentity, IdentityRegistry
Observers src/uni/observers/ 89 files: structural, causal, epistemic observers + GraphProjector
Evolution src/uni/evolution/ EvolutionEngine, MetaValidator, Gates, Fuzzer, ProofEngine
Observatory src/uni/observatory/ BlackBoxRecorder, TelemetryServer, ObservatoryMonitor
Autonomous src/uni/autonomous/ AutonomousSandbox, RunHarness (4-stage campaign)
Vision src/uni/vision/ VisionCompiler (LLM → .uni source)
Stdlib src/uni/stdlib/ Standard library: meta.uni, logic.uni, numeric.uni, identity.uni
Packs src/uni/packs/ Application packs: Snake, Tic-Tac-Toe, Todo, Calculator
Adapter src/uni/adapter/ HTTP server, REST API bridge
UIR src/uni/uir/ Universal Intermediate Representation models

Documentation

  1. Core System Contract — The 4+2 primitives and execution model
  2. Architecture Doctrine — Layer separation and determinism rules
  3. Writing Laws — Guide to authoring .uni behaviors
  4. Getting Started — Quick setup guide
  5. Evolution Roadmap — Multi-epoch evolution strategy

Current Phase: 14 (Semantic Identity & Explain-to-Repair)

UNI has completed 14 phases of development across 3 epochs:

  • Epoch 1: Wiring (Graph ↔ Runtime, Reflex Arc, AuditBus)
  • Epoch 2: Governance (Observatory, Budget, Jepsen Campaigns, Structural Purification)
  • Epoch 3: Semantic Civilization (Identity Tracking, Explain-to-Repair, Meta-Ontology)

⚖️ License

Proprietary UNI License © 2026. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uni_native-0.1.0.tar.gz (525.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uni_native-0.1.0-py3-none-any.whl (571.4 kB view details)

Uploaded Python 3

File details

Details for the file uni_native-0.1.0.tar.gz.

File metadata

  • Download URL: uni_native-0.1.0.tar.gz
  • Upload date:
  • Size: 525.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for uni_native-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7ddb02fd20e9780485b9387c94f61062789eb8c226a6739d64f06aa09afde3e
MD5 505822ba769a938188a6893c214c9583
BLAKE2b-256 1febc2da75a548ae9692d06d646cc4e84e671e779bc6157f5649538c769fe47d

See more details on using hashes here.

File details

Details for the file uni_native-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: uni_native-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 571.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for uni_native-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5d23f275c347af77ed11e73e12236b6f4c2a1cbadb4d6a96ecb698de74f47c
MD5 bc3d4a8b55ed2aa799abc33137937872
BLAKE2b-256 14ae41f7b8b5d663e09e6d25e538ed2cec1a3a5f4b5b75476cdecddeb1a0a8c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page