KB-2539

RP Classification Cleanup — 05 Verification + Regression Suite

3 min read Revision 1
registries-pivotverificationregressionsql-suite2026-06-03

05 — Verification + Regression Suite (V1–V10)

All read-only. Run any time post-apply; re-run after each DOT cleanup round to confirm convergence. Expected values are today's live baseline (pre-cleanup); after Actions A/D they shift as noted.

# Check Pre-cleanup expected Post-cleanup target
V1 view_rows = base_rows 37 = 37 35 = 35 (after 2 retires)
V2 registry_group_kind domain 15 / shape 22 domain ≥ 21 (after Action B)
V3 FAC-02 exact LBL-101×3, 104×4, 105×2 + provisional rows mapped
V4 species_status clean 31 / missing 4 / ambiguous 2 / orphan 0 missing → 2 (matrix only)
V5 orphan rows 0 0 (invariant)
V6 raw_species='species' flagged ambiguous_meta PIV-016, PIV-103 same (governed meta, kept)
V7 composition_status match 21 / mismatch 3 / drill 9 / no_ref 4 mismatch 0 / drill 9
V8 the 3 real composition bugs PIV-001, PIV-016, PIV-021 0 rows
V9 classification_lane gov_home 15 / rp_local 20 / inactive 2 inactive → 0
V10 L2 gate (no false claim) ospa 0 / own 0 / gap 210 / emit 0 unchanged (invariant)

Live results captured this macro (pre-cleanup) — ALL PASS

V1  37 = 37  (equal=t)
V2  domain=15  pivot_shape=22
V3  LBL-101 Cấu trúc=3 | LBL-104 Công cụ=4 | LBL-105 Giám sát=2
V4  clean=31  missing=4  ambiguous_meta=2   (orphan absent ⇒ 0)
V5  0 rows
V6  PIV-016, PIV-103
V7  match=21  mismatch=3  drill_overload=9  no_ref=4
V8  PIV-001(molecule≠atom) PIV-016(atom≠meta) PIV-021(atom≠molecule)
V9  governance_home=15  rp_local=20  inactive_retire_candidate=2
V10 ospa=0 ownership=0 gap=210 gov_emit=0

Regression invariants (must always hold)

  • R1 no-island: the view copies no data; dropping it leaves base tables untouched (proven via non-destructive rollback test).
  • R2 orphan=0: every non-null species resolves to a governed entity_species.species_code (V5).
  • R3 no L2 false claim: V10 reads the real L2 gate; gap is reported as 210, never 0.
  • R4 row conservation: view_rows = (SELECT count(*) FROM pivot_definitions) always (V1) — guards against join fan-out.
  • R5 base immutability (this macro): pivot_definitions md5 = 5a060f5460c3d9e02c4a6754cdee4fcc unchanged entry→exit.

SQL (canonical file)

/Users/nmhuyen/one-roof-clone-finalization-2026-06-03/sql/rp_classification/verify_v_rp_classification_governance_map.sql — full V1–V10 with inline EXPECT comments. Reproduce V7 quickly:

SELECT composition_status, count(*) FROM v_rp_classification_governance_map
GROUP BY composition_status ORDER BY composition_status;
Back to Knowledge Hub knowledge/dev/reports/architecture/registries-pivot-classification-cleanup-and-view-apply-2026-06-03/05-verification-and-regression-suite.md