KB-409A
Mission S111-COUNT-VERIFY Report (moved from root)
4 min read Revision 1
reports111count-verifylegacy-misplacedmoved-2026-05-07
Mission S111-COUNT-VERIFY Report
Date: 2026-03-12 | PR: #491 | Status: COMPLETE
Note: Moved from root path
mission-count-verify-reportto canonical location on 2026-05-07 (OGV-2B cleanup).
Assembly Gate
- PG count(), pg_stat_user_tables, count() FILTER — all built-in PostgreSQL. No custom code.
- No new Nuxt UI component — using existing SharedDirectusTable
- readItems() already in use — only changed data source and label 3-5. N/A
Files Modified
- PG function refresh_registry_counts() on VPS (via DOT)
- web/pages/knowledge/registries/index.vue (header label + crosscheck)
- dot/bin/dot-pg-views-ensure v3.0.0
3 Independent Counting Methods (6/3=2)
| CAT | Type | count_a | count_b | count_c | orphan | check |
|---|---|---|---|---|---|---|
| CAT-000 | catalog | 20 | 20 | 20 | 0 | KHOP |
| CAT-001 | table | 20 | 20 | 20 | 0 | KHOP |
| CAT-002 | module | 4 | 4 | 4 | 0 | KHOP |
| CAT-003 | workflow | 2 | 2 | 2 | 0 | KHOP |
| CAT-004 | workflow_step | 70 | 70 | 70 | 0 | KHOP |
| CAT-005 | wcr | 3 | 3 | 0 | 0 | KHOP |
| CAT-006 | dot_tool | 108 | 108 | 108 | 0 | KHOP |
| CAT-007 | page | 37 | 37 | 37 | 0 | KHOP |
| CAT-008 | collection | 106 | 106 | 106 | 0 | KHOP |
| CAT-009 | task | 6 | 6 | 0 | 0 | KHOP |
| CAT-010 | agent | 6 | 6 | 6 | 0 | KHOP |
| CAT-011 | checkpoint_type | 31 | 31 | 31 | 0 | KHOP |
| CAT-012 | checkpoint_set | 2 | 2 | 2 | 0 | KHOP |
| CAT-013 | entity_dependency | 254 | 254 | 254 | 0 | KHOP |
| CAT-014 | table_proposal | 0 | 0 | 0 | 0 | KHOP |
| CAT-015 | checkpoint_instance | 44 | 44 | 0 | 0 | KHOP |
| CAT-016 | changelog | 783 | 783 | 0 | 783 | KHOP |
| CAT-017 | system_issue | 31 | 31 | 0 | 31 | KHOP |
Orphan Investigation (814 total)
CAT-016 changelog: 783 orphans (100% of records)
- registry_changelog table has code column but ALL 783 records have NULL code
- Reason: changelog entries created by Directus Flows do not assign PREFIX-NNN codes
- These are log/audit records, not entities needing unique IDs
- Status: EXPECTED BEHAVIOR, not a data integrity issue
CAT-017 system_issue: 31 orphans (100% of records)
- system_issues table has code column but ALL 31 records have NULL code
- Reason: created by DOT tools (e.g. dot-id-collision-check) without code assignment
- Status: EXPECTED BEHAVIOR — issue tracking records, not registry entities
Collections without code column (count_c=0, orphan=0):
- CAT-005 wcr (workflow_change_requests): no code column
- CAT-009 task (tasks): no code column
- CAT-014 table_proposal (table_proposals): no code column
- CAT-015 checkpoint_instance (checkpoint_instances): no code column
- Status: CORRECT — orphan_count correctly shows 0 for these
Header Fix: 18 vs 20
- v_registry_counts has 18 real entity types
- meta_catalog has 20 rows (18 + CAT-ALL aggregate + CAT-999 uncategorized)
- Header now shows: "18 loai thuc the (+ 2 tong hop)"
- This is consistent: table shows 20 rows, header explains 18 are real
Verify Production — ALL PASS
- Summary: 1527 atoms, 18 types, 814 orphans
- Header label: "18 loai thuc the (+ 2 tong hop)" — PASS
- Navigation: 5 items (Knowledge, Modules, Tasks, Workflows, Registries) — PASS
- Crosscheck: all 18 types show KHOP via Directus API — PASS