The Bug Report Is Not a Spec: Extracting Invariants Before an OSS Patch
说明与用途
该工作流程为开源项目提供“不变式门”机制:捕获问题、编写精确不变式、编码为失败测试、模型验证,只有在不变式通过后才提交补丁。
问题
Bug reports often lack clear specifications, leading volunteers to submit patches that compile but violate the original contract.
结果
The invariant gate prevents accidental contract changes by ensuring any patch is grounded in a documented, testable invariant.
工作流
- Freeze the issue by capturing issue data, base commit, and repro command.
- Write a one‑sentence invariant describing actor, input, and observable.
- Encode the invariant as a characterization test that fails on the base SHA.
- Run the test, record output, and comment if it passes without a patch.
- Invite a model to attack the invariant, reviewing potential flaws before patching.
证据
The missing artifact is not another review persona. It is a written invariant that can fail on purpose.
If the new test passes on the base SHA, do not invent a patch anyway.
- 记录日期: 2026-09-08T04:29:49.898Z