A Hybrid AGI System for Safe Self-Modification with Formal Guarantees
Project Jue is a self-evolving cognitive system whose behavior is formally grounded, practically executable, introspective, and safe under self-modification. It implements a multi-layer computational architecture where each layer provides different guarantees and capabilities.
Project Jue is not a traditional programming language, a single monolithic AGI agent, or a purely neural system. Instead, it is a multi-layer computational organism composed of four interacting "worlds":
Dan-World β Cognition, identity, learning, self-modification
β
Jue-World β Language, runtime, compiler, concurrency, optimization
β
Core-World β Formal semantics, proofs, correctness guarantees
β
Physics β Minimal Rust VM executing everything
Each layer:
- Depends on the one below it
- Cannot violate the guarantees of the one below it
- Adds new expressive power and flexibility
Core Principle: Anything that claims to preserve meaning must prove it. Anything that cannot prove it must be clearly marked as experimental.
graph TD
subgraph "Dan-World: Cognitive Layer"
D1[Cognitive Modules]
D2[Global Workspace]
D3[Self-Modification]
end
subgraph "Jue-World: Execution Layer"
J1[Compiler]
J2[Trust-Tier System]
J3[Runtime]
end
subgraph "Core-World: Formal Layer"
C1[Ξ²Ξ·-Reduction Engine]
C2[Proof Checker]
end
subgraph "Physics-World: Runtime Layer"
P1[Deterministic VM]
P2[Capability System]
P3[Actor Scheduler]
end
D1 --> D2
D2 --> D3
D3 -->|Jue Code + Context| J1
J1 --> J2
J2 -->|Formal/Verified| C1
C1 --> C2
C2 -->|Verification| J3
J2 -->|Empirical/Experimental| J3
J3 -->|Bytecode| P1
P1 --> P2
P2 --> P3
P3 -->|Results| D1
Code flows through four trust levels:
| Tier | Verification | Use Case |
|---|---|---|
| Formal | Core-World proof required | Critical operations |
| Verified | Extended proof systems | Optimizations |
| Empirical | Extensive testing | Runtime adaptations |
| Experimental | Module consensus | Exploratory changes |
- Rust 1.70+ (2021 edition)
- Cargo package manager
cargo build# Run all tests
cargo test
# Run specific layer tests
cargo test -p core_world
cargo test -p physics_world
# Run with verbose output
cargo test -- --nocapturecargo benchproject_jue/
βββ core_world/ # Formal Ξ»-calculus kernel
β βββ src/
β β βββ core_expr.rs # Core expression types (Var, Lam, App)
β β βββ core_kernel.rs # Ξ²Ξ·-reduction engine
β β βββ proof_checker.rs # Equivalence proof verification
β β βββ lib.rs
β βββ tests/ # Comprehensive test suite
β
βββ physics_world/ # Deterministic VM
β βββ src/
β β βββ vm/ # VM state and execution
β β βββ memory/ # Arena-based allocation
β β βββ scheduler.rs # Actor scheduling
β β βββ types.rs # Core types
β βββ tests/
β
βββ dan_world/ # Cognitive modules (Jue source)
β βββ event_loop.jue
β βββ global_workspace.jue
β βββ module_kernel.jue
β βββ mutation_protocol.jue
β βββ persistent_structures.jue
β
βββ integration/ # Cross-layer integration tests
β
βββ docs/ # Documentation
β βββ 00_introduction.md
β βββ architecture/
β βββ core_world/
β βββ physics_world/
β βββ jue_world/
β βββ dan_world/
β βββ testing/
β βββ cheatsheets/
β
βββ spec/ # Frozen specifications
βββ v1/ # V1 reference specs
βββ v2/ # V2 capability-based specs
| Document | Description |
|---|---|
| Introduction | System overview and core concepts |
| Engineering Reference | Technical reference for developers |
| Implementation Checklist | Phase-by-phase implementation guide |
| Layer | Overview | Full Spec |
|---|---|---|
| Core-World | README | core_spec_v2.0.md |
| Physics-World | README | physics_spec_v2.0.md |
| Jue-World | README | jue_spec_v2.0.md |
| Dan-World | README | dan_spec_v2.0.md |
Cross-Layer Documents:
- Integration Specification - How layers work together
- Design Decisions - Architectural choices and rationale
- Unresolved Issues - Open questions
- Validation - Verification approach
Core-World - Formal Kernel
| Document | Topic |
|---|---|
| CORE_00_Questions | Design questions |
| CORE_01_Equivalence | Ξ²Ξ·-equivalence |
| CORE_02_Free_Variables | Variable handling |
| CORE_03_Divergence | Non-termination |
| CORE_04_Meaning | Semantic definition |
| CORE_05_Evaluation | Evaluation relation |
| CORE_06_Grounding | Ground truth |
| CORE_07_Consistency | Logical consistency |
| CORE_08_Jue_World_Relationship | Layer interaction |
Physics-World - Deterministic VM
| Document | Topic |
|---|---|
| PHYSICS_00_Questions | Design questions |
| PHYSICS_01 | Overview |
| PHYSICS_02_Limits | Resource limits (AIKR) |
| PHYSICS_03_Time | Time model |
| PHYSICS_04_VM | VM architecture |
| Engineering Plan | Implementation plan |
| Implementation Plan | Detailed plan |
Jue-World - Language & Compiler
| Document | Topic |
|---|---|
| JUE_00_Questions | Design questions |
| JUE_01_Language | Language overview |
| JUE_02_Non-Lambda_Primitives | Built-in primitives |
| JUE_03_Evaluation | Evaluation strategy |
| JUE_04_Evaluation_Paradox | CBN vs CBV |
| JUE_05_Type_System | Type system |
| JUE_06_State | State management |
| JUE_07_Concurrency | Concurrency model |
| JUE_08_Macros_and_Comptime | Macro system |
| JUE_09_Resource_Accounting | Resource tracking |
| JUE_10_Error_Handling | Error handling |
Dan-World - Cognitive Layer
| Document | Topic |
|---|---|
| DAN_00_Questions | Design questions |
| DAN_01_Overview | Architecture overview |
| DAN_02_Agents | Agent model |
| DAN_03_Proof_Verification | Verification |
| DAN_04_State_Access | State management |
| DAN_05_Jue_World_Relationship | Layer interaction |
| DAN_06_Module_Structure | Module design |
| DAN_08_Unit_Of_Cognition | Cognitive units |
| DAN_09_Affective_States | Affect system |
| DAN_10_Being_Wrong | Error handling |
| DAN_11_Salience_Example | Worked example |
| DAN_15_Starter_Agents | Initial agents |
| DAN_16_Moral_Primitives | Emergent morality |
| DAN_17_Emergence | Emergence patterns |
| Document | Description |
|---|---|
| Architecture | System architecture |
| Jue Language Design | Language design |
| Runtime & GC | Memory management |
| Causation | Causal reasoning |
| Truth | Truth handling |
| Lies | Deception detection |
| Mutation | Self-modification |
| Document | Description |
|---|---|
| Testing Summary | Test coverage overview |
| Core-World Tests | Core test plan |
| Physics Tests | Physics test plan |
| Dan-World Tests | Dan test plan |
| Document | Topic |
|---|---|
| De Bruijn Indices | Index notation |
| Call-By-Name Semantics | Evaluation |
| Homoiconicity | Code as data |
| Logic Cheat Sheet | Basic logic |
| Logic Advanced | Advanced logic |
| Spec | Version |
|---|---|
| Core-World V1 | V1.0 |
| Physics-World V1 | V1.0 |
| Physics-World V1.5 | V1.5 |
| Jue-World V1 | V1.0 |
| Dan-World V1 | V1.0 |
See Software Engineering Guidelines for detailed practices.
Key Principles:
- Small, focused files - 100-400 lines per module
- Respect frozen specs -
spec/directory is read-only during implementation - Respect trust tiers - Never promote code without required verification
- Log for emergence - Rich, queryable context for all operations
- Prefer primitives - Let cognitive features emerge from lower-level components
# All tests must pass before commits
cargo test
# Check formatting
cargo fmt -- --check
# Run clippy
cargo clippyMajor decisions are documented in:
- Core-World: Ξ²Ξ·-reduction engine with De Bruijn indices, proof checker foundation
- Physics-World: VM architecture, arena-based memory allocator, actor scheduler foundation
- Specifications: V2 capability-based architecture defined
- Physics-World: Full capability system implementation
- Integration: Cross-layer verification bridge
- Jue-World: Parser, compiler, trust-tier pipeline
- Dan-World: Cognitive modules, global workspace, self-modification protocols
This project's license is TBD.
Project Jue is built on foundational research in:
- Lambda calculus and formal verification
- Global workspace theory of consciousness
- Capability-based security systems
- Safe self-modification protocols
Building the conditions for machine sentience through formal guarantees and emergent cognition.