sparkforensics-server 0.4.0 → 0.5.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 (382) hide show
  1. package/index.js +3 -0
  2. package/package.json +3 -3
  3. package/public/assets/AutoscalingChurn-5hDGIXi4.js +1 -0
  4. package/public/assets/CacheUtilization-CT2SCnJJ.js +1 -0
  5. package/public/assets/CachingOpportunity-D_O_WkbH.js +1 -0
  6. package/public/assets/ColdStart-B38OiAOp.js +1 -0
  7. package/public/assets/ConfigAudit-BoplryCH.js +1 -0
  8. package/public/assets/CoreUsageArea-csgwNxkl.js +1 -0
  9. package/public/assets/Dashboard-BgKodJl2.js +2 -0
  10. package/public/assets/DisclosureContext-B0siMVdg.js +1 -0
  11. package/public/assets/DuplicatePlanSubtree-BqS2A2j4.js +1 -0
  12. package/public/assets/ExecutorUtilization-Dp52QGWo.js +1 -0
  13. package/public/assets/GcPressure-CT1yzR_s.js +1 -0
  14. package/public/assets/IncompleteRun-C7Qkjtjn.js +1 -0
  15. package/public/assets/JobFailures-WHl3ELfh.js +1 -0
  16. package/public/assets/MemoryUtilization-D8IUDHJI.js +1 -0
  17. package/public/assets/OverBroadcast-6oSSAQ_R.js +1 -0
  18. package/public/assets/PartitionHint-CUvbnnxy.js +1 -0
  19. package/public/assets/PartitionSizing-BwdFL-mw.js +1 -0
  20. package/public/assets/{PlanExplorer-DdmPkKO1.js → PlanExplorer-DcxmiQWL.js} +1 -1
  21. package/public/assets/PlanGraphRoute-pqnHTt4i.js +1 -0
  22. package/public/assets/RetryWaste-BTbeHkJc.js +1 -0
  23. package/public/assets/ShuffleIO-CRhrYNE0.js +1 -0
  24. package/public/assets/Skew-DSNXRG9V.js +1 -0
  25. package/public/assets/SlowHost-B7Lwu2EU.js +1 -0
  26. package/public/assets/SmallFiles-C082c2rd.js +1 -0
  27. package/public/assets/SpeculationWaste-BS2vpadr.js +1 -0
  28. package/public/assets/Spill-B4DVKHXx.js +1 -0
  29. package/public/assets/StageFailed-D3ac9Sou.js +1 -0
  30. package/public/assets/StageFindingGroup-D9naK109.js +1 -0
  31. package/public/assets/{StageHeader-BSV8ALhT.js → StageHeader-pI1nTwVf.js} +1 -1
  32. package/public/assets/StageShape-eO5le8iG.js +1 -0
  33. package/public/assets/StageSlowness-BaNyfNvL.js +1 -0
  34. package/public/assets/Straggler-D5Fnok_y.js +1 -0
  35. package/public/assets/TaskFailures-BWnC-K_G.js +1 -0
  36. package/public/assets/{TinyTask-CIPRxWfT.js → TinyTask-8_5lpq_2.js} +1 -1
  37. package/public/assets/UnderBroadcast-DJ0XSwth.js +1 -0
  38. package/public/assets/{finding-anchor-DF1cSHO1.js → finding-anchor-Cys8Z6Yn.js} +1 -1
  39. package/public/assets/{impact-sort-7z0ZcBZf.js → impact-sort-BTQndbof.js} +1 -1
  40. package/public/assets/index-DCeWge12.js +13 -0
  41. package/public/assets/parser-worker-DmeCnLWU.js +122 -0
  42. package/public/assets/{plan-graph-vendor-B0sEms9Z.js → plan-graph-vendor-BYl-AzN5.js} +1 -1
  43. package/public/assets/{react-vendor-BAKt3vny.js → react-vendor-DEdfrRTJ.js} +1 -1
  44. package/public/assets/{select-Cy5pmbrh.js → select-DIYN6D3y.js} +1 -1
  45. package/public/assets/{usePagedRows-BjPOpUU8.js → usePagedRows-BxvdFnPk.js} +1 -1
  46. package/public/assets/useRecentFiles-C3Ov47U7.js +11 -0
  47. package/public/assets/{useSortMode-CU0vzThu.js → useSortMode-B8SRfAoG.js} +1 -1
  48. package/public/docs/404.html +4 -3
  49. package/public/docs/assets/{app.C6w47a9W.js → app.D2GqAkhy.js} +1 -1
  50. package/public/docs/assets/chunks/@localSearchIndexroot.D4OdkQjy.js +1 -0
  51. package/public/docs/assets/chunks/{VPLocalSearchBox.BcTNvT55.js → VPLocalSearchBox.BS4cSmtW.js} +1 -1
  52. package/public/docs/assets/chunks/{theme.D-mE6j02.js → theme.BuxVpb0H.js} +2 -2
  53. package/public/docs/assets/contributor-guide_architecture_board-widgets.md.YQcj5EI4.js +1 -0
  54. package/public/docs/assets/contributor-guide_architecture_board-widgets.md.YQcj5EI4.lean.js +1 -0
  55. package/public/docs/assets/contributor-guide_architecture_board-widgets_caching-and-memory.md.8bH1HnZp.js +1 -0
  56. package/public/docs/assets/contributor-guide_architecture_board-widgets_caching-and-memory.md.8bH1HnZp.lean.js +1 -0
  57. package/public/docs/assets/contributor-guide_architecture_board-widgets_plan-advisor.md.RlzvUmNm.js +1 -0
  58. package/public/docs/assets/contributor-guide_architecture_board-widgets_plan-advisor.md.RlzvUmNm.lean.js +1 -0
  59. package/public/docs/assets/contributor-guide_architecture_board-widgets_visual-system-and-templating.md.DYgUpIJB.js +1 -0
  60. package/public/docs/assets/contributor-guide_architecture_board-widgets_visual-system-and-templating.md.DYgUpIJB.lean.js +1 -0
  61. package/public/docs/assets/contributor-guide_architecture_detector-contract.md.wj6Et6UD.js +1 -0
  62. package/public/docs/assets/contributor-guide_architecture_detector-contract.md.wj6Et6UD.lean.js +1 -0
  63. package/public/docs/assets/contributor-guide_architecture_detector-contract_plan-attribution.md.yNex4bys.js +1 -0
  64. package/public/docs/assets/contributor-guide_architecture_detector-contract_plan-attribution.md.yNex4bys.lean.js +1 -0
  65. package/public/docs/assets/contributor-guide_architecture_detector-contract_threshold-tables.md.fkPBXsU2.js +1 -0
  66. package/public/docs/assets/contributor-guide_architecture_detector-contract_threshold-tables.md.fkPBXsU2.lean.js +1 -0
  67. package/public/docs/assets/contributor-guide_architecture_drill-down.md.CqZPrdo9.js +1 -0
  68. package/public/docs/assets/contributor-guide_architecture_drill-down.md.CqZPrdo9.lean.js +1 -0
  69. package/public/docs/assets/contributor-guide_architecture_drill-down_plan-graph.md.DwOozIEs.js +1 -0
  70. package/public/docs/assets/contributor-guide_architecture_drill-down_plan-graph.md.DwOozIEs.lean.js +1 -0
  71. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.CZv_ZGOp.js +1 -0
  72. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.CZv_ZGOp.lean.js +1 -0
  73. package/public/docs/assets/contributor-guide_architecture_impact-estimation_caveats-tuning-and-coverage.md.BUucRc0A.js +1 -0
  74. package/public/docs/assets/contributor-guide_architecture_impact-estimation_caveats-tuning-and-coverage.md.BUucRc0A.lean.js +1 -0
  75. package/public/docs/assets/contributor-guide_architecture_impact-estimation_stage-union-rollup.md.DdCGtAGu.js +1 -0
  76. package/public/docs/assets/contributor-guide_architecture_impact-estimation_stage-union-rollup.md.DdCGtAGu.lean.js +1 -0
  77. package/public/docs/assets/contributor-guide_architecture_index.md.tymxf1Fh.js +1 -0
  78. package/public/docs/assets/contributor-guide_architecture_index.md.tymxf1Fh.lean.js +1 -0
  79. package/public/docs/assets/contributor-guide_architecture_overview.md.C1sSvm9i.js +1 -0
  80. package/public/docs/assets/contributor-guide_architecture_overview.md.C1sSvm9i.lean.js +1 -0
  81. package/public/docs/assets/contributor-guide_architecture_state-and-history.md.DyCBdjuM.js +1 -0
  82. package/public/docs/assets/{contributor-guide_architecture_state-and-history.md.DOTVHjTV.lean.js → contributor-guide_architecture_state-and-history.md.DyCBdjuM.lean.js} +1 -1
  83. package/public/docs/assets/contributor-guide_architecture_state-and-history_history-server-intake.md.C298hrHZ.js +1 -0
  84. package/public/docs/assets/contributor-guide_architecture_state-and-history_history-server-intake.md.C298hrHZ.lean.js +1 -0
  85. package/public/docs/assets/contributor-guide_architecture_state-and-history_run-comparison-internals.md.uuAKpY0Y.js +1 -0
  86. package/public/docs/assets/contributor-guide_architecture_state-and-history_run-comparison-internals.md.uuAKpY0Y.lean.js +1 -0
  87. package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BOZ1azXG.js +1 -0
  88. package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BOZ1azXG.lean.js +1 -0
  89. package/public/docs/assets/contributor-guide_architecture_widget-rendering_findings-tab.md.BQXycK6G.js +1 -0
  90. package/public/docs/assets/contributor-guide_architecture_widget-rendering_findings-tab.md.BQXycK6G.lean.js +1 -0
  91. package/public/docs/assets/contributor-guide_architecture_widget-rendering_investigation-routing.md.BGdiyElu.js +1 -0
  92. package/public/docs/assets/contributor-guide_architecture_widget-rendering_investigation-routing.md.BGdiyElu.lean.js +1 -0
  93. package/public/docs/assets/contributor-guide_architecture_widget-rendering_list-sort-mode.md.BuHKgH0C.js +1 -0
  94. package/public/docs/assets/contributor-guide_architecture_widget-rendering_list-sort-mode.md.BuHKgH0C.lean.js +1 -0
  95. package/public/docs/assets/contributor-guide_architecture_widget-rendering_reference-section.md.DWqC80bN.js +1 -0
  96. package/public/docs/assets/contributor-guide_architecture_widget-rendering_reference-section.md.DWqC80bN.lean.js +1 -0
  97. package/public/docs/assets/contributor-guide_architecture_widget-rendering_row-expand-contract.md.ZT89u9f1.js +1 -0
  98. package/public/docs/assets/contributor-guide_architecture_widget-rendering_row-expand-contract.md.ZT89u9f1.lean.js +1 -0
  99. package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.BAnhi2-d.js +1 -0
  100. package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.BAnhi2-d.lean.js +1 -0
  101. package/public/docs/assets/contributor-guide_architecture_worker-protocol_cli-and-mcp.md.Dk08VS7n.js +1 -0
  102. package/public/docs/assets/contributor-guide_architecture_worker-protocol_cli-and-mcp.md.Dk08VS7n.lean.js +1 -0
  103. package/public/docs/assets/contributor-guide_architecture_worker-protocol_core-and-event-validation.md.DSVFPpWb.js +1 -0
  104. package/public/docs/assets/contributor-guide_architecture_worker-protocol_core-and-event-validation.md.DSVFPpWb.lean.js +1 -0
  105. package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-availability.md.CjimIDBY.js +6 -0
  106. package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-availability.md.CjimIDBY.lean.js +1 -0
  107. package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-report.md.DVGZOWvW.js +1 -0
  108. package/public/docs/assets/contributor-guide_architecture_worker-protocol_evidence-report.md.DVGZOWvW.lean.js +1 -0
  109. package/public/docs/assets/contributor-guide_contributing.md.CQMvGwFt.js +1 -0
  110. package/public/docs/assets/{contributor-guide_contributing.md.B2E9ni79.lean.js → contributor-guide_contributing.md.CQMvGwFt.lean.js} +1 -1
  111. package/public/docs/assets/contributor-guide_development-setup.md.D9bu4j_c.js +15 -0
  112. package/public/docs/assets/contributor-guide_development-setup.md.D9bu4j_c.lean.js +1 -0
  113. package/public/docs/assets/contributor-guide_testing.md.By6XGR9a.js +1 -0
  114. package/public/docs/assets/{contributor-guide_testing.md.DTwhpoN2.lean.js → contributor-guide_testing.md.By6XGR9a.lean.js} +1 -1
  115. package/public/docs/assets/{style.DSixAiZE.css → style.tmDhD3c8.css} +1 -1
  116. package/public/docs/assets/user-guide_alternative-log-retrieval.md.CJpYvHGo.js +4 -0
  117. package/public/docs/assets/user-guide_alternative-log-retrieval.md.CJpYvHGo.lean.js +1 -0
  118. package/public/docs/assets/user-guide_alternative-log-retrieval_managed-platforms.md.DvDwHNtC.js +4 -0
  119. package/public/docs/assets/user-guide_alternative-log-retrieval_managed-platforms.md.DvDwHNtC.lean.js +1 -0
  120. package/public/docs/assets/user-guide_alternative-log-retrieval_ssh-bastion.md.Gszzlplv.js +1 -0
  121. package/public/docs/assets/user-guide_alternative-log-retrieval_ssh-bastion.md.Gszzlplv.lean.js +1 -0
  122. package/public/docs/assets/user-guide_getting-started.md.DYHHHkQR.js +1 -0
  123. package/public/docs/assets/user-guide_getting-started.md.DYHHHkQR.lean.js +1 -0
  124. package/public/docs/assets/user-guide_getting-started_ci-and-automation.md.DpnfKz3x.js +22 -0
  125. package/public/docs/assets/user-guide_getting-started_ci-and-automation.md.DpnfKz3x.lean.js +1 -0
  126. package/public/docs/assets/user-guide_getting-started_reading-the-dashboard.md.Obf3W3__.js +1 -0
  127. package/public/docs/assets/user-guide_getting-started_reading-the-dashboard.md.Obf3W3__.lean.js +1 -0
  128. package/public/docs/assets/user-guide_getting-started_regression-metric-keys.md.B_gzr2Mw.js +1 -0
  129. package/public/docs/assets/user-guide_getting-started_regression-metric-keys.md.B_gzr2Mw.lean.js +1 -0
  130. package/public/docs/assets/user-guide_getting-started_tuning-thresholds.md.B_MyjyZm.js +4 -0
  131. package/public/docs/assets/user-guide_getting-started_tuning-thresholds.md.B_MyjyZm.lean.js +1 -0
  132. package/public/docs/assets/user-guide_mcp-tools.md.C65SjWUL.js +16 -0
  133. package/public/docs/assets/user-guide_mcp-tools.md.C65SjWUL.lean.js +1 -0
  134. package/public/docs/assets/user-guide_mcp-tools_compare-runs.md.CPowlb2q.js +55 -0
  135. package/public/docs/assets/user-guide_mcp-tools_compare-runs.md.CPowlb2q.lean.js +1 -0
  136. package/public/docs/assets/user-guide_mcp-tools_diagnose-run.md.BP1vnHA5.js +23 -0
  137. package/public/docs/assets/user-guide_mcp-tools_diagnose-run.md.BP1vnHA5.lean.js +1 -0
  138. package/public/docs/assets/user-guide_mcp-tools_evaluate-budgets.md.Dq5Azk8G.js +26 -0
  139. package/public/docs/assets/user-guide_mcp-tools_evaluate-budgets.md.Dq5Azk8G.lean.js +1 -0
  140. package/public/docs/assets/user-guide_mcp-tools_get-finding-documentation.md.BtTTHNV6.js +14 -0
  141. package/public/docs/assets/user-guide_mcp-tools_get-finding-documentation.md.BtTTHNV6.lean.js +1 -0
  142. package/public/docs/assets/user-guide_mcp-tools_get-finding-evidence.md.rKyu4wts.js +20 -0
  143. package/public/docs/assets/user-guide_mcp-tools_get-finding-evidence.md.rKyu4wts.lean.js +1 -0
  144. package/public/docs/assets/user-guide_mcp-tools_get-reference-doc.md.Yac4tH3u.js +5 -0
  145. package/public/docs/assets/user-guide_mcp-tools_get-reference-doc.md.Yac4tH3u.lean.js +1 -0
  146. package/public/docs/assets/user-guide_mcp-tools_get-run-summary.md.DpxZ4ZNp.js +15 -0
  147. package/public/docs/assets/user-guide_mcp-tools_get-run-summary.md.DpxZ4ZNp.lean.js +1 -0
  148. package/public/docs/assets/user-guide_mcp-tools_list-runs.md.DpQPeCM3.js +12 -0
  149. package/public/docs/assets/user-guide_mcp-tools_list-runs.md.DpQPeCM3.lean.js +1 -0
  150. package/public/docs/assets/user-guide_run-comparison.md.B6aNtDYF.js +1 -0
  151. package/public/docs/assets/user-guide_run-comparison.md.B6aNtDYF.lean.js +1 -0
  152. package/public/docs/assets/user-guide_run-comparison_how-stages-are-matched.md.XBzQ1oEU.js +1 -0
  153. package/public/docs/assets/user-guide_run-comparison_how-stages-are-matched.md.XBzQ1oEU.lean.js +1 -0
  154. package/public/docs/assets/user-guide_understanding-findings.md.Dqt2H_C1.js +1 -0
  155. package/public/docs/contributor-guide/architecture/board-widgets/caching-and-memory.html +30 -0
  156. package/public/docs/contributor-guide/architecture/board-widgets/plan-advisor.html +30 -0
  157. package/public/docs/contributor-guide/architecture/board-widgets/visual-system-and-templating.html +30 -0
  158. package/public/docs/contributor-guide/architecture/board-widgets.html +7 -6
  159. package/public/docs/contributor-guide/architecture/detector-contract/plan-attribution.html +30 -0
  160. package/public/docs/contributor-guide/architecture/detector-contract/threshold-tables.html +30 -0
  161. package/public/docs/contributor-guide/architecture/detector-contract.html +7 -6
  162. package/public/docs/contributor-guide/architecture/drill-down/plan-graph.html +30 -0
  163. package/public/docs/contributor-guide/architecture/drill-down.html +7 -6
  164. package/public/docs/contributor-guide/architecture/impact-estimation/caveats-tuning-and-coverage.html +30 -0
  165. package/public/docs/contributor-guide/architecture/impact-estimation/stage-union-rollup.html +30 -0
  166. package/public/docs/contributor-guide/architecture/impact-estimation.html +7 -6
  167. package/public/docs/contributor-guide/architecture/index.html +7 -6
  168. package/public/docs/contributor-guide/architecture/overview.html +7 -6
  169. package/public/docs/contributor-guide/architecture/state-and-history/history-server-intake.html +30 -0
  170. package/public/docs/contributor-guide/architecture/state-and-history/run-comparison-internals.html +30 -0
  171. package/public/docs/contributor-guide/architecture/state-and-history.html +7 -6
  172. package/public/docs/contributor-guide/architecture/widget-rendering/findings-tab.html +30 -0
  173. package/public/docs/contributor-guide/architecture/widget-rendering/investigation-routing.html +30 -0
  174. package/public/docs/contributor-guide/architecture/widget-rendering/list-sort-mode.html +30 -0
  175. package/public/docs/contributor-guide/architecture/widget-rendering/reference-section.html +30 -0
  176. package/public/docs/contributor-guide/architecture/widget-rendering/row-expand-contract.html +30 -0
  177. package/public/docs/contributor-guide/architecture/widget-rendering.html +7 -6
  178. package/public/docs/contributor-guide/architecture/worker-protocol/cli-and-mcp.html +30 -0
  179. package/public/docs/contributor-guide/architecture/worker-protocol/core-and-event-validation.html +30 -0
  180. package/public/docs/contributor-guide/architecture/worker-protocol/evidence-availability.html +35 -0
  181. package/public/docs/contributor-guide/architecture/worker-protocol/evidence-report.html +30 -0
  182. package/public/docs/contributor-guide/architecture/worker-protocol.html +7 -11
  183. package/public/docs/contributor-guide/contributing.html +7 -6
  184. package/public/docs/contributor-guide/development-setup.html +11 -10
  185. package/public/docs/contributor-guide/testing.html +7 -6
  186. package/public/docs/hashmap.json +1 -1
  187. package/public/docs/index.html +5 -4
  188. package/public/docs/tuning-reference/anti-patterns.html +5 -4
  189. package/public/docs/tuning-reference/aqe.html +5 -4
  190. package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +5 -4
  191. package/public/docs/tuning-reference/bottleneck-cold-start.html +5 -4
  192. package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +5 -4
  193. package/public/docs/tuning-reference/bottleneck-failures.html +5 -4
  194. package/public/docs/tuning-reference/bottleneck-gc.html +5 -4
  195. package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +5 -4
  196. package/public/docs/tuning-reference/bottleneck-memory-utilization.html +5 -4
  197. package/public/docs/tuning-reference/bottleneck-retry-waste.html +5 -4
  198. package/public/docs/tuning-reference/bottleneck-shuffle.html +5 -4
  199. package/public/docs/tuning-reference/bottleneck-skew.html +5 -4
  200. package/public/docs/tuning-reference/bottleneck-slow-host.html +5 -4
  201. package/public/docs/tuning-reference/bottleneck-small-files.html +5 -4
  202. package/public/docs/tuning-reference/bottleneck-spill.html +5 -4
  203. package/public/docs/tuning-reference/bottleneck-straggler.html +5 -4
  204. package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +5 -4
  205. package/public/docs/tuning-reference/bottleneck-utilization.html +5 -4
  206. package/public/docs/tuning-reference/caching.html +5 -4
  207. package/public/docs/tuning-reference/cluster-config.html +5 -4
  208. package/public/docs/tuning-reference/config.html +5 -4
  209. package/public/docs/tuning-reference/data-formats.html +5 -4
  210. package/public/docs/tuning-reference/index.html +5 -4
  211. package/public/docs/tuning-reference/intro.html +5 -4
  212. package/public/docs/tuning-reference/joins.html +5 -4
  213. package/public/docs/tuning-reference/memory-model.html +5 -4
  214. package/public/docs/tuning-reference/metrics.html +5 -4
  215. package/public/docs/tuning-reference/partitioning.html +5 -4
  216. package/public/docs/tuning-reference/pyspark.html +5 -4
  217. package/public/docs/tuning-reference/shuffle.html +5 -4
  218. package/public/docs/tuning-reference/spark-architecture.html +5 -4
  219. package/public/docs/tuning-reference/table-formats.html +5 -4
  220. package/public/docs/user-guide/alternative-log-retrieval/managed-platforms.html +33 -0
  221. package/public/docs/user-guide/alternative-log-retrieval/ssh-bastion.html +30 -0
  222. package/public/docs/user-guide/alternative-log-retrieval.html +11 -7
  223. package/public/docs/user-guide/getting-started/ci-and-automation.html +51 -0
  224. package/public/docs/user-guide/getting-started/reading-the-dashboard.html +30 -0
  225. package/public/docs/user-guide/getting-started/regression-metric-keys.html +30 -0
  226. package/public/docs/user-guide/getting-started/tuning-thresholds.html +33 -0
  227. package/public/docs/user-guide/getting-started.html +7 -11
  228. package/public/docs/user-guide/mcp-tools/compare-runs.html +84 -0
  229. package/public/docs/user-guide/mcp-tools/diagnose-run.html +52 -0
  230. package/public/docs/user-guide/mcp-tools/evaluate-budgets.html +55 -0
  231. package/public/docs/user-guide/mcp-tools/get-finding-documentation.html +43 -0
  232. package/public/docs/user-guide/mcp-tools/get-finding-evidence.html +49 -0
  233. package/public/docs/user-guide/mcp-tools/get-reference-doc.html +34 -0
  234. package/public/docs/user-guide/mcp-tools/get-run-summary.html +44 -0
  235. package/public/docs/user-guide/mcp-tools/list-runs.html +41 -0
  236. package/public/docs/user-guide/mcp-tools.html +12 -126
  237. package/public/docs/user-guide/run-comparison/how-stages-are-matched.html +30 -0
  238. package/public/docs/user-guide/run-comparison.html +7 -6
  239. package/public/docs/user-guide/understanding-findings.html +7 -6
  240. package/public/export-template.html +44 -44
  241. package/public/index.html +4 -4
  242. package/vendor-core/allocation.js +106 -0
  243. package/vendor-core/analyzer.js +13 -13
  244. package/vendor-core/api-merge-writes.js +80 -0
  245. package/vendor-core/cli/budgets.js +23 -9
  246. package/vendor-core/cli/collect-run.js +11 -4
  247. package/vendor-core/cli/regression-budgets.js +83 -0
  248. package/vendor-core/comparison-output.js +49 -0
  249. package/vendor-core/comparison-verdict.js +22 -22
  250. package/vendor-core/core-source-hash.txt +1 -1
  251. package/vendor-core/delta-commands.js +13 -0
  252. package/vendor-core/delta-log-paths.js +42 -0
  253. package/vendor-core/delta-targets.js +127 -0
  254. package/vendor-core/detectors.js +202 -68
  255. package/vendor-core/docs-content/detection/cache.md +3 -2
  256. package/vendor-core/docs-content/detection/cfg.md +9 -8
  257. package/vendor-core/docs-content/detection/chrn.md +1 -2
  258. package/vendor-core/docs-content/detection/cold.md +4 -2
  259. package/vendor-core/docs-content/detection/fail.md +3 -2
  260. package/vendor-core/docs-content/detection/gc.md +3 -2
  261. package/vendor-core/docs-content/detection/host.md +2 -1
  262. package/vendor-core/docs-content/detection/local.md +1 -1
  263. package/vendor-core/docs-content/detection/mem.md +5 -2
  264. package/vendor-core/docs-content/detection/plan.md +2 -1
  265. package/vendor-core/docs-content/detection/sfail.md +2 -1
  266. package/vendor-core/docs-content/detection/shape.md +5 -4
  267. package/vendor-core/docs-content/detection/skew.md +3 -1
  268. package/vendor-core/docs-content/detection/slow.md +2 -2
  269. package/vendor-core/docs-content/detection/spec.md +2 -3
  270. package/vendor-core/docs-content/detection/spill.md +1 -1
  271. package/vendor-core/docs-site-config.js +1 -1
  272. package/vendor-core/effective-conf.js +107 -0
  273. package/vendor-core/efficiency-model.js +8 -6
  274. package/vendor-core/event-handlers.js +255 -56
  275. package/vendor-core/event-schemas.js +5 -1
  276. package/vendor-core/evidence-report.js +31 -14
  277. package/vendor-core/finding-generic-recommendation.js +20 -1
  278. package/vendor-core/finding-names.js +7 -0
  279. package/vendor-core/finding-presentation.js +61 -26
  280. package/vendor-core/finding-tag-help.js +1 -1
  281. package/vendor-core/finding-types.js +12 -0
  282. package/vendor-core/format-utils.js +4 -3
  283. package/vendor-core/impact-estimator.js +20 -2
  284. package/vendor-core/impact-format.js +14 -13
  285. package/vendor-core/impact-model.js +27 -5
  286. package/vendor-core/ingest.js +4 -2
  287. package/vendor-core/list-runs.js +5 -2
  288. package/vendor-core/mcp-server-factory.js +13 -6
  289. package/vendor-core/mcp-tools.js +43 -34
  290. package/vendor-core/model-assembler.js +23 -1
  291. package/vendor-core/parser-worker.js +1 -1
  292. package/vendor-core/plan-graph-model.js +1 -1
  293. package/vendor-core/plan-summary.js +13 -10
  294. package/vendor-core/proxy.js +3 -1
  295. package/vendor-core/python-stage.js +25 -0
  296. package/vendor-core/recommendation-rollup.js +16 -9
  297. package/vendor-core/redact.js +51 -10
  298. package/vendor-core/remediation.js +20 -0
  299. package/vendor-core/run-comparison.js +118 -140
  300. package/vendor-core/run-interpretation.js +2 -1
  301. package/vendor-core/run-metrics.js +198 -0
  302. package/vendor-core/run-output.js +26 -0
  303. package/vendor-core/run-totals.js +24 -0
  304. package/vendor-core/run-verdict.js +3 -4
  305. package/vendor-core/scorecard-estimates.js +1 -0
  306. package/vendor-core/session-snapshot.js +7 -0
  307. package/vendor-core/shs-schemas.js +2 -2
  308. package/vendor-core/spark-memory.js +17 -0
  309. package/vendor-core/stage-alignment.js +262 -0
  310. package/vendor-core/stage-identity.js +112 -0
  311. package/vendor-core/stage-plan-nodes.js +18 -0
  312. package/vendor-core/stage-quantiles.js +4 -0
  313. package/vendor-core/types.js +54 -1
  314. package/vendor-core/wasted-core-hours.js +10 -7
  315. package/vendor-core/write-target-args.js +48 -0
  316. package/vendor-core/write-targets.js +295 -0
  317. package/public/assets/AutoscalingChurn-CUSIvvab.js +0 -1
  318. package/public/assets/CacheUtilization-Ce0K6_X2.js +0 -1
  319. package/public/assets/CachingOpportunity-Cn-LmRA4.js +0 -1
  320. package/public/assets/ColdStart-BoiYzEyV.js +0 -1
  321. package/public/assets/ConfigAudit-BoJc6PAw.js +0 -1
  322. package/public/assets/CoreUsageArea-BFfXKu7K.js +0 -1
  323. package/public/assets/Dashboard-Bo_1jGqH.js +0 -2
  324. package/public/assets/DisclosureContext-LYzHroHO.js +0 -1
  325. package/public/assets/DuplicatePlanSubtree-BaAuGAoo.js +0 -1
  326. package/public/assets/ExecutorUtilization-OE6VMFkG.js +0 -1
  327. package/public/assets/GcPressure-AoL_ZNrV.js +0 -1
  328. package/public/assets/IncompleteRun-Bv6IzgsQ.js +0 -1
  329. package/public/assets/JobFailures-DF3U2z1f.js +0 -1
  330. package/public/assets/MemoryUtilization-B65OVZlq.js +0 -1
  331. package/public/assets/OverBroadcast-DXbJREDl.js +0 -1
  332. package/public/assets/PartitionSizing-DZLnjy0d.js +0 -1
  333. package/public/assets/PlanGraphRoute-C-BGmC6j.js +0 -1
  334. package/public/assets/RetryWaste-BbEPsdMw.js +0 -1
  335. package/public/assets/ShuffleIO-wZB94LS8.js +0 -1
  336. package/public/assets/Skew-SpQE7zeJ.js +0 -1
  337. package/public/assets/SlowHost-DwDBCTvr.js +0 -1
  338. package/public/assets/SmallFiles-yjY_6sT1.js +0 -1
  339. package/public/assets/SpeculationWaste-73PDmj0c.js +0 -1
  340. package/public/assets/Spill-DEw0Kd1i.js +0 -1
  341. package/public/assets/StageFailed-BEfXdEJc.js +0 -1
  342. package/public/assets/StageFindingGroup-Bzm2TY03.js +0 -1
  343. package/public/assets/StageShape-CzR4jHOt.js +0 -1
  344. package/public/assets/StageSlowness-vMPsnAaa.js +0 -1
  345. package/public/assets/Straggler-Cf__OGl5.js +0 -1
  346. package/public/assets/TaskFailures-BZ8kLZiO.js +0 -1
  347. package/public/assets/UnderBroadcast-CBm8ZPoS.js +0 -1
  348. package/public/assets/index-CEM9bz_x.js +0 -13
  349. package/public/assets/parser-worker-Q5KCPdKT.js +0 -122
  350. package/public/assets/useRecentFiles-BrBl-AP1.js +0 -11
  351. package/public/docs/assets/chunks/@localSearchIndexroot.DbZy5EtM.js +0 -1
  352. package/public/docs/assets/contributor-guide_architecture_board-widgets.md.VTcYTH4d.js +0 -1
  353. package/public/docs/assets/contributor-guide_architecture_board-widgets.md.VTcYTH4d.lean.js +0 -1
  354. package/public/docs/assets/contributor-guide_architecture_detector-contract.md.CsqZHz_T.js +0 -1
  355. package/public/docs/assets/contributor-guide_architecture_detector-contract.md.CsqZHz_T.lean.js +0 -1
  356. package/public/docs/assets/contributor-guide_architecture_drill-down.md.CFNCE8JB.js +0 -1
  357. package/public/docs/assets/contributor-guide_architecture_drill-down.md.CFNCE8JB.lean.js +0 -1
  358. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.HT9IJGIl.js +0 -1
  359. package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.HT9IJGIl.lean.js +0 -1
  360. package/public/docs/assets/contributor-guide_architecture_index.md.3TO9ic6w.js +0 -1
  361. package/public/docs/assets/contributor-guide_architecture_index.md.3TO9ic6w.lean.js +0 -1
  362. package/public/docs/assets/contributor-guide_architecture_overview.md.CTEqVeV4.js +0 -1
  363. package/public/docs/assets/contributor-guide_architecture_overview.md.CTEqVeV4.lean.js +0 -1
  364. package/public/docs/assets/contributor-guide_architecture_state-and-history.md.DOTVHjTV.js +0 -1
  365. package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BmpARZve.js +0 -1
  366. package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.BmpARZve.lean.js +0 -1
  367. package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.21pTYhFF.js +0 -6
  368. package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.21pTYhFF.lean.js +0 -1
  369. package/public/docs/assets/contributor-guide_contributing.md.B2E9ni79.js +0 -1
  370. package/public/docs/assets/contributor-guide_development-setup.md.CjgZJwjK.js +0 -15
  371. package/public/docs/assets/contributor-guide_development-setup.md.CjgZJwjK.lean.js +0 -1
  372. package/public/docs/assets/contributor-guide_testing.md.DTwhpoN2.js +0 -1
  373. package/public/docs/assets/user-guide_alternative-log-retrieval.md.ZHPSbBkF.js +0 -1
  374. package/public/docs/assets/user-guide_alternative-log-retrieval.md.ZHPSbBkF.lean.js +0 -1
  375. package/public/docs/assets/user-guide_getting-started.md.CEa2ZX-l.js +0 -6
  376. package/public/docs/assets/user-guide_getting-started.md.CEa2ZX-l.lean.js +0 -1
  377. package/public/docs/assets/user-guide_mcp-tools.md.dQwIvdTF.js +0 -131
  378. package/public/docs/assets/user-guide_mcp-tools.md.dQwIvdTF.lean.js +0 -1
  379. package/public/docs/assets/user-guide_run-comparison.md.ChLI3MK0.js +0 -1
  380. package/public/docs/assets/user-guide_run-comparison.md.ChLI3MK0.lean.js +0 -1
  381. package/public/docs/assets/user-guide_understanding-findings.md.D1ccs60C.js +0 -1
  382. /package/public/docs/assets/{user-guide_understanding-findings.md.D1ccs60C.lean.js → user-guide_understanding-findings.md.Dqt2H_C1.lean.js} +0 -0
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,R as r,W as i,at as a,d as o,mt as s}from"./DisclosureContext-LYzHroHO.js";import{p as c}from"./plan-graph-vendor-B0sEms9Z.js";import{i as l,m as u}from"./useRecentFiles-BrBl-AP1.js";import{D as d,S as f}from"./index-CEM9bz_x.js";import{o as p,r as m,t as h}from"./Dashboard-Bo_1jGqH.js";import{r as g}from"./impact-sort-7z0ZcBZf.js";import{n as _,t as v}from"./finding-anchor-DF1cSHO1.js";import{t as y}from"./usePagedRows-BjPOpUU8.js";import{n as b,t as x}from"./useSortMode-CU0vzThu.js";import{t as S}from"./StageHeader-BSV8ALhT.js";import{a as C,i as w,n as T,r as E,t as D}from"./select-Cy5pmbrh.js";import{t as O}from"./PlanExplorer-DdmPkKO1.js";var k=e(t(),1),A=c();function j(e){if(e.rule===`lowShuffleParallelism`)return`${n(e)} tasks carrying the shuffle`;let t=n(e);return e.rule===`maxPartitionTooBig`?`Largest partition ${i(t)} (too large)`:`Largest partition ${i(t)}`}function M({entry:e,appModel:t}){let n=s(),r=_(e.partitions),i=n===`advanced`&&l(e.stageId,t);return(0,A.jsxs)(`div`,{ref:r.ref,tabIndex:r.tabIndex,"data-flashed":r.dataFlashed,className:`space-y-2 ${v} transition-colors ${r.flashClassName}`,children:[(0,A.jsx)(S,{stageId:e.stageId,appModel:t}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.partitions.map((e,t)=>(0,A.jsxs)(`span`,{children:[t>0?` · `:``,j(e)]},e.id))}),(0,A.jsx)(h,{finding:e.partitions[0]}),(0,A.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,A.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-xs text-muted-foreground`,children:e.partitions.map(e=>(0,A.jsxs)(`li`,{children:[e.recommendation,` `,(0,A.jsx)(h,{finding:e})]},e.id))}),i?(0,A.jsx)(O,{stageId:e.stageId,appModel:t}):null]})]})}var N=(0,k.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let[i,s]=(0,k.useState)(0),[c,l]=(0,k.useState)(!n),{sortMode:h,setSortMode:_,orderBy:v}=x(),S=d(),{partitionFindings:O,sorted:j,orderedEntries:N}=(0,k.useMemo)(()=>{let e=u(t,`partitionSizing`),n=new Map;for(let t of e){if(t.stageId==null)continue;let e=n.get(t.stageId);e?(e.partitions.push(t),r[t.impactBand]<r[e.impactBand]&&(e.impactBand=t.impactBand)):n.set(t.stageId,{stageId:t.stageId,partitions:[t],impactBand:t.impactBand})}let i=[...n.values()].sort((e,t)=>r[e.impactBand]-r[t.impactBand]||e.stageId-t.stageId);return{partitionFindings:e,sorted:i,orderedEntries:v(i,e=>e.partitions,e=>e.stageId)}},[t,h]),P=S?N.findIndex(e=>e.partitions.some(e=>e===S.finding)):null,{totalPages:F,effectivePage:I,visible:L}=y(N,i,s,P);if(O.length===0){let t=e.stages.size;return(0,A.jsx)(f,{title:`Partition Sizing`,open:c,onOpenChange:l,summary:(0,A.jsx)(p,{value:`No issues`,context:`no issue detected: partition sizing checked across ${t} stage${t===1?``:`s`}`}),children:(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No partition-sizing issues detected.`})})}let R=a(O),z=g(O,j.length,c);return(0,A.jsx)(f,{title:`Partition Sizing`,impactBand:R,open:c,onOpenChange:l,summary:(0,A.jsx)(p,{value:`Stage ${j[0].stageId}`,context:`${j.length} stage${j.length===1?``:`s`} flagged`}),badges:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(o,{type:`partitionSizing`,impactBand:R??`info`}),z?(0,A.jsx)(b,{mode:h,onChange:e=>{_(e),s(0)}}):null]}),children:(0,A.jsxs)(`div`,{className:`space-y-4`,children:[L.map(t=>(0,A.jsx)(M,{entry:t,appModel:e},t.stageId)),(0,A.jsx)(m,{page:I,totalPages:F,onPrev:()=>s(e=>e-1),onNext:()=>s(e=>e+1),renderJumpControl:()=>(0,A.jsxs)(D,{value:String(I*6),onValueChange:e=>s(Math.floor(Number(e)/6)),children:[(0,A.jsx)(w,{size:`sm`,"aria-label":`Jump to stage`,children:(0,A.jsx)(C,{placeholder:`Jump to stage`})}),(0,A.jsx)(T,{children:N.map((e,t)=>(0,A.jsxs)(E,{value:String(t),children:[`Stage `,e.stageId]},e.stageId))})]})})]})})});export{N as PartitionSizing};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{C as n,S as r,T as i,_ as a,b as o,g as s,h as c,m as l,v as u,w as d,x as f,y as p}from"./react-vendor-BAKt3vny.js";import{K as m,S as h,W as g,at as _,d as v,dt as y,ft as b,it as x,l as S,o as C,q as w,s as T,u as E,yt as D}from"./DisclosureContext-LYzHroHO.js";import{a as O,c as ee,d as k,f as A,i as j,l as te,n as M,o as N,p as P,r as F,s as I,t as L,u as R}from"./plan-graph-vendor-B0sEms9Z.js";import{_ as z,d as B,i as ne,l as re,n as ie,o as ae,p as oe,s as se,t as ce,u as le}from"./useRecentFiles-BrBl-AP1.js";import{Ct as V,H as ue,_t as de,at as fe,ct as pe,dt as me,ft as H,it as U,lt as W,ot as G,pt as he,s as ge,st as _e,ut as ve,wt as ye}from"./index-CEM9bz_x.js";import{t as be}from"./impact-sort-7z0ZcBZf.js";var xe={name:`arrow-left-right`,size:24,node:[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]};xe.node;var Se=y(xe),Ce={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Ce.node;var we=y(Ce),Te={name:`map`,size:24,node:[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]};Te.node;var Ee=y(Te),De={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};De.node;var Oe=y(De),ke={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ke.node;var Ae=y(ke),je={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};je.node;var Me=y(je),Ne={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};Ne.node;var Pe=y(Ne),Fe={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};Fe.node;var Ie=y(Fe),K=e(t(),1);function Le({id:e,sourceNodeId:t,planNode:n,category:r,segmentIndex:i,splitRole:a,durationShare:o,exclusiveDurationShare:s,findings:c}){return{id:e,sourceNodeId:t,label:n.name,category:r,operatorDetail:pe(n.name,n.detail??``),primaryMetric:_e(n.metrics),segmentIndex:i,splitRole:a,durationShare:o??null,exclusiveDurationShare:s??null,findings:c,metrics:(n.metrics??[]).map(e=>({name:e.name,value:G(e)})),detailText:n.detail&&n.detail!==n.name?n.detail:``}}function Re(e,t){let{scope:n,stageId:r,appModel:i,findings:a=[],durationMode:o=`exclusive`}=t;if(!e)return{nodes:[],edges:[],segmentIndex:null,segmentCount:0,scope:`full`,segmentStageIds:new Map};let s=i.stages.get(r)?.sqlExecutionId??null,c=s==null?null:i.sql.get(s),{segments:l,segOf:u,segmentTopology:d}=ve(e),f=l.filter(Boolean).length,p=c&&s!=null?U(e,i,c,s,o):null,m=o===`exclusive`?p:c&&s!=null?U(e,i,c,s,`exclusive`):null,h=new Map,g=c&&s!=null?W(s,i.stages):[];if(g.length){let e=new Map;for(let t of g){let n=i.stages.get(t);n&&e.set(t,{submittedAt:n.submittedAt,completedAt:n.completedAt})}for(let[t,n]of me(l,e,g,d))h.set(t,n)}let _=new Map;if(s!=null){for(let e of a)if(`executionId`in e&&e.executionId===s)for(let t of e.planNodeIds??[]){let n=_.get(t);n?n.push(e):_.set(t,[e])}}let v=[],y=[],b=new Map;H(e,(e,t)=>{let n=e.id,r=fe(e.name),a=u.get(e),o=t?t.id:null,s=e.exchangeRole===`write`&&t?t.id:n,c=Le({id:n,sourceNodeId:s,planNode:e,category:r,segmentIndex:a,splitRole:e.exchangeRole??null,durationShare:p?.get(e),exclusiveDurationShare:m?.get(e),findings:_.get(n)??[]});if(v.push(c),e.exchangeRole){let t=b.get(s)??{};t[e.exchangeRole]=c,b.set(s,t)}if(o){let t={id:`${o}->${n}`,source:o,target:n};if(e.exchangeRole===`write`){let e=h.get(a),n=e==null?void 0:i.stages.get(e),r=n?.shuffleWriteBytes||n?.shuffleReadBytes;if(r){t.shuffleBytes=r;let e=b.get(s)??{};e.shuffleBytes=r,b.set(s,e)}}y.push(t)}},{dedupe:!0});for(let{read:e,write:t,shuffleBytes:n}of b.values())e&&t&&(e.pairedNodeId=t.id,t.pairedNodeId=e.id),n!=null&&(e&&(e.exchangeShuffleBytes=n),t&&(t.exchangeShuffleBytes=n));if(n===`full`)return{nodes:v,edges:y,segmentIndex:null,segmentCount:f,scope:`full`,segmentStageIds:h};let x=null;for(let[e,t]of h)if(t===r){x=e;break}if(x===null)return{nodes:v,edges:y,segmentIndex:null,segmentCount:f,scope:`full`,segmentStageIds:h};let S=new Set;return{nodes:v.filter(e=>e.segmentIndex===x&&(S.add(e.id),!0)),edges:y.filter(e=>S.has(e.source)&&S.has(e.target)),segmentIndex:x,segmentCount:f,scope:`segment`,segmentStageIds:h}}var ze=24,Be=32;function Ve(e,t,n={}){let r=new L.graphlib.Graph({compound:!!n.groupOf});r.setGraph({rankdir:`RL`,nodesep:128,ranksep:60,ranker:`tight-tree`}),r.setDefaultEdgeLabel(()=>({}));let i=new Set;if(n.groupOf){for(let t of e){let e=n.groupOf(t);e&&i.add(e)}for(let e of i)r.setNode(e,{})}for(let t of e){r.setNode(t.id,{width:220,height:90});let e=n.groupOf?.(t);e&&r.setParent(t.id,e)}for(let e of t)r.setEdge(e.source,e.target);return L.layout(r),e.map(e=>{let t=r.node(e.id);return{...e,position:{x:t.x-110,y:t.y-45}}})}function He(e,t,n={}){let r=n.paddingX??ze,i=n.paddingY??ze,a=n.headerHeight??Be,o=new Map;for(let n of e){let e=t(n);if(!e)continue;let r=n.position.x,i=n.position.y,a=r+220,s=i+90,c=o.get(e);c?(c.minX=Math.min(c.minX,r),c.minY=Math.min(c.minY,i),c.maxX=Math.max(c.maxX,a),c.maxY=Math.max(c.maxY,s)):o.set(e,{minX:r,minY:i,maxX:a,maxY:s})}return[...o.entries()].map(([e,t])=>({id:e,position:{x:t.minX-r,y:t.minY-i-a},width:t.maxX-t.minX+r*2,height:t.maxY-t.minY+i*2+a}))}function Ue(e,t,n={}){let r=new Set,i=[];for(let a of t){let t=t=>{let n=e(t);return n&&!r.has(n)?n:null};for(let e of He(a,t,n))r.add(e.id),i.push(e)}return i}var q=P();function We({delay:e=0,...t}){return(0,q.jsx)(p,{"data-slot":`tooltip-provider`,delay:e,...t})}function Ge({...e}){return(0,q.jsx)(i,{"data-slot":`tooltip`,...e})}function Ke({...e}){return(0,q.jsx)(d,{"data-slot":`tooltip-trigger`,...e})}function qe({className:e,side:t=`top`,sideOffset:i=4,align:a=`center`,alignOffset:s=0,children:c,...l}){return(0,q.jsx)(n,{children:(0,q.jsx)(r,{align:a,alignOffset:s,side:t,sideOffset:i,className:`isolate z-50`,children:(0,q.jsxs)(f,{"data-slot":`tooltip-content`,className:D(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none`,e),...l,children:[c,(0,q.jsx)(o,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}function Je(e){return e==null?null:e>=40?`critical`:e>=15?`warning`:`info`}var J={scan:`⇩`,exchange:`⇄`,join:`⋈`,aggregate:`Σ`,sort:`↕`,filter:`∇`,aqe:`⚙`,boilerplate:`·`,transform:`→`};function Ye(e){return e.find(e=>e.impactBand===`critical`)??e.find(e=>e.impactBand===`warning`)??e[0]}function Xe({data:e}){let{label:t,operatorDetail:n,primaryMetric:r,category:i,splitRole:a,durationSharePct:o,findings:s}=e,c=J[i]??J.transform,l=Je(o);return(0,q.jsxs)(`div`,{className:`relative flex flex-col overflow-visible rounded-md border border-border bg-card px-3 py-2 text-xs shadow-sm`,style:{width:220,height:90},"data-category":i,children:[(0,q.jsx)(O,{type:`target`,position:k.Right,className:`opacity-0!`}),(0,q.jsx)(O,{type:`source`,position:k.Left,className:`opacity-0!`}),s&&s.length>0?(()=>{let e=Ye(s);return(0,q.jsxs)(Ge,{children:[(0,q.jsxs)(Ke,{"data-testid":`node-finding-badge`,className:D(`absolute -right-1 -top-1 flex items-center gap-1 rounded-full bg-card px-1.5 py-0.5 text-[10px] font-medium leading-none shadow-sm ring-1 ring-border`,S[e.impactBand]),children:[(0,q.jsx)(E,{impactBand:e.impactBand}),x(e.type),s.length>1?(0,q.jsx)(`span`,{children:s.length}):null]}),(0,q.jsx)(qe,{className:`max-w-xs`,children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1 text-left`,children:s.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(E,{impactBand:e.impactBand}),(0,q.jsx)(`span`,{children:ge(e)})]},e.id??`${e.type}-${t}`))})})]})})():null,a===`read`?(0,q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:`paired: see write half`}):null,o!=null&&l?(0,q.jsxs)(`div`,{className:`mb-1 flex shrink-0 items-center gap-1.5`,title:`Share of the plan's total stage wall time`,children:[(0,q.jsxs)(`span`,{className:D(`shrink-0 text-[10px] font-medium tabular-nums`,S[l]),children:[o,`%`]}),(0,q.jsx)(`div`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`div`,{"data-testid":`duration-heat-bar-fill`,className:D(`h-full rounded-full`,T[l]),style:{width:`${o>0?Math.max(o,4):0}%`}})}),(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Duration share `,o,`%, `,l===`critical`?`high`:l===`warning`?`medium`:`low`]})]}):null,(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:c}),(0,q.jsx)(`span`,{className:`min-w-0 truncate font-medium`,title:t,children:t})]}),n?(0,q.jsx)(`p`,{className:`truncate text-muted-foreground`,title:n,children:n}):null,r?(0,q.jsx)(`p`,{className:`truncate text-muted-foreground`,title:r,children:r}):null]})}var Ze={read:`Read half. Consumes the shuffle written by its paired write half.`,write:`Write half. Produces the shuffle its paired read half consumes.`};function Qe({node:e,onClose:t,onJumpToPaired:n}){let r=J[e.category]??J.transform,i=e.findings??[],a=e.metrics??[],o=e.category.charAt(0).toUpperCase()+e.category.slice(1);return(0,q.jsxs)(`div`,{"data-testid":`plan-node-detail`,role:`dialog`,"aria-label":`Plan node detail: ${e.label}`,className:`flex h-full w-80 shrink-0 flex-col gap-3 overflow-y-auto border-l border-border bg-card p-3 text-xs`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:r}),(0,q.jsx)(`span`,{className:`break-words font-medium`,children:e.label})]}),(0,q.jsx)(V,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,"aria-label":`Close node detail`,onClick:t,children:(0,q.jsx)(he,{className:`size-4`})})]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[o,` · Segment `,e.segmentIndex+1,e.durationSharePct==null?null:(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsxs)(`span`,{className:`text-foreground`,children:[e.durationSharePct,`%`]}),` of plan stage time`]})]}),e.splitRole?(0,q.jsxs)(Y,{title:`Exchange`,children:[(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:Ze[e.splitRole]}),e.exchangeShuffleBytes==null?e.label.startsWith(`Broadcast`)?(0,q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Broadcast, no shuffle`}):null:(0,q.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Shuffle written`,` `,(0,q.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:g(e.exchangeShuffleBytes)})]}),e.pairedNodeId&&n?(0,q.jsxs)(V,{type:`button`,variant:`outline`,size:`sm`,className:`mt-2 h-7 w-full justify-start gap-1.5`,onClick:()=>n(e.pairedNodeId),children:[(0,q.jsx)(Se,{className:`size-3.5`,"aria-hidden":`true`}),`Jump to `,e.splitRole===`read`?`write`:`read`,` half`]}):null]}):null,i.length>0?(0,q.jsx)(Y,{title:`Findings`,children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:i.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-start gap-1.5`,children:[(0,q.jsx)(v,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor,className:`shrink-0`}),(0,q.jsx)(`span`,{className:`break-words`,children:ge(e)})]},e.id??`${e.type}-${t}`))})}):null,a.length>0?(0,q.jsx)(Y,{title:`Metrics`,children:(0,q.jsx)(`dl`,{className:`grid grid-cols-[1fr_auto] gap-x-3 gap-y-1`,children:a.map((e,t)=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`min-w-0 break-words text-muted-foreground`,children:e.name}),(0,q.jsx)(`dd`,{className:`text-right font-medium tabular-nums`,children:e.value})]},`${e.name}-${t}`))})}):null,e.detailText?(0,q.jsx)(Y,{title:`Plan detail`,children:(0,q.jsx)(`pre`,{"data-testid":`plan-node-detail-text`,className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-muted p-2 font-mono text-[11px] leading-snug`,children:e.detailText})}):null]})}function Y({title:e,children:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:e}),t]})}var $e=[{category:`scan`,label:`Scan`},{category:`filter`,label:`Filter`},{category:`join`,label:`Join`},{category:`aggregate`,label:`Aggregate`},{category:`sort`,label:`Sort`},{category:`exchange`,label:`Exchange`},{category:`transform`,label:`Transform`}];function et(){return(0,q.jsxs)(`div`,{"data-testid":`plan-graph-legend`,role:`region`,"aria-label":`Plan graph legend`,className:`flex max-w-md flex-col gap-2 rounded-md border border-border bg-card p-3 text-xs shadow-md`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:`Operators`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:$e.map(({category:e,label:t})=>(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:J[e]}),t]},e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-muted-foreground`,children:`Duration share`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:D(`h-1.5 w-6 rounded-full`,T.info)}),` low`]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:D(`h-1.5 w-6 rounded-full`,T.warning)}),` medium`]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(`span`,{className:D(`h-1.5 w-6 rounded-full`,T.critical)}),` high`]})]})]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[(0,q.jsx)(`span`,{className:`text-foreground`,children:`Edge thickness`}),` = shuffle bytes moved across an exchange.`]}),(0,q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`A `,(0,q.jsx)(`span`,{className:`text-foreground`,children:`segment`}),` box groups one Exchange-bounded stage of the plan; a`,` `,(0,q.jsx)(`span`,{className:`text-foreground`,children:`stage`}),` box (full-plan view) wraps every segment of one Spark stage.`]})]})}function tt({...e}){return(0,q.jsx)(u,{"data-slot":`popover`,...e})}function nt({...e}){return(0,q.jsx)(a,{"data-slot":`popover-trigger`,...e})}function rt({align:e=`center`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=8,className:i,...a}){return(0,q.jsx)(s,{children:(0,q.jsx)(c,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,q.jsx)(l,{"data-slot":`popover-content`,className:D(`z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-3 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:animate-none`,i),...a})})})}function it({ariaLabel:e,name:t,options:n,value:r,onChange:i,trailingContent:a}){return(0,q.jsx)(We,{children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,role:`radiogroup`,"aria-label":e,children:[n.map(e=>(0,q.jsxs)(Ge,{children:[(0,q.jsxs)(Ke,{render:(0,q.jsx)(`label`,{className:`tap-target-comfortable flex min-h-8 items-center gap-1.5 px-1 text-sm`}),children:[(0,q.jsx)(`input`,{type:`radio`,name:t,value:e.value,checked:r===e.value,onChange:()=>i(e.value)}),e.label]}),(0,q.jsx)(qe,{children:e.description})]},e.value)),a]})})}var at=[{value:`io`,label:`I/O only`,description:`Show only scan and exchange nodes, where the plan reads or shuffles/broadcasts data.`},{value:`basic`,label:`Basic`,description:`Add join, aggregate, sort, and filter nodes to I/O; hide pass-through and boilerplate operators like Project or WholeStageCodegen.`},{value:`advanced`,label:`Advanced`,description:`Show every operator, including the pass-through and boilerplate nodes the other two modes hide.`}];function ot({mode:e,onChange:t,hiddenCount:n}){return(0,q.jsx)(it,{ariaLabel:`Node filter`,name:`plan-graph-filter`,options:at,value:e,onChange:t,trailingContent:n>0?(0,q.jsx)(C,{label:`${n} nodes hidden`,impactBand:`info`}):null})}var st=[{value:`exclusive`,label:`Node only`,description:`Each node's share reflects time spent in that operator alone, excluding its descendants.`},{value:`inclusive`,label:`Node + descendants`,description:`Each node's share adds in every descendant operator's time, so an ancestor's bar reflects its whole subtree.`}];function ct({mode:e,onChange:t}){return(0,q.jsx)(it,{ariaLabel:`Duration heat bar scope`,name:`plan-graph-duration-mode`,options:st,value:e,onChange:t})}function lt({filterMode:e,onFilterModeChange:t,hiddenCount:n,durationMode:r,onDurationModeChange:i,iconOnly:a=!1}){return(0,q.jsxs)(tt,{children:[(0,q.jsxs)(nt,{"aria-label":a?`Settings`:void 0,title:a?`Settings`:void 0,className:D(ye({variant:`ghost`,size:a?`icon`:`sm`}),`tap-target-comfortable`,a?void 0:`gap-1.5`),children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),a?null:`Settings`]}),(0,q.jsxs)(rt,{align:a?`start`:`end`,side:a?`right`:`bottom`,"aria-label":`Plan graph settings`,className:`space-y-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Node filter`}),(0,q.jsx)(ot,{mode:e,onChange:t,hiddenCount:n})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-px bg-border`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{className:`mb-1.5 text-xs font-medium text-muted-foreground`,children:`Duration attribution`}),(0,q.jsx)(ct,{mode:r,onChange:i})]})]})]})}var X=e=>e.data;function ut({planNodes:e,problemNodes:t,filterMode:n,onFilterModeChange:r,hiddenCount:i,durationMode:a,onDurationModeChange:o,legendOpen:s,onToggleLegend:c,miniMapOpen:l,onToggleMiniMap:u}){let{zoomIn:d,zoomOut:f,fitView:p,setCenter:m}=R(),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),y=[...e].filter(e=>X(e).durationSharePct!=null).sort((e,t)=>(X(t).durationSharePct??0)-(X(e).durationSharePct??0)),b=e=>{e&&m(e.position.x,e.position.y,{zoom:1,duration:300})},x=(e,t,n)=>{if(e.length===0)return;let r=e[((t?e.findIndex(e=>e.id===t):-1)+1)%e.length];b(r),n(r.id)};return(0,q.jsxs)(`div`,{className:`flex w-12 shrink-0 flex-col items-center gap-1 border-r border-border bg-card/60 py-2`,children:[(0,q.jsxs)(dt,{children:[(0,q.jsx)(Z,{label:`Zoom in`,onClick:()=>d({duration:200}),children:(0,q.jsx)(Ie,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:`Zoom out`,onClick:()=>f({duration:200}),children:(0,q.jsx)(Pe,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:`Fit to view`,onClick:()=>p({duration:200}),children:(0,q.jsx)(Oe,{"aria-hidden":`true`})})]}),(0,q.jsx)(ft,{}),(0,q.jsxs)(dt,{children:[(0,q.jsx)(Z,{label:`Next worst duration`,disabled:y.length===0,onClick:()=>x(y,h,g),children:(0,q.jsx)(Me,{"aria-hidden":`true`})}),t.length>0?(0,q.jsx)(Z,{label:`Next problem`,onClick:()=>x(t,_,v),children:(0,q.jsx)(we,{"aria-hidden":`true`})}):null]}),(0,q.jsx)(ft,{}),(0,q.jsxs)(dt,{children:[(0,q.jsx)(lt,{iconOnly:!0,filterMode:n,onFilterModeChange:r,hiddenCount:i,durationMode:a,onDurationModeChange:o}),(0,q.jsx)(Z,{label:s?`Hide legend`:`Legend`,pressed:s,onClick:c,children:(0,q.jsx)(de,{"aria-hidden":`true`})}),(0,q.jsx)(Z,{label:l?`Hide minimap`:`Show minimap`,pressed:l,onClick:u,children:(0,q.jsx)(Ee,{"aria-hidden":`true`})})]})]})}function dt({children:e}){return(0,q.jsx)(`div`,{className:`flex flex-col items-center gap-1`,children:e})}function ft(){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`my-0.5 h-px w-6 bg-border`})}function Z({label:e,onClick:t,disabled:n,pressed:r,children:i}){return(0,q.jsx)(V,{type:`button`,variant:`ghost`,size:`icon`,className:D(`tap-target-comfortable`,r&&`bg-primary/15 text-primary hover:bg-primary/20 hover:text-primary`),"aria-label":e,title:e,"aria-pressed":r,disabled:n,onClick:t,children:i})}function pt(e){if(e.type!==`planNode`)return`var(--muted)`;let t=e.data.findings??[],n=_(t);return n?z[n]:`var(--plan-aggregate)`}function mt({finding:e,className:t}){let n=w(e);return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,q.jsx)(v,{type:e.type,impactBand:e.impactBand,docAnchor:e.docAnchor,className:t}),n?(0,q.jsx)(`span`,{className:`font-mono text-[10px] leading-none whitespace-nowrap text-muted-foreground`,children:n}):null]})}function ht({data:e}){let{width:t,height:n,stageId:r,durationLabel:i,findings:a}=e;return(0,q.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-dashed border-border/70 bg-muted/10 nopan nodrag`,style:{width:t,height:n,pointerEvents:`all`},children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{title:r==null?`This plan segment couldn't be matched to a specific Spark stage`:void 0,children:r==null?`Stage —`:`Stage ${r}`}),(0,q.jsx)(C,{label:i??`—`,impactBand:`info`,title:`Approximate share of this stage's wall time`}),a.length>0?(0,q.jsx)(`div`,{className:`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1`,children:a.map((e,t)=>(0,q.jsx)(mt,{finding:e,className:`h-4 gap-1 px-1.5 text-xs`},e.id??`${e.type}-${t}`))}):null]})})}function gt({data:e}){let{width:t,height:n,stageId:r,findings:i,showOwnFindings:a=!0,onSelect:o}=e;return(0,q.jsxs)(`div`,{className:`relative rounded-xl border border-primary/25 bg-primary/5 nopan nodrag`,style:{width:t,height:n,pointerEvents:`all`},children:[(0,q.jsx)(`button`,{type:`button`,"aria-label":`Focus stage ${r}`,onClick:o,style:{pointerEvents:`auto`},className:`absolute inset-0 size-full cursor-pointer rounded-xl transition-colors hover:border-primary/50 hover:bg-primary/10`}),a&&i.length>0?(0,q.jsx)(`div`,{className:`absolute left-2 right-2 top-1 flex flex-wrap gap-1`,children:i.map((e,t)=>(0,q.jsx)(mt,{finding:e,className:`h-4 gap-1 px-1.5 text-xs`},e.id??`${e.type}-${t}`))}):null,(0,q.jsxs)(`span`,{className:`absolute right-2 bottom-1 text-xs font-medium text-primary`,children:[`Stage `,r]})]})}var _t=1.5,vt=.55;function yt(e,t){return!(e>0)||!(t>0)?0:Math.min(1,Math.log(e+1)/Math.log(t+1))}function bt(e,t){return _t+7.5*yt(e,t)}function xt(e,t){return vt+.44999999999999996*yt(e,t)}function St({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a,markerEnd:o,data:s}){let[c,l,u]=A({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a}),{shuffleBytes:d=0,maxShuffleBytes:f=0}=s??{},p=bt(d,f),m=xt(d,f),h=d>0&&d<1e3?`<1 KB`:g(d);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(F,{path:c,markerEnd:o,style:{stroke:`var(--text-muted)`,strokeWidth:p,strokeOpacity:m}}),(0,q.jsx)(j,{children:(0,q.jsxs)(Ge,{children:[(0,q.jsx)(Ke,{"data-testid":`exchange-edge-label`,className:`nodrag nopan pointer-events-auto absolute cursor-help rounded bg-card/90 px-1 py-0.5 font-mono text-[10px] leading-none text-muted-foreground ring-1 ring-border`,style:{transform:`translate(-50%, -50%) translate(${l}px, ${u}px)`},children:h}),(0,q.jsx)(qe,{className:`max-w-xs`,children:(0,q.jsxs)(`p`,{children:[h,` of shuffle written across this exchange. Edge thickness scales with the volume moved.`]})})]})})]})}var Ct={planNode:Xe,segmentGroup:ht,stageGroup:gt},wt={exchange:St},Tt=1,Et=2,Dt=3,Ot=e=>e.data,Q={padding:.06,maxZoom:1.75};function kt({resizeTick:e,fitSignal:t,centerRequest:n}){let{fitView:r,setCenter:i,getNode:a}=R();return(0,K.useEffect)(()=>{if(!n||n.token===0||!n.nodeId)return;let e=a(n.nodeId);e?i(e.position.x,e.position.y,{zoom:1,duration:300}):r({nodes:[{id:n.nodeId}],duration:300,maxZoom:1})},[n,i,a,r]),(0,K.useEffect)(()=>{let e=()=>r({duration:200,...Q});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[r]),(0,K.useEffect)(()=>{e!==0&&r({duration:200,...Q})},[e,r]),(0,K.useEffect)(()=>{t!==0&&r({duration:300,...Q})},[t,r]),null}function At(){let e=(0,K.useRef)(null),[t,n]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let t=e.current;if(!t)return;let r=!0,i=new ResizeObserver(()=>{if(r){r=!1;return}n(e=>e+1)});return i.observe(t),()=>i.disconnect()},[]),{ref:e,tick:t}}function jt(e,t){return e.filter(e=>e.stageId===t||oe(e)?.includes(t))}function Mt({model:e,showMiniMap:t,findings:n=[],stageId:r,segmentStageIds:i,visibleNodeIds:a,visibleEdges:o,onSelectStage:s,selectedNodeId:c=null,onSelectNode:l,onJumpToPaired:u,centerRequest:d,fitSignal:f=0,filterMode:p=`basic`,onFilterModeChange:h=()=>{},hiddenCount:g=0,durationMode:_=`exclusive`,onDurationModeChange:v=()=>{}}){let{flowNodes:y,flowEdges:b}=(0,K.useMemo)(()=>{let t=e.nodes.reduce((e,t)=>e+(t.exclusiveDurationShare??t.durationShare??0),0),c=e=>`segment-${e.segmentIndex}`,l=e.scope===`full`,u=e=>{let t=i?.get(e.segmentIndex);return t==null?null:`stage-${t}`},d=a?Ve(e.nodes.filter(e=>a.has(e.id)),o??e.edges,{groupOf:c}):Ve(e.nodes,e.edges,{groupOf:c}),f=new Set(d.map(c)),p=l?new Set(d.map(u).filter(e=>e!=null)):null,h=e.nodes.some(e=>!f.has(c(e)))||p!=null&&e.nodes.some(e=>{let t=u(e);return t!=null&&!p.has(t)})?Ve(e.nodes,e.edges,{groupOf:c}):d,g=d.map(e=>{let n=e.durationShare!=null&&t>0?Math.round(e.durationShare/t*100):null,r=e.splitRole===`read`?`${e.label}, paired: see write half`:[e.label,e.operatorDetail,e.primaryMetric,n==null?null:`${n}% of the plan's total stage duration`].filter(Boolean).join(`, `);return{id:e.id,type:`planNode`,position:e.position,draggable:!1,zIndex:Dt,measured:{width:220,height:90},ariaLabel:r,ariaRole:`button`,data:{...e,durationSharePct:n}}}),_=Ue(c,[d,h]).map(t=>{let r=Number(t.id.replace(`segment-`,``)),a=e.nodes.filter(e=>c(e)===t.id),o=a.reduce((e,t)=>e+(t.exclusiveDurationShare??t.durationShare??0),0),s=a.some(e=>e.durationShare!=null),l=i?.get(r)??null,u=l==null?[]:jt(n,l);return{id:t.id,type:`segmentGroup`,position:t.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Et,style:{width:t.width,height:t.height},measured:{width:t.width,height:t.height},data:{width:t.width,height:t.height,stageId:l,durationLabel:s?m(o):null,findings:u}}}),v=new Set(_.map(e=>e.data.stageId).filter(e=>e!=null)),y=l?(()=>{let e={paddingX:32,paddingY:64,headerHeight:0},t=Ue(u,[d,h],e),i=`stage-${r}`;if(jt(n,r).length>0&&!t.some(e=>e.id===i)){let[n]=Ue(()=>i,[d,h],e);n&&t.push(n)}return t.map(e=>{let t=Number(e.id.replace(`stage-`,``));return{id:e.id,type:`stageGroup`,position:e.position,draggable:!1,selectable:!1,focusable:!1,zIndex:Tt,style:{width:e.width,height:e.height},measured:{width:e.width,height:e.height},data:{width:e.width,height:e.height,stageId:t,findings:jt(n,t),showOwnFindings:!v.has(t),onSelect:()=>s?.(t)}}})})():[],b=o??e.edges,x=b.reduce((e,t)=>Math.max(e,t.shuffleBytes??0),0),S=b.map(e=>e.shuffleBytes?{id:e.id,source:e.source,target:e.target,type:`exchange`,data:{shuffleBytes:e.shuffleBytes,maxShuffleBytes:x}}:{id:e.id,source:e.source,target:e.target});return{flowNodes:[...y,..._,...g],flowEdges:S}},[e,n,r,i,a,o,s]),{ref:x,tick:S}=At(),[C,w]=(0,K.useState)(!0),[T,E]=(0,K.useState)(!0),D=c?y.find(e=>e.id===c&&e.type===`planNode`):void 0,O=y.filter(e=>e.type===`planNode`),k=y.filter(e=>e.type===`stageGroup`&&(e.data.findings?.length??0)>0).sort(be(e=>e.data.findings??[])),A=a!=null&&a.size===0&&e.nodes.length>0;return(0,q.jsx)(ee,{children:(0,q.jsx)(We,{children:(0,q.jsxs)(`div`,{ref:x,className:`flex min-h-0 flex-1`,children:[(0,q.jsx)(ut,{planNodes:O,problemNodes:k,filterMode:p,onFilterModeChange:h,hiddenCount:g,durationMode:_,onDurationModeChange:v,legendOpen:C,onToggleLegend:()=>w(e=>!e),miniMapOpen:t&&T,onToggleMiniMap:()=>E(e=>!e)}),(0,q.jsx)(`div`,{className:`relative min-w-0 flex-1`,onKeyDown:e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target.closest(`.react-flow__node-planNode`)?.getAttribute(`data-id`);t&&(e.preventDefault(),l?.(t))},children:(0,q.jsxs)(te,{nodes:y,edges:b,nodeTypes:Ct,edgeTypes:wt,"aria-label":`Plan graph. Operators and the data flowing between them. Tab to move between operators, Enter to open an operator's details.`,fitView:!0,fitViewOptions:Q,minZoom:.05,edgesFocusable:!1,onNodeClick:(e,t)=>{t.type===`planNode`&&l?.(t.id)},onPaneClick:()=>l?.(null),children:[(0,q.jsx)(M,{}),(0,q.jsx)(kt,{resizeTick:S,fitSignal:f,centerRequest:d}),A?(0,q.jsx)(I,{position:`top-center`,children:(0,q.jsxs)(`p`,{role:`status`,className:`rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground shadow-sm`,children:[`All `,e.nodes.length,` operators are hidden by the node filter. Change it in Settings to show them.`]})}):null,C?(0,q.jsx)(I,{position:`bottom-left`,children:(0,q.jsx)(et,{})}):null,t&&T?(0,q.jsx)(N,{nodeColor:pt,pannable:!0,zoomable:!0,ariaLabel:`Plan overview. Drag to pan and scroll to zoom the graph.`}):null]})}),D?(0,q.jsx)(Qe,{node:Ot(D),onClose:()=>l?.(null),onJumpToPaired:u}):null]})})})}function Nt({open:e,nodeCount:t,onConfirm:n,onCancel:r}){return(0,q.jsx)(ae,{open:e,onOpenChange:e=>{e||r()},children:(0,q.jsxs)(se,{children:[(0,q.jsx)(le,{children:(0,q.jsx)(B,{children:`Expand to full plan?`})}),(0,q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This plan has `,t,` nodes. Rendering the full graph may take several seconds.`]}),(0,q.jsxs)(re,{children:[(0,q.jsx)(V,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Cancel`}),(0,q.jsx)(V,{type:`button`,size:`sm`,onClick:n,children:`Expand anyway`})]})]})})}var Pt={io:[`scan`,`exchange`],basic:[`scan`,`exchange`,`join`,`aggregate`,`sort`,`filter`],advanced:null},Ft=300;function It(e,t){let n=new Map;for(let t of e){let e=n.get(t.source);e?e.push(t.target):n.set(t.source,[t.target])}let r=new Map;function i(e){let a=r.get(e);if(a)return a;let o=new Set;r.set(e,o);for(let r of n.get(e)??[])if(t.has(r))o.add(r);else for(let e of i(r))o.add(e);return o}let a=new Map;for(let t of e)t.shuffleBytes&&a.set(`${t.source}->${t.target}`,t.shuffleBytes);let o=[];for(let e of t)for(let t of i(e)){let n={id:`${e}=>${t}`,source:e,target:t},r=a.get(`${e}->${t}`);r&&(n.shuffleBytes=r),o.push(n)}return o}function Lt(e,t){try{return Re(e,t)}catch{return null}}var Rt=new Map;function zt(e,t,n,r){return`${e??`none`}::${t}::${n}::${r}`}function Bt(){Rt.clear()}var Vt=b.getState().modelResetCount;b.subscribe(e=>{e.modelResetCount!==Vt&&(Vt=e.modelResetCount,Bt())});function $(e,t,n){let r=zt(n,t.stageId,t.scope,t.durationMode),i=Rt.get(r);if(i)return i;let a=Lt(e,t);return a&&Rt.set(r,a),a}function Ht({stageId:e,appModel:t,findings:n,activeFileId:r,onClose:i,initialScope:a}){let{resetToDropZone:o}=ue(),{recentEntries:s,onPickRecent:c,onRemoveRecent:l}=ce(r),[u,d]=(0,K.useState)(`basic`),[f,p]=(0,K.useState)(`exclusive`),[m,g]=(0,K.useState)(a??`segment`),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(a!==`full`),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(e),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(0),[ee,k]=(0,K.useState)({nodeId:null,token:0}),[A,j]=(0,K.useState)(null),te=e=>k(t=>({nodeId:e,token:t.token+1}));(0,K.useEffect)(()=>{E(null)},[C,m,u]);let M=ne(C,t),N=M?$(M,{scope:`segment`,stageId:C,appModel:t,findings:n,durationMode:f},r):null,P=N!=null&&N.scope===`full`&&m===`segment`&&N.nodes.length>Ft,F=P&&!x;(0,K.useEffect)(()=>{F&&v(!0)},[F]);let I=M&&(m===`full`||_)?$(M,{scope:`full`,stageId:C,appModel:t,findings:n,durationMode:f},r):null,L=!y&&m===`full`&&I!=null&&I.nodes.length>Ft,R=_||L;(0,K.useEffect)(()=>{let e=e=>{e.key!==`Escape`||R||(T?E(null):i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,R,T]);let z=P||L?null:m===`full`?I:N;(0,K.useEffect)(()=>{A&&m===`full`&&z?.nodes.some(e=>e.id===A)&&(E(A),te(A),j(null))},[A,m,z]);function B(){let e=M?$(M,{scope:`full`,stageId:C,appModel:t,findings:n,durationMode:f},r):null;e&&e.nodes.length>Ft?v(!0):(g(`full`),O(e=>e+1))}function re(){g(`segment`),O(e=>e+1)}function ae(e){if(z?.nodes.some(t=>t.id===e)){E(e),te(e);return}j(e),B()}let oe=(0,K.useCallback)(e=>{w(e),g(`segment`),b(!0),S(!1),j(null),O(e=>e+1)},[]);function se(){b(!0),g(`full`),v(!1),O(e=>e+1)}function le(){v(!1),j(null),L&&(b(!0),g(`segment`),N?.scope===`full`&&S(!0)),F&&S(!0)}function de(e){return i(),c(e)}let{visibleNodeIds:fe,filteredEdges:pe,hiddenNodes:me}=(0,K.useMemo)(()=>{let e=Pt[u],t=new Set;if(z)for(let n of z.nodes)(!e||e.includes(n.category))&&t.add(n.id);return{visibleNodeIds:t,filteredEdges:z?It(z.edges,t):[],hiddenNodes:z?z.nodes.filter(e=>!t.has(e.id)):[]}},[z,u]),H=z?.scope===`full`,U=m===`full`,W=(0,K.useId)(),G=H&&!U;return(0,q.jsxs)(`div`,{"data-testid":`dashboard`,className:`flex h-screen flex-col`,style:{paddingRight:`var(--docs-inset, 0px)`},children:[(0,q.jsx)(ie,{onLoadNew:o,recentEntries:s,activeFileId:r,onPickRecent:de,onRemoveRecent:l,leadingContent:(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsxs)(`h1`,{className:`truncate font-heading text-sm font-semibold`,children:[`Plan graph: Stage `,C]}),z&&z.scope===`segment`?(0,q.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Segment `,z.segmentIndex+1,` of `,z.segmentCount]}):null,(0,q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:(0,q.jsx)(h,{anchor:`#bottleneck-duplicate-plan-subtree`,children:`Plan Advisor docs`})})]}),sectionControls:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,q.jsx)(V,{type:`button`,variant:`outline`,size:`sm`,disabled:G,"aria-describedby":G?W:void 0,onClick:H?re:B,children:H?`Back to segment view`:`Expand to full plan`}),G?(0,q.jsx)(`p`,{id:W,className:`text-xs text-muted-foreground`,children:`This stage's plan couldn't be scoped to a single segment`}):null]}),(0,q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:i,children:`Close`})]})}),(0,q.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:L?null:!M||!z?(0,q.jsx)(`p`,{role:`alert`,className:`p-6 text-sm text-destructive`,children:P?`This plan has more nodes than the graph view can safely render without expanding. Click "Expand to full plan" to confirm.`:`Couldn't build the plan graph for this stage.`}):(0,q.jsx)(Mt,{model:z,visibleNodeIds:fe,visibleEdges:pe,showMiniMap:!0,findings:n,stageId:C,segmentStageIds:z.segmentStageIds,onSelectStage:oe,selectedNodeId:T,onSelectNode:E,onJumpToPaired:ae,centerRequest:ee,fitSignal:D,filterMode:u,onFilterModeChange:d,hiddenCount:me.length,durationMode:f,onDurationModeChange:p})}),(0,q.jsx)(Nt,{open:R,nodeCount:I?.nodes.length??0,onConfirm:se,onCancel:le})]})}export{Ht as PlanGraphRoute};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,K as r,R as i,at as a,d as o,p as s,u as c}from"./DisclosureContext-LYzHroHO.js";import{p as l}from"./plan-graph-vendor-B0sEms9Z.js";import{m as u}from"./useRecentFiles-BrBl-AP1.js";import{D as d,S as f}from"./index-CEM9bz_x.js";import{i as p,o as m,r as h,t as g}from"./Dashboard-Bo_1jGqH.js";import{r as _}from"./impact-sort-7z0ZcBZf.js";import{n as v}from"./finding-anchor-DF1cSHO1.js";import{t as y}from"./usePagedRows-BjPOpUU8.js";import{n as b,t as x}from"./useSortMode-CU0vzThu.js";var S=e(t(),1),C=l();function w(e){return e.stageId!=null}function T(e){return(e.extended??``).replace(/, wasting \d+s of executor time\./,`.`)}function E(e){let t=String(e.recommendation??``),n=t.indexOf(`: `);return n===-1?t:t.slice(n+2)}function D({finding:e}){let t=v([e]);return(0,C.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`flex flex-col gap-1 transition-colors ${t.flashClassName}`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(p,{stageId:e.stageId}),(0,C.jsx)(c,{impactBand:e.impactBand})]}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Wasted `,(0,C.jsx)(`strong`,{children:r(n(e))}),` of executor time.`,e.extended?(0,C.jsxs)(s,{children:[` `,T(e)]}):null]}),e.recommendation?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:E(e)}):null,(0,C.jsx)(g,{finding:e})]})}function O({appModel:e,catalog:t,defaultCollapsed:s=!0}){let[c,l]=(0,S.useState)(0),{sortMode:p,setSortMode:g,orderBy:v}=x(),[T,E]=(0,S.useState)(!s),O=d(),k=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(!k.current){k.current=!0;return}l(0)},[e]);let A=u(t,`retryWaste`).filter(w),j=[...A].sort((e,t)=>i[e.impactBand]-i[t.impactBand]||(typeof t.value==`number`?t.value:0)-(typeof e.value==`number`?e.value:0)),M=v(j,e=>[e],e=>e.stageId),N=O?M.findIndex(e=>e===O.finding):null,{totalPages:P,effectivePage:F,visible:I}=y(M,c,l,N);return A.length===0?null:(0,C.jsxs)(f,{title:`Retry Waste`,impactBand:a(A),badges:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o,{type:`retryWaste`,impactBand:a(A)}),_(A,A.length,T)?(0,C.jsx)(b,{mode:p,onChange:e=>{g(e),l(0)}}):null]}),open:T,onOpenChange:E,summary:(0,C.jsx)(m,{value:r(n(j[0])),context:`${A.length} item${A.length===1?``:`s`} flagged`}),children:[(0,C.jsx)(`ul`,{className:`space-y-3`,children:I.map(e=>(0,C.jsx)(D,{finding:e},e.id))}),(0,C.jsx)(h,{page:F,totalPages:P,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)})]})}export{O as RetryWaste};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,R as r,W as i,at as a,d as o,mt as s,nt as c}from"./DisclosureContext-LYzHroHO.js";import{p as l}from"./plan-graph-vendor-B0sEms9Z.js";import{i as u}from"./useRecentFiles-BrBl-AP1.js";import{D as d,S as f}from"./index-CEM9bz_x.js";import{a as p,o as m,r as h,t as g}from"./Dashboard-Bo_1jGqH.js";import{r as _}from"./impact-sort-7z0ZcBZf.js";import{n as v,t as y}from"./finding-anchor-DF1cSHO1.js";import{t as b}from"./usePagedRows-BjPOpUU8.js";import{n as x,t as S}from"./useSortMode-CU0vzThu.js";import{t as C}from"./StageHeader-BSV8ALhT.js";import{a as w,i as T,n as E,r as D,t as O}from"./select-Cy5pmbrh.js";import{t as k}from"./PlanExplorer-DdmPkKO1.js";var A=e(t(),1),j=l();function M({entry:e,appModel:t}){let r=s(),a=v([e.shuffle]),o=t.stages.get(e.stageId),l=o?c(o):null,d=r===`advanced`&&u(e.stageId,t);return(0,j.jsxs)(`div`,{ref:a.ref,tabIndex:a.tabIndex,"data-flashed":a.dataFlashed,className:`space-y-2 ${y} transition-colors ${a.flashClassName}`,children:[(0,j.jsx)(C,{stageId:e.stageId,appModel:t}),(0,j.jsxs)(`p`,{className:`text-sm`,children:[`Shuffle read: `,(0,j.jsx)(`strong`,{children:i(n(e.shuffle))}),` · `,`Write: `,i(o?.shuffleWriteBytes??0)]}),(0,j.jsx)(g,{finding:e.shuffle}),l||d?(0,j.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[l?(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Try `,(0,j.jsxs)(`code`,{children:[`spark.sql.shuffle.partitions = `,l.recommended]}),`: current`,` `,l.current,` tasks, target 128 MB per partition`]}):null,d?(0,j.jsx)(k,{stageId:e.stageId,appModel:t}):null]}):null]})}var N=(0,A.memo)(function({appModel:e,catalog:t,defaultCollapsed:s=!0}){let[c,l]=(0,A.useState)(0),[u,g]=(0,A.useState)(!s),{sortMode:v,setSortMode:y,orderBy:C}=S(),k=d(),{shuffleFindings:N,sorted:P,orderedEntries:F}=(0,A.useMemo)(()=>{let e=t.filter(e=>e.type===`shuffle`),i=[...e.filter(e=>e.stageId!=null).map(e=>({stageId:e.stageId,shuffle:e,impactBand:e.impactBand,peak:n(e)}))].sort((e,t)=>r[e.impactBand]-r[t.impactBand]||t.peak-e.peak);return{shuffleFindings:e,sorted:i,orderedEntries:C(i,e=>[e.shuffle],e=>e.stageId)}},[t,v]),I=k?F.findIndex(e=>e.shuffle===k.finding):null,{totalPages:L,effectivePage:R,visible:z}=b(F,c,l,I);if(N.length===0){let t=0;for(let n of e.stages.values())t=Math.max(t,n.shuffleReadBytes??0);return(0,j.jsx)(f,{title:`Shuffle I/O`,open:u,onOpenChange:g,summary:(0,j.jsx)(m,{value:i(t),context:`no issue detected: peak shuffle read`}),children:(0,j.jsx)(`div`,{className:`flex flex-col gap-1`,children:(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No shuffle read/write issues detected.`})})})}let B=a(N),V=F.map(e=>({id:e.stageId})),H=_(N,P.length,u);return(0,j.jsx)(f,{title:`Shuffle I/O`,impactBand:B,open:u,onOpenChange:g,summary:(0,j.jsx)(m,{value:i(P[0].peak),context:`Peak shuffle read · ${P.length} stage${P.length===1?``:`s`} flagged`}),badges:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o,{type:`shuffle`,impactBand:B??`info`}),H?(0,j.jsx)(x,{mode:v,onChange:e=>{y(e),l(0)}}):null]}),children:(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsx)(p,{pills:V}),z.map(t=>(0,j.jsx)(M,{entry:t,appModel:e},t.stageId)),(0,j.jsx)(h,{page:R,totalPages:L,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1),renderJumpControl:()=>(0,j.jsxs)(O,{value:String(R*6),onValueChange:e=>l(Math.floor(Number(e)/6)),children:[(0,j.jsx)(T,{size:`sm`,"aria-label":`Jump to stage`,children:(0,j.jsx)(w,{placeholder:`Jump to stage`})}),(0,j.jsx)(E,{children:F.map((e,t)=>(0,j.jsxs)(D,{value:String(t),children:[`Stage `,e.stageId,` (`,i(e.peak),`)`]},e.stageId))})]})})]})})});export{N as ShuffleIO};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,J as r}from"./DisclosureContext-LYzHroHO.js";import{p as i}from"./plan-graph-vendor-B0sEms9Z.js";import{t as a}from"./StageFindingGroup-Bzm2TY03.js";var o=e(t(),1),s=i();function c(e){return`${e.metric}: ${r(`ratio`,n(e))}`}var l=(0,o.memo)(function(e){return(0,s.jsx)(a,{...e,type:`skew`,title:`Task Skew`,idPrefix:`skew`,findingLabel:c})});export{l as Skew};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,J as r,R as i,d as a,u as o}from"./DisclosureContext-LYzHroHO.js";import{p as s}from"./plan-graph-vendor-B0sEms9Z.js";import{m as c}from"./useRecentFiles-BrBl-AP1.js";import{D as l,S as u}from"./index-CEM9bz_x.js";import{o as d,r as f,t as p}from"./Dashboard-Bo_1jGqH.js";import{r as m}from"./impact-sort-7z0ZcBZf.js";import{n as h}from"./finding-anchor-DF1cSHO1.js";import{t as g}from"./usePagedRows-BjPOpUU8.js";import{n as _,t as v}from"./useSortMode-CU0vzThu.js";import{t as y}from"./StageHeader-BSV8ALhT.js";var b=e(t(),1),x=s();function S(e){let t=n(e);if(e.metric===`execMaxMedianRatio`)return`Executor ${e.executorId}: ${r(`ratio`,t)} median on ${e.dimension??`this metric`}`;let i=Math.round((e.hostTaskShare??0)*100);return e.metric===`hostDurationShare`?`${e.host}: ${r(`pctFraction`,t)} of this stage's task time (${r(`pct`,i)} of tasks)`:`${e.host}: ${r(`ratio`,t)} median task time (${r(`pct`,i)} of tasks)`}function C(e){if(e.metric!==`hostDurationShare`&&e.metric!==`execMaxMedianRatio`)return null;let t=e.recommendation??``,n=t.indexOf(`: `);return n===-1?null:t.slice(n)}function w({finding:e,appModel:t}){let n=h([e]),r=C(e);return(0,x.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(o,{impactBand:e.impactBand}),e.stageId==null?null:(0,x.jsx)(y,{stageId:e.stageId,appModel:t})]}),(0,x.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[S(e),r]}),(0,x.jsx)(p,{finding:e}),r==null?(0,x.jsx)(`p`,{className:`text-muted-foreground pt-1`,children:e.recommendation}):null]})}var T=(0,b.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:r,setSortMode:o,orderBy:s}=v(),[p,h]=(0,b.useState)(!n),[y,C]=(0,b.useState)(0),T=c(t,`slowHost`).slice().sort((e,t)=>i[e.impactBand]-i[t.impactBand]),E=s(T,e=>[e],e=>e.stageId??null),D=l(),O=D?E.findIndex(e=>e===D.finding):null,{totalPages:k,effectivePage:A,visible:j}=g(E,y,C,O);return T.length===0?null:(0,x.jsxs)(u,{title:`Slow Executor Host`,impactBand:T[0].impactBand,badges:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{type:`slowHost`,impactBand:T[0].impactBand}),m(T,T.length,p)?(0,x.jsx)(_,{mode:r,onChange:o}):null]}),open:p,onOpenChange:h,summary:(0,x.jsx)(d,{value:S(T[0]),context:`${T.length} issue${T.length===1?``:`s`} flagged`}),children:[(0,x.jsx)(`ul`,{className:`space-y-2`,children:j.map(t=>(0,x.jsx)(w,{finding:t,appModel:e},t.id))}),(0,x.jsx)(f,{page:A,totalPages:k,onPrev:()=>C(e=>e-1),onNext:()=>C(e=>e+1)})]})});export{T as SlowHost};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{R as n,at as r,d as i,p as a}from"./DisclosureContext-LYzHroHO.js";import{p as o}from"./plan-graph-vendor-B0sEms9Z.js";import{h as s,m as c}from"./useRecentFiles-BrBl-AP1.js";import{D as l,S as u,x as d}from"./index-CEM9bz_x.js";import{a as f,o as p,r as m,t as h}from"./Dashboard-Bo_1jGqH.js";import{i as g,r as _}from"./impact-sort-7z0ZcBZf.js";import{n as v,t as y}from"./finding-anchor-DF1cSHO1.js";import{t as b}from"./usePagedRows-BjPOpUU8.js";import{n as x,t as S}from"./useSortMode-CU0vzThu.js";var C=e(t(),1),w=o();function T({finding:e}){let t=v([e]);return(0,w.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-2 ${y} transition-colors ${t.flashClassName}`,children:[e.stageIds.length>0?(0,w.jsx)(f,{pills:e.stageIds.map(e=>({id:e}))}):null,(0,w.jsxs)(`p`,{children:[e.recommendation,` `,(0,w.jsx)(h,{finding:e})]})]})}var E=(0,C.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:o,setSortMode:f,orderBy:h}=S(),[v,y]=(0,C.useState)(!t),[E,D]=(0,C.useState)(0),{findings:O,pills:k}=(0,C.useMemo)(()=>{let t=c(e,`smallFiles`).sort((e,t)=>n[e.impactBand]-n[t.impactBand]);return{findings:t,pills:[...new Set(t.flatMap(e=>e.stageIds))].map(e=>({id:e}))}},[e,o]),A=h(O,e=>[e],g),j=l(),M=j?A.findIndex(e=>e===j.finding):null,{totalPages:N,effectivePage:P,visible:F}=b(A,E,D,M);return O.length===0?null:(0,w.jsxs)(u,{title:`Excessive Small Files`,impactBand:r(O),open:v,onOpenChange:y,badges:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(i,{type:`smallFiles`,impactBand:r(O)??`info`,className:d}),_(O,O.length,v)?(0,w.jsx)(x,{mode:o,onChange:f}):null]}),statusBadge:(0,w.jsx)(a,{children:(0,w.jsx)(s,{confidence:O[0].confidence,validationRequired:O[0].validationRequired,evidenceKey:`sqlPlan`})}),summary:(0,w.jsx)(p,{value:`${k.length} stage${k.length===1?``:`s`}`,context:`${O.length} finding${O.length===1?``:`s`} flagged`}),children:[(0,w.jsx)(`ul`,{className:`space-y-3 text-sm`,children:F.map(e=>(0,w.jsx)(T,{finding:e},e.id))}),(0,w.jsx)(m,{page:P,totalPages:N,onPrev:()=>D(e=>e-1),onNext:()=>D(e=>e+1)})]})});export{E as SmallFiles};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,K as r,R as i,d as a,u as o}from"./DisclosureContext-LYzHroHO.js";import{p as s}from"./plan-graph-vendor-B0sEms9Z.js";import{D as c,S as l}from"./index-CEM9bz_x.js";import{o as u,r as d,t as f}from"./Dashboard-Bo_1jGqH.js";import{r as p}from"./impact-sort-7z0ZcBZf.js";import{n as m}from"./finding-anchor-DF1cSHO1.js";import{t as h}from"./usePagedRows-BjPOpUU8.js";import{n as g,t as _}from"./useSortMode-CU0vzThu.js";import{t as v}from"./StageHeader-BSV8ALhT.js";var y=e(t(),1),b=s();function x(e){return r(n(e))}function S({finding:e,appModel:t}){let n=m([e]);return(0,b.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(o,{impactBand:e.impactBand}),e.stageId==null?null:(0,b.jsx)(v,{stageId:e.stageId,appModel:t}),(0,b.jsx)(`strong`,{children:x(e)})]}),(0,b.jsx)(f,{finding:e}),(0,b.jsx)(`p`,{className:`text-muted-foreground pt-1`,children:e.recommendation})]})}var C=(0,y.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:r,setSortMode:o,orderBy:s}=_(),[f,m]=(0,y.useState)(!n),[v,C]=(0,y.useState)(0),w=t.filter(e=>e.type===`speculationWaste`).slice().sort((e,t)=>i[e.impactBand]-i[t.impactBand]),T=s(w,e=>[e],e=>e.stageId??null),E=c(),D=E?T.findIndex(e=>e===E.finding):null,{totalPages:O,effectivePage:k,visible:A}=h(T,v,C,D);return w.length===0?null:(0,b.jsxs)(l,{title:`Speculation Waste`,impactBand:w[0].impactBand,badges:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a,{type:`speculationWaste`,impactBand:w[0].impactBand}),p(w,w.length,f)?(0,b.jsx)(g,{mode:r,onChange:o}):null]}),open:f,onOpenChange:m,summary:(0,b.jsx)(u,{value:x(w[0]),context:`${w.length} issue${w.length===1?``:`s`} flagged`}),children:[(0,b.jsx)(`ul`,{className:`space-y-2`,children:A.map(t=>(0,b.jsx)(S,{finding:t,appModel:e},t.id))}),(0,b.jsx)(d,{page:k,totalPages:O,onPrev:()=>C(e=>e-1),onNext:()=>C(e=>e+1)})]})});export{C as SpeculationWaste};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,_ as n,c as r,d as i,f as a,l as o,o as s,r as c,s as l,t as u,v as d}from"./charts-vendor-0VMaLVLN.js";import{$ as f,B as p,R as m,S as h,V as g,W as _,d as v,mt as y,nt as b,o as x,p as S,u as C}from"./DisclosureContext-LYzHroHO.js";import{p as ee}from"./plan-graph-vendor-B0sEms9Z.js";import{F as w,M as T,N as E,P as D,_ as O,b as k,h as A,i as j}from"./useRecentFiles-BrBl-AP1.js";import{D as M,S as N,yt as P}from"./index-CEM9bz_x.js";import{d as F,i as I,o as L,r as R,s as z,t as B}from"./Dashboard-Bo_1jGqH.js";import{r as V}from"./impact-sort-7z0ZcBZf.js";import{n as H,t as U}from"./finding-anchor-DF1cSHO1.js";import{t as W}from"./usePagedRows-BjPOpUU8.js";import{n as G,t as K}from"./useSortMode-CU0vzThu.js";import{t as q}from"./PlanExplorer-DdmPkKO1.js";var J=e(t(),1),Y=ee(),X=240,Z=524288e3,Q=10;function $(e){let t=e.spillBytes>Z,n=e.gcPct>Q;return t&&n?`critical`:t||n?`warning`:`info`}function te(e){return O[$(e)]}function ne({active:e,payload:t}){if(!e||!t?.length)return null;let n=t[0]?.payload;if(!n)return null;let r=$(n);return(0,Y.jsxs)(`div`,{className:`rounded-md border border-border bg-popover px-2 py-1.5 text-xs text-popover-foreground shadow-md`,children:[(0,Y.jsxs)(`p`,{children:[_(n.spillBytes),` spilled`]}),(0,Y.jsxs)(`p`,{children:[n.gcPct.toFixed(1),`% GC`]}),(0,Y.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 font-medium`,children:[(0,Y.jsx)(C,{impactBand:r}),r.toUpperCase()]})]})}function re({appModel:e}){let t=[];for(let n of e.stages.values()){let e=n.memoryBytesSpilled??0;e<=0||t.push({stageId:n.id,spillBytes:e,gcPct:n.gcPct??0,submittedAt:n.submittedAt??0})}if(t.length===0)return(0,Y.jsx)(F,{tone:`clean`,icon:P,title:`No stages spilled memory in this run.`});let f=z(t),p=[...f].sort((e,t)=>e.submittedAt-t.submittedAt).map(e=>({stage:`S${e.stageId}`,spillMB:e.spillBytes/1048576,gcPct:e.gcPct}));return(0,Y.jsxs)(T,{defaultValue:`scatter`,children:[(0,Y.jsxs)(D,{"aria-label":`Memory pressure view`,children:[(0,Y.jsx)(w,{value:`scatter`,children:`Scatter`}),(0,Y.jsx)(w,{value:`twin`,children:`Twin bars`})]}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Spill and GC pressure both stem from tight executor memory, see`,` `,(0,Y.jsx)(h,{anchor:`#memory-model`,children:`how Spark’s memory model works`}),`.`]}),(0,Y.jsxs)(E,{value:`scatter`,children:[(0,Y.jsxs)(`div`,{className:`mb-1 flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(C,{impactBand:`critical`}),`CRITICAL`]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(C,{impactBand:`warning`}),`WARNING`]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(C,{impactBand:`info`}),`INFO`]})]}),(0,Y.jsx)(k,{ariaLabel:`Memory pressure scatter: spilled memory versus GC percent, one point per stage that spilled.`,height:X,table:{caption:`Memory spilled and GC percent by stage`,columns:[`Stage`,`Memory spilled`,`GC %`],rows:f.map(e=>[`S${e.stageId}`,_(e.spillBytes),`${e.gcPct.toFixed(1)}%`]),align:[`left`,`right`,`right`]},children:(0,Y.jsxs)(c,{children:[(0,Y.jsx)(a,{stroke:O.muted,strokeOpacity:.2}),(0,Y.jsx)(l,{type:`number`,dataKey:`spillBytes`,name:`Memory spilled`,tickFormatter:e=>_(e),tick:{fontSize:10}}),(0,Y.jsx)(s,{type:`number`,dataKey:`gcPct`,name:`GC %`,tick:{fontSize:10},width:32}),(0,Y.jsx)(d,{cursor:{strokeDasharray:`3 3`},content:ne}),(0,Y.jsx)(r,{data:f,name:`Spill vs. GC`,children:f.map(e=>(0,Y.jsx)(n,{fill:te(e)},e.stageId))})]})})]}),(0,Y.jsx)(E,{value:`twin`,children:(0,Y.jsx)(k,{ariaLabel:`Memory pressure by stage: spilled memory and GC percent across stages in submission order.`,height:X,table:{caption:`Spilled memory and GC percent by stage, submission order`,columns:[`Stage`,`Spill (MB)`,`GC %`],rows:p.map(e=>[e.stage,e.spillMB.toFixed(1),`${e.gcPct.toFixed(1)}%`]),align:[`left`,`right`,`right`]},children:(0,Y.jsxs)(u,{data:p,children:[(0,Y.jsx)(a,{stroke:O.muted,strokeOpacity:.2}),(0,Y.jsx)(l,{dataKey:`stage`,tick:{fontSize:10}}),(0,Y.jsx)(s,{yAxisId:`left`,tick:{fontSize:10},width:36}),(0,Y.jsx)(s,{yAxisId:`right`,orientation:`right`,tick:{fontSize:10},width:36}),(0,Y.jsx)(d,{}),(0,Y.jsx)(o,{yAxisId:`left`,dataKey:`spillMB`,name:`Spill (MB)`,fill:O.critical}),(0,Y.jsx)(i,{yAxisId:`right`,dataKey:`gcPct`,name:`GC %`,stroke:O.info,dot:!1})]})})})]})}function ie(e,t){return e.stages.get(t)?.spillClassification??`unclassified`}function ae({finding:e,appModel:t}){let n=H([e]),r=y(),i=t.stages.get(e.stageId),a=ie(t,e.stageId),o=a===`volume`&&i?b(i):null,s=r===`advanced`&&j(e.stageId,t);return(0,Y.jsxs)(`div`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-2 ${U} transition-colors ${n.flashClassName}`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(C,{impactBand:e.impactBand}),(0,Y.jsx)(x,{label:p[a],impactBand:e.impactBand,title:g[a]}),(0,Y.jsx)(I,{stageId:e.stageId})]}),(0,Y.jsx)(S,{children:(0,Y.jsx)(A,{confidence:e.confidence,validationRequired:e.validationRequired})})]}),(0,Y.jsxs)(`p`,{className:`text-sm`,children:[`Memory spilled: `,(0,Y.jsx)(`strong`,{children:_(f(e))}),` · `,`Disk: `,_(i?.diskBytesSpilled??0)]}),(0,Y.jsx)(B,{finding:e}),o?(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Try: `,(0,Y.jsxs)(`code`,{children:[`spark.sql.shuffle.partitions = `,o.recommended]}),` (current ${o.current} tasks, target 128 MB per partition)`]}):null,e.recommendation?(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.recommendation}):null,s?(0,Y.jsx)(`div`,{className:`pt-1`,children:(0,Y.jsx)(q,{stageId:e.stageId,appModel:t})}):null]})}var oe=(0,J.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:r,setSortMode:i,orderBy:a}=K(),[o,s]=(0,J.useState)(!n),[c,l]=(0,J.useState)(0),{findings:u,sorted:d,orderedFindings:f}=(0,J.useMemo)(()=>{let e=t.filter(e=>e.type===`spill`&&e.stageId!=null),n=[...e].sort((e,t)=>(m[e.impactBand]??9)-(m[t.impactBand]??9)||(typeof t.value==`number`?t.value:0)-(typeof e.value==`number`?e.value:0));return{findings:e,sorted:n,orderedFindings:a(n,e=>[e],e=>e.stageId)}},[t,r]),p=M(),h=p?f.findIndex(e=>e===p.finding):null,{totalPages:g,effectivePage:y,visible:b}=W(f,c,l,h);if(u.length===0){let t=0;for(let n of e.stages.values())t=Math.max(t,n.memoryBytesSpilled??0);return(0,Y.jsx)(N,{title:`Spill: no issue detected (max ${_(t)} spilled)`,children:(0,Y.jsx)(F,{tone:`clean`,icon:P,title:`No stages spilled memory in this run.`})})}let x=d[0].impactBand;return(0,Y.jsx)(N,{title:`Spill`,impactBand:x,badges:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(v,{type:`spill`,impactBand:x}),V(u,d.length,o)?(0,Y.jsx)(G,{mode:r,onChange:i}):null]}),open:o,onOpenChange:s,summary:(0,Y.jsx)(L,{value:_(typeof d[0].value==`number`?d[0].value:0),context:`peak · ${d.length} stage${d.length===1?``:`s`}`}),children:(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsx)(re,{appModel:e}),b.map(t=>(0,Y.jsx)(ae,{finding:t,appModel:e},t.stageId)),(0,Y.jsx)(R,{page:y,totalPages:g,onPrev:()=>l(e=>e-1),onNext:()=>l(e=>e+1)})]})})});export{oe as Spill};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{R as n,at as r,d as i,u as a}from"./DisclosureContext-LYzHroHO.js";import{p as o}from"./plan-graph-vendor-B0sEms9Z.js";import{m as s}from"./useRecentFiles-BrBl-AP1.js";import{D as c,S as l}from"./index-CEM9bz_x.js";import{i as u,o as d,r as f,t as p}from"./Dashboard-Bo_1jGqH.js";import{r as m}from"./impact-sort-7z0ZcBZf.js";import{n as h}from"./finding-anchor-DF1cSHO1.js";import{t as g}from"./usePagedRows-BjPOpUU8.js";import{n as _,t as v}from"./useSortMode-CU0vzThu.js";var y=e(t(),1),b=o();function x(e){return e.stageId!=null}function S({finding:e}){let t=h([e]);return(0,b.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`flex flex-col gap-1 transition-colors ${t.flashClassName}`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(u,{stageId:e.stageId}),(0,b.jsx)(a,{impactBand:e.impactBand})]}),(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Stage attempt failed outright. Reason: `,(0,b.jsx)(`strong`,{children:e.valueText})]}),(0,b.jsx)(p,{finding:e}),e.recommendation?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.recommendation}):null]})}function C({appModel:e,catalog:t,defaultCollapsed:a=!0}){let[o,u]=(0,y.useState)(0),{sortMode:p,setSortMode:h,orderBy:C}=v(),[w,T]=(0,y.useState)(!a),E=c(),D=(0,y.useRef)(!1);(0,y.useEffect)(()=>{if(!D.current){D.current=!0;return}u(0)},[e]);let O=s(t,`stageFailed`).filter(x),k=C([...O].sort((e,t)=>n[e.impactBand]-n[t.impactBand]||e.stageId-t.stageId),e=>[e],e=>e.stageId),A=E?k.findIndex(e=>e===E.finding):null,{totalPages:j,effectivePage:M,visible:N}=g(k,o,u,A);return O.length===0?null:(0,b.jsxs)(l,{title:`Failed Stages`,impactBand:r(O),badges:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i,{type:`stageFailed`,impactBand:r(O)}),m(O,O.length,w)?(0,b.jsx)(_,{mode:p,onChange:e=>{h(e),u(0)}}):null]}),open:w,onOpenChange:T,summary:(0,b.jsx)(d,{value:O.length,context:`stage${O.length===1?``:`s`} failed outright`}),children:[(0,b.jsx)(`ul`,{className:`space-y-3`,children:N.map(e=>(0,b.jsx)(S,{finding:e},e.id))}),(0,b.jsx)(f,{page:M,totalPages:j,onPrev:()=>u(e=>e-1),onNext:()=>u(e=>e+1)})]})}export{C as StageFailed};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{K as n,R as r,at as i,d as a,lt as o,mt as s,p as c,u as l,ut as u}from"./DisclosureContext-LYzHroHO.js";import{p as d}from"./plan-graph-vendor-B0sEms9Z.js";import{h as f,i as p,m}from"./useRecentFiles-BrBl-AP1.js";import{D as h,S as g}from"./index-CEM9bz_x.js";import{c as _,n as v,o as y,r as b,t as x}from"./Dashboard-Bo_1jGqH.js";import{r as S}from"./impact-sort-7z0ZcBZf.js";import{n as C,t as w}from"./finding-anchor-DF1cSHO1.js";import{t as T}from"./usePagedRows-BjPOpUU8.js";import{n as E,t as D}from"./useSortMode-CU0vzThu.js";import{t as O}from"./StageHeader-BSV8ALhT.js";import{t as k}from"./PlanExplorer-DdmPkKO1.js";var A=e(t(),1),j=d();function M({expanded:e,onClick:t,label:n,location:r,controlsId:i}){let a=r?` for ${r}`:``;return(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":e,"aria-controls":i,"aria-label":`${e?`Hide`:`Show`} ${n.toLowerCase()}${a}`,onClick:t,className:`tap-target-comfortable tap-target-comfortable--sm flex w-fit cursor-pointer items-center gap-1 text-xs font-medium text-primary underline underline-offset-2`,children:[n,e?(0,j.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}):(0,j.jsx)(u,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]})}function N(e){let[t,n]=(0,A.useState)(!1),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(!1),[s,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(!1);return{expanded:t,data:r,loading:a,error:s,toggle:()=>{let r=!t;n(r),r&&e&&!l&&!a&&(o(!0),e().then(e=>i(e)).catch(()=>c(!0)).finally(()=>{u(!0),o(!1)}))}}}function P({group:e,appModel:t,getTaskData:r,idPrefix:i,findingLabel:a}){let{exportMode:o,getTaskData:u}=_(r),{expanded:d,data:m,error:h,toggle:g}=N(u?()=>u(e.stageId):void 0),y=C(e.findings),b=t.stages.get(e.stageId),S=s()===`advanced`&&p(e.stageId,t),T=`${i}-stage-${e.stageId}-detail`;return(0,j.jsxs)(`div`,{ref:y.ref,tabIndex:y.tabIndex,"data-flashed":y.dataFlashed,className:`space-y-2 ${w} transition-colors ${y.flashClassName}`,children:[(0,j.jsx)(O,{stageId:e.stageId,appModel:t}),(0,j.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.findings.map((e,t)=>(0,j.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,j.jsx)(l,{impactBand:e.impactBand}),(0,j.jsx)(`span`,{children:a(e)}),(0,j.jsx)(x,{finding:e}),(0,j.jsx)(c,{children:(0,j.jsx)(f,{confidence:e.confidence,validationRequired:e.validationRequired})})]},t))}),b?.taskDurationP50==null?null:(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`P50 `,n(b.taskDurationP50),` · P95 `,n(b.taskDurationP95),` · Max`,` `,n(b.taskDurationMax)]}),e.slowHost?(0,j.jsxs)(`p`,{className:`flex items-start gap-2 text-xs`,children:[(0,j.jsx)(l,{impactBand:e.slowHost.impactBand,className:`mt-1`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Slow host:`}),` `,e.slowHost.host,` (`,e.slowHost.value,`× median,`,` `,Math.round((e.slowHost.hostTaskShare??0)*100),`% of tasks)`]})]}):null,e.straggler?(0,j.jsxs)(`p`,{className:`flex items-start gap-2 text-xs`,children:[(0,j.jsx)(l,{impactBand:e.straggler.impactBand,className:`mt-1`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Stragglers:`}),` `,(e.straggler.speculativeTasks??0)>0?`${e.straggler.speculativeTasks} speculative task${e.straggler.speculativeTasks===1?``:`s`}`:`${e.straggler.value}% of tasks > 4× P50`]})]}):null,(0,j.jsx)(M,{expanded:d,onClick:g,label:`Task detail`,location:`Stage ${e.stageId}`,controlsId:T}),d?(0,j.jsxs)(`div`,{id:T,className:`space-y-3 pt-1`,children:[m?(0,j.jsx)(v,{metrics:m.metrics,fieldNames:m.fieldNames,markers:{p50:b?.taskDurationP50,p95:b?.taskDurationP95}}):o?(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Task data isn’t included in exported reports.`}):h?(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Task data unavailable for this stage.`}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading task data…`}),S?(0,j.jsx)(k,{stageId:e.stageId,appModel:t}):null]}):null]})}var F=(0,A.memo)(function({appModel:e,catalog:t,getTaskData:n,defaultCollapsed:o=!0,type:s,title:c,idPrefix:l,findingLabel:u}){let[d,f]=(0,A.useState)(0),{sortMode:p,setSortMode:_,orderBy:v}=D(),[x,C]=(0,A.useState)(!o),{relevant:w,stageGroups:O,orderedGroups:k}=(0,A.useMemo)(()=>{let e=t.filter(e=>e.type===s),n=new Map;for(let t of e)t.stageId!=null&&(n.has(t.stageId)||n.set(t.stageId,[]),n.get(t.stageId).push(t));let a=[...n.entries()].map(([e,n])=>({stageId:e,findings:n,impactBand:i(n)??`info`,slowHost:m(t,`slowHost`).find(t=>t.stageId===e),straggler:m(t,`straggler`).find(t=>t.stageId===e)})).sort((e,t)=>r[e.impactBand]-r[t.impactBand]||e.stageId-t.stageId);return{relevant:e,stageGroups:a,orderedGroups:v(a,e=>e.findings,e=>e.stageId)}},[t,p,s]),M=h(),N=M?k.findIndex(e=>e.findings.some(e=>e===M.finding)):null,{totalPages:F,effectivePage:I,visible:L}=T(k,d,f,N);if(w.length===0)return null;let R=i(w);return(0,j.jsxs)(g,{title:c,impactBand:R,badges:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{type:s,impactBand:R??`info`}),S(w,O.length,x)?(0,j.jsx)(E,{mode:p,onChange:_}):null]}),open:x,onOpenChange:C,summary:(0,j.jsx)(y,{value:`${O.length} stage${O.length===1?``:`s`}`,context:`${w.length} finding${w.length===1?``:`s`} flagged`}),children:[(0,j.jsx)(`div`,{className:`space-y-3`,children:L.map(t=>(0,j.jsx)(P,{group:t,appModel:e,getTaskData:n,idPrefix:l,findingLabel:u},t.stageId))}),(0,j.jsx)(b,{page:I,totalPages:F,onPrev:()=>f(e=>e-1),onNext:()=>f(e=>e+1)})]})});export{F as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{p as n}from"./plan-graph-vendor-B0sEms9Z.js";import{t as r}from"./StageFindingGroup-Bzm2TY03.js";var i=e(t(),1),a=n(),o={lowParallelism:`Low parallelism`,dataExplosion:`Data explosion`,taskStageSkew:`Task/stage skew`};function s(e){return`${e.type===`stageShape`?o[e.rule]:`stage shape`}: ${e.value}`}var c=(0,i.memo)(function(e){return(0,a.jsx)(r,{...e,type:`stageShape`,title:`Stage Shape`,idPrefix:`stage-shape`,findingLabel:s})});export{c as StageShape};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{R as n,d as r,u as i}from"./DisclosureContext-LYzHroHO.js";import{p as a}from"./plan-graph-vendor-B0sEms9Z.js";import{D as o,S as s}from"./index-CEM9bz_x.js";import{o as c,r as l,t as u}from"./Dashboard-Bo_1jGqH.js";import{r as d}from"./impact-sort-7z0ZcBZf.js";import{n as f}from"./finding-anchor-DF1cSHO1.js";import{t as p}from"./usePagedRows-BjPOpUU8.js";import{n as m,t as h}from"./useSortMode-CU0vzThu.js";import{t as g}from"./StageHeader-BSV8ALhT.js";var _=e(t(),1),v=a();function y(e){return`${e.value}m stage duration`}function b({finding:e,appModel:t}){let n=f([e]);return(0,v.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(i,{impactBand:e.impactBand}),e.stageId==null?null:(0,v.jsx)(g,{stageId:e.stageId,appModel:t}),(0,v.jsx)(`strong`,{children:y(e)})]}),(0,v.jsx)(u,{finding:e}),(0,v.jsx)(`p`,{className:`text-muted-foreground pt-1`,children:e.recommendation})]})}var x=(0,_.memo)(function({appModel:e,catalog:t,defaultCollapsed:i=!0}){let{sortMode:a,setSortMode:u,orderBy:f}=h(),[g,x]=(0,_.useState)(!i),[S,C]=(0,_.useState)(0),w=t.filter(e=>e.type===`stageSlowness`).slice().sort((e,t)=>n[e.impactBand]-n[t.impactBand]),T=f(w,e=>[e],e=>e.stageId??null),E=o(),D=E?T.findIndex(e=>e===E.finding):null,{totalPages:O,effectivePage:k,visible:A}=p(T,S,C,D);return w.length===0?null:(0,v.jsxs)(s,{title:`Slow Stage`,impactBand:w[0].impactBand,badges:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(r,{type:`stageSlowness`,impactBand:w[0].impactBand}),d(w,w.length,g)?(0,v.jsx)(m,{mode:a,onChange:u}):null]}),open:g,onOpenChange:x,summary:(0,v.jsx)(c,{value:y(w[0]),context:`${w.length} issue${w.length===1?``:`s`} flagged`}),children:[(0,v.jsx)(`ul`,{className:`space-y-2`,children:A.map(t=>(0,v.jsx)(b,{finding:t,appModel:e},t.id))}),(0,v.jsx)(l,{page:k,totalPages:O,onPrev:()=>C(e=>e-1),onNext:()=>C(e=>e+1)})]})});export{x as StageSlowness};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,J as r,R as i,d as a,p as o,u as s}from"./DisclosureContext-LYzHroHO.js";import{p as c}from"./plan-graph-vendor-B0sEms9Z.js";import{h as l,m as u}from"./useRecentFiles-BrBl-AP1.js";import{D as d,S as f}from"./index-CEM9bz_x.js";import{o as p,r as m,t as h}from"./Dashboard-Bo_1jGqH.js";import{r as g}from"./impact-sort-7z0ZcBZf.js";import{n as _}from"./finding-anchor-DF1cSHO1.js";import{t as v}from"./usePagedRows-BjPOpUU8.js";import{n as y,t as b}from"./useSortMode-CU0vzThu.js";import{t as x}from"./StageHeader-BSV8ALhT.js";var S=e(t(),1),C=c();function w(e){let t=n(e);return e.unit===`count`?`${t} speculative attempt${t===1?``:`s`} discarded`:`${r(`pct`,t)} of tasks straggled`}function T(e){let t=w(e),n=e.recommendation??``,r=n.startsWith(t)?n.slice(t.length):` ${n}`,i=r.indexOf(`; `);return i===-1?{primary:r,extended:null}:{primary:r.slice(0,i),extended:r.slice(i+2)}}function E({finding:e,appModel:t}){let n=_([e]),{primary:r,extended:i}=T(e);return(0,C.jsxs)(`li`,{ref:n.ref,tabIndex:n.tabIndex,"data-flashed":n.dataFlashed,className:`space-y-1 text-sm transition-colors ${n.flashClassName}`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,C.jsx)(s,{impactBand:e.impactBand}),e.stageId==null?null:(0,C.jsx)(x,{stageId:e.stageId,appModel:t})]}),(0,C.jsx)(o,{children:(0,C.jsx)(l,{confidence:e.confidence,validationRequired:e.validationRequired})})]}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[w(e),r,i==null?null:(0,C.jsx)(o,{children:`; ${i}`})]}),(0,C.jsx)(h,{finding:e})]})}var D=(0,S.memo)(function({appModel:e,catalog:t,defaultCollapsed:n=!0}){let{sortMode:r,setSortMode:o,orderBy:s}=b(),[c,l]=(0,S.useState)(!n),[h,_]=(0,S.useState)(0),x=u(t,`straggler`).slice().sort((e,t)=>i[e.impactBand]-i[t.impactBand]),T=s(x,e=>[e],e=>e.stageId??null),D=d(),O=D?T.findIndex(e=>e===D.finding):null,{totalPages:k,effectivePage:A,visible:j}=v(T,h,_,O);return x.length===0?null:(0,C.jsxs)(f,{title:`Stragglers`,impactBand:x[0].impactBand,badges:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(a,{type:`straggler`,impactBand:x[0].impactBand}),g(x,x.length,c)?(0,C.jsx)(y,{mode:r,onChange:o}):null]}),open:c,onOpenChange:l,summary:(0,C.jsx)(p,{value:w(x[0]),context:`${x.length} issue${x.length===1?``:`s`} flagged`}),children:[(0,C.jsx)(`ul`,{className:`space-y-2`,children:j.map(t=>(0,C.jsx)(E,{finding:t,appModel:e},t.id))}),(0,C.jsx)(m,{page:A,totalPages:k,onPrev:()=>_(e=>e-1),onNext:()=>_(e=>e+1)})]})});export{D as Straggler};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{$ as n,J as r,R as i,at as a,d as o,u as s}from"./DisclosureContext-LYzHroHO.js";import{p as c}from"./plan-graph-vendor-B0sEms9Z.js";import{m as l}from"./useRecentFiles-BrBl-AP1.js";import{$ as u,D as d,S as f}from"./index-CEM9bz_x.js";import{i as p,o as m,r as h,t as g}from"./Dashboard-Bo_1jGqH.js";import{r as _}from"./impact-sort-7z0ZcBZf.js";import{n as v}from"./finding-anchor-DF1cSHO1.js";import{t as y}from"./usePagedRows-BjPOpUU8.js";import{n as b,t as x}from"./useSortMode-CU0vzThu.js";var S=e(t(),1),C=c();function w(e){return e.stageId!=null}function T({groups:e,otherFailedTasks:t}){return e.length===0?null:(0,C.jsxs)(`ul`,{className:`space-y-2`,"aria-label":`Distinct failures`,children:[e.map((e,t)=>(0,C.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` task`,e.count===1?``:`s`,`: `,(0,C.jsx)(`strong`,{className:`break-words`,children:u(e)})]}),e.stackExcerpt?(0,C.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-md bg-muted p-2 text-xs whitespace-pre`,children:e.stackExcerpt}):null]},t)),t>0?(0,C.jsxs)(`li`,{className:`text-xs text-muted-foreground`,children:[t,` more failed task`,t===1?``:`s`,` not shown`]}):null]})}function E({finding:e}){let t=v([e]),n=e.dominantError??e.dominantReason;return(0,C.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`flex flex-col gap-1 transition-colors ${t.flashClassName}`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(p,{stageId:e.stageId}),(0,C.jsx)(s,{impactBand:e.impactBand})]}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Failure rate: `,(0,C.jsxs)(`strong`,{children:[e.value,`%`]}),` (`,e.failedTasks,` tasks) · Dominant error: `,(0,C.jsx)(`strong`,{className:`break-words`,children:n??`—`})]}),(0,C.jsx)(T,{groups:e.failureGroups,otherFailedTasks:e.otherFailedTasks}),(0,C.jsx)(g,{finding:e}),e.recommendation?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.recommendation}):null]})}function D({appModel:e,catalog:t,defaultCollapsed:s=!0}){let[c,u]=(0,S.useState)(0),{sortMode:p,setSortMode:g,orderBy:v}=x(),[T,D]=(0,S.useState)(!s),O=d(),k=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(!k.current){k.current=!0;return}u(0)},[e]);let A=l(t,`failures`).filter(w),j=[...A].sort((e,t)=>i[e.impactBand]-i[t.impactBand]||e.stageId-t.stageId),M=v(j,e=>[e],e=>e.stageId),N=O?M.findIndex(e=>e===O.finding):null,{totalPages:P,effectivePage:F,visible:I}=y(M,c,u,N);return A.length===0?null:(0,C.jsxs)(f,{title:`Failed Tasks`,impactBand:a(A),badges:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o,{type:`failures`,impactBand:a(A)}),_(A,A.length,T)?(0,C.jsx)(b,{mode:p,onChange:e=>{g(e),u(0)}}):null]}),open:T,onOpenChange:D,summary:(0,C.jsx)(m,{value:r(`pct`,n(j[0])),context:`${A.length} item${A.length===1?``:`s`} flagged`}),children:[(0,C.jsx)(`ul`,{className:`space-y-3`,children:I.map(e=>(0,C.jsx)(E,{finding:e},e.id))}),(0,C.jsx)(h,{page:F,totalPages:P,onPrev:()=>u(e=>e-1),onNext:()=>u(e=>e+1)})]})}export{D as TaskFailures};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{R as n,at as r,d as i,p as a}from"./DisclosureContext-LYzHroHO.js";import{p as o}from"./plan-graph-vendor-B0sEms9Z.js";import{h as s,m as c}from"./useRecentFiles-BrBl-AP1.js";import{D as l,S as u,x as d}from"./index-CEM9bz_x.js";import{a as f,o as p,r as m,t as h}from"./Dashboard-Bo_1jGqH.js";import{i as g,r as _}from"./impact-sort-7z0ZcBZf.js";import{n as v,t as y}from"./finding-anchor-DF1cSHO1.js";import{t as b}from"./usePagedRows-BjPOpUU8.js";import{n as x,t as S}from"./useSortMode-CU0vzThu.js";var C=e(t(),1),w=o();function T({finding:e}){let t=v([e]);return(0,w.jsxs)(`li`,{ref:t.ref,tabIndex:t.tabIndex,"data-flashed":t.dataFlashed,className:`space-y-2 ${y} transition-colors ${t.flashClassName}`,children:[e.stageIds.length>0?(0,w.jsx)(f,{pills:e.stageIds.map(e=>({id:e}))}):null,(0,w.jsxs)(`p`,{children:[e.recommendation,` `,(0,w.jsx)(h,{finding:e})]})]})}var E=(0,C.memo)(function({catalog:e,defaultCollapsed:t=!0}){let{sortMode:o,setSortMode:f,orderBy:h}=S(),[v,y]=(0,C.useState)(!t),[E,D]=(0,C.useState)(0),{findings:O,pills:k}=(0,C.useMemo)(()=>{let t=c(e,`underBroadcast`).sort((e,t)=>n[e.impactBand]-n[t.impactBand]);return{findings:t,pills:[...new Set(t.flatMap(e=>e.stageIds))].map(e=>({id:e}))}},[e]),A=h(O,e=>[e],g),j=l(),M=j?A.findIndex(e=>e===j.finding):null,{totalPages:N,effectivePage:P,visible:F}=b(A,E,D,M);return O.length===0?null:(0,w.jsxs)(u,{title:`Missed Broadcast Join`,impactBand:r(O),open:v,onOpenChange:y,badges:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(i,{type:`underBroadcast`,impactBand:r(O)??`info`,className:d}),_(O,O.length,v)?(0,w.jsx)(x,{mode:o,onChange:f}):null]}),statusBadge:(0,w.jsx)(a,{children:(0,w.jsx)(s,{confidence:O[0].confidence,validationRequired:O[0].validationRequired,evidenceKey:`sqlPlan`})}),summary:(0,w.jsx)(p,{value:`${k.length} stage${k.length===1?``:`s`}`,context:`${O.length} finding${O.length===1?``:`s`} flagged`}),children:[(0,w.jsx)(`ul`,{className:`space-y-3 text-sm`,children:F.map(e=>(0,w.jsx)(T,{finding:e},e.id))}),(0,w.jsx)(m,{page:P,totalPages:N,onPrev:()=>D(e=>e-1),onNext:()=>D(e=>e+1)})]})});export{E as UnderBroadcast};