KB-1165

IU Core First Durable Structure Op — 09 Next macro package

3 min read Revision 1
dieu44iu-core-mvpstructure-opnext-macrov0.62026-05-21

09 — Next Macro Package

State at handoff

  • Structure-op execution layer (010) installed; gate inert by default.
  • First durable reparent_piece committed and verified (b37fb5f1-...).
  • DOT 41/41, no-hardcode clean, five-layer classified, 637 tests pass.
  • dry_run=false blocked; no downstream delivery; worker dry-run-safe.

Open gaps (exact)

  1. Structure-op event emissionfn_iu_structure_op_apply does not emit an IU event, so the route worker has no organic IU-domain evidence (seen=0). The path components exist (fn_iu_emit_event -> event_outbox -> fn_iu_route_worker_run); only the wiring is missing.
  2. Non-reparent operationsapply / rollback RAISE feature_not_supported for add_new_piece / split / merge / deprecate / replace. plan already accepts all six.
  3. Tree build breadth — 1 of ~96 document IUs is nested; the rest of DIEU-35 / DIEU-28 / DIEU-32 remain flat.
  4. Python PgStructureStore — the live StructureStore Protocol implementation (Python side) is still the in-memory seam only; the SQL layer is the execution layer of record.

IU_CORE_STRUCTURE_OP_EVENT_EMISSION_AND_DIEU35_TREE_BUILD

  1. Register an iu.structure_* event type in event_type_registry (+ matching outbound route, enabled + dry_run=true).
  2. Wire fn_iu_structure_op_apply to emit IU_REPARENTED (and the other STRUCTURE_OP_EVENTS) via fn_iu_emit_event — additive CREATE OR REPLACE.
  3. Run the worker (runtime/150) and capture real IU-domain dry-run evidence (iu_route_attempt rows for a genuine structure event).
  4. Reparent the remaining flat DIEU-35 leaves under their canonical_address- encoded parents — a batch of reparent_piece ops behind the same gate.
  5. Refresh runtime/110, five-layer, tests; commit.

Alternatives

  • dry_run=false delivery macro — build fn_iu_route_deliver for one target kind (still gated, still sovereign-approved). Higher blast radius.
  • Non-reparent structure ops — extend apply/rollback to add_new_piece / split / merge, which need the IU birth gate (fn_iu_create) to mint new IU identities.
  • Auto-cut production bridge — drive a real orchestrator CutResult through AutocutBridge -> StructureOpsWorkflow against the SQL layer.

Recommended first: the event-emission + tree-build macro — lowest blast radius, closes the worker-evidence gap, and exercises the execution layer at batch scale.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-first-durable-structure-op-autocut-worker-scale-open-goal/09-next-macro-package.md