Menu

Run Less, Prove More: Diff-Scoped Test Gating for Agent Patches
πŸ“°

Run Less, Prove More: Diff-Scoped Test Gating for Agent Patches

DEV Community: cicdΒ·Finley ZhouΒ·12 days ago
#Sim5ZK58
#devtocicd#devto#dev#suite#tests
Reading 0:00
15s threshold

An agent patch rarely needs your whole suite. It needs a scope you can defend line by line, and a safety net over everything the scope excludes. Most review pipelines get this backwards: they run everything, watch it go red at random, and then learn nothing about which failure the patch actually caused.

This is a selection strategy, not a speed trick. The gate runs a narrow set of tests, emits a receipt explaining why each test was included, and escalates to the full suite whenever a widening trigger fires. Flaky tests are frozen separately β€” and a freeze is only granted once a property check covers the same behavior.

The cost is a product, not a number

Write the cost down before optimizing it. For a patch p :

cost(p) = |selected(p)| * t_avg + |frozen| * t_skip + widen(p) * |full| * t_avg

Enter fullscreen mode

Exit fullscreen mode

widen(p) is binary here on purpose. Either a trigger fired or it did not.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.