@v11g/agents-rock 1.0.8 → 1.0.10

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 (314) hide show
  1. package/README.md +2 -1
  2. package/package.json +2 -2
  3. package/plugins/business-analyst/.claude-plugin/plugin.json +1 -1
  4. package/plugins/business-analyst/evals/ba-interview-conflict/graders/conflict-quoted.md +15 -0
  5. package/plugins/business-analyst/evals/ba-interview-conflict/graders/no-internal-ids.md +9 -0
  6. package/plugins/business-analyst/evals/ba-interview-conflict/graders/one-question.md +15 -0
  7. package/plugins/business-analyst/evals/ba-interview-conflict/graders/skill-fired.md +7 -0
  8. package/plugins/business-analyst/evals/ba-interview-conflict/prompt.md +31 -0
  9. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-internal-ids.md +9 -0
  10. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-setup-questions.md +16 -0
  11. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/one-scope-question.md +19 -0
  12. package/plugins/business-analyst/evals/ba-interview-first-turn/graders/skill-fired.md +7 -0
  13. package/plugins/business-analyst/evals/ba-interview-first-turn/prompt.md +31 -0
  14. package/plugins/business-analyst/evals/ba-review-page/case.yaml +4 -0
  15. package/plugins/business-analyst/evals/ba-review-page/fixture.sh +12 -0
  16. package/plugins/business-analyst/evals/ba-review-page/graders/decide-in-interview.md +26 -0
  17. package/plugins/business-analyst/evals/ba-review-page/graders/skill-fired.md +7 -0
  18. package/plugins/business-analyst/evals/ba-review-page/prompt.md +9 -0
  19. package/plugins/business-analyst/skills/business-analyst/README.md +8 -0
  20. package/plugins/business-analyst/skills/business-analyst/SKILL.md +47 -16
  21. package/plugins/business-analyst/skills/business-analyst/assets/review-page.html +68 -0
  22. package/plugins/business-analyst/skills/business-analyst/evals/evals.json +1 -1
  23. package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +3 -2
  24. package/plugins/business-analyst/skills/business-analyst/references/interview.md +156 -8
  25. package/plugins/business-analyst/skills/business-analyst/references/review.md +18 -4
  26. package/plugins/business-analyst/skills/business-analyst/references/writing.md +49 -8
  27. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
  28. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
  29. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
  30. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
  31. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
  32. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
  33. package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +12 -6
  34. package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-data.mjs +66 -0
  35. package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-layout.mjs +53 -0
  36. package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-page.mjs +78 -0
  37. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-checks.mjs +73 -0
  38. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-md.mjs +53 -0
  39. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-render.mjs +72 -0
  40. package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-rules.mjs +90 -0
  41. package/plugins/business-analyst/skills/business-analyst/scripts/review.mjs +48 -0
  42. package/plugins/business-analyst/skills/business-analyst/scripts/review.py +60 -0
  43. package/plugins/business-analyst/skills/business-analyst/scripts/review_data.py +81 -0
  44. package/plugins/business-analyst/skills/business-analyst/scripts/review_layout.py +50 -0
  45. package/plugins/business-analyst/skills/business-analyst/scripts/review_page.py +115 -0
  46. package/plugins/business-analyst/skills/business-analyst/scripts/scope.mjs +24 -0
  47. package/plugins/business-analyst/skills/business-analyst/scripts/scope.py +35 -0
  48. package/plugins/business-analyst/skills/business-analyst/scripts/scope_checks.py +168 -0
  49. package/plugins/business-analyst/skills/business-analyst/scripts/scope_render.py +140 -0
  50. package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +27 -0
  51. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.json +78 -0
  52. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.md +136 -0
  53. package/plugins/business-analyst/skills/business-analyst/scripts/test/python-parity.test.mjs +88 -0
  54. package/plugins/business-analyst/skills/business-analyst/scripts/test/quality-gates.test.mjs +26 -0
  55. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-browser.test.mjs +106 -0
  56. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-fixture.mjs +32 -0
  57. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-page.test.mjs +340 -0
  58. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-parity.test.mjs +79 -0
  59. package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-cases.mjs +58 -0
  60. package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-checks.test.mjs +31 -0
  61. package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-md.test.mjs +140 -0
  62. package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +1 -1
  63. package/plugins/business-analyst/skills/business-analyst/scripts/validate.py +17 -8
  64. package/plugins/reasoning/.claude-plugin/plugin.json +1 -1
  65. package/plugins/reasoning/evals/format-handoff-folder/graders/folder-named.md +8 -0
  66. package/plugins/reasoning/evals/format-handoff-folder/graders/skill-fired.md +7 -0
  67. package/plugins/reasoning/evals/format-handoff-folder/prompt.md +9 -0
  68. package/plugins/reasoning/evals/format-ids-and-supports/graders/ids-in-chat.md +8 -0
  69. package/plugins/reasoning/evals/format-ids-and-supports/graders/skill-fired.md +7 -0
  70. package/plugins/reasoning/evals/format-ids-and-supports/graders/supports-resolve.md +11 -0
  71. package/plugins/reasoning/evals/format-ids-and-supports/prompt.md +8 -0
  72. package/plugins/reasoning/evals/format-root-candidate-status/graders/candidate-status.md +11 -0
  73. package/plugins/reasoning/evals/format-root-candidate-status/graders/skill-fired.md +7 -0
  74. package/plugins/reasoning/evals/format-root-candidate-status/prompt.md +8 -0
  75. package/plugins/reasoning/evals/format-unsaved-continues/graders/analysis-completes.md +9 -0
  76. package/plugins/reasoning/evals/format-unsaved-continues/graders/not-saved-stated.md +9 -0
  77. package/plugins/reasoning/evals/format-unsaved-continues/graders/skill-fired.md +7 -0
  78. package/plugins/reasoning/evals/format-unsaved-continues/prompt.md +8 -0
  79. package/plugins/reasoning/skills/problem-router/README.md +6 -0
  80. package/plugins/reasoning/skills/problem-router/SKILL.md +4 -0
  81. package/plugins/reasoning/skills/problem-router/references/contract.md +114 -19
  82. package/plugins/reasoning/skills/problem-solving/README.md +6 -0
  83. package/plugins/reasoning/skills/problem-solving/SKILL.md +2 -0
  84. package/plugins/reasoning/skills/problem-solving/references/contract.md +114 -19
  85. package/plugins/reasoning/skills/problem-solving/references/interview.md +2 -0
  86. package/plugins/reasoning/skills/systemic-design/README.md +3 -0
  87. package/plugins/reasoning/skills/systemic-design/SKILL.md +2 -0
  88. package/plugins/reasoning/skills/systemic-design/references/contract.md +114 -19
  89. package/plugins/reasoning/skills/systemic-design/references/interview.md +2 -0
  90. package/plugins/reasoning/skills/systems-thinking/README.md +3 -0
  91. package/plugins/reasoning/skills/systems-thinking/SKILL.md +2 -0
  92. package/plugins/reasoning/skills/systems-thinking/frameworks/leverage-points.md +15 -6
  93. package/plugins/reasoning/skills/systems-thinking/references/contract.md +114 -19
  94. package/plugins/reasoning/skills/systems-thinking/references/interview.md +2 -0
  95. package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
  96. package/plugins/solution-architect/evals/proposal-workflow/case.yaml +6 -0
  97. package/plugins/solution-architect/evals/proposal-workflow/fixture.sh +6 -0
  98. package/plugins/solution-architect/evals/proposal-workflow/graders/inputs-written.md +23 -0
  99. package/plugins/solution-architect/evals/proposal-workflow/graders/no-proposal-md.md +7 -0
  100. package/plugins/solution-architect/evals/proposal-workflow/graders/skill-fired.md +7 -0
  101. package/plugins/solution-architect/evals/proposal-workflow/graders/validate-then-render.md +16 -0
  102. package/plugins/solution-architect/evals/proposal-workflow/prompt.md +10 -0
  103. package/plugins/solution-architect/evals/workflow-gate-no-architecture/case.yaml +4 -0
  104. package/plugins/solution-architect/evals/workflow-gate-no-architecture/fixture.sh +6 -0
  105. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +10 -0
  106. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/nothing-written.md +7 -0
  107. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/skill-fired.md +7 -0
  108. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +11 -0
  109. package/plugins/solution-architect/evals/workflow-gate-no-architecture/prompt.md +7 -0
  110. package/plugins/solution-architect/evals/workflow-happy-path/case.yaml +4 -0
  111. package/plugins/solution-architect/evals/workflow-happy-path/fixture.sh +6 -0
  112. package/plugins/solution-architect/evals/workflow-happy-path/graders/no-estimation-md.md +7 -0
  113. package/plugins/solution-architect/evals/workflow-happy-path/graders/pages-or-stop.md +16 -0
  114. package/plugins/solution-architect/evals/workflow-happy-path/graders/routed-to-workflow.md +12 -0
  115. package/plugins/solution-architect/evals/workflow-happy-path/graders/skill-fired.md +7 -0
  116. package/plugins/solution-architect/evals/workflow-happy-path/graders/three-questions-max.md +14 -0
  117. package/plugins/solution-architect/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +15 -0
  118. package/plugins/solution-architect/evals/workflow-happy-path/prompt.md +9 -0
  119. package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +11 -1
  120. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +4 -1
  121. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +16 -1
  122. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +27 -0
  123. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +9 -0
  124. package/plugins/solution-architect/skills/estimate/README.md +38 -18
  125. package/plugins/solution-architect/skills/estimate/SKILL.md +16 -69
  126. package/plugins/solution-architect/skills/estimate/classic/FLOW.md +77 -0
  127. package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template-agentic.html +111 -138
  128. package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template.html +219 -445
  129. package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/scores-review-template.html +5 -4
  130. package/plugins/solution-architect/skills/estimate/{references → classic/references}/agentic-estimation.md +4 -2
  131. package/plugins/solution-architect/skills/estimate/classic/references/ai-multipliers.md +57 -0
  132. package/plugins/solution-architect/skills/estimate/{references → classic/references}/interview.md +56 -35
  133. package/plugins/solution-architect/skills/estimate/{references → classic/references}/scoring-guide.md +40 -4
  134. package/plugins/solution-architect/skills/estimate/{references → classic/references}/task-shapes.md +1 -1
  135. package/plugins/solution-architect/skills/estimate/{references → classic/references}/techniques.md +29 -21
  136. package/plugins/solution-architect/skills/estimate/{references → classic/references}/writing.md +77 -45
  137. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/compute.mjs +1 -1
  138. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/checks.mjs +38 -6
  139. package/plugins/solution-architect/skills/estimate/classic/scripts/lib/redact.mjs +112 -0
  140. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/roadmap.mjs +4 -5
  141. package/plugins/solution-architect/skills/estimate/classic/scripts/lib/rollup.mjs +129 -0
  142. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/schema.mjs +31 -38
  143. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-csv.mjs +3 -3
  144. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-html.mjs +3 -3
  145. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/render.mjs +9 -8
  146. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/score-review.mjs +3 -3
  147. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/baselines.test.mjs +3 -3
  148. package/plugins/solution-architect/skills/estimate/classic/scripts/test/browser-agentic.test.mjs +143 -0
  149. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser.test.mjs +211 -52
  150. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/compute.test.mjs +58 -33
  151. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/e2e.test.mjs +55 -3
  152. package/plugins/solution-architect/skills/estimate/classic/scripts/test/estimate-math.test.mjs +44 -0
  153. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-fail.md +0 -10
  154. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-pass.md +0 -10
  155. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-inputs.json +1 -7
  156. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/booking-inputs.json +11 -10
  157. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-fail.md +6 -0
  158. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-pass.md +17 -21
  159. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/measurements.test.mjs +1 -1
  160. package/plugins/solution-architect/skills/estimate/classic/scripts/test/pricing.test.mjs +88 -0
  161. package/plugins/solution-architect/skills/estimate/classic/scripts/test/project-price.test.mjs +93 -0
  162. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/quality-gates.test.mjs +7 -1
  163. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/references.test.mjs +88 -26
  164. package/plugins/solution-architect/skills/estimate/classic/scripts/test/render.test.mjs +405 -0
  165. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/schema.test.mjs +114 -61
  166. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/score-review.test.mjs +37 -4
  167. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/scoring.test.mjs +1 -1
  168. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/url-state.test.mjs +2 -2
  169. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/validate.test.mjs +104 -10
  170. package/plugins/solution-architect/skills/estimate/classic/scripts/test/xlsx-export.test.mjs +475 -0
  171. package/plugins/solution-architect/skills/estimate/classic/scripts/test/zip-store.test.mjs +26 -0
  172. package/plugins/solution-architect/skills/estimate/evals/evals.json +44 -9
  173. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +28 -0
  174. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
  175. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.md +141 -0
  176. package/plugins/solution-architect/skills/estimate/shared/assets/xlsx-export.js +336 -0
  177. package/plugins/solution-architect/skills/estimate/shared/lib/agentic-task-schema.mjs +24 -0
  178. package/plugins/solution-architect/skills/estimate/shared/lib/context-schema.mjs +35 -0
  179. package/plugins/solution-architect/skills/estimate/shared/lib/estimate-math.mjs +31 -0
  180. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/inline.mjs +13 -5
  181. package/plugins/solution-architect/skills/estimate/shared/lib/pricing.mjs +78 -0
  182. package/plugins/solution-architect/skills/estimate/shared/lib/project-price.mjs +96 -0
  183. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring-schema.mjs +1 -1
  184. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring.mjs +3 -3
  185. package/plugins/solution-architect/skills/estimate/shared/lib/zip.mjs +60 -0
  186. package/plugins/solution-architect/skills/estimate/workflow-based/FLOW.md +91 -0
  187. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-components.html +994 -0
  188. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-template.html +440 -0
  189. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimator-system.xlsx +0 -0
  190. package/plugins/solution-architect/skills/estimate/workflow-based/assets/score-review.html +838 -0
  191. package/plugins/solution-architect/skills/estimate/workflow-based/references/hidden-work-by-type.md +429 -0
  192. package/plugins/solution-architect/skills/estimate/workflow-based/references/linking.md +59 -0
  193. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-components-template.mjs +80 -0
  194. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-template.mjs +60 -0
  195. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +51 -0
  196. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-xlsx-template.py +144 -0
  197. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/compute.mjs +32 -0
  198. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-html.mjs +44 -0
  199. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-view.mjs +71 -0
  200. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/pair-findings.mjs +19 -0
  201. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/requirements.mjs +33 -0
  202. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/rollup.mjs +66 -0
  203. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema-components.mjs +69 -0
  204. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema.mjs +70 -0
  205. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-diff.mjs +54 -0
  206. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-html.mjs +52 -0
  207. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +51 -0
  208. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/render.mjs +42 -0
  209. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/score-review.mjs +46 -0
  210. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/arch-link.js +9 -0
  211. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/click.js +28 -0
  212. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/prelude.js +4 -0
  213. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/view.js +63 -0
  214. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/browser.test.mjs +127 -0
  215. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs +43 -0
  216. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-template.test.mjs +18 -0
  217. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/cli.test.mjs +48 -0
  218. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/estimator-system.test.mjs +66 -0
  219. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/ARCHITECTURE-mini.md +31 -0
  220. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/feedback.json +19 -0
  221. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/inputs-pass.json +80 -0
  222. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/measurements.jsonl +0 -0
  223. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/requirements.json +79 -0
  224. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/page-view.test.mjs +54 -0
  225. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/pages-browser.test.mjs +209 -0
  226. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/quality-gates.test.mjs +25 -0
  227. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/render.test.mjs +54 -0
  228. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/requirements.test.mjs +33 -0
  229. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/rollup.test.mjs +80 -0
  230. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/schema.test.mjs +61 -0
  231. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/score-review.test.mjs +108 -0
  232. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/stage.mjs +32 -0
  233. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/workflow-script.test.mjs +24 -0
  234. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +58 -0
  235. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/validate.mjs +19 -0
  236. package/plugins/solution-architect/skills/new-lead/SKILL.md +4 -3
  237. package/plugins/solution-architect/skills/proposal/README.md +22 -7
  238. package/plugins/solution-architect/skills/proposal/SKILL.md +18 -7
  239. package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +143 -0
  240. package/plugins/solution-architect/skills/proposal/evals/evals.json +29 -11
  241. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/ARCHITECTURE.md +65 -0
  242. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/brief.md +21 -0
  243. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation-inputs.json +126 -0
  244. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation.json +215 -0
  245. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation-inputs.json +224 -34
  246. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.json +103 -114
  247. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.md +48 -22
  248. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation-inputs.json +211 -33
  249. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.json +102 -117
  250. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.md +48 -25
  251. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +31 -0
  252. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation-inputs.json +468 -0
  253. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation.json +773 -0
  254. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/measurements.jsonl +0 -0
  255. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
  256. package/plugins/solution-architect/skills/proposal/references/interview.md +3 -6
  257. package/plugins/solution-architect/skills/proposal/references/review.md +16 -4
  258. package/plugins/solution-architect/skills/proposal/references/workflow.md +88 -0
  259. package/plugins/solution-architect/skills/proposal/references/writing.md +33 -31
  260. package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +1 -1
  261. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +5 -22
  262. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +18 -8
  263. package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +6 -2
  264. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-body.mjs +42 -0
  265. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-package.mjs +56 -0
  266. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-xml.mjs +44 -0
  267. package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +24 -33
  268. package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +1 -1
  269. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-checks.mjs +71 -0
  270. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-cli.mjs +46 -0
  271. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-html.mjs +39 -0
  272. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-lead.mjs +45 -0
  273. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-page.mjs +30 -0
  274. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-view.mjs +80 -0
  275. package/plugins/solution-architect/skills/proposal/scripts/render.mjs +5 -1
  276. package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +50 -47
  277. package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +99 -40
  278. package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +11 -5
  279. package/plugins/solution-architect/skills/proposal/scripts/test/docx.test.mjs +68 -0
  280. package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +3 -3
  281. package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +46 -0
  282. package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +67 -54
  283. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +6 -1
  284. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +17 -0
  285. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +8 -12
  286. package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +3 -3
  287. package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +5 -4
  288. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-browser.test.mjs +96 -0
  289. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-checks.test.mjs +98 -0
  290. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-docs.test.mjs +25 -0
  291. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-render.test.mjs +75 -0
  292. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-stage.mjs +15 -0
  293. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-view.test.mjs +78 -0
  294. package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +4 -1
  295. package/plugins/solution-architect/workflows/review-links.js +61 -0
  296. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +0 -101
  297. package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +0 -89
  298. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +0 -64
  299. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +0 -154
  300. package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +0 -39
  301. package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +0 -131
  302. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +0 -251
  303. package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +0 -254
  304. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/slicing.md +0 -0
  305. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/agentic-checks.mjs +0 -0
  306. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/components.mjs +0 -0
  307. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/md-tables.mjs +0 -0
  308. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/scoring-checks.mjs +0 -0
  309. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/measurements.jsonl +0 -0
  310. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/zip.mjs +0 -0
  311. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/validate.mjs +0 -0
  312. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/baselines.mjs +0 -0
  313. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/measurements.mjs +0 -0
  314. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/score-diff.mjs +0 -0
@@ -1,251 +0,0 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import { readFileSync, writeFileSync, mkdtempSync } from 'node:fs';
4
- import { execFileSync } from 'node:child_process';
5
- import { tmpdir } from 'node:os';
6
- import { join } from 'node:path';
7
- import { inlineModule, extractExports, stripInternal } from '../lib/inline.mjs';
8
-
9
- const tpl = () => readFileSync(new URL('../../assets/estimate-template.html', import.meta.url), 'utf8');
10
- const cli = new URL('../render.mjs', import.meta.url).pathname;
11
- const fixture = new URL('./fixtures/booking-inputs.json', import.meta.url).pathname;
12
- const passMd = new URL('./fixtures/estimation-pass.md', import.meta.url).pathname;
13
- const computeCli = new URL('../compute.mjs', import.meta.url).pathname;
14
- const agenticFixture = new URL('./fixtures/agentic-inputs.json', import.meta.url).pathname;
15
- const agenticPassMd = new URL('./fixtures/agentic-estimation-pass.md', import.meta.url).pathname;
16
- const measurementsFixture = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
17
-
18
- function renderedPage(extra = []) {
19
- return renderWith(() => {}, extra);
20
- }
21
-
22
- // Same pipeline, with the booking inputs mutated first — for pages whose
23
- // shape depends on the scenarios (one team vs several, AI-only variants).
24
- function renderWith(mutate, extra = []) {
25
- const dir = mkdtempSync(join(tmpdir(), 'estimate-render-'));
26
- const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
27
- mutate(inputs);
28
- const inputsPath = join(dir, 'inputs.json');
29
- writeFileSync(inputsPath, JSON.stringify(inputs));
30
- const json = join(dir, 'estimation.json');
31
- execFileSync('node', [computeCli, '--inputs', inputsPath, '--out', json]);
32
- execFileSync('node', [cli, '--json', json, '--md', passMd, '--out', dir, ...extra]);
33
- return readFileSync(join(dir, 'estimate.html'), 'utf8');
34
- }
35
-
36
- // Agentic fixtures point measurementsPath at the shared fixture file, same
37
- // as validate.test.mjs's agenticEstimation() helper.
38
- function renderAgentic({ clientOnly = false } = {}) {
39
- const dir = mkdtempSync(join(tmpdir(), 'estimate-render-agentic-'));
40
- const inputs = JSON.parse(readFileSync(agenticFixture, 'utf8'));
41
- inputs.measurementsPath = measurementsFixture;
42
- const inputsPath = join(dir, 'inputs.json');
43
- writeFileSync(inputsPath, JSON.stringify(inputs));
44
- const json = join(dir, 'estimation.json');
45
- execFileSync('node', [computeCli, '--inputs', inputsPath, '--out', json]);
46
- execFileSync('node', [cli, '--json', json, '--md', agenticPassMd, '--out', dir, ...(clientOnly ? ['--client-only'] : [])]);
47
- return readFileSync(join(dir, 'estimate.html'), 'utf8');
48
- }
49
-
50
- test('render refuses a deliverable that fails validation', () => {
51
- const failMd = new URL('./fixtures/estimation-fail.md', import.meta.url).pathname;
52
- const dir = mkdtempSync(join(tmpdir(), 'estimate-render-'));
53
- const json = join(dir, 'estimation.json');
54
- execFileSync('node', [computeCli, '--inputs', fixture, '--out', json]);
55
- assert.throws(() => execFileSync('node', [cli, '--json', json, '--md', failMd, '--out', dir]));
56
- });
57
-
58
- test('template carries exactly the five slots and no external URLs', () => {
59
- const markers = [...tpl().matchAll(/<!-- slot:(\w+) -->/g)].map((m) => m[1]).sort();
60
- assert.deepEqual([...new Set(markers)], ['DATA', 'FONTS', 'GUIDE', 'TITLE', 'VIEWER']);
61
- // openxmlformats URIs are XML namespace identifiers the xlsx export writes
62
- // into generated sheets — never fetched, so the page stays self-contained.
63
- assert.doesNotMatch(tpl(), /https?:\/\/(?!www\.w3\.org|schemas\.openxmlformats\.org)/);
64
- });
65
-
66
- // Companion mode: the analyze-requirements viewer links this page, and this page links
67
- // back. The href is caller-supplied because only the caller knows where the
68
- // viewer was rendered; internal-only because a client file must not point at
69
- // an internal document set.
70
- test('--viewer adds an internal-only back-link; client-only strips it', () => {
71
- const withLink = renderedPage(['--viewer', '../viewer/index.html']);
72
- assert.match(withLink, /<a id="viewer-link" data-internal href="\.\.\/viewer\/index\.html">/);
73
- const without = renderedPage();
74
- assert.doesNotMatch(without, /<a id="viewer-link"/);
75
- const client = renderedPage(['--viewer', '../viewer/index.html', '--client-only']);
76
- assert.doesNotMatch(client, /<a id="viewer-link"/);
77
- });
78
-
79
- test('the --viewer href is attribute-escaped', () => {
80
- const html = renderedPage(['--viewer', '../a"b/index.html']);
81
- assert.match(html, /href="\.\.\/a&quot;b\/index\.html"/);
82
- });
83
-
84
- test('rendered page is self-contained and carries parseable data', () => {
85
- const html = renderedPage();
86
- assert.doesNotMatch(html, /<!-- slot:/);
87
- assert.match(html, /@font-face/);
88
- const data = html.match(/<script type="application\/json" id="estimation-data">([\s\S]*?)<\/script>/)[1];
89
- assert.equal(JSON.parse(data).inputs.project, 'Booking App');
90
- // No formula is inlined any more: the page reads committed numbers only.
91
- assert.doesNotMatch(html, /function pert\(/);
92
- assert.doesNotMatch(html, /function scenarioRollup\(|function taskHours\(/);
93
- });
94
-
95
- test('inlineModule strips export keywords; extractExports keeps only the named blocks', () => {
96
- assert.equal(inlineModule('export function f() {}\nexport const X = 1;\nconst y = 2;'),
97
- 'function f() {}\nconst X = 1;\nconst y = 2;');
98
- assert.equal(extractExports('export const A = 1;\nexport function b() {\n return A;\n}\nexport const C = 3;', ['b']),
99
- 'export function b() {\n return A;\n}');
100
- });
101
-
102
- test('the page carries a method section with source attributions', () => {
103
- const html = renderedPage();
104
- assert.match(html, /id="method"/);
105
- assert.match(html, /atomicobject\.com/); // sources cited in the page, not only in refs
106
- assert.match(html, /kmino\.io/);
107
- });
108
-
109
- test('the summary comes first and the method fold last — the number before the formula', () => {
110
- assert.match(tpl(), /<main>\s*<div class="col">\s*<section id="summary">/);
111
- assert.match(tpl(), /<section id="register"><\/section>\s*<section id="method"><\/section>\s*<\/div>\s*<\/main>/);
112
- });
113
-
114
- // The scenario cards, the cost bars and the what-if rail are gone: one
115
- // Summary block states the recommended team, months and cost once.
116
- test('the page has no scenario cards, cost bars or what-if rail', () => {
117
- const html = renderedPage();
118
- assert.doesNotMatch(html, /scenario-cards|cost-bars|ctl-|whatif|modified-banner|id="reset"/);
119
- assert.match(html, /id="summary"/);
120
- });
121
-
122
- test('the summary names the recommended team, its AI assistance, months and cost', () => {
123
- const html = renderedPage();
124
- // renderer source: the label rule, and the JSON it reads from
125
- assert.match(html, /humans unaided/);
126
- assert.match(html, /AI-assisted/);
127
- assert.match(html, /"recommendedScenario":"2eng-max5x"/);
128
- });
129
-
130
- // Only a different roster is an alternative worth a row; a same-team variant
131
- // that differs in AI assistance collapses to one line.
132
- test('renderer distinguishes team alternatives from AI-only variants', () => {
133
- const html = renderedPage();
134
- assert.match(html, /AI assistance: /); // the collapsed same-team line
135
- assert.match(html, /<caption>Alternatives<\/caption>/); // the different-roster table
136
- assert.match(html, /function sameTeam|const sameTeam/);
137
- });
138
-
139
- test('--figures adds the client-facing range line; without it there is none', () => {
140
- const dir = mkdtempSync(join(tmpdir(), 'estimate-figures-'));
141
- const figures = join(dir, 'proposal-figures.json');
142
- writeFileSync(figures, JSON.stringify({ scenario: '2eng-max5x', cost: { low: 5000, high: 7000 }, months: { low: 0.3, high: 0.5 } }));
143
- const withRange = renderedPage(['--figures', figures]);
144
- assert.match(withRange, /"figures":\{"cost":\{"low":5000,"high":7000\},"months":\{"low":0.3,"high":0.5\}\}/);
145
- const without = renderedPage();
146
- assert.doesNotMatch(without, /"figures":/);
147
- });
148
-
149
- test('recommendedReason travels with the data', () => {
150
- const html = renderWith((inputs) => { inputs.recommendedReason = 'client has one senior available'; });
151
- assert.match(html, /"recommendedReason":"client has one senior available"/);
152
- });
153
-
154
- test('the breakdown no longer carries a Range column', () => {
155
- assert.doesNotMatch(tpl(), /label: 'Range'/);
156
- });
157
-
158
- test('--client-only strips every internal range', () => {
159
- const html = renderedPage(['--client-only']);
160
- assert.doesNotMatch(html, /data-internal|internal:start|ctl-team/);
161
- assert.match(stripInternal('a<!-- internal:start -->X<!-- internal:end -->b'), /^ab$/);
162
- });
163
-
164
- test('--client-only redacts rates and cost breakdown unless exposeRatesToClient is set', () => {
165
- // Matched as quoted JSON keys, not bare identifiers: estimate-math.mjs is
166
- // inlined verbatim for the what-if engine and legitimately declares
167
- // `laborCost`/`toolingCost` as plain JS locals in every render, client or not.
168
- const html = renderedPage(['--client-only']);
169
- assert.doesNotMatch(html, /"rate":/);
170
- assert.doesNotMatch(html, /"laborCost":/);
171
- assert.doesNotMatch(html, /"toolingCost":/);
172
- });
173
-
174
- // The cite is internal shorthand — ticket phrases, file names, meeting
175
- // wording — so it never ships, rates opt-out or not. The anchor is the guide
176
- // sentence the client can read, and it stays.
177
- test('--client-only blanks the evidence cites and keeps the anchors', () => {
178
- const client = renderedPage(['--client-only']);
179
- assert.doesNotMatch(client, /slot conflict \+ cancellation rules/);
180
- assert.match(client, /Custom business logic, moderate algorithm complexity, multiple states/);
181
- assert.match(renderedPage(), /slot conflict \+ cancellation rules/);
182
- });
183
-
184
- test('--client-only keeps rates when exposeRatesToClient is true', () => {
185
- const dir = mkdtempSync(join(tmpdir(), 'estimate-render-'));
186
- const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
187
- inputs.exposeRatesToClient = true;
188
- const inputsPath = join(dir, 'inputs.json');
189
- writeFileSync(inputsPath, JSON.stringify(inputs));
190
- const json = join(dir, 'estimation.json');
191
- execFileSync('node', [computeCli, '--inputs', inputsPath, '--out', json]);
192
- execFileSync('node', [cli, '--json', json, '--md', passMd, '--out', dir, '--client-only']);
193
- const html = readFileSync(join(dir, 'estimate.html'), 'utf8');
194
- assert.match(html, /"rate":/);
195
- });
196
-
197
- test('component data survives the client-only render', () => {
198
- // deliberate: names come from the architecture doc the client already sees;
199
- // costs stay redacted — the rollup shows hours/share only
200
- const client = renderedPage(['--client-only']);
201
- assert.match(client, /"components":/);
202
- assert.match(client, /"component":"api"/);
203
- });
204
-
205
- test('the rendered page carries the roadmap section markup', () => {
206
- const html = renderedPage();
207
- assert.match(html, /id="roadmap"/);
208
- assert.match(html, /roadmapRow|roadmap-row/); // renderer present, not stripped
209
- });
210
-
211
- // Agentic template routing.
212
- test('agentic estimation renders the agentic template', () => {
213
- const html = renderAgentic();
214
- assert.match(html, /Delivery: agentic/);
215
- assert.match(html, /UNCALIBRATED/);
216
- assert.match(html, /Refactor A/); // evidence rendered from computed data
217
- assert.doesNotMatch(html, /boilerplate/); // no AI-category machinery on this page
218
- });
219
-
220
- test('agentic client render still redacts rates', () => {
221
- const html = renderAgentic({ clientOnly: true });
222
- assert.doesNotMatch(html, /"rate":/);
223
- });
224
-
225
- test('agentic client render strips the measurements path, repository, and evidence descriptions', () => {
226
- const full = renderAgentic();
227
- assert.match(full, new RegExp(measurementsFixture.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
228
- assert.match(full, /"repository":"project-a"/);
229
- assert.match(full, /Refactor A/);
230
-
231
- const client = renderAgentic({ clientOnly: true });
232
- assert.doesNotMatch(client, new RegExp(measurementsFixture.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
233
- assert.doesNotMatch(client, /"measurementsPath":/);
234
- assert.doesNotMatch(client, /"repository":/);
235
- assert.doesNotMatch(client, /Refactor A/);
236
- assert.doesNotMatch(client, />undefined</); // renderEvidence tolerates a stripped description
237
- });
238
-
239
- test('the page never derives scores and carries the guide from the reference file', () => {
240
- const html = renderedPage();
241
- for (const gone of ['deriveScores', 'TECH_CATEGORY_SCORE', 'scoreTier', 'SCORE_GUIDE', 'bdModePill', 'bdMode(', 'derived:']) {
242
- assert.equal(html.includes(gone), false, `${gone} must not be in the page`);
243
- }
244
- assert.match(html, /<template id="scoring-guide"><table class="guide-table">/);
245
- assert.ok(html.includes('Payments, auth, data migrations, or PII — high business impact'));
246
- });
247
-
248
- test('the agentic page has no guide slot', () => {
249
- const html = renderAgentic();
250
- assert.doesNotMatch(html, /scoring-guide/);
251
- });
@@ -1,254 +0,0 @@
1
- // The Feature breakdown's spreadsheet export: an internal-only button that
2
- // clones the sample estimator workbook in the browser, fills tab 1 with the
3
- // currently visible rows, and keeps every tier/price formula live in-cell.
4
- import { test } from 'node:test';
5
- import assert from 'node:assert/strict';
6
- import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
7
- import { execFileSync } from 'node:child_process';
8
- import { tmpdir } from 'node:os';
9
- import { join } from 'node:path';
10
- import { pathToFileURL } from 'node:url';
11
- import { findChrome } from '../../../analyze-requirements/scripts/lib/chrome.mjs';
12
- import { openPage } from '../../../analyze-requirements/scripts/lib/cdp.mjs';
13
- import { readZip } from './zip.mjs';
14
-
15
- const skip = { skip: !findChrome() && 'no chrome on PATH' };
16
- const fixture = new URL('./fixtures/booking-inputs.json', import.meta.url).pathname;
17
-
18
- function buildPage(inputsPath = fixture) {
19
- const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-'));
20
- const scripts = new URL('..', import.meta.url).pathname;
21
- const passMd = join(scripts, 'test/fixtures/estimation-pass.md');
22
- execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', inputsPath, '--out', join(dir, 'estimation.json')]);
23
- execFileSync('node', [join(scripts, 'render.mjs'), '--json', join(dir, 'estimation.json'), '--md', passMd, '--out', dir]);
24
- return pathToFileURL(join(dir, 'estimate.html')).href;
25
- }
26
-
27
- async function exportedFiles(page) {
28
- const b64 = await page.eval('window.__buildWorkbook()');
29
- return readZip(Buffer.from(b64, 'base64'));
30
- }
31
-
32
- const sheet1 = (files) => files.get('xl/worksheets/sheet1.xml').toString('utf8');
33
- const cell = (xml, ref) => new RegExp(`<c r="${ref}"[^>]*?(?:/>|>(.*?)</c>)`, 's').exec(xml)?.[1] ?? '';
34
- const inlineText = (frag) => /<t[^>]*>([^<]*)<\/t>/.exec(frag)?.[1];
35
- const cellNumber = (frag) => Number(/<v>([^<]*)<\/v>/.exec(frag)?.[1]);
36
- const cellFormula = (frag) => /<f>([^<]*)<\/f>/.exec(frag)?.[1];
37
-
38
- // The workbook carries a Task Breakdown sheet and a Score Rationale sheet, so
39
- // the export answers for the whole section rather than for either tab.
40
- test('the section heading carries an internal-only download button', skip, async () => {
41
- const page = await openPage(buildPage());
42
- try {
43
- assert.ok(await page.eval(
44
- `!!document.querySelector('#feature-table .sec-head button[data-download][data-internal]')`),
45
- 'expected a data-download button marked data-internal on the section heading');
46
- } finally { page.close(); }
47
- });
48
-
49
- test('the export clones the sample workbook with its guide tabs intact', skip, async () => {
50
- const page = await openPage(buildPage());
51
- try {
52
- const files = await exportedFiles(page);
53
- for (const name of ['xl/worksheets/sheet1.xml', 'xl/worksheets/sheet2.xml',
54
- 'xl/worksheets/sheet3.xml', 'xl/styles.xml', '[Content_Types].xml']) {
55
- assert.ok(files.has(name), `${name} missing from the exported archive`);
56
- }
57
- const workbook = files.get('xl/workbook.xml').toString('utf8');
58
- assert.match(workbook, /Scoring Guide/);
59
- assert.match(workbook, /Tier Reference/);
60
- } finally { page.close(); }
61
- });
62
-
63
- test('rows land ordered by milestone with the interview scores verbatim', skip, async () => {
64
- const page = await openPage(buildPage());
65
- try {
66
- const xml = sheet1(await exportedFiles(page));
67
- assert.equal(inlineText(cell(xml, 'A7')), 'User can book appointment');
68
- assert.equal(inlineText(cell(xml, 'A8')), 'Email reminders');
69
- assert.deepEqual(['B', 'C', 'D', 'E', 'F'].map((c) => cellNumber(cell(xml, `${c}7`))), [3, 3, 2, 3, 3]);
70
- assert.deepEqual(['B', 'C', 'D', 'E', 'F'].map((c) => cellNumber(cell(xml, `${c}8`))), [2, 2, 3, 2, 2]);
71
- } finally { page.close(); }
72
- });
73
-
74
- // Row 6 is the sample workbook's own header row — the export never writes it,
75
- // it writes scores into B–F underneath. Pin the seam: if the sample's score
76
- // columns are ever reordered or renamed, every exported score lands under the
77
- // wrong heading and nothing else would notice. The sample keeps these as
78
- // shared strings, unlike the cells the export writes inline.
79
- function sharedText(files, frag) {
80
- const idx = Number(/<v>(\d+)<\/v>/.exec(frag)?.[1]);
81
- const items = [...files.get('xl/sharedStrings.xml').toString('utf8').matchAll(/<si>([\s\S]*?)<\/si>/g)];
82
- return [...items[idx][1].matchAll(/<t[^>]*>([^<]*)<\/t>/g)].map((m) => m[1]).join('');
83
- }
84
-
85
- const headerText = (files, frag) => inlineText(frag) ?? sharedText(files, frag);
86
-
87
- test('the score columns sit under the sample workbook\'s five score headers', skip, async () => {
88
- const page = await openPage(buildPage());
89
- try {
90
- const files = await exportedFiles(page);
91
- const xml = sheet1(files);
92
- assert.deepEqual(['B', 'C', 'D', 'E', 'F'].map((c) => headerText(files, cell(xml, `${c}6`))),
93
- ['TECH\nCOMPLEXITY\n(1–5)', 'FEATURE\nSIZE\n(1–5)', 'DEPEND-\nENCIES\n(1–5)',
94
- 'UNCER-\nTAINTY\n(1–5)', 'RISK\n(1–5)']);
95
- } finally { page.close(); }
96
- });
97
-
98
- test('column N carries the plain-words note for sales readers', skip, async () => {
99
- const page = await openPage(buildPage());
100
- try {
101
- const xml = sheet1(await exportedFiles(page));
102
- assert.equal(inlineText(cell(xml, 'N6')), 'WHY THIS TIER');
103
- assert.match(inlineText(cell(xml, 'N7')) ?? '', /open questions/);
104
- assert.match(xml, /<autoFilter ref="A6:N26"\/>/);
105
- } finally { page.close(); }
106
- });
107
-
108
- const sheetRationale = (files) => files.get('xl/worksheets/sheet5.xml')?.toString('utf8') ?? '';
109
-
110
- test('a Score Rationale tab lists anchor, evidence and both sources per factor', skip, async () => {
111
- const page = await openPage(buildPage());
112
- try {
113
- const files = await exportedFiles(page);
114
- assert.match(files.get('xl/workbook.xml').toString('utf8'), /name="Score Rationale"/);
115
- assert.match(files.get('xl/_rels/workbook.xml.rels').toString('utf8'), /Target="worksheets\/sheet5\.xml"/);
116
- assert.match(files.get('[Content_Types].xml').toString('utf8'), /PartName="\/xl\/worksheets\/sheet5\.xml"/);
117
- const xml = sheetRationale(files);
118
- assert.deepEqual(['A1', 'B1', 'C1', 'D1', 'E1', 'F1', 'G1'].map((r) => inlineText(cell(xml, r))),
119
- ['FEATURE', 'FACTOR', 'SCORE', 'ANCHOR', 'EVIDENCE', 'FEATURE SOURCE', 'SCORE ORIGIN']);
120
- assert.equal(inlineText(cell(xml, 'A2')), 'User can book appointment');
121
- assert.equal(inlineText(cell(xml, 'B2')), 'Tech');
122
- assert.equal(cellNumber(cell(xml, 'C2')), 3);
123
- assert.equal(inlineText(cell(xml, 'D2')), 'Custom business logic, moderate algorithm complexity, multiple states');
124
- assert.equal(inlineText(cell(xml, 'E2')), 'slot conflict + cancellation rules');
125
- assert.equal(inlineText(cell(xml, 'F2')), 'stated'); // the client asked for the feature
126
- assert.equal(inlineText(cell(xml, 'G2')), 'reviewer changed'); // and a human edited its score
127
- assert.match(xml, /<autoFilter ref="A1:G11"\/>/); // 2 features × 5 factors
128
- } finally { page.close(); }
129
- });
130
-
131
- // The two columns answer different questions about different people — whether
132
- // the client asked for the feature, and whether a reviewer overrode the
133
- // agent's score. The booking fixture happens to agree on both, so this pins
134
- // them apart: one feature the client asked for, whose score nobody touched.
135
- test('feature source and score origin are read from separate fields', skip, async () => {
136
- const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-sources-'));
137
- const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
138
- inputs.features[0].provenance = 'stated';
139
- inputs.features[0].scoreProvenance = 'proposed';
140
- const inputsPath = join(dir, 'inputs.json');
141
- writeFileSync(inputsPath, JSON.stringify(inputs));
142
- const page = await openPage(buildPage(inputsPath));
143
- try {
144
- const xml = sheetRationale(await exportedFiles(page));
145
- assert.equal(inlineText(cell(xml, 'F2')), 'stated');
146
- assert.equal(inlineText(cell(xml, 'G2')), 'agent proposed');
147
- assert.deepEqual(page.errors, []);
148
- } finally { page.close(); }
149
- });
150
-
151
- test('QUICK inputs export blank score cells and an empty rationale tab', skip, async () => {
152
- const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-quick-'));
153
- const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
154
- inputs.depth = 'QUICK';
155
- for (const f of inputs.features) {
156
- delete f.scores; delete f.scoreNote; delete f.scoreProvenance;
157
- f.tasks = [{ ...f.tasks[0], id: `${f.id}-band`, o: 60, m: 110, p: 160 }];
158
- }
159
- const inputsPath = join(dir, 'inputs.json');
160
- writeFileSync(inputsPath, JSON.stringify(inputs));
161
- const page = await openPage(buildPage(inputsPath));
162
- try {
163
- const files = await exportedFiles(page);
164
- const xml = sheet1(files);
165
- assert.equal(cell(xml, 'B7'), '', 'no score value at QUICK');
166
- assert.match(xml, /<c r="B7" s="\d+"\/>/);
167
- assert.match(sheetRationale(files), /<autoFilter ref="A1:G1"\/>/);
168
- } finally { page.close(); }
169
- });
170
-
171
- test('score math stays in the sheet: G-K are formulas, total row uses SUMIF', skip, async () => {
172
- const page = await openPage(buildPage());
173
- try {
174
- const xml = sheet1(await exportedFiles(page));
175
- assert.match(cellFormula(cell(xml, 'G7')) ?? '', /SUM\(B7:F7\)/);
176
- assert.match(cellFormula(cell(xml, 'H7')) ?? '', /IF\(/);
177
- for (const ref of ['I7', 'J7', 'K7']) {
178
- assert.ok(cellFormula(cell(xml, ref)), `${ref} must hold a formula, not a baked value`);
179
- }
180
- assert.equal(inlineText(cell(xml, 'A27')), 'PROJECT TOTAL');
181
- assert.match(cellFormula(cell(xml, 'G27')) ?? '', /SUMIF\(G7:G26/);
182
- } finally { page.close(); }
183
- });
184
-
185
- test('milestone and container fill L/M under an autofiltered header', skip, async () => {
186
- const page = await openPage(buildPage());
187
- try {
188
- const xml = sheet1(await exportedFiles(page));
189
- assert.equal(inlineText(cell(xml, 'L6')), 'MILESTONE');
190
- assert.equal(inlineText(cell(xml, 'M6')), 'CONTAINER');
191
- assert.equal(inlineText(cell(xml, 'L7')), 'M1 - Booking core');
192
- assert.equal(inlineText(cell(xml, 'M7')), 'Booking API');
193
- assert.equal(inlineText(cell(xml, 'M8')), 'Notification Service');
194
- assert.match(xml, /<autoFilter ref="A6:N26"\/>/);
195
- } finally { page.close(); }
196
- });
197
-
198
- test('the export honours the active source filter', skip, async () => {
199
- const page = await openPage(buildPage());
200
- try {
201
- await page.eval(`(() => {
202
- const sel = document.querySelector('#feature-table select[data-select="prov"]');
203
- sel.value = 'stated';
204
- sel.dispatchEvent(new Event('change', { bubbles: true }));
205
- })()`);
206
- const xml = sheet1(await exportedFiles(page));
207
- assert.match(xml, /User can book appointment/);
208
- assert.doesNotMatch(xml, /Email reminders/);
209
- assert.equal(inlineText(cell(xml, 'A27')), 'PROJECT TOTAL', 'total row must survive filtering');
210
- } finally { page.close(); }
211
- });
212
-
213
- const sheetTasks = (files) => files.get('xl/worksheets/sheet4.xml')?.toString('utf8') ?? '';
214
-
215
- test('the export adds a registered Task Breakdown tab', skip, async () => {
216
- const page = await openPage(buildPage());
217
- try {
218
- const files = await exportedFiles(page);
219
- assert.ok(files.has('xl/worksheets/sheet4.xml'), 'sheet4.xml missing');
220
- assert.match(files.get('xl/workbook.xml').toString('utf8'), /name="Task Breakdown"/);
221
- assert.match(files.get('xl/_rels/workbook.xml.rels').toString('utf8'), /Target="worksheets\/sheet4\.xml"/);
222
- assert.match(files.get('[Content_Types].xml').toString('utf8'), /PartName="\/xl\/worksheets\/sheet4\.xml"/);
223
- } finally { page.close(); }
224
- });
225
-
226
- test('task rows carry the PERT formula in-cell and ride the feature filter', skip, async () => {
227
- const page = await openPage(buildPage());
228
- try {
229
- await page.eval(`(() => {
230
- const sel = document.querySelector('#feature-table select[data-select="prov"]');
231
- sel.value = 'stated';
232
- sel.dispatchEvent(new Event('change', { bubbles: true }));
233
- })()`);
234
- const xml = sheetTasks(await exportedFiles(page));
235
- assert.equal(inlineText(cell(xml, 'A2')), 'User can book appointment');
236
- assert.equal(inlineText(cell(xml, 'B2')), 'Booking CRUD API');
237
- assert.deepEqual(['D2', 'E2', 'F2'].map((r) => cellNumber(cell(xml, r))), [16, 24, 40]);
238
- assert.match(cellFormula(cell(xml, 'G2')) ?? '', /\(D2\+4\*E2\+F2\)\/6/);
239
- assert.equal(inlineText(cell(xml, 'H2')), 'HIGH');
240
- assert.equal(inlineText(cell(xml, 'K2')), 'Booking API');
241
- assert.doesNotMatch(xml, /Scheduled reminder jobs/, 'filtered-out feature tasks must not export');
242
- } finally { page.close(); }
243
- });
244
-
245
- test('the task tab is filterable and sortable: autofilter over a frozen header', skip, async () => {
246
- const page = await openPage(buildPage());
247
- try {
248
- const xml = sheetTasks(await exportedFiles(page));
249
- assert.equal(inlineText(cell(xml, 'A1')), 'FEATURE');
250
- // 3 fixture tasks under rows 2-4
251
- assert.match(xml, /<autoFilter ref="A1:K4"\/>/);
252
- assert.match(xml, /<pane ySplit="1"[^>]*state="frozen"/);
253
- } finally { page.close(); }
254
- });