5000x-live — Retention policy dry-run
5000x-live — Retention policy dry-run
Hygiene note (6000x): title/tags renormalised from "5500x" to "5000x-live" to match the path. Content preserved verbatim except this banner.
Verdict: PASS — 3 policies dry-runnable, 0 eligible rows; gate stays inert.
Live policies (iu_core_retention_policy)
| target_table | age_column | keep_days | actor_scope | reason |
|---|---|---|---|---|
dot_iu_command_run |
created_at |
90 | runtime_500x_op_proof, iu_core_2400x_full_reindex, iu_core_3000x_runtime_330_smoke, iu_5000x_pilot |
keep 90d of one-off operator command-run rows for governance; trim only macro/sandbox actors |
iu_three_axis_envelope_refresh_log |
started_at |
30 | iu_lifecycle_trigger, iu_5000x_pilot |
keep 30d of lifecycle-trigger fires; older redundant with v_iu_three_axis_envelope_refresh_status |
iu_three_axis_envelope_trigger_error_log |
captured_at |
90 | null (ALL) |
keep 90d of trigger exceptions; rare |
Dry-run executed this macro
SELECT * FROM fn_iu_core_retention_cleanup('iu_5000x_live_dry_run_probe', true);
| target_table | cutoff | rows_eligible | rows_deleted | dry_run |
|---|---|---|---|---|
| dot_iu_command_run | 2026-02-22 | 0 | 0 | true |
| iu_three_axis_envelope_refresh_log | 2026-04-23 | 0 | 0 | true |
| iu_three_axis_envelope_trigger_error_log | 2026-02-22 | 0 | 0 | true |
All three queries returned 0 eligible rows — corpus is too young (oldest macro iu_core_2400x_full_reindex ran 2026-05-23).
Gate iu_core.retention_enabled — stays false
Flipping the gate now is a no-op (0 rows). Without paired cron, a live gate flip just creates risk of an out-of-band manual fn_iu_core_retention_cleanup(..., false) call deleting data unexpectedly. Gate stays inert.
Reversibility
Gate is a single dot_config row; flip back with one UPDATE dot_config SET value='false' WHERE key='iu_core.retention_enabled';.
Next macro (5700x) — paired enable
- Install cron line:
45 3 * * * docker exec postgres psql -U directus -d directus -c "SELECT * FROM fn_iu_core_retention_cleanup('iu_retention_cron', false);" >> /var/log/incomex/iu-core-retention.log 2>&1 - Flip gate:
UPDATE dot_config SET value='true', updated_at=NOW() WHERE key='iu_core.retention_enabled'; - First scheduled run executes at 03:45 UTC the next day.
- Capture before/after
count(*)of all 3 tables in pre/post snapshot.