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

Freeze One Function's I/O Table, Then Change One Branch

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

Метод заморозки таблицы ввода-вывода функции перед рефакторингом. Создайте JSONL-оракул с наблюдаемыми значениями, затем безопасно рефакторите, сверяясь с оракулом.

Задача

Refactoring messy modules with hidden branches can silently break callers. Coding models rewrite entire files and drop rare conditions without a frozen oracle, leading to new outage modes.

Результат

A reproducible test oracle that captures all observable I/O behaviors of a function, enabling safe refactoring without silent regressions.

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

  • Isolate the target function into a thin module without renaming branches or magic numbers
  • Identify all observable I/O: return payloads, raised exception types, numeric delays, message text prefixes
  • Build a fixture matrix covering all branches including max attempts, missing retry_after headers, auth failures, and unknown HTTP status codes
  • Generate JSONL rows for each test case capturing args, result, and error
  • Use the JSONL oracle as a regression baseline before refactoring
  • Verify refactored code produces identical I/O by replaying the JSONL

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

I/O means every value a caller can observe. Return payloads count as observable I/O. Raised exception types also count as I/O.

Источник

Coding models will rewrite the entire file on request. They drop rare conditions without a frozen oracle.

Источник

  • Дата записи: 2026-09-13T20:01:24.592Z