sparkforensics-cli 0.1.0 → 0.2.2

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 (361) hide show
  1. package/README.md +6 -0
  2. package/bin/sparkforensics-analyze.mjs +113 -48
  3. package/export-template/docs/404.html +25 -0
  4. package/export-template/docs/assets/app.DQTZyGL1.js +1 -0
  5. package/export-template/docs/assets/aqe-loop.IwQSATHw.svg +1 -0
  6. package/export-template/docs/assets/aqe-loop.dark.DGbaxqJE.svg +1 -0
  7. package/export-template/docs/assets/broadcast-vs-shuffle.Db4WY1XK.svg +1 -0
  8. package/export-template/docs/assets/broadcast-vs-shuffle.dark.C7Bxs0mG.svg +1 -0
  9. package/export-template/docs/assets/cache-lifecycle.dark.B-hS7AgU.svg +1 -0
  10. package/export-template/docs/assets/cache-lifecycle.rEOVYQNU.svg +1 -0
  11. package/export-template/docs/assets/chunks/@localSearchIndexroot.DppnXnDE.js +1 -0
  12. package/export-template/docs/assets/chunks/VPLocalSearchBox.BkBIPFs6.js +9 -0
  13. package/export-template/docs/assets/chunks/duplicate-plan-subtree.dark.Cdp70QhV.js +1 -0
  14. package/export-template/docs/assets/chunks/framework.DSg0KOwT.js +20 -0
  15. package/export-template/docs/assets/chunks/retry-escalation-ladder.dark.DHipdJgZ.js +1 -0
  16. package/export-template/docs/assets/chunks/theme.DP0u1AUq.js +2 -0
  17. package/export-template/docs/assets/cold-start-timeline.DxC_Sc7w.svg +1 -0
  18. package/export-template/docs/assets/cold-start-timeline.dark.CZ17YcAG.svg +1 -0
  19. package/export-template/docs/assets/columnar-layout.PghGeOEA.svg +1 -0
  20. package/export-template/docs/assets/columnar-layout.dark.BVNlz0ff.svg +1 -0
  21. package/export-template/docs/assets/container-memory.DIO0AnIm.svg +1 -0
  22. package/export-template/docs/assets/container-memory.dark.CP-5zuCl.svg +1 -0
  23. package/export-template/docs/assets/contributor-guide_architecture_board-widgets.md.CWpj01WU.js +1 -0
  24. package/export-template/docs/assets/contributor-guide_architecture_board-widgets.md.CWpj01WU.lean.js +1 -0
  25. package/export-template/docs/assets/contributor-guide_architecture_detector-contract.md.CgzUsQ6W.js +1 -0
  26. package/export-template/docs/assets/contributor-guide_architecture_detector-contract.md.CgzUsQ6W.lean.js +1 -0
  27. package/export-template/docs/assets/contributor-guide_architecture_drill-down.md.BtPdlM7r.js +1 -0
  28. package/export-template/docs/assets/contributor-guide_architecture_drill-down.md.BtPdlM7r.lean.js +1 -0
  29. package/export-template/docs/assets/contributor-guide_architecture_impact-estimation.md.CooslVJt.js +1 -0
  30. package/export-template/docs/assets/contributor-guide_architecture_impact-estimation.md.CooslVJt.lean.js +1 -0
  31. package/export-template/docs/assets/contributor-guide_architecture_index.md.3TO9ic6w.js +1 -0
  32. package/export-template/docs/assets/contributor-guide_architecture_index.md.3TO9ic6w.lean.js +1 -0
  33. package/export-template/docs/assets/contributor-guide_architecture_overview.md.CehiRmGn.js +1 -0
  34. package/export-template/docs/assets/contributor-guide_architecture_overview.md.CehiRmGn.lean.js +1 -0
  35. package/export-template/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.js +1 -0
  36. package/export-template/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.lean.js +1 -0
  37. package/export-template/docs/assets/contributor-guide_architecture_widget-rendering.md.R27gQrgY.js +1 -0
  38. package/export-template/docs/assets/contributor-guide_architecture_widget-rendering.md.R27gQrgY.lean.js +1 -0
  39. package/export-template/docs/assets/contributor-guide_architecture_worker-protocol.md.IbnfNrV3.js +6 -0
  40. package/export-template/docs/assets/contributor-guide_architecture_worker-protocol.md.IbnfNrV3.lean.js +1 -0
  41. package/export-template/docs/assets/contributor-guide_contributing.md.CvRsdr6J.js +1 -0
  42. package/export-template/docs/assets/contributor-guide_contributing.md.CvRsdr6J.lean.js +1 -0
  43. package/export-template/docs/assets/contributor-guide_development-setup.md.DvAN_9mK.js +12 -0
  44. package/export-template/docs/assets/contributor-guide_development-setup.md.DvAN_9mK.lean.js +1 -0
  45. package/export-template/docs/assets/contributor-guide_testing.md.6rIKqSyY.js +1 -0
  46. package/export-template/docs/assets/contributor-guide_testing.md.6rIKqSyY.lean.js +1 -0
  47. package/export-template/docs/assets/dag-stages.DSz_S937.svg +1 -0
  48. package/export-template/docs/assets/dag-stages.dark.F72UzxH4.svg +1 -0
  49. package/export-template/docs/assets/driver-executor.D5pQ7YN1.svg +1 -0
  50. package/export-template/docs/assets/driver-executor.dark.BmX9cPvh.svg +1 -0
  51. package/export-template/docs/assets/duplicate-plan-subtree.B4cvN6fj.svg +1 -0
  52. package/export-template/docs/assets/duplicate-plan-subtree.dark.Dw8wS0Ag.svg +1 -0
  53. package/export-template/docs/assets/index.md.CHJVslga.js +1 -0
  54. package/export-template/docs/assets/index.md.CHJVslga.lean.js +1 -0
  55. package/export-template/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  56. package/export-template/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  57. package/export-template/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  58. package/export-template/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  59. package/export-template/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  60. package/export-template/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  61. package/export-template/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  62. package/export-template/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  63. package/export-template/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  64. package/export-template/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  65. package/export-template/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  66. package/export-template/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  67. package/export-template/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  68. package/export-template/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  69. package/export-template/docs/assets/join-strategy.C_FvrCEo.svg +1 -0
  70. package/export-template/docs/assets/join-strategy.dark.ChMLnNII.svg +1 -0
  71. package/export-template/docs/assets/memory-borrowing.BqQRJg0u.svg +1 -0
  72. package/export-template/docs/assets/memory-borrowing.dark.Yhh20O9C.svg +1 -0
  73. package/export-template/docs/assets/memory-regions.XHvO7jHG.svg +1 -0
  74. package/export-template/docs/assets/memory-regions.dark.D4TP9_08.svg +1 -0
  75. package/export-template/docs/assets/repartition-vs-coalesce.BovLRrpj.svg +1 -0
  76. package/export-template/docs/assets/repartition-vs-coalesce.dark.BhAczKZQ.svg +1 -0
  77. package/export-template/docs/assets/retry-escalation-ladder.DyTKJJmZ.svg +1 -0
  78. package/export-template/docs/assets/retry-escalation-ladder.dark.BdsabtU3.svg +1 -0
  79. package/export-template/docs/assets/shuffle-map-reduce.KuOEZVmg.svg +1 -0
  80. package/export-template/docs/assets/shuffle-map-reduce.dark.BgQZnFSb.svg +1 -0
  81. package/export-template/docs/assets/spill-classification.BU2euYDO.svg +1 -0
  82. package/export-template/docs/assets/spill-classification.dark.D7i1M40d.svg +1 -0
  83. package/export-template/docs/assets/style.DSixAiZE.css +1 -0
  84. package/export-template/docs/assets/tuning-reference_anti-patterns.md.Df1YMIHu.js +1 -0
  85. package/export-template/docs/assets/tuning-reference_anti-patterns.md.Df1YMIHu.lean.js +1 -0
  86. package/export-template/docs/assets/tuning-reference_aqe.md.BIsCtLzm.js +1 -0
  87. package/export-template/docs/assets/tuning-reference_aqe.md.BIsCtLzm.lean.js +1 -0
  88. package/export-template/docs/assets/tuning-reference_bottleneck-broadcast-sizing.md.CEstB3Ia.js +1 -0
  89. package/export-template/docs/assets/tuning-reference_bottleneck-broadcast-sizing.md.CEstB3Ia.lean.js +1 -0
  90. package/export-template/docs/assets/tuning-reference_bottleneck-cold-start.md.CEuy-72y.js +7 -0
  91. package/export-template/docs/assets/tuning-reference_bottleneck-cold-start.md.CEuy-72y.lean.js +1 -0
  92. package/export-template/docs/assets/tuning-reference_bottleneck-duplicate-plan-subtree.md.CIohQDfn.js +1 -0
  93. package/export-template/docs/assets/tuning-reference_bottleneck-duplicate-plan-subtree.md.CIohQDfn.lean.js +1 -0
  94. package/export-template/docs/assets/tuning-reference_bottleneck-failures.md.4z5BXGJ2.js +6 -0
  95. package/export-template/docs/assets/tuning-reference_bottleneck-failures.md.4z5BXGJ2.lean.js +1 -0
  96. package/export-template/docs/assets/tuning-reference_bottleneck-gc.md.DSxzZRK7.js +6 -0
  97. package/export-template/docs/assets/tuning-reference_bottleneck-gc.md.DSxzZRK7.lean.js +1 -0
  98. package/export-template/docs/assets/tuning-reference_bottleneck-job-failure-rate.md.BaJl__1W.js +8 -0
  99. package/export-template/docs/assets/tuning-reference_bottleneck-job-failure-rate.md.BaJl__1W.lean.js +1 -0
  100. package/export-template/docs/assets/tuning-reference_bottleneck-memory-utilization.md.DbP-SJZc.js +7 -0
  101. package/export-template/docs/assets/tuning-reference_bottleneck-memory-utilization.md.DbP-SJZc.lean.js +1 -0
  102. package/export-template/docs/assets/tuning-reference_bottleneck-retry-waste.md.D5JMjVOt.js +1 -0
  103. package/export-template/docs/assets/tuning-reference_bottleneck-retry-waste.md.D5JMjVOt.lean.js +1 -0
  104. package/export-template/docs/assets/tuning-reference_bottleneck-shuffle.md.CM-nTmIH.js +12 -0
  105. package/export-template/docs/assets/tuning-reference_bottleneck-shuffle.md.CM-nTmIH.lean.js +1 -0
  106. package/export-template/docs/assets/tuning-reference_bottleneck-skew.md.BdUwiDhn.js +14 -0
  107. package/export-template/docs/assets/tuning-reference_bottleneck-skew.md.BdUwiDhn.lean.js +1 -0
  108. package/export-template/docs/assets/tuning-reference_bottleneck-slow-host.md.BlIo6UDW.js +7 -0
  109. package/export-template/docs/assets/tuning-reference_bottleneck-slow-host.md.BlIo6UDW.lean.js +1 -0
  110. package/export-template/docs/assets/tuning-reference_bottleneck-small-files.md.B8kloyx8.js +5 -0
  111. package/export-template/docs/assets/tuning-reference_bottleneck-small-files.md.B8kloyx8.lean.js +1 -0
  112. package/export-template/docs/assets/tuning-reference_bottleneck-spill.md.PNH7mITt.js +6 -0
  113. package/export-template/docs/assets/tuning-reference_bottleneck-spill.md.PNH7mITt.lean.js +1 -0
  114. package/export-template/docs/assets/tuning-reference_bottleneck-straggler.md.DY36fHN5.js +7 -0
  115. package/export-template/docs/assets/tuning-reference_bottleneck-straggler.md.DY36fHN5.lean.js +1 -0
  116. package/export-template/docs/assets/tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.js +8 -0
  117. package/export-template/docs/assets/tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.lean.js +1 -0
  118. package/export-template/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.js +5 -0
  119. package/export-template/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.lean.js +1 -0
  120. package/export-template/docs/assets/tuning-reference_caching.md.B7aQ8asB.js +1 -0
  121. package/export-template/docs/assets/tuning-reference_caching.md.B7aQ8asB.lean.js +1 -0
  122. package/export-template/docs/assets/tuning-reference_cluster-config.md.ZVmDGsQ3.js +1 -0
  123. package/export-template/docs/assets/tuning-reference_cluster-config.md.ZVmDGsQ3.lean.js +1 -0
  124. package/export-template/docs/assets/tuning-reference_config.md.UvveiWG3.js +1 -0
  125. package/export-template/docs/assets/tuning-reference_config.md.UvveiWG3.lean.js +1 -0
  126. package/export-template/docs/assets/tuning-reference_data-formats.md.bjCAWH3N.js +1 -0
  127. package/export-template/docs/assets/tuning-reference_data-formats.md.bjCAWH3N.lean.js +1 -0
  128. package/export-template/docs/assets/tuning-reference_index.md.BQ_NooMV.js +1 -0
  129. package/export-template/docs/assets/tuning-reference_index.md.BQ_NooMV.lean.js +1 -0
  130. package/export-template/docs/assets/tuning-reference_intro.md.CobD-lGB.js +1 -0
  131. package/export-template/docs/assets/tuning-reference_intro.md.CobD-lGB.lean.js +1 -0
  132. package/export-template/docs/assets/tuning-reference_joins.md.BtKs_CuW.js +1 -0
  133. package/export-template/docs/assets/tuning-reference_joins.md.BtKs_CuW.lean.js +1 -0
  134. package/export-template/docs/assets/tuning-reference_memory-model.md.DhT-n4y3.js +1 -0
  135. package/export-template/docs/assets/tuning-reference_memory-model.md.DhT-n4y3.lean.js +1 -0
  136. package/export-template/docs/assets/tuning-reference_metrics.md.mLOh7Apj.js +1 -0
  137. package/export-template/docs/assets/tuning-reference_metrics.md.mLOh7Apj.lean.js +1 -0
  138. package/export-template/docs/assets/tuning-reference_partitioning.md.q0zKF_8X.js +1 -0
  139. package/export-template/docs/assets/tuning-reference_partitioning.md.q0zKF_8X.lean.js +1 -0
  140. package/export-template/docs/assets/tuning-reference_pyspark.md.DDCfvN9t.js +6 -0
  141. package/export-template/docs/assets/tuning-reference_pyspark.md.DDCfvN9t.lean.js +1 -0
  142. package/export-template/docs/assets/tuning-reference_shuffle.md.BZZ7R4Ix.js +1 -0
  143. package/export-template/docs/assets/tuning-reference_shuffle.md.BZZ7R4Ix.lean.js +1 -0
  144. package/export-template/docs/assets/tuning-reference_spark-architecture.md.Dwzm5avO.js +1 -0
  145. package/export-template/docs/assets/tuning-reference_spark-architecture.md.Dwzm5avO.lean.js +1 -0
  146. package/export-template/docs/assets/tuning-reference_table-formats.md.D6wj-2dX.js +1 -0
  147. package/export-template/docs/assets/tuning-reference_table-formats.md.D6wj-2dX.lean.js +1 -0
  148. package/export-template/docs/assets/udf-execution-models.BUFDICuG.svg +1 -0
  149. package/export-template/docs/assets/udf-execution-models.dark.YTNS6GDq.svg +1 -0
  150. package/export-template/docs/assets/user-guide_alternative-log-retrieval.md.B4tPGIal.js +1 -0
  151. package/export-template/docs/assets/user-guide_alternative-log-retrieval.md.B4tPGIal.lean.js +1 -0
  152. package/export-template/docs/assets/user-guide_getting-started.md.BJvwLEIM.js +3 -0
  153. package/export-template/docs/assets/user-guide_getting-started.md.BJvwLEIM.lean.js +1 -0
  154. package/export-template/docs/assets/user-guide_mcp-tools.md.Vi3RoflJ.js +125 -0
  155. package/export-template/docs/assets/user-guide_mcp-tools.md.Vi3RoflJ.lean.js +1 -0
  156. package/export-template/docs/assets/user-guide_run-comparison.md.CQc1aoU8.js +1 -0
  157. package/export-template/docs/assets/user-guide_run-comparison.md.CQc1aoU8.lean.js +1 -0
  158. package/export-template/docs/assets/user-guide_understanding-findings.md.DL1UDhvR.js +1 -0
  159. package/export-template/docs/assets/user-guide_understanding-findings.md.DL1UDhvR.lean.js +1 -0
  160. package/export-template/docs/contributor-guide/architecture/board-widgets.html +25 -0
  161. package/export-template/docs/contributor-guide/architecture/detector-contract.html +25 -0
  162. package/export-template/docs/contributor-guide/architecture/drill-down.html +25 -0
  163. package/export-template/docs/contributor-guide/architecture/impact-estimation.html +25 -0
  164. package/export-template/docs/contributor-guide/architecture/index.html +25 -0
  165. package/export-template/docs/contributor-guide/architecture/overview.html +25 -0
  166. package/export-template/docs/contributor-guide/architecture/state-and-history.html +25 -0
  167. package/export-template/docs/contributor-guide/architecture/widget-rendering.html +25 -0
  168. package/export-template/docs/contributor-guide/architecture/worker-protocol.html +30 -0
  169. package/export-template/docs/contributor-guide/contributing.html +25 -0
  170. package/export-template/docs/contributor-guide/development-setup.html +36 -0
  171. package/export-template/docs/contributor-guide/testing.html +25 -0
  172. package/export-template/docs/favicon.svg +4 -0
  173. package/export-template/docs/hashmap.json +1 -0
  174. package/export-template/docs/index.html +25 -0
  175. package/export-template/docs/package.json +1 -0
  176. package/export-template/docs/tuning-reference/anti-patterns.html +25 -0
  177. package/export-template/docs/tuning-reference/aqe.html +25 -0
  178. package/export-template/docs/tuning-reference/bottleneck-broadcast-sizing.html +25 -0
  179. package/export-template/docs/tuning-reference/bottleneck-cold-start.html +31 -0
  180. package/export-template/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +25 -0
  181. package/export-template/docs/tuning-reference/bottleneck-failures.html +30 -0
  182. package/export-template/docs/tuning-reference/bottleneck-gc.html +30 -0
  183. package/export-template/docs/tuning-reference/bottleneck-job-failure-rate.html +32 -0
  184. package/export-template/docs/tuning-reference/bottleneck-memory-utilization.html +31 -0
  185. package/export-template/docs/tuning-reference/bottleneck-retry-waste.html +25 -0
  186. package/export-template/docs/tuning-reference/bottleneck-shuffle.html +36 -0
  187. package/export-template/docs/tuning-reference/bottleneck-skew.html +38 -0
  188. package/export-template/docs/tuning-reference/bottleneck-slow-host.html +31 -0
  189. package/export-template/docs/tuning-reference/bottleneck-small-files.html +29 -0
  190. package/export-template/docs/tuning-reference/bottleneck-spill.html +30 -0
  191. package/export-template/docs/tuning-reference/bottleneck-straggler.html +31 -0
  192. package/export-template/docs/tuning-reference/bottleneck-tiny-tasks.html +32 -0
  193. package/export-template/docs/tuning-reference/bottleneck-utilization.html +29 -0
  194. package/export-template/docs/tuning-reference/caching.html +25 -0
  195. package/export-template/docs/tuning-reference/cluster-config.html +25 -0
  196. package/export-template/docs/tuning-reference/config.html +25 -0
  197. package/export-template/docs/tuning-reference/data-formats.html +25 -0
  198. package/export-template/docs/tuning-reference/index.html +25 -0
  199. package/export-template/docs/tuning-reference/intro.html +25 -0
  200. package/export-template/docs/tuning-reference/joins.html +25 -0
  201. package/export-template/docs/tuning-reference/memory-model.html +25 -0
  202. package/export-template/docs/tuning-reference/metrics.html +25 -0
  203. package/export-template/docs/tuning-reference/partitioning.html +25 -0
  204. package/export-template/docs/tuning-reference/pyspark.html +30 -0
  205. package/export-template/docs/tuning-reference/shuffle.html +25 -0
  206. package/export-template/docs/tuning-reference/spark-architecture.html +25 -0
  207. package/export-template/docs/tuning-reference/table-formats.html +25 -0
  208. package/export-template/docs/user-guide/alternative-log-retrieval.html +25 -0
  209. package/export-template/docs/user-guide/getting-started.html +27 -0
  210. package/export-template/docs/user-guide/mcp-tools.html +149 -0
  211. package/export-template/docs/user-guide/run-comparison.html +25 -0
  212. package/export-template/docs/user-guide/understanding-findings.html +25 -0
  213. package/export-template/docs/vp-icons.css +0 -0
  214. package/export-template/favicon.svg +4 -0
  215. package/export-template/index.html +111 -0
  216. package/export-template/parser-worker-DyjiQvfP.js +112 -0
  217. package/export-template/sample-runs/sample-run.ndjson.gz +0 -0
  218. package/package.json +20 -6
  219. package/vendor-core/analyzer.js +74 -74
  220. package/vendor-core/cli/budgets.js +13 -27
  221. package/vendor-core/cli/collect-run.js +43 -19
  222. package/vendor-core/core-count.js +25 -27
  223. package/vendor-core/core-locality-ratio.js +4 -11
  224. package/vendor-core/core-time-series.js +6 -12
  225. package/vendor-core/core-usage-locality.js +3 -4
  226. package/vendor-core/detectors.js +395 -389
  227. package/vendor-core/docs-config.js +69 -21
  228. package/vendor-core/docs-content/chapters/01-intro.md +32 -0
  229. package/vendor-core/docs-content/chapters/02-spark-architecture.md +76 -0
  230. package/vendor-core/docs-content/chapters/03-memory-model.md +73 -0
  231. package/vendor-core/docs-content/chapters/04-partitioning.md +65 -0
  232. package/vendor-core/docs-content/chapters/05-joins.md +62 -0
  233. package/vendor-core/docs-content/chapters/06-shuffle.md +59 -0
  234. package/vendor-core/docs-content/chapters/07-data-formats.md +81 -0
  235. package/vendor-core/docs-content/chapters/07b-table-formats.md +56 -0
  236. package/vendor-core/docs-content/chapters/08-caching.md +58 -0
  237. package/vendor-core/docs-content/chapters/09-pyspark.md +78 -0
  238. package/vendor-core/docs-content/chapters/10-aqe.md +167 -0
  239. package/vendor-core/docs-content/chapters/11-cluster-config.md +170 -0
  240. package/vendor-core/docs-content/chapters/12-anti-patterns.md +171 -0
  241. package/vendor-core/docs-content/chapters/14-metrics.md +87 -0
  242. package/vendor-core/docs-content/chapters/15-config.md +93 -0
  243. package/vendor-core/docs-content/chapters/nav-index.json +370 -0
  244. package/vendor-core/docs-content/detection/cache.md +7 -0
  245. package/vendor-core/docs-content/detection/cfg.md +15 -0
  246. package/vendor-core/docs-content/detection/chrn.md +9 -0
  247. package/vendor-core/docs-content/detection/cold.md +4 -0
  248. package/vendor-core/docs-content/detection/cstor.md +4 -0
  249. package/vendor-core/docs-content/detection/fail.md +5 -0
  250. package/vendor-core/docs-content/detection/gc.md +4 -0
  251. package/vendor-core/docs-content/detection/host.md +5 -0
  252. package/vendor-core/docs-content/detection/incmp.md +6 -0
  253. package/vendor-core/docs-content/detection/jobs.md +4 -0
  254. package/vendor-core/docs-content/detection/local.md +6 -0
  255. package/vendor-core/docs-content/detection/mem.md +10 -0
  256. package/vendor-core/docs-content/detection/part.md +5 -0
  257. package/vendor-core/docs-content/detection/plan.md +14 -0
  258. package/vendor-core/docs-content/detection/retry.md +4 -0
  259. package/vendor-core/docs-content/detection/sfail.md +5 -0
  260. package/vendor-core/docs-content/detection/shape.md +5 -0
  261. package/vendor-core/docs-content/detection/shfl.md +4 -0
  262. package/vendor-core/docs-content/detection/skew.md +6 -0
  263. package/vendor-core/docs-content/detection/slow.md +6 -0
  264. package/vendor-core/docs-content/detection/spec.md +8 -0
  265. package/vendor-core/docs-content/detection/spill.md +7 -0
  266. package/vendor-core/docs-content/detection/strag.md +5 -0
  267. package/vendor-core/docs-content/detection/tiny.md +4 -0
  268. package/vendor-core/docs-content/detection/util.md +4 -0
  269. package/vendor-core/docs-content/diagrams/aqe-loop.dark.svg +1 -0
  270. package/vendor-core/docs-content/diagrams/aqe-loop.svg +1 -0
  271. package/vendor-core/docs-content/diagrams/broadcast-vs-shuffle.dark.svg +1 -0
  272. package/vendor-core/docs-content/diagrams/broadcast-vs-shuffle.svg +1 -0
  273. package/vendor-core/docs-content/diagrams/cache-lifecycle.dark.svg +1 -0
  274. package/vendor-core/docs-content/diagrams/cache-lifecycle.svg +1 -0
  275. package/vendor-core/docs-content/diagrams/cold-start-timeline.dark.svg +1 -0
  276. package/vendor-core/docs-content/diagrams/cold-start-timeline.svg +1 -0
  277. package/vendor-core/docs-content/diagrams/columnar-layout.dark.svg +1 -0
  278. package/vendor-core/docs-content/diagrams/columnar-layout.svg +1 -0
  279. package/vendor-core/docs-content/diagrams/container-memory.dark.svg +1 -0
  280. package/vendor-core/docs-content/diagrams/container-memory.svg +1 -0
  281. package/vendor-core/docs-content/diagrams/dag-stages.dark.svg +1 -0
  282. package/vendor-core/docs-content/diagrams/dag-stages.svg +1 -0
  283. package/vendor-core/docs-content/diagrams/driver-executor.dark.svg +1 -0
  284. package/vendor-core/docs-content/diagrams/driver-executor.svg +1 -0
  285. package/vendor-core/docs-content/diagrams/duplicate-plan-subtree.dark.svg +1 -0
  286. package/vendor-core/docs-content/diagrams/duplicate-plan-subtree.svg +1 -0
  287. package/vendor-core/docs-content/diagrams/join-strategy.dark.svg +1 -0
  288. package/vendor-core/docs-content/diagrams/join-strategy.svg +1 -0
  289. package/vendor-core/docs-content/diagrams/memory-borrowing.dark.svg +1 -0
  290. package/vendor-core/docs-content/diagrams/memory-borrowing.svg +1 -0
  291. package/vendor-core/docs-content/diagrams/memory-regions.dark.svg +1 -0
  292. package/vendor-core/docs-content/diagrams/memory-regions.svg +1 -0
  293. package/vendor-core/docs-content/diagrams/repartition-vs-coalesce.dark.svg +1 -0
  294. package/vendor-core/docs-content/diagrams/repartition-vs-coalesce.svg +1 -0
  295. package/vendor-core/docs-content/diagrams/retry-escalation-ladder.dark.svg +1 -0
  296. package/vendor-core/docs-content/diagrams/retry-escalation-ladder.svg +1 -0
  297. package/vendor-core/docs-content/diagrams/shuffle-map-reduce.dark.svg +1 -0
  298. package/vendor-core/docs-content/diagrams/shuffle-map-reduce.svg +1 -0
  299. package/vendor-core/docs-content/diagrams/spill-classification.dark.svg +1 -0
  300. package/vendor-core/docs-content/diagrams/spill-classification.svg +1 -0
  301. package/vendor-core/docs-content/diagrams/udf-execution-models.dark.svg +1 -0
  302. package/vendor-core/docs-content/diagrams/udf-execution-models.svg +1 -0
  303. package/vendor-core/docs-content/tuning/broadcast-sizing.md +78 -0
  304. package/vendor-core/docs-content/tuning/cold-start.md +81 -0
  305. package/vendor-core/docs-content/tuning/duplicate-plan-subtree.md +45 -0
  306. package/vendor-core/docs-content/tuning/failures.md +124 -0
  307. package/vendor-core/docs-content/tuning/gc.md +110 -0
  308. package/vendor-core/docs-content/tuning/job-failure-rate.md +101 -0
  309. package/vendor-core/docs-content/tuning/memory-utilization.md +58 -0
  310. package/vendor-core/docs-content/tuning/retry-waste.md +90 -0
  311. package/vendor-core/docs-content/tuning/shuffle.md +154 -0
  312. package/vendor-core/docs-content/tuning/skew.md +123 -0
  313. package/vendor-core/docs-content/tuning/slow-host.md +117 -0
  314. package/vendor-core/docs-content/tuning/small-files.md +99 -0
  315. package/vendor-core/docs-content/tuning/spill.md +114 -0
  316. package/vendor-core/docs-content/tuning/straggler.md +103 -0
  317. package/vendor-core/docs-content/tuning/tiny-tasks.md +94 -0
  318. package/vendor-core/docs-content/tuning/utilization.md +90 -0
  319. package/vendor-core/docs-site-config.js +10 -17
  320. package/vendor-core/efficiency-model.js +7 -13
  321. package/vendor-core/etl-phases.js +3 -5
  322. package/vendor-core/event-handlers.js +232 -134
  323. package/vendor-core/event-schemas.js +48 -114
  324. package/vendor-core/evidence-availability.js +5 -10
  325. package/vendor-core/evidence-report.js +73 -123
  326. package/vendor-core/export-data.js +48 -0
  327. package/vendor-core/finding-action-label.js +4 -10
  328. package/vendor-core/finding-filter-predicate.js +3 -7
  329. package/vendor-core/finding-generic-recommendation.js +112 -0
  330. package/vendor-core/finding-names.js +51 -0
  331. package/vendor-core/format-utils.js +112 -38
  332. package/vendor-core/impact-band.js +18 -24
  333. package/vendor-core/impact-estimator.js +38 -74
  334. package/vendor-core/ingest.js +7 -13
  335. package/vendor-core/job-groups.js +3 -6
  336. package/vendor-core/list-runs.js +278 -0
  337. package/vendor-core/load-vendored.js +6 -12
  338. package/vendor-core/log-header-peek.js +81 -0
  339. package/vendor-core/lz4-block.js +4 -6
  340. package/vendor-core/mcp-server-factory.js +38 -8
  341. package/vendor-core/mcp-tools.js +105 -76
  342. package/vendor-core/model-assembler.js +8 -16
  343. package/vendor-core/occupancy.js +5 -9
  344. package/vendor-core/parser-worker.js +20 -29
  345. package/vendor-core/plan-dot.js +2 -5
  346. package/vendor-core/plan-duration-attribution.js +78 -29
  347. package/vendor-core/plan-graph-model.js +126 -69
  348. package/vendor-core/plan-node-detail.js +31 -17
  349. package/vendor-core/plan-summary.js +19 -8
  350. package/vendor-core/recommendation-rollup.js +35 -39
  351. package/vendor-core/redact.js +72 -16
  352. package/vendor-core/rolling-log-reassembly.js +4 -6
  353. package/vendor-core/run-comparison.js +86 -72
  354. package/vendor-core/scaling-sim.js +5 -7
  355. package/vendor-core/session-snapshot.js +1 -1
  356. package/vendor-core/shs-fetch.js +4 -6
  357. package/vendor-core/shs-load.js +9 -13
  358. package/vendor-core/shs-request.js +1 -1
  359. package/vendor-core/stage-quantiles.js +14 -0
  360. package/vendor-core/types.js +78 -18
  361. package/vendor-core/wasted-core-hours.js +7 -12
@@ -1,26 +1,14 @@
1
1
  import { z } from 'zod';
2
2
 
3
- // ---------------------------------------------------------------------------
4
- // sparkPlanInfo: iterative (non-recursive-schema) tree parser
3
+ // sparkPlanInfo: iterative (non-recursive-schema) tree parser.
5
4
  //
6
- // Validates the raw, unbounded-depth `sparkPlanInfo` tree carried on
7
- // SparkListenerSQLExecutionStart/End events (consumed today by
8
- // `resolvePlanTree` in event-handlers.js:233-273). Per the spec, this must
9
- // NEVER be validated with z.lazy(): it uses an explicit heap-allocated stack,
10
- // the same iterative-over-recursive approach src/plan-tree-walk.js's
11
- // walkPlanTree already uses for the *resolved* tree (that one walks an
12
- // already-built tree; this one builds one from raw JSON).
13
- // ---------------------------------------------------------------------------
5
+ // Validates the raw, unbounded-depth sparkPlanInfo tree on SQLExecutionStart/End events. Must
6
+ // NEVER be validated with z.lazy(): it uses an explicit heap-allocated stack so zod never sees the
7
+ // full tree depth in one call.
14
8
 
15
- // `resolvePlanTree` (event-handlers.ts) reads `m.accumulatorId` to look up
16
- // the accumulator's live value in accumMap; this field was missing from the
17
- // original (Task 6) schema, so it was silently stripped by object-schema
18
- // validation before resolvePlanTree ever saw it, breaking metric resolution
19
- // for every plan node once real events start flowing through
20
- // SparkEventSchema.safeParse. Declared optional (not required) to keep
21
- // accepting tests/event-schemas.test.js's existing 'value'-only fixture;
22
- // resolvePlanTree already tolerates a missing accumulatorId (accumMap.has
23
- // just resolves false, the metric contributes no value).
9
+ // resolvePlanTree reads m.accumulatorId to look up the accumulator's live value in accumMap.
10
+ // Optional (not required): resolvePlanTree tolerates a missing accumulatorId (accumMap.has
11
+ // resolves false, the metric contributes no value).
24
12
  const SparkPlanMetricSchema = z.object({
25
13
  name: z.string(),
26
14
  accumulatorId: z.number().optional(),
@@ -28,17 +16,10 @@ const SparkPlanMetricSchema = z.object({
28
16
  metricType: z.string().optional(),
29
17
  });
30
18
 
31
- // Shallow shape only. `children` is intentionally z.array(z.unknown()) here:
32
- // each child gets its own shallow parse inside the iterative walk below, so
33
- // this schema never recurses into itself and zod never sees the full tree
34
- // depth in one call.
35
- //
36
- // `metadata` (file-scan nodes carry Location/Format/ReadSchema/PushedFilters/
37
- // PartitionFilters/DataFilters/Batched here) was missing from the original
38
- // schema, so it was silently stripped before ever reaching the posted `sql`
39
- // message's `sparkPlanInfo` (same data-loss class as the accumulatorId gap
40
- // above). Nothing reads it yet, but it's real data crossing the worker
41
- // boundary, so it's kept rather than dropped.
19
+ // Shallow shape only. `children` is z.array(z.unknown()): each child gets its own shallow parse
20
+ // in the iterative walk below, so this schema never recurses and zod never sees the full depth.
21
+ // `metadata` (file-scan Location/Format/ReadSchema/...) is kept though nothing reads it yet: real
22
+ // data crossing the worker boundary.
42
23
  const SparkPlanInfoNodeSchema = z.object({
43
24
  nodeName: z.string(),
44
25
  simpleString: z.string().optional(),
@@ -94,11 +75,8 @@ export function parseSparkPlanInfoTree(raw ) {
94
75
  throw new Error('unreachable: sparkPlanInfo tree stack exhausted without resolving root');
95
76
  }
96
77
 
97
- // A zod field schema wrapping parseSparkPlanInfoTree, for use inside the
98
- // SQLExecutionStart event schema. Nullable/optional to mirror
99
- // `event.sparkPlanInfo ?? null` in startSqlExecution (event-handlers.js:448).
100
- // Deliberately NOT z.lazy(): defers to the iterative parser above, so the
101
- // full tree depth is still never handed to zod's own recursion.
78
+ // A zod field wrapping parseSparkPlanInfoTree for the SQLExecutionStart schema. Nullable/optional
79
+ // to mirror `event.sparkPlanInfo ?? null`. Deliberately NOT z.lazy(): defers to the iterative parser.
102
80
  const SparkPlanInfoFieldSchema = z
103
81
  .unknown()
104
82
  .nullable()
@@ -113,19 +91,15 @@ const SparkPlanInfoFieldSchema = z
113
91
  }
114
92
  });
115
93
 
116
- // ---------------------------------------------------------------------------
117
- // Six fully-specified event schemas (verbatim per task-6-brief.md Step 3;
118
- // backed by exact quoted source cited in each comment)
119
- // ---------------------------------------------------------------------------
94
+ // Fully-specified event schemas.
120
95
 
121
- // event-handlers.js:516-518 (`SparkListenerLogStart` case, inline: sets
122
- // state.pendingSparkVersion)
96
+ // SparkListenerLogStart case (inline: sets state.pendingSparkVersion).
123
97
  export const LogStartEventSchema = z.object({
124
98
  Event: z.literal('SparkListenerLogStart'),
125
99
  'Spark Version': z.string().optional(),
126
100
  });
127
101
 
128
- // event-handlers.js:293-306 (startApplication)
102
+ // startApplication.
129
103
  export const ApplicationStartEventSchema = z.object({
130
104
  Event: z.literal('SparkListenerApplicationStart'),
131
105
  'App ID': z.string().optional(),
@@ -134,20 +108,9 @@ export const ApplicationStartEventSchema = z.object({
134
108
  'Spark Version': z.string().optional(),
135
109
  });
136
110
 
137
- // event-handlers.js:308-323 (updateEnvironment): 'Spark Properties' is fed
138
- // straight into normalizeSparkProperties(props), which already accepts
139
- // object | array | null (src/format-utils... no, src/event-handlers.js:53-62)
140
- //
141
- // Property VALUES were previously required to be z.string(), but
142
- // normalizeSparkProperties (event-handlers.ts:211-226) just spread each
143
- // value through (`{ ...(props ?? {}) }` / `map[pair[0]] = pair[1]`) with no
144
- // requirement that it already be a string, so a real Spark config carrying a
145
- // non-string-looking JSON value (a bare number or boolean) was rejecting the
146
- // entire EnvironmentUpdate event instead of parsing it. Widened to the
147
- // realistic set of raw JSON scalar types; normalizeSparkProperties now
148
- // coerces each value to a string at the boundary so its `Record<string,
149
- // string>` return contract (and every downstream reader of `app.config`)
150
- // is unaffected.
111
+ // updateEnvironment: 'Spark Properties' is fed to normalizeSparkProperties, which accepts
112
+ // object | array | null. Property VALUES are string|number|boolean (a real config can carry a
113
+ // bare JSON number/boolean); normalizeSparkProperties coerces each to a string at the boundary.
151
114
  const SparkPropertyValueSchema = z.union([z.string(), z.number(), z.boolean()]);
152
115
  export const EnvironmentUpdateEventSchema = z.object({
153
116
  Event: z.literal('SparkListenerEnvironmentUpdate'),
@@ -158,20 +121,15 @@ export const EnvironmentUpdateEventSchema = z.object({
158
121
  ]).optional(),
159
122
  });
160
123
 
161
- // event-handlers.js:526-532 (inline ApplicationEnd case)
124
+ // inline ApplicationEnd case.
162
125
  export const ApplicationEndEventSchema = z.object({
163
126
  Event: z.literal('SparkListenerApplicationEnd'),
164
127
  Timestamp: z.number().optional(),
165
128
  });
166
129
 
167
- // event-handlers.js:490-502 (addExecutor). `Resource Profile Id` is read from
168
- // BOTH inside 'Executor Info' (the real Spark placement) and top-level (a
169
- // fallback for a variant that hoists it) via `event['Executor Info']?.[...] ??
170
- // event['Resource Profile Id']`, so both locations must be declared or the
171
- // nested (primary) one is silently stripped by object-schema validation.
172
- // `Timestamp` is read as `event['Timestamp']` with no defensive operator, so
173
- // per the optionality rule it's required, not guessed-optional (it also
174
- // backs ExecutorAddedEvent.timestamp: number, a non-optional field).
130
+ // addExecutor. `Resource Profile Id` is read from BOTH inside 'Executor Info' (real Spark
131
+ // placement) and top-level (a variant that hoists it), so both must be declared or the nested one
132
+ // is silently stripped. `Timestamp` is read with no defensive operator, so it's required.
175
133
  export const ExecutorAddedEventSchema = z.object({
176
134
  Event: z.literal('SparkListenerExecutorAdded'),
177
135
  Timestamp: z.number(),
@@ -184,9 +142,7 @@ export const ExecutorAddedEventSchema = z.object({
184
142
  'Resource Profile Id': z.number().optional(),
185
143
  });
186
144
 
187
- // event-handlers.js:504-512 (removeExecutor). `Timestamp` is read as
188
- // `event['Timestamp']` with no defensive operator, so per the optionality
189
- // rule it's required (backs ExecutorRemovedEvent.timestamp: number).
145
+ // removeExecutor. `Timestamp` is read with no defensive operator, so it's required.
190
146
  export const ExecutorRemovedEventSchema = z.object({
191
147
  Event: z.literal('SparkListenerExecutorRemoved'),
192
148
  Timestamp: z.number(),
@@ -194,18 +150,10 @@ export const ExecutorRemovedEventSchema = z.object({
194
150
  'Removed Reason': z.string().optional(),
195
151
  });
196
152
 
197
- // ---------------------------------------------------------------------------
198
- // Nine schemas transcribed from their handlers (task-6-brief.md Step 4). See
199
- // task-6-report.md for the exact field-by-field derivation from each handler.
200
- // ---------------------------------------------------------------------------
153
+ // Schemas transcribed from their handlers.
201
154
 
202
- // event-handlers.js:325-345 (startJob). 'spark.sql.execution.id' is read via
203
- // `event['Properties']?.['spark.sql.execution.id']` then
204
- // `parseInt(sqlExecIdStr, 10)` (startJob, event-handlers.ts:498-501):
205
- // parseInt coerces its argument to a string internally, so it tolerates the
206
- // raw value already being a number just as well as a string; requiring
207
- // z.string() here rejected the whole JobStart event for a log variant that
208
- // emits this property as a JSON number instead of a numeric string.
155
+ // startJob. 'spark.sql.execution.id' is read then parseInt'd, which coerces to string internally,
156
+ // so it tolerates the raw value being a number; widened to string|number (some logs emit a JSON number).
209
157
  export const JobStartEventSchema = z.object({
210
158
  Event: z.literal('SparkListenerJobStart'),
211
159
  'Job ID': z.number().optional(),
@@ -216,7 +164,7 @@ export const JobStartEventSchema = z.object({
216
164
  }).optional(),
217
165
  });
218
166
 
219
- // event-handlers.js:347-360 (endJob)
167
+ // endJob.
220
168
  export const JobEndEventSchema = z.object({
221
169
  Event: z.literal('SparkListenerJobEnd'),
222
170
  'Job ID': z.number(),
@@ -229,9 +177,8 @@ export const JobEndEventSchema = z.object({
229
177
  }).optional(),
230
178
  });
231
179
 
232
- // event-handlers.js:362-389 (submitStage) + mergeStageRddInfo
233
- // (event-handlers.js:391-422, called from submitStage with the same 'Stage
234
- // Info' object, so its 'RDD Info' reads are part of this event's shape too)
180
+ // submitStage + mergeStageRddInfo (called from submitStage with the same 'Stage Info', so its
181
+ // 'RDD Info' reads are part of this event's shape too).
235
182
  const RddInfoSchema = z.object({
236
183
  'RDD ID': z.number().optional(),
237
184
  Name: z.string().optional(),
@@ -243,11 +190,8 @@ const RddInfoSchema = z.object({
243
190
  Replication: z.number().optional(),
244
191
  }).optional(),
245
192
  'Number of Partitions': z.number().optional(),
246
- // 'Number of Cached Partitions' / 'Memory Size' / 'Disk Size' are read via
247
- // `rdd[field] || prev?.field || 0` (mergeStageRddInfo, event-handlers.ts:
248
- // 594-596): a `||` fallback is tolerant of the key being absent
249
- // (undefined || ... just falls through to the next fallback), so a real
250
- // event-log variant that omits one of these keys must still parse.
193
+ // 'Number of Cached Partitions'/'Memory Size'/'Disk Size' are read via `rdd[field] || prev || 0`,
194
+ // tolerant of the key being absent, so a variant that omits one must still parse.
251
195
  'Number of Cached Partitions': z.number().optional(),
252
196
  'Memory Size': z.number().optional(),
253
197
  'Disk Size': z.number().optional(),
@@ -265,7 +209,7 @@ export const StageSubmittedEventSchema = z.object({
265
209
  }),
266
210
  });
267
211
 
268
- // event-handlers.js:543-551 (inline StageCompleted case)
212
+ // inline StageCompleted case.
269
213
  export const StageCompletedEventSchema = z.object({
270
214
  Event: z.literal('SparkListenerStageCompleted'),
271
215
  'Stage Info': z.object({
@@ -275,7 +219,7 @@ export const StageCompletedEventSchema = z.object({
275
219
  }),
276
220
  });
277
221
 
278
- // event-handlers.js:431-444 (recordStageExecutorMetrics)
222
+ // recordStageExecutorMetrics.
279
223
  export const StageExecutorMetricsEventSchema = z.object({
280
224
  Event: z.literal('SparkListenerStageExecutorMetrics'),
281
225
  'Stage ID': z.number(),
@@ -285,7 +229,7 @@ export const StageExecutorMetricsEventSchema = z.object({
285
229
 
286
230
  const MAX_ACCUMULABLES_PER_TASK = 10_000;
287
231
 
288
- // event-handlers.js:147-231 (accumulateTask)
232
+ // accumulateTask.
289
233
  export const TaskEndEventSchema = z.object({
290
234
  Event: z.literal('SparkListenerTaskEnd'),
291
235
  'Stage ID': z.number(),
@@ -296,26 +240,20 @@ export const TaskEndEventSchema = z.object({
296
240
  'Task Info': z.object({
297
241
  'Launch Time': z.number().optional(),
298
242
  'Finish Time': z.number().optional(),
299
- // Failed/Killed are read via `info['Failed'] || info['Killed']`
300
- // (accumulateTask, event-handlers.ts:340): a `||` fallback is tolerant
301
- // of either key being absent (undefined || undefined is falsy, no
302
- // crash), so real event-log variants that omit these keys must still
303
- // parse rather than have the whole TaskEnd event rejected.
243
+ // Failed/Killed are read via `info['Failed'] || info['Killed']`, tolerant of either being
244
+ // absent, so variants that omit them must still parse.
304
245
  Failed: z.boolean().optional(),
305
246
  Killed: z.boolean().optional(),
306
- // Speculative is read via `info['Speculative'] === true`
307
- // (accumulateTask, event-handlers.ts:347): a strict-equality check is
308
- // also tolerant of the key being absent (undefined === true is just
309
- // false), so this is optional too.
247
+ // Speculative is read via `=== true`, also tolerant of the key being absent, so it's optional too.
310
248
  Speculative: z.boolean().optional(),
311
249
  Host: z.string().optional(),
312
250
  'Executor ID': z.string().optional(),
313
251
  Locality: z.string().optional(),
314
252
  Index: z.number().optional(),
315
- // Bounded well above any real plan's per-task metric count (see
316
- // MAX_PLAN_DEPTH above for the same defensive intent): caps how much a
317
- // single crafted TaskEnd can grow event-handlers.ts's taskAccumStages,
318
- // which is never pruned for the life of the parse.
253
+ 'Task ID': z.number().optional(),
254
+ 'Attempt Number': z.number().optional(),
255
+ // Bounded well above any real per-task metric count: caps how much a crafted TaskEnd can grow
256
+ // taskAccumStages, which is never pruned for the life of the parse.
319
257
  Accumulables: z.array(z.object({
320
258
  ID: z.number(),
321
259
  Update: z.union([z.string(), z.number()]).optional(),
@@ -346,7 +284,7 @@ export const TaskEndEventSchema = z.object({
346
284
  }).optional(),
347
285
  });
348
286
 
349
- // event-handlers.js:446-460 (startSqlExecution)
287
+ // startSqlExecution.
350
288
  export const SqlExecutionStartEventSchema = z.object({
351
289
  Event: z.literal('org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart'),
352
290
  executionId: z.number(),
@@ -356,8 +294,8 @@ export const SqlExecutionStartEventSchema = z.object({
356
294
  sparkPlanInfo: SparkPlanInfoFieldSchema,
357
295
  });
358
296
 
359
- // event-handlers.js (applyAdaptiveExecutionUpdate): AQE re-plans mid-query
360
- // and re-emits sparkPlanInfo for the same executionId; last write wins.
297
+ // applyAdaptiveExecutionUpdate: AQE re-plans mid-query and re-emits sparkPlanInfo for the same
298
+ // executionId; last write wins.
361
299
  export const SqlAdaptiveExecutionUpdateEventSchema = z.object({
362
300
  Event: z.literal('org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate'),
363
301
  executionId: z.number(),
@@ -365,25 +303,21 @@ export const SqlAdaptiveExecutionUpdateEventSchema = z.object({
365
303
  sparkPlanInfo: SparkPlanInfoFieldSchema,
366
304
  });
367
305
 
368
- // event-handlers.js:462-478 (endSqlExecution)
306
+ // endSqlExecution.
369
307
  export const SqlExecutionEndEventSchema = z.object({
370
308
  Event: z.literal('org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd'),
371
309
  executionId: z.number(),
372
310
  time: z.number(),
373
311
  });
374
312
 
375
- // event-handlers.js:480-488 (applyDriverAccumUpdates)
313
+ // applyDriverAccumUpdates.
376
314
  export const DriverAccumUpdatesEventSchema = z.object({
377
315
  Event: z.literal('org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates'),
378
316
  executionId: z.number(),
379
317
  accumUpdates: z.array(z.tuple([z.number(), z.number()])),
380
318
  });
381
319
 
382
- // ---------------------------------------------------------------------------
383
- // Discriminated union: exactly 16 entries, one per `case` in processEvent's
384
- // switch (event-handlers.js:514-577).
385
- // ---------------------------------------------------------------------------
386
-
320
+ // Discriminated union: one entry per `case` in processEvent's switch.
387
321
  export const SparkEventSchema = z.discriminatedUnion('Event', [
388
322
  LogStartEventSchema,
389
323
  ApplicationStartEventSchema,
@@ -1,10 +1,7 @@
1
1
 
2
2
 
3
- // Not annotated `: number` on purpose: `const X = 1` infers the literal type
4
- // `1`, which is assignable both wherever `number` is expected (e.g. equality
5
- // checks below) and wherever the `EvidenceAvailability.schemaVersion: 1`
6
- // literal field is expected (the `return` at the bottom of this file);
7
- // widening it to `number` would break that assignment.
3
+ // Not annotated `: number` on purpose: `const X = 1` infers the literal type `1`, assignable to
4
+ // the EvidenceAvailability.schemaVersion:1 literal field; widening to `number` would break that.
8
5
  export const EVIDENCE_AVAILABILITY_SCHEMA_VERSION = 1;
9
6
 
10
7
  const SUMMARIES = {
@@ -46,11 +43,9 @@ function isPositiveFinite(value ) {
46
43
  return typeof value === 'number' && Number.isFinite(value) && value > 0;
47
44
  }
48
45
 
49
- /** A stage contributes usable core-time evidence only when it both ran tasks
50
- * and produced a positive duration sum: a degenerate aggregate (every task
51
- * with `finish <= launch`) carries `totalTaskDurationSum <= 0` and proves
52
- * nothing, so it must not report `present`. Shared with ScalingSim so the
53
- * two consumers cannot drift. */
46
+ /** A stage contributes usable core-time evidence only when it both ran tasks and produced a
47
+ * positive duration sum: a degenerate aggregate (every task finish <= launch) proves nothing.
48
+ * Shared with ScalingSim so the two consumers can't drift. */
54
49
  export function hasUsableRunAggregates(runAggregates ) {
55
50
  const perStage = (runAggregates )?.perStage;
56
51
  return perStage != null