KB-390C

MOWD Phase 1 — Next Prompt Pack (32 prompts) (Branch K)

9 min read Revision 1
mowdphase1promptsworkstreams2026-05-29

Branch K — Next Prompt Pack (32 self-contained prompts)

Standing preamble (prepend to every prompt): Host = contabo VPS; container = postgres; DB = directus; read via MCP query_pg role context_pack_readonly; apply (only for BEGIN..ROLLBACK rehearsal or human-approved commit) via ssh contabodocker exec -i postgres psql -U workflow_admin -d directus. Run Hard Gate 0 first (fn_iu_gate_verify_closed() all_safe; idle-in-tx=0; baseline snapshot). Use server-side timeouts; never client-timeout-kill. Forbidden: committed DDL without recorded Điều 32 approval, Directus/Qdrant/vector writes, UI/Nuxt implementation unless the prompt scopes it, runtime/event/job execution, agent self-approval, MOWD as a fifth Mother, second SoT, leaving an idle transaction. MOW remains owner (GOV-MOW). Do not ask the user; use safe defaults and produce human-executable packets where authority is absent.


  1. Human ratification execution. Drive the council/owner ratification of MOWD-PHASE1-EXTEND per doc 01: verify no prior artifact, present the packet, and produce the exact approval_requests + ≥2 apr_approvals insert statements for a human to run. Do not insert them yourself.

  2. Human-approved schema commit. Given a recorded approval, execute doc 02 EXTEND in the off-peak window: preflight (5 checks), single tx, in-tx verify (25/27/9, 8 FK, 2 views, 2/70 smoke), COMMIT, fresh-connection post-verify, and capture evidence. If ok_approved is false, STOP and report.

  3. Read-only DOT registration. After EXTEND commit + the 2 views + 4 read fns exist, register the 6 dot_mow_design_* read DOTs (doc 03 §4) in BEGIN..ROLLBACK first (confirm 54→60→54), then on confirmation COMMIT, and verify catalog count and mutating=false.

  4. Mutating DOT registration. Implement fn_mow_design_bind_iu/_bind_step_iu/_bind_dot/_bind_event/_freeze/_unfreeze/_propose_change/_activate/_rollback, with Điều-35 paired tests; rehearse catalog registration (category design, mutating=true) in BEGIN..ROLLBACK; defer COMMIT until a mutating-DOT approval is recorded.

  5. UI data view implementation. Build the read models behind doc 04 (incl. the pre-aggregated count join and v_mow_governance_cockpit); expose via Directus read-only permissions; verify each surface's fields/filters/sort/traffic-light against live data; no write path.

  6. Inline step → IU migration (WF-001). Execute migration batch B0+B1 (doc 05): mint design IU from BPMN, mint step/guide IUs (dedupe by semantic hash, discard placeholders), bind via DOTs from a human-reviewed manifest, validate GREEN. Per-batch dry-run + tx + verify; reversible.

  7. Workflow validation harness implementation. Package doc 06 as fn_mow_design_validate(workflow_id) returning JSON; wire to dot_mow_design_validate; run §1+§6 read-only now and the full set post-EXTEND; report any non-zero check.

  8. Proposal queue implementation. Implement dot_mow_design_propose_change writing workflow_change_requests (dsl_diff, schema_warnings, status=draft); ensure agent proposals never auto-apply; add the cockpit query for pending proposals with age/SLA.

  9. Activation gate implementation. Implement dot_mow_design_activate enforcing validation GREEN + ≥2 human apr_approvals + caller=GOV-COUNCIL before bumping active_design_version; prove the agent path is rejected by the automated-agent CHECK.

  10. Freeze/unfreeze implementation. Implement dot_mow_design_freeze/_unfreeze; prove frozen designs reject bind/activate; audit each transition; add cockpit 🔴 for frozen-for-error.

  11. MOW tree read model. Build Surface 1 (doc 04) tree/list over v_mow_design_workflow + parent/level/category; verify traffic-light rule and keyset pagination at synthetic scale (thousands of rows) read-only.

  12. MOW Design Registry list/detail read model. Build Surface 2 detail (header+steps+relations+audit); verify per-step traffic-light, dangling-ref sweep, DAG render via dot_mow_design_render_tree.

  13. Governance Cockpit read model. Build Surface 4 over approval_requests/apr_approvals/workflow_change_requests/gates; verify pending/approvals-needed/frozen/validation-failing rollups and gate checked_at freshness.

  14. MOT/JFT read model integration. Build Surface 3 over tasks joined to workflows/steps; keyset paginate for 10k+; traffic-light orphan tasks; read-only (no task runtime).

  15. Pilot workflow selection confirmation. Re-confirm WF-001 vs alternatives on live data; output the pilot data sheet (header, 10 steps, relations, BPMN length, owner) and the binding manifest skeleton.

  16. Pilot workflow IU binding. Execute doc 09 DOT sequence for WF-001 through proposal/approval where required; bind all 10 steps + design IU; reach bound_step_count=10; capture evidence; reversible.

  17. Pilot validation. Run the full harness against WF-001; expect GREEN + 0 dangling; produce the GPT-verifiable evidence pack (SQL + outputs).

  18. Pilot closeout. Run the governance drill (propose→approve→activate→rollback) on WF-001 with ≥2 human signs; document the audit trail; mark pilot PASS/PARTIAL with blockers.

  19. Runtime readiness review. Evaluate doc 08 §4 entry criteria against live state; report which are met; do NOT open operator_runtime_enabled.

  20. Trigger design (Phase 2). Design workflow_trigger_design (distinct from the 107-row trigger_registry DB-trigger catalog) as a design-only table via birth contract; rehearse creation in BEGIN..ROLLBACK; defer commit.

  21. Assignee policy (Phase 2). Design assignee_policy (role/dept/user resolution for human/manager steps) referencing identity (directus_users/roles); document, rehearse, defer.

  22. Hierarchy tables (Phase 2). Design the 6 tbl_* hierarchy tables; map to existing collection/table registries; rehearse births; defer.

  23. Scanner/detector (Phase 2). Design a read-only scanner that detects unbound steps, dangling refs, and inline-text drift across all workflows; output as a health DOT; rehearse.

  24. Mobile/defer review. Assess which UI surfaces need mobile/responsive contracts vs defer; produce a contract delta; no implementation.

  25. Directus boundary check. Audit that no design write path bypasses DOTs into Directus; confirm read-only permissions for the 4 surfaces; report any leak.

  26. Nuxt shell contract. Define the Nuxt SSR shell contract (routes, data-fetch boundaries, permission-driven action rendering) for the 4 surfaces per Điều 28; contract only, no code.

  27. Event/queue boundary. Verify design event refs map to event_type_registry without enabling emission; confirm emit_enabled/job_substrate/dlq.replay stay false; document the design↔runtime event boundary.

  28. Rollback drill. On a copy/rehearsal, execute the doc 02 §6 reversal and the dot_mow_design_rollback forward-only path; prove byte-clean reversal pre-population and version-pin post-population.

  29. Performance/load read-only test. Generate synthetic-scale read load (thousands of workflows / 10k tasks in a rehearsal DB or via EXPLAIN on parameterized queries) against the 4 surface views; report plans, index needs, and the keyset-pagination proof; no production writes.

  30. Final Phase 1 acceptance. Run the full validation harness + governance evidence + UI freshness + pilot closeout; produce the Phase 1 acceptance report (PASS/PARTIAL with exact blockers) and the runtime-phase go/no-go.

  31. DOT family paired-test build (Điều 35). For each mutating dot_mow_design_*, author and run a paired test (happy + reversal + idempotency + gate-denied) read-only/rehearsal; record test_passed; block activation use until green.

  32. MEMORY + KB consolidation. After each workstream, update the auto-memory index and KB with absolute-dated results, links to this package, and the next macro; verify exit==entry gate state and zero idle-tx.


Prompt pack verdict: 32 prompts (≥30 required), each self-contained, host-aware, Hard-Gate-0-aware, forbidden-aware, non-interactive, mapped to the 30 mission workstreams plus paired-test and consolidation.

Back to Knowledge Hub knowledge/dev/reports/architecture/mow-design-registry-phase1-ratify-commit-dot-ui-migration-acceptance-megacampaign-2026-05-29/11-next-prompt-pack.md