Skip to content
Scalpels home

Sign up now for $10 in credit on a new Laravel Cloud account.

Guide

Continuously improve your software with Scalpels and Solo

The ledger

· Ed Grosvenor

An hourly loop lives or dies on what it remembers. Without memory it reports the same slow query every hour, files the same issue twelve times by lunch, and has no idea what "since the last run" means.

The conductor keeps that memory in a single Solo scratchpad called Improvement ledger, rather than in its own conversation, so a fresh conductor can pick up exactly where the last one left off. It reads the ledger at the start of every run and writes it at the end. Because it is a scratchpad, you can open it in Solo at any time and see exactly what the loop believes.

Create it

Ask any Solo agent in the project to create it with scratchpad_write, tagged improvement-loop, from orders/ledger.md in the companion code. It looks like this:

# Improvement ledger

## Last run

- finished_at: never
- covered_until: 2026-10-15T00:00:00Z

## Apps

| Name | Repository | Scalpels team | Hone app_deployment | Hone app | Wake app_deployment | Wake app |
| --- | --- | --- | --- | --- | --- | --- |
| Storefront | acme/storefront | acme | … | … | pending | pending |

## Open findings

| Fingerprint | Todo | Issue | First seen | Last seen | Hits |
| --- | --- | --- | --- | --- | --- |

## Runs

<!-- One line per run, newest last. -->

Set covered_until to the moment you want the first run to start reading from. A day ago is a good start. That is enough to prove the loop finds something, but not so much that the first run files twenty issues.

Each section's job

Last run. covered_until is the end of the window the last successful run read. The next run reads from there to now. If a run fails halfway, it does not move covered_until, so the next run covers the gap. That is what makes it safe for the loop to miss a run. If the Mac was off for a weekend, Monday's first run reads the whole weekend.

Apps. The map from what you need. Adding an app to the loop is adding a row. Each tool is its own Scalpels deployment, so each needs its own app_deployment beside the id your app has inside that tool. Copy both from what the tool itself returns.

Write pending in both cells for a tool you have not connected yet. That word is part of the loop's vocabulary. The conductor skips a pending tool and says so in its summary. It does not treat it as an app it failed to read, so it also does not hold covered_until back. The row above is an ordinary, working row, and the loop runs perfectly well on Hone alone until Wake is connected.

Open findings. Every problem the loop has filed and not yet closed, keyed by a fingerprint. A fingerprint is a short, stable name for the problem that does not change from one hour to the next. The fingerprint is how the conductor knows the slow query it sees today is the same one it filed yesterday. Investigations defines the fingerprints.

Runs. Each run gets one line with when it ran, the window it covered, and how many findings were new, repeated, or resolved. When you want to know whether the loop is earning its keep, this is where you look.

Two rules that keep it honest

  • Write with the revision. Every scratchpad write takes an expected_revision. If the revision has moved, something else edited the ledger since the conductor read it. The conductor rereads and merges instead of overwriting.
  • One run at a time. The script that rings the conductor will not ring it while it is still busy. As a second guard, the conductor takes a Solo lock called improvement-loop with lock_acquire before it reads the ledger, and releases it with lock_release when it is done. If the lock is already held, the run stops without doing anything.

Need help setting up automation to keep your Laravel app healthy?

These agencies and freelancers are standing by and ready to help.

  • Scott Keck-Warren

    Michigan

    PHP and Laravel developer with 13 years of experience building and maintaining production apps. US Eastern, English.

    Freelancer Ask for help
    Ask Scott Keck-Warren for help