Ouroboros Self-Reflective Metaprogramming & Repair Engine

Ouroboros Self-Reflective Metaprogramming & Repair Engine

@q00/ouroboros·v2.0.0·core

A recursive self-reflective metaprogramming engine for DeepSeek Harness. Delivers runtime loop detection, automated compilation error recovery, and self-healing test-driven development (TDD).

Self-Repair · TDD · Metaprogramming · Debugging

GitHubNPM
Installation & Integration
bash
manager:
$ pnpm add @q00/ouroboros

Architecture

Ouroboros Evolution gives autonomous agents the resilience to diagnose and repair their own mistakes. Even the most capable LLMs generate code with occasional syntax mistakes, failing test assertions, or subtle library version conflicts. This plugin implements a self-reflective TDD feedback loop on top of Cordis. When a sandbox execution fails, Ouroboros captures the compiler stack trace and failing test names, isolating the exact failure boundary. It prompts the model with targeted diagnostic diffs, iterating systematically until all test suites turn green.

Core Features

01

Automated TDD Self-Healing: Uses green unit tests as the objective standard for success

02

Stack Trace Distillation: Prunes verbose runtime noise to present only fatal fault lines

03

Reflection Loop Hard Cap: Enforces max attempt thresholds to prevent infinite retry loops

04

Fix Pattern Memorization: Automatically records successful repairs into long-term memory

Core Workflow

01

Execution Fault Capture

Captures compiler errors, unhandled rejections, and failing test assertion stacks.

02

Root-Cause Boundary Isolation

Filters noise to isolate exact source file line numbers causing the failure.

03

Hypothesis & Patch Synthesis

Agent reasons through the error trace and generates a minimal refactoring patch.

04

Sandbox Regression Re-run

Re-executes test suites in the sandbox until all assertions pass cleanly.

Configuration Parameters Reference (YAML / JSON)

ParameterTypeDefaultDescription
maxRepairAttemptsnumber5Maximum repair iterations allowed per failure
autoCommitOnSuccessbooleantrueAutomatically commit git diff when tests pass
testCommandstringnpm testCommand executed to verify bugfix assertions