Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

One Test Must Flip, One Must Not: A Pairing Gate for Agent Patches

说明与用途

配对测试门确保速率限制器补丁修复边界错误而不改变正确行为。

问题

A sliding‑window rate limiter allowed one request too many at the window boundary, causing a silent 429 without an outage. The bug was hard to reproduce and patches risked breaking unrelated behavior.

结果

The pairing gate prevented two faulty patches and ensured that only a correct fix was merged, preserving existing behavior and improving test reliability.

工作流

  • 1. Identify the edge‑case bug in the rate limiter.
  • 2. Write a flip test that reproduces the failure at the window boundary.
  • 3. Write a guard test that verifies unchanged behavior for adjacent cases.
  • 4. Create a shell script (gate.sh) to run both tests on a clean checkout.
  • 5. Run the gate before applying any patch; reject if guard is red or flip is green.
  • 6. Apply candidate patch only after pre‑patch state is verified.
  • 7. Re‑run the gate to confirm flip turns green and guard stays green.
  • 8. If additional side effects are detected, add more guard tests (e.g., caller‑collection).

证据

The gate refuses to evaluate a patch until the pre‑patch state is proven.

来源

The first patch produced a flip test that was already green — I had written the test against the patched tree.

来源

  • 记录日期: 2026-09-20T03:15:16.212Z