adr-verify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ADR Verify

ADR 验证

Companion to
adr-index
. After import, reads the persisted graph and surfaces integrity issues:
  • Dangling refs — edge points at an ADR ID that doesn't exist in
    adr-patterns
    . Common cause: the referenced ADR is in a sibling repo or got deleted.
  • Supersede cycles
    ADR-A supersedes ADR-B
    and
    ADR-B supersedes ADR-A
    (or longer cycles). Always data corruption.
  • Status mismatches — an ADR is the source of a
    supersedes
    edge but its own status isn't
    Superseded
    . Usually a missed status update during a successor ADR's promotion.
作为
adr-index
的配套工具。导入完成后,读取已持久化的图谱并识别完整性问题:
  • 悬空引用 —— 关联指向的ADR ID在
    adr-patterns
    中不存在。常见原因:被引用的ADR位于同级仓库中或已被删除。
  • 替代循环 ——
    ADR-A 替代 ADR-B
    ADR-B 替代 ADR-A
    (或更长的循环链)。这属于数据损坏问题。
  • 状态不匹配 —— 某个ADR是
    supersedes
    (替代)关联的源,但自身状态并非
    Superseded
    (已被替代)。通常是在后续ADR升级时遗漏了状态更新。

When to use

使用场景

  • Right after
    adr-index
    to confirm the graph is healthy
  • In CI as a fail-closed gate (
    VERIFY_STRICT=1
    exits 1 on any issue)
  • Before publishing an ADR-related release
  • 在执行
    adr-index
    后立即使用,确认图谱状态健康
  • 在CI流程中作为强制检查关卡(设置
    VERIFY_STRICT=1
    时,任何问题都会导致以状态码1退出)
  • 在发布ADR相关版本前使用

Steps

操作步骤

bash
node plugins/ruflo-adr/scripts/verify.mjs
Optional env:
  • VERIFY_FORMAT=json
    — JSON instead of markdown
  • VERIFY_STRICT=1
    — exit 1 on ANY issue (default: only on cycles)
bash
node plugins/ruflo-adr/scripts/verify.mjs
可选环境变量:
  • VERIFY_FORMAT=json
    —— 输出JSON格式而非markdown格式
  • VERIFY_STRICT=1
    —— 任何问题都会导致以状态码1退出(默认:仅在检测到循环时退出)

Exit codes

退出码

CodeMeaning
0
Graph healthy (or dangling refs / status mismatches present in non-strict mode)
1
Supersede cycle detected, OR strict mode + any issue present
代码含义
0
图谱状态健康(或在非严格模式下存在悬空引用/状态不匹配问题)
1
检测到替代循环,或开启严格模式且存在任何问题

Cross-references

交叉引用

  • adr-index
    — populates the data this skill verifies
  • scripts/import.mjs
    — has its own dry-run validation; this skill is the read-back companion
  • adr-index
    —— 生成本工具需要验证的数据
  • scripts/import.mjs
    —— 自带试运行验证;本工具是其配套的回溯验证工具