KB-9D19
70000x · 03 — Six-flow test runner package layout + behavior</title> <parameter name="tags">["iu-core","70000x","runner","package","six-flow"]
4 min read Revision 1
70000x · 03 — P2 Six-flow test runner package
Layout
ops/iu-core-six-flow-test-readiness/
├── README.md
├── SIX_FLOW_TEST_READINESS_MATRIX.md
├── USER_TEST_RUNBOOK.md
├── DOT_COMMAND_PLAN.md
├── run_six_flow_tests.sh (bash 3.2+ TSV-based runner)
├── test_01_autocut_reconstruct_source.sql (read-only)
├── test_02_axis_b_professional_filter.sql (read-only)
├── test_03_parent_child_subtree_filter.sql(read-only)
├── test_04_create_edit_piece_document.sql (BEGIN/ROLLBACK + in-TX gate-toggle)
├── test_05_piece_trigger_in_out.sql (BEGIN/ROLLBACK + in-TX gate-toggle)
├── test_06_sql_bridge_piece_to_db.sql (BEGIN/ROLLBACK)
├── _reports/<UTC_timestamp>/ (per-run logs, gitignored)
└── reports/ (KB report bundle 00..10)
Runner contract
SSH_HOST=contabo ./run_six_flow_tests.sh [test_NN]
- Resolves psql exec channel via
${PSQL_CMD}or${SSH_HOST}(defaults todocker exec -i postgres psql -U directus -d directus). - Creates
_reports/<UTC_timestamp>/and a per-test log file. - Pipes each SQL file into psql with
ON_ERROR_STOP=1 -q. - Classifies the result:
- psql rc≠0 →
FAIL_psql_rc_N - any
verdict_pass | frow →FAIL_verdicts_N - else →
PASS_N
- psql rc≠0 →
- Writes
summary.jsonand exits non-zero if any test FAILed.
Bash 3.2 handling
macOS ships bash 3.2 (no associative arrays). The runner uses TSV name<TAB>result per line which works in bash 3.2+. Runs natively on any modern bash.
In-TX gate-toggle pattern (T04, T05)
BEGIN;
UPDATE dot_config SET value='true' WHERE key='iu_core.composer_enabled';
-- run test
UPDATE dot_config SET value='false' WHERE key='iu_core.composer_enabled'; -- defensive
ROLLBACK;
ROLLBACK reverses both the gate flip AND the work atomically. Pre-ROLLBACK gate-flip-back is belt-and-suspenders. This is [[feedback-in-tx-gate-toggle-reversibility]], proven 12000x phases D-G, refreshed at 70000x T04+T05.
Six tests one-line per
T01 fn_iu_reconstruct_source('DIEU-35') → 36 pieces, monotonic, all resolvable
T02 iu_metadata_tag_registry axis-B = {legal_document, section_type, unit_kind}
T03 fn_iu_subtree(root) → root cb211ee6 has depth 2, children+grandchildren present, acyclic
T04 fn_iu_compose mints 3+attaches 3; add/reorder/remove OK; dry_run split/merge/supersede/retire all JSON-OK
T05 fn_iu_piece_emit_event in-TX emit emit_enabled=true + dry_run_only=true → +1 row, emit_mode='dry_run'; ZERO live piece routes
T06 INSERT iu_sql_link (link_role='represents') → validate=resolved, view-resolve, reverse-lookup
Live evidence — run 20260525T081115Z
{
"ts": "20260525T081115Z",
"results": {
"test_01_autocut_reconstruct_source": "PASS_3",
"test_02_axis_b_professional_filter": "PASS_3",
"test_03_parent_child_subtree_filter": "PASS_3",
"test_04_create_edit_piece_document": "PASS_5",
"test_05_piece_trigger_in_out": "PASS_3",
"test_06_sql_bridge_piece_to_db": "PASS_6"
}
}
6 PASS / 0 FAIL.
Schema-discovery learnings (filed as 70000x lessons L2-L6)
information_unit.status→lifecycle_statusevent_outbox.payload→safe_payloadfn_iu_createunit_kind vocab →{design_doc_section, law_unit}iu_sql_link.link_roleCHECK vocab → 11 roles (userepresentsnotreference)fn_iu_sql_link_inbound_captureis a trigger function — not directly callable