harden sm-flow protocol and archive v4.0 validation runs

- Rewrite hard constraint #1: apply must read Committed OpenSpec files as the execution source of truth
- Promote sub-skill invocation to hard constraint #6; remove fallbacks.md and all degradation paths
- Add file existence verification at commit and archive exit gates
- Require grill question pool, evidence-driven conclusions, and user-interview confirmations to be written to decisions.md
- Record v4.0 validation retrospective in workflow.md: propose overreach, sub-skill pseudo-calling, spec omitting user behavior
- Archive knowledge-index-sort OpenSpec and devflow entries from prior run
This commit is contained in:
zhuyongxin
2026-05-26 09:59:24 +08:00
parent 71e0b7f801
commit 63994b6440
11 changed files with 342 additions and 143 deletions
+2 -3
View File
@@ -28,12 +28,12 @@ sm-flow → 编排层(harness):阶段、门控、产物约束、人
以下 6 条是硬约束,违反即流程失败。其余约束按阶段定义在 `references/phase-contracts.md`。
1. **OpenSpec 是唯一执行真理源**。apply 只能基于 Committed OpenSpec 执行。Draft OpenSpec 是讨论对象,不是执行许可。
1. **OpenSpec 是唯一执行真理源**。apply 阶段必须读取 Committed OpenSpec 文件作为执行依据;对话中的描述不等于产物。Draft OpenSpec 是讨论对象,不是执行许可。
2. **不得跳过 context**。生成 OpenSpec 前,必须先读取相关 devflow 上下文(glossary、ADR、历史项目)。
3. **不得跳过 grill**。即使需求看起来很清楚,至少解决三个高价值澄清或验证问题。
4. **不得跳过 commit**。进入 apply 前,Draft OpenSpec 必须通过 commit 检查成为 Committed OpenSpec。
5. **冲突必须先分类再处理**。OpenSpec 不准(规格遗漏)→ 修正 OpenSpec;代码偏离(实现偏差)→ 修正代码;不确定或涉及设计方向 → 暂停并等待用户确认。
6. **降级执行必须标注**。fallback 产物必须标注为降级执行,不能伪装成真实子 skill 调用。
6. **子 skill 必须显式调用**。每个阶段指定的子 skill 必须显式调用;如果子 skill 不存在,流程失败,不得静默跳过或降级执行。
每个阶段的过程约束(question pool、one-at-a-time、cross-artifact 对齐、冲突回写等)和质量约束(可观测产出要求)见 `references/phase-contracts.md` 中对应阶段的退出条件和 checkpoint。
@@ -55,7 +55,6 @@ sm-flow → 编排层(harness):阶段、门控、产物约束、人
- 需要执行阶段时,先读取 `references/phase-contracts.md`;如果当前阶段涉及接口影响分级、分档、启动规则、快速模式或完成标准,再补读 `references/operating-rules.md`。
- 创建或更新 PRD、ADR、验收报告、词汇表、复合知识文档时,读取 `references/templates.md`。
- archive 阶段或需要从 OpenSpec 提取产物时,读取 `references/archive-rules.md`。
- 子 skill 无法直接调用时,读取 `references/fallbacks.md`。
## 内部阶段