DEV Community

Cover image for My Dark Factory Reinvented Sprint Planning
Jamie Duncan
Jamie Duncan

Posted on Originally published at jduncan.io

My Dark Factory Reinvented Sprint Planning

Originally published at jduncan.io.

As of last week, I had pushed roughly 40 billion tokens through Leaf, my local Level 5 dark software factory. Once the core build and review loops felt steady, I couldn't resist poking at what else an unattended fleet could catch on its own.

First, I added an SRE loop. Its job was to watch application health and performance over time: reading end-to-end test results, repository-declared performance benchmarks, and chronic CI/CD failures, then filing bugs whenever performance envelopes or reliability started drifting the wrong way.

That ran alongside my daily dreaming loop, which scans 30-day swaths of telemetry verdicts to catch slow-burn patterns that single-room Analysts miss, plus the single-room Analysts themselves and the Improve loop that looked for dead code and measured code complexity to make the next agent find the right work easier.

Within 24 hours, the factory handed me a surprise I didn't see coming.

Telemetry, SRE, and dreaming were all finding the same issues from different angles. Same root causes, just three different points of view on the same symptom.

That's normal in the real world. What wasn't normal was how my factory handled it. Because my planning room picked up issues one at a time, the factory would grab SRE's ticket, plan a fix, and ship it. Ten minutes later, it would grab Telemetry's ticket for the same underlying flaw and patch it from a slightly different angle.

It turned into a mess fast.

I needed a process that could look across all the open issues for a repository, collate them, strip out the duplicates, set dependencies, and organize them into a coherent batch before any planning room opened.

Oh no. I needed a sprint planning meeting.

What have I done?

Agents rediscovered agile ceremony

My first reaction was to laugh at myself. I spent months trying to strip unnecessary human ceremony out of agent workflows, and the factory's own failure mode walked me right back into backlog grooming.

When you stop and think about the mechanics, though, it makes complete sense.

Every loop was doing its job faithfully. The SRE agent's job wasn't to track performance across the repository; its job was to notice a drifting benchmark or a flaky deploy and file a clean defect report. The Telemetry Analyst's job was to explain why a pod burned 95 turns. The Dreamer's job was to connect three slow rooms over the last month.

Their goal wasn't cross-team coordination. Their goal was to report from their specific point of view.

Human engineering teams have the exact same problem. SRE files a latency alert, QA files a flaky test bug, and a developer files a tech-debt ticket. All three point at the same overloaded query. Sprint planning exists in human orgs because specialist roles naturally generate overlapping symptoms, and someone has to synthesize them before engineers start cutting branches.

Good process isn't always bureaucracy.

Sometimes it's just the shape of the problem.
Sometimes we have to sit and stare at the stickies on the whiteboard.

Building the triage loop

So on Monday, I built a Triage loop right in front of the planning room.

Instead of letting every newly filed bug wake up a PM and Architect on the spot (hotfixes still jump the line), issues now land in a waiting backlog. On a schedule or on demand, a triager agent opens a short sprint-planning pass for a repository. It reads the waiting issues together, closes duplicates, groups related tickets, wires up dependencies, and starts the coherent work as a batch. It only works on issue content and bodies. Just like a human would shuffling cards around a kanban board.

By Tuesday morning, I had staggered triage across repositories in 180-minute slots. Instead of a chaotic drip of single-issue fixes fighting over the same files, work moved in predictable bursts. My plan was to stagger projects across the clock: Project A during business hours, background repos in the evening, keeping the closet shelf humming without stepping on itself.

So close.

Then I broke TypeScript.

The Tuesday morning TypeScript meltdown

Adding the SRE loop, the Triage backlog, and smarter work ranking was the straw that finally snapped the back of Leaf v1's single-threaded Node.js backend.

By Tuesday, the v1 src/ tree had grown to 206 non-test TypeScript files all sharing one Node.js event loop: HTTP API routes, WebSocket streams to five worker hosts, synchronous SQLite queries, git subprocesses, container orchestration, and background admission passes for 60 concurrent pod slots.

