KB-2543

IU Core 120x Three-Axis — 03 Three-axis verification + metadata population

4 min read Revision 1
dieu44iu-core-mvp120xaxis-verificationruntime-230sandbox-090v0.62026-05-22

03 — Three-Axis Verification + Metadata Population

Population — runtime/230

230_metadata_enrichment_populate.sql discovered the whole live IU corpus (SELECT id FROM information_unit WHERE deleted_at IS NULL — no hardcoded id) and passed it to fn_iu_metadata_refresh:

Check Result
E1 refresh ok=true iu_count=158 vocabulary_registered=12 tags_assigned=330
E2 registry legal_document 3, section_type 12, unit_kind 2 — 17 tag keys
E3 tags 330 tags, all enrichment_source='derived'
E4 coverage 158 live IU = 158 IU with tags (full coverage)
E5 no orphan 0 orphan tags, 0 orphan IU refs

Additive + idempotent (ON CONFLICT re-derives in place). Reversal: runtime/rollback/230.

Axis verification — sandbox/090 (BEGIN…ROLLBACK, zero durable rows)

090_three_axis_metadata_probe.sql exercised all three axes on production data — 7 probes, all pass=true:

Probe Axis Result
M1 reconstruct A fn_iu_reconstruct_source('DIEU-35') returned 36 pieces in linear order, 0 source gaps flagged
M2 content group B v_iu_content_group group doc:DIEU-35 = 36 members, 3 tag_kinds, 0 unregistered tags
M3 subtree C fn_iu_subtree('D38-DIEU35-S6') = 8 units (self + 7 descendants); tree globally acyclic
M4 envelope A+B+C v_iu_metadata_envelope = 158 rows = 158 live IU; all 158 carry tags; 86 carry an axis-A sort_order
M5 consistency 0 orphan tags, 0 tags on a deleted IU
M6 refresh idempotent B re-running fn_iu_metadata_refresh over all 158 IUs: tag rows 330 → 330 (no duplicate)
M7 autocut→three-axis all an auto-cut-mapped add_new_piece applied ok=true, was metadata-refreshed, and appeared in the envelope (1) + content group (1)

ROLLBACK — zero durable rows from the probe.

Axis A — original-text reconstruction (acceptance model A)

fn_iu_reconstruct_source(doc_code) lists a document's IUs in original sort_order order with a gap_before flag; v_iu_source_outline exposes sort_order_step (≠ 1 ⇒ missing/duplicate segment). The whole 3-document corpus reconstructs with 0 gaps — the source order is complete and duplicate-free. A source-outline view can be rebuilt with no human memory.

Axis B — semantic / content grouping (acceptance model B)

v_iu_content_group lists every IU in a content group; the group key is a registry-backed tag_key (FK-enforced — 0 unregistered). tag_kind lets a caller filter by classifier family. enrichment_source distinguishes the derived (confirmed-class) tags from the reserved inferred/proposed lane.

Axis C — hierarchy (acceptance model C)

fn_iu_subtree(iu) returns an IU + all descendants with relative_depth; parent/ancestors come from iu_tree_path.path_ids; v_iu_metadata_envelope carries parent_id, depth, root_unit_id, child_count. Global acyclicity is asserted (v_iu_tree count = live IU count). Hierarchy connects to lineage via has_structure_op in the envelope.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-120x-three-axis-metadata-delivery-autocut-textcode-open-goal/03-axis-verification.md