IU Test b–f Command Pack — 10 Author-Ready Next Macro Prompts
10 — Author-Ready Next Macro Prompts
Five complete, paste-ready macro prompts, written to the prompt standard v1.2 (self-contained-after-clear; Execution Channel Pack + Dependency Closure Pack for any live action; Live-Apply-Hard-Gate-0 where mutation occurs; no-underload). Each is self-contained.
PROMPT 1 — IU_TEST_B_C_READONLY_HARNESS_IMPLEMENTATION_XHIGH
Mode: implementation, READ-ONLY (SELECT + audit rows only). Context may be cleared — do not ask for prior chat; read the sources below first.
Goal: Implement and run a DOT-callable, config-driven, end-to-end automated read-only test harness that PASSes IU tests b (domain/professional axis filter) and c (parent-child-grandchild tree filter), producing auditable evidence. Zero mutation to IU data.
Read sources (KB):
knowledge/dev/reports/architecture/iu-test-b-to-f-readiness-command-pack-2026-05-28/02-test-b-domain-axis-filter-plan.md.../03-test-c-tree-axis-filter-plan.md,.../07-dot-command-gap-and-spec.md,.../00-command-pack-overview.md- survey
iu-core-process-brick-readiness-and-gap-survey-2026-05-28.md
First actions: verify host/DB (directus); read sources; live baseline survey (information_unit=216, iu_three_axis_envelope=216, iu_metadata_tag=536, iu_metadata_tag_registry=36, iu_tree_path=199, iu_relation=60); confirm read-only vs write channel (Execution Channel Pack: SSH workflow_admin available for the function/catalog DDL; MCP query_pg read-only for proofs).
Allowed: create STABLE SQL functions filter_axis_b, filter_axis_c_subtree; add catalog rows dot_iu_filter_axis_b, dot_iu_subtree, dot_iu_test_harness_run (read-only core); write dot_iu_command_run audit rows; BEGIN/ROLLBACK delta proofs. Functions must be SELECT-only.
Forbidden: any UPDATE/DELETE/INSERT to IU data tables; any gate flip; any event emission; split/merge/compose; touching iu_enact.*; 4 Mothers work. No secret logging.
Exact outputs: the two functions + three catalog commands (via SSH workflow_admin migration); a harness run over ≥2 axis-B families (incl legal_domain:knowledge_systems→16) and ≥3 axis-C roots (a DIEU-37 root, a DIEU-35 root, a leaf); evidence JSON + KB report knowledge/dev/laws/dieu44-trien-khai/.../iu-test-b-c-readonly-harness-result-*.md.
Acceptance (PASS): b assertions 1–5 + c assertions 1–6 hold; both commands record mutating=false; BEGIN/ROLLBACK deltas zero on information_unit/iu_three_axis_envelope/iu_metadata_tag/iu_relation/iu_tree_path/event_outbox; KB report uploaded and read-back verified. PARTIAL if envelope drift found (document exact rows).
Rollback/verification: functions/catalog are additive and read-only; rollback = DROP the added functions/catalog rows if rejected. Verify: re-run harness twice → byte-identical output.
PROMPT 2 — IU_SQL_LINK_PROOF_AND_DOT_COMMAND_IMPLEMENTATION_XHIGH
Mode: implementation, READ-ONLY proof first; mutating register/capture deferred as author-ready follow-up. Context may be cleared.
Goal: Make IU↔SQL link validation/resolution DOT-callable and PASS test f read-proof against the 3 live iu_sql_link rows; leave link activation (enable) and inbound-capture as bounded follow-ups.
Read sources: .../04-test-f-sql-link-proof-plan.md, .../07-dot-command-gap-and-spec.md, survey report.
First actions: baseline read of iu_sql_link (3 rows, all enabled=false: represents→tac_publication, governs→fn_iu_three_axis_envelope_refresh, governs→v_iu_section_type_vocab_sync); confirm fn_iu_sql_link_validate + v_iu_sql_link_resolved exist.
Allowed: add read-only catalog commands dot_iu_sql_link_validate, dot_iu_sql_link_resolve; run the 3-link validate+resolve proof; audit rows (mutating=false).
Forbidden: flipping any iu_sql_link.enabled to true; running fn_iu_sql_link_inbound_capture (writes); any gate flip; creating new links. No secret logging.
Exact outputs: the two read-only commands; a proof report {links_total:3, validated:3, drift:0} per object_kind; KB report; an author-ready spec for the deferred dot_iu_sql_link_register + dot_iu_sql_link_capture_probe (mutating, Điều 32, bounded).
Acceptance (PASS): all 3 links validate + resolve with fingerprint_match=true, zero deltas, DOT-callable, mutating=false. PARTIAL if a link is broken/drifted (flag exact row).
Rollback/verification: additive read-only commands; rollback = DROP if rejected; verify re-run idempotent.
PROMPT 3 — IU_BOUNDED_GATE_PROTOCOL_DESIGN_OR_IMPLEMENTATION_XHIGH
Mode: design → implementation of gate-flip primitives ONLY. LIVE-APPLY-HARD-GATE-0 applies (gate flips are live
dot_configwrites). Context may be cleared.
Goal: Build the reusable bounded gate protocol (open→test→auto-close, fail-closed, audited, approval-aware) that all mutating IU tests depend on. No test data mutation in this macro — only the gate primitives + a self-test that opens and immediately closes one low-risk gate inside BEGIN/ROLLBACK.
Read sources: .../08-bounded-gate-protocol.md, .../09-infra-closure-backlog-and-sequencing.md (U2), survey gate snapshot.
LIVE-APPLY-HARD-GATE-0 (before deep work): prove SSH workflow_admin write channel (ssh contabo "docker exec -i postgres psql -U workflow_admin -d directus -v ON_ERROR_STOP=1" with a BEGIN/ROLLBACK probe); confirm dot_config writable by workflow_admin; pg_dump backup available. If channel fails → AUTHOR_MODE_ONLY, do not author 30m of unrequested docs.
Allowed: create gate-protocol function(s) (open/close/verify-close/watchdog) writing dot_config + dot_iu_command_run + a gate-transition record; require an approval_id (Điều 32) param on open of any mutating gate; a self-test that flips one gate true→false inside BEGIN/ROLLBACK and proves verify-close.
Forbidden: opening any gate outside the protocol; flipping iu_enact.allow_no_review_decision or iu_core.vector_sync_enabled (NEVER); leaving any gate open at macro end; running d/e tests. No secret logging.
Exact outputs: protocol functions + runbook; proof that open requires approval_id; proof of auto-close + verify-close + fail-close (force a fault, assert gate returns to default); KB report.
Acceptance (PASS): protocol can open and guarantee-close a gate; verify-close read-back == default; open without approval_id is refused; final dot_config snapshot identical to pre-macro. BLOCKED if write channel absent.
Rollback/verification: protocol functions additive; the self-test uses BEGIN/ROLLBACK so no durable flip persists; verify post-macro dot_config snapshot equals baseline.
PROMPT 4 — IU_SPLIT_MERGE_REVIEW_DECISION_WIRING_XHIGH
Mode: implementation, MUTATING, governed. Depends on PROMPT 3 (gate protocol) being approved. Context may be cleared.
Goal: Commit the governed REVIEW sub-pipeline + row-builder so fn_iu_piece_split/fn_iu_piece_merge can run with a non-null review_decision_id, then prove test d's split (d5) and merge (d6) on dedicated test IUs with Axis-A preservation, first-population of iu_split_set/iu_merge_set, and clean rollback.
Read sources: .../05-test-d-compose-structure-ops-plan.md, .../08-bounded-gate-protocol.md, .../09-... (U3), TD-P1 backlog td-p1-split-merge-metadata-propagation-gap-2026-05-15.md, survey.
LIVE-APPLY-HARD-GATE-0: SSH workflow_admin channel probe; privileged read of cutter_governance.review_decision to confirm shape (RO role is denied — use workflow_admin); pg_dump backup; Dependency Closure Pack: confirm fn_iu_piece_split/merge, iu_split_set/merge_set, gateway marker fn_iu_structure_op, fn_iu_structure_op_rollback all present.
Allowed: commit review sub-pipeline + row-builder issuing review_decision_id; wire split/merge to require it; open structure_ops_enabled (+composer_enabled if needed) via the PROMPT-3 protocol with an approval_id; run d5/d6 on test IUs; rollback; close gates.
Forbidden: flipping allow_no_review_decision; splitting/merging production law IUs on first run; leaving gates open; running without review_decision_id; 4 Mothers work. No secret logging.
Exact outputs: review wiring; first valid iu_split_set + iu_merge_set rows (test); Axis-A reconstruct proofs (children concat hash == parent original); rollback proof; gate verify-close; KB report.
Acceptance (PASS): d5/d6 succeed with review_decision_id, Axis-A preserved, no orphan child, clean rollback, gates verified closed. PARTIAL if state-machine wedges (then U5 required). BLOCKED if review shape unconfirmable.
Rollback/verification: fn_iu_structure_op_rollback per op; retire test IUs/collection; verify dot_config snapshot == baseline; verify no production IU mutated.
PROMPT 5 — IU_TRIGGER_IN_OUT_EVENT_CONTRACT_AND_TEST_PLAN_XHIGH
Mode: implementation, MUTATING (event registry + bounded delivery). Depends on PROMPT 3. Context may be cleared.
Goal: Register the iu.* event-type contracts and PASS test e: trigger-in capture (idempotent) and trigger-out emit→route→deliver on a test route under a bounded delivery window, plus a forced-failure DLQ proof.
Read sources: .../06-test-e-trigger-in-out-plan.md, .../08-bounded-gate-protocol.md, .../09-... (U6), survey event facts.
LIVE-APPLY-HARD-GATE-0: SSH workflow_admin channel; Dependency Closure Pack: confirm event_type_registry, fn_iu_emit_event, fn_iu_piece_emit_event, iu_outbound_route (15), iu_sql_event_route (1), fn_iu_route_deliver, fn_iu_route_worker_run, iu_route_dead_letter (0), fn_iu_route_dead_letter_replay; inventory the 15 live routes so the bounded delivery flip cannot deliver a real route.
Allowed: register iu.trigger_in.received, iu.trigger_out.emitted, iu.route.delivered, iu.route.failed (JSON schema, compat_mode=forward, refs-only payload) — register-before-emit; create a test route + test IU; open delivery_enabled (route-scoped if supported) via PROMPT-3 protocol with approval_id; run trigger-in + trigger-out; force a failure → DLQ; close gate.
Forbidden: emitting unregistered events; delivering to any of the 15 real routes; leaving delivery_enabled open; payloads carrying body/secret/vector (MP-D8 deny-list); 4 Mothers. No secret logging.
Exact outputs: 4 registered event types; idempotent trigger-in proof; trigger-out emit→route→deliver to test sink; first iu_route_dead_letter row (classified) on forced failure; idempotency re-run proof; gate verify-close (and no real-route delivery); KB report.
Acceptance (PASS): trigger-in idempotent; trigger-out delivered to test sink under bounded window; forced failure produces classified DLQ row; re-run idempotent; delivery gate verified closed with zero real-route impact. BLOCKED if event types cannot be registered or delivery cannot be route-scoped/safely-bounded.
Rollback/verification: retire test route/IU; remove/mark test attempt+dead_letter rows; verify dot_config snapshot == baseline; verify event_type_registry only gained the 4 additive iu.* types (compat-safe, retained).
Notes on the set
- Prompts 1 and 2 are read-only and need no gate/approval → run first, in parallel.
- Prompt 3 is the hinge (bounded gate protocol) → prompts 4 and 5 depend on it.
- Prompts 4 and 5 are mutating + governed → each carries Hard-Gate-0, Dependency Closure, bounded gate use, approval, rollback, and verify-close.
- A 6th follow-up (
IU_CUT_STATE_MACHINE_ROLLBACK_AFTER_APPROVAL_POLICY, U5) is a prerequisite for prompt 4's failure path and should be authored if d5/d6 route through the cut state machine.