用途:为 loom 计划生成 before/after 验证对,证明某阶段确实改变了系统行为,区分“本阶段使其工作”与“它本来就能工作”。
主要能力:before_stage 与 after_stage 均为 Vec<TruthCheck>,由计划作者编写。before_stage 在 worktree 创建后、会话启动前运行,失败则阶段进入 Blocked 且不启动会话;after_stage 在 loom stage complete 期间、acceptance 通过后运行,失败则阶段保持 Executing。每个检查超时 30 秒。TruthCheck 字段包括 command(必填)、exit_code(默认 0)、stdout_contains、stdout_not_contains、stderr_empty、description。
使用方式:新功能用 before 失败、after 成功;缺陷修复方向相反,before 复现成功(缺陷存在)、after 复现失败(缺陷消失)。after 状态还可用 acceptance、wiring、artifacts 验证。所有路径相对 working_dir,不得使用 ../ 或重复路径。
限制:before_stage 在全新 worktree 中运行,复现器必须已存在于基础分支;负向 exit_code 断言较脆弱,建议配合 stdout_contains/stdout_not_contains。简单文件存在、纯知识阶段、纯质量门禁不建议使用。truths 已不再是独立字段,行为命令应放入 acceptance。