Axis Rollout SQL G_prod_00 — Production Preflight (read-only, gated; sha256 59558f5d…)
-- ============================================================================
-- G_prod_00 — PRODUCTION AXIS ROLLOUT PREFLIGHT (READ-ONLY, NOT EXECUTED)
-- Run on production directus. Pure SELECTs. Verifies the rollout is safe to
-- start and that the ratification gate (os_proposal_approvals >= 1) is met.
-- ============================================================================
\pset pager off
\echo ==================== AXIS_ROLLOUT_PREFLIGHT ====================
SELECT 'db' k, current_database() v
UNION ALL SELECT 'is_production', (current_database()='directus')::text
UNION ALL SELECT 'ownership_rows', (SELECT count()::text FROM governance_object_ownership)
UNION ALL SELECT 'canonical_gap', (SELECT count()::text FROM v_object_owner_gap)
UNION ALL SELECT 'inventory_born_requires_owner', (SELECT count()::text FROM v_governance_object_inventory WHERE requires_owner AND born)
UNION ALL SELECT 'active_scopes', (SELECT count()::text FROM governance_responsibility_scope WHERE status='active')
UNION ALL SELECT 'axis_tables_present', (SELECT count()::text FROM information_schema.tables WHERE table_schema='public' AND table_name IN ('axis_registry','axis_value','axis_assignment','coverage_rule','axis_object_ownership','axis_candidate_finding'))
UNION ALL SELECT 'RATIFICATION_ospa', (SELECT count()::text FROM os_proposal_approvals)
UNION ALL SELECT 'GATE_ratified', (SELECT (count()>=1)::text FROM os_proposal_approvals)
UNION ALL SELECT 'idle_in_tx', (SELECT count()::text FROM pg_stat_activity WHERE state='idle in transaction')
ORDER BY 1;
\echo NOTE: proceed to G_prod_01 ONLY if is_production=true, axis_tables_present=0, GATE_ratified=true.