IU Core 500x — 04 Piece/file/workflow proofs + text-as-code
04 — Piece / file / workflow proofs + text-as-code
1. Create-file-from-many-pieces
Proven twice. Non-durable — sandbox/110 E2: fn_iu_compose of a
2-piece file emits collection_created=1 + piece_added=2, every piece
minted through the birth gate. Durable — runtime/270: collection
iu_core.composer.scratch-file-001 committed, 2 pieces minted via
fn_iu_compose → fn_iu_create, validated ok=true.
2. Create-workflow-from-steps
sandbox/110 E8 — fn_iu_compose of a workflow from 3 ordered step
pieces: render returns 3 steps, fn_iu_collection_validate ok=true,
piece_order contiguous [0,1,2]. A workflow is an ordered collection of
step pieces, each step one IU. E9 — validation is fail-closed: a
soft-deleted step is caught ("1 active piece(s) are soft-deleted").
3. Add / remove / reorder / validate / render
sandbox/110 E3 — add + reorder + remove each emit their event (5 mutation
events total). sandbox/120 O6 — dot_iu_remove_piece leaves the piece
alive. runtime/270 — fn_iu_collection_render returns the 2 ordered
pieces; fn_iu_collection_validate clean.
4. Metadata axes refresh after composition
runtime/270 R270_pieces: axis_b_tag_total = 2 — fn_iu_compose calls
fn_iu_metadata_refresh for every minted piece, so composed-from-scratch
content enters the three-axis metadata model immediately. in_axis_c_tree = 0 is expected — composed pieces are flat, not reparented into the cut
tree.
5. Text-as-code export / diff / validate — roundtrip proof
Proven byte-identical on the new composed collection. The production
fn_iu_collection_manifest_refresh stored a manifest digest for
iu_core.composer.scratch-file-001; the manifest rows were read via
fn_iu_collection_render and fed to the offline Python contract
composer.manifest_digest(...):
stored = 79d66938f49fe54aea0643c9b3a81d39
computed = 79d66938f49fe54aea0643c9b3a81d39
ROUNDTRIP_BYTE_IDENTICAL = True
The SQL digest and the Python text-as-code contract agree exactly — a git
diff of a composition manifest is meaningful. text_as_code.py
(serialize_corpus, parse_collection_manifest,
roundtrip_collection_manifest, propose_collection_import) is unchanged
and still covered by the suite; the 480x durable iu-tree/ export remains
intact. IMPORT_IS_DESTRUCTIVE stays False — propose_collection_import
is fail-closed and non-destructive.
6. Durable inert test collection
runtime/270's iu_core.composer.scratch-file-001 (lifecycle draft,
never delivered) is the durable inert composed-from-scratch collection the
macro asks for — fully reversible via runtime/rollback/270.