test(metaharness): ADR-150 cross-references resolve (iter 106)

iter-91 gated SKILL.md → script-path references. iter-106 applies the
same pattern to the ADR layer: ADR-150 references ADR-151 (Phase-3
scope shell) and ADR-152 (Genome Similarity Search). If either gets
renamed/moved, ADR-150's links rot silently.

Drift scenario:
   - Someone renames `ADR-151-harness-intelligence-layer.md` to
     `ADR-151-phase-3-scope.md` (cleaner slug)
   - ADR-150 still links to the old name
   - Markdown renders but the link 404s
   - Future maintainers reading ADR-150 hit a dead end finding the
     Phase-3 scope

WHAT SHIPPED — smoke step 17z69

  - Extract every `ADR-15[0-9]` reference from ADR-150's body
  - For each ref, assert the matching file exists in v3/docs/adr/
    using glob ADR-NNN-*.md (tolerates slug renames? No — the file
    must literally be there with the ADR-NNN-...md naming).
  - Floor count ≥ 3 (ADR-150 must reference itself + at least 151 + 152)

Current refs: ADR-150, ADR-151, ADR-152 (all resolve)

If a future iter:
  - Renames ADR-151 file but not the ADR-150 references
    → "ADR-151-not-found"
  - Adds an ADR-153 reference without creating the file
    → "ADR-153-not-found"

CROSS-REFERENCE INTEGRITY MATRIX (post-iter-106)

| Direction              | Surface                | Iter |
|------------------------|------------------------|------|
| Source → Target (9 forward)                                  |
|   description string   | SUBCOMMANDS keys       | 73   |
|   SUBCOMMANDS values   | scripts/*.mjs          | 89   |
|   MCP runScript()      | scripts/*.mjs          | 90   |
|   SKILL.md refs        | scripts/*.mjs          | 91   |
|   MCP enum             | SEVERITY_RANK          | 92   |
|   MCP tool names       | CLAUDE.md catalog      | 93   |
|   SUBCOMMANDS keys     | CLAUDE.md catalog      | 94   |
|   CI workflow refs     | tripwire scripts       | 84   |
|   ADR-150 refs         | ADR-NNN files          | 106  |  ◀ this iter
| Target → Source (1 reverse, iter 102)                        |
| Internal consistency (3, iters 103-105)                      |

Thirteen smoke-gated cross-reference surfaces.

GATES THIS ITER
   smoke:    108 → 109 (step 17z69 green)
   contract: 3 ADR references × 3 file-existence checks pass

DOCUMENTATION-LAYER INTEGRITY

Source-code references already gated at multiple layers. iter-106
extends to the ADR layer — the documentation form of cross-reference.
Now both code references AND ADR references have smoke-time existence
gates.

Co-Authored-By: RuFlo <ruv@ruv.net>
This commit is contained in:
ruv committed 2026-06-17 01:02:13 -04:00
1 parent d36c902133
commit f80977b566
1 file changed
+24
@@ -191,6 +191,30 @@ grep -q "execCli(\[\s*'-y'\s*,\s*'metaharness@latest'" "$F" 2>/dev/null || \
grep -q "cwd: opts" "$F" || miss="$miss no-cwd-passthrough"
[[ -z "$miss" ]] && ok || bad "$miss"
step "17z69. ADR-150 cross-references resolve to existing files (iter 106)"
miss=""
# ADR-150's body references ADR-151 and ADR-152 (the Phase-3 scope shell
# and the genome-similarity ADR). If either gets renamed/moved, the
# link in ADR-150 becomes a 404. Same drift class as iter-91's SKILL.md
# refs, applied to the ADR layer.
ADR_DIR="$ROOT/../../v3/docs/adr"
ADR_150="$ADR_DIR/ADR-150-metaharness-integration-surfaces.md"
# Extract every ADR-NNN reference (including 150 itself for completeness)
REFS=$(grep -oE "ADR-15[0-9]" "$ADR_150" 2>/dev/null | sort -u)
COUNT=0
for ref in $REFS; do
COUNT=$((COUNT + 1))
# Find matching file in ADR dir
num=$(echo "$ref" | sed -E 's/ADR-//')
# The file naming convention is ADR-NNN-<slug>.md
if ! ls "$ADR_DIR"/ADR-${num}-*.md 2>/dev/null | head -1 | grep -q . ; then
miss="$miss ${ref}-not-found"
fi
done
# ADR-150 must reference at least its Phase-3 parents (151 + 152) plus self
[[ "$COUNT" -ge 3 ]] || miss="$miss too-few-adr-refs:$COUNT"
[[ -z "$miss" ]] && ok || bad "$miss"
step "17z68. SKILL.md description + argument-hint frontmatter populated (iter 105)"
miss=""
# Companion to iter-104's allowed-tools gate.