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

The Agent Reintroduces a Bug You Already Fixed in an Earlier Session

Описание и применение

АИ‑агент может вернуть ранее исправленную ошибку, если не закрепить её тестом. Добавление регрессионного теста, названного по инварианту, и его обязательное прохождение в CI делает исправление долговечным.

Задача

An AI coding agent can reintroduce a bug that was previously fixed because it has no memory of past fixes, leading to regressions that are hard to detect until a regression test fails.

Результат

By encoding invariants as executable tests and keeping them close to the code, teams prevent AI agents from reintroducing previously fixed bugs, even across refactors.

Рабочий процесс

  • 1. Identify the bug and fix it in the current session.
  • 2. Add a regression test that reproduces the original failure (red) and passes after the fix.
  • 3. Name the test after the invariant, not the implementation.
  • 4. Add a short comment only for non‑obvious constraints.
  • 5. If the bug depends on a boundary, add an end‑to‑end test that drives the real path.
  • 6. Commit the corrected code, the regression test, and the comment together.
  • 7. Run the test against the previous commit to confirm it would have caught the original failure.
  • 8. Make the test a merge requirement so every future session must pass it.

Доказательства

An agent has no memory of a fix it made in a previous session, so nothing structurally stops it from reintroducing the exact bug you already paid to remove.

Источник

Write the regression test before considering the bug closed.

Источник

If the bug lived across a layer transition, a unit test is insufficient — drive the real path and assert the observable outcome.

Источник

  • Дата записи: 2026-11-01T06:28:47.994Z