Date: 2026.01.27
Focus: Forensic audit of the "Ralph Wiggum Loop" codebase
This report analyzes the structural evolution and technical "DNA" of Wreckit, identifying the legacy layers and the strategic impact of the new RLM architecture.
- Mechanism: spwaning
claudeorampas external child processes. - Evidence:
src/agent/process-runner.ts(extracted from the monolithicrunner.ts). - DNA Signature: Use of
<promise>COMPLETE</promise>signals and manual stdout/stderr buffering. Brittle but highly compatible.
- Mechanism: Integration of
@anthropic-ai/claude-agent-sdk. - Evidence:
src/agent/dispatcher.tsand theAgentConfigUnionschema. - DNA Signature: Discriminated unions (
kind: "claude_sdk") used to bridge the gap between "dumb" processes and "smart" in-process SDK calls.
- Mechanism: Recursive Language Models via
JSRuntime. - Evidence:
src/agent/rlm-runner.tsandsrc/agent/rlm-tools.ts. - Innovation: Moving the prompt from the model's context window to a sandboxed Node
vm. This represents a fundamental shift from "Prompt Engineering" to "Context Engineering".
- The Git God-Object:
src/git/index.tsis a 1200+ line monolith handling everything from branch cleanup to secret scanning. It uses a global mutex to serialize all operations—a legacy of historical concurrency issues. - State Machine Fragility: The "truth" of item states is scattered across three files:
states.ts,phase.ts, anditemWorkflow.ts. Desynchronization here is a high risk. - Pattern Duplication: Every workflow phase (research, plan, implement) implements its own
while(attempt < maxAttempts)retry loop with nearly identical validation logic. - The Deprecation Trail: 11
@deprecatedmarkers currently exist inrunner.tsandindex.ts. The codebase is in a state of "permanent transition".
- Z.AI Proxy: The system forces Z.AI support by mapping
ANTHROPIC_AUTH_TOKENto the SDK'sapiKeyfield and overriding theapiURL. - Manual JIT Context: The skill loader (Item 033) injects files into the agent's context just-in-time, a precursor to the full RLM "offloaded context" model.
- The "I SEE YOU" Pattern: A specific confirmation message used to verify that agents have successfully bypassed their context window to read offloaded data.
- Extract PhaseExecutor: Consolidate the duplicated retry/validation loops into a single service.
- Modularize Git: Split the 1200-line git module into
git/branch.ts,git/pr.ts, andgit/status.ts. - Unified State truth: Centralize the state progression logic into
states.tsand have the workflow derive from it programmatically.
- Core Engine:
src/agent/ - State Machine:
src/domain/ - Workflow Runner:
src/workflow/itemWorkflow.ts - Self-Healing:
src/agent/healingRunner.ts