05 — PIVOT_MISSING x14 Resolution
— 05 PIVOT_MISSING x14 RESOLUTION
Source of the number: PIVOT_MISSING = 14 is exactly the count of v_registries_pivot_node_contract rows with count_status = 'PIVOT_MISSING' (also reflected in v_registries_pivot_surface). The UI pivot tree has 39 nodes = 25 pivot_backed + 14 PIVOT_MISSING. (A different grain — leaf-level v_count_integrity — reports 138 pivot_missing; that is the per-registry-leaf integrity metric surfaced by /api/registries-pivot/summary, not the UI node metric. Both are reported, neither hidden.)
A node is flagged PIVOT_MISSING when its warning_flags carry count_missing=true, i.e. the node has no scalar count_value. Classifying all 14 by pivot_kind, result existence, and classification_lane:
| class | n | nodes | meaning | verdict |
|---|---|---|---|---|
| BY_DESIGN_TABLE_NO_SCALAR | 9 | PIV-101,102,103,104,105,106,201,202,203 | cross_table / l2_drill pivots that HAVE pivot_results; they render as drill tables, so they legitimately have no single count badge | not a defect |
| DATA_EMPTY_LEVEL | 3 | PIV-204,205,206 | l2_drill for composition levels Material / Product / Building that have no entities -> no pivot_results | expected blocker (empty-state) |
| RETIRE_PHANTOM | 2 | PIV-020, MTX-TEST | PIV-020 _uncategorized Total and MTX-TEST Test Matrix; classification_lane=inactive_retire_candidate, no results | deprecated -> deactivate |
Conclusion: none of the 14 is a genuine production break. The dominant 9 are a node-contract semantics artifact — the UI flags cross_table/l2_drill nodes as PIVOT_MISSING when it should render them as drill tables. The 3 empty-level nodes are valid empty states (no entities at that level). The 2 phantoms (a synthetic uncategorized total and a test matrix) should be deactivated (is_active=false) so they leave the UI tree.
Resolution plan (view v_rp_pivot_missing_resolution_plan):
- BY_DESIGN_TABLE_NO_SCALAR: UI/node-contract fix — treat cross_table/l2_drill as table-rendering nodes, do not mark PIVOT_MISSING. No data change.
- DATA_EMPTY_LEVEL: show empty-state, optionally hide until data exists. No error.
- RETIRE_PHANTOM: deactivate PIV-020 and MTX-TEST. This is a data write to pivot_definitions and is left to the operator/owner (not executed; no authority to deactivate here).
Guard: v_rp_pivot_missing_no_false_green_guard returns PASS_ALL_PIVOT_MISSING_EXPLAINED (total=14, explained=14, unexplained=0). No PIVOT_MISSING is unexplained, and the count is not hidden. Views: v_rp_pivot_missing_inventory_v2, v_rp_pivot_missing_resolution_plan, v_rp_pivot_missing_no_false_green_guard.