@v11g/agents-rock 1.0.9 → 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 (246) hide show
  1. package/README.md +1 -0
  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/solution-architect/evals/proposal-workflow/case.yaml +6 -0
  65. package/plugins/solution-architect/evals/proposal-workflow/fixture.sh +6 -0
  66. package/plugins/solution-architect/evals/proposal-workflow/graders/inputs-written.md +23 -0
  67. package/plugins/solution-architect/evals/proposal-workflow/graders/no-proposal-md.md +7 -0
  68. package/plugins/solution-architect/evals/proposal-workflow/graders/skill-fired.md +7 -0
  69. package/plugins/solution-architect/evals/proposal-workflow/graders/validate-then-render.md +16 -0
  70. package/plugins/solution-architect/evals/proposal-workflow/prompt.md +10 -0
  71. package/plugins/solution-architect/evals/workflow-gate-no-architecture/case.yaml +4 -0
  72. package/plugins/solution-architect/evals/workflow-gate-no-architecture/fixture.sh +6 -0
  73. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +10 -0
  74. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/nothing-written.md +7 -0
  75. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/skill-fired.md +7 -0
  76. package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +11 -0
  77. package/plugins/solution-architect/evals/workflow-gate-no-architecture/prompt.md +7 -0
  78. package/plugins/solution-architect/evals/workflow-happy-path/case.yaml +4 -0
  79. package/plugins/solution-architect/evals/workflow-happy-path/fixture.sh +6 -0
  80. package/plugins/solution-architect/evals/workflow-happy-path/graders/no-estimation-md.md +7 -0
  81. package/plugins/solution-architect/evals/workflow-happy-path/graders/pages-or-stop.md +16 -0
  82. package/plugins/solution-architect/evals/workflow-happy-path/graders/routed-to-workflow.md +12 -0
  83. package/plugins/solution-architect/evals/workflow-happy-path/graders/skill-fired.md +7 -0
  84. package/plugins/solution-architect/evals/workflow-happy-path/graders/three-questions-max.md +14 -0
  85. package/plugins/solution-architect/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +15 -0
  86. package/plugins/solution-architect/evals/workflow-happy-path/prompt.md +9 -0
  87. package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +11 -1
  88. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +27 -0
  89. package/plugins/solution-architect/skills/estimate/README.md +18 -3
  90. package/plugins/solution-architect/skills/estimate/SKILL.md +18 -75
  91. package/plugins/solution-architect/skills/estimate/classic/FLOW.md +77 -0
  92. package/plugins/solution-architect/skills/estimate/classic/assets/estimate-template.html +1337 -0
  93. package/plugins/solution-architect/skills/estimate/{references → classic/references}/task-shapes.md +1 -1
  94. package/plugins/solution-architect/skills/estimate/{references → classic/references}/writing.md +2 -2
  95. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/compute.mjs +1 -1
  96. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/checks.mjs +1 -1
  97. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/roadmap.mjs +1 -1
  98. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/rollup.mjs +5 -5
  99. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/schema.mjs +4 -26
  100. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-csv.mjs +2 -2
  101. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-html.mjs +2 -2
  102. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/render.mjs +8 -7
  103. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/score-review.mjs +3 -3
  104. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/baselines.test.mjs +3 -3
  105. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser-agentic.test.mjs +2 -2
  106. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser.test.mjs +2 -2
  107. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/compute.test.mjs +1 -1
  108. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/e2e.test.mjs +6 -6
  109. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/estimate-math.test.mjs +3 -3
  110. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/measurements.test.mjs +1 -1
  111. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/pricing.test.mjs +1 -1
  112. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/project-price.test.mjs +1 -1
  113. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/quality-gates.test.mjs +7 -1
  114. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/references.test.mjs +6 -6
  115. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/render.test.mjs +3 -3
  116. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/schema.test.mjs +1 -1
  117. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/score-review.test.mjs +6 -6
  118. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/scoring.test.mjs +1 -1
  119. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/url-state.test.mjs +2 -2
  120. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/validate.test.mjs +1 -1
  121. package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/xlsx-export.test.mjs +3 -3
  122. package/plugins/solution-architect/skills/estimate/classic/scripts/test/zip-store.test.mjs +26 -0
  123. package/plugins/solution-architect/skills/estimate/evals/evals.json +37 -2
  124. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +28 -0
  125. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
  126. package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.md +141 -0
  127. package/plugins/solution-architect/skills/estimate/shared/assets/xlsx-export.js +336 -0
  128. package/plugins/solution-architect/skills/estimate/shared/lib/agentic-task-schema.mjs +24 -0
  129. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/context-schema.mjs +2 -2
  130. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/inline.mjs +8 -0
  131. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring-schema.mjs +1 -1
  132. package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring.mjs +1 -1
  133. package/plugins/solution-architect/skills/estimate/shared/lib/zip.mjs +60 -0
  134. package/plugins/solution-architect/skills/estimate/workflow-based/FLOW.md +91 -0
  135. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-components.html +994 -0
  136. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-template.html +440 -0
  137. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimator-system.xlsx +0 -0
  138. package/plugins/solution-architect/skills/estimate/workflow-based/assets/score-review.html +838 -0
  139. package/plugins/solution-architect/skills/estimate/workflow-based/references/hidden-work-by-type.md +429 -0
  140. package/plugins/solution-architect/skills/estimate/workflow-based/references/linking.md +59 -0
  141. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-components-template.mjs +80 -0
  142. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-template.mjs +60 -0
  143. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +51 -0
  144. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-xlsx-template.py +144 -0
  145. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/compute.mjs +32 -0
  146. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-html.mjs +44 -0
  147. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-view.mjs +71 -0
  148. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/pair-findings.mjs +19 -0
  149. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/requirements.mjs +33 -0
  150. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/rollup.mjs +66 -0
  151. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema-components.mjs +69 -0
  152. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema.mjs +70 -0
  153. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-diff.mjs +54 -0
  154. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-html.mjs +52 -0
  155. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +51 -0
  156. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/render.mjs +42 -0
  157. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/score-review.mjs +46 -0
  158. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/arch-link.js +9 -0
  159. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/click.js +28 -0
  160. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/prelude.js +4 -0
  161. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/view.js +63 -0
  162. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/browser.test.mjs +127 -0
  163. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs +43 -0
  164. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-template.test.mjs +18 -0
  165. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/cli.test.mjs +48 -0
  166. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/estimator-system.test.mjs +66 -0
  167. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/ARCHITECTURE-mini.md +31 -0
  168. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/feedback.json +19 -0
  169. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/inputs-pass.json +80 -0
  170. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/measurements.jsonl +0 -0
  171. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/requirements.json +79 -0
  172. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/page-view.test.mjs +54 -0
  173. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/pages-browser.test.mjs +209 -0
  174. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/quality-gates.test.mjs +25 -0
  175. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/render.test.mjs +54 -0
  176. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/requirements.test.mjs +33 -0
  177. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/rollup.test.mjs +80 -0
  178. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/schema.test.mjs +61 -0
  179. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/score-review.test.mjs +108 -0
  180. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/stage.mjs +32 -0
  181. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/workflow-script.test.mjs +24 -0
  182. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +58 -0
  183. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/validate.mjs +19 -0
  184. package/plugins/solution-architect/skills/proposal/README.md +13 -0
  185. package/plugins/solution-architect/skills/proposal/SKILL.md +8 -0
  186. package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +143 -0
  187. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +31 -0
  188. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation-inputs.json +468 -0
  189. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation.json +773 -0
  190. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/measurements.jsonl +0 -0
  191. package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
  192. package/plugins/solution-architect/skills/proposal/references/review.md +11 -0
  193. package/plugins/solution-architect/skills/proposal/references/workflow.md +88 -0
  194. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-body.mjs +42 -0
  195. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-package.mjs +56 -0
  196. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-xml.mjs +44 -0
  197. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-checks.mjs +71 -0
  198. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-cli.mjs +46 -0
  199. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-html.mjs +39 -0
  200. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-lead.mjs +45 -0
  201. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-page.mjs +30 -0
  202. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-view.mjs +80 -0
  203. package/plugins/solution-architect/skills/proposal/scripts/render.mjs +5 -1
  204. package/plugins/solution-architect/skills/proposal/scripts/test/docx.test.mjs +68 -0
  205. package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +2 -2
  206. package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +9 -2
  207. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +17 -0
  208. package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +2 -2
  209. package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +2 -2
  210. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-browser.test.mjs +96 -0
  211. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-checks.test.mjs +98 -0
  212. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-docs.test.mjs +25 -0
  213. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-render.test.mjs +75 -0
  214. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-stage.mjs +15 -0
  215. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-view.test.mjs +78 -0
  216. package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +4 -1
  217. package/plugins/solution-architect/workflows/review-links.js +61 -0
  218. package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +0 -1677
  219. /package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template-agentic.html +0 -0
  220. /package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/scores-review-template.html +0 -0
  221. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/agentic-estimation.md +0 -0
  222. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/ai-multipliers.md +0 -0
  223. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/interview.md +0 -0
  224. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/scoring-guide.md +0 -0
  225. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/slicing.md +0 -0
  226. /package/plugins/solution-architect/skills/estimate/{references → classic/references}/techniques.md +0 -0
  227. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/agentic-checks.mjs +0 -0
  228. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/components.mjs +0 -0
  229. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/md-tables.mjs +0 -0
  230. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/redact.mjs +0 -0
  231. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/scoring-checks.mjs +0 -0
  232. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-fail.md +0 -0
  233. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-pass.md +0 -0
  234. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-inputs.json +0 -0
  235. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/booking-inputs.json +0 -0
  236. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-fail.md +0 -0
  237. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-pass.md +0 -0
  238. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/measurements.jsonl +0 -0
  239. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/zip.mjs +0 -0
  240. /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/validate.mjs +0 -0
  241. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/baselines.mjs +0 -0
  242. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/estimate-math.mjs +0 -0
  243. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/measurements.mjs +0 -0
  244. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/pricing.mjs +0 -0
  245. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/project-price.mjs +0 -0
  246. /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/score-diff.mjs +0 -0
@@ -0,0 +1,48 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { execFileSync, spawnSync } from 'node:child_process';
4
+ import { mkdtempSync, readFileSync, writeFileSync, copyFileSync } from 'node:fs';
5
+ import { tmpdir } from 'node:os';
6
+ import { join } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const script = (n) => fileURLToPath(new URL(`../${n}.mjs`, import.meta.url));
10
+ const fx = (n) => fileURLToPath(new URL(`./fixtures/${n}`, import.meta.url));
11
+
12
+ function stage(mutate) {
13
+ const dir = mkdtempSync(join(tmpdir(), 'wf-'));
14
+ const inputs = JSON.parse(readFileSync(fx('inputs-pass.json'), 'utf8'));
15
+ inputs.measurementsPath = fx('measurements.jsonl');
16
+ if (mutate) mutate(inputs);
17
+ writeFileSync(join(dir, 'estimation-inputs.json'), JSON.stringify(inputs));
18
+ copyFileSync(fx('requirements.json'), join(dir, 'requirements.json'));
19
+ return dir;
20
+ }
21
+
22
+ test('compute writes estimation.json with features, components and price', () => {
23
+ const dir = stage();
24
+ execFileSync('node', [script('compute'), '--inputs', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'estimation.json')]);
25
+ const out = JSON.parse(readFileSync(join(dir, 'estimation.json'), 'utf8'));
26
+ assert.deepEqual(Object.keys(out.computed).sort(), ['components', 'features', 'price']);
27
+ assert.equal(Object.keys(out.computed.features).length, 5);
28
+ });
29
+
30
+ test('compute refuses invalid inputs and names the finding', () => {
31
+ const dir = stage((i) => { i.features[0].tasks = []; });
32
+ const r = spawnSync('node', [script('compute'), '--inputs', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'estimation.json')]);
33
+ assert.equal(r.status, 1);
34
+ assert.match(String(r.stderr), /"tasks" belongs on components/);
35
+ });
36
+
37
+ test('validate exits 0 on a clean pair and 1 when estimation.json is stale', () => {
38
+ const dir = stage();
39
+ execFileSync('node', [script('compute'), '--inputs', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'estimation.json')]);
40
+ const ok = spawnSync('node', [script('validate'), '--inputs', join(dir, 'estimation-inputs.json'), '--json', join(dir, 'estimation.json')]);
41
+ assert.equal(ok.status, 0, String(ok.stderr));
42
+ const est = JSON.parse(readFileSync(join(dir, 'estimation.json'), 'utf8'));
43
+ est.computed.features['FEAT-001'].point += 1;
44
+ writeFileSync(join(dir, 'estimation.json'), JSON.stringify(est));
45
+ const stale = spawnSync('node', [script('validate'), '--inputs', join(dir, 'estimation-inputs.json'), '--json', join(dir, 'estimation.json')]);
46
+ assert.equal(stale.status, 1);
47
+ assert.match(String(stale.stderr), /computed block differs from a fresh recompute/);
48
+ });
@@ -0,0 +1,66 @@
1
+ // The workflow-mode workbook template: Estimator_v2 with a SYSTEM / MODULE
2
+ // column before the Ballpark tab's FEATURE column, built by LibreOffice
3
+ // (build-xlsx-template.py) so every formula and the Roll-up's links shift.
4
+ import { test } from 'node:test';
5
+ import assert from 'node:assert/strict';
6
+ import { execFileSync, spawnSync } from 'node:child_process';
7
+ import { mkdtempSync, readFileSync, rmSync } from 'node:fs';
8
+ import { tmpdir } from 'node:os';
9
+ import { join } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { readZip } from '../../../classic/scripts/test/zip.mjs';
12
+
13
+ const at = (rel) => fileURLToPath(new URL(rel, import.meta.url));
14
+ const TEMPLATE = at('../../assets/estimator-system.xlsx');
15
+ const BALLPARK = 'xl/worksheets/sheet2.xml';
16
+ const ROLLUP = 'xl/worksheets/sheet5.xml';
17
+
18
+ function sheets(file) {
19
+ const files = readZip(readFileSync(file));
20
+ const strings = [...files.get('xl/sharedStrings.xml').toString('utf8').matchAll(/<si>([\s\S]*?)<\/si>/g)]
21
+ .map((m) => [...m[1].matchAll(/<t[^>]*>([^<]*)<\/t>/g)].map((t) => t[1]).join(''));
22
+ const text = (part, ref) => {
23
+ const m = new RegExp(`<c r="${ref}"[^>]*t="s"[^>]*><v>(\\d+)</v>`).exec(files.get(part).toString('utf8'));
24
+ return m ? strings[Number(m[1])] : undefined;
25
+ };
26
+ return { xml: (part) => files.get(part).toString('utf8'), text };
27
+ }
28
+
29
+ test('Ballpark: SYSTEM / MODULE in A, FEATURE / WORK ITEM in B, A7..A36 are real cells', () => {
30
+ const { xml, text } = sheets(TEMPLATE);
31
+ assert.equal(text(BALLPARK, 'A6'), 'SYSTEM / MODULE');
32
+ assert.equal(text(BALLPARK, 'B6'), 'FEATURE / WORK ITEM');
33
+ for (let r = 7; r <= 36; r += 1) assert.match(xml(BALLPARK), new RegExp(`<c r="A${r}" s="\\d+"`), `no cell A${r}`);
34
+ });
35
+
36
+ test('Ballpark: formulas, merges, pane and validation follow the shift', () => {
37
+ const ballpark = sheets(TEMPLATE).xml(BALLPARK);
38
+ assert.match(ballpark, /<c r="H7"[^>]*><f[^>]*>[^<]*SUMPRODUCT\(\$C7:\$G7/);
39
+ assert.match(ballpark, /<pane xSplit="2" ySplit="6" topLeftCell="C7"/);
40
+ for (const ref of ['A1:N1', 'A2:N2', 'A39:N39']) assert.match(ballpark, new RegExp(`<mergeCell ref="${ref}"/>`));
41
+ assert.match(ballpark, /<dataValidation [^>]*sqref="C7:G36"/);
42
+ });
43
+
44
+ test("Roll-up's subtotal link points at the shifted Ballpark subtotal", () => {
45
+ assert.match(sheets(TEMPLATE).xml(ROLLUP), /<c r="C6"[^>]*><f[^>]*>(?:'|&apos;)Ballpark Estimator(?:'|&apos;)!\$J\$37</);
46
+ });
47
+
48
+ const canRebuild = spawnSync('/usr/bin/python3', ['-c', 'import uno'], { stdio: 'ignore' }).status === 0
49
+ && spawnSync('soffice', ['--version'], { stdio: 'ignore' }).status === 0;
50
+
51
+ test('build-xlsx-template.py rebuilds the committed template', { skip: !canRebuild && 'no LibreOffice / uno' }, () => {
52
+ const dir = mkdtempSync(join(tmpdir(), 'xlsx-template-'));
53
+ try {
54
+ const out = join(dir, 'rebuilt.xlsx');
55
+ execFileSync('/usr/bin/python3', [at('../build-xlsx-template.py'), '--out', out], { stdio: 'ignore', timeout: 120000 });
56
+ const [built, committed] = [sheets(out), sheets(TEMPLATE)];
57
+ for (const part of [BALLPARK, ROLLUP]) assert.equal(built.xml(part), committed.xml(part), `${part} differs`);
58
+ } finally { rmSync(dir, { recursive: true, force: true }); }
59
+ });
60
+
61
+ test('build-xlsx-template.py: a bare --out fails with a usage message', { skip: !canRebuild && 'no LibreOffice / uno' }, () => {
62
+ const run = spawnSync('/usr/bin/python3', [at('../build-xlsx-template.py'), '--out'], { encoding: 'utf8' });
63
+ assert.notEqual(run.status, 0);
64
+ assert.match(run.stderr, /usage: .*build-xlsx-template\.py \[--out <file>\]/);
65
+ assert.doesNotMatch(run.stderr, /Traceback/);
66
+ });
@@ -0,0 +1,31 @@
1
+ # sin-kowa-mini — architecture (fixture)
2
+
3
+ Trimmed from the Sin Kowa v2 document for tests. Component ids match
4
+ `inputs-pass.json`.
5
+
6
+ ## 5 Architecture Model
7
+
8
+ | Container | Tech | Used by |
9
+ | --- | --- | --- |
10
+ | Core API (`api`) | NestJS | Office Web App, Background Worker |
11
+ | Office Web App (`office`) | React SPA | office staff |
12
+ | Background Worker (`worker`) | job runner | — |
13
+ | Operations Database (`ops`) | PostgreSQL | Core API |
14
+
15
+ ## 6 Core Components
16
+
17
+ | Component | Responsibility | Tech | Deploy unit | src |
18
+ | --- | --- | --- | --- | --- |
19
+ | Stage Engine (`api.stage`) | moves Orders through the stages; raises Short-Pack alerts | NestJS module | Core API | proposed |
20
+ | Orders and Quoting (`api.orders`) | Order, Quotation, pricing, Order Draft confirmation | NestJS module | Core API | proposed |
21
+ | Billing (`api.billing`) | Invoice from accepted packed quantities; issued invoices never edited | NestJS module | Core API | proposed |
22
+ | Office Web App (`office`) | orders, quotes, invoicing screens | React SPA | Office Web App | proposed |
23
+ | Notifier (`worker.notify`) | sends alerts to staff | job | Background Worker | proposed |
24
+ | Order Drafter (`worker.drafter`) | turns message text into an Order Draft | LLM job | Background Worker | proposed |
25
+ | Operations Database (`ops`) | system of record; one schema per module | PostgreSQL | RDS | proposed |
26
+
27
+ ## 9 External Integrations
28
+
29
+ | System | Used for | Component that integrates |
30
+ | --- | --- | --- |
31
+ | Mailbox | inbound order emails | Order Drafter |
@@ -0,0 +1,19 @@
1
+ {
2
+ "features": [
3
+ { "id": "FEAT-001", "scores": { "tech": 3, "size": 3, "deps": 2, "unc": 3, "risk": 3 }, "scoreNote": "" },
4
+ { "id": "FEAT-002", "scores": { "tech": 3, "size": 3, "deps": 2, "unc": 3, "risk": 4 }, "scoreNote": "", "reasons": { "risk": "a missed alert blocks invoicing for days" } },
5
+ { "id": "FEAT-003", "scores": { "tech": 3, "size": 3, "deps": 2, "unc": 3, "risk": 3 }, "scoreNote": "" },
6
+ { "id": "FEAT-004", "scores": { "tech": 3, "size": 3, "deps": 2, "unc": 3, "risk": 3 }, "scoreNote": "" },
7
+ { "id": "FEAT-005", "scores": { "tech": 3, "size": 3, "deps": 2, "unc": 3, "risk": 3 }, "scoreNote": "" }
8
+ ],
9
+ "components": [
10
+ { "id": "api.stage", "implements": ["FEAT-001", "FEAT-002"] },
11
+ { "id": "api.orders", "implements": ["FEAT-003", "FEAT-004"] },
12
+ { "id": "api.billing", "implements": ["FEAT-005"] },
13
+ { "id": "office", "implements": ["FEAT-001", "FEAT-003", "FEAT-005"] },
14
+ { "id": "worker.notify", "implements": ["FEAT-002"] },
15
+ { "id": "worker.drafter", "implements": [] },
16
+ { "id": "ops", "implements": [] }
17
+ ],
18
+ "addComponent": [ { "feature": "FEAT-004", "note": "a review screen for the draft is missing" } ]
19
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "scopeMode": "workflow",
3
+ "requirements": "requirements.json",
4
+ "project": "sin-kowa-mini",
5
+ "currency": "USD",
6
+ "deliveryMode": "agentic",
7
+ "depth": "STANDARD",
8
+ "agentContext": { "agent": "claude-code", "model": "claude-opus-5-5" },
9
+ "contextLevels": { "codebaseMaturity": 1, "stackFamiliarity": 1, "specQuality": 3, "compliance": 2, "clientDecisions": 3 },
10
+ "contextProvenance": {
11
+ "codebaseMaturity": { "level": 1, "anchor": "Greenfield", "cite": "ARCHITECTURE.md mode: greenfield", "source": "derived" },
12
+ "stackFamiliarity": { "level": 1, "anchor": "Core stack, done before", "cite": "not assessed — adjust in the exported workbook", "source": "derived" },
13
+ "specQuality": { "level": 3, "anchor": "Outline or slide deck", "cite": "BA readiness 62", "source": "derived" },
14
+ "compliance": { "level": 2, "anchor": "Handles PII", "cite": "customer names on invoices", "source": "derived" },
15
+ "clientDecisions": { "level": 3, "anchor": "Committee sign-off", "cite": "two directors approve", "source": "derived" }
16
+ },
17
+ "features": [
18
+ { "id": "FEAT-001", "scoreNote": "Five stages with task views per role; the heart of the warehouse app", "scoreProvenance": "proposed",
19
+ "scores": { "tech": { "n": 3, "anchor": "Custom business logic, moderate algorithm complexity, multiple states", "cite": "five stages, role-scoped views" },
20
+ "size": { "n": 3, "anchor": "Medium feature with multiple components and backend logic", "cite": "engine + screens" },
21
+ "deps": { "n": 2, "anchor": "One internal dependency (e.g. auth check)", "cite": "reads roles" },
22
+ "unc": { "n": 3, "anchor": "Some open questions, design decisions to be made during build", "cite": "24h trigger rule open" },
23
+ "risk": { "n": 3, "anchor": "Moderate impact if broken, requires testing, affects multiple users", "cite": "every order passes through" } } },
24
+ { "id": "FEAT-002", "scoreNote": "Flags a can't-fulfil item in time to act", "scoreProvenance": "proposed",
25
+ "scores": { "tech": { "n": 3, "anchor": "Custom business logic, moderate algorithm complexity, multiple states", "cite": "exception branch" },
26
+ "size": { "n": 3, "anchor": "Medium feature with multiple components and backend logic", "cite": "alert + screen" },
27
+ "deps": { "n": 2, "anchor": "One internal dependency (e.g. auth check)", "cite": "stage engine event" },
28
+ "unc": { "n": 3, "anchor": "Some open questions, design decisions to be made during build", "cite": "who is alerted is open" },
29
+ "risk": { "n": 3, "anchor": "Moderate impact if broken, requires testing, affects multiple users", "cite": "missed alert delays invoicing" } } },
30
+ { "id": "FEAT-003", "scoreNote": "Orders and quotes from email, phone and fax", "scoreProvenance": "proposed",
31
+ "scores": { "tech": { "n": 3, "anchor": "Custom business logic, moderate algorithm complexity, multiple states", "cite": "catalog + cost-plus pricing" },
32
+ "size": { "n": 3, "anchor": "Medium feature with multiple components and backend logic", "cite": "intake + quote screens" },
33
+ "deps": { "n": 2, "anchor": "One internal dependency (e.g. auth check)", "cite": "item master" },
34
+ "unc": { "n": 3, "anchor": "Some open questions, design decisions to be made during build", "cite": "markup rule unconfirmed" },
35
+ "risk": { "n": 3, "anchor": "Moderate impact if broken, requires testing, affects multiple users", "cite": "wrong quote loses margin" } } },
36
+ { "id": "FEAT-004", "scoreNote": "Drafts an order from an email for staff to confirm", "scoreProvenance": "proposed",
37
+ "scores": { "tech": { "n": 3, "anchor": "Custom business logic, moderate algorithm complexity, multiple states", "cite": "LLM extraction + review" },
38
+ "size": { "n": 3, "anchor": "Medium feature with multiple components and backend logic", "cite": "job + review screen" },
39
+ "deps": { "n": 2, "anchor": "One internal dependency (e.g. auth check)", "cite": "mailbox" },
40
+ "unc": { "n": 3, "anchor": "Some open questions, design decisions to be made during build", "cite": "no sample emails yet" },
41
+ "risk": { "n": 3, "anchor": "Moderate impact if broken, requires testing, affects multiple users", "cite": "staff confirm every draft" } } },
42
+ { "id": "FEAT-005", "scoreNote": "Invoice from packed quantities plus proof of delivery", "scoreProvenance": "proposed",
43
+ "scores": { "tech": { "n": 3, "anchor": "Custom business logic, moderate algorithm complexity, multiple states", "cite": "three-way match" },
44
+ "size": { "n": 3, "anchor": "Medium feature with multiple components and backend logic", "cite": "match + documents + screens" },
45
+ "deps": { "n": 2, "anchor": "One internal dependency (e.g. auth check)", "cite": "reads packed quantities" },
46
+ "unc": { "n": 3, "anchor": "Some open questions, design decisions to be made during build", "cite": "credit note flow open" },
47
+ "risk": { "n": 3, "anchor": "Moderate impact if broken, requires testing, affects multiple users", "cite": "money" } } }
48
+ ],
49
+ "components": [
50
+ { "id": "api", "name": "Core API" },
51
+ { "id": "api.stage", "name": "Stage Engine", "parent": "api", "milestone": "M1 - Walking skeleton",
52
+ "builds": [ { "feature": "FEAT-001", "why": "moves Orders through the five stages" }, { "feature": "FEAT-002", "why": "raises the Short-Pack alert on a can't-fulfil line" } ],
53
+ "tasks": [ { "id": "stage-engine", "name": "Stage transitions with audit", "shape": "small_implementation", "scope": { "affectedFiles": 8, "complexity": "medium" }, "seedMinutes": { "o": 90, "m": 180, "p": 360 }, "assumptions": [], "provenance": "proposed" },
54
+ { "id": "stage-tests", "name": "Transition tests", "shape": "test_creation", "scope": { "affectedFiles": 3, "complexity": "low" }, "seedMinutes": { "o": 30, "m": 60, "p": 120 }, "assumptions": [], "provenance": "proposed" } ] },
55
+ { "id": "api.orders", "name": "Orders and Quoting", "parent": "api", "milestone": "M1 - Walking skeleton",
56
+ "builds": [ { "feature": "FEAT-003", "why": "owns Order, Quotation and the cost-plus pricing rule" } ],
57
+ "tasks": [ { "id": "orders-impl", "name": "Order and quotation aggregate", "shape": "small_implementation", "scope": { "affectedFiles": 10, "complexity": "medium" }, "seedMinutes": { "o": 120, "m": 240, "p": 480 }, "assumptions": [], "provenance": "proposed" } ] },
58
+ { "id": "api.billing", "name": "Billing", "parent": "api", "milestone": "M2 - Money",
59
+ "builds": [ { "feature": "FEAT-005", "why": "invoice qty = accepted packed qty; issued invoices never edited" } ],
60
+ "tasks": [ { "id": "billing-match", "name": "Three-way match", "shape": "small_implementation", "scope": { "affectedFiles": 6, "complexity": "medium" }, "seedMinutes": { "o": 60, "m": 120, "p": 240 }, "assumptions": [], "provenance": "proposed" },
61
+ { "id": "billing-docs", "name": "Printable invoice", "shape": "small_implementation", "scope": { "affectedFiles": 4, "complexity": "low" }, "seedMinutes": { "o": 40, "m": 80, "p": 160 }, "assumptions": [], "provenance": "proposed" } ] },
62
+ { "id": "office", "name": "Office Web App", "milestone": "M1 - Walking skeleton",
63
+ "builds": [ { "feature": "FEAT-001", "why": "stage board and task views" }, { "feature": "FEAT-003", "why": "order intake and quote screens" }, { "feature": "FEAT-005", "why": "invoice list, detail and release screens" } ],
64
+ "tasks": [ { "id": "office-screens", "name": "Orders, quotes and invoicing screens", "shape": "ui_implementation", "scope": { "affectedFiles": 14, "complexity": "medium" }, "seedMinutes": { "o": 180, "m": 360, "p": 720 }, "assumptions": [], "provenance": "proposed" } ] },
65
+ { "id": "worker", "name": "Background Worker" },
66
+ { "id": "worker.notify", "name": "Notifier", "parent": "worker", "milestone": "M2 - Money",
67
+ "builds": [ { "feature": "FEAT-002", "why": "delivers the Short-Pack alert to ops and invoicing staff" } ],
68
+ "tasks": [ { "id": "notify-impl", "name": "Alert delivery", "shape": "api_integration", "scope": { "affectedFiles": 3, "complexity": "low" }, "seedMinutes": { "o": 30, "m": 60, "p": 120 }, "assumptions": [], "provenance": "proposed" } ] },
69
+ { "id": "worker.drafter", "name": "Order Drafter", "parent": "worker", "milestone": "M3 - Operations",
70
+ "builds": [ { "feature": "FEAT-004", "why": "turns message text into an Order Draft" } ],
71
+ "tasks": [ { "id": "drafter-impl", "name": "Email to draft extraction", "shape": "api_integration", "scope": { "affectedFiles": 5, "complexity": "medium" }, "seedMinutes": { "o": 90, "m": 180, "p": 360 }, "assumptions": [], "provenance": "proposed" } ] },
72
+ { "id": "ops", "name": "Operations Database", "notEstimated": "one schema per module; no store-specific work in this scope" }
73
+ ],
74
+ "risks": [],
75
+ "assumptions": [
76
+ { "text": "InvoiceNow is a data model only, with no live connection", "impactIfWrong": "a live Access Point link is a separate feature", "source": "ASM-005" },
77
+ { "text": "Label printers accept ZPL over the LAN", "impactIfWrong": "printer bridge work added", "source": "new" }
78
+ ],
79
+ "exclusions": ["Hosting and third-party subscription fees"]
80
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "schemaVersion": "1.0",
3
+ "lead": "sin-kowa-mini",
4
+ "status": "ANALYZED",
5
+ "depth": "STANDARD",
6
+ "updated": "2026-10-06",
7
+ "mode": "greenfield",
8
+ "scopeMode": "workflow",
9
+ "mapLabel": "IMDA roadmap pillar",
10
+ "context": {
11
+ "problem": "Clients dispute charges after the ship sails and there is no record of what was packed.",
12
+ "goals": [
13
+ { "id": "G-001", "goal": "Stop billing disputes after sailing", "metric": "disputes per month down 50% in 6 months", "source": "PO brief" }
14
+ ],
15
+ "successMetrics": ["disputes per month down 50% within 6 months of go-live"]
16
+ },
17
+ "actors": [
18
+ { "id": "ACT-001", "name": "Packer", "type": "human", "goal": "pack an order without paper lists", "painPoints": ["packs from a printed list"] },
19
+ { "id": "ACT-002", "name": "Office staff", "type": "human", "goal": "invoice the moment goods are delivered", "painPoints": ["waits weeks for the paper delivery order"] }
20
+ ],
21
+ "workflows": [
22
+ { "id": "WF-001", "name": "Order to invoice today", "state": "as-is", "trigger": "ship sends an order by email or phone", "steps": ["office staff key the order in", "warehouse packs from a paper list", "paper delivery order signed at the dock", "invoice raised when the paper returns"], "exceptions": ["client disputes a charge after sailing"] },
23
+ { "id": "WF-002", "name": "Order pipeline", "state": "to-be", "label": "confirmed", "source": "PO brief, System 1", "trigger": "order confirmed by office staff", "steps": ["Order In", "Pack", "Pack Review", "Shipped"], "branches": [{ "from": "Pack", "to": "Short-pack alert", "label": "can't fulfil" }, { "from": "Pack Review", "to": "Pack", "label": "mismatch" }], "replaces": ["WF-001"], "exceptions": [] },
24
+ { "id": "WF-003", "name": "Order to cash", "state": "to-be", "label": "recommended", "source": "drafted from PO brief, System 2", "trigger": "order received by email or phone", "steps": ["Order received", "Quote", "Invoice", "Paid"], "branches": [], "replaces": ["WF-001"], "exceptions": [] },
25
+ { "id": "WF-004", "name": "Custom order", "state": "to-be", "label": "confirmed", "source": "PO brief, System 2 sub-flow", "trigger": "order holds an item that is sourced, not stocked", "steps": ["Flag as custom", "Vendor PO", "Receive into stock"], "branches": [], "sub": { "startsAt": "WF-003:Order received", "rejoins": "WF-002", "share": "about 20% of orders" }, "exceptions": [] }
26
+ ],
27
+ "systems": [
28
+ { "id": "SYS-001", "name": "Warehouse operations", "purpose": "Moves an order from intake to the dock; the one screen a warehouse worker needs.", "map": "Warehouse Automation", "label": "confirmed", "source": "PO brief, System 1", "workflows": ["WF-002"], "features": ["FEAT-001", "FEAT-002"] },
29
+ { "id": "SYS-002", "name": "Orders & invoicing", "purpose": "Quotation through to a paid invoice.", "map": "Finance/Documentation", "label": "confirmed", "source": "PO brief, System 2", "workflows": ["WF-003", "WF-004"], "features": ["FEAT-003", "FEAT-004", "FEAT-005"] }
30
+ ],
31
+ "features": [
32
+ { "id": "FEAT-001", "name": "Order pipeline & stage engine", "does": "Moves an order through each stage, with task views per role", "label": "confirmed", "source": "PO brief, System 1", "steps": ["WF-002:Order In", "WF-002:Pack", "WF-002:Pack Review", "WF-002:Shipped"], "requirements": ["FR-001"] },
33
+ { "id": "FEAT-002", "name": "Short-pack alert", "does": "Flags an item that cannot be packed, in time to buy or cancel", "label": "confirmed", "source": "PO brief, System 1", "steps": ["WF-002:Short-pack alert"], "requirements": ["FR-002"] },
34
+ { "id": "FEAT-003", "name": "Order intake & quotation", "does": "Captures email and phone orders and prices them", "label": "confirmed", "source": "PO brief, System 2", "steps": ["WF-003:Order received", "WF-003:Quote", "WF-004:Flag as custom"], "requirements": ["FR-003"] },
35
+ { "id": "FEAT-004", "name": "Invoice from packed quantities", "does": "Raises the invoice from what was packed and shipped", "label": "recommended", "source": "drafted from PO brief, System 2", "steps": ["WF-002:Shipped", "WF-003:Invoice", "WF-003:Paid"], "requirements": ["FR-004"] },
36
+ { "id": "FEAT-005", "name": "One login, role-based screens", "does": "One login; packers see packing tasks, office staff see orders and invoices", "label": "confirmed", "source": "PO brief, System 1", "steps": ["*"], "requirements": ["FR-005"] }
37
+ ],
38
+ "requirements": [
39
+ { "id": "FR-001", "text": "The system must move each order through the stages Order In, Pack, Pack Review and Shipped.", "label": "confirmed", "source": "PO brief, System 1", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "in", "acceptance": [] },
40
+ { "id": "FR-002", "text": "The system must let a packer flag an item that cannot be packed and alert office staff.", "label": "confirmed", "source": "PO brief, System 1", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "in", "acceptance": [] },
41
+ { "id": "FR-003", "text": "Office staff must be able to enter an order received by email or phone and produce a quotation.", "label": "confirmed", "source": "PO brief, System 2", "traces": { "goal": "G-001", "workflow": "WF-003", "rules": [] }, "scope": "in", "acceptance": [] },
42
+ { "id": "FR-004", "text": "The system must raise the invoice from packed-and-audited quantities.", "label": "assumed", "source": "PO brief, System 2", "traces": { "goal": "G-001", "workflow": "WF-003", "rules": ["BR-001"] }, "scope": "in", "acceptance": ["SC-001"] },
43
+ { "id": "FR-005", "text": "The system must provide one login, with packers limited to packing tasks.", "label": "confirmed", "source": "PO brief, System 1", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "in", "acceptance": [] },
44
+ { "id": "FR-006", "text": "The system must print a pallet label at the Pack stage.", "label": "assumed", "source": "PO brief, System 4", "traces": { "goal": "G-001", "workflow": "WF-002", "rules": [] }, "scope": "future", "acceptance": [] }
45
+ ],
46
+ "businessRules": [
47
+ { "id": "BR-001", "rule": "Invoice quantity equals packed-and-audited quantity.", "source": "PO brief, System 2", "examples": ["ordered 10, packed 10 -> invoice 10", "ordered 10, packed 8 -> invoice 8"] }
48
+ ],
49
+ "scenarios": [
50
+ { "id": "SC-001", "requirement": "FR-004", "type": "happy", "given": "an order of 10 items with 8 packed", "when": "the invoice is raised", "then": "it bills 8 items" }
51
+ ],
52
+ "nfrs": [
53
+ { "id": "NFR-001", "area": "availability", "text": "Scans made without connectivity must be kept and synced within 5 minutes of reconnecting.", "label": "assumed" }
54
+ ],
55
+ "integrations": [
56
+ { "id": "INT-001", "system": "InvoiceNow network", "direction": "write", "label": "recommended" }
57
+ ],
58
+ "data": [
59
+ { "id": "DAT-001", "entity": "Order", "sensitivity": "commercial", "volume": "about 300 per month", "label": "assumed" }
60
+ ],
61
+ "constraints": [
62
+ { "id": "CON-001", "text": "Vessels are offline at sea; delivery orders are signed on paper at the dock today.", "source": "PO brief" }
63
+ ],
64
+ "assumptions": [
65
+ { "id": "ASM-001", "text": "Packers carry a phone with a camera on the warehouse floor.", "impact": "medium", "status": "unconfirmed" }
66
+ ],
67
+ "openQuestions": [
68
+ { "id": "Q-001", "question": "Is order to cash the right shape: quote before the order is confirmed?", "priority": "P1", "reason": "the workflow was drafted, not described by the client", "affects": ["WF-003"], "status": "open", "answer": null, "architectureBlocker": false },
69
+ { "id": "Q-002", "question": "Should the invoice be raised at shipping, or when the delivery order is signed?", "priority": "P2", "reason": "decides the invoice trigger", "affects": ["FEAT-004", "INT-001"], "status": "open", "answer": null, "architectureBlocker": false }
70
+ ],
71
+ "conflicts": [],
72
+ "scope": { "out": ["last-mile delivery tracking"], "future": ["pallet labels"], "unconfirmed": [] },
73
+ "ai": null,
74
+ "readiness": {
75
+ "overall": 63,
76
+ "areas": { "businessContext": 80, "workflows": 70, "rules": 60, "integrations": 50, "data": 60, "nfrs": 60 },
77
+ "blockers": []
78
+ }
79
+ }
@@ -0,0 +1,54 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { loadPair } from '../lib/requirements.mjs';
5
+ import { computeWorkflowEstimation } from '../lib/rollup.mjs';
6
+ import { priceView, milestoneView, registerView } from '../lib/page-view.mjs';
7
+
8
+ const fx = fileURLToPath(new URL('./fixtures/inputs-pass.json', import.meta.url));
9
+ function estimate(mutate) {
10
+ const { inputs, req } = loadPair(fx);
11
+ if (mutate) mutate(inputs, req);
12
+ return { est: computeWorkflowEstimation(inputs, req, []), req };
13
+ }
14
+
15
+ test('priceView: the computed price, five context rows, eight overhead lines, effort', () => {
16
+ const { est } = estimate();
17
+ const v = priceView(est);
18
+ assert.equal(v.price.presentLow, est.computed.price.presentLow);
19
+ assert.equal(v.featureCount, 5);
20
+ assert.deepEqual(v.context.map((c) => c.key), ['codebaseMaturity', 'stackFamiliarity', 'specQuality', 'compliance', 'clientDecisions']);
21
+ assert.deepEqual(v.context[2], { key: 'specQuality', label: 'Specification quality', level: 3, anchor: 'Outline or slide deck', multiplier: 1.2 });
22
+ assert.equal(v.overheads.length, 8);
23
+ assert.equal(v.overheads.at(-1).label, 'Cross-feature integration');
24
+ assert.deepEqual({ components: v.effort.components, tasks: v.effort.tasks }, { components: 6, tasks: 8 });
25
+ assert.equal(v.avgUnc, 3);
26
+ });
27
+
28
+ test('priceView: no tasks anywhere → zero hours and no implied rate', () => {
29
+ const { est } = estimate((i) => { for (const c of i.components) c.tasks = []; });
30
+ assert.equal(priceView(est).effort.hours, 0);
31
+ assert.equal(priceView(est).effort.rate, null);
32
+ });
33
+
34
+ test('milestoneView: features land with their main builder, in milestone order', () => {
35
+ const { est } = estimate();
36
+ const ms = milestoneView(est);
37
+ assert.deepEqual(ms.map((m) => m.name), ['M1 - Walking skeleton', 'M2 - Money', 'M3 - Operations']);
38
+ assert.deepEqual(ms.map((m) => m.features.map((f) => f.id)), [['FEAT-001', 'FEAT-003'], ['FEAT-002', 'FEAT-005'], ['FEAT-004']]);
39
+ assert.equal(ms[0].title, '1. Walking skeleton');
40
+ assert.ok(Math.abs(ms.reduce((n, m) => n + m.share, 0) - 1) < 0.02);
41
+ assert.ok(ms[2].low > 0 && ms[2].low < ms[2].high && ms[2].high < est.computed.price.presentHigh);
42
+ });
43
+
44
+ test('registerView: assumptions as text; exclusions = scope.out then inputs.exclusions', () => {
45
+ const { est, req } = estimate();
46
+ const r = registerView(est, req);
47
+ assert.equal(r.assumptions.length, 2);
48
+ assert.deepEqual(r.exclusions, ['last-mile delivery tracking', 'Hosting and third-party subscription fees']);
49
+ });
50
+
51
+ test('registerView: no scope.out and no exclusions → empty list', () => {
52
+ const { est, req } = estimate((i, r) => { delete i.exclusions; delete r.raw.scope; });
53
+ assert.deepEqual(registerView(est, req).exclusions, []);
54
+ });
@@ -0,0 +1,209 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { execFileSync, spawnSync } from 'node:child_process';
4
+ import { join } from 'node:path';
5
+ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
6
+ import { tmpdir } from 'node:os';
7
+ import { fileURLToPath, 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
+ import { readZip } from '../../../classic/scripts/test/zip.mjs';
11
+ import { staged, noFlowsAt } from './stage.mjs';
12
+
13
+ const skip = !findChrome();
14
+ const settle = () => new Promise((r) => setTimeout(r, 1500));
15
+ const renderer = fileURLToPath(new URL('../render.mjs', import.meta.url));
16
+ function pages(mutate, edit) {
17
+ const dir = staged(mutate);
18
+ if (edit) edit(dir);
19
+ execFileSync('node', [renderer, '--inputs', join(dir, 'estimation-inputs.json'), '--json', join(dir, 'estimation.json'), '--out', join(dir, 'dist')]);
20
+ return (name) => pathToFileURL(join(dir, 'dist', name)).href;
21
+ }
22
+ const text = (page, sel) => page.eval(`document.querySelector(${JSON.stringify(sel)}).textContent`);
23
+
24
+ test('Workflow-based page: price, milestones, register, Method visible, no errors', { skip }, async () => {
25
+ const page = await openPage(pages()('estimate.html'));
26
+ try {
27
+ await settle();
28
+ assert.deepEqual(page.errors, []);
29
+ assert.match(await text(page, '#headline'), /\$39,000 – \$48,500/);
30
+ assert.equal(await page.eval(`document.querySelectorAll('#ms .m').length`), 3);
31
+ assert.equal(await page.eval(`document.querySelectorAll('#exclude li').length`), 2);
32
+ assert.notEqual(await page.eval(`getComputedStyle(document.getElementById('method')).display`), 'none');
33
+ assert.match(await text(page, '#subline'), /2 systems · 5 features/);
34
+ } finally { await page.close(); }
35
+ });
36
+
37
+ test('prices carry the currency code when it is not USD', { skip }, async () => {
38
+ const page = await openPage(pages((i) => { i.currency = 'SGD'; })('estimate.html'));
39
+ try {
40
+ await settle();
41
+ assert.match(await text(page, '#headline'), /SGD 39,000 – SGD 48,500/);
42
+ } finally { await page.close(); }
43
+ });
44
+
45
+ test('Component-based page: read-only, tasks with hours, no errors', { skip }, async () => {
46
+ const page = await openPage(pages()('estimate-components.html'));
47
+ try {
48
+ await settle();
49
+ assert.deepEqual(page.errors, []);
50
+ assert.equal(await page.eval(`document.querySelectorAll('.pick button').length`), 0);
51
+ assert.equal(await page.eval(`getComputedStyle(document.querySelector('.bar')).display`), 'none');
52
+ assert.match(await text(page, '#headline'), /\$39,000 – \$48,500/);
53
+ assert.match(await page.eval(`document.body.textContent`), /Three-way match/);
54
+ } finally { await page.close(); }
55
+ });
56
+
57
+ async function exportedWorkbook(url) {
58
+ const page = await openPage(url);
59
+ try {
60
+ await settle();
61
+ return Buffer.from(await page.eval('window.__buildWorkbook()'), 'base64');
62
+ } finally { await page.close(); }
63
+ }
64
+
65
+ test('the workbook export: rows grouped by system, SYSTEM / MODULE in A, 8 tasks, familiarity level 1', { skip }, async () => {
66
+ const files = readZip(await exportedWorkbook(pages()('estimate-components.html')));
67
+ const sheet = (n) => files.get(`xl/worksheets/${n}`).toString('utf8');
68
+ const inline = (ref, text) => new RegExp(`<c r="${ref}"[^>]*t="inlineStr"><is><t>${text}</t>`);
69
+ assert.match(sheet('sheet2.xml'), inline('A7', 'Warehouse operations'));
70
+ assert.match(sheet('sheet2.xml'), inline('B7', 'Order pipeline &amp; stage engine'));
71
+ assert.match(sheet('sheet2.xml'), inline('B8', 'Short-pack alert'));
72
+ assert.match(sheet('sheet2.xml'), inline('A9', 'Orders &amp; invoicing'));
73
+ assert.match(sheet('sheet2.xml'), /<c r="H7"[^>]*><f[^>]*>[^<]*SUMPRODUCT/); // the export keeps a live formula
74
+ ['MILESTONE', 'CONTAINER', 'WHY THIS TIER'].forEach((h, i) => assert.match(sheet('sheet2.xml'), inline(`${'OPQ'[i]}6`, h)));
75
+ assert.equal((sheet('sheet6.xml').match(/<row r=/g) ?? []).length, 9); // header + 8 tasks
76
+ assert.match(sheet('sheet5.xml'), /<c r="C12"[^>]*><v>1<\/v>/); // stackFamiliarity
77
+ assert.match(files.get('xl/workbook.xml').toString('utf8'), /Task Breakdown[\s\S]*Score Rationale|Score Rationale[\s\S]*Task Breakdown/);
78
+ });
79
+
80
+ test('download xlsx starts the download, then reminds to review the Project Roll-up tab', { skip }, async () => {
81
+ const page = await openPage(pages()('estimate-components.html'));
82
+ try {
83
+ await settle();
84
+ await page.eval('window.__downloadXlsx = () => { window.__dl = 1; }');
85
+ await page.eval(`document.getElementById('xlsx').click()`);
86
+ assert.equal(await page.eval('window.__dl'), 1);
87
+ assert.equal(await page.eval(`document.getElementById('xlsx-remind').open`), true);
88
+ assert.equal(await page.eval(`document.getElementById('xlsx-remind').getAttribute('aria-labelledby')`), 'xlsx-remind-title');
89
+ assert.equal(await text(page, '#xlsx-remind-title'), 'Review the Project Roll-up tab');
90
+ assert.match(await text(page, '#xlsx-remind'), /Review the Project Roll-up tab[\s\S]*Project Roll-up, sets the project context levels/);
91
+ await page.eval(`[...document.querySelectorAll('#xlsx-remind button')].find((b) => b.textContent === 'Got it').click()`);
92
+ assert.equal(await page.eval(`document.getElementById('xlsx-remind').open`), false);
93
+ assert.deepEqual(page.errors, []);
94
+ } finally { await page.close(); }
95
+ });
96
+
97
+ // The template's own sample register text sits in shared strings; once our
98
+ // rows replace it, no Roll-up cell may still point at one of those strings.
99
+ function rollupOf(files) {
100
+ const strings = [...files.get('xl/sharedStrings.xml').toString('utf8').matchAll(/<si>([\s\S]*?)<\/si>/g)].map((m) => m[1]);
101
+ const xml = files.get('xl/worksheets/sheet5.xml').toString('utf8');
102
+ const cell = (ref) => new RegExp(`<c r="${ref}"[^>]*?(?:/>|>([\\s\\S]*?)</c>)`).exec(xml)?.[1] ?? '';
103
+ const shared = (needle) => strings.findIndex((x) => x.includes(needle));
104
+ return { xml, cell, shared };
105
+ }
106
+
107
+ test('the workbook carries the project name, assumptions and exclusions', { skip }, async () => {
108
+ const files = readZip(await exportedWorkbook(pages()('estimate-components.html')));
109
+ assert.match(files.get('xl/worksheets/sheet2.xml').toString('utf8'), /<c r="C3"[^>]*t="inlineStr"><is><t>sin-kowa-mini<\/t>/);
110
+ const { xml, cell, shared } = rollupOf(files);
111
+ assert.equal(cell('B61'), '<is><t>InvoiceNow is a data model only, with no live connection</t></is>');
112
+ assert.equal(cell('B63'), '');
113
+ assert.equal(cell('B70'), '<is><t>last-mile delivery tracking</t></is>');
114
+ assert.equal(cell('B71'), '<is><t>Hosting and third-party subscription fees</t></is>');
115
+ assert.equal(cell('B72'), '');
116
+ const sample = shared('Native mobile applications');
117
+ assert.ok(sample >= 0, 'the template sample text moved; update this test');
118
+ assert.doesNotMatch(xml, new RegExp(`t="s"[^>]*><v>${sample}</v>`));
119
+ });
120
+
121
+ test('more exclusions than slots: the last slot holds the rest', { skip }, async () => {
122
+ const more = (i) => { i.exclusions = Array.from({ length: 9 }, (_, n) => `extra ${n + 1}`); };
123
+ const { cell } = rollupOf(readZip(await exportedWorkbook(pages(more)('estimate-components.html'))));
124
+ assert.equal(cell('B77'), '<is><t>extra 7</t></is>');
125
+ assert.equal(cell('B78'), '<is><t>Also: extra 8; extra 9</t></is>');
126
+ });
127
+
128
+ // LibreOffice recalculates the exported workbook (it carries no cached
129
+ // values); the Roll-up's range to present must be the page's price.
130
+ const noOffice = spawnSync('soffice', ['--version'], { stdio: 'ignore' }).status !== 0;
131
+ function recalculated(bytes) {
132
+ const dir = mkdtempSync(join(tmpdir(), 'wf-recalc-'));
133
+ writeFileSync(join(dir, 'in.xlsx'), bytes);
134
+ execFileSync('soffice', [`-env:UserInstallation=${pathToFileURL(join(dir, 'profile')).href}`, '--headless',
135
+ '--convert-to', 'xlsx', '--outdir', join(dir, 'out'), join(dir, 'in.xlsx')], { stdio: 'ignore', timeout: 120000 });
136
+ return readZip(readFileSync(join(dir, 'out', 'in.xlsx')));
137
+ }
138
+
139
+ test('recalculated in LibreOffice, the Roll-up range to present equals estimation.json', { skip: skip || noOffice }, async () => {
140
+ const dir = staged();
141
+ execFileSync('node', [renderer, '--inputs', join(dir, 'estimation-inputs.json'), '--json', join(dir, 'estimation.json'), '--out', join(dir, 'dist')]);
142
+ const rollup = recalculated(await exportedWorkbook(pathToFileURL(join(dir, 'dist', 'estimate-components.html')).href))
143
+ .get('xl/worksheets/sheet5.xml').toString('utf8');
144
+ const value = (ref) => Number(new RegExp(`<c r="${ref}"[^>]*>(?:<f[^>]*>[^<]*</f>)?<v>([^<]*)</v>`).exec(rollup)?.[1]);
145
+ const { presentLow, presentHigh } = JSON.parse(readFileSync(join(dir, 'estimation.json'), 'utf8')).computed.price;
146
+ assert.deepEqual([value('C56'), value('D56')], [presentLow, presentHigh]);
147
+ });
148
+
149
+ test('a milestone chip whose feature is in no system hovers without errors', { skip }, async () => {
150
+ const unsystem = (dir) => {
151
+ const file = join(dir, 'requirements.json');
152
+ const req = JSON.parse(readFileSync(file, 'utf8'));
153
+ req.systems.forEach((s) => { s.features = s.features.filter((f) => f !== 'FEAT-005'); });
154
+ writeFileSync(file, JSON.stringify(req));
155
+ execFileSync('node', [fileURLToPath(new URL('../compute.mjs', import.meta.url)), '--inputs', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'estimation.json')]);
156
+ };
157
+ const page = await openPage(pages(null, unsystem)('estimate.html'));
158
+ try {
159
+ await settle();
160
+ assert.equal(await page.eval(`document.querySelectorAll('.chip[data-f="FEAT-005"]').length`), 1);
161
+ await page.eval(`document.querySelector('.chip[data-f="FEAT-005"]').dispatchEvent(new MouseEvent('mouseover', { bubbles: true }))`);
162
+ assert.deepEqual(page.errors, []);
163
+ } finally { await page.close(); }
164
+ });
165
+
166
+ test('a system with no workflow: Workflow-based page draws it, the card says so, no errors', { skip }, async () => {
167
+ const page = await openPage(pages(null, noFlowsAt)('estimate.html'));
168
+ try {
169
+ await settle();
170
+ assert.deepEqual(page.errors, []);
171
+ const metas = JSON.parse(await page.eval(`JSON.stringify([...document.querySelectorAll('#syscards .sys .meta')].map((m) => m.textContent))`));
172
+ assert.match(metas[0], /workflow from the PO's document/);
173
+ assert.match(metas[1], /no workflow in the PO's document/);
174
+ assert.doesNotMatch(await page.eval('document.body.textContent'), /suggested by us|Each system has its workflows/);
175
+ assert.match(await text(page, 'tr[data-feat="FEAT-003"]'), /not on a workflow step/);
176
+ } finally { await page.close(); }
177
+ });
178
+
179
+ test('a system with no workflow: Component-based page renders clean', { skip }, async () => {
180
+ const page = await openPage(pages(null, noFlowsAt)('estimate-components.html'));
181
+ try {
182
+ await settle();
183
+ assert.deepEqual(page.errors, []);
184
+ assert.match(await text(page, 'tr[data-cap="FEAT-003"]'), /off-step/);
185
+ } finally { await page.close(); }
186
+ });
187
+
188
+ test('a system with no workflow gets its card and its features, no diagram, no errors', { skip }, async () => {
189
+ const noWorkflow = (dir) => {
190
+ const file = join(dir, 'requirements.json');
191
+ const req = JSON.parse(readFileSync(file, 'utf8'));
192
+ req.systems[1].features = req.systems[1].features.filter((f) => f !== 'FEAT-005');
193
+ req.systems.push({ id: 'SYS-003', name: 'Audit', purpose: 'Checks packs.', label: 'confirmed', source: 'PO brief', workflows: [], features: ['FEAT-005'] });
194
+ writeFileSync(file, JSON.stringify(req));
195
+ execFileSync('node', [fileURLToPath(new URL('../compute.mjs', import.meta.url)), '--inputs', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'estimation.json')]);
196
+ };
197
+ const page = await openPage(pages(null, noWorkflow)('estimate.html'));
198
+ try {
199
+ await settle();
200
+ assert.deepEqual(page.errors, []);
201
+ assert.equal(await page.eval(`document.querySelectorAll('#syscards .sys').length`), 3);
202
+ assert.match(await text(page, '.sys[data-sys="SYS-003"] .meta'), /1 features · no workflow in the PO's document/);
203
+ assert.equal(await page.eval(`document.querySelectorAll('#b-SYS-003 .flow').length`), 0);
204
+ assert.equal(await page.eval(`document.querySelectorAll('#b-SYS-003 tr[data-feat="FEAT-005"]').length`), 1);
205
+ await page.eval(`document.querySelector('.sys[data-sys="SYS-003"]').dispatchEvent(new MouseEvent('mouseover', { bubbles: true }))`);
206
+ await page.eval(`document.querySelector('.sys[data-sys="SYS-003"]').click()`);
207
+ assert.deepEqual(page.errors, []);
208
+ } finally { await page.close(); }
209
+ });