KB-55BD

70000x · 02 — Mig 036 envelope auto-refresh APPLIED LIVE as workflow_admin</title> <parameter name="tags">["iu-core","70000x","migration-036","applied","p1-unblock","auto-refresh"]

4 min read Revision 1

70000x · 02 — P1 mig 036 envelope auto-refresh — APPLIED LIVE

What it adds

Object Class Role
fn_iu_three_axis_envelope_auto_refresh_lineage_trigger function Trigger payload. Gate fast-path. EXCEPTION-WHEN-OTHERS swallow into trigger_error_log.
trg_iu_three_axis_envelope_auto_refresh_lineage trigger Statement-level AFTER INSERT on iu_collection_template_instance_lineage.

Gate iu_core.three_axis_auto_refresh_enabled was already false (per migrations 023/024 default) — mig 036 inherits the same gate, so the trigger is installed but inert until that gate flips true.

Apply transcript

$ cat sql/iu-core/036_envelope_auto_refresh_on_auto_compose.sql | \
  ssh contabo "docker exec -i postgres psql -U workflow_admin -d directus -v ON_ERROR_STOP=1"
BEGIN
CREATE FUNCTION
COMMENT
DROP TRIGGER       ← idempotent guard
CREATE TRIGGER
 036_fn | t
 036_trg | t
 036_gate | false
COMMIT

(There is a "[TRIGGER-GUARD] DDL detected: CREATE TRIGGER ..." WARNING from a project audit guard — intentional, advisory, does not block the DDL.)

SSOT + pinning bumps (same commit as mig 036's live apply)

sql/iu-core/runtime/110_iu_core_dot_conformance_scan.sql: added 2 entries (fn + trg), bumped D9 VALUES tuple from ('function',65),('trigger',6) to ('function',66),('trigger',7).

tests/test_iu_core_ddl.py: EXPECTED_COUNTS function 65→66, trigger 6→7, total assertion 181→183.

tests/test_iu_core_piece_event_runtime.py: assertion strings rebased to new SSOT + 183.

Plus 12 more test files where embedded SSOT regex / literal references were bumped from ('function',65) / ('trigger',6) to ('function',66) / ('trigger',7) (per [[feedback-pinning-tests-bump-per-macro]]).

Total pinning sites bumped: 15.

D9 conformance — LIVE verification

 D9_conformance | table      |       29 |    29 | t
 D9_conformance | view       |       30 |    30 | t
 D9_conformance | function   |       66 |    66 | t   ← LIVE matches new SSOT (was 65)
 D9_conformance | trigger    |        7 |     7 | t   ← LIVE matches new SSOT (was 6)
 D9_conformance | config     |       13 |    13 | t
 D9_conformance | event_type |       22 |    22 | t
 D9_conformance | route      |       16 |    16 | t

7/7 GREEN. Total 183 objects (was 181).

Auto-refresh — gate stays false post-apply (safe-by-default)

Mig 036 installs the trigger but the gate iu_core.three_axis_auto_refresh_enabled stays false. No auto-refresh fires until an operator explicitly flips the gate. To enable:

UPDATE dot_config SET value='true' WHERE key='iu_core.three_axis_auto_refresh_enabled';

Rollback path

cat sql/iu-core/rollback/036_envelope_auto_refresh_on_auto_compose.rollback.sql | \
  ssh contabo "docker exec -i postgres psql -U workflow_admin -d directus -v ON_ERROR_STOP=1"

Then revert the SSOT/pinning bumps from 66/7/183 → 65/6/181 in a new commit.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-70000x-full-test-readiness-six-user-flows-open-goal/02-p1-mig-036-applied.md