test(metaharness): ADR-152 refs resolve + ADR-151 scope-refs documented (iter 107)

iter-106 gated ADR-150's cross-references. iter-107 extends to ADR-152
(which only references existing ADRs) AND adds a structural assertion
to ADR-151 (which references the not-yet-created ADR-153-156 by design).

THE TWO ASYMMETRIC ADRs

   ADR-152 (Genome Similarity Search):
      - References ADR-150 (parent: Phase 1+2)
      - References ADR-151 (parent: Phase-3 scope)
      - All refs MUST exist → standard cross-reference gate

   ADR-151 (Phase-3 scope shell):
      - References ADR-150 (parent)
      - References ADR-152 (existing child)
      - References ADR-153, 154, 155, 156 (future children, scope-only)
      - The future ADRs are INTENTIONALLY referenced before they exist;
        ADR-151's design is to scope-lock them
      - File-existence gate would fail here for the WRONG reason

WHAT SHIPPED — smoke step 17z70

  - ADR-152: iter-106 style file-existence check on every ADR ref
  - ADR-151: structural assertion that:
      (a) explicitly contains "scope-only" or "scope only" marker
      (b) explicitly references ADR-153, 154, 155, 156 (the 4 future ADRs)
    If a future iter:
      - Drops the scope-only marker  → "adr151-no-scope-only-marker"
      - Forgets to mention any of 153-156 → "adr151-missing-ADR-NNN"

The dual-check pattern lets each ADR be gated by the rule that
applies to it:
   - "all refs exist"   for ADRs with hard cross-refs
   - "scope-refs named" for the scope-shell ADR

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

| Direction              | Surface                | Iter |
|------------------------|------------------------|------|
| Source → Target (10 forward)                                 |
|   ADR-150 refs         | ADR files              | 106  |
|   ADR-152 refs         | ADR files              | 107  |  ◀ this iter
| Target → Source (1 reverse, iter 102)                        |
| Internal consistency (4, iters 103-105 + 107)               |
|   ADR-151 scope marker | 153-156 references     | 107  |  ◀ this iter

Fourteen smoke-gated surfaces.

GATES THIS ITER
   smoke:    109 → 110 (step 17z70 green)
   contract: ADR-152's 3 refs verified + ADR-151's 4 scope markers anchored

OBSERVATION

Different ADRs have different reference semantics. Implementation ADRs
(150, 152) make hard cross-references. Scope-shell ADRs (151) make
forward references to future ADRs that don't exist yet. The smoke
gate distinguishes these via STRUCTURAL assertions specific to each
ADR's pattern, not a one-size-fits-all rule.

Co-Authored-By: RuFlo <ruv@ruv.net>
This commit is contained in:
ruv committed 2026-06-17 01:07:06 -04:00
1 parent f80977b566
commit 6638530ba8
1 file changed
+30
@@ -191,6 +191,36 @@ 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 "17z70. ADR-152 cross-references resolve + ADR-151 scope-refs documented (iter 107)"
miss=""
ADR_DIR="$ROOT/../../v3/docs/adr"
# ADR-152 (Genome Similarity Search) references only existing ADRs:
# ADR-150, ADR-151. Both must resolve. Same gate as iter-106 but for
# ADR-152's body.
ADR_152="$ADR_DIR/ADR-152-genome-similarity-search.md"
REFS=$(grep -oE "ADR-15[0-9]" "$ADR_152" 2>/dev/null | sort -u)
COUNT=0
for ref in $REFS; do
COUNT=$((COUNT + 1))
num=$(echo "$ref" | sed -E 's/ADR-//')
if ! ls "$ADR_DIR"/ADR-${num}-*.md 2>/dev/null | head -1 | grep -q . ; then
miss="$miss ADR-152-ref-${ref}-not-found"
fi
done
[[ "$COUNT" -ge 2 ]] || miss="$miss adr152-too-few-refs:$COUNT"
# ADR-151 references ADR-153-156 (scope-only, to-be-created). Verify
# these are explicitly documented as scope-only in ADR-151's body
# (per the "each sub-capability gets its own ADR" pattern from iter 34).
ADR_151="$ADR_DIR/ADR-151-harness-intelligence-layer.md"
grep -q "scope-only\|scope only" "$ADR_151" 2>/dev/null || miss="$miss adr151-no-scope-only-marker"
# ADR-151 must reference 153, 154, 155, 156 as the 4 future ADRs
for n in 153 154 155 156; do
grep -q "ADR-${n}" "$ADR_151" 2>/dev/null || miss="$miss adr151-missing-ADR-${n}"
done
[[ -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