IU Core 60x Delivery/Non-reparent — 05 Auto-cut bridge DB-backed proof + delivery_seam.py
05 — Auto-cut Bridge DB-backed Proof + delivery_seam.py
Auto-cut bridge — DB-backed proof advanced
The auto-cut bridge (cutter_agent/iu_core/autocut_bridge.py) maps an
orchestrator CutResult to structure-op requests, carrying a BirthSpec
(canonical_address/title/body/unit_kind/section_type) per new piece into
payload['new_pieces'] — the birth-gate handshake the migration-012 SQL apply
consumes.
sandbox/080 probe D8 advances the bridge proof end-to-end on the
production schema, BEGIN…ROLLBACK:
- an auto-cut-mapped
add_new_pieceop is planned with a discovered birth spec (vocabularyunit_kind/section_typeread from a real IU — no hardcode); fn_iu_structure_op_applyenacts it —ok=true, the birth gate mints one governed IU viafn_iu_create;- the apply emits a
structure_child_addedevent intoevent_outbox; - that event is delivered through the new seam —
fn_iu_route_deliver→fn_iu_structure_consumer→ aniu_tree_change_logprojection row.
D8 result: autocut add applied ok=true · event_emitted=true · delivered projection 44 → 45. This is the first proof of the full
auto-cut → structure-op → structure-event → delivery chain DB-backed. Zero
durable rows (rolled back). No production CUT executed.
The SQL execution layer D8 drives (fn_iu_structure_op_plan / _apply) is the
exact substrate the Python PgStructureStore.drive() delegates to — so D8 is
also the DB-backed proof of the substrate PgStructureStore drives.
delivery_seam.py — advanced to mirror the now-built SQL seam
cutter_agent/iu_core/delivery_seam.py was the executable contract with every
target UnbuiltDeliveryTarget (fail-closed). Migration 013 built the SQL
sql_function target, so the module gained SqlFunctionDeliveryTarget — the
Python mirror of fn_iu_route_deliver → fn_iu_structure_consumer:
deliver()reproduces the SQL seam's three gates in order —delivery_enabledkill-switch, the per-route allowlist, the internal-consumer target check;- registered for
'sql_function'gate-closed with an empty allowlist, so the default registry stays fail-closed exactly as the production install; SQL_FUNCTION_CONSUMER = 'fn_iu_structure_consumer'— the substrate contract;target_is_fail_closed()/seam_is_fail_closed()reworked: anUnbuiltDeliveryTargetis always fail-closed; a builtSqlFunctionDeliveryTargetis fail-closed while gate-closed or empty-allowlist.
Proven by 6 executable tests in test_iu_core_60x_delivery_seam.py
(TestSqlFunctionDeliveryTarget): default fail-closed, gate-closed refuses,
not-allowlisted refuses, wrong-consumer refuses, armed target delivers
(status=sent delivered=true), the consumer constant matches the SQL.
No production CUT
No orchestrator CUT ran; execution_enabled was not flipped; no IU was created
durably by the auto-cut path (D8 minted inside the rolled-back probe only).