KB-1537

110500x · 02 — Apply mig 042R (durable)

5 min read Revision 1
iu-core110500x042Rapplyoperator-aliaspg-dump

110500x · 02 — Apply mig 042R (Operator Alias Surface)

Authored in 110000x report 02; applied durably here via workflow_admin socket-trust.

Pre-apply schema validation

Before authoring drift patches, verified live schema:

-- dot_iu_command_catalog columns
command_name     text  NOT NULL
category         text  NOT NULL  CHECK (category ∈ {collection,piece,lifecycle,read,health})
mutating         bool  NOT NULL
reversible       bool  NOT NULL
target_functions ARRAY NOT NULL
registered_at    timestamptz NOT NULL DEFAULT now()

-- iu_core.iu_staging_record.vector_excluded boolean (column exists, CHECK ((vector_excluded = true)))

Live schema matches 110000x author-mode mechanical-drift-patches list (no further patching needed).

SQL applied

Per 110000x report 02, full SQL stored at /tmp/042R_iu_core_operator_aliases.sql (10,507 bytes). Executes inside one BEGIN/COMMIT:

BEGIN;
-- 5× CREATE OR REPLACE FUNCTION public.fn_iu_op_{mark_file,verify_mark,cut,verify_cut,cleanup_dry_run}
-- 1× INSERT INTO public.dot_iu_command_catalog ... VALUES (5 rows) ON CONFLICT (command_name) DO NOTHING
COMMIT;

Apply command

scp /tmp/042R_iu_core_operator_aliases.sql contabo:/tmp/042R_iu_core_operator_aliases.sql
ssh contabo 'docker cp /tmp/042R_iu_core_operator_aliases.sql postgres:/tmp/042R_iu_core_operator_aliases.sql && \
  docker exec postgres psql -U workflow_admin -d directus -v ON_ERROR_STOP=1 -f /tmp/042R_iu_core_operator_aliases.sql'

Output:

BEGIN
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
INSERT 0 5
COMMIT

Verified delta

SELECT proname FROM pg_proc p JOIN pg_namespace n ON n.oid=p.pronamespace
WHERE n.nspname='public' AND p.proname LIKE 'fn_iu_op_%' ORDER BY 1;
-- fn_iu_op_cleanup_dry_run
-- fn_iu_op_cut
-- fn_iu_op_mark_file
-- fn_iu_op_verify_cut
-- fn_iu_op_verify_mark

SELECT count(*) FROM dot_iu_command_catalog;                          -- 41
SELECT count(*) FROM dot_iu_command_catalog WHERE command_name LIKE 'dot_iu_operator_%';  -- 5
SELECT count(*) FROM pg_proc p JOIN pg_namespace n ON n.oid=p.pronamespace
WHERE n.nspname='public';                                              -- 507

D9 delta (expected = observed)

Surface Pre Post Δ Match
public fns 502 507 +5
dot_iu_command_catalog 36 41 +5
dot_iu_command_run 21 21 0 ✓ (no audit; CREATE FUNCTION + INSERT INTO catalog don't emit run rows)
All other counters 0

pg_dump

Pre-110500x:

  • path: postgres:/tmp/pre-110500x.dump, contabo:/tmp/pre-110500x.dump
  • size: 82,202,070 B
  • md5: 0591218ccb5ce3c4b93808139b27d35e

Post-110500x:

  • path: postgres:/tmp/post-110500x.dump, contabo:/tmp/post-110500x.dump
  • size: 82,212,167 B
  • md5: 34a7756d57ab812eb9b27e45d2a46934

Δ = +10,097 B for 5 plpgsql function bodies + 5 DOT catalog rows. Fc compression brings this below the +25-35KB SQL-text estimate; the actual binary delta is the source-of-truth.

Verified live signatures

All five callable per pg_get_function_identity_arguments() matches 110000x author intent:

fn args returns
fn_iu_op_mark_file (text, text, jsonb, text, text DEFAULT 'user', text DEFAULT NULL, text DEFAULT NULL, text DEFAULT 'operational-cut-workflow') jsonb
fn_iu_op_verify_mark (uuid, boolean DEFAULT false, text DEFAULT NULL, text DEFAULT NULL, text DEFAULT NULL) jsonb
fn_iu_op_cut (uuid, boolean, text, boolean DEFAULT false) jsonb
fn_iu_op_verify_cut (uuid, text DEFAULT 'operator') jsonb
fn_iu_op_cleanup_dry_run (integer DEFAULT 15, text DEFAULT 'operator') jsonb

DOT entries

dot_iu_operator_mark_file              | piece     | mutating=t | reversible=t | targets=[fn_iu_op_mark_file, fn_iu_mark_create_manifest]
dot_iu_operator_verify_mark            | health    | mutating=f | reversible=f | targets=[fn_iu_op_verify_mark, fn_iu_verify_mark]
dot_iu_operator_cut_staging            | piece     | mutating=t | reversible=t | targets=[fn_iu_op_cut, fn_iu_cut_from_manifest]
dot_iu_operator_verify_cut             | health    | mutating=f | reversible=f | targets=[fn_iu_op_verify_cut, fn_iu_verify_cut_result]
dot_iu_operator_cleanup_staging_dry_run | read     | mutating=f | reversible=f | targets=[fn_iu_op_cleanup_dry_run, fn_iu_staging_cleanup]

All five category values in CHECK vocab {collection, piece, lifecycle, read, health}.

Verdict

IU_CORE_110500X_APPLY_042R_PASS

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-110500x-apply-operator-alias-d30-d31-test/02-apply-042R.md