The git history from ~/Code/factory preserves the exact smoking gun. The very last commit on the v1 TypeScript codebase (ba4a044e, Tuesday, November 17 at 8:39 AM Eastern) tells the whole story in four lines:

commit ba4a044efabd6cea1efe7c59db5834fcd70c8a65
Date:   Tue Nov 17 08:39:43 2026 -0500

    Restore the cursor walk for Improve and SRE (#4520)

    316c3c2a and a7d41948 replaced the per-loop cursor walk with a ranking
    by attempts, complexity score and git recency. demand() runs on every
    admission pass, so the ranking's extra git log spawn and its full
    files x open-issues filter ran back to back on the main thread. With the
    triage backlog, that stalled the supervisor until its health check
    killed it.
Enter fullscreen mode Exit fullscreen mode

Look at the chain reaction in that commit message.

  1. Both Improve and SRE replaced a cheap cursor walk with a ranking pass that scored files by attempts, complexity, and git recency.
  2. demand() ran on every admission pass, executing the extra git log spawn and a full files x open-issues cross-product filter back to back on the main thread.
  3. Once the new triage backlog kept open issues stacked up instead of draining immediately, that admission pass stalled the Node.js event loop long enough for the supervisor's own health check to declare the process dead and kill it.

And when the supervisor got killed mid-flight, the restarts triggered secondary fallout (commit cc7f910e earlier that same morning had to patch dropped tech-lead commands and re-ask pods whose say calls hit an unreachable Factory API during a restart).

Restoring the cursor walk in ba4a044e stopped the bleeding for the afternoon. It didn't fix the real architecture problem. Running a multi-loop, multi-host orchestration engine on a single-threaded runtime where one heavy loop calculation can starve the API and trip the health check was living on borrowed time.

To be fair to Node.js and TypeScript, I'm not claiming JavaScript can't run backend services. Plenty of huge companies run Node at scale with worker threads, queues, and separate microservices. My factory is a single-binary, closet-shelf control plane where I want one simple process managing SQLite, git repos, host sockets, and a dozen background loops without me babysitting event-loop lag.

That's a Go problem.

Enter Factory v2

The very next morning (Wednesday, November 18), I cut the cord and landed the initial Factory 2.0 build.

It's going to have a better name (I think), and it's taking every hard-won lesson from those 40 billion tokens while ruthlessly deleting the ideas that didn't survive contact with reality. The architecture split is simple:

  • Backend and host agents in Go: The supervisor, bridge, CLI, hook, and hostd worker daemon are all Go now. Real goroutines, real concurrency, and one hard reliability rule baked into the spec: nothing in a background loop gets to delay the API or the health check.
  • Sprint planning as a first-class stage: Triage isn't bolted onto the side anymore. The lifecycle is explicitly Sprint -> Plan -> Build -> Land -> Ship -> Learn, with a strict issue rubric and atomic transactions so overlapping findings get grouped before a planning room ever opens.
  • Frontend stays in TypeScript, with a full UI overhaul: TypeScript is still great where it belongs. The web UI is getting a clean rebuild focused on the live flow, quota meters per subscription pool, and what actually needs my attention.

I'm pushing the first real workloads through v2 right now and shaking out the remaining bugs across the fleet. I hope to unveil the whole thing, new name and all, in the next week or two.

My quotas can't wait.

So what?

If you're stacking multiple autonomous agent loops onto the same codebase, three things fell out of this week's wreckage:

  • Multiple observer loops require a synthesis gate. As soon as you have more than one automated filer (SRE, telemetry, security, complexity), they will report the same root cause in different words. Put a triage step in front of execution so you fix the cause once instead of patching three symptoms.
  • Respect the event loop on control planes. If your orchestrator runs admission logic, git commands, and API health checks on one thread, a growing backlog can turn a harmless O(files x issues) filter into a self-inflicted crash loop.
  • Treat v1 as the spec for v2. Pushing 40 billion tokens through a scrappy TypeScript prototype wasn't wasted effort. It taught me which loops actually move the needle, which ceremonies are real engineering, and exactly where the runtime walls are before I wrote a line of Go.

Top comments (0)