Step 13: A warning is a green light
Step 13: A warning is a green light
The thirteenth step of the harness I put around my coding agents: a check fails or says nothing, never a warning, because an agent fixes only what turns it red.
Part of the series: Codebase Harness, Step by Step · View all parts
Previously in this series: Step 12: Gaming the gate
A colleague used to tell me: if the build is green, nobody reads the warnings. I said they were right there in the log. He was right, and with agents it is worse: an agent fixes what turns the check red, nothing else. So a check fails, or it says nothing.
Two dimensions. A guide acts before the agent, a sensor after. Each is inferential, judged by a model, or computational, decided by a program. Inferential guides are what the agent reads, AGENTS.md, a skill, a plan, sharper written in the literature's words; computational guides are deterministic tools, a codemod, a generator, a command that acts in the agent's place, code mode, where the agent writes a program instead of a string of actions, a language server. Inferential sensors are a review by a model or a person; computational sensors are the type checker, the linter, tests and fitness functions. Each practice moves a judgement toward computation, and the computational sensor is the optimum.
- 4 · literature in skills
- 5 · skills
- 1 · type checker
- 2 · linter
- 3 · dead code
- 6 · fitness functions
- 7 · plan in phases
- 8 · files per phase
- 9 · model per phase
- 10 · snapshot
- 11 · state machine
- 12 · anti-gaming
- 13 · no warningstoday
In Birgitta Böckeler's grid of guides and sensors, a warning is a computational sensor wired to no one: the program decides, and the decision reaches neither the agent nor you. The series' map: Guides and Sensors: Mapping Your Attention to Free It
In practice, look for what your tools report without failing. My gate was green, and oxlint still held nine disable comments that silenced nothing: it reports those as warnings, exit 0. One flag makes them errors: --report-unused-disable-directives-severity=error.
knip does the same with its configuration hints: printed, never failing, unless treatConfigHintsAsErrors is set. Each tool has its quiet channel. Find it, and make it fail.
The limit: a new rule with hundreds of old violations cannot go red tomorrow. Those belong in a baseline the gate reads, not in a warning nobody does.
Google learnt it at scale. The Clang team turned new checks into compiler errors, "not a warning, which the Clang team found Google developers ignored". By 2018, their C++ and Java builds had no warnings at all. Sadowski et al., CACM 2018: Lessons from Building Static Analysis Tools at Google
If you want an example, here is my lint step, an unused disable comment an error like any other: lbdremy/phax/scripts/lint-baseline.ts
A thought after reading?
If you would like to discuss about this article, you can write to me here. I share because I care and I want to learn. Please teach me with care.