principle-sequence-verifiable-units
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSequence work into verifiable units
将工作按可验证单元排序
Order work as a sequence of small units, each ending in a state you can check, and don't advance until the current one is green.
Why: A break caught at the unit that caused it is cheap to localize. A break caught after a batch is buried, and you have already built further on a broken base. Sequencing those same units into a delivery a reviewer can replay turns "trust me" into "watch it go red, then green."
Execution. In a sweep, migration, or any run of similar edits, verify each change before starting the next. Each unit is a before/after bracket: known-good state, one change, run the check, then proceed. Rebase onto clean trunk first so every check measures against the real baseline. When a lever does the edits, the per-unit check is nearly free. Run it anyway.
Delivery. Stack commits and PRs in the order that proves the work. The canonical shape is the failing test first, then the fix on top. Other story orders are a subtraction before the reshape, a baseline capture before the treatment, the scaffold before the feature. Each commit lands on its own and the sequence reads as an argument.
The sequencing complement to the prove-it-works principle skill, which keeps each check real, and the build-the-lever principle skill, which makes the per-unit check cheap.
将工作组织为一系列小型单元,每个单元结束时都处于可检查状态,当前单元未通过检查前不要继续。
**原因:**在导致问题的那个单元上发现故障,定位起来成本很低。若等一批工作完成后才发现,故障就会埋得更深,而且你已经在故障基础上继续构建。将这些相同的单元按 reviewer 能够重放的顺序交付,就能将“相信我”变成“看着它先变红、再变绿”。
**执行。**在 sweep、migration 或任何一系列类似编辑中,开始下一项之前先验证上一项变更。每个单元都构成一个“变更前/后”对照:已知正常状态、一项变更、运行检查,然后继续。先 rebase 到干净的 trunk 上,这样每次检查都以真实基线为准。当某种 lever 执行这些编辑时,逐单元检查几乎不费成本。即便如此,也应运行检查。
**交付。**按照能够证明工作正确性的顺序堆叠 commits 和 PRs。标准形式是先提交 failing test,再在其上提交 fix。其他叙事顺序可以是:先做 subtraction 再 reshape,先捕获 baseline 再进行 treatment,先搭建 scaffold 再实现 feature。每个 commit 都独立合入,整个序列读起来就像一段论证。
这种排序方式与 prove-it-works 原则 skill(让每次检查都真实有效)和 build-the-lever 原则 skill(让逐单元检查成本低廉)互为补充。