决策记录验证_adr-verify

决策记录验证_adr-verify
以下为本文档的中文说明adr-verify 是架构决策记录验证工具,作为 adr-index 的配套技能使用。在导入架构决策记录后,该工具会读取持久化的决策关系图谱,检查并报告三类完整性问题。第一类是悬挂引用,即某个边缘指向的 ADR ID 在 adr-patterns 命名空间中不存在,常见原因是引用的 ADR 位于兄弟仓库中或已被删除。第二类是替代循环,即出现 ADR-A 替代 ADR-B 而 ADR-B 又替代 ADR-A 的循环依赖(或更长的循环链),这类问题通常表示数据损坏。第三类是状态不匹配,即某个 ADR 是替代关系边的来源,但其自身状态却未被标记为已替代,通常是在替代 ADR 晋升时遗漏了状态更新。使用场景包括:在运行 adr-index 后立即验证决策图谱的健康状态;在持续集成流水线中作为故障关闭门禁,当设置 VERIFY_STRICT1 环境变量时遇到任何问题都会以退出码 1 终止;在发布与 ADR 相关的版本之前进行完整性检查。核心原则是确保架构决策记录之间的关系图始终保持一致和完整,任何不一致都被视为需要立即修复的问题。该工具在 CI 环境中作为强制门禁运行时效果最佳,能够防止带有损坏决策关系图的代码被合并。ADR VerifyCompanion toadr-index. After import, reads the persisted graph and surfaces integrity issues:Dangling refs— edge points at an ADR ID that doesn’t exist inadr-patterns. Common cause: the referenced ADR is in a sibling repo or got deleted.Supersede cycles—ADR-A supersedes ADR-BandADR-B supersedes ADR-A(or longer cycles). Always data corruption.Status mismatches— an ADR is the source of asupersedesedge but its own status isn’tSuperseded. Usually a missed status update during a successor ADR’s promotion.When to useRight afteradr-indexto confirm the graph is healthyIn CI as a fail-closed gate (VERIFY_STRICT1exits 1 on any issue)Before publishing an ADR-related releaseStepsnodeplugins/ruflo-adr/scripts/verify.mjsOptional env:VERIFY_FORMATjson— JSON instead of markdownVERIFY_STRICT1— exit 1 on ANY issue (default: only on cycles)Exit codesCodeMeaning0Graph healthy (or dangling refs / status mismatches present in non-strict mode)1Supersede cycle detected, OR strict mode any issue presentCross-referencesadr-index— populates the data this skill verifiesscripts/import.mjs— has its own dry-run validation; this skill is the read-back companion3e:[“,,,L41”,null,{“content”:“$42”,“frontMatter”:{“name”:“adr-verify”,“description”:“Read back adr-patterns adr-edges namespaces, surface dangling refs / supersede cycles / status mismatches; exit 1 on cycles”,“argument-hint”:“”,“allowed-tools”:“Bash mcp__claude-flow__memory_list mcp__claude-flow__memory_retrieve”}}]3f:[“KaTeX parse error: Expected }, got EOF at end of input: …,children:[[”,“div”,null,{“className”:“flex items-center justify-between border-b border-border bg-muted/30 px-4 py-2.5”,“children”:[[“KaTeX parse error: Expected }, got EOF at end of input: …,children:[”,“span”,null,{“className”:“truncate text-xs font-medium text-muted-foreground”,“children”:“同仓库更多 Skills”}]}],[“KaTeX parse error: Expected EOF, got } at position 88: …ldren:同仓库}]]}̲],[”,“div”,null,{“className”:“p-4 sm:p-5”,“children”:[[“,h2,null,id:related−skills−heading,className:text−2xlfont−semiboldtracking−normaltext−foreground,children:同仓库更多Skills],[,h2,null,{id:related-skills-heading,className:text-2xl font-semibold tracking-normal text-foreground,children:同仓库更多 Skills}],[,h2,null,id:related−skills−heading,className:text−2xlfont−semiboldtracking−normaltext−foreground,children:同仓库更多Skills],[”,“div”,null,{“className”:“mt-4 grid gap-3 sm:grid-cols-2”,“children”:[“L43,L43,L43,L44”,“L45,L45,L45,L46”,“L47,L47,L47,L48”]}]]}]]}]49:I[206516,[“/_next/static/chunks/051aanbhrv4br.js”,“/_next/static/chunks/0mizr60h7ayzt.js”,“/_next/static/chunks/0v9lm1dmbdoo-.js”,“/_next/static/chunks/0rxr1j1j3j-.r.js”,“/_next/static/chunks/02ftybezfvqjd.js”,“/_next/static/chunks/0.v9ksvnnj8ia.js”,“/_next/static/chunks/0bn6id96nx3k.js,“/_next/static/chunks/13ybnhn37c.tc.js”,“/_next/static/chunks/0_fnrdtruz8uf.js”,“/_next/static/chunks/0r6l15utt1mwb.js”,“/_next/static/chunks/0dm9a5into854.js”,/_next/static/chunks/07k6hqoibtcn.js”,“/next/static/chunks/0b4cao.4y…j.js”,“/_next/static/chunks/02i-n28z7kjd0.js”],“default”]