08 — Pivot-Only Count Design + PIVOT_MISSING
title: 08 — Pivot-Only Count Design + PIVOT_MISSING date: 2026-05-30
08 — Pivot-Only Count Design + PIVOT_MISSING
Rule: every number = pivot_count()/pivot_query() over is_active pivots. No Nuxt math. Missing ⇒ PIVOT_MISSING + proposed row.
Per-number map — VERIFIED canonical pivots (live 2026-05-30)
Registries total → PIV-001=169 · UI tables → PIV-002=21 · Modules → PIV-003=5 · Workflows/steps/wcr → PIV-004/005/006=2/70/3 · DOT → PIV-007=309 (overrides stale CAT-DOT.record_count=307) · Pages → PIV-008=37 (meta CAT-007 actual=52 → drift) · Collections → PIV-009=168 · Tasks/comments/approvals → PIV-010/021/207=10/75/211 · Agents → PIV-011=6 · Checkpoint types/sets → PIV-012/013=31/2 · Entity deps → PIV-014=142 · Triggers → PIV-015=107 · Species → PIV-016=42 (overrides page "178,030") · Species-collection map → PIV-017=164 · Audit queue → PIV-018=1 · Birth → PIV-019=964,607 (meta CAT-023 actual=943,726 → drift) · Catalog/species/DOT/collection grouped → PIV-101/102/106/103/104/105 + v_pivot_dot_by_category (child layers, not totals) · L2 species per level → PIV-201/202/203=66/47/33 · Level totals (pivot page) → v_pivot_by_level(+species) · Birth matrices → MTX-L1-OVERVIEW/MTX-L2-ATOM=964,607.
Canonical-total rule: node total uses the PIV-0xx total pivot for its source_object; PIV-1xx/2xx/MTX-* grouped pivots are child layers, never summed (prevents meta_catalog 169-vs-164 and dot_tools 309-vs-16 double-count).
Counting-integrity drift — VERIFIED (record_count vs actual_count)
CAT-ALL 1,666,499 vs 1,919,748 · CAT-023 964,607 vs 943,726 · CAT-006 309 vs 163 · CAT-CMP 423 vs 326 · CAT-MAT 0 vs 55 · CAT-007 37 vs 52 · CAT-MOL 774 vs 766 · CAT-DOT 307 vs NULL · CAT-COL 168 vs NULL · CAT-SPE 42 vs NULL → pervasive. Resolution (P2): refresh_meta_catalog_from_pivot() under Điều 32; until then show pivot + badge drift.
Stale/unknown display
stale (needs_refresh=true; 3 today incl MTX-L1-OVERVIEW last 2026-05-11) → value + amber badge, never recompute. unknown → live pivot_count or "—". drift → red badge "stored≠pivot" + evidence link.
PIVOT_MISSING
PM1 grand-total objects → PIV-500 (v_pivot_by_level SUM), GOV-COUNCIL, P1 · PM2 Information Units → PIV-310 (information_unit), GOV-COUNCIL, P1 · PM3 KG edges total/by type → PIV-320 (v_kg_edges_all), GOV-KG-SYS, P1 · PM4 drift count → v_count_drift + test_counting_contract(), GOV-SIV, P1 · PM5 stale count → expose pivot_results.needs_refresh via v_living_lists, GOV-SIV, P2 · PM6 total active pivots → PIV-330 (pivot_definitions), GOV-SIV, P2 · PM7 orphan totals → PIV-501/view, GOV-SIV, P2 · PM8 child_status_breakdown → grouping pivots via pivot_matrix, per-domain, P2 · PM9 missing birth/iu/dot/pivot coverage → anti-join views, GOV-SIV, P2 · PM10 per-species→entity grandchild → species-scoped pivots once entity_species tree built, GOV-COUNCIL, P3.
No page number originates in Nuxt — each cell → a pivot_code or PIVOT_MISSING (Điều 26 + Điều 32 gated).
Agent-proposed registry-list columns (data-driven)
Count (pivot_count) · Species (entity_species) · Composition Level (meta_catalog.composition_level) · Source Table (source_object) · Pivot Code (count_pivot_code) · Drift Status (test_counting_contract) · Birth Status (birth_registry) · IU Status (information_unit) · DOT Status (dot_tools) · Governance Owner (domain-map) · Last Refreshed (pivot_results.refreshed_at) · Warnings (derived) · Next Action (derived). Columns shown depend on node_type; none computed in frontend.