KB-3263

03 — Minimum Safety Net: Apply & Verification

3 min read Revision 1
safety-netapplyverificationidempotencyrollback2026-06-03

03 — Minimum Safety Net: Apply & Verification

Mode: APPLIED LIVE. All objects committed to prod directus 2026-06-03 via ssh contabo → docker exec -i postgres psql -U workflow_admin -d directus -v ON_ERROR_STOP=1. Single transaction per run, idempotent (CREATE OR REPLACE / IF NOT EXISTS). Re-run safe.

Backup before apply

None of the 10 target object names (6 views + 2 staging tables + 2 functions) pre-existed (verified via information_schema), so CREATE OR REPLACE / CREATE … IF NOT EXISTS overwrote nothing. The rollback (DROP) fully restores prior state. No definition needed saving.

Objects applied & verified live

# Object Type Verified Live result
1 v_birth_orphan view 81 rows (54 iu_cmd + 27 pivot)
2 v_birth_phantom view 289 rows (283 SYNTHETIC_TEST + 6 REAL_MISSING)
3 v_birth_coverage_status view 173 rows; 94 zero-birth; 132 trigger-no-gate; 1 critical-family zero-birth
4 _recon_dot_fs_inventory table 287 rows loaded (285 dot-prefixed, 76 backups)
5 v_dot_fs_reconciliation view 287 rows: 193 OK / 76 backup / 16 FILE_NO_REGISTRY / 2 non-dot
6 v_dot_registry_no_file view 41 rows
7 v_dot_pivot_update_status view STAGED_FILE_ONLY / UNBORN / NOT_VALID_DOT
8 _preflight_accepted_exceptions table 1 seed (SYNTHETIC_TEST accepted)
9 fn_preflight_guard() + fn_assert_safe_for_dot_action() functions guard returns 8 dims; assert RAISES (exit 3)

Post-apply detector counts (live)

v_birth_orphan      : dot_iu_command_catalog 54 (active 54) | pivot_definitions 27 (active 26)
v_birth_phantom     : SYNTHETIC_TEST 283 | REAL_MISSING 6
v_dot_fs_reconcil.  : OK_REGISTERED_BORN 193 | BACKUP_FILE 76 | FILE_NO_REGISTRY 16 | NON_DOT_ARTIFACT 2
coverage zero-birth : BIRTH_REQUIRED 25 | BIRTH_DEFERRED 44 | EXEMPT_junction 15 | EXEMPT_log 5

Rollback readiness

operator_bundle/99_rollback_minimum_safety_net.sql drops all 10 objects in dependency order, touches no business table, idempotent. Tested logic; ready to run any time.

Idempotency proof

The apply script was run twice this session (initial apply, then corrected re-apply after view refinements). Both ended == APPLY COMPLETE == with no error — confirming idempotency.

Back to Knowledge Hub knowledge/dev/reports/architecture/birth-orphan-safety-net-operator-apply-backlog-triage-2026-06-03/03-minimum-safety-net-apply-or-operator-bundle.md