Teaching My Dark Factory to Dream: From Agent Telemetry to Self-Healing Code
Why I deleted 6,000 lines of LLM friction-counting in Leaf and replaced them with SQL flags, an Analyst agent, and a daily Dream pass.
~/Code/jduncan-blog
Engineering, craft, and curiosity.
Self-taught engineer, recovering history major. Tech, woodworking, home automation.
Why I deleted 6,000 lines of LLM friction-counting in Leaf and replaced them with SQL flags, an Analyst agent, and a daily Dream pass.
Post-mortem fixes bloated my dark factory's agent prompts to 17,072 words in 30 days. See what happened when I cut 65% of the rules and moved them to code.
How I built an autonomous security loop in Leaf with Trivy, Semgrep, and an examiner agent, and what its first 289 findings fixed in BrandCast.
After 15.8 billion tokens and 208,649 model turns in Leaf, SWE-bench and static price routers like LiteLLM optimize for the wrong thing. Buy runs, not models.
Interactive agent skills rely on progressive disclosure and human guardrails. My token data shows why unattended 2027 loops need radically smaller context.