Skip to content

dotpipe/nopcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Swarm Opcode Evolution System

A self-evolving multi-agent AI architecture that combines:

  • LLM swarm orchestration (Ollama + OpenAI)
  • adversarial code generation
  • execution-based fitness evaluation
  • evolutionary opcode compiler system
  • self-repairing memory (software immune system)
  • IR-based intermediate execution layer
  • ncurses live cognitive visualization

⚙️ SYSTEM OVERVIEW

This system behaves like a self-improving computational organism:

Input → IR Compiler → Agent Swarm → LLM Swarm → Execution Engine
         ↓                 ↓              ↓
   Opcode Evolution   Debate System   Adversarial Tests
         ↓                 ↓              ↓
   Repair Memory ← Fitness Scoring ← Failure Clustering

🧬 CORE DESIGN PRINCIPLES

  • Execution > Prediction (code must run to be valid)
  • Adversarial pressure improves robustness
  • Memory stores failure patterns (immune system)
  • Multiple LLM roles simulate cognitive diversity
  • Evolutionary selection drives opcode survival

📁 SYSTEM FILE ARCHITECTURE

Below is a breakdown of all system modules.


🧠 CORE ORCHESTRATION LAYER

bootstrap.py

Initial system entrypoint.

  • builds controller
  • initializes swarm
  • restores persistent memory
  • launches ncurses dashboard

controller.py

Central cognitive runtime.

  • runs full system cycles
  • coordinates agents, IR, swarm, and memory
  • executes evolution loop per step
  • returns live UI state

run_dashboard.py

NCurses interface runner.

  • renders system state
  • displays agent reasoning
  • shows evolution progress live

🤖 LLM & MODEL LAYER

llm_router.py

Unified abstraction over all LLM providers.

  • OpenAI integration
  • Ollama local models
  • unified .call() interface

model_router.py

Intelligence scheduler.

  • selects best model per task
  • learns performance over time
  • routes reasoning vs generation tasks

🧠 AGENT SYSTEM

agent.py

Individual reasoning units.

  • generate solutions
  • participate in debate
  • execute IR logic

role_manager.py

Dynamic role allocation system.

  • assigns agent responsibilities
  • adapts based on performance
  • supports adversarial roles

⚔️ DEBATE SYSTEM

debate_engine.py

Multi-agent reasoning conflict system.

  • agents compete for best solution
  • scoring determines winner
  • improves reasoning diversity

⚙️ IR COMPILER SYSTEM

ir_engine.py

Executes intermediate representation instructions.

ir_compiler.py

Converts agent reasoning → IR programs.

ir_optimizer.py

Optimizes IR execution paths.


🧬 OPCODE EVOLUTION SYSTEM

opcode_backend.py

Base opcode registry and execution logic.

opcode_swarm_backend.py

LLM swarm-based opcode generation system.

evolving_opcode_swarm.py

Genetic evolution of opcode implementations.

  • mutation
  • selection
  • survival pressure

🧪 EXECUTION & FITNESS SYSTEM

execution_fitness.py

Runs generated code safely.

  • sandbox execution
  • timeout protection
  • runtime scoring

adversarial_tester.py

Generates inputs designed to break code.

  • edge cases
  • hostile inputs
  • robustness testing

🧠 SELF-REPAIR SYSTEM

self_patcher.py

LLM-based automatic code repair.

repair_memory.py

Stores known bug → fix mappings.

  • long-term failure memory
  • reuse of fixes

failure_cluster.py

Groups similar failure types.

  • bug classification system
  • enables predictive fixes

🧬 EVOLUTION MEMORY LAYER

persistent_memory.py

Stores:

  • agent states
  • opcode evolution history
  • system sessions

emergent_language.py

Tracks patterns that evolve into reusable “functions”.


🖥️ VISUALIZATION LAYER

dashboard.py

NCurses UI renderer.

  • agent activity
  • execution traces
  • evolution progress
  • system health

🔁 SYSTEM BEHAVIOR LOOP

1. Input received
2. IR compiled
3. Agents debate
4. Swarm generates code
5. Adversarial tests attack code
6. Execution verifies correctness
7. Failure triggers repair system
8. Repair memory stores fix
9. Evolution selects best variants
10. System repeats

🧠 EMERGENT PROPERTIES

Over time this system develops:

  • stable opcode languages
  • self-correcting behavior
  • reduced failure rate
  • reusable fix patterns
  • model specialization per task

⚠️ DESIGN WARNING

This system executes generated code.

Recommended safeguards:

  • sandbox environment
  • no production filesystem access
  • strict timeout enforcement

🚀 FUTURE EXTENSIONS

  • multi-language opcode compilation (Rust / JS / WASM)
  • distributed swarm execution
  • reinforcement learning reward tuning
  • semantic embedding memory layer
  • full cognitive trace debugger

🧩 MODULE EXPANSION FORMAT

For additional modules:

module_name.py

Purpose: Short description of role in system

Inputs:

  • what it receives

Outputs:

  • what it returns

Connected Systems:

  • dependencies

Evolution Role:

  • generator / validator / optimizer / memory / UI

🧠 SYSTEM STATUS

Self-evolving multi-agent computational intelligence system with adversarial training, execution grounding, and memory-driven repair.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages