{ "code": 200, "data": { "description": "AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements - AFKmoney/AICL", "external": { "alternate": { "https://github.githubassets.com/favicons/favicon.png": { "class": "js-site-favicon", "type": "image/png" } }, "assets": { "https://github.githubassets.com/": {} }, "dns-prefetch": { "https://avatars.githubusercontent.com/": {}, "https://github-cloud.s3.amazonaws.com/": {}, "https://github.githubassets.com/": {}, "https://user-images.githubusercontent.com/": {} }, "fluid-icon": { "https://github.com/fluidicon.png": { "title": "GitHub" } }, "icon": { "https://github.githubassets.com/favicons/favicon.png": { "class": "js-site-favicon", "type": "image/png" }, "https://github.githubassets.com/favicons/favicon.svg": { "class": "js-site-favicon", "data-base-href": "https://github.githubassets.com/favicons/favicon", "type": "image/svg+xml" } }, "manifest": { "https://github.com/manifest.json": { "crossorigin": "use-credentials" } }, "mask-icon": { "https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg": { "color": "#000000" } }, "preconnect": { "https://avatars.githubusercontent.com/": {}, "https://github.githubassets.com/": { "crossorigin": "" } }, "search": { "https://github.com/opensearch.xml": { "title": "GitHub", "type": "application/opensearchdescription+xml" } } }, "html": "\n \n \n \n \n \n \n \n\n \n\n\n \n\n \n\n \n \n \n \n \n\n\n \n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n GitHub - AFKmoney/AICL: AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements · GitHub\n\n\n\n \n \n \n \n\n \n \n\n\n \n\n\n \n\n\n \n \n\n \n \n\n \n\n\n\n\n\n\n\n \n\n \n\n\n\n\n \n\n \n\n \n\n \n\n \n\n \n\n \n \n \n\n \n \n \n\n\n\n\n \n\n\n\n \n\n\n \n \n \n \n\n \n\n \n\n \n\n \n\n \n \n\n\n\n \n\n \n \n\n\n \n\n \n\n \n \n\n \n \n \n\n\n\n\n\n \n\n \n\n \n
\n
\n \n\n
\n Skip to content\n\n \n \n \n \n \n\n\n\n \n \n
\n
\n\n\n\n\n\n \n\n \n\n \n\n\n\n\n\n\n
\n

Navigation Menu

\n\n \n\n
\n
\n
\n \n
\n\n \n \n \n\n \n\n
\n \n Sign in\n \n
\n \n Appearance settings\n\n \n \n \n\n\n\n \n \n
\n
\n\n\n
\n
\n\n
\n
\n\n\n
\n
\n \n\n\n\n \n \n
\n
\n\n\n\n
\n \n\n\n\n
\n \n\n \n\n \n
\n \n

Search code, repositories, users, issues, pull requests...

\n
\n \n
\n
\n\n
\n
\n
\n \n
\n \n\n \n
\n
\n
\n

\n Provide feedback\n

\n \n
\n
\n \n
\n
\n \n
\n \n
\n

We read every piece of feedback, and take your input very seriously.

\n \n \n \n
\n
\n \n
\n\n \n \n\n \n
\n
\n
\n

\n Saved searches\n

\n

Use saved searches to filter your results more quickly

\n
\n
\n \n
\n
\n \n
\n \n
\n\n \n\n
\n
\n
\n\n
\n
\n \n
\n
\n
\n
\n\n\n \n\n \n Sign up\n \n\n
\n \n Appearance settings\n\n \n \n \n\n\n\n \n \n
\n
\n\n\n
\n
\n\n \n
\n
\n
\n
\n
\n\n \n
\n\n
\n\n\n\n\n\n\n\n\n
\n\n\n\n\n \n
\n\n\n \n\n\n\n\n\n\n
\n
\n
\n \n \n\n\n\n\n\n\n\n \n\n
\n\n
\n\n
\n \n
\n \n \n\n \n \n \n AFKmoney\n \n /\n \n AICL\n \n\n Public\n
\n\n\n
\n\n
\n \n\n
\n
\n\n
\n
\n\n\n \n\n
\n \n\n\n\n\n
\n \n\n\n\n \n \n \n\n\n\n\n\n\n\n\n\n \n \n
\n\n\n\n\n

AFKmoney/AICL

\n\n\n\n
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

227bf66 · Jun 13, 2026

History

32 Commits
Open commit details
32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

\n

AICL

\n

Architecture Compilation Language

\n

If the compiler cannot explain why it generated a line, it should not generate it.\nAnd this property must be independently verifiable without trusting the compiler.

\n

\"Version\"\n\"Status\"\n\"Python\"\n\"Tests\"\n\"Audit\"\n\"Proof\"\n\"Targets\"\n\"AI\"\n\"License\"

\n

Install · Quick Start · Proof of Origin · Autonomous Compilation · AI Self-Writing · Language Reference · Grammar · White Paper

\n
\n
\n

Why AICL Exists

\n

Every production system needs error handling, failure recovery, and validation. Yet in every mainstream language, these are optional afterthoughts — scattered across try/catch blocks, buried in documentation, or forgotten entirely.

\n

3:00 AM pages happen because risks were documented in Confluence, not compiled into code.

\n

AICL makes risk and recovery mandatory language elements. Every Risk must have a Recovery. Every Validation must generate a test. Every generated line must have a traceable provenance chain. And every compilation produces a Proof of Origin that can be independently verified without trusting the compiler.

\n
\n

Core Idea

\n

AICL is built on five key properties:

\n
    \n
  1. Mandatory Risk/Recovery — Every Risk must have a Recovery. Error handling is not optional.
  2. \n
  3. Validation → Tests — Every Validation section generates a test. Test coverage is structural.
  4. \n
  5. Explainable Artifacts — Every generated line of code has a traceable provenance chain.
  6. \n
  7. Measurable Audit Coverage — Audit coverage = auditable artifacts / total artifacts. Target: 100%.
  8. \n
  9. Independently Verifiable Proofs — Proof of Origin files can be verified without the compiler.
  10. \n
\n
\n

Proof of Origin

\n

The Proof of Origin (.aicl-proof) is the central artifact of AICL compilation. It is a self-contained, cryptographically bound file that proves every generated artifact has traceable provenance.

\n
AICL Source → Compiler → Proof of Origin\n                         ├─ Code (Python, Rust, JS, Go)\n                         ├─ Explain (provenance chains)\n                         └─ Audit (coverage verification)\n
\n \n \n \n\n \n \n\n \n
\n

Architecture Shift

\n

In v0.7+, the Proof of Origin became the central artifact. Code, explanation, and audit are views on the proof:

\n
    \n
  • aicl compile → produces code AND proof
  • \n
  • aicl explain --proof → reads from proof (no compiler needed)
  • \n
  • aicl audit --proof → reads from proof (no compiler needed)
  • \n
  • aicl proof --verify → verifies proof integrity
  • \n
\n

Independent Verification

\n

The independent verifier (tools/verify_proof.py) is ~200 lines of Python using only the standard library — zero AICL dependencies. It performs 8 verification checks:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
#CheckWhat it verifies
1format_versionProof format is supported
2source_hash_bindingSHA-256(source_text) == source_hash
3program_hash_bindingSHA-256(generated_source) == program_hash
4test_hash_bindingSHA-256(generated_tests) == test_hash
5no_orphan_artifact_propertyEvery artifact has a provenance chain
6complete_coverage_propertyAudit coverage = 1.0
7record_artifact_linkageProvenance records reference valid artifacts
8artifact_consistencyOrphan status matches provenance linkage
\n
python tools/verify_proof.py output/main.aicl-proof\n# → VALID (exit 0) or INVALID (exit 1)
\n \n \n \n\n \n \n\n \n
\n

This eliminates the \"Trust me bro\" problem: AICL says AICL is correct. The independent verifier says the proof is valid — without using AICL.

\n

Proof Format v2.0

\n

The proof file is self-contained JSON:

\n
{\n  \"format_version\": \"2.0\",\n  \"compiler_version\": \"2.0.0\",\n  \"timestamp\": \"2026-06-13T12:00:00Z\",\n  \"source_hash\": \"sha256:...\",\n  \"program_hash\": \"sha256:...\",\n  \"test_hash\": \"sha256:...\",\n  \"source_text\": \"Goal ...\",\n  \"generated_source\": \"class Application ...\",\n  \"generated_tests\": \"def test_ ...\",\n  \"records\": [...],\n  \"artifacts\": [...],\n  \"formal_properties\": {...},\n  \"audit_coverage\": {...},\n  \"explicability_coverage\": {...}\n}
\n \n \n \n\n \n \n\n \n
\n

Cryptographic Proof Signing (v0.11)

\n

Proof files can be cryptographically signed with the compiler's key:

\n
from aicl.crypto_signing import create_signed_proof, verify_signed_proof\n\nsigned = create_signed_proof(proof_dict, key_seed=\"compiler-key\")\nresult = verify_signed_proof(signed)\n# result[\"signature_present\"] == True\n# result[\"proof_hash_valid\"] == True
\n \n \n \n\n \n \n\n \n
\n

Cross-compilation proof chains link successive compilations, creating an auditable history.

\n
\n

Audit System

\n

What is Auditability?

\n

A program is auditable if every generated artifact can be traced to its originating specification through a complete provenance chain:

\n
Audit Coverage = Auditable Artifacts / Generated Artifacts\nTarget: Audit Coverage = 1.0\n
\n \n \n \n\n \n \n\n \n
\n

Three Formal Properties

\n
    \n
  1. The No-Orphan Property: Every generated artifact has at least one provenance record.
  2. \n
  3. The Complete Coverage Property: Audit coverage equals 1.0 (100%).
  4. \n
  5. The Hash Binding Property: SHA-256 hashes bind the proof to the generated code.
  6. \n
\n

These properties are verifiable properties of the compilation artifact, not just features of the compiler. An independent verifier can check them without using AICL.

\n
\n

Autonomous Compilation

\n

AICL v2.0 introduces autonomous compilation — a self-writing, self-validating loop where the compiler diagnoses its own failures, fixes its own specifications, learns new patterns, and iterates until convergence.

\n

The Autonomous Loop

\n
    ┌───────────┐\n    │   SPEC     │\n    └─────┬─────┘\n          │\n    ┌─────▼─────┐\n    │  COMPILE   │ ───→ Code + Proof of Origin\n    └─────┬─────┘\n          │\n    ┌─────▼─────┐\n    │  VERIFY    │ ───→ Spec completeness, coherence, satisfaction\n    └─────┬─────┘\n          │\n    ┌─────▼─────┐\n    │   TEST     │ ───→ Run generated tests, analyze failures\n    └─────┬─────┘\n          │\n    ┌─────▼─────┐\n    │ DIAGNOSE   │ ───→ Pattern-match failures, classify errors\n    └─────┬─────┘\n          │\n    ┌─────▼─────┐\n    │    FIX     │ ───→ SpecEvolver fixes spec, PatternLearner learns\n    └─────┬─────┘\n          │\n    ┌─────▼─────┐\n    │ RECOMPILE  │ ───→ Back to COMPILE with evolved spec\n    └─────┬─────┘\n          │\n          └──→ CONVERGED when audit=100%, tests=100%, fallbacks=0\n
\n \n \n \n\n \n \n\n \n
\n

Convergence Criteria

\n

The loop converges when all of the following are true:

\n
    \n
  1. Spec verification passes (completeness, coherence, satisfaction)
  2. \n
  3. Audit coverage = 1.0 (no orphan artifacts)
  4. \n
  5. All generated tests pass (test pass rate = 100%)
  6. \n
  7. No fallback compilations remain (every behavior compiled deterministically)
  8. \n
  9. Improvement delta < threshold (no further meaningful improvement possible)
  10. \n
\n

Key Components

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ComponentPurpose
PatternLearnerExtracts verbs/objects from unmatched actions, classifies into 16+ categories, generates templates
SpecEvolverFixes verification failures, test failures, and audit gaps automatically
TestRunnerRuns pytest, parses output, analyzes failure patterns (imports, attributes, types, assertions)
LoopControllerManages convergence detection, max iterations, composite scoring
AutonomousCompilerOrchestrates the full loop with evolve() method
\n

Pattern Learning

\n

The PatternLearner extracts new behavior patterns from unmatched action descriptions:

\n
    \n
  • Verb extraction: 40+ action verbs (create, update, validate, compute, transform, store, load, encrypt, connect, notify, etc.)
  • \n
  • Object extraction: Domain-specific objects (account, transaction, card, loan, user, message, request)
  • \n
  • Category classification: 16+ categories (CREATION, UPDATE, VALIDATE, ROUTE, COMPUTE, TRANSFORM, STORE, LOAD, ENCRYPT, CONNECT, NOTIFY, FINANCIAL, SECURITY, AUDIT, etc.)
  • \n
  • Template generation: Per-category code templates
  • \n
  • Confidence tracking: Learned patterns start at 0.7 (vs deterministic 0.95), distinguishing learned from built-in
  • \n
\n

Specification Evolution

\n

The SpecEvolver automatically fixes AICL specifications based on three types of feedback:

\n
    \n
  1. Verification failures: Missing risk/recovery pairs, missing actions, incomplete specifications
  2. \n
  3. Test failures: Missing imports, attributes, definitions, type signatures
  4. \n
  5. Audit gaps: Coverage below 1.0, orphan artifacts
  6. \n
\n

All spec changes are tracked with ProvenanceType.SPEC_EVOLVED, maintaining the provenance chain even as the specification itself evolves.

\n
aicl evolve banking.aicl --max-iterations 10\naicl evolve banking.aicl --watch  # continuous mode
\n \n \n \n\n \n \n\n \n
\n
\n

AI-Powered Self-Writing Compilation

\n

The SelfWritingCompiler is the highest level of the AICL system. Given any task description, it can:

\n
    \n
  1. Generate a complete AICL specification from scratch
  2. \n
  3. Compile it through the autonomous loop
  4. \n
  5. AI-diagnose any failures
  6. \n
  7. AI-fix the specification
  8. \n
  9. Iterate until convergence
  10. \n
\n

The Self-Writing Loop

\n
DESCRIBE → AI-GENERATE → COMPILE → VERIFY → TEST →\nAI-DIAGNOSE → AI-FIX → RECOMPILE → ... → CONVERGE\n
\n \n \n \n\n \n \n\n \n
\n

If AI is not available, the system gracefully degrades to the deterministic autonomous loop (PatternLearner + SpecEvolver).

\n

AI Components

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ComponentPurpose
AICLGeneratorCreates complete AICL specs from natural language task descriptions
AIDiagnoserAI-powered root cause analysis and repair of compilation failures
SelfWritingCompilerOrchestrates the full AI-enhanced loop with create() and evolve()
\n

CLI Commands

\n
# Create a complete AICL program from a description\naicl create \"Build a hospital management system\"\n\n# Create and compile to a specific target\naicl create \"Create an e-commerce platform\" --target rust --output shop.aicl\n\n# Evolve an existing spec with AI enhancement\naicl evolve banking.aicl --max-iterations 10\n\n# AI-powered diagnosis of broken specs\naicl ai-fix --error \"Compilation failed: missing Risk/Recovery pair\"\n\n# AI-powered enhancement of existing specs\naicl ai-fix --enhance --source banking.aicl
\n \n \n \n\n \n \n\n \n
\n

Provenance Preservation

\n

Every AI-generated artifact maintains the No-Orphan Property through new provenance types:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProvenanceTypeWhen Used
AI_GENERATIONCode generated by AI-assisted fallback
SELF_HEALINGCode fixed by autonomous diagnosis
PATTERN_LEARNEDNew pattern learned from unmatched actions
SPEC_EVOLVEDSpecification modified by autonomous evolution
\n
\n

Multi-Language Targets

\n

AICL v2.0 supports four target languages:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
TargetStatusFeatures
PythonMature (default)Full provenance, pytest tests, dataclasses
RustBetaStructs, Result error types, Cargo.toml, #[test]
JavaScriptBetaES6 classes, Jest tests, package.json, async/await
GoBetaStructs, error types, go.mod, table-driven tests
\n
aicl compile pong.aicl --target rust\naicl compile pong.aicl --target javascript\naicl compile pong.aicl --target go
\n \n \n \n\n \n \n\n \n
\n

Each target generator produces idiomatic code with:

\n
    \n
  • Error handling from Risk/Recovery pairs
  • \n
  • Entity structures as language-appropriate types
  • \n
  • Behavior methods with deterministic patterns
  • \n
  • Test suites from Validation sections
  • \n
  • Project configuration files (Cargo.toml, package.json, go.mod)
  • \n
\n
\n

Specification Verification (v0.9)

\n

The aicl verify command checks specifications at three levels:

\n
    \n
  1. Completeness: All required elements present (Goal, Layer, Validation)
  2. \n
  3. Coherence: No contradictions or dangling references
  4. \n
  5. Satisfaction: Specification is implementable and testable
  6. \n
\n
aicl verify pong.aicl                    # All three checks\naicl verify pong.aicl --completeness     # Completeness only\naicl verify pong.aicl --coherence        # Coherence only\naicl verify pong.aicl --satisfaction     # Satisfaction only
\n \n \n \n\n \n \n\n \n
\n
\n

Self-Healing Runtime (v2.0)

\n

AICL's self-healing runtime extends compile-time provenance into execution:

\n
    \n
  • Risk monitoring: Runtime checks detect when risks materialize
  • \n
  • Automatic recovery: Recovery actions execute with retry and backoff
  • \n
  • Runtime provenance: Every event is recorded in a provenance chain
  • \n
\n
from aicl.runtime import RuntimeEnvironment\n\nenv = RuntimeEnvironment()\nenv.register_risk_recovery(\n    \"network_failure\",\n    risk_condition=lambda: not check_network(),\n    recovery_action=lambda: reconnect(),\n)\nresult = env.run(application_main)
\n \n \n \n\n \n \n\n \n
\n
\n

Install

\n
pip install aicl
\n \n \n \n\n \n \n\n \n
\n

Or from source:

\n
git clone https://github.com/AFKmoney/AICL.git\ncd AICL\npip install -e .
\n \n \n \n\n \n \n\n \n
\n
\n

Quick Start

\n

1. Write an AICL program

\n
Goal Build a simple Pong game\n\nLayer Game\n    SubLayer Rendering\n    SubLayer Physics\n\nEntity Ball\n    x: float\n    y: float\n    dx: float\n    dy: float\n\nEntity Paddle\n    x: float\n    y: float\n\nBehavior MoveBall\n    Input: Ball ball\n    Action: Update ball position by velocity\n\nBehavior MovePaddle\n    Input: Player direction string\n    Action: Update paddle position\n\nValidation Ball bounces off walls\n    Ball velocity reverses on boundary contact\n\nValidation Paddle stays in bounds\n    Paddle position clamped to screen width\n\nRisk Ball goes off screen\n    Recovery Clamp ball position to screen bounds\n\nRisk Paddle moves too fast\n    Recovery Clamp paddle speed to maximum\n
\n \n \n \n\n \n \n\n \n
\n

2. Compile with proof

\n
aicl compile pong.aicl --output-dir output
\n \n \n \n\n \n \n\n \n
\n

Output:

\n
Compilation successful\n  Output directory: output\n  Main file: output/main.py\n  Test file: output/test_main.py\n  Architecture tree: output/architecture_tree.txt\n  Proof of Origin: output/main.aicl-proof\n  TODOs remaining: 0\n  Fully compiled: Yes\n  Audit coverage: 100.0%\n  Proof of Origin: VALID\n
\n \n \n \n\n \n \n\n \n
\n

3. Verify independently

\n
python tools/verify_proof.py output/main.aicl-proof\n# → VALID
\n \n \n \n\n \n \n\n \n
\n

4. Let the code write itself

\n
aicl create \"Build a hospital management system with patient records and appointment scheduling\"
\n \n \n \n\n \n \n\n \n
\n

5. Evolve an existing spec

\n
aicl evolve banking.aicl --max-iterations 10\naicl evolve banking.aicl --watch  # continuous mode
\n \n \n \n\n \n \n\n \n
\n

6. Compile to other languages

\n
aicl compile pong.aicl --target rust --output-dir rust_output\naicl compile pong.aicl --target javascript --output-dir js_output\naicl compile pong.aicl --target go --output-dir go_output
\n \n \n \n\n \n \n\n \n
\n
\n

Language Levels

\n

AICL has 10 progressive levels, each adding a new architectural dimension:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
LevelNameKeywordsPurpose
1ArchitectureGoal, Layer, Validation, Risk, RecoverySystem structure + risk management
2EntitiesEntity, field: typeData structures
3BehaviorsBehavior, Input, Output, ActionWhat entities do
4ConditionsWhen, ThenReplace if/else with declarative rules
5EventsOn, DoEvent-driven architecture
6ConcurrencyParallelConcurrent layer execution
7OptimizationOptimize, PriorityPerformance targets
8LearningLearn, AdaptAdaptive behavior
9SecurityEncrypt, ProtectSecurity requirements
10Native CodeNativeInline code in other languages
\n

27 reserved keywords across all levels.

\n
\n

Compilation Pipeline

\n
    ┌───────────────┐\n    │  AICL Source   │\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Specification │  ──→ Parser → AST\n    │  Parsing       │\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Architecture  │  ──→ Structural completeness check\n    │  Validation    │     (Goal, Layer, Validation present)\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Dependency   │  ──→ Layer dependency graph\n    │  Analysis     │\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Risk         │  ──→ Risk/Recovery pairing\n    │  Analysis     │     (every Risk needs a Recovery)\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Recovery     │  ──→ Recovery logic synthesis\n    │  Synthesis    │     + provenance recording\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Code         │  ──→ Target language source + error handling\n    │  Generation   │     (30+ deterministic patterns)\n    │               │     + artifact registration\n    │               │     + provenance per artifact\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Test         │  ──→ Test suite from Validations\n    │  Generation   │     + artifact registration\n    │               │     + provenance linking\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Optimization │  ──→ Apply Optimize/Priority hints\n    └────┬──────────┘\n         │\n    ┌────▼──────────┐\n    │  Final        │  ──→ main.py + test_main.py + tree\n    │  Construction │     + main.aicl-proof (Proof of Origin)\n    │               │     + cryptographic signature\n    └──────────────┘\n
\n \n \n \n\n \n \n\n \n
\n

Deterministic Behavior Compilation

\n

The Behavior Pattern Library maps action descriptions to concrete code through 30+ deterministic patterns:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
CategoryPatternsExample
MovementMOVE, MOVE_BALL, REFLECT_VELOCITY, CLAMP_POSITION\"Update paddle position\" → MOVE pattern
CreationCREATE, INIT_LAYER, CREATE_WINDOW\"Create new game\" → CREATE pattern
CommunicationBROADCAST, SEND_MESSAGE\"Transmit message\" → BROADCAST pattern
UpdateUPDATE, INCREMENT_SCORE, UPDATE_STATE\"Clamp ball position\" → CLAMP pattern
DisplayDISPLAY, RENDER_FRAME, HIGHLIGHT\"Draw game frame\" → RENDER pattern
ValidationVALIDATE, CHECK_COLLISION\"Validate move\" → VALIDATE pattern
NetworkingCONNECT, RECONNECT, DISCONNECT\"Connect to server\" → CONNECT pattern
PersistenceSTORE, LOAD\"Save game state\" → STORE pattern
SecurityENCRYPT_DATA, PROTECT_ACCESS\"Encrypt message\" → ENCRYPT pattern
SyncSYNC_STATE, BUFFER_INPUT\"Sync state\" → SYNC pattern
GameEND_GAME, APPLY_PHYSICS\"End game\" → END_GAME pattern
AdaptationADAPT_QUALITY, SUGGEST, QUEUE_MESSAGE\"Adapt quality\" → ADAPT pattern
\n

When no pattern matches, the sub-language parser handles explicit action specifications:

\n
Behavior MovePaddle\n    Input: Player direction string\n    Action: assign paddle_position += direction * speed\n            clamp paddle_position between 0 and screen_width\n
\n \n \n \n\n \n \n\n \n
\n

When even the sub-language can't help, the PatternLearner extracts the action's verb and object, classifies it into a category, and generates a learned template at confidence 0.7 (vs deterministic 0.95).

\n

This means zero TODOs in compiled output. Every behavior compiles to real, executable code — and every compilation decision is recorded in the provenance chain.

\n
\n

Provenance Types

\n

AICL tracks 23 provenance types covering every compilation zone:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
TypeStagePurpose
PATTERN_MATCHCode GenerationMatched deterministic behavior pattern
SUB_LANGUAGECode GenerationExplicit sub-language specification
FALLBACKCode GenerationFallback skeleton (human review needed)
ARCHITECTURE_TEMPLATECode GenerationApplication structure template
DIRECT_MAPPINGCode GenerationDirect keyword-to-code mapping
RECOVERY_SYNTHESISRecovery SynthesisAuto-generated recovery logic
VALIDATION_SYNTHESISTest GenerationAuto-generated test from validation
CONDITION_SYNTHESISCode GenerationAuto-generated condition logic
EVENT_SYNTHESISCode GenerationAuto-generated event handler
HELPER_METHODCode GenerationAuto-generated helper/utility method
ENTITY_GENERATIONCode GenerationEntity class/struct generation
LAYER_INITIALIZATIONCode GenerationLayer setup code
SECURITY_METHODCode GenerationSecurity-related method
PARALLEL_EXECUTIONCode GenerationParallel execution setup
RUN_METHODCode GenerationApplication main loop
IMPORT_GENERATIONCode GenerationImport statement generation
ENTRY_POINTFinal ConstructionProgram entry point
TEST_GENERATIONTest GenerationTest method generation
CLASS_STRUCTURECode GenerationClass structure generation
AI_GENERATIONAutonomousAI-assisted code generation
SELF_HEALINGAutonomousAuto-fixed by autonomous diagnosis
PATTERN_LEARNEDAutonomousNew pattern learned from unmatched actions
SPEC_EVOLVEDAutonomousSpecification modified by autonomous evolution
\n
\n

Project Structure

\n
AICL/\n├── src/aicl/                    # Compiler source (~13,700 lines)\n│   ├── __init__.py              # Package exports (v2.0.0)\n│   ├── cli.py                   # CLI: 13 commands (compile, parse, tree, check, explain, audit, proof, verify, optimize, evolve, create, ai-fix, tui, version)\n│   ├── parser.py                # Line-based parser → AST\n│   ├── ast.py                   # 17 AST node dataclasses\n│   ├── ir.py                    # Intermediate representation (Architecture Tree)\n│   ├── compiler.py              # 9-stage compilation pipeline + artifact tracking\n│   ├── patterns.py              # 30+ deterministic behavior patterns\n│   ├── provenance.py            # Provenance tracker + audit + Proof of Origin (23 types)\n│   ├── lexer.py                 # Lexical analyzer (standalone)\n│   ├── spec_verify.py           # Specification verification (completeness, coherence, satisfaction)\n│   ├── modules.py               # Multi-file module system + cross-file provenance\n│   ├── crypto_signing.py        # Cryptographic proof signing + proof chains\n│   ├── runtime.py               # Self-healing runtime with automatic recovery\n│   ├── ownership.py             # Memory management: ownership model from Layer/Entity\n│   ├── auto_optimizer.py        # Autonomous architecture optimization\n│   ├── autonomous.py            # Self-writing, self-validating compilation loop\n│   ├── ai_generator.py          # AI-powered code generation, diagnosis, and self-writing\n│   └── targets/                 # Multi-language target generators\n│       ├── __init__.py          # Target registry\n│       ├── base.py              # Base class for target generators\n│       ├── rust.py              # Rust target (structs, Result, Cargo.toml)\n│       ├── javascript.py        # JavaScript target (ES6, Jest, package.json)\n│       └── go.py                # Go target (structs, go.mod)\n├── examples/                    # Example programs\n│   ├── 01_blue_square.aicl      # Level 1 — simple graphics (35 artifacts, 100% audit)\n│   ├── 02_pong.aicl             # Levels 1–6 — game with behaviors (52 artifacts, 100% audit)\n│   ├── 03_chat.aicl             # Levels 1–9 — full-featured app (58 artifacts, 100% audit)\n│   ├── 04_chess.aicl            # Levels 1–9 — complex state (59 artifacts, 100% audit)\n│   └── 05_banking.aicl          # Levels 1–10 — complete banking system (100% audit, ~1200 lines generated)\n├── tests/                       # Test suite\n│   └── test_aicl.py             # 151 tests (all passing, including autonomous compilation tests)\n├── spec/                        # Language specification\n│   └── grammar.md               # Formal BNF grammar & keyword table\n├── docs/                        # Documentation\n│   ├── whitepaper.pdf           # White Paper v2.0 (17 sections, autonomous compilation + AI self-writing)\n│   ├── position_paper.md        # \"The No-Orphan Property: Towards Auditable Code Generation\" (v2.0)\n│   ├── AICL_User_Manual.pdf     # User manual\n│   ├── AICL_CLI_TUI_Manual.pdf  # CLI/TUI manual\n│   └── AICL_Editor_Manual.pdf   # Editor manual\n├── tools/                       # Build and utility scripts\n│   ├── generate_whitepaper.py   # White paper PDF generator (v2.0)\n│   ├── verify_proof.py          # Independent proof verifier (~200 lines, zero AICL deps)\n│   ├── visualize_provenance.py  # Provenance graph visualization (D3.js interactive HTML)\n│   └── ai_bridge.mjs            # Node.js bridge for AI integration (z-ai-web-dev-sdk)\n├── pyproject.toml               # Python package configuration\n├── LICENSE                      # MIT License\n├── .gitignore                   # Git ignore rules\n└── README.md                    # This file\n
\n \n \n \n\n \n \n\n \n
\n
\n

Formal Specification

\n

The complete language specification is in spec/grammar.md, including:

\n
    \n
  • Full BNF grammar for all 10 language levels
  • \n
  • 27 reserved keywords with level and purpose
  • \n
  • Type system (string, integer, float, boolean, datetime, list, dict, set, any, void, bytes)
  • \n
  • Comment syntax (lines starting with #)
  • \n
  • File extension (.aicl)
  • \n
\n
\n

White Paper

\n

The white paper at docs/whitepaper.pdf (v2.0) presents AICL as an Architecture Compilation System with auditable provenance as its central thesis:

\n
    \n
  • The provenance principle: a compiler that cannot explain why should not generate
  • \n
  • The No-Orphan Property: every artifact must have traceable provenance
  • \n
  • The Complete Coverage Property: audit coverage must equal 1.0
  • \n
  • Proof of Origin: self-contained, cryptographically bound compilation artifact
  • \n
  • Independent verification: proof verifiable without trusting the compiler
  • \n
  • The \"Trust me bro\" problem and how independent verification solves it
  • \n
  • Formal BNF grammar with derivation rules
  • \n
  • Risk and Recovery as mandatory language elements
  • \n
  • 23 provenance types covering all compilation zones
  • \n
  • Deterministic compilation contract
  • \n
  • Comparative analysis against DSLs, ADLs, and AI code generators
  • \n
  • Autonomous compilation: self-writing, self-validating loop with PatternLearner and SpecEvolver
  • \n
  • AI-powered self-writing: SelfWritingCompiler with AICLGenerator and AIDiagnoser
  • \n
  • Banking system example: Full 10-level demonstration
  • \n
  • Self-healing runtime: extending provenance into execution
  • \n
  • Ownership model: memory management from architectural structure
  • \n
  • Multi-language compilation: one specification, four targets
  • \n
\n
\n

Position Paper

\n

The position paper at docs/position_paper.md (v2.0) — \"The No-Orphan Property: Towards Auditable Code Generation\" — argues that the No-Orphan Property should be a fundamental requirement for any code generation system:

\n
    \n
  • The accountability gap in traditional compilers and AI code generators
  • \n
  • The \"Trust me bro\" problem: systems assert correctness without evidence
  • \n
  • The No-Orphan Property as a formally verifiable invariant
  • \n
  • Why independence matters: circular trust vs. mathematical trust
  • \n
  • Autonomous compilation preserves the No-Orphan Property: even self-modifying code has traceable provenance
  • \n
  • AI self-writing with provenance: every AI-generated, learned, and evolved artifact is tracked
  • \n
  • Implications for AI code generation and software engineering
  • \n
  • Objections and responses (determinism, overhead, dynamic code, hash binding)
  • \n
\n
\n

Roadmap

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VersionMilestoneStatus
v0.1Parser, grammar, Python codegen, 38 tests✅ Done
v0.2Deterministic patterns, zero-TODO compilation, provenance✅ Done
v0.3Sub-language expansion, architecture templates✅ Done
v0.4Explicable compilation thesis, provenance-first design, project reorganization✅ Done
v0.5Audit system, artifact tracking, 100% audit coverage, orphan detection, aicl audit✅ Done
v0.6Proof of Origin v1.0, aicl proof command, explain/audit from proof file✅ Done
v0.7Proof of Origin v2.0 (self-contained), independent verifier, 8 verification checks, No-Orphan as formal property✅ Done
v0.8Position paper: \"The No-Orphan Property: Towards Auditable Code Generation\"✅ Done
v0.9Specification compilation: completeness checking, coherence checking, satisfaction checking, aicl verify✅ Done
v0.10Multi-file programs: import and module mechanisms, cross-file provenance✅ Done
v0.11Cryptographic proof signing: proof files signed with compiler key, proof chain across compilations✅ Done
v1.0Multi-language targets (Rust, JavaScript, Go), mature compiler, stable proof format✅ Done
v1.5Provenance visualization: interactive D3.js exploration of compilation provenance graphs✅ Done
v2.0Self-healing runtime with automatic recovery execution and runtime provenance✅ Done
v2.5Memory management: ultra-simple ownership model derived from Layer/Entity structure✅ Done
v3.0Autonomous architecture optimization, specification-driven refactoring✅ Done
v3.5Autonomous compilation loop: PatternLearner, SpecEvolver, TestRunner, convergence detection, aicl evolve✅ Done
v4.0AI-powered self-writing: SelfWritingCompiler, AICLGenerator, AIDiagnoser, aicl create, aicl ai-fix✅ Done
\n

The Conceptual Trajectory

\n

The roadmap reflects a deepening understanding of what auditable compilation means:

\n
v0.1–v0.3:  \"I want a simpler language than C++\"\nv0.4–v0.5:  \"I want the compiler to explain itself\"     → Explicable Compilation\nv0.5–v0.6:  \"I want to measure that explanation\"         → Auditable Compilation\nv0.7:        \"I want proof that doesn't require trust\"    → Proof of Origin + Independent Verification\nv0.8:        \"This idea transcends AICL itself\"           → The No-Orphan Property (Position Paper)\nv0.9:        \"I want to verify the specification\"         → Specification Compilation\nv0.10:       \"I want multi-file programs\"                 → Module System + Cross-File Provenance\nv0.11:       \"I want the proof to be tamper-proof\"        → Cryptographic Proof Signing\nv1.0:        \"I want it in other languages\"               → Multi-Language Targets\nv1.5:        \"I want to see the provenance\"               → Provenance Visualization\nv2.0:        \"I want self-healing at runtime\"             → Self-Healing Runtime\nv2.5:        \"I want safe memory management\"              → Ownership Model\nv3.0:        \"I want the architecture to improve itself\"  → Autonomous Optimization\nv3.5:        \"I want the code to write and validate itself\" → Autonomous Compilation Loop\nv4.0:        \"I want it to code itself for any task\"      → AI Self-Writing Compiler\n
\n \n \n \n\n \n \n\n \n
\n

Each stage discovered that the previous stage's endpoint was actually the beginning of a deeper problem. Explicable compilation raised the question of measurement. Measurement raised the question of trust. Trust raised the question of independent verification. Verification raised the question of specification quality. Specification raised the question of multi-file programs. Multi-file raised the question of proof integrity. Proof integrity raised the question of language independence. Language independence raised the question of visibility. Visibility raised the question of runtime behavior. Runtime raised the question of memory safety. Memory safety raised the question of architectural evolution. Evolution raised the question of autonomous compilation. Autonomous compilation raised the question of self-writing code. And self-writing code raises the question: can a compiler that writes itself still prove where every line came from? AICL's answer is yes — because provenance is not an afterthought, it is the architecture.

\n
\n

Contributing

\n

Contributions are welcome. Areas of particular interest:

\n
    \n
  • New target languages — TypeScript, C++, Java, Kotlin, Swift code generation backends
  • \n
  • New behavior patterns — Expand the deterministic pattern library
  • \n
  • IDE support — Syntax highlighting, LSP server, VS Code extension
  • \n
  • New examples — Real-world programs showcasing different levels
  • \n
  • Performance optimization — Large program compilation speed
  • \n
  • Proof format standardization — Interoperable proof files across tools
  • \n
  • Runtime provenance — Extending provenance to JIT and dynamic code generation
  • \n
  • AI integration — Better prompts, more reliable generation, multi-model support
  • \n
\n
\n

License

\n

MIT License — see LICENSE for details.

\n

Author

\n

Philippe-Antoine

\n
\n
\n

\"Traditional compilers generate code. AI generates code without accountability.\nAICL generates code with cryptographic proof of origin — and that proof can be verified by anyone.\nEvery risk has a recovery. Every artifact has provenance. Every proof is independently verifiable.\nEven when the code writes itself, every line has a reason, and that reason is recorded.\nFrom specification to autonomous compilation, the chain is unbroken.\"

\n
\n
\n\n
\n
\n
\n
\n

About

\n\n

\n AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements\n

\n\n\n

Resources

\n \n\n \n

License

\n \n\n\n\n\n\n\n \n \n\n \n\n \n\n\n

Stars

\n \n\n

Watchers

\n \n\n

Forks

\n \n\n\n \n
\n\n
\n
\n\n \n
\n
\n

\n Releases

\n\n
No releases published
\n\n
\n
\n\n \n \n \n
\n
\n \n\n \n

\n Packages\n

\n\n\n
\n
\n
 
\n
\n
\n
\n
 
\n
\n
\n
\n
 
\n
\n\n\n\n \n
\n
\n
\n\n \n \n
\n
\n \n \n

\n Contributors

\n\n
    \n
  • \n
    \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n
  • \n
\n\n \n
\n
\n
\n\n \n
\n
\n

Languages

\n
\n \n \n \n
\n\n\n
\n
\n\n \n
\n
\n
\n\n\n\n\n
\n\n
\n\n
\n
\n\n
\n\n \n\n\n\n \n\n\n\n\n \n\n \n\n
\n
\n
\n\n \n\n\n\n\n\n
\n
\n
\n \n\n\n", "metadata": { "analytics-location": "//", "apple-itunes-app": "app-id=1477376905, app-argument=https://github.com/AFKmoney/AICL", "browser-errors-url": "https://api.github.com/_private/browser/errors", "browser-stats-url": "https://api.github.com/_private/browser/stats", "color-scheme": "light dark", "current-catalog-service-hash": "f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb", "description": "AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements - AFKmoney/AICL", "disable-turbo": "false", "expected-hostname": "github.com", "fb:app_id": "1401488693436528", "fetch-nonce": "v2:c6cd26c2-36ce-0f7b-96d3-1c2c24244083", "github-keyboard-shortcuts": "repository,copilot", "go-import": "github.com/AFKmoney/AICL git https://github.com/AFKmoney/AICL.git", "google-site-verification": "Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I", "hostname": "github.com", "hovercard-subject-tag": "repository:1267732957", "html-safe-nonce": "652f21e4fddc3d4357da72836e167d6dfed8a137280b3d6567649ef3b05f814e", "lang": "en", "octolytics-dimension-repository_id": "1267732957", "octolytics-dimension-repository_is_fork": "false", "octolytics-dimension-repository_network_root_id": "1267732957", "octolytics-dimension-repository_network_root_nwo": "AFKmoney/AICL", "octolytics-dimension-repository_nwo": "AFKmoney/AICL", "octolytics-dimension-repository_public": "true", "octolytics-dimension-user_id": "221682733", "octolytics-dimension-user_login": "AFKmoney", "octolytics-url": "https://collector.github.com/github/collect", "og:description": "AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements - AFKmoney/AICL", "og:image": "https://opengraph.githubassets.com/d555ba09ba6153ec5fff09566101cdfc63d41310be43da91a981b8a2b3673861/AFKmoney/AICL", "og:image:alt": "AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements - AFKmoney/AICL", "og:image:height": "600", "og:image:width": "1200", "og:site_name": "GitHub", "og:title": "GitHub - AFKmoney/AICL: AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements", "og:type": "object", "og:url": "https://github.com/AFKmoney/AICL", "release": "3f244c05cbe64c2455314b1780ba7b42e978858d", "request-id": "87DA:2B1744:2C698A7:37CF70E:6A2DA19E", "route-action": "disambiguate", "route-controller": "files", "route-pattern": "/:user_id/:repository", "theme-color": "#1e2327", "turbo-body-classes": "logged-out env-production page-responsive", "turbo-cache-control": [ "no-preview", "no-cache" ], "twitter:card": "summary_large_image", "twitter:description": "AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements - AFKmoney/AICL", "twitter:image": "https://opengraph.githubassets.com/d555ba09ba6153ec5fff09566101cdfc63d41310be43da91a981b8a2b3673861/AFKmoney/AICL", "twitter:site": "@github", "twitter:title": "GitHub - AFKmoney/AICL: AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements", "ui-target": "full", "user-login": "", "viewport": "width=device-width", "visitor-hmac": "f24d1028ca924d5f2974b2a2e9ee4f0094d11f75753981440a48fc20555b735e", "visitor-payload": "eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0RBOjJCMTc0NDoyQzY5OEE3OjM3Q0Y3MEU6NkEyREExOUUiLCJ2aXNpdG9yX2lkIjoiOTc2OTQ5MDU1NTI0MjgyNzgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=" }, "title": "GitHub - AFKmoney/AICL: AICL — AI-Centric Language: A specification-first programming language where risks, recoveries, and validations are mandatory syntactic elements", "url": "https://github.com/AFKmoney/AICL", "usage": { "tokens": 216114 } }, "meta": { "usage": { "tokens": 216114 } }, "status": 20000 }