KB-76E1

IU Core Worker Live — 05 Auto-cut integration bridge package

3 min read Revision 1
dieu44iu-core-mvpauto-cutbridgeskeletonv0.62026-05-21

IU Core Worker Live — 05 Auto-cut integration bridge package

What it is

cutter_agent/iu_core/autocut_bridge.py — the repo-backed skeleton for the event-worker macro KB doc 07. It maps the durable output of a v0.6 orchestrator cut onto IU Core structure-op and SQL-link requests.

Surface

  • CUT_OPERATIONS{create→add_new_piece, split→split_large_piece, merge→merge_small_pieces}.
  • CutSqlObject — a SQL/Directus object a cut produced (object_kind, object_name, object_schema, link_role).
  • CutResultUnit — one IU a cut created: unit_id, operation, parent_id, source_unit_ids, sql_object.
  • CutResult — the cut's durable output: units, actor, source_version_string, payload.
  • SqlLinkRequest — a requested iu_sql_link row, with its deterministic iu_sql_link_key.
  • map_cut_to_structure_ops(cut) / map_cut_to_sql_links(cut) — pure mappers.
  • AutocutBridge — holds a CutResult, exposes structure_op_requests(), sql_link_requests(), is_empty().

Design

  • Post-lifecycle_enact hook. The bridge runs after a cut has committed; it records lineage/links and never re-runs CUT.
  • Pure mapper. No IO, no DB. CutResult → (list[StructureOpRequest], list[SqlLinkRequest]). The created unit's id goes in StructureOpRequest.new_unit_ids — the cut (not the workflow) minted it.
  • Idempotent by construction. Every request carries a deterministic key (structure_operation_key / iu_sql_link_key), so re-running the bridge over the same cut produces byte-identical requests that dedupe at the substrate.

What is NOT built (next macro)

The orchestrator phase iu_core_record — gated, post-lifecycle_enact, that drives the bridge's requests through StructureOpsWorkflow (sovereign-approved apply). This module is the contract that phase consumes; wiring it into cutter_agent/orchestrator/ is the auto-cut integration macro's work. No production CUT was executed this macro.

Tests: TestAutocutBridge (6) — operation mapping, created unit in new_unit_ids, SQL-link mapping + key, idempotent keys, empty cut, unknown operation rejected.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-worker-live-dryrun-structure-autocut-delivery-prep-open-goal/05-autocut-bridge-package.md