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

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

说明与用途

在重构前冻结函数I/O表的技术。创建JSONL预言机记录可观察的I/O值,然后在回归保护下安全重构。

问题

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