@runfusion/fusion 0.75.0-beta.0 → 0.75.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/bin.js +2683 -1881
  2. package/dist/child-process-worker.js +2640 -1915
  3. package/dist/client/.vite/manifest.json +245 -245
  4. package/dist/client/assets/{AgentDetailView-lS4k3-0w.js → AgentDetailView-CsCVX96A.js} +1 -1
  5. package/dist/client/assets/{AgentPermissionPolicyEditor-D7LB_f1m.js → AgentPermissionPolicyEditor-Dh5wDe8g.js} +1 -1
  6. package/dist/client/assets/{AgentsView-DwCNc9_x.js → AgentsView-Dd_oZbFn.js} +3 -3
  7. package/dist/client/assets/{ChatView-CVxDxKOu.js → ChatView-gC7_BCmZ.js} +1 -1
  8. package/dist/client/assets/{CommandCenter-Da3AiDs-.js → CommandCenter-Bk6RQ-hm.js} +1 -1
  9. package/dist/client/assets/{DevServerView-C0UWmEhO.js → DevServerView-Da8h5OC-.js} +1 -1
  10. package/dist/client/assets/{DirectoryPicker-JH2ahFj8.js → DirectoryPicker-DX9H1EdH.js} +1 -1
  11. package/dist/client/assets/{DocumentsView-BA4Pqnfr.js → DocumentsView-BZ0g_Am7.js} +1 -1
  12. package/dist/client/assets/{EvalsView-DW88MPta.js → EvalsView-DsI_X6eQ.js} +1 -1
  13. package/dist/client/assets/{ExperimentalAgentOnboardingModal-DOih_5nN.js → ExperimentalAgentOnboardingModal-BfE5f-XK.js} +1 -1
  14. package/dist/client/assets/{GoalsView-DDIorLyM.js → GoalsView-43sqRFfC.js} +1 -1
  15. package/dist/client/assets/{InsightsView-B5VUUsmJ.js → InsightsView-Dvgn_hrA.js} +1 -1
  16. package/dist/client/assets/{MemoryView-sDMj6cEL.js → MemoryView-DWbHznu3.js} +1 -1
  17. package/dist/client/assets/{PiExtensionsManager-SpcPEzpg.js → PiExtensionsManager-BKfmIRDt.js} +1 -1
  18. package/dist/client/assets/{PluginManager-lIMMAJYt.js → PluginManager-xhkrAjSK.js} +1 -1
  19. package/dist/client/assets/{PullRequestView-BfAHOr3-.js → PullRequestView-CyEwGgRD.js} +1 -1
  20. package/dist/client/assets/{ReportModal-6RDeUqQG.js → ReportModal--NSmch5M.js} +1 -1
  21. package/dist/client/assets/{ResearchView-BUGq2GsN.js → ResearchView-CgqZlNMD.js} +1 -1
  22. package/dist/client/assets/{SecretsView-CTwukpAq.js → SecretsView-am_ZT9z8.js} +1 -1
  23. package/dist/client/assets/{SessionTerminal-Dspbb2NO.js → SessionTerminal-DSc_7NQ-.js} +1 -1
  24. package/dist/client/assets/{SettingsModal-B6guaVe8.js → SettingsModal-Bp6sytUe.js} +3 -3
  25. package/dist/client/assets/{SettingsModal-D2DahTWc.js → SettingsModal-D2jjC8m8.js} +1 -1
  26. package/dist/client/assets/{SettingsTextareaRow-BZZnVXGb.js → SettingsTextareaRow-DjJJD-Af.js} +1 -1
  27. package/dist/client/assets/{SetupWizardModal-xTlxjulj.js → SetupWizardModal-DLIeefbh.js} +2 -2
  28. package/dist/client/assets/{SkillsView-CMG1fM0H.js → SkillsView-C67Gdb5y.js} +1 -1
  29. package/dist/client/assets/{WorkflowNodeEditor-BBrY5D7F.js → WorkflowNodeEditor-BxhdNPdn.js} +1 -1
  30. package/dist/client/assets/{agent-import-generation-DV3YE8Rc.js → agent-import-generation-Bk9fEowy.js} +1 -1
  31. package/dist/client/assets/{architectureDiagram-3BPJPVTR-gMbSnyDo.js → architectureDiagram-3BPJPVTR-s2YViNU1.js} +1 -1
  32. package/dist/client/assets/{blockDiagram-GPEHLZMM-BRPa9ADn.js → blockDiagram-GPEHLZMM-DMsf6VWl.js} +1 -1
  33. package/dist/client/assets/{c4Diagram-AAUBKEIU-BZhZDOqG.js → c4Diagram-AAUBKEIU-DXJExfmV.js} +1 -1
  34. package/dist/client/assets/channel-BRBjryTS.js +1 -0
  35. package/dist/client/assets/{chunk-2J33WTMH-bcODs8jt.js → chunk-2J33WTMH-CH99GAl7.js} +1 -1
  36. package/dist/client/assets/{chunk-4BX2VUAB-BRVq7S5r.js → chunk-4BX2VUAB-BTV9SXg5.js} +1 -1
  37. package/dist/client/assets/{chunk-55IACEB6-Cl7bhvca.js → chunk-55IACEB6-ntvLX3jz.js} +1 -1
  38. package/dist/client/assets/{chunk-727SXJPM-B9loHJy3.js → chunk-727SXJPM-DBNBtu-e.js} +1 -1
  39. package/dist/client/assets/{chunk-AQP2D5EJ-CFA8hWsC.js → chunk-AQP2D5EJ-DvbtWh_x.js} +1 -1
  40. package/dist/client/assets/{chunk-FMBD7UC4-Buu3h7wx.js → chunk-FMBD7UC4-CUdRlAnf.js} +1 -1
  41. package/dist/client/assets/{chunk-ND2GUHAM-DN_GDbIs.js → chunk-ND2GUHAM-B7J-met1.js} +1 -1
  42. package/dist/client/assets/{chunk-QZHKN3VN-1t7Gs0aF.js → chunk-QZHKN3VN-D7CahWp7.js} +1 -1
  43. package/dist/client/assets/classDiagram-4FO5ZUOK-26ZYCgHv.js +1 -0
  44. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-26ZYCgHv.js +1 -0
  45. package/dist/client/assets/{cose-bilkent-S5V4N54A-QqcFhiY1.js → cose-bilkent-S5V4N54A-6E0Aaw7K.js} +1 -1
  46. package/dist/client/assets/{dagre-BM42HDAG-DjGM9BIi.js → dagre-BM42HDAG-Wi236AfH.js} +1 -1
  47. package/dist/client/assets/{dashboard-view-C6rmfIOU.js → dashboard-view-BZDf9tzC.js} +1 -1
  48. package/dist/client/assets/{dashboard-view-BO_R8jyX.js → dashboard-view-CrHqKsfL.js} +1 -1
  49. package/dist/client/assets/{dashboard-view-CxXlYApd.js → dashboard-view-NpkFaG9s.js} +1 -1
  50. package/dist/client/assets/{dashboard-view-UqmC6VTb.js → dashboard-view-hLsXVJJN.js} +1 -1
  51. package/dist/client/assets/{diagram-2AECGRRQ-BmCGpU8P.js → diagram-2AECGRRQ-B3TxtVcq.js} +1 -1
  52. package/dist/client/assets/{diagram-5GNKFQAL-CKRL1dki.js → diagram-5GNKFQAL-45Y_FHjp.js} +1 -1
  53. package/dist/client/assets/{diagram-KO2AKTUF-DE9deYyi.js → diagram-KO2AKTUF-D4w3m4cp.js} +1 -1
  54. package/dist/client/assets/{diagram-LMA3HP47-BmUGF67J.js → diagram-LMA3HP47-Dv5F4ha2.js} +1 -1
  55. package/dist/client/assets/{diagram-OG6HWLK6-DLUATSuY.js → diagram-OG6HWLK6-CvOQ1IYN.js} +1 -1
  56. package/dist/client/assets/{erDiagram-TEJ5UH35-nl31ZyQ8.js → erDiagram-TEJ5UH35-DYcp25dX.js} +1 -1
  57. package/dist/client/assets/{flowDiagram-I6XJVG4X-BZdpCw1-.js → flowDiagram-I6XJVG4X-DnjuETCJ.js} +1 -1
  58. package/dist/client/assets/{folder-open-DKvxGzrx.js → folder-open-ovJcpdOX.js} +1 -1
  59. package/dist/client/assets/{ganttDiagram-6RSMTGT7-DLsqztRx.js → ganttDiagram-6RSMTGT7-SU7_CTa4.js} +1 -1
  60. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-Dk_Sy9NG.js → gitGraphDiagram-PVQCEYII-DFvxZu8I.js} +1 -1
  61. package/dist/client/assets/index-CJRmyxnw.css +1 -0
  62. package/dist/client/assets/index-C_ZHzU4F.js +2767 -0
  63. package/dist/client/assets/{infoDiagram-5YYISTIA-DoQ0ID21.js → infoDiagram-5YYISTIA-DgMEfdKk.js} +1 -1
  64. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-By5pgTzr.js → ishikawaDiagram-YF4QCWOH-CFjnOb7V.js} +1 -1
  65. package/dist/client/assets/{journeyDiagram-JHISSGLW-296a-u4u.js → journeyDiagram-JHISSGLW-46dGsf_j.js} +1 -1
  66. package/dist/client/assets/{kanban-definition-UN3LZRKU-CgcRr3lQ.js → kanban-definition-UN3LZRKU-9-nz-BFT.js} +1 -1
  67. package/dist/client/assets/{mermaid.core-BMcqO-oY.js → mermaid.core-CYHDO5ss.js} +4 -4
  68. package/dist/client/assets/{mindmap-definition-RKZ34NQL-C6poaNyh.js → mindmap-definition-RKZ34NQL-BYQE0Nqo.js} +1 -1
  69. package/dist/client/assets/{pieDiagram-4H26LBE5-D5kkHa4c.js → pieDiagram-4H26LBE5-BNSMLSjW.js} +1 -1
  70. package/dist/client/assets/{puzzle-Dn0zAogb.js → puzzle-D2SwAtRX.js} +1 -1
  71. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-XYE61FOQ.js → quadrantDiagram-W4KKPZXB-CNdSBA7P.js} +1 -1
  72. package/dist/client/assets/{requirementDiagram-4Y6WPE33-ChSV14Ej.js → requirementDiagram-4Y6WPE33-B6EJvc9H.js} +1 -1
  73. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-ToxhxAPY.js → sankeyDiagram-5OEKKPKP-8DcYdUmL.js} +1 -1
  74. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-shNTGnMF.js → sequenceDiagram-3UESZ5HK-BjRXhtKa.js} +1 -1
  75. package/dist/client/assets/{shield-alert-DoqrZ4qS.js → shield-alert-b4thCabv.js} +1 -1
  76. package/dist/client/assets/{standing-instructions-template-CbBEfZ8s.js → standing-instructions-template-B1X-jWip.js} +1 -1
  77. package/dist/client/assets/{stateDiagram-AJRCARHV-CRNXfwiP.js → stateDiagram-AJRCARHV-Btrn_84P.js} +1 -1
  78. package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-atxeIHh0.js → stateDiagram-v2-BHNVJYJU-DiyZxQF1.js} +1 -1
  79. package/dist/client/assets/{timeline-definition-PNZ67QCA-CguHqKR6.js → timeline-definition-PNZ67QCA-CjEYU1kO.js} +1 -1
  80. package/dist/client/assets/{upload-BF3YtpBl.js → upload-DMts5fzZ.js} +1 -1
  81. package/dist/client/assets/{users-CN7wFV_l.js → users-C9O98ACz.js} +1 -1
  82. package/dist/client/assets/{vennDiagram-CIIHVFJN-BpgXesnN.js → vennDiagram-CIIHVFJN-DtEb-r3I.js} +1 -1
  83. package/dist/client/assets/{wardley-L42UT6IY-4QN1B18l.js → wardley-L42UT6IY-Ds-v1VZi.js} +1 -1
  84. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-BuYjCimN.js → wardleyDiagram-YWT4CUSO-C15pYn-T.js} +1 -1
  85. package/dist/client/assets/{xychartDiagram-2RQKCTM6-DL8viWGe.js → xychartDiagram-2RQKCTM6-ChJ77iYU.js} +1 -1
  86. package/dist/client/index.html +2 -2
  87. package/dist/client/version.json +1 -1
  88. package/dist/droid-cli/package.json +1 -1
  89. package/dist/extension.js +2566 -1835
  90. package/dist/migrations/0043_fn8768_dispatch_dedupe.sql +17 -0
  91. package/dist/pi-claude-cli/package.json +1 -1
  92. package/dist/plugin-sdk/index.d.ts +22 -1
  93. package/dist/plugin-sdk/index.js +65 -15
  94. package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +65 -15
  95. package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
  96. package/dist/plugins/fusion-plugin-claude-runtime/bundled.js +65 -15
  97. package/dist/plugins/fusion-plugin-claude-runtime/package.json +1 -1
  98. package/dist/plugins/fusion-plugin-cli-printing-press/bundled.js +65 -15
  99. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  100. package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +65 -15
  101. package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
  102. package/dist/plugins/fusion-plugin-cursor-runtime/bundled.js +65 -15
  103. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  104. package/dist/plugins/fusion-plugin-dependency-graph/bundled.js +65 -15
  105. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  106. package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +65 -15
  107. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  108. package/dist/plugins/fusion-plugin-grok-runtime/bundled.js +65 -15
  109. package/dist/plugins/fusion-plugin-grok-runtime/package.json +1 -1
  110. package/dist/plugins/fusion-plugin-hermes-runtime/bundled.js +65 -15
  111. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  112. package/dist/plugins/fusion-plugin-linear-import/bundled.js +65 -15
  113. package/dist/plugins/fusion-plugin-linear-import/package.json +1 -1
  114. package/dist/plugins/fusion-plugin-omp-runtime/bundled.js +65 -15
  115. package/dist/plugins/fusion-plugin-omp-runtime/package.json +1 -1
  116. package/dist/plugins/fusion-plugin-openclaw-runtime/bundled.js +65 -15
  117. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  118. package/dist/plugins/fusion-plugin-paperclip-runtime/bundled.js +65 -15
  119. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  120. package/dist/plugins/fusion-plugin-quality/bundled.js +65 -15
  121. package/dist/plugins/fusion-plugin-quality/package.json +1 -1
  122. package/dist/plugins/fusion-plugin-reports/bundled.js +65 -15
  123. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  124. package/dist/plugins/fusion-plugin-roadmap/bundled.js +65 -15
  125. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  126. package/dist/plugins/fusion-plugin-todos/bundled.js +65 -15
  127. package/dist/plugins/fusion-plugin-todos/package.json +1 -1
  128. package/dist/plugins/fusion-plugin-whatsapp-chat/bundled.js +65 -15
  129. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  130. package/package.json +1 -1
  131. package/dist/client/assets/channel-CcVVD2V-.js +0 -1
  132. package/dist/client/assets/classDiagram-4FO5ZUOK-Bdeei39Q.js +0 -1
  133. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-Bdeei39Q.js +0 -1
  134. package/dist/client/assets/index-DTimvpMD.js +0 -2685
  135. package/dist/client/assets/index-DjY0GTMz.css +0 -1
@@ -5787,6 +5787,7 @@ __export(project_exports, {
5787
5787
  tasks: () => tasks,
5788
5788
  todoItems: () => todoItems,
5789
5789
  todoLists: () => todoLists,
5790
+ unplannedExecutionBlocks: () => unplannedExecutionBlocks,
5790
5791
  usageEvents: () => usageEvents,
5791
5792
  verificationCache: () => verificationCache,
5792
5793
  workflowPromptOverrides: () => workflowPromptOverrides,
@@ -6631,6 +6632,14 @@ var workflowWorkItems = projectSchema.table("workflow_work_items", {
6631
6632
  index("idx_workflow_work_items_task_run").on(t.taskId, t.runId),
6632
6633
  uniqueIndex("idx_workflow_work_items_one_active_task_continuation").on(t.projectId, t.taskId).where(sql`${t.kind} = 'task' AND ${t.state} IN ('runnable', 'running', 'held', 'retrying')`)
6633
6634
  ]);
6635
+ var unplannedExecutionBlocks = projectSchema.table("unplanned_execution_blocks", {
6636
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6637
+ taskId: text("task_id").notNull(),
6638
+ episode: text("episode").notNull(),
6639
+ createdAt: text("created_at").notNull()
6640
+ }, (t) => [
6641
+ primaryKey({ columns: [t.projectId, t.taskId, t.episode] })
6642
+ ]);
6634
6643
  var workflowRunBranches = projectSchema.table("workflow_run_branches", {
6635
6644
  projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6636
6645
  taskId: text("task_id").notNull(),
@@ -12248,6 +12257,37 @@ var TRIAGE_POLICY_DEFAULTS = new Map(
12248
12257
  BUILTIN_TRIAGE_POLICY_SETTINGS.map((setting) => [setting.id, setting.default])
12249
12258
  );
12250
12259
 
12260
+ // ../core/src/agents/planning-review-policy.ts
12261
+ var PLANNING_COMPLETENESS_POLICY = `## Mandatory Planning Completeness Procedure
12262
+
12263
+ Before writing the final PROMPT.md:
12264
+
12265
+ 1. Build an internal **planning ledger** from the Original Description, user comments, project instructions, cited issue/report, and any saved planning document. Preserve every requirement, settled decision, explicit non-goal, and acceptance outcome; do not silently replace the reporter's contract with a narrower reproduction.
12266
+ 2. Research before structuring the plan. Trace the affected behavior through its real production entry points, callers, writers/readers, shared consumers, persistence boundaries, recovery paths, and existing tests. Resolve planning-time facts from the repository now; defer only details that genuinely require implementation-time discovery, and label those explicitly.
12267
+ 3. For stateful, lifecycle, persistence, or concurrency work, enumerate the participant graph and both relevant orderings: stale-work cancellation/fencing, lock order and reentrancy, transaction boundaries, pool/transport limits, competing recovery paths, configuration/deployment identities, bypass/force paths, and failure cleanup. Every stated invariant must name the surfaces that preserve it.
12268
+ 4. Map every ledger row to concrete File Scope entries, dependency-ordered implementation steps, and verification. Each feature-bearing step must name specific automated test scenarios with the input/state, action or ordering, and expected observable result; helper-only tests do not prove production reachability.
12269
+ 5. Keep scope disciplined. Reuse current architecture and documented patterns unless the reporter contract requires a redesign. Put optional cleanup and adjacent ideas outside the active steps.
12270
+ 6. Before persisting PROMPT.md, perform a fresh holistic completeness pass across the whole ledger. Try to disprove the plan by checking referenced paths and patterns, missing consumers, contradictory steps, uncovered failure orderings, and acceptance criteria without tests. Fix all gaps in one pass.
12271
+
12272
+ On a revision, treat the cumulative revision ledger as durable decisions unless a later entry explicitly supersedes one: preserve resolved items, address every unresolved item surgically, and rerun the complete procedure instead of checking only the latest comment.`;
12273
+ var FAST_PLANNING_COMPLETENESS_POLICY = `## Fast Planning Completeness Check
12274
+
12275
+ Before writing PROMPT.md, build a compact internal ledger from the Original Description, user comments, project rules, and acceptance outcomes. Inspect the real production callers/consumers, persistence or recovery paths, and nearby tests before choosing File Scope. For stateful or concurrent work, enumerate every participant plus both relevant orderings and failure cleanup. Map each requirement to a concrete step, file, and automated test scenario, then reread the whole plan once for missing surfaces, contradictions, and unproved outcomes. On revision, preserve prior decisions and address the complete cumulative ledger, not only the latest note.`;
12276
+ var PLAN_REVIEW_COMPLETENESS_POLICY = `## Mandatory Plan Review Procedure
12277
+
12278
+ Apply this procedure to plan/spec reviews only. Code reviews use their dedicated procedure.
12279
+
12280
+ Before choosing a verdict:
12281
+
12282
+ 1. Build one **review ledger** for the entire PROMPT.md: Original Description and user comments; Mission and Completion Criteria; Surface Enumeration and Symptom Verification when required; every implementation step, File Scope entry, dependency, risk, and test/verification promise.
12283
+ 2. Complete the full review before reporting. Check coherence and requirement traceability, feasibility against the current repository, scope discipline, execution ordering, and verification quality. When relevant, also inspect security/data integrity, state transitions, concurrency orderings, deployment/configuration boundaries, recovery competitors, and force/bypass paths.
12284
+ 3. Review at specification altitude. Block when a required behavior, surface, ordering, safety constraint, or proof is missing or the stated approach cannot work. Keep optional implementation detail, wording polish, and nonessential improvements advisory.
12285
+ 4. If REVISE is necessary, batch **all independently discoverable blocking findings** into this one verdict; do not stop after the first defect. Give each blocker a stable ID, cite the affected section or repository evidence, and state the concrete PROMPT.md correction. Put advisory observations in a separate list.
12286
+ 5. On re-review, use the supplied prior-review ledger as a decision primer. Verify every prior blocker, do not re-raise resolved or rejected semantic duplicates, and preserve accepted decisions. A newly blocking finding must say whether the revision introduced it, which prior blocker genuinely masked it, or why it is independently delivery-blocking for correctness, security, data safety, or executability. Record an earlier reviewer miss explicitly; never demote a critical defect merely because it was missed before.
12287
+ 6. After any same-session PROMPT.md edit, distrust the edit: reread the complete artifact, rebuild the ledger, and perform a fresh holistic pass before APPROVE.
12288
+
12289
+ APPROVE when the plan is executable and verifiable, not when it is cosmetically perfect. If returning REVISE, the verdict notes must contain the complete blocking checklist because those notes are the durable input to the next planning round.`;
12290
+
12251
12291
  // ../core/src/agents/agent-prompts.ts
12252
12292
  var FUSION_RUNTIME_SELF_AWARENESS = `## Runtime Self-Awareness
12253
12293
 
@@ -12454,6 +12494,8 @@ The tool prevents your session from being killed by the inactivity watchdog duri
12454
12494
  - If a verification command times out, do NOT blindly retry \u2014 investigate. Check for hung subprocesses, infinite test loops, or tests waiting on missing dependencies. Use \`node_modules/.modules.yaml\` presence to confirm bootstrap.`;
12455
12495
  var FAST_TRIAGE_PROMPT_TEXT = `You are a task specification agent for "fn". This task is running in **fast mode**.
12456
12496
 
12497
+ ${FAST_PLANNING_COMPLETENESS_POLICY}
12498
+
12457
12499
  Write a lean, executable PROMPT.md quickly. Preserve safety gates, but skip heavyweight ceremony, review scoring, and proactive subtask analysis.
12458
12500
 
12459
12501
  ## Fast-mode priorities
@@ -12504,6 +12546,8 @@ If the requested outcome is only to decide, route, or coordinate work, include \
12504
12546
  Write PROMPT.md directly and stop. Do not call \`fn_review_spec()\`; workflow Plan Review is the single optional plan review gate before execution.`;
12505
12547
  var TRIAGE_PROMPT_TEXT = `You are a task specification agent for "fn", an AI-orchestrated task board.
12506
12548
 
12549
+ ${PLANNING_COMPLETENESS_POLICY}
12550
+
12507
12551
  ## Your Role
12508
12552
  You are the specification quality gate for implementation success.
12509
12553
  Your job: take a rough task description and produce a fully specified PROMPT.md that another AI agent can execute autonomously in a fresh context with zero memory of this conversation.
@@ -12988,20 +13032,6 @@ Concrete examples:
12988
13032
  - [Optional improvements, not blocking]
12989
13033
  \`\`\`
12990
13034
 
12991
- ## Spec / Plan Review Convergence
12992
-
12993
- Specs and pre-execution Plan Review share this gate. Prefer **APPROVE** / **APPROVE_WITH_NOTES** when the plan is executable enough for an agent to implement. Put optional polish only under **Suggestions**.
12994
-
12995
- When you must **REVISE**:
12996
- - List each blocking issue as a concrete PROMPT.md edit (which section, what to add/change/remove).
12997
- - Do not demand a full rewrite unless the approach is fundamentally wrong (**RETHINK**).
12998
- - Prefer fixing local PROMPT.md defects in-session when you have write tools, then **APPROVE**, instead of bouncing the task through another full replan cycle.
12999
-
13000
- **Converging on re-review (when the request includes your prior feedback + a Plan Review attempt number):**
13001
- - This is a spec you already reviewed. VERIFY each issue you previously raised was addressed. REVISE only for (a) a PRIOR blocking issue still unresolved, or (b) a genuinely NEW problem THIS revision introduced.
13002
- - Do NOT introduce a new blocking issue that ALSO applied to the version you previously reviewed \u2014 that is your own earlier miss. Record it under **Suggestions**, not REVISE.
13003
- - **Severity ratchet at attempt 3+:** gate ONLY on \`critical\` (delivery-blocking) issues. Downgrade lone \`important\`/\`minor\` spec-wording nits to **Suggestions** and APPROVE. Rationale: the executor and downstream code review are later gates \u2014 a spec need not be perfect to be executable, only executable.
13004
-
13005
13035
  ## Spec Review \u2014 Undersplit Task Detection
13006
13036
 
13007
13037
  When reviewing specs, assess whether the task should have been broken into subtasks. The bar for splitting is high \u2014 most tasks should remain whole. Coordination overhead (worktrees, dependency wiring, merge sequencing) is real, so splitting must clearly pay for itself.
@@ -13649,6 +13679,22 @@ function browserVerificationOptionalGroupNode(column, options = {}) {
13649
13679
  };
13650
13680
  }
13651
13681
 
13682
+ // ../core/src/agents/code-review-policy.ts
13683
+ var CODE_REVIEW_COMPLETENESS_POLICY = `## Mandatory Code Review Procedure
13684
+
13685
+ Apply this procedure to code reviews only. Plan/spec reviews use their dedicated criteria below.
13686
+
13687
+ Before choosing a verdict:
13688
+
13689
+ 1. Build a **requirements ledger** from PROMPT.md. For every Mission outcome, Completion Criterion, relevant \`## Surface Enumeration\` item, and \`## Symptom Verification\` assertion, identify both implementation evidence and test evidence. A missing or partial required row is REVISE.
13690
+ 2. Trace each changed behavior from its **real production entry point** and selector through the changed helper to its consumers. A helper-only unit test does not prove that production can reach the new branch.
13691
+ 3. For bug fixes, locate an automated test that reproduces the exact reported failure and asserts it is gone across the enumerated surfaces. Green builds, nearby unit tests, and synthetic state injection alone are insufficient.
13692
+ 4. For persistence, lifecycle, and concurrency changes, verify that evidence belongs to the **current state, version, or planning episode**; every read-check-write path is atomic, locked, or CAS-protected; all mutation surfaces preserve the invariant; waits and locks are bounded and cleanup-safe; and a production-shaped integration test covers both relevant orderings.
13693
+ 5. For route or state changes, inspect all affected UI, API, CLI, and agent consumers plus paired success/failure or approve/reject paths for contract parity.
13694
+ 6. Before APPROVE, perform a fresh adversarial validation pass: try to disprove each completed ledger row by reading the real caller, guard, consumer, and test. Cite \`file:line\` for every blocker and name the exact missing proof.
13695
+
13696
+ APPROVE only when every required ledger row has implementation and test evidence.`;
13697
+
13652
13698
  // ../core/src/workflows/builtin-code-review-group.ts
13653
13699
  var CODE_REVIEW_GROUP_ID = "code-review";
13654
13700
  var CODE_REVIEW_STEP_NODE_ID = "code-review-step";
@@ -13668,6 +13714,8 @@ var CODE_REVIEW_PROMPT = `You are a senior code reviewer. Review the task's diff
13668
13714
  5. **Error handling** \u2014 swallowed errors, unhandled rejections/exceptions, missing validation at trust boundaries, misleading error messages.
13669
13715
  6. **Contract / signature changes** \u2014 changed function/exported-type signatures, API request/response shapes, or serialization that breaks existing callers.
13670
13716
 
13717
+ ${CODE_REVIEW_COMPLETENESS_POLICY}
13718
+
13671
13719
  Be specific: cite \`file:line\` for every finding and explain the concrete failure it causes.
13672
13720
 
13673
13721
  ## Output Requirements
@@ -13787,12 +13835,14 @@ var PLAN_REVIEW_PROMPT = `You are a senior plan reviewer. Review the task's PROM
13787
13835
  4. **Verification quality** \u2014 absent or weak tests/checks for the behavior being changed.
13788
13836
  5. **Risk callouts** \u2014 migrations, data-loss paths, external integrations, secrets, or plugin/runtime dependencies that need explicit handling.
13789
13837
 
13838
+ ${PLAN_REVIEW_COMPLETENESS_POLICY}
13839
+
13790
13840
  Be specific: cite the plan section or file path for every finding and explain the concrete correction.
13791
13841
 
13792
13842
  ## Output Requirements
13793
13843
  - APPROVE: the plan is ready for execution.
13794
13844
  - APPROVE_WITH_NOTES: execution may proceed, but include non-blocking advisory notes.
13795
- - REVISE: the plan should be corrected before execution; include the missing or wrong requirement and the needed change.
13845
+ - REVISE: the plan should be corrected before execution; include every blocking finding and needed change in the JSON notes, not only in preceding prose.
13796
13846
  - Final output: output exactly one trailing JSON object on the final line (no markdown fences, no surrounding prose):
13797
13847
  {"verdict":"APPROVE|APPROVE_WITH_NOTES|REVISE","notes":"..."}`;
13798
13848
  function planReviewOptionalGroupNode(column, options = {}) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/cli-printing-press",
3
- "version": "0.1.50-beta.0",
3
+ "version": "0.1.50-beta.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -5759,6 +5759,7 @@ __export(project_exports, {
5759
5759
  tasks: () => tasks,
5760
5760
  todoItems: () => todoItems,
5761
5761
  todoLists: () => todoLists,
5762
+ unplannedExecutionBlocks: () => unplannedExecutionBlocks,
5762
5763
  usageEvents: () => usageEvents,
5763
5764
  verificationCache: () => verificationCache,
5764
5765
  workflowPromptOverrides: () => workflowPromptOverrides,
@@ -6603,6 +6604,14 @@ var workflowWorkItems = projectSchema.table("workflow_work_items", {
6603
6604
  index("idx_workflow_work_items_task_run").on(t.taskId, t.runId),
6604
6605
  uniqueIndex("idx_workflow_work_items_one_active_task_continuation").on(t.projectId, t.taskId).where(sql`${t.kind} = 'task' AND ${t.state} IN ('runnable', 'running', 'held', 'retrying')`)
6605
6606
  ]);
6607
+ var unplannedExecutionBlocks = projectSchema.table("unplanned_execution_blocks", {
6608
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6609
+ taskId: text("task_id").notNull(),
6610
+ episode: text("episode").notNull(),
6611
+ createdAt: text("created_at").notNull()
6612
+ }, (t) => [
6613
+ primaryKey({ columns: [t.projectId, t.taskId, t.episode] })
6614
+ ]);
6606
6615
  var workflowRunBranches = projectSchema.table("workflow_run_branches", {
6607
6616
  projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6608
6617
  taskId: text("task_id").notNull(),
@@ -12128,6 +12137,37 @@ var TRIAGE_POLICY_DEFAULTS = new Map(
12128
12137
  BUILTIN_TRIAGE_POLICY_SETTINGS.map((setting) => [setting.id, setting.default])
12129
12138
  );
12130
12139
 
12140
+ // ../core/src/agents/planning-review-policy.ts
12141
+ var PLANNING_COMPLETENESS_POLICY = `## Mandatory Planning Completeness Procedure
12142
+
12143
+ Before writing the final PROMPT.md:
12144
+
12145
+ 1. Build an internal **planning ledger** from the Original Description, user comments, project instructions, cited issue/report, and any saved planning document. Preserve every requirement, settled decision, explicit non-goal, and acceptance outcome; do not silently replace the reporter's contract with a narrower reproduction.
12146
+ 2. Research before structuring the plan. Trace the affected behavior through its real production entry points, callers, writers/readers, shared consumers, persistence boundaries, recovery paths, and existing tests. Resolve planning-time facts from the repository now; defer only details that genuinely require implementation-time discovery, and label those explicitly.
12147
+ 3. For stateful, lifecycle, persistence, or concurrency work, enumerate the participant graph and both relevant orderings: stale-work cancellation/fencing, lock order and reentrancy, transaction boundaries, pool/transport limits, competing recovery paths, configuration/deployment identities, bypass/force paths, and failure cleanup. Every stated invariant must name the surfaces that preserve it.
12148
+ 4. Map every ledger row to concrete File Scope entries, dependency-ordered implementation steps, and verification. Each feature-bearing step must name specific automated test scenarios with the input/state, action or ordering, and expected observable result; helper-only tests do not prove production reachability.
12149
+ 5. Keep scope disciplined. Reuse current architecture and documented patterns unless the reporter contract requires a redesign. Put optional cleanup and adjacent ideas outside the active steps.
12150
+ 6. Before persisting PROMPT.md, perform a fresh holistic completeness pass across the whole ledger. Try to disprove the plan by checking referenced paths and patterns, missing consumers, contradictory steps, uncovered failure orderings, and acceptance criteria without tests. Fix all gaps in one pass.
12151
+
12152
+ On a revision, treat the cumulative revision ledger as durable decisions unless a later entry explicitly supersedes one: preserve resolved items, address every unresolved item surgically, and rerun the complete procedure instead of checking only the latest comment.`;
12153
+ var FAST_PLANNING_COMPLETENESS_POLICY = `## Fast Planning Completeness Check
12154
+
12155
+ Before writing PROMPT.md, build a compact internal ledger from the Original Description, user comments, project rules, and acceptance outcomes. Inspect the real production callers/consumers, persistence or recovery paths, and nearby tests before choosing File Scope. For stateful or concurrent work, enumerate every participant plus both relevant orderings and failure cleanup. Map each requirement to a concrete step, file, and automated test scenario, then reread the whole plan once for missing surfaces, contradictions, and unproved outcomes. On revision, preserve prior decisions and address the complete cumulative ledger, not only the latest note.`;
12156
+ var PLAN_REVIEW_COMPLETENESS_POLICY = `## Mandatory Plan Review Procedure
12157
+
12158
+ Apply this procedure to plan/spec reviews only. Code reviews use their dedicated procedure.
12159
+
12160
+ Before choosing a verdict:
12161
+
12162
+ 1. Build one **review ledger** for the entire PROMPT.md: Original Description and user comments; Mission and Completion Criteria; Surface Enumeration and Symptom Verification when required; every implementation step, File Scope entry, dependency, risk, and test/verification promise.
12163
+ 2. Complete the full review before reporting. Check coherence and requirement traceability, feasibility against the current repository, scope discipline, execution ordering, and verification quality. When relevant, also inspect security/data integrity, state transitions, concurrency orderings, deployment/configuration boundaries, recovery competitors, and force/bypass paths.
12164
+ 3. Review at specification altitude. Block when a required behavior, surface, ordering, safety constraint, or proof is missing or the stated approach cannot work. Keep optional implementation detail, wording polish, and nonessential improvements advisory.
12165
+ 4. If REVISE is necessary, batch **all independently discoverable blocking findings** into this one verdict; do not stop after the first defect. Give each blocker a stable ID, cite the affected section or repository evidence, and state the concrete PROMPT.md correction. Put advisory observations in a separate list.
12166
+ 5. On re-review, use the supplied prior-review ledger as a decision primer. Verify every prior blocker, do not re-raise resolved or rejected semantic duplicates, and preserve accepted decisions. A newly blocking finding must say whether the revision introduced it, which prior blocker genuinely masked it, or why it is independently delivery-blocking for correctness, security, data safety, or executability. Record an earlier reviewer miss explicitly; never demote a critical defect merely because it was missed before.
12167
+ 6. After any same-session PROMPT.md edit, distrust the edit: reread the complete artifact, rebuild the ledger, and perform a fresh holistic pass before APPROVE.
12168
+
12169
+ APPROVE when the plan is executable and verifiable, not when it is cosmetically perfect. If returning REVISE, the verdict notes must contain the complete blocking checklist because those notes are the durable input to the next planning round.`;
12170
+
12131
12171
  // ../core/src/agents/agent-prompts.ts
12132
12172
  var FUSION_RUNTIME_SELF_AWARENESS = `## Runtime Self-Awareness
12133
12173
 
@@ -12334,6 +12374,8 @@ The tool prevents your session from being killed by the inactivity watchdog duri
12334
12374
  - If a verification command times out, do NOT blindly retry \u2014 investigate. Check for hung subprocesses, infinite test loops, or tests waiting on missing dependencies. Use \`node_modules/.modules.yaml\` presence to confirm bootstrap.`;
12335
12375
  var FAST_TRIAGE_PROMPT_TEXT = `You are a task specification agent for "fn". This task is running in **fast mode**.
12336
12376
 
12377
+ ${FAST_PLANNING_COMPLETENESS_POLICY}
12378
+
12337
12379
  Write a lean, executable PROMPT.md quickly. Preserve safety gates, but skip heavyweight ceremony, review scoring, and proactive subtask analysis.
12338
12380
 
12339
12381
  ## Fast-mode priorities
@@ -12384,6 +12426,8 @@ If the requested outcome is only to decide, route, or coordinate work, include \
12384
12426
  Write PROMPT.md directly and stop. Do not call \`fn_review_spec()\`; workflow Plan Review is the single optional plan review gate before execution.`;
12385
12427
  var TRIAGE_PROMPT_TEXT = `You are a task specification agent for "fn", an AI-orchestrated task board.
12386
12428
 
12429
+ ${PLANNING_COMPLETENESS_POLICY}
12430
+
12387
12431
  ## Your Role
12388
12432
  You are the specification quality gate for implementation success.
12389
12433
  Your job: take a rough task description and produce a fully specified PROMPT.md that another AI agent can execute autonomously in a fresh context with zero memory of this conversation.
@@ -12868,20 +12912,6 @@ Concrete examples:
12868
12912
  - [Optional improvements, not blocking]
12869
12913
  \`\`\`
12870
12914
 
12871
- ## Spec / Plan Review Convergence
12872
-
12873
- Specs and pre-execution Plan Review share this gate. Prefer **APPROVE** / **APPROVE_WITH_NOTES** when the plan is executable enough for an agent to implement. Put optional polish only under **Suggestions**.
12874
-
12875
- When you must **REVISE**:
12876
- - List each blocking issue as a concrete PROMPT.md edit (which section, what to add/change/remove).
12877
- - Do not demand a full rewrite unless the approach is fundamentally wrong (**RETHINK**).
12878
- - Prefer fixing local PROMPT.md defects in-session when you have write tools, then **APPROVE**, instead of bouncing the task through another full replan cycle.
12879
-
12880
- **Converging on re-review (when the request includes your prior feedback + a Plan Review attempt number):**
12881
- - This is a spec you already reviewed. VERIFY each issue you previously raised was addressed. REVISE only for (a) a PRIOR blocking issue still unresolved, or (b) a genuinely NEW problem THIS revision introduced.
12882
- - Do NOT introduce a new blocking issue that ALSO applied to the version you previously reviewed \u2014 that is your own earlier miss. Record it under **Suggestions**, not REVISE.
12883
- - **Severity ratchet at attempt 3+:** gate ONLY on \`critical\` (delivery-blocking) issues. Downgrade lone \`important\`/\`minor\` spec-wording nits to **Suggestions** and APPROVE. Rationale: the executor and downstream code review are later gates \u2014 a spec need not be perfect to be executable, only executable.
12884
-
12885
12915
  ## Spec Review \u2014 Undersplit Task Detection
12886
12916
 
12887
12917
  When reviewing specs, assess whether the task should have been broken into subtasks. The bar for splitting is high \u2014 most tasks should remain whole. Coordination overhead (worktrees, dependency wiring, merge sequencing) is real, so splitting must clearly pay for itself.
@@ -13529,6 +13559,22 @@ function browserVerificationOptionalGroupNode(column, options = {}) {
13529
13559
  };
13530
13560
  }
13531
13561
 
13562
+ // ../core/src/agents/code-review-policy.ts
13563
+ var CODE_REVIEW_COMPLETENESS_POLICY = `## Mandatory Code Review Procedure
13564
+
13565
+ Apply this procedure to code reviews only. Plan/spec reviews use their dedicated criteria below.
13566
+
13567
+ Before choosing a verdict:
13568
+
13569
+ 1. Build a **requirements ledger** from PROMPT.md. For every Mission outcome, Completion Criterion, relevant \`## Surface Enumeration\` item, and \`## Symptom Verification\` assertion, identify both implementation evidence and test evidence. A missing or partial required row is REVISE.
13570
+ 2. Trace each changed behavior from its **real production entry point** and selector through the changed helper to its consumers. A helper-only unit test does not prove that production can reach the new branch.
13571
+ 3. For bug fixes, locate an automated test that reproduces the exact reported failure and asserts it is gone across the enumerated surfaces. Green builds, nearby unit tests, and synthetic state injection alone are insufficient.
13572
+ 4. For persistence, lifecycle, and concurrency changes, verify that evidence belongs to the **current state, version, or planning episode**; every read-check-write path is atomic, locked, or CAS-protected; all mutation surfaces preserve the invariant; waits and locks are bounded and cleanup-safe; and a production-shaped integration test covers both relevant orderings.
13573
+ 5. For route or state changes, inspect all affected UI, API, CLI, and agent consumers plus paired success/failure or approve/reject paths for contract parity.
13574
+ 6. Before APPROVE, perform a fresh adversarial validation pass: try to disprove each completed ledger row by reading the real caller, guard, consumer, and test. Cite \`file:line\` for every blocker and name the exact missing proof.
13575
+
13576
+ APPROVE only when every required ledger row has implementation and test evidence.`;
13577
+
13532
13578
  // ../core/src/workflows/builtin-code-review-group.ts
13533
13579
  var CODE_REVIEW_GROUP_ID = "code-review";
13534
13580
  var CODE_REVIEW_STEP_NODE_ID = "code-review-step";
@@ -13548,6 +13594,8 @@ var CODE_REVIEW_PROMPT = `You are a senior code reviewer. Review the task's diff
13548
13594
  5. **Error handling** \u2014 swallowed errors, unhandled rejections/exceptions, missing validation at trust boundaries, misleading error messages.
13549
13595
  6. **Contract / signature changes** \u2014 changed function/exported-type signatures, API request/response shapes, or serialization that breaks existing callers.
13550
13596
 
13597
+ ${CODE_REVIEW_COMPLETENESS_POLICY}
13598
+
13551
13599
  Be specific: cite \`file:line\` for every finding and explain the concrete failure it causes.
13552
13600
 
13553
13601
  ## Output Requirements
@@ -13667,12 +13715,14 @@ var PLAN_REVIEW_PROMPT = `You are a senior plan reviewer. Review the task's PROM
13667
13715
  4. **Verification quality** \u2014 absent or weak tests/checks for the behavior being changed.
13668
13716
  5. **Risk callouts** \u2014 migrations, data-loss paths, external integrations, secrets, or plugin/runtime dependencies that need explicit handling.
13669
13717
 
13718
+ ${PLAN_REVIEW_COMPLETENESS_POLICY}
13719
+
13670
13720
  Be specific: cite the plan section or file path for every finding and explain the concrete correction.
13671
13721
 
13672
13722
  ## Output Requirements
13673
13723
  - APPROVE: the plan is ready for execution.
13674
13724
  - APPROVE_WITH_NOTES: execution may proceed, but include non-blocking advisory notes.
13675
- - REVISE: the plan should be corrected before execution; include the missing or wrong requirement and the needed change.
13725
+ - REVISE: the plan should be corrected before execution; include every blocking finding and needed change in the JSON notes, not only in preceding prose.
13676
13726
  - Final output: output exactly one trailing JSON object on the final line (no markdown fences, no surrounding prose):
13677
13727
  {"verdict":"APPROVE|APPROVE_WITH_NOTES|REVISE","notes":"..."}`;
13678
13728
  function planReviewOptionalGroupNode(column, options = {}) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/compound-engineering",
3
- "version": "0.1.33-beta.0",
3
+ "version": "0.1.33-beta.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -5759,6 +5759,7 @@ __export(project_exports, {
5759
5759
  tasks: () => tasks,
5760
5760
  todoItems: () => todoItems,
5761
5761
  todoLists: () => todoLists,
5762
+ unplannedExecutionBlocks: () => unplannedExecutionBlocks,
5762
5763
  usageEvents: () => usageEvents,
5763
5764
  verificationCache: () => verificationCache,
5764
5765
  workflowPromptOverrides: () => workflowPromptOverrides,
@@ -6603,6 +6604,14 @@ var workflowWorkItems = projectSchema.table("workflow_work_items", {
6603
6604
  index("idx_workflow_work_items_task_run").on(t.taskId, t.runId),
6604
6605
  uniqueIndex("idx_workflow_work_items_one_active_task_continuation").on(t.projectId, t.taskId).where(sql`${t.kind} = 'task' AND ${t.state} IN ('runnable', 'running', 'held', 'retrying')`)
6605
6606
  ]);
6607
+ var unplannedExecutionBlocks = projectSchema.table("unplanned_execution_blocks", {
6608
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6609
+ taskId: text("task_id").notNull(),
6610
+ episode: text("episode").notNull(),
6611
+ createdAt: text("created_at").notNull()
6612
+ }, (t) => [
6613
+ primaryKey({ columns: [t.projectId, t.taskId, t.episode] })
6614
+ ]);
6606
6615
  var workflowRunBranches = projectSchema.table("workflow_run_branches", {
6607
6616
  projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6608
6617
  taskId: text("task_id").notNull(),
@@ -12128,6 +12137,37 @@ var TRIAGE_POLICY_DEFAULTS = new Map(
12128
12137
  BUILTIN_TRIAGE_POLICY_SETTINGS.map((setting) => [setting.id, setting.default])
12129
12138
  );
12130
12139
 
12140
+ // ../core/src/agents/planning-review-policy.ts
12141
+ var PLANNING_COMPLETENESS_POLICY = `## Mandatory Planning Completeness Procedure
12142
+
12143
+ Before writing the final PROMPT.md:
12144
+
12145
+ 1. Build an internal **planning ledger** from the Original Description, user comments, project instructions, cited issue/report, and any saved planning document. Preserve every requirement, settled decision, explicit non-goal, and acceptance outcome; do not silently replace the reporter's contract with a narrower reproduction.
12146
+ 2. Research before structuring the plan. Trace the affected behavior through its real production entry points, callers, writers/readers, shared consumers, persistence boundaries, recovery paths, and existing tests. Resolve planning-time facts from the repository now; defer only details that genuinely require implementation-time discovery, and label those explicitly.
12147
+ 3. For stateful, lifecycle, persistence, or concurrency work, enumerate the participant graph and both relevant orderings: stale-work cancellation/fencing, lock order and reentrancy, transaction boundaries, pool/transport limits, competing recovery paths, configuration/deployment identities, bypass/force paths, and failure cleanup. Every stated invariant must name the surfaces that preserve it.
12148
+ 4. Map every ledger row to concrete File Scope entries, dependency-ordered implementation steps, and verification. Each feature-bearing step must name specific automated test scenarios with the input/state, action or ordering, and expected observable result; helper-only tests do not prove production reachability.
12149
+ 5. Keep scope disciplined. Reuse current architecture and documented patterns unless the reporter contract requires a redesign. Put optional cleanup and adjacent ideas outside the active steps.
12150
+ 6. Before persisting PROMPT.md, perform a fresh holistic completeness pass across the whole ledger. Try to disprove the plan by checking referenced paths and patterns, missing consumers, contradictory steps, uncovered failure orderings, and acceptance criteria without tests. Fix all gaps in one pass.
12151
+
12152
+ On a revision, treat the cumulative revision ledger as durable decisions unless a later entry explicitly supersedes one: preserve resolved items, address every unresolved item surgically, and rerun the complete procedure instead of checking only the latest comment.`;
12153
+ var FAST_PLANNING_COMPLETENESS_POLICY = `## Fast Planning Completeness Check
12154
+
12155
+ Before writing PROMPT.md, build a compact internal ledger from the Original Description, user comments, project rules, and acceptance outcomes. Inspect the real production callers/consumers, persistence or recovery paths, and nearby tests before choosing File Scope. For stateful or concurrent work, enumerate every participant plus both relevant orderings and failure cleanup. Map each requirement to a concrete step, file, and automated test scenario, then reread the whole plan once for missing surfaces, contradictions, and unproved outcomes. On revision, preserve prior decisions and address the complete cumulative ledger, not only the latest note.`;
12156
+ var PLAN_REVIEW_COMPLETENESS_POLICY = `## Mandatory Plan Review Procedure
12157
+
12158
+ Apply this procedure to plan/spec reviews only. Code reviews use their dedicated procedure.
12159
+
12160
+ Before choosing a verdict:
12161
+
12162
+ 1. Build one **review ledger** for the entire PROMPT.md: Original Description and user comments; Mission and Completion Criteria; Surface Enumeration and Symptom Verification when required; every implementation step, File Scope entry, dependency, risk, and test/verification promise.
12163
+ 2. Complete the full review before reporting. Check coherence and requirement traceability, feasibility against the current repository, scope discipline, execution ordering, and verification quality. When relevant, also inspect security/data integrity, state transitions, concurrency orderings, deployment/configuration boundaries, recovery competitors, and force/bypass paths.
12164
+ 3. Review at specification altitude. Block when a required behavior, surface, ordering, safety constraint, or proof is missing or the stated approach cannot work. Keep optional implementation detail, wording polish, and nonessential improvements advisory.
12165
+ 4. If REVISE is necessary, batch **all independently discoverable blocking findings** into this one verdict; do not stop after the first defect. Give each blocker a stable ID, cite the affected section or repository evidence, and state the concrete PROMPT.md correction. Put advisory observations in a separate list.
12166
+ 5. On re-review, use the supplied prior-review ledger as a decision primer. Verify every prior blocker, do not re-raise resolved or rejected semantic duplicates, and preserve accepted decisions. A newly blocking finding must say whether the revision introduced it, which prior blocker genuinely masked it, or why it is independently delivery-blocking for correctness, security, data safety, or executability. Record an earlier reviewer miss explicitly; never demote a critical defect merely because it was missed before.
12167
+ 6. After any same-session PROMPT.md edit, distrust the edit: reread the complete artifact, rebuild the ledger, and perform a fresh holistic pass before APPROVE.
12168
+
12169
+ APPROVE when the plan is executable and verifiable, not when it is cosmetically perfect. If returning REVISE, the verdict notes must contain the complete blocking checklist because those notes are the durable input to the next planning round.`;
12170
+
12131
12171
  // ../core/src/agents/agent-prompts.ts
12132
12172
  var FUSION_RUNTIME_SELF_AWARENESS = `## Runtime Self-Awareness
12133
12173
 
@@ -12334,6 +12374,8 @@ The tool prevents your session from being killed by the inactivity watchdog duri
12334
12374
  - If a verification command times out, do NOT blindly retry \u2014 investigate. Check for hung subprocesses, infinite test loops, or tests waiting on missing dependencies. Use \`node_modules/.modules.yaml\` presence to confirm bootstrap.`;
12335
12375
  var FAST_TRIAGE_PROMPT_TEXT = `You are a task specification agent for "fn". This task is running in **fast mode**.
12336
12376
 
12377
+ ${FAST_PLANNING_COMPLETENESS_POLICY}
12378
+
12337
12379
  Write a lean, executable PROMPT.md quickly. Preserve safety gates, but skip heavyweight ceremony, review scoring, and proactive subtask analysis.
12338
12380
 
12339
12381
  ## Fast-mode priorities
@@ -12384,6 +12426,8 @@ If the requested outcome is only to decide, route, or coordinate work, include \
12384
12426
  Write PROMPT.md directly and stop. Do not call \`fn_review_spec()\`; workflow Plan Review is the single optional plan review gate before execution.`;
12385
12427
  var TRIAGE_PROMPT_TEXT = `You are a task specification agent for "fn", an AI-orchestrated task board.
12386
12428
 
12429
+ ${PLANNING_COMPLETENESS_POLICY}
12430
+
12387
12431
  ## Your Role
12388
12432
  You are the specification quality gate for implementation success.
12389
12433
  Your job: take a rough task description and produce a fully specified PROMPT.md that another AI agent can execute autonomously in a fresh context with zero memory of this conversation.
@@ -12868,20 +12912,6 @@ Concrete examples:
12868
12912
  - [Optional improvements, not blocking]
12869
12913
  \`\`\`
12870
12914
 
12871
- ## Spec / Plan Review Convergence
12872
-
12873
- Specs and pre-execution Plan Review share this gate. Prefer **APPROVE** / **APPROVE_WITH_NOTES** when the plan is executable enough for an agent to implement. Put optional polish only under **Suggestions**.
12874
-
12875
- When you must **REVISE**:
12876
- - List each blocking issue as a concrete PROMPT.md edit (which section, what to add/change/remove).
12877
- - Do not demand a full rewrite unless the approach is fundamentally wrong (**RETHINK**).
12878
- - Prefer fixing local PROMPT.md defects in-session when you have write tools, then **APPROVE**, instead of bouncing the task through another full replan cycle.
12879
-
12880
- **Converging on re-review (when the request includes your prior feedback + a Plan Review attempt number):**
12881
- - This is a spec you already reviewed. VERIFY each issue you previously raised was addressed. REVISE only for (a) a PRIOR blocking issue still unresolved, or (b) a genuinely NEW problem THIS revision introduced.
12882
- - Do NOT introduce a new blocking issue that ALSO applied to the version you previously reviewed \u2014 that is your own earlier miss. Record it under **Suggestions**, not REVISE.
12883
- - **Severity ratchet at attempt 3+:** gate ONLY on \`critical\` (delivery-blocking) issues. Downgrade lone \`important\`/\`minor\` spec-wording nits to **Suggestions** and APPROVE. Rationale: the executor and downstream code review are later gates \u2014 a spec need not be perfect to be executable, only executable.
12884
-
12885
12915
  ## Spec Review \u2014 Undersplit Task Detection
12886
12916
 
12887
12917
  When reviewing specs, assess whether the task should have been broken into subtasks. The bar for splitting is high \u2014 most tasks should remain whole. Coordination overhead (worktrees, dependency wiring, merge sequencing) is real, so splitting must clearly pay for itself.
@@ -13529,6 +13559,22 @@ function browserVerificationOptionalGroupNode(column, options = {}) {
13529
13559
  };
13530
13560
  }
13531
13561
 
13562
+ // ../core/src/agents/code-review-policy.ts
13563
+ var CODE_REVIEW_COMPLETENESS_POLICY = `## Mandatory Code Review Procedure
13564
+
13565
+ Apply this procedure to code reviews only. Plan/spec reviews use their dedicated criteria below.
13566
+
13567
+ Before choosing a verdict:
13568
+
13569
+ 1. Build a **requirements ledger** from PROMPT.md. For every Mission outcome, Completion Criterion, relevant \`## Surface Enumeration\` item, and \`## Symptom Verification\` assertion, identify both implementation evidence and test evidence. A missing or partial required row is REVISE.
13570
+ 2. Trace each changed behavior from its **real production entry point** and selector through the changed helper to its consumers. A helper-only unit test does not prove that production can reach the new branch.
13571
+ 3. For bug fixes, locate an automated test that reproduces the exact reported failure and asserts it is gone across the enumerated surfaces. Green builds, nearby unit tests, and synthetic state injection alone are insufficient.
13572
+ 4. For persistence, lifecycle, and concurrency changes, verify that evidence belongs to the **current state, version, or planning episode**; every read-check-write path is atomic, locked, or CAS-protected; all mutation surfaces preserve the invariant; waits and locks are bounded and cleanup-safe; and a production-shaped integration test covers both relevant orderings.
13573
+ 5. For route or state changes, inspect all affected UI, API, CLI, and agent consumers plus paired success/failure or approve/reject paths for contract parity.
13574
+ 6. Before APPROVE, perform a fresh adversarial validation pass: try to disprove each completed ledger row by reading the real caller, guard, consumer, and test. Cite \`file:line\` for every blocker and name the exact missing proof.
13575
+
13576
+ APPROVE only when every required ledger row has implementation and test evidence.`;
13577
+
13532
13578
  // ../core/src/workflows/builtin-code-review-group.ts
13533
13579
  var CODE_REVIEW_GROUP_ID = "code-review";
13534
13580
  var CODE_REVIEW_STEP_NODE_ID = "code-review-step";
@@ -13548,6 +13594,8 @@ var CODE_REVIEW_PROMPT = `You are a senior code reviewer. Review the task's diff
13548
13594
  5. **Error handling** \u2014 swallowed errors, unhandled rejections/exceptions, missing validation at trust boundaries, misleading error messages.
13549
13595
  6. **Contract / signature changes** \u2014 changed function/exported-type signatures, API request/response shapes, or serialization that breaks existing callers.
13550
13596
 
13597
+ ${CODE_REVIEW_COMPLETENESS_POLICY}
13598
+
13551
13599
  Be specific: cite \`file:line\` for every finding and explain the concrete failure it causes.
13552
13600
 
13553
13601
  ## Output Requirements
@@ -13667,12 +13715,14 @@ var PLAN_REVIEW_PROMPT = `You are a senior plan reviewer. Review the task's PROM
13667
13715
  4. **Verification quality** \u2014 absent or weak tests/checks for the behavior being changed.
13668
13716
  5. **Risk callouts** \u2014 migrations, data-loss paths, external integrations, secrets, or plugin/runtime dependencies that need explicit handling.
13669
13717
 
13718
+ ${PLAN_REVIEW_COMPLETENESS_POLICY}
13719
+
13670
13720
  Be specific: cite the plan section or file path for every finding and explain the concrete correction.
13671
13721
 
13672
13722
  ## Output Requirements
13673
13723
  - APPROVE: the plan is ready for execution.
13674
13724
  - APPROVE_WITH_NOTES: execution may proceed, but include non-blocking advisory notes.
13675
- - REVISE: the plan should be corrected before execution; include the missing or wrong requirement and the needed change.
13725
+ - REVISE: the plan should be corrected before execution; include every blocking finding and needed change in the JSON notes, not only in preceding prose.
13676
13726
  - Final output: output exactly one trailing JSON object on the final line (no markdown fences, no surrounding prose):
13677
13727
  {"verdict":"APPROVE|APPROVE_WITH_NOTES|REVISE","notes":"..."}`;
13678
13728
  function planReviewOptionalGroupNode(column, options = {}) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/cursor-runtime",
3
- "version": "0.1.52-beta.0",
3
+ "version": "0.1.52-beta.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {