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
@@ -0,0 +1,30 @@
# knowledge-index-sort Brief
## 背景
- 用户目标:给 knowledge-index-panel 添加排序功能,支持按日期和标签数量排序
- 当前问题:条目按 ENTRIES 数组原始顺序渲染,用户无法按日期或标签排序查看
- 关联 OpenSpec:`openspec/changes/knowledge-index-sort/`
- devflow 分档:micro
## 范围
- 本次要做:在 filter-row 中添加排序下拉框,支持 4 种排序模式(日期新→旧、旧→新、标签多→少、少→多)
- 本次不做:多列排序、拖拽排序、修改 ENTRIES 数据结构、分页
- 影响区域:`knowledge-index.html`、`scripts/update-knowledge-index.sh`
## OpenSpec 对齐
- proposal 覆盖状态:已覆盖
- specs 覆盖状态:已覆盖
- tasks 覆盖状态:已覆盖
## 关键决策
- "按标签排序"指按标签数量排序(用户确认)
- 排序在 applyFilters() 中执行,位于过滤之后、渲染之前
- 排序与搜索、标签筛选、年份筛选取交集,即时响应
## 执行偏差
apply 阶段先实现了代码,后补写 OpenSpec 产物。已在 decisions.md 中记录并分析根因。此偏差推动了 sm-flow 协议本身的改进(commit gate 文件存在性检查、grill 退出条件 decisions.md 强制写入、archive 退出条件文件验证)。