← NotesAI3 min read

The mess agents leave that no build catches

Docs pointing at files that moved, files that never stop growing, allowlists that only grow. Small stuff that piles up, and the four gates I use against it.

Janus
Janus

My agents work 24/7 and I spend my time on setup, review, validation and the clients (more on that in this note). The build itself is rarely the problem: strict languages, a fat test suite, an adversarial review before every commit and a strict CI catch most of what breaks.

What none of that catches is the slow shit. A doc names a file that moved last week, a file keeps growing because it's the one the agent already has open, an allowlist gets one more line because adding your case to it is the shortest way to green. Each one is tiny, and after a few hundred agent sessions you get a repo where the docs mislead and the next agent reads 3,000 lines to change one.

Gates instead of more rules

My first reflex was more rules in the AGENTS.md. Agents follow rules most of the time, and most of the time isn't enough over a few hundred sessions, so a rule nothing enforces gets broken sooner or later. groundskeep checks the state of the repo (not what the agent did) with four gates: 1. paths fails when any text file (docs, comments, CI, scripts) names a repo path that doesn't exist, 2. size fails when a file grows past a line limit, 3. chars bans strings in a set of files, like em dashes in UI copy or a leftover TODO(agent), 4. ratchet fails when an allowlist gains a line or a count goes up compared with the base commit, unless the commit message says why.

Old mess is fine, new mess fails

That's what makes it usable on a real repo. You run it once, write today's exceptions to a baseline, and from then on new problems fail while old ones can only go away. Fix part of a 1,300-line file (example) and the gate asks you to lower the number in the baseline, fix all of it and it asks you to delete the line. No big cleanup week that never happens.

Written for the agent

Most of the time the one reading a finding is another agent, so every finding says where, what and how to fix it, and there's a JSON output for bots. "This file is over 1,000 lines, split it along a seam so each part holds one concern" is something an agent can act on, a red cross in CI mostly gets you a creative workaround.

Where it came from

Every gate exists because its failure happened more than once in a production codebase of about 750k lines that agents work in every day. It's one Rust binary, works with any language, runs in CI (there's a GitHub Action), and it ships with two extras: an AGENTS.md template where every rule names the thing that enforces it, and the kit I use for whole-repo audits by a team of agents, where every finding carries its evidence and a second agent tries to refute it.

Code is on GitHub: groundskeep, MIT or Apache-2.0, that's it.

New notes by email. No spam.

By subscribing you agree that Brevo stores your email to send you new notes. You confirm once by email, and every email has an unsubscribe link. Privacy note