Skip to content

chore: 清理治理噪音并支持 evidence 取代关系 - #12

Merged
YanZhiwei merged 1 commit into
mainfrom
chore/governance-noise-cleanup
Oct 29, 2026
Merged

YanZhiwei merged 1 commit into
mainfrom
chore/governance-noise-cleanup

Conversation

@YanZhiwei

Copy link
Copy Markdown
Owner

概要

给历史 evidence 增加显式的“被取代”关系,并把 4 条长期存在的 freshness warning 降为 0 噪音;
保留唯一一条描述当前安装状态的 warning。

动机

  • 4 份 phase-01-* evidence 落后 6 个提交,材料路径变化后持续告警
  • 告警长期存在会让治理检查失去信号价值
  • 直接改写 head 或删除记录会伪造历史,不能接受

变更类型

  • Feature 或新组件
  • Bugfix 或契约修正
  • 重构或简化
  • 文档或治理
  • 依赖升级

当前设计(改前)

  • 入口或组件:scripts/check-governance.ps1 扫描 harness/evidence/*.md
  • 所有者与依赖方向:Harness 拥有 evidence;治理脚本只读校验
  • 当前约束:freshness 只根据 head_revision 与 HEAD 的差异判断,没有“已被取代”的表达

本次改动

位置 改动 原因
scripts/check-governance.ps1 支持 superseded_by;目标必须存在,仅抑制 freshness 显式取代,不改写历史
scripts/test-governance.ps1 新增 2 个场景 覆盖抑制与缺失目标
harness/evidence/phase-01-*.md 4 条记录标记 superseded 指向覆盖同一关注点的较新记录
docs/development/quality-gates.md 记录字段语义与 23 个场景 文档与检查器一致
.specify/feature.json(本地) 删除陈旧指针 机器本地状态,不提交

影响范围

维度 影响 依据
公共 API、命令、配置 无;仅治理脚本字段 check-governance.ps1
持久化或迁移 无 无数据路径变化
兼容性与升级路径 旧 evidence 无需改动;新字段可选 默认行为不变
安全与权限 无 只读检查
性能与资源 无 多一次字段检查
依赖与供应链 无新增依赖 脚本内实现

设计

N/A:治理元数据与检查逻辑,不涉及运行时结构。

架构决策

  • 相关 ADR 已链接,且与 HEAD 的实现一致。
  • 本次没有改变架构决策。

行为与验收

需求 结果 证据
历史记录可表达取代关系 pass 4 条 phase-01-* 已标记
目标缺失必须失败 pass 新增场景 superseded_by target does not exist
抑制只影响 freshness pass 必填字段、result、limitations、build-log 校验保留
告警数量下降 pass 5 → 1

验证

检查 结果 证据
scripts/test-governance.ps1 pass 23 scenarios
-Check governance pass 0 error / 1 warning(当前交付记录)
-Check static pass 0 failing check
scripts/test-static.ps1 pass 3 scenarios
-Check docs pass 64 文件 / 168 目标
git diff --check pass 无空白错误
pwsh -NoProfile -File scripts/quality.ps1
pwsh -NoProfile -File scripts/quality.ps1 -Check governance
pwsh -NoProfile -File scripts/quality.ps1 -Check docs
git diff --check

文档

  • docs/development/quality-gates.md 已说明字段与场景数。
  • 生成投影已同步:本次没有生成投影。
  • 无需文档改动。

回滚

回滚本 PR 会恢复 5 条 warning;旧 evidence 文件本身不受影响。superseded_by 是可选字段,
移除后检查器行为回到原状。

AI 使用披露

  • 使用了 AI 辅助,且每一行改动都经过命令验证和人工审阅。

评审重点

  • “抑制 warning”是否被限制在 freshness,而没有放宽其他治理校验
  • 四份记录的取代目标是否确实覆盖同一关注点
  • 剩余那条 warning 为什么应保留

Checklist

  • 验收条件已覆盖。
  • 阻塞性评审发现已处理。
  • ADR 与 HEAD 一致(本次无 ADR)。
  • 验证证据已附。
  • outgoing diff 与评审范围一致。

- Add `superseded_by` support: a historical evidence file can point at a
  newer record; the target must exist, and only freshness warnings are
  suppressed.
- Mark the four phase-01 records as superseded by the delivery and metadata
  evidence that re-verified the same concerns at later commits.
- Add two governance regression scenarios (21 -> 23).
- Remove the stale machine-local feature pointer and document the field.
@YanZhiwei
YanZhiwei merged commit 00d9c40 into main Oct 29, 2026
14 checks passed
@YanZhiwei YanZhiwei mentioned this pull request Oct 29, 2026
10 of 16 tasks
YanZhiwei added a commit that referenced this pull request Oct 29, 2026
- Record the installed state at the PR #12 merge commit: Bundle 0.1.2,
  13 components, 33 native commands.
- Note the two deliberate config changes since the upgrade and confirm the
  other configs, core skill, and tasks template are unchanged.
- Cite the full quality gate and main Quality run 40802098059 (14/14).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant