IU Core 120x Three-Axis — 05 Auto-cut three-axis mapping + text-as-code kickoff
05 — Auto-cut Three-Axis Mapping + Text-as-Code Kickoff
Auto-cut bridge → three-axis metadata
sandbox/090 probe M7 proved the auto-cut output flows into all three
metadata axes, on production data, BEGIN…ROLLBACK:
- the auto-cut bridge maps a cut
createto anadd_new_piecestructure op (birth spec discovered from real vocabulary — no hardcode); fn_iu_structure_op_applyenacts it (ok=true) — the birth gate mints one governed IU;fn_iu_metadata_refreshenriches the minted IU into axis B;- the minted IU is then visible in
v_iu_metadata_envelope(axis A position + axis C hierarchy + axis B tag count) AND inv_iu_content_group.
So an auto-cut-produced IU automatically enters the three-axis model: axis A
via its sort_order/section_*, axis C via the structure op's tree placement,
axis B via fn_iu_metadata_refresh. M7 result:
apply ok=true · in_envelope=1 · content_group_tags=1. Zero durable rows. No
production CUT executed.
Text-as-code layer — kickoff
cutter_agent/iu_core/text_as_code.py kicks off the text-as-code layer on top
of the three-axis model. Like delivery_seam.py / pg_structure_store.py it
is a pure contract module — dataclasses + pure functions, no IO, no DB.
Deterministic export layout. iu_export_path(record) →
iu-tree/<doc_code|_unfiled>/<sort_order:04d>-<canonical_address>.md. Axis A
(sort_order) drives the ordering prefix so a directory listing reads in
original document order; the globally-unique canonical_address is the
filename stem, so no two IUs can collide on a path. export_tree raises on
any path collision.
Diff contract. diff_trees(old, new) → TreeDiff(added, removed, changed)
— deterministic, sorted; a git diff of an export is meaningful.
Fail-closed, non-destructive import contract. IMPORT_IS_DESTRUCTIVE is
False. validate_import only checks (unique iu_id / canonical_address /
export path, no self-parent) and returns every error — an import is acceptable
ONLY when errors is empty. import_plan produces a plan and executes is
always False. Building a real importer is a later, separately gated macro.
Read-only export proof
The full live IU corpus was exported read-only through the contract (production
v_iu_metadata_envelope → IuExportRecord → export_tree):
| Check | Result |
|---|---|
| records exported | 158 |
| export files | 158 (1:1, no path collision) |
| deterministic | re-export byte-identical |
| self-diff | empty |
| import validation | ok=true — 158 records, 0 errors |
| import executes | False (non-destructive) |
| layout buckets | DIEU-28, DIEU-32, DIEU-35, _unfiled |
A real finding surfaced + was fixed during the proof: the first path scheme
(section-code tail) collided for _unfiled IUs; the export-tree collision
guard caught it, and the scheme was corrected to the unique
canonical_address stem. The contract's own safety check did its job.
12 executable tests in test_iu_core_120x_three_axis.py
(TestTextAsCode) prove the contract: deterministic + unique paths, diff,
fail-closed validation, non-destructive import plan.