KB-47E4

100000x · 09 — Carry-Forward (memory updates + next macro)

6 min read Revision 1
iu-core100000xcarry-forwardmemorynext-steps2026-05-26

100000x · 09 — Carry-Forward

A. Memory updates from this macro

Refresh

  1. [[feedback-fn-iu-create-returns-jsonb-not-uuid]] — correct the result-key reference. Live fn_iu_create returns jsonb with key iu_id (NOT id). 90000x memory had (result->>'id')::uuid — wrong; live shows 'iu_id', v_iu_id in the function body. Always use (result->>'iu_id')::uuid.

  2. [[feedback-channel-memory-drifts-verify-live]] — add four new drifts:

    • information_unit.section_type is NOT set by fn_iu_create (only identity_profile->>'primary_section_type_ref'); callers must follow-up with UPDATE.
    • section_type CHECK vocab is the 13-item set {appendix, article, changelog, checklist, definition, governance_process, heading, instruction_block, paragraph, principle, process, section, technical_spec}. clause is INVALID for section_type (valid for piece_role only).
    • iu_core.iu_staging_record.source_kind CHECK vocab is {agent, user, system, import}. fixture is INVALID; use system.
    • referenced_iu_ids is uuid[]; subqueries that return the array column don't combine with id = ANY(...); use IN (SELECT unnest(col) FROM ...).

New

  1. [[feedback-fn-iu-create-no-column-writes-for-sort-section-doc]]fn_iu_create writes only id, canonical_address, unit_kind, owner_ref, created_by, updated_by, identity_profile, parent_or_container_ref (plus version anchor). It does NOT populate sort_order, section_type (column), section_code, doc_code. Cut/composer fns must follow up with UPDATE information_unit SET … to set those columns. Proven 100000x mig 040R 2026-05-26.

  2. [[feedback-iu-piece-membership-role-vocab-seven]]iu_piece_membership.piece_role CHECK vocab is {title, intro, body, step, clause, appendix, reference} (7 roles). clause is VALID here (and only here); distinct from section_type vocab on information_unit.

  3. [[feedback-cut-from-manifest-g7-via-composer-enabled-config-key]] — G7 composer gate reads dot_config row key='iu_core.composer_enabled' value='true'. In-TX toggle (UPDATE dot_config…) is safe and reverts on rollback. Operator must close after a real cut. Proven 100000x report 04.

  4. [[project-iu-core-100000x-reauthor-apply-cut-verify-full-proof-pass-2026-05-26]] — project memory for this macro.

B. Code/SSOT bumps for operator commit (deferred)

100000x did NOT bump SSOT or pinning tests. Per [[feedback-pinning-tests-bump-per-macro]] discipline, the operator commit that wraps this macro should include:

File Change
cutter_agent/iu_core/dot_commands.py::_REGISTRY +2 entries: dot_iu_cut_from_manifest (category=piece, mutating=true, reversible=true) and dot_iu_verify_cut_result (category=health, mutating=false, reversible=false)
D9 conformance test (e.g. tests/conformance/test_d9_object_count.py) bump expected public_fns 500→502, dot_catalog 34→36
Pinning tests (per macro discipline) update 15+ sites referencing dot_catalog rows count

Single commit recommended. PR title suggestion: iu-core(100000x): add fn_iu_cut_from_manifest + fn_iu_verify_cut_result + DOT catalog.

C. Next macro — 110000x first real Điều 37 cut

Use the runbook in report 08. Recommended scope for 110000x:

  1. Operator supplies real Điều 37 source (text or file).
  2. Author manifest with proper canonical_addresses, sort_orders, parent_or_container_refs.
  3. Run MARK → VERIFY-MARK → APPROVE → CUT → VERIFY-CUT live (NOT BEGIN/ROLLBACK).
  4. Healthcheck: piece count, lifecycle, axes, no-vector.
  5. Optional: create an iu_piece_collection of kind cut and add memberships via fn_iu_collection_add_piece to surface in collection views.
  6. KB report under …/v0.6-iu-core-110000x-first-real-dieu37-cut/.

D. Surfaces still preserved (re-confirmed for safety)

Surface Why preserved
production_documents mission rule + structurally absent in directus DB
Qdrant collections mission rule + zero outbound calls from new fns
Nuxt deployment mission rule
iu_core.retention_enabled gate unchanged (false)
iu_core.composer_enabled gate restored to false post-proof
PR #669 untouched
037-039 fn bodies unchanged (no CREATE OR REPLACE on existing)
25000x mig 033 auto-instantiate unchanged
DOT/D9 SSOT (cutter_agent) NOT bumped (deferred to operator commit)
Pinning tests NOT bumped (paired with SSOT)

E. Lessons (one-line each)

  • Live signature survey is cheap and saves a re-author cycle — 50 LOC of pg_proc / information_schema.columns introspection before authoring catches every drift the macro charter foresaw.
  • plpgsql defers SQL-stmt resolution → smoke-test refusal paths immediately — 90000x mig 040 was authored CREATE-clean but would have crashed at first apply on payload_json column missing. 100000x ran G1/G2 smoke tests right after CREATE.
  • In-TX gate toggle + BEGIN/ROLLBACK is the right pattern for proof — composer gate flipped open for the cut, closed by ROLLBACK; zero permanent state, full pipeline exercise.
  • Vocab mistakes are the dominant error class — 4 of 6 drifts patched in this macro were vocab (section_type, source_kind, payload_kind, category). Live CHECK introspection is mandatory before fixture authoring.

F. End-state after 110000x first real cut green

  • 7-stage operating flow proven on real source.
  • pg_dump growth proportional to source size + 1 audit row + N IU pieces.
  • DOT dot_iu_cut_from_manifest run_status='applied' count = number of real cuts.
  • iu_core.composer_enabled discipline established: open per-cut, close after.
  • Report 00 — top-line PASS summary.
  • Report 08 — operator runbook for real Điều 37.
  • 91000x report 07 — original re-author roadmap (now closed by this macro).
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-100000x-reauthor-apply-cut-verify-full-proof/09-carry-forward.md