verification-before-completion
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVerification Before Completion
完成前的验证
Overview
概述
Claiming work is complete without verification is dishonesty, not efficiency.
Core principle: Evidence before claims, always.
Violating the letter of this rule is violating the spirit of this rule.
未经验证就宣称工作完成是不诚信的行为,而非高效。
核心原则: 始终先有证据,再做宣称。
违反规则的字面表述即违反规则的精神内核。
The Iron Law
铁律
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCEIf you haven't run the verification command in this message, you cannot claim it passes.
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE如果未运行此消息中的验证命令,则不能宣称任务已通过。
The Gate Function
门禁机制
BEFORE claiming any status or expressing satisfaction:
1. IDENTIFY: What command proves this claim?
2. RUN: Execute the FULL command (fresh, complete)
3. READ: Full output, check exit code, count failures
4. VERIFY: Does output confirm the claim?
- If NO: State actual status with evidence
- If YES: State claim WITH evidence
5. ONLY THEN: Make the claim
Skip any step = lying, not verifying在宣称任何状态或表达满意之前:
1. 确定:什么命令可以证明该宣称?
2. 执行:运行完整的命令(全新、完整的执行)
3. 读取:查看完整输出,检查退出代码,统计失败次数
4. 验证:输出是否确认了宣称的内容?
- 如果否:结合证据说明实际状态
- 如果是:结合证据做出宣称
5. 只有此时:才能做出宣称
跳过任何步骤 = 说谎,而非验证Common Failures
常见失误
| Claim | Requires | Not Sufficient |
|---|---|---|
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
| Linter clean | | Partial check, extrapolation |
| Format clean | | Visual inspection, assumption |
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
| Regression test works | Red-green cycle verified | Test passes once |
| Agent completed | VCS diff shows changes | Agent reports "success" |
| Requirements met | Line-by-line checklist | Tests passing |
| Code quality gates | | Tests passing |
| 宣称内容 | 所需验证条件 | 不充分的验证方式 |
|---|---|---|
| 测试通过 | 测试命令输出:0个失败项 | 之前的运行结果、“应该能通过” |
| 代码检查无问题 | | 部分检查、推断 |
| 代码格式规范 | | 视觉检查、假设 |
| 构建成功 | 构建命令:退出码0 | 代码检查通过、日志看起来正常 |
| 漏洞已修复 | 针对原始症状的测试通过 | 代码已修改、假设已修复 |
| 回归测试可用 | 已验证红绿色循环(Red-green cycle) | 测试通过一次 |
| Agent已完成任务 | 版本控制系统(VCS)差异显示有变更 | Agent报告“成功” |
| 需求已满足 | 逐行核对清单 | 测试通过 |
| 代码质量门禁已通过 | | 测试通过 |
Red Flags - STOP
危险信号 - 立即停止
- Using "should", "probably", "seems to"
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
- About to commit/push/PR without verification
- Trusting agent success reports
- Relying on partial verification
- Thinking "just this once"
- Tired and wanting work over
- ANY wording implying success without having run verification
- 使用“应该”、“可能”、“似乎”等词汇
- 未验证就表达满意(如“太棒了!”、“完美!”、“完成了!”等)
- 未验证就准备提交/推送/创建拉取请求(PR)
- 信任Agent的成功报告
- 依赖部分验证
- 抱有“就这一次”的想法
- 因疲惫而想结束工作
- 任何未运行验证就暗示成功的表述
Rationalization Prevention
合理化借口规避
| Excuse | Reality |
|---|---|
| "Should work now" | RUN the verification |
| "I'm confident" | Confidence does not equal evidence |
| "Just this once" | No exceptions |
| "Linter passed" | Linter does not equal compiler |
| "Agent said success" | Verify independently |
| "I'm tired" | Exhaustion does not equal excuse |
| "Partial check is enough" | Partial proves nothing |
| "Different words so rule doesn't apply" | Spirit over letter |
| 借口 | 实际情况 |
|---|---|
| “现在应该可以正常运行了” | 运行验证命令 |
| “我很有信心” | 信心不等于证据 |
| “就这一次” | 没有例外情况 |
| “代码检查已通过” | 代码检查不等于编译验证 |
| “Agent说成功了” | 独立进行验证 |
| “我累了” | 疲惫不能成为借口 |
| “部分检查就足够了” | 部分检查无法证明任何事情 |
| “表述不同所以规则不适用” | 规则精神优先于字面表述 |
Key Patterns
关键模式
Tests:
CORRECT: [Run test command] [See: 34/34 pass] "All tests pass"
WRONG: "Should pass now" / "Looks correct"Regression tests (TDD Red-Green):
CORRECT: Write -> Run (pass) -> Revert fix -> Run (MUST FAIL) -> Restore -> Run (pass)
WRONG: "I've written a regression test" (without red-green verification)Build:
CORRECT: [Run build] [See: exit 0] "Build passes"
WRONG: "Linter passed" (linter doesn't check compilation)Lint and Format (BLOCKING GATE):
CORRECT: [Run pnpm lint:fix] [See: 0 errors] [Run pnpm format] [See: no changes] "Lint and format clean"
WRONG: "Code looks formatted" / "No obvious lint issues" / "Should be clean"Requirements:
CORRECT: Re-read plan -> Create checklist -> Verify each -> Report gaps or completion
WRONG: "Tests pass, phase complete"Agent delegation:
CORRECT: Agent reports success -> Check VCS diff -> Verify changes -> Report actual state
WRONG: Trust agent report测试:
正确做法:[运行测试命令] [查看结果:34/34 通过] “所有测试通过”
错误做法:“应该能通过了” / “看起来是对的”回归测试(测试驱动开发TDD的红绿色循环):
正确做法:编写测试 -> 运行(失败)-> 还原修复代码 -> 运行(必须失败)-> 恢复修复代码 -> 运行(通过)
错误做法:“我已经编写了回归测试”(未验证红绿色循环)构建:
正确做法:[运行构建命令] [查看结果:退出码0] “构建成功”
错误做法:“代码检查已通过”(代码检查不验证编译情况)代码检查与格式化(强制门禁):
正确做法:[运行 pnpm lint:fix] [查看结果:0个错误] [运行 pnpm format] [查看结果:无变更] “代码检查与格式化均合规”
错误做法:“代码看起来格式规范” / “没有明显的代码检查问题” / “应该是合规的”需求:
正确做法:重新阅读计划 -> 创建核对清单 -> 逐项验证 -> 报告差距或完成情况
错误做法:“测试通过,阶段完成”Agent委托任务:
正确做法:Agent报告成功 -> 检查VCS差异 -> 验证变更内容 -> 报告实际状态
错误做法:信任Agent的报告Why This Matters
为什么这很重要
From failure analysis:
- "I don't believe you" - trust broken
- Undefined functions shipped - would crash
- Missing requirements shipped - incomplete features
- Time wasted on false completion -> redirect -> rework
- Violates: "Honesty is a core value. If you lie, you'll be replaced."
从失败案例分析来看:
- “我不信任你”——信任破裂
- 发布了未定义的函数——会导致崩溃
- 发布了未满足需求的功能——功能不完整
- 因虚假的完成宣称浪费时间——需要重新调整、返工
- 违反了:“诚信是核心价值观。如果你撒谎,将会被替换。”
When To Apply
应用场景
ALWAYS before:
- ANY variation of success/completion claims
- ANY expression of satisfaction
- ANY positive statement about work state
- Committing, PR creation, task completion
- Moving to next task
- Delegating to agents
Rule applies to:
- Exact phrases
- Paraphrases and synonyms
- Implications of success
- ANY communication suggesting completion/correctness
始终在以下操作前应用:
- 任何形式的成功/完成宣称
- 任何表达满意的表述
- 任何关于工作状态的正面陈述
- 提交代码、创建PR、标记任务完成
- 切换到下一个任务
- 委托任务给Agent
规则适用于:
- 确切表述
- 改写和同义词
- 暗示成功的表述
- 任何表明完成/正确性的沟通内容
The Bottom Line
底线
No shortcuts for verification.
Run the command. Read the output. THEN claim the result.
This is non-negotiable.
验证没有捷径。
运行命令。读取输出。然后再宣称结果。
这是不容协商的。
Memory Protocol (MANDATORY)
记忆协议(强制要求)
Before starting:
Read
.claude/context/memory/learnings.mdAfter completing:
- New pattern ->
.claude/context/memory/learnings.md - Issue found ->
.claude/context/memory/issues.md - Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
开始前:
读取
.claude/context/memory/learnings.md完成后:
- 新的模式 -> 写入
.claude/context/memory/learnings.md - 发现的问题 -> 写入
.claude/context/memory/issues.md - 做出的决策 -> 写入
.claude/context/memory/decisions.md
假设会被中断:如果未记录到记忆中,就等同于未发生过。