KB-36E4

RP DOT Cleanup — 08 Next RP Build Plan (author dot-pivot-update)

4 min read Revision 1
registries-pivotnext-macrodot-pivot-updateschema-splitanti-drift2026-06-03

08 — Next RP Build Plan

Immediately usable NOW (no gate, no mutation)

  • RP UI/API consume v_rp_classification_governance_map read-only (doc 07): governed badges, governed-vs-RP-local split, L2 GATED banner, drill-overload chip.
  • Run the anti-drift suite (sql/01_antidrift_checks.sql) on cron / DOT-114 to detect new drift and any L2 false claim (doc 06).

The single blocker to executing cleanup (NOT L2)

RP L1 cleanup is blocked by a tooling gap, not by L2 ratification:

The pivot domain has no update-capable governed DOT.

Next macro: REGISTRIES_PIVOT_DOT_PIVOT_UPDATE_AUTHOR_AND_CLEANUP (owner-go)

  1. Author + register dot-pivot-update (paste-ready proposal: sql/05_proposed_dot_pivot_update.sh). Targeted single-row UPDATE by --code; validates --level ∈ {atom,molecule,compound,meta}, --species ∈ entity_species, --group ∈ FAC-02 tokens ∪ RP-local shapes; --dry-run mode; before/after diff. Register it in dot_tools via the governed DOT-register path (NOT manual UPDATE to dot_tools either — use the dot register tool).
  2. Run Action A (deterministic, no council):
    dot-pivot-update --code PIV-001 --level atomdot-pivot-update --code PIV-016 --level metadot-pivot-update --code PIV-021 --level molecule
    
    Each fires only the statement refresh trigger (matrix_spec NULL, INSERT-birth trigger not fired on UPDATE). Re-run V7/AD-4 → mismatch must drop 3 → 0. Rollback values: PIV-001 molecule, PIV-016 atom, PIV-021 atom.
  3. Council ratifies Action-B FAC-02 targets (doc 05), incl. the LBL-104-vs-new "Quy trình"(LBL-106) decision for the workflow family. Then: dot-pivot-update --code <PIV> --group <token> for each. Re-run AD-6 → backlog 0.
  4. Action D: already inactive; optionally set PIV-020 superseded_by only if a retire DOT is extended to handle already-inactive rows (cosmetic; low priority).

Then: anti-drift schema split (dot-schema-*, no manual DDL)

Stop drift at the source (from prior doc 07):

  1. Split registry_groupdomain_facet (FK/CHECK → FAC-02) + pivot_kind (RP-local enum). Removes category-error #1 structurally.
  2. De-overload composition_level: add drill_level for RP-local drill pivots; restrict composition_level to the governed ladder, derived from species. Makes Action-A-style mismatches self-correcting.
  3. species integrity: CHECK/FK to entity_species.species_code (view already proves 0 orphans — make it enforced).
  4. dot-pivot-declare / dot-pivot-update validate against the governed mapping at declare time → the governed mapping becomes the only way to write.

How to keep free-text drift from returning

  • The view + AD-1/AD-2/AD-5 catch it at read time today.
  • The schema split + declare-time validation prevent it at write time (above).
  • Until the split lands: the view is the contract; the (future) DOT is the only cleanup mechanism; manual UPDATE stays forbidden (G6 / Đ26 §II-QUINQUIES).

When L2 rollout becomes relevant

Not for RP classification — L1 is independent and operational. L2 (ownership/axis/topic, ospa≥1) gates only the separate ONE_ROOF_PRODUCTION_ROLLOUT_EXECUTE_ON_RATIFICATION macro. RP classification can be fully cleaned (Actions A–D) and the schema split shipped with the L2 gate still CLOSED. RP would consume L2 ownership later only if it wants per-pivot ownership attribution — a future, optional integration, not a dependency.

Roadmap

[DONE] view apply
[DONE] DOT cleanup + anti-drift + UI/API handoff  (THIS macro; execution HELD on tooling gap)
  → REGISTRIES_PIVOT_DOT_PIVOT_UPDATE_AUTHOR_AND_CLEANUP   (next; owner-go)
      ├─ author+register dot-pivot-update
      ├─ run Action A (mismatch 3→0)
      ├─ council ratify Action B → run domain assignments (AD-6 → 0)
      └─ design domain_facet / pivot_kind / drill_level split (dot-schema-*)
  ∥ (independent) ONE_ROOF_PRODUCTION_ROLLOUT_EXECUTE_ON_RATIFICATION   (L2, gated ospa≥1)
Back to Knowledge Hub knowledge/dev/reports/architecture/registries-pivot-dot-cleanup-antidrift-ui-api-handoff-2026-06-03/08-next-rp-build-plan.md