Q: How would an autonomous compounding loop work in Kelly's factory, and what would it look like in practice?¶
Answer:
An autonomous compounding loop is a persistent background agent that, on a schedule, reads its own prior outputs, takes a bounded action, and writes a new output — so each iteration starts from accumulated context rather than a blank slate. This is distinct from Kelly's existing scheduled mechanisms (cron, heartbeat) because those are point-in-time health checks, not accumulated learning loops.
What "compounding" means¶
Kelly's current cron and TaskFlow run on timers and produce outputs, but each run is independent — today's build-health check knows nothing about last week's failures. A compounding loop breaks that independence: the agent reads its own last run's output before starting the next one. Over time, this creates a retrieval-augmented context that grows more valuable with each iteration. yukicapital-ai-ceo-overview
Yuki AI CEO's three production loops make this concrete:
- New AI Models (daily 3am) — scans for new models, evaluates them, opens PRs if warranted. Next run knows which model categories already passed review.
- Bug Autofix (daily 6am) — reads error logs, diagnoses, writes fixes, pushes to main. Next run knows which bug patterns it already resolved.
- SEO Optimizer (weekly) — pulls search console data, rewrites meta tags, creates missing pages, measures impact, auto-reverts bad changes. Next run avoids pages it already improved.
Each loop compounds because the output of run N becomes part of the context for run N+1. yukicapital-ai-ceo-overview
The GUPP foundation¶
Steve Yegge's GUPP (Gas Town Universal Propulsion Principle) provides the execution model: "if there is work on your hook, you MUST run it." The Deacon daemon patrols hooks structurally, kills stuck agents, and re-queues their Beads. The key architectural insight is that GUPP hooks are persistent work items, not ephemeral invocations — a deferred agent resumes where it left off rather than starting fresh. steve-yegge-beads-kelly-gap
Kelly's current factory does not have a GUPP equivalent. The router can defer work via sessions_yield, but there's no architectural enforcement that a deferred sub-agent will resume. The gap analysis identifies this as a medium-high adoption priority. kelly-factory-overview
What a Kelly compounding loop would look like¶
A Kelly-flavored compounding loop lives in the background, is guardrailed in scope, runs on a schedule, reads its own prior output, and writes back a new state. Three candidate loops:
Daily KB maintenance loop¶
- Schedule: Daily, early morning
- Input: Previous day's
compiled/log.md, recentmemory/YYYY-MM-DD.md - Action: Reads last lint pass results, identifies articles that cite missing concepts, writes updated cross-references, appends a
## [YYYY-MM-DD] lint | summaryentry to log.md - Compounds: Each run knows which pages were already cross-referenced, which stale claims were already flagged, which new sources were recently ingested
Weekly research synthesis loop¶
- Schedule: Weekly
- Input: All
compiled/sources/*.mdarticles from the past 7 days - Action: Reads recent ingests, identifies emerging themes or contradictions between new and existing articles, writes a synthesis note to
compiled/reports/synthesis-YYYY-WXX.md - Compounds: Previous synthesis notes establish a baseline; new synthesis can explicitly contrast with prior week's findings
Project health loop¶
- Schedule: Daily
- Input:
projects/*/context.mdfiles, previous day's TEA audit results - Action: Checks for projects with stale context (no update in 5+ days), verifies done markers are current, flags projects where TEA audit PASS-WITH-FOLLOWUPS items are untracked past their follow-up window
- Compounds: Each run knows which projects it already pinged, which follow-ups are already in flight
Why Kelly doesn't have this yet¶
Kelly's gap analysis identifies the missing pattern explicitly. The factory has:
- heartbeat for liveness checks (point-in-time, no memory between runs)
- cron for scheduled tasks (independent invocations, no cross-run state)
- TEA audit for quality gates (runs per-stage, not per-loop)
- pipeline state for stage tracking (doesn't capture agent learning)
None of these mechanisms reads its own prior output and continues. The compounding loop requires a persistent output that the next iteration can demand-load — which is precisely the Beads substrate: a git-versioned, SQL-queryable artifact that the loop reads from and writes to. steve-yegge-beads-kelly-gap
⚠️ GAP: No KB article describes a GUPP hook implementation in Kelly¶
The gap analysis recommends GUPP hook enforcement as a medium-high priority but provides no implementation sketch. The KB has the execution axiom (you MUST run if your hook is non-empty) and the Deacon patrol concept, but no concrete pattern for how Kelly's router or a background agent would implement a hook queue and guarantee resumption. Implementing this would require drawing on Gas Town's Beads-based execution model, which Kelly hasn't yet adopted. kelly-gas-town-gap-analysis
Confidence: MEDIUM¶
The KB provides strong source material for what compounding loops look like (Yuki AI CEO's three loops), the execution model they require (GUPP), and Kelly's current architectural gap (no self-referential scheduled agent). However, there is no article in the KB that synthesizes these into a concrete Kelly implementation pattern — the loop designs above are inferential, not described in any source article.
Sources: yukicapital-ai-ceo-overview · steve-yegge-beads-kelly-gap · kelly-factory-overview · kelly-gas-town-gap-analysis · karpathy-llm-wiki