Dieu43 Health H11: Description Coverage
-- H11 Description Coverage (Fix C — Đ43 v1.2 rev 6 §9.1) -- Reports count of rows with NULL or empty description per table (public schema). -- Static UNION ALL because readonly role cannot execute dynamic SQL.
SELECT table_name, missing_count FROM ( SELECT 'agents'::text AS table_name, count()::bigint AS missing_count FROM agents WHERE description IS NULL OR description = '' UNION ALL SELECT 'ai_discussions'::text AS table_name, count()::bigint AS missing_count FROM ai_discussions WHERE description IS NULL OR description = '' UNION ALL SELECT 'binding_registry'::text AS table_name, count()::bigint AS missing_count FROM binding_registry WHERE description IS NULL OR description = '' UNION ALL SELECT 'block_library'::text AS table_name, count()::bigint AS missing_count FROM block_library WHERE description IS NULL OR description = '' UNION ALL SELECT 'checkpoint_sets'::text AS table_name, count()::bigint AS missing_count FROM checkpoint_sets WHERE description IS NULL OR description = '' UNION ALL SELECT 'checkpoint_type_overrides'::text AS table_name, count()::bigint AS missing_count FROM checkpoint_type_overrides WHERE description IS NULL OR description = '' UNION ALL SELECT 'checkpoint_types'::text AS table_name, count()::bigint AS missing_count FROM checkpoint_types WHERE description IS NULL OR description = '' UNION ALL SELECT 'collection_field_standards'::text AS table_name, count()::bigint AS missing_count FROM collection_field_standards WHERE description IS NULL OR description = '' UNION ALL SELECT 'collection_registry'::text AS table_name, count()::bigint AS missing_count FROM collection_registry WHERE description IS NULL OR description = '' UNION ALL SELECT 'context_trigger_sources'::text AS table_name, count()::bigint AS missing_count FROM context_trigger_sources WHERE description IS NULL OR description = '' UNION ALL SELECT 'design_templates'::text AS table_name, count()::bigint AS missing_count FROM design_templates WHERE description IS NULL OR description = '' UNION ALL SELECT 'directus_files'::text AS table_name, count()::bigint AS missing_count FROM directus_files WHERE description IS NULL OR description = '' UNION ALL SELECT 'directus_flows'::text AS table_name, count()::bigint AS missing_count FROM directus_flows WHERE description IS NULL OR description = '' UNION ALL SELECT 'directus_policies'::text AS table_name, count()::bigint AS missing_count FROM directus_policies WHERE description IS NULL OR description = '' UNION ALL SELECT 'directus_roles'::text AS table_name, count()::bigint AS missing_count FROM directus_roles WHERE description IS NULL OR description = '' UNION ALL SELECT 'directus_users'::text AS table_name, count()::bigint AS missing_count FROM directus_users WHERE description IS NULL OR description = '' UNION ALL SELECT 'dot_config'::text AS table_name, count()::bigint AS missing_count FROM dot_config WHERE description IS NULL OR description = '' UNION ALL SELECT 'dot_coverage_required'::text AS table_name, count()::bigint AS missing_count FROM dot_coverage_required WHERE description IS NULL OR description = '' UNION ALL SELECT 'dot_domain_rules'::text AS table_name, count()::bigint AS missing_count FROM dot_domain_rules WHERE description IS NULL OR description = '' UNION ALL SELECT 'dot_operations'::text AS table_name, count()::bigint AS missing_count FROM dot_operations WHERE description IS NULL OR description = '' UNION ALL SELECT 'dot_tools'::text AS table_name, count()::bigint AS missing_count FROM dot_tools WHERE description IS NULL OR description = '' UNION ALL SELECT 'entity_species'::text AS table_name, count()::bigint AS missing_count FROM entity_species WHERE description IS NULL OR description = '' UNION ALL SELECT 'globals'::text AS table_name, count()::bigint AS missing_count FROM globals WHERE description IS NULL OR description = '' UNION ALL SELECT 'help_collections'::text AS table_name, count()::bigint AS missing_count FROM help_collections WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_acl_config'::text AS table_name, count()::bigint AS missing_count FROM kg_acl_config WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_auto_approve_rules'::text AS table_name, count()::bigint AS missing_count FROM kg_auto_approve_rules WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_constraint_config'::text AS table_name, count()::bigint AS missing_count FROM kg_constraint_config WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_priority_templates'::text AS table_name, count()::bigint AS missing_count FROM kg_priority_templates WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_signal_config'::text AS table_name, count()::bigint AS missing_count FROM kg_signal_config WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_source_authority'::text AS table_name, count()::bigint AS missing_count FROM kg_source_authority WHERE description IS NULL OR description = '' UNION ALL SELECT 'kg_thresholds'::text AS table_name, count()::bigint AS missing_count FROM kg_thresholds WHERE description IS NULL OR description = '' UNION ALL SELECT 'law_jurisdiction'::text AS table_name, count()::bigint AS missing_count FROM law_jurisdiction WHERE description IS NULL OR description = '' UNION ALL SELECT 'meta_catalog'::text AS table_name, count()::bigint AS missing_count FROM meta_catalog WHERE description IS NULL OR description = '' UNION ALL SELECT 'modules'::text AS table_name, count()::bigint AS missing_count FROM modules WHERE description IS NULL OR description = '' UNION ALL SELECT 'os_expenses'::text AS table_name, count()::bigint AS missing_count FROM os_expenses WHERE description IS NULL OR description = '' UNION ALL SELECT 'os_invoice_items'::text AS table_name, count()::bigint AS missing_count FROM os_invoice_items WHERE description IS NULL OR description = '' UNION ALL SELECT 'os_items'::text AS table_name, count()::bigint AS missing_count FROM os_items WHERE description IS NULL OR description = '' UNION ALL SELECT 'os_project_templates'::text AS table_name, count()::bigint AS missing_count FROM os_project_templates WHERE description IS NULL OR description = '' UNION ALL SELECT 'os_projects'::text AS table_name, count()::bigint AS missing_count FROM os_projects WHERE description IS NULL OR description = '' UNION ALL SELECT 'os_tasks'::text AS table_name, count()::bigint AS missing_count FROM os_tasks WHERE description IS NULL OR description = '' UNION ALL SELECT 'system_issues'::text AS table_name, count()::bigint AS missing_count FROM system_issues WHERE description IS NULL OR description = '' UNION ALL SELECT 'table_proposals'::text AS table_name, count()::bigint AS missing_count FROM table_proposals WHERE description IS NULL OR description = '' UNION ALL SELECT 'table_registry'::text AS table_name, count()::bigint AS missing_count FROM table_registry WHERE description IS NULL OR description = '' UNION ALL SELECT 'tasks'::text AS table_name, count()::bigint AS missing_count FROM tasks WHERE description IS NULL OR description = '' UNION ALL SELECT 'taxonomy'::text AS table_name, count()::bigint AS missing_count FROM taxonomy WHERE description IS NULL OR description = '' UNION ALL SELECT 'taxonomy_facets'::text AS table_name, count()::bigint AS missing_count FROM taxonomy_facets WHERE description IS NULL OR description = '' UNION ALL SELECT 'ui_pages'::text AS table_name, count()::bigint AS missing_count FROM ui_pages WHERE description IS NULL OR description = '' UNION ALL SELECT 'universal_rule_registry'::text AS table_name, count()::bigint AS missing_count FROM universal_rule_registry WHERE description IS NULL OR description = '' UNION ALL SELECT 'workflow_categories'::text AS table_name, count()::bigint AS missing_count FROM workflow_categories WHERE description IS NULL OR description = '' UNION ALL SELECT 'workflow_change_requests'::text AS table_name, count()::bigint AS missing_count FROM workflow_change_requests WHERE description IS NULL OR description = '' UNION ALL SELECT 'workflow_steps'::text AS table_name, count()::bigint AS missing_count FROM workflow_steps WHERE description IS NULL OR description = '' UNION ALL SELECT 'workflows'::text AS table_name, count()::bigint AS missing_count FROM workflows WHERE description IS NULL OR description = '' ) h WHERE missing_count > 0 ORDER BY missing_count DESC, table_name;