RP DOT Cleanup — 06 Anti-Drift Health Suite (AD-1..AD-9)
06 — Anti-Drift Health Suite
Goal: stop free-text classification drift from returning, and detect a false L2 claim, using read-only checks over the live mapping view + governed truth. SQL: sql/01_antidrift_checks.sql (9 checks) and sql/02_health_view_optional.sql (one-row dashboard view, held, not applied).
The 9 checks (validated live 2026-06-03)
| id | sev | detects | live result | threshold / alert if |
|---|---|---|---|---|
| AD-1 | CRITICAL | new literal species='species' not contained |
0 | > 0 |
| AD-2 | ERROR | orphan species (non-governed code) | 0 | > 0 |
| AD-3 | WARN | missing species on active gov-home pivot | 0 | > 0 |
| AD-4 | ERROR | composition mismatch (real bug) | 3 (PIV-001/016/021) | > 3 (NEW one appeared) |
| AD-5 | WARN | registry_group_kind = unknown (RP/domain conflation) | 0 | > 0 |
| AD-6 | INFO | provisional domain, no FAC-02 label (naming backlog) | 6 | tracked, not alerted |
| AD-7 | CRITICAL | L2 false claim (gate not closed) | false | true |
| AD-8 | ERROR | view/base row-count parity | true (37=37) | equal=false |
| AD-9 | WARN | island scan (forked classification table) | 0 | > 0 |
Each check the mission named is covered:
- new literal species='species' → AD-1
- missing species → AD-3
- composition mismatch → AD-4
- RP-local/domain conflation → AD-5
- orphan species → AD-2
- L2 false claim → AD-7
Dashboard query (single row, all verdicts)
The folded one-row form is sql/02_health_view_optional.sql → v_rp_classification_health. Until applied, the equivalent inline query (in 01_antidrift_checks.sql header / and the live-validated combined SELECT) returns the same columns. Healthy state = all ok_* columns true, ok_l2_gate_closed_no_false_claim = true.
Alert thresholds (recommended)
- PAGE (critical): AD-1 > 0, AD-7 = true (someone activated/mis-reported L2).
- TICKET (error): AD-2 > 0, AD-4 > 3, AD-8 equal=false.
- REVIEW (warn): AD-3 > 0, AD-5 > 0, AD-9 > 0.
- BACKLOG (info): AD-6 — drive to 0 by ratifying Action-B naming (doc 05).
AD-4 baseline is 3 (the known PIV-001/016/021 mismatches) and drops to 0 once the future dot-pivot-update applies Action A. Re-baseline AD-4 to 0 after that run; any reappearance is then a true regression.
Scheduling options (no daemon, no new infra)
dot-pivot-health(DOT-114, cron) can carry these as an extra check block.- Or a read-only cron
psql -f sql/01_antidrift_checks.sqlpiped to the alerting channel. No writes, so no Đ26/DOT constraint applies to reading.
Why the health VIEW is held (not applied)
This macro performs zero production mutation. v_rp_classification_health is inert and read-only, but creating it is still a persistent prod DDL change outside the authorized scope ("safe RP classification cleanup via DOT"). It is paste-ready and validated; apply on explicit owner-go exactly as the mapping view was applied (single inert DDL via ssh). Rollback: DROP VIEW v_rp_classification_health;.