今日已更新 56 条资讯 | 累计 41276 条内容
关于我们

Revert Production. Agent Tests Must Fail.

Finley Sun 2026年09月09日 23:53 0 次阅读 来源:Dev.to

A parser patch lands in review at 02:11. Twelve tests sit green beside the diff. Coverage rises nine points before dawn. Two days later a trailing delimiter returns None in production. The agent shipped code and tests together. Reviewers saw one color only. Green never proved the new behavior. It only proved the suite agreed with itself. A lock is not proven by a key you just cut. You prove it by pulling the bolt. The door must swing open. Agent tests need the same motion. Keep the new tests. Restore production files from the merge base. Run the suite again. Something must fail. Call that event a revert witness. No failure means the tests do not pin the patch. They exercise old paths, mirrors, or nothing. Review queues now fill with overnight agent diffs. The pattern is stable across languages. Tests arrive in the same commit as the implementation. Continuous integration reports green. Nobody saw the assertion fail against yesterday's tree. Think of a weigh station on a bridge. Trucks roll across and the gauge never moves. Either the cargo is air or the gauge is painted. Many agent suites paint the gauge. The revert witness is a boot on the scale. Consider a tiny tag parser under review. The old function splits on commas and keeps blanks. # tags.py at the merge base def parse_tags ( raw : str ) -> list [ str ]: if not raw : return [] return raw . split ( " , " ) The agent rewrites the function to strip tokens. It also drops empty pieces. That change is reasonable on its face. The tests decide whether the change is locked. # tags.py after the agent patch def parse_tags ( raw : str ) -> list [ str ]: if raw is None : raise TypeError ( " raw must be a string " ) parts = [] for piece in raw . split ( " , " ): token = piece . strip () if token : parts . append ( token ) return parts A busy agent suite can still stay green after a revert. It checks "a,b" and an empty string. Both results already match the merge base. # test_tags.py — weak suite, no witness from tags impor

本文内容来源于互联网,版权归原作者所有
查看原文