feat(gate): adr-required 索引世界拒引 lifecycle=archived 的 ADR(W1-C1 #164 交付 3,ADR-0053) - #207
Conversation
…;W1-C1 .github#164 交付 3,ADR-0053)
|
Warning Review limit reached
Next review available in: 6 minutes Limit details: You’ve used all 10 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
PR Summary by QodoGate adr-required: reject lifecycle=archived ADR references in index world
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
There was a problem hiding this comment.
Pull request overview
This PR updates the adr-required gate (index-world path) to reject references to ADRs whose lifecycle=archived, enforcing W1-C1 #164 delivery 3 / ADR-0053: archived ADRs are historical backfill and must not be used as new decision basis in new PRs.
Changes:
- Split INDEX parsing output into an “active/superseded mapping” (
/tmp/adr_map.txt) and an “archived set” (/tmp/adr_archived.txt). - Add an early check in index-world validation to fail the gate if a referenced ADR number is in the archived set.
- Update logs/comments to reflect “archived not allowed” in the success path.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| p = e.get("archive_path") | ||
| if not p: | ||
| continue | ||
| num = f"{int(e[\"number\"]):04d}" |
| # 让本步骤的存在性清单与 org-gate v1.4.2 按文件名校验零改动兼容), | ||
| # 正本在 archive 仓 adr/。被引 ADR-NNNN 必须在 INDEX entries 且 | ||
| # archive_path 非空,并 HEAD 校验 archive 正本可达(raw 200)。 | ||
| # archive_path 非空,并 HEAD 校验 archive 正本可达(raw 200); |
…缩进 IndentationError——索引世界首次实跑暴露;兼落地 archived 拒引)
Code Review by Qodo
1.
|
动机
W1-C1(#164 交付 3)收口:adr-required 索引世界(#174 落地)当前只校验"编号在 INDEX entries
∧ archive 正本可达"。#164 要求 lifecycle=archived 的 ADR 不可被新 PR 引用为新决策依据——
archived(编号 0017/0030 一次性破玻璃回填)是历史事件记录,不是可引用的现行决策。
Card: #164
变更(.github/workflows/gate.yml,仅索引世界路径)
adr_map.txt(active/superseded,带 archive_path)+adr_archived.txt(lifecycle=archived 的编号)::error::…生命周期=archived(历史回填,不可作为新 决策依据)→ MISSING=1(引用现行/superseding ADR 或补新 ADR)本地演练(对 live INDEX.yaml @ cd5b2b16,新逻辑精确复算)
有效映射 57 = 59 entries − 2 archived;archived 集合 {0017, 0030}。
在线验证(本 PR 自身即测试载体)
本 PR 改 .github/workflows/(C1 路径)且引用 ADR-0053(active,已迁 archive)——
其 adr-required 运行即索引世界正向实测:INDEX@main 命中 + archive raw 200。
(#164 AC-2 正向证据;负向证据见随后一次性验证 PR。)
风险