@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
@@ -0,0 +1,143 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
4
+ import { execFileSync } from 'node:child_process';
5
+ import { tmpdir } from 'node:os';
6
+ import { join } from 'node:path';
7
+ import { pathToFileURL } from 'node:url';
8
+ import { findChrome } from '../../../../analyze-requirements/scripts/lib/chrome.mjs';
9
+ import { openPage } from '../../../../analyze-requirements/scripts/lib/cdp.mjs';
10
+
11
+ const skip = { skip: !findChrome() && 'no chrome on PATH' };
12
+ const fixture = new URL('./fixtures/agentic-inputs.json', import.meta.url).pathname;
13
+ const passMd = new URL('./fixtures/agentic-estimation-pass.md', import.meta.url).pathname;
14
+ const measurementsFixture = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
15
+
16
+ // Agentic estimation.json never carries scenarios or months (schema.mjs
17
+ // refuses `scenarios` outright), so this is the browser-level guard the
18
+ // team fixture already gets in browser.test.mjs: build the page, actually
19
+ // open it in Chrome and read the DOM, rather than pattern-matching template
20
+ // source or the embedded JSON blob the way render.test.mjs does.
21
+ function buildPage(extra = [], mutate = () => {}, mdExtra = '') {
22
+ const dir = mkdtempSync(join(tmpdir(), 'estimate-browser-agentic-'));
23
+ const scripts = new URL('..', import.meta.url).pathname;
24
+ const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
25
+ inputs.measurementsPath = measurementsFixture;
26
+ mutate(inputs);
27
+ const inputsPath = join(dir, 'inputs.json');
28
+ writeFileSync(inputsPath, JSON.stringify(inputs));
29
+ const json = join(dir, 'estimation.json');
30
+ const md = join(dir, 'estimation.md');
31
+ writeFileSync(md, readFileSync(passMd, 'utf8') + mdExtra);
32
+ execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', inputsPath, '--out', json]);
33
+ execFileSync('node', [join(scripts, 'render.mjs'), '--json', json, '--md', md, '--out', dir, ...extra]);
34
+ return pathToFileURL(join(dir, 'estimate.html')).href;
35
+ }
36
+
37
+ // What a reader actually sees: a clone of <body> with <script>/<style> torn
38
+ // out, then its textContent. Not `document.body.textContent` (which walks
39
+ // the JS source and embedded JSON, so it flags a `$0`/`month` that only
40
+ // exists in a code comment — a false positive, not the leak this check is
41
+ // for). Not `innerText` either — that also drops nodes the client-view
42
+ // toggle hides via `display:none` without removing from the DOM
43
+ // ([data-internal]), which is exactly where a leaked `$0` would hide.
44
+ function readerText(page) {
45
+ return page.eval(`(() => {
46
+ const clone = document.body.cloneNode(true);
47
+ clone.querySelectorAll('script,style').forEach((n) => n.remove());
48
+ return clone.textContent;
49
+ })()`);
50
+ }
51
+
52
+ // The binding user decision: agentic mode is not priced, and the page must
53
+ // never present a bare zero as if it were a quote. R50 keys this off
54
+ // computed.price.p50 === 0, which every agentic estimate hits today (no
55
+ // feature ever carries a score under this model).
56
+ async function assertUnpriced(page) {
57
+ assert.deepEqual(page.errors, []);
58
+ assert.match(await page.eval(`document.querySelector('#summary .lead')?.textContent`), /not priced/i);
59
+ assert.match(await page.eval(`document.querySelector('#summary .figures')?.textContent`), /\d+(\.\d+)? h$/);
60
+ const body = await readerText(page);
61
+ assert.doesNotMatch(body, /\$0\b/);
62
+ assert.doesNotMatch(body, /month/i);
63
+ }
64
+
65
+ test('the agentic page renders measured hours and states plainly it is not priced', skip, async () => {
66
+ const page = await openPage(buildPage());
67
+ try { await assertUnpriced(page); } finally { page.close(); }
68
+ });
69
+
70
+ test('the --client-only agentic page renders the same unpriced state without throwing', skip, async () => {
71
+ const page = await openPage(buildPage(['--client-only']));
72
+ try { await assertUnpriced(page); } finally { page.close(); }
73
+ });
74
+
75
+ // redact.mjs strips a task's provenance/assumptions (R49) and an evidence
76
+ // entry's description (R48) from the client render — taskRow/renderEvidence
77
+ // must not throw or print "undefined" once those keys are gone.
78
+ test('the client-only page tolerates redacted task fields without throwing', skip, async () => {
79
+ const page = await openPage(buildPage(['--client-only']));
80
+ try {
81
+ assert.deepEqual(page.errors, []);
82
+ assert.ok(await page.eval(`document.querySelectorAll('#detail tbody tr').length > 0`));
83
+ assert.doesNotMatch(await page.eval(`document.getElementById('detail').textContent`), /undefined/);
84
+ assert.doesNotMatch(await page.eval(`document.getElementById('evidence').textContent`), /undefined/);
85
+ } finally { page.close(); }
86
+ });
87
+
88
+ // Milestone-tagged features do exist for agentic estimations even though the
89
+ // shared fixture carries none — the roadmap must draw the same share-of-effort
90
+ // bars the team page does, not the retired month Gantt.
91
+ const ROADMAP_MD = `
92
+ ### Roadmap
93
+
94
+ Bands are relative shares of total effort, not durations.
95
+
96
+ | Milestone | Share |
97
+ | --- | --- |
98
+ | M1 - Plan | 50% |
99
+ | M2 - Swap | 50% |
100
+ `;
101
+
102
+ test('a milestone-tagged agentic estimate draws share-based roadmap bars, not months', skip, async () => {
103
+ const page = await openPage(buildPage([], (inputs) => {
104
+ inputs.features[0].milestone = 'M1 - Plan';
105
+ inputs.features[1].milestone = 'M2 - Swap';
106
+ }, ROADMAP_MD));
107
+ try {
108
+ assert.deepEqual(page.errors, []);
109
+ const shares = await page.eval(`[...document.querySelectorAll('#roadmap .roadmap-share')].map((s) => s.textContent)`);
110
+ assert.equal(shares.length, 2);
111
+ assert.ok(shares.every((s) => /%$/.test(s)), `expected percentages, got ${shares}`);
112
+ assert.equal(await page.eval(`document.querySelector('#roadmap .roadmap-months')`), null);
113
+ assert.doesNotMatch(await page.eval(`document.getElementById('roadmap').textContent`), /\bmo\b/);
114
+ } finally { page.close(); }
115
+ });
116
+
117
+ // R51: recommendedReason is not scenario-specific (schema.mjs only refuses
118
+ // scenarios/recommendedScenario) and redact.mjs still strips it
119
+ // unconditionally from every client render — so the agentic page must render
120
+ // it internally, the way the team page's summaryApproach() does, and never
121
+ // carry it in the --client-only bytes.
122
+ test('a written approach note renders under the agentic summary, internal-only', skip, async () => {
123
+ const page = await openPage(buildPage([], (inputs) => {
124
+ inputs.recommendedReason = 'the client wants a spike before committing scope';
125
+ }));
126
+ try {
127
+ assert.equal(await page.eval(`document.querySelector('#summary .why')?.textContent`),
128
+ 'Approach: the client wants a spike before committing scope.');
129
+ assert.ok(await page.eval(`document.querySelector('#summary .why')?.closest('[data-internal]')`),
130
+ 'the approach note must be marked internal-only');
131
+ assert.deepEqual(page.errors, []);
132
+ } finally { page.close(); }
133
+ });
134
+
135
+ test('the client-only agentic page does not carry the written approach note', skip, async () => {
136
+ const page = await openPage(buildPage(['--client-only'], (inputs) => {
137
+ inputs.recommendedReason = 'we quoted low to beat the incumbent bid';
138
+ }));
139
+ try {
140
+ assert.equal(await page.eval(`document.querySelector('#summary .why')`), null);
141
+ assert.deepEqual(page.errors, []);
142
+ } finally { page.close(); }
143
+ });
@@ -5,29 +5,41 @@ import { execFileSync } from 'node:child_process';
5
5
  import { tmpdir } from 'node:os';
6
6
  import { join } from 'node:path';
7
7
  import { pathToFileURL } from 'node:url';
8
- import { findChrome } from '../../../analyze-requirements/scripts/lib/chrome.mjs';
9
- import { openPage } from '../../../analyze-requirements/scripts/lib/cdp.mjs';
8
+ import { findChrome } from '../../../../analyze-requirements/scripts/lib/chrome.mjs';
9
+ import { openPage } from '../../../../analyze-requirements/scripts/lib/cdp.mjs';
10
10
 
11
11
  const skip = { skip: !findChrome() && 'no chrome on PATH' };
12
12
  const fixture = new URL('./fixtures/booking-inputs.json', import.meta.url).pathname;
13
13
 
14
+ // The deliverable gate cross-checks the document's presented range against the
15
+ // computed one, so a fixture variant that prices differently needs the range
16
+ // it actually priced. The booking fixture's own numbers are unchanged.
17
+ function pricedMd(jsonPath) {
18
+ const md = readFileSync(new URL('./fixtures/estimation-pass.md', import.meta.url), 'utf8');
19
+ const { presentLow, presentHigh } = JSON.parse(readFileSync(jsonPath, 'utf8')).computed.price;
20
+ return md.replace(/\| Presented range \|[^|]*\|/,
21
+ `| Presented range | $${presentLow.toLocaleString('en-US')} – $${presentHigh.toLocaleString('en-US')} |`);
22
+ }
23
+
14
24
  function buildPage(extra = [], inputsPath = fixture) {
15
25
  const dir = mkdtempSync(join(tmpdir(), 'estimate-browser-'));
16
26
  const scripts = new URL('..', import.meta.url).pathname;
17
- const passMd = join(scripts, 'test/fixtures/estimation-pass.md');
18
- execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', inputsPath, '--out', join(dir, 'estimation.json')]);
19
- execFileSync('node', [join(scripts, 'render.mjs'), '--json', join(dir, 'estimation.json'), '--md', passMd, '--out', dir, ...extra]);
27
+ const json = join(dir, 'estimation.json');
28
+ const md = join(dir, 'estimation.md');
29
+ execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', inputsPath, '--out', json]);
30
+ writeFileSync(md, pricedMd(json));
31
+ execFileSync('node', [join(scripts, 'render.mjs'), '--json', json, '--md', md, '--out', dir, ...extra]);
20
32
  return pathToFileURL(join(dir, 'estimate.html')).href;
21
33
  }
22
34
 
23
35
  // The booking inputs with a mutation applied, for pages whose shape depends
24
- // on the scenarios.
25
- function buildPageWith(mutate) {
36
+ // on an input the fixture does not carry (an extra feature, a written reason).
37
+ function buildPageWith(mutate, extra = []) {
26
38
  const dir = mkdtempSync(join(tmpdir(), 'estimate-browser-inputs-'));
27
39
  const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
28
40
  mutate(inputs);
29
41
  writeFileSync(join(dir, 'inputs.json'), JSON.stringify(inputs));
30
- return buildPage([], join(dir, 'inputs.json'));
42
+ return buildPage(extra, join(dir, 'inputs.json'));
31
43
  }
32
44
 
33
45
 
@@ -41,6 +53,8 @@ test('every section explains itself: help icons plus a rendered method section',
41
53
  assert.match(method, /three-point-pert/); // technique named from inputs
42
54
  assert.match(method, /PERT/);
43
55
  assert.match(method, /atomicobject\.com/);
56
+ // a field removed from schema.mjs or computed still must not print undefined/NaN
57
+ assert.doesNotMatch(method, /undefined|NaN/);
44
58
  // open by default: the method explains the page up front; still collapsible
45
59
  assert.equal(await page.eval(`document.querySelector('#method details.method-fold').open`), true);
46
60
  await page.eval(`document.querySelector('#method details.method-fold summary').click()`);
@@ -53,7 +67,7 @@ test('client view hides internals; theme toggle flips the root attribute', skip,
53
67
  try {
54
68
  await page.eval(`document.getElementById('view-toggle').click()`);
55
69
  assert.equal(await page.eval(
56
- `getComputedStyle(document.querySelector('#summary .alts')).display`), 'none');
70
+ `getComputedStyle(document.querySelector('#summary .working')).display`), 'none');
57
71
  await page.eval(`document.getElementById('theme-toggle').click()`);
58
72
  assert.equal(await page.eval(`document.documentElement.dataset.theme`), 'light');
59
73
  } finally { page.close(); }
@@ -71,6 +85,26 @@ test('the --client-only page boots clean without its stripped controls', skip, a
71
85
  } finally { page.close(); }
72
86
  });
73
87
 
88
+ // render.test.mjs's byte check of a can't-fail assertion asked, in spirit,
89
+ // "does the client page contain no internal-only nodes?" — a DOM question.
90
+ // It is not "zero [data-internal] nodes exist": several are unconditional,
91
+ // always-rendered UI chrome (the empty price-working container, the xlsx
92
+ // download button, the expand-all control, a feature's expand button) that
93
+ // exist in every render, client-only included, and rely entirely on the
94
+ // `.view-client [data-internal] { display:none }` rule — not on being absent
95
+ // — for the toggle-preview mechanism this template already uses everywhere.
96
+ // A `=== null` assertion here would fail on that legitimate chrome, not on a
97
+ // leak. The honest, breakable question is: is every one of them invisible?
98
+ test('every internal-marked node on the client-only page is hidden, not just absent from data', skip, async () => {
99
+ const page = await openPage(buildPage(['--client-only']));
100
+ try {
101
+ const visible = await page.eval(`[...document.querySelectorAll('[data-internal]')]
102
+ .filter((el) => getComputedStyle(el).display !== 'none')
103
+ .map((el) => el.tagName + (el.id ? '#' + el.id : '') + (el.className ? '.' + el.className : ''))`);
104
+ assert.deepEqual(visible, []);
105
+ } finally { page.close(); }
106
+ });
107
+
74
108
  test('feature breakdown absorbs the effort chart and the task register', skip, async () => {
75
109
  const page = await openPage(buildPage());
76
110
  try {
@@ -262,10 +296,7 @@ test('roadmap bands segment by container; clicking a row drives the breakdown',
262
296
  // rows by container, so the stripe colors cluster the way the band's segments
263
297
  // do — the roadmap colors and the breakdown colors tell the same story.
264
298
  test('a roadmap click groups the breakdown rows by container', skip, async () => {
265
- const dir = mkdtempSync(join(tmpdir(), 'estimate-browser-'));
266
- const scripts = new URL('..', import.meta.url).pathname;
267
- const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
268
- inputs.features.push({
299
+ const url = buildPageWith((inputs) => inputs.features.push({
269
300
  id: 'audit', name: 'Booking audit log', provenance: 'proposed',
270
301
  component: 'api', milestone: 'M2 - Notifications',
271
302
  scores: {
@@ -279,11 +310,8 @@ test('a roadmap click groups the breakdown rows by container', skip, async () =>
279
310
  scoreProvenance: 'proposed',
280
311
  tasks: [{ id: 'audit-log', name: 'Audit log writes', category: 'boilerplate',
281
312
  o: 4, m: 6, p: 10, confidence: 'MED', assumptions: [], provenance: 'proposed' }],
282
- });
283
- writeFileSync(join(dir, 'inputs.json'), JSON.stringify(inputs));
284
- execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', join(dir, 'inputs.json'), '--out', join(dir, 'estimation.json')]);
285
- execFileSync('node', [join(scripts, 'render.mjs'), '--json', join(dir, 'estimation.json'), '--md', join(scripts, 'test/fixtures/estimation-pass.md'), '--out', dir]);
286
- const page = await openPage(pathToFileURL(join(dir, 'estimate.html')).href);
313
+ }));
314
+ const page = await openPage(url);
287
315
  try {
288
316
  const ids = () => page.eval(
289
317
  `[...document.querySelectorAll('#panel-estimate tr.feat-row')].map((r) => r.dataset.id)`);
@@ -415,11 +443,18 @@ const headTexts = stripArrow(BD_HEAD);
415
443
  const scoreHeadTexts = stripArrow(SCORE_HEAD);
416
444
  const clickTab = (tab) => `document.querySelector('#feature-table [role="tab"][data-tab="${tab}"]').click()`;
417
445
 
418
- test('the scoring tab carries the five factors, Σ and tier; values verbatim from inputs', skip, async () => {
446
+ // The total is a weighted score, not a sum — (3,3,4,2,4) weighs 15.5, not
447
+ // 16 — and the tier cut-offs are the v2 band edges, where an edge prices
448
+ // into the upper band.
449
+ test('the scoring tab carries the five factors, the weighted score and tier; values verbatim from inputs', skip, async () => {
419
450
  const page = await openPage(buildPage());
420
451
  try {
421
452
  assert.deepEqual(await page.eval(scoreHeadTexts),
422
- ['Feature', 'Tech', 'Size', 'Deps', 'Unc', 'Risk', 'Σ', 'Tier']);
453
+ ['Feature', 'Tech', 'Size', 'Deps', 'Unc', 'Risk', 'Score', 'Tier']);
454
+ const hints = await page.eval(`[...document.querySelectorAll('#panel-scoring > .bd-scroll th button')].map((b) => b.title)`);
455
+ assert.match(hints[6], /weighted/i);
456
+ assert.doesNotMatch(hints[6], /sum of the five/);
457
+ assert.equal(hints[7], 'S < 11.5 / M < 17.5 / L < 22.5 / XL from 22.5');
423
458
  const booking = await page.eval(cellTexts('#panel-scoring tr[data-id="booking"] td.score'));
424
459
  assert.deepEqual(booking.slice(0, 5), ['3', '3', '2', '3', '3']);
425
460
  assert.equal(booking[5], '14');
@@ -443,15 +478,19 @@ test('score cells explain themselves: anchor + cite on hover, note under the nam
443
478
  } finally { page.close(); }
444
479
  });
445
480
 
446
- test('⚠ marks a feature whose PERT hours fall outside its tier band', skip, async () => {
481
+ // The hours calibration bands no longer bound anything: a tier is 70% risk,
482
+ // uncertainty and dependencies and only 10% size, so a small-but-hairy feature
483
+ // is legitimately XL on hours nobody would call XL. The cross-check that
484
+ // compared the two fired on exactly that shape, so it is gone — inputs.calibration
485
+ // stays as QUICK depth's PERT seed and nothing on the page reads it.
486
+ test('the effort cell carries no tier-band cross-check', skip, async () => {
447
487
  const page = await openPage(buildPageWith((inputs) => {
448
- // reminders is S (20–60 h); push its only task to ~120 h
488
+ // reminders scores S; push its only task far past the S hour band
449
489
  inputs.features[1].tasks[0] = { ...inputs.features[1].tasks[0], o: 90, m: 120, p: 160 };
450
490
  }));
451
491
  try {
452
- const warn = await page.eval(`document.querySelector('#panel-estimate tr[data-id="reminders"] .oob')?.title ?? ''`);
453
- assert.match(warn, /outside S band 20–60 h/);
454
- assert.equal(await page.eval(`!!document.querySelector('#panel-estimate tr[data-id="booking"] .oob')`), false);
492
+ assert.equal(await page.eval(`document.querySelectorAll('#panel-estimate .oob').length`), 0);
493
+ assert.equal(await page.eval(`document.querySelector('#panel-estimate tr[data-id="reminders"] .bd-num').textContent`), '121.67');
455
494
  assert.deepEqual(page.errors, []);
456
495
  } finally { page.close(); }
457
496
  });
@@ -543,7 +582,7 @@ test('each tab shows only its own columns', skip, async () => {
543
582
  try {
544
583
  assert.deepEqual(await page.eval(headTexts), ['Feature', 'Effort (h)', 'Confidence', 'Source']);
545
584
  assert.deepEqual(await page.eval(scoreHeadTexts),
546
- ['Feature', 'Tech', 'Size', 'Deps', 'Unc', 'Risk', 'Σ', 'Tier']);
585
+ ['Feature', 'Tech', 'Size', 'Deps', 'Unc', 'Risk', 'Score', 'Tier']);
547
586
  await page.eval(clickTab('scoring'));
548
587
  assert.equal(await page.eval(`document.getElementById('panel-scoring').hidden`), false);
549
588
  assert.equal(await page.eval(`document.getElementById('panel-estimate').hidden`), true);
@@ -732,48 +771,168 @@ test('printing shows both tables, named', skip, async () => {
732
771
  } finally { page.close(); }
733
772
  });
734
773
 
735
- // The Summary is the one place team, months and cost appear. The booking
736
- // fixture recommends the AI-assisted senior+mid pair; the unaided trio is a
737
- // different roster, so it is an alternative row, not a collapsed line.
738
- test('the summary states the recommended scenario once and lists team alternatives', skip, async () => {
774
+ // The Summary is the one place the price appears, and it is the presented
775
+ // range — the booking fixture's p50 and p95 rounded to $10,000 and $14,000,
776
+ // with $12,000 as the single number to give when one is demanded.
777
+ test('the summary states the presented range and the single number', skip, async () => {
739
778
  const page = await openPage(buildPage());
740
779
  try {
741
- const lead = await page.eval(`document.querySelector('#summary .lead').textContent`);
742
- assert.equal(lead, '2 engineers (senior · mid), AI-assisted');
780
+ assert.equal(await page.eval(`document.querySelector('#summary .lead').textContent`), 'Presented range');
743
781
  const figures = await page.eval(`document.querySelector('#summary .figures').textContent`);
744
- assert.match(figures, /0\.40 months/);
745
- assert.match(figures, /\$5,993/);
746
- const alts = await page.eval(`[...document.querySelectorAll('#summary .alts tbody tr td:first-child')].map((c) => c.textContent)`);
747
- assert.deepEqual(alts, ['3 engineers (mid · mid · junior), humans unaided']);
748
- assert.equal(await page.eval(`document.querySelector('#summary .insight')`), null); // slower and pricier: no insight
782
+ assert.equal(figures, '$10,000–$14,000');
783
+ const meta = await page.eval(cellTexts('#summary p.meta'));
784
+ assert.equal(meta[0], 'single number, if one is required: $12,000');
785
+ assert.equal(meta[1], 'contingency 15% · implied accuracy 24%');
786
+ assert.ok(meta.some((m) => m.startsWith('91 h to plan')), `no planning hours line: ${meta}`);
787
+ // nothing on this page is a duration, in any section
788
+ assert.doesNotMatch(await page.eval(`document.body.textContent`), /month/i);
789
+ // a field removed from computed.price or refused by schema.mjs still must
790
+ // not print undefined/NaN (riskBufferHours and overheadPct both did once)
791
+ assert.doesNotMatch(await page.eval(`document.getElementById('summary').textContent`), /undefined|NaN/);
792
+ assert.deepEqual(page.errors, []);
793
+ } finally { page.close(); }
794
+ });
795
+
796
+ // The working behind the number — the multiplier, the overhead lines, the
797
+ // tier each feature's score bought — is internal-only. --client-only strips
798
+ // the whole block; the internal page shows it under the range.
799
+ test('the price working sits under the summary, internal-only', skip, async () => {
800
+ const page = await openPage(buildPage());
801
+ try {
802
+ const captions = await page.eval(cellTexts('#summary .working caption'));
803
+ assert.deepEqual(captions, ['Price build-up', 'Tier Reference']);
804
+ const rows = await page.eval(cellTexts('#summary .working tbody tr td:first-child'));
805
+ assert.deepEqual(rows.slice(0, 5),
806
+ ['Feature prices', 'Context multiplier', 'Adjusted base', 'Overheads', 'Contingency']);
807
+ assert.match(await page.eval(`document.querySelector('#summary .working').textContent`), /×1\.4/);
749
808
  assert.deepEqual(page.errors, []);
750
809
  } finally { page.close(); }
751
810
  });
752
811
 
753
- // Same roster, AI on vs off: not a staffing choice, so it collapses to one
754
- // line under the recommendation instead of an alternatives table.
755
- test('a same-team AI-only variant collapses to one line, not a table', skip, async () => {
812
+ test('the client-only page shows the range and no working at all', skip, async () => {
813
+ const page = await openPage(buildPage(['--client-only']));
814
+ try {
815
+ assert.equal(await page.eval(`document.querySelector('#summary .figures').textContent`), '$10,000–$14,000');
816
+ assert.equal(await page.eval(`document.querySelector('#summary .working').children.length`), 0);
817
+ assert.equal(await page.eval(`document.querySelectorAll('#panel-scoring .tier').length`), 0);
818
+ assert.deepEqual(page.errors, []);
819
+ } finally { page.close(); }
820
+ });
821
+
822
+ // R61 / spec 3 + 12: no project hours total beside the price for a client.
823
+ // Feature hours still ship (R49); only the Summary headline goes. Read from
824
+ // the DOM text, not innerText, so a node merely hidden by CSS still fails.
825
+ test('the client summary carries no project hours total', skip, async () => {
826
+ const client = await openPage(buildPage(['--client-only']));
827
+ try {
828
+ const text = await client.eval(`document.getElementById('summary').textContent`);
829
+ assert.doesNotMatch(text, /h to plan/, 'client-only summary shows a project hours total');
830
+ assert.match(text, /2 features/, 'the rest of the size line stays');
831
+ assert.deepEqual(client.errors, []);
832
+ } finally { client.close(); }
833
+ const internal = await openPage(buildPage());
834
+ try {
835
+ await internal.eval(`document.getElementById('view-toggle').click()`);
836
+ const shown = await internal.eval(`document.getElementById('summary').innerText`);
837
+ assert.doesNotMatch(shown, /h to plan/, 'the client-view preview shows a project hours total');
838
+ } finally { internal.close(); }
839
+ });
840
+
841
+ // What a reader actually sees: a clone of <body> with <script>/<style> torn
842
+ // out, then its textContent. Not `document.body.textContent` (which walks
843
+ // the JS source and embedded JSON, so it flags a `$0`/`month` sitting only
844
+ // in a code comment — a false positive, not the leak this check is for).
845
+ // Not `innerText` either — that also drops nodes the client-view toggle
846
+ // hides via `display:none` without removing from the DOM ([data-internal]),
847
+ // which is exactly where a leaked `$0` would hide.
848
+ function readerText(page) {
849
+ return page.eval(`(() => {
850
+ const clone = document.body.cloneNode(true);
851
+ clone.querySelectorAll('script,style').forEach((n) => n.remove());
852
+ return clone.textContent;
853
+ })()`);
854
+ }
855
+
856
+ // R50: a QUICK-depth estimate scores no feature and hits the same all-zero
857
+ // price an agentic estimate does (estimate-template-agentic.html) — the
858
+ // summary must say plainly that this scope is not priced, never present the
859
+ // bare $0 that computed.price.presentLow/presentHigh/singleNumber all are,
860
+ // and the internal price build-up must carry no zeroed rows either. Checked
861
+ // on both renders the brief asked for: the internal page and --client-only.
862
+ const quickUnscored = (inputs) => {
863
+ inputs.depth = 'QUICK';
864
+ for (const f of inputs.features) {
865
+ delete f.scores; delete f.scoreNote; delete f.scoreProvenance;
866
+ f.tasks = [{ ...f.tasks[0], id: `${f.id}-band`, o: 60, m: 110, p: 160 }];
867
+ }
868
+ };
869
+
870
+ async function assertQuickUnpriced(page) {
871
+ assert.deepEqual(page.errors, []);
872
+ assert.equal(await page.eval(`document.querySelector('#summary .lead').textContent`), 'Not priced');
873
+ assert.match(await page.eval(`document.querySelector('#summary .figures').textContent`), /^\d+(\.\d+)? h$/);
874
+ assert.equal(await page.eval(`document.querySelector('#summary .working').children.length`), 0);
875
+ const body = await readerText(page);
876
+ assert.doesNotMatch(body, /\$0\b/);
877
+ assert.doesNotMatch(body, /month/i);
878
+ }
879
+
880
+ test('a QUICK-depth estimate states it is not priced instead of presenting $0', skip, async () => {
881
+ const page = await openPage(buildPageWith(quickUnscored));
882
+ try { await assertQuickUnpriced(page); } finally { page.close(); }
883
+ });
884
+
885
+ test('a QUICK-depth --client-only render states the same unpriced state', skip, async () => {
886
+ const page = await openPage(buildPageWith(quickUnscored, ['--client-only']));
887
+ try { await assertQuickUnpriced(page); } finally { page.close(); }
888
+ });
889
+
890
+ // The roadmap draws computed.roadmap's shares: M1 is 76% of the booking
891
+ // fixture's effort and M2 the remaining 24%, and neither is a duration.
892
+ test('the roadmap bars are labelled with their share of effort', skip, async () => {
893
+ const page = await openPage(buildPage());
894
+ try {
895
+ assert.deepEqual(await page.eval(cellTexts('#roadmap .roadmap-share')), ['76%', '24%']);
896
+ const widths = await page.eval(
897
+ `[...document.querySelectorAll('#roadmap .roadmap-band')].map((b) => b.style.width)`);
898
+ assert.deepEqual(widths, ['76%', '24%']);
899
+ assert.equal(await page.eval(`document.querySelector('#roadmap .roadmap-axis-unit').textContent`), '% of effort');
900
+ assert.deepEqual(page.errors, []);
901
+ } finally { page.close(); }
902
+ });
903
+
904
+ // Free text about the approach taken, when the writer left any. It explains a
905
+ // judgment call — delivery mode, technique — not a choice between prices. It
906
+ // is internal shorthand under the writing contract (references/writing.md),
907
+ // same as a score's cite, so it is marked data-internal like the price
908
+ // working above it (R45) — only the "Approach:" label is new.
909
+ test('a written approach note renders under the summary figures', skip, async () => {
756
910
  const page = await openPage(buildPageWith((inputs) => {
757
- const rec = inputs.scenarios.find((s) => s.id === inputs.recommendedScenario);
758
- const other = inputs.scenarios.find((s) => s.id !== rec.id);
759
- other.team = rec.team.map((m) => ({ ...m }));
911
+ inputs.recommendedReason = 'the client has one senior available';
760
912
  }));
761
913
  try {
762
- assert.equal(await page.eval(`document.querySelector('#summary .alts table')`), null);
763
- const line = await page.eval(`document.querySelector('#summary .alts .meta').textContent`);
764
- assert.match(line, /^Without AI assistance: 0\.\d\d months · \$[\d,]+ \(\+0\.\d\d mo · \+\$[\d,]+\)$/);
914
+ assert.equal(await page.eval(`document.querySelector('#summary .why').textContent`),
915
+ 'Approach: the client has one senior available.');
916
+ assert.ok(await page.eval(`document.querySelector('#summary .why')?.closest('[data-internal]')`),
917
+ 'the approach note must be marked internal-only');
765
918
  assert.deepEqual(page.errors, []);
766
919
  } finally { page.close(); }
767
920
  });
768
921
 
769
- // One scenario is the default interview answer: no alternatives block at all.
770
- test('a single-scenario estimate shows the summary with no alternatives block', skip, async () => {
922
+ // R45: the note is free text an internal agent writes under a contract that
923
+ // never warns it reaches the client — the same reasoning that blanks a
924
+ // score's cite unconditionally. A client-only render must not show it.
925
+ // R48: redact.mjs blanks recommendedReason itself (not just the DOM node),
926
+ // so a client-only page never has the data to render the note from — the
927
+ // element is absent, not merely CSS-hidden. The byte-level guarantee (the
928
+ // phrase is nowhere in the exported file) lives in render.test.mjs, since
929
+ // that is what a client-only render actually promises.
930
+ test('the client-only page does not show the written approach note', skip, async () => {
771
931
  const page = await openPage(buildPageWith((inputs) => {
772
- inputs.scenarios = inputs.scenarios.filter((s) => s.id === inputs.recommendedScenario);
773
- }));
932
+ inputs.recommendedReason = 'we quoted low to beat the incumbent bid';
933
+ }, ['--client-only']));
774
934
  try {
775
- assert.equal(await page.eval(`document.querySelector('#summary .alts')`), null);
776
- assert.equal(await page.eval(`document.querySelector('#summary .lead').textContent`), '2 engineers (senior · mid), AI-assisted');
935
+ assert.equal(await page.eval(`document.querySelector('#summary .why')`), null);
777
936
  assert.deepEqual(page.errors, []);
778
937
  } finally { page.close(); }
779
938
  });