# Loop-based software factory to refactor and standardize an entire codebase

Matchpoint Intelligence · 2026 · Codex, Claude Code, Python, SQLite, git worktrees · Role: Sole Developer

## Problem

Our initial implementation for the compatibility matching system was coupled to a Shopify Integration. We needed to refactor and decouple it to make it provider agnostic to allow us to support other markets (like physical dealerships). I had to fold about 20 legacy repos into bounded-context monorepos while also standardizing the platform architecture: 465 work units. That was too much to do by hand, so I built a loop harness (Early 2026) and dependency graph to maximize the throughput.

## First principles

- This was a pre-scoped, well-bounded transition with multiple facets (Refactor, Monorepo transition, Architecture Standardization)
- Work with dependencies can be scheduled like a build graph and executed in independent parallel streams.

## Approach

The Matchpoint Loop Harness:

1. parses work orders into a SQLite ledger, with waves and a dependency graph;
2. picks the next eligible work order and opens a git worktree for it;
3. has a **generator** agent write the change;
4. has a fresh-session **evaluator** check it;
5. has a separate fresh-session **stop-judge** give the verdict;
6. merges development changes automatically and holds production changes for owner approval.

[![One work unit through the Loop Harness: campaign, ledger, frontier and dispatch; then a generator, preflight checks, an evaluator and a stop-judge; then a retry, an owner question, or a merge to Dev, with 465 merged](https://mikereese.dev/static/img/loop-harness-work.png)](https://mikereese.dev/static/img/loop-harness-work.png)

It also has pause, stop and recover controls, and a web console. Extended further with mining agents to proactively identify opportunities for design pattern reuse, operational complexity improvements, and code removal.

[![Telemetry and self-improvement: the sources of record feed collectors, a snapshot, the console and a shipper to AWS; open obligations spawn self-improvement agents, whose work orders go back into the ledger](https://mikereese.dev/static/img/loop-harness-telemetry.png)](https://mikereese.dev/static/img/loop-harness-telemetry.png)

## Skills I taught myself

- **Multi-agent orchestration** with Codex and Claude Code.
- **Building a software factory** which also required the account pool, throughput and efficiency telemetry, and an observability / command center dashboard
- **Ledger-driven scheduling** with SQLite and independent git worktrees.

## Result

A 55.9k-line engine with 152 test files, telemetry stores, and a command center. One run applied a 105-work-order amendment at a concurrency of 6. Max token burn was 2.0B tokens in one day, rotating through 14 Claude Accounts and 3 OpenAI Accounts.

## Command center screenshots

From the console's Telos view, as of 2026-08-08.

[![The Telos view's tripwires: each tripwire's hits, its true, false and unadjudicated dispositions, median time to clear, trend, and extinction status, where a tripwire that never fires is reviewed for deletion](https://mikereese.dev/static/img/loop-harness-tripwires.png)](https://mikereese.dev/static/img/loop-harness-tripwires.png)

[![The Telos view's throughput: median 1.92 h and p90 11.67 h from dispatch to merge, against a pre-Telos baseline of 1.93 h and 69.91 h; a phase waterfall where generation is the widest bar; 81.1% first-pass yield; frontier starvation; and amendment latency](https://mikereese.dev/static/img/loop-harness-throughput.png)](https://mikereese.dev/static/img/loop-harness-throughput.png)

[![The Telos view's recent wins: patterns minted by the standardization process, such as PAT-004 admission permit gate and PAT-025 evidence-command classification, alongside what-worked entries](https://mikereese.dev/static/img/loop-harness-recent-wins.png)](https://mikereese.dev/static/img/loop-harness-recent-wins.png)

[![The console's self-improvement view: each miner's motions and last run, including 50 by the incident miner, 33 by the pattern miner and 11 by the efficiency miner](https://mikereese.dev/static/img/loop-harness-miners.png)](https://mikereese.dev/static/img/loop-harness-miners.png)
