@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,60 @@
1
+ // Builds assets/score-review.html from the approved mockup sources. Slots
2
+ // replace the Sin Kowa data; every other change to the mockup is a rep()
3
+ // below, so a rebuild never silently undoes one (build-template.test.mjs
4
+ // pins the output to the committed asset). Usage: node build-template.mjs [--out <file>]
5
+ import { readFileSync, writeFileSync } from 'node:fs';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const at = (rel) => fileURLToPath(new URL(rel, import.meta.url));
9
+ const M = at('../../../../../../docs/mockups/estimate-workflow-mode/');
10
+ const outFlag = process.argv.indexOf('--out');
11
+ const OUT = outFlag > 0 ? process.argv[outFlag + 1] : at('../assets/score-review.html');
12
+ const base = readFileSync(`${M}score-review.base.html`, 'utf8');
13
+ const py = readFileSync(`${M}build-score.py`, 'utf8');
14
+ const cssStart = py.indexOf("CSS = '''") + 9;
15
+ const css = py.slice(cssStart, py.indexOf("'''", cssStart));
16
+ let body = readFileSync(`${M}score-review.body.html`, 'utf8');
17
+
18
+ function rep(from, to) {
19
+ const next = body.replace(from, to);
20
+ if (next === body) throw new Error(`template builder: nothing matched ${String(from).slice(0, 60)}`);
21
+ body = next;
22
+ }
23
+
24
+ // ---- data slots ----
25
+ rep(/\/\*DATA\*\/\s*\n\/\*ENG\*\//, [
26
+ "const PAGE = JSON.parse(document.getElementById('page-data').textContent);",
27
+ 'const DATA = PAGE.data; const ENG = PAGE.eng; const IMPLEMENTS = PAGE.implements; const CAP_SCORES = PAGE.scores; const TASKS = {};',
28
+ ].join('\n'));
29
+ rep('/*ANCHOR*/', 'const ANCHOR = PAGE.anchor;');
30
+ rep('const FINAL = false; /*FINAL*/', 'const FINAL = false;');
31
+ rep(/<span class="mock">[^<]*<\/span>\s*\n/, '');
32
+ rep('<h1>Sin Kowa — score review', '<h1><!-- slot:TITLE --> — score review');
33
+ rep(/19 features in 4 systems, built by 21 components/, '<span id="subcount"></span>');
34
+ rep('render(); CAPS.forEach((c) => paint(c.id));', "$('#subcount').textContent = `${CAPS.length} features in ${DATA.systems.length} systems, built by ${COMPS.length} components`;\nrender(); CAPS.forEach((c) => paint(c.id));");
35
+ rep('Review &amp; send →</button>', 'Review &amp; send →</button> <span class="quiet">You can reopen this page later; your changes stay in this browser.</span>');
36
+ rep('<script type="module">', '<script type="application/json" id="page-data"><!-- slot:DATA --></script>\n<script type="module">');
37
+ // saved edits belong to one baseline: a page rebuilt from changed inputs starts fresh
38
+ rep(/const STORE = `score-review:\$\{DATA\.project\}:v4`;/, 'const STORE = `score-review:${DATA.project}:v4:${PAGE.baseline}`;');
39
+
40
+ // ---- pricing: the shared module replaces the transcription ----
41
+ rep(/const WEIGHTS = \{[^\n]*\n(?:const BANDS = [^\n]*\n){1,2}[^\n]*\n?const weighted = [^\n]*\nconst bandFor = [^\n]*\n/, '<!-- slot:MATH -->\n');
42
+ rep('// ---- v2 pricing, transcribed from scripts/lib/pricing.mjs ----', '// ---- v2 pricing, inlined from shared/lib/pricing.mjs ----');
43
+ rep(/function price\(s\) \{\n[\s\S]*?\n\}\n/, 'const price = (s) => featurePrice(s);\n');
44
+
45
+ // ---- architecture links: from the roster, to the viewer beside the page (spec 3 E4) ----
46
+ rep(/\/\/ the architecture document holds the C4 views[^\n]*\n\/\/ \(C3 is the Backend API[^\n]*\nconst ARCH = 'architecture\.html';\nconst archLink = [\s\S]*?\.join\(' · '\); \};\n/,
47
+ readFileSync(at('./template/arch-link.js'), 'utf8'));
48
+
49
+ // ---- the 22-line function gate (quality-gates.test.mjs) ----
50
+ // An apostrophe inside a template literal reads as a string quote to the gate.
51
+ rep("data-tip=\"Each feature's scores", 'data-tip="Each feature&#39;s scores');
52
+ rep("you can't send until each", 'you can&#39;t send until each');
53
+ rep(/document\.addEventListener\('click', \(e\) => \{\n const b = e\.target\.closest\('\.pick button'\);[\s\S]*?\n \}\n\}\);\n/,
54
+ readFileSync(at('./template/click.js'), 'utf8'));
55
+ rep(" const count = { edits: CAPS.filter((c) => isChanged(c.id)).length,", " repaintNav();\n}\nfunction repaintNav() {\n const count = { edits: CAPS.filter((c) => isChanged(c.id)).length,");
56
+ rep('diagrams need a connection in this mockup', 'diagrams need a connection');
57
+
58
+ const head = base.slice(0, base.indexOf('</style>')).replace('<title>Sin Kowa — score review</title>', '<title><!-- slot:TITLE --> — score review</title>');
59
+ writeFileSync(OUT, `${head}${css}${readFileSync(`${M}reading.css`, 'utf8')}</style>\n</head>\n<body>\n${body}`);
60
+ console.log(OUT);
@@ -0,0 +1,51 @@
1
+ // Builds assets/estimate-template.html (the Workflow-based page) from the
2
+ // approved mockup. Like build-template.mjs, every change to the mockup is a
3
+ // rep() below; build-pages.test.mjs pins the output to the committed asset.
4
+ // Usage: node build-workflow-template.mjs [--out <file>]
5
+ import { readFileSync, writeFileSync } from 'node:fs';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const at = (rel) => fileURLToPath(new URL(rel, import.meta.url));
9
+ const M = at('../../../../../../docs/mockups/estimate-workflow-mode/');
10
+ const outFlag = process.argv.indexOf('--out');
11
+ const OUT = outFlag > 0 ? process.argv[outFlag + 1] : at('../assets/estimate-template.html');
12
+ let html = readFileSync(`${M}estimate.src.html`, 'utf8');
13
+
14
+ // A function replacement: the inserted scripts contain `$'`, which a string
15
+ // replacement would expand.
16
+ function rep(from, to) {
17
+ const next = html.replace(from, () => to);
18
+ if (next === html) throw new Error(`workflow template builder: nothing matched ${String(from).slice(0, 60)}`);
19
+ html = next;
20
+ }
21
+
22
+ rep('<title>Sin Kowa — estimate</title>', '<title><!-- slot:TITLE --> — estimate</title>');
23
+ rep('</style>', `${readFileSync(`${M}reading.css`, 'utf8')}</style>`); // as build-workflow.py
24
+ rep('<body class="client">', '<body>'); // internal page (spec 3 E8): the client gets the proposal
25
+ rep(/<span class="mock">[^<]*<\/span>\s*\n/, '');
26
+ rep('<h1>Sin Kowa Digital Transformation — estimate', '<h1><!-- slot:TITLE --> — estimate');
27
+ rep(/<p class="sub">[^<]*<\/p>/, '<p class="sub" id="subline"></p>');
28
+ rep('<a href="estimate-mockup.html" aria-current="page">', '<a href="estimate.html" aria-current="page">');
29
+ rep('<a href="estimate-feature-mockup.html">Component-based</a>', '<a href="estimate-components.html">Component-based</a>');
30
+ rep('`estimate-feature-mockup.html#step=', '`estimate-components.html#step=');
31
+ rep('What Sin Kowa can use at the end of each milestone.', 'What the client can use at the end of each milestone.');
32
+ rep('<script type="module">\n/*DATA*/\n/*ENG*/\n/*ROLLUP*/', [
33
+ '<script type="application/json" id="page-data"><!-- slot:DATA --></script>',
34
+ '<script type="module">',
35
+ readFileSync(at('./template/prelude.js'), 'utf8'),
36
+ readFileSync(at('./template/view.js'), 'utf8'),
37
+ ].join('\n'));
38
+ rep('renderSummary(); renderSystems(); renderBreakdown(); renderRoadmap(); renderMethod();', [
39
+ "$('#subline').textContent = `${DATA.systems.length} systems · ${DATA.systems.reduce((n, s) => n + s.features.length, 0)} features · scope reviewed by the PO, scores reviewed internally · prices in ${PAGE.currency}`;",
40
+ 'viewSummary(PAGE.view); renderSystems(); renderBreakdown(); viewRoadmap(PAGE); viewMethod(PAGE.view);',
41
+ ].join('\n'));
42
+
43
+ rep('diagrams need a connection in this mockup', 'diagrams need a connection');
44
+ rep('if (id) return { hit: fromFeat(id)', 'if (id && byId[id]) return { hit: fromFeat(id)'); // a milestone feature in no system has no diagram steps
45
+ rep('byId[id].sys.id === c.dataset.sys', 'byId[id]?.sys.id === c.dataset.sys');
46
+ // A system may have no workflow (BA 0.4.0): s.main is null, and nothing sets `missing`.
47
+ rep("${s.main.missing ? 'workflow suggested by us, confirmed by PO' : 'workflow from the PO\\'s document'}", "${s.main ? 'workflow from the PO\\'s document' : 'no workflow in the PO\\'s document'}");
48
+ rep('Each system has its workflows; each feature sits on the workflow steps it serves.', "A system has the workflows the PO's document draws; each feature sits on the steps it serves, or on none when its system has no workflow.");
49
+
50
+ writeFileSync(OUT, html);
51
+ console.log(OUT);
@@ -0,0 +1,144 @@
1
+ # Builds assets/estimator-system.xlsx, the workflow-mode workbook template:
2
+ # Estimator_v2 (the XLSX_TEMPLATE embedded in shared/assets/xlsx-export.js)
3
+ # with a SYSTEM / MODULE column inserted before the Ballpark tab's FEATURE
4
+ # column. LibreOffice does the insert, so every formula, merge, validation and
5
+ # the Roll-up's links into the Ballpark tab shift with it.
6
+ #
7
+ # Build time only, never at render. Needs LibreOffice (`soffice`) and the
8
+ # system Python that ships its `uno` module:
9
+ # /usr/bin/python3 build-xlsx-template.py [--out <file>]
10
+ import base64
11
+ import os
12
+ import re
13
+ import shutil
14
+ import subprocess
15
+ import sys
16
+ import tempfile
17
+ import time
18
+ import zipfile
19
+ from pathlib import Path
20
+ from typing import Any
21
+ import uno
22
+ from com.sun.star.beans import PropertyValue
23
+
24
+ HERE = Path(__file__).resolve().parent
25
+ EXPORT_JS = HERE / '../../shared/assets/xlsx-export.js'
26
+ OUT = HERE / '../assets/estimator-system.xlsx'
27
+ CONTENTS = 1 | 2 | 4 | 16 # CellFlags VALUE | DATETIME | STRING | FORMULA: keeps the style
28
+ SPANNED_ROWS = (1, 2, 39) # title, subtitle, note: text in A, merged A:N
29
+ BALLPARK_XML = 'xl/worksheets/sheet2.xml'
30
+ # Both A and B stay in view while scrolling right. A hidden document's view
31
+ # ignores freezeAtPosition, so the pane is set in the saved sheet instead.
32
+ PANE = ('<pane xSplit="1" ySplit="6" topLeftCell="B7"', '<pane xSplit="2" ySplit="6" topLeftCell="C7"')
33
+
34
+
35
+ def prop(name: str, value: Any) -> PropertyValue:
36
+ p = PropertyValue()
37
+ p.Name, p.Value = name, value
38
+ return p
39
+
40
+
41
+ def connect(pipe: str) -> Any:
42
+ local = uno.getComponentContext()
43
+ resolver = local.ServiceManager.createInstanceWithContext('com.sun.star.bridge.UnoUrlResolver', local)
44
+ for _ in range(120):
45
+ try:
46
+ return resolver.resolve(f'uno:pipe,name={pipe};urp;StarOffice.ComponentContext')
47
+ except Exception:
48
+ time.sleep(0.5)
49
+ raise RuntimeError('LibreOffice did not start')
50
+
51
+
52
+ def copy_cells(sh: Any, src: str, dest: str) -> None:
53
+ sh.copyRange(sh.getCellRangeByName(dest).CellAddress, sh.getCellRangeByName(src).RangeAddress)
54
+
55
+
56
+ def span_from_a(sh: Any, r: int) -> None:
57
+ sh.getCellRangeByName(f'B{r}:N{r}').merge(False)
58
+ copy_cells(sh, f'B{r}', f'A{r}')
59
+ sh.getCellRangeByName(f'B{r}').clearContents(CONTENTS)
60
+ sh.getCellRangeByName(f'A{r}:N{r}').merge(True)
61
+
62
+
63
+ def add_system_column(doc: Any) -> None:
64
+ sh = doc.Sheets.getByName('Ballpark Estimator')
65
+ sh.Columns.insertByIndex(0, 1)
66
+ for r in SPANNED_ROWS:
67
+ span_from_a(sh, r)
68
+ copy_cells(sh, 'B6:B37', 'A6') # header, feature cells and subtotal band: B's look
69
+ sh.getCellRangeByName('A7:A37').clearContents(CONTENTS)
70
+ sh.getCellRangeByName('A6').setString('SYSTEM / MODULE')
71
+ cols = sh.Columns
72
+ cols.getByIndex(0).Width = round(cols.getByIndex(1).Width * 24 / 30)
73
+
74
+
75
+ def freeze_two_columns(path: Path) -> None:
76
+ with zipfile.ZipFile(path) as z:
77
+ parts = [(i, z.read(i)) for i in z.infolist()]
78
+ with zipfile.ZipFile(path, 'w', zipfile.ZIP_DEFLATED) as z:
79
+ for info, data in parts:
80
+ if info.filename == BALLPARK_XML:
81
+ xml = data.decode('utf8')
82
+ if PANE[0] not in xml:
83
+ raise RuntimeError('Ballpark pane not where expected')
84
+ data = xml.replace(PANE[0], PANE[1]).encode('utf8')
85
+ z.writestr(info, data)
86
+
87
+
88
+ def convert(src: Path, out: Path) -> None:
89
+ pipe = f'xlsx-template-{os.getpid()}'
90
+ profile = tempfile.mkdtemp(prefix='lo-xlsx-template-')
91
+ office = subprocess.Popen(['soffice', '--headless', '--invisible', '--norestore',
92
+ f'-env:UserInstallation=file://{profile}', f'--accept=pipe,name={pipe};urp;'])
93
+ try:
94
+ desk = connect(pipe).ServiceManager.createInstance('com.sun.star.frame.Desktop')
95
+ doc = desk.loadComponentFromURL(uno.systemPathToFileUrl(str(src)), '_blank', 0, (prop('Hidden', True),))
96
+ add_system_column(doc)
97
+ doc.storeToURL(uno.systemPathToFileUrl(str(out)), (prop('FilterName', 'Calc MS Excel 2007 XML'),))
98
+ doc.close(True)
99
+ try:
100
+ desk.terminate()
101
+ except Exception:
102
+ pass # the bridge drops as the office exits
103
+ office.wait(timeout=60)
104
+ finally:
105
+ if office.poll() is None:
106
+ office.kill()
107
+ shutil.rmtree(profile, ignore_errors=True)
108
+
109
+
110
+ USAGE = 'usage: /usr/bin/python3 build-xlsx-template.py [--out <file>]'
111
+
112
+
113
+ def out_path() -> Path:
114
+ if '--out' not in sys.argv:
115
+ return OUT.resolve()
116
+ at = sys.argv.index('--out') + 1
117
+ if at >= len(sys.argv) or sys.argv[at].startswith('--'):
118
+ sys.exit(USAGE)
119
+ return Path(sys.argv[at]).resolve()
120
+
121
+
122
+ def template_b64() -> str:
123
+ m = re.search(r"const XLSX_TEMPLATE = '([^']+)'", EXPORT_JS.read_text())
124
+ if not m:
125
+ raise RuntimeError(f'XLSX_TEMPLATE not found in {EXPORT_JS}')
126
+ return m.group(1)
127
+
128
+
129
+ def main() -> None:
130
+ out = out_path()
131
+ b64 = template_b64()
132
+ work = tempfile.mkdtemp(prefix='xlsx-template-')
133
+ try:
134
+ src = Path(work) / 'Estimator_v2.xlsx'
135
+ src.write_bytes(base64.b64decode(b64))
136
+ convert(src, out)
137
+ freeze_two_columns(out)
138
+ finally:
139
+ shutil.rmtree(work, ignore_errors=True)
140
+ print(out)
141
+
142
+
143
+ if __name__ == '__main__':
144
+ main()
@@ -0,0 +1,32 @@
1
+ // estimation-inputs.json (+ requirements.json) → estimation.json. Refuses on
2
+ // any schema finding so the computed truth never rests on a bad shape.
3
+ import { writeFileSync, mkdirSync } from 'node:fs';
4
+ import { dirname } from 'node:path';
5
+ import { loadMeasurements, resolveMeasurementsPath } from '../../shared/lib/measurements.mjs';
6
+ import { loadPair } from './lib/requirements.mjs';
7
+ import { checkWorkflowInputs } from './lib/schema.mjs';
8
+ import { computeWorkflowEstimation } from './lib/rollup.mjs';
9
+
10
+ export function parseArgs(argv) {
11
+ const args = {};
12
+ for (let i = 0; i < argv.length; i += 1) {
13
+ if (argv[i].startsWith('--')) args[argv[i].slice(2)] = argv[++i];
14
+ }
15
+ return args;
16
+ }
17
+
18
+ const args = parseArgs(process.argv.slice(2));
19
+ if (!args.inputs || !args.out) {
20
+ console.error('usage: compute.mjs --inputs estimation-inputs.json --out estimation.json');
21
+ process.exit(1);
22
+ }
23
+ const { inputs, req } = loadPair(args.inputs);
24
+ const findings = checkWorkflowInputs(inputs, req);
25
+ if (findings.length) {
26
+ console.error(findings.join('\n'));
27
+ process.exit(1);
28
+ }
29
+ const measurements = loadMeasurements(resolveMeasurementsPath(inputs)).records;
30
+ mkdirSync(dirname(args.out), { recursive: true });
31
+ writeFileSync(args.out, `${JSON.stringify(computeWorkflowEstimation(inputs, req, measurements), null, 2)}\n`);
32
+ console.log(args.out);
@@ -0,0 +1,44 @@
1
+ // Fills the two estimate templates. Both pages are internal (spec 3 E2): the
2
+ // client gets the proposal. Numbers come from estimation.json through
3
+ // page-view.mjs; the templates only format them.
4
+ import { embed } from '../../../../analyze-requirements/scripts/lib/embed.mjs';
5
+ import { inlineModule, extractExports } from '../../../shared/lib/inline.mjs';
6
+ import { pageData, systemData, MATH_EXPORTS } from './score-html.mjs';
7
+ import { priceView, milestoneView, registerView } from './page-view.mjs';
8
+ import { xlsxRows } from './xlsx-rows.mjs';
9
+
10
+ const json = (v) => JSON.stringify(v).replaceAll('</script', '<\\/script');
11
+
12
+ function common(est, req) {
13
+ return { currency: est.inputs.currency ?? 'USD', view: priceView(est), milestones: milestoneView(est), register: registerView(est, req) };
14
+ }
15
+
16
+ // The Effort side's task rows: [name, low, expected, high hours, confidence, assumptions].
17
+ export function taskTable(est) {
18
+ const out = {};
19
+ for (const c of est.inputs.components) {
20
+ const done = est.computed.components[c.id]?.tasks ?? {};
21
+ if (c.tasks?.length) out[c.id] = c.tasks.map((t) => [t.name, done[t.id].low, done[t.id].e, done[t.id].high, done[t.id].confidence, (t.assumptions ?? []).join('; ')]);
22
+ }
23
+ return out;
24
+ }
25
+
26
+ export function workflowHtml({ est, req, template }) {
27
+ const data = { project: est.inputs.project, mapLabel: req.mapLabel, systems: req.systems.map((s) => systemData(s, req)) };
28
+ return embed({ template, slots: { TITLE: est.inputs.project, DATA: json({ ...common(est, req), data }) } });
29
+ }
30
+
31
+ export function componentsHtml({ est, req, assets }) {
32
+ const page = {
33
+ ...pageData({ inputs: est.inputs, req, guide: assets.guide }), ...common(est, req),
34
+ tasks: taskTable(est),
35
+ xlsx: {
36
+ rows: xlsxRows(est, req), levels: est.inputs.contextLevels, template: assets.xlsxTemplate,
37
+ register: { project: est.inputs.project, ...registerView(est, req) },
38
+ },
39
+ };
40
+ return embed({
41
+ template: assets.template,
42
+ slots: { TITLE: est.inputs.project, DATA: json(page), MATH: inlineModule(extractExports(assets.mathSrc, MATH_EXPORTS)), XLSX: assets.xlsxSrc },
43
+ });
44
+ }
@@ -0,0 +1,71 @@
1
+ // Everything the two estimate pages print, computed here so the pages only
2
+ // format numbers and never derive a price (the classic page's rule too).
3
+ import { CONTEXT_FACTORS } from '../../../shared/lib/project-price.mjs';
4
+ import { round2 } from '../../../shared/lib/estimate-math.mjs';
5
+
6
+ const CTX_LABEL = {
7
+ codebaseMaturity: 'Codebase maturity', stackFamiliarity: 'Stack & domain familiarity', specQuality: 'Specification quality',
8
+ compliance: 'Compliance & data sensitivity', clientDecisions: 'Client decision structure',
9
+ };
10
+ const OVH_LABEL = {
11
+ foundation: 'Shared foundation & scaffolding', discovery: 'Discovery & specification', ux: 'UX / UI design', qa: 'QA & user acceptance testing',
12
+ devops: 'DevOps, environments & release', docs: 'Documentation & handover', pm: 'Project management & client comms', integration: 'Cross-feature integration',
13
+ };
14
+ const mean = (xs) => (xs.length ? xs.reduce((a, b) => a + b, 0) / xs.length : 0);
15
+ const byMilestone = (a, b) => a.localeCompare(b, undefined, { numeric: true });
16
+
17
+ function contextRows(inputs) {
18
+ return Object.keys(CONTEXT_FACTORS).map((key) => {
19
+ const level = inputs.contextLevels[key];
20
+ return { key, label: CTX_LABEL[key], level, anchor: inputs.contextProvenance?.[key]?.anchor ?? '', multiplier: CONTEXT_FACTORS[key][level - 1] ?? 1 };
21
+ });
22
+ }
23
+
24
+ function overheadRows(price) {
25
+ return Object.entries(price.overheads.lines).map(([key, pct]) => ({ label: OVH_LABEL[key] ?? key, pct, amount: round2(price.adjustedBase * pct) }));
26
+ }
27
+
28
+ // Hours once per component: a shared component is listed under several
29
+ // features but built once.
30
+ function effort(computed) {
31
+ const comps = Object.values(computed.components).filter((c) => c.builds.length);
32
+ const hours = round2(comps.reduce((n, c) => n + c.hours, 0));
33
+ const tasks = comps.reduce((n, c) => n + Object.keys(c.tasks).length, 0);
34
+ return { components: comps.length, tasks, hours, rate: hours ? round2(computed.price.p50 / hours) : null };
35
+ }
36
+
37
+ export function priceView(est) {
38
+ const { inputs, computed } = est;
39
+ const avg = (k) => round2(mean(inputs.features.map((f) => f.scores[k].n)));
40
+ return {
41
+ price: computed.price, featureCount: inputs.features.length, context: contextRows(inputs),
42
+ overheads: overheadRows(computed.price), avgUnc: avg('unc'), avgRisk: avg('risk'), effort: effort(computed),
43
+ };
44
+ }
45
+
46
+ // A milestone's range is its share of the feature build applied to the
47
+ // presented range — the mockup's rule.
48
+ function milestoneRow(name, feats, computed) {
49
+ const mine = feats.filter(([, f]) => f.milestone === name);
50
+ const total = computed.price.featurePoints;
51
+ const share = total ? mine.reduce((n, [, f]) => n + f.point, 0) / total : 0;
52
+ return {
53
+ name, title: name.replace(/^M(\d+) - /, '$1. '),
54
+ features: mine.map(([id, f]) => ({ id, name: f.name, system: f.system })),
55
+ components: Object.values(computed.components).filter((c) => c.milestone === name && c.builds.length).length,
56
+ share: round2(share), low: round2(computed.price.presentLow * share), high: round2(computed.price.presentHigh * share),
57
+ };
58
+ }
59
+
60
+ export function milestoneView(est) {
61
+ const feats = Object.entries(est.computed.features);
62
+ const names = [...new Set(feats.map(([, f]) => f.milestone).filter(Boolean))].sort(byMilestone);
63
+ return names.map((name) => milestoneRow(name, feats, est.computed));
64
+ }
65
+
66
+ export function registerView(est, req) {
67
+ return {
68
+ assumptions: (est.inputs.assumptions ?? []).map((a) => a.text),
69
+ exclusions: [...(req.raw.scope?.out ?? []), ...(est.inputs.exclusions ?? [])],
70
+ };
71
+ }
@@ -0,0 +1,19 @@
1
+ // One validation for validate.mjs and render.mjs: the inputs' shape, then a
2
+ // byte-level check that estimation.json's computed block is a fresh recompute.
3
+ import { readFileSync } from 'node:fs';
4
+ import { loadMeasurements, resolveMeasurementsPath } from '../../../shared/lib/measurements.mjs';
5
+ import { checkWorkflowInputs } from './schema.mjs';
6
+ import { computeWorkflowEstimation } from './rollup.mjs';
7
+
8
+ function checkComputed(inputs, req, jsonPath) {
9
+ const est = JSON.parse(readFileSync(jsonPath, 'utf8'));
10
+ const measurements = loadMeasurements(resolveMeasurementsPath(inputs)).records;
11
+ const fresh = computeWorkflowEstimation(inputs, req, measurements).computed;
12
+ return JSON.stringify(est.computed) === JSON.stringify(fresh) ? [] : ['estimation.json: computed block differs from a fresh recompute — run compute.mjs'];
13
+ }
14
+
15
+ export function pairFindings(inputs, req, jsonPath) {
16
+ const findings = checkWorkflowInputs(inputs, req);
17
+ if (!findings.length && jsonPath) findings.push(...checkComputed(inputs, req, jsonPath));
18
+ return findings;
19
+ }
@@ -0,0 +1,33 @@
1
+ // The BA package is the source of names, systems and workflow steps in
2
+ // workflow mode; estimation-inputs.json carries only ids and scores. This
3
+ // module loads and indexes it so no other module re-derives the shape.
4
+ import { existsSync, readFileSync } from 'node:fs';
5
+ import { dirname, resolve } from 'node:path';
6
+
7
+ const byId = (list) => Object.fromEntries((list ?? []).map((x) => [x.id, x]));
8
+
9
+ export function resolveRequirementsPath(inputsPath, inputs) {
10
+ if (typeof inputs.requirements !== 'string' || !inputs.requirements) return null;
11
+ return resolve(dirname(inputsPath), inputs.requirements);
12
+ }
13
+
14
+ export function loadRequirements(path) {
15
+ const raw = JSON.parse(readFileSync(path, 'utf8'));
16
+ const systems = raw.systems ?? [];
17
+ const systemOf = {};
18
+ for (const s of systems) for (const f of s.features ?? []) systemOf[f] = s.id;
19
+ return {
20
+ raw, project: raw.lead ?? raw.project ?? 'Estimate', mapLabel: raw.mapLabel ?? null,
21
+ features: byId(raw.features), systems, systemById: byId(systems), workflows: byId(raw.workflows), systemOf,
22
+ };
23
+ }
24
+
25
+ export function loadPair(inputsPath) {
26
+ const inputs = JSON.parse(readFileSync(inputsPath, 'utf8'));
27
+ const reqPath = resolveRequirementsPath(inputsPath, inputs);
28
+ const req = reqPath && existsSync(reqPath) ? loadRequirements(reqPath) : null;
29
+ return { inputs, req };
30
+ }
31
+
32
+ // Scope provenance in workflow mode is the BA label, not a field of our own.
33
+ export const featureProvenance = (feature) => (feature.label === 'confirmed' ? 'stated' : 'proposed');
@@ -0,0 +1,66 @@
1
+ // Turns validated workflow-mode inputs into estimation.json: a price per
2
+ // feature from its five scores, hours per component from agentic baselines,
3
+ // and the project price. Names and systems come from the BA package.
4
+ import { round2 } from '../../../shared/lib/estimate-math.mjs';
5
+ import { featurePrice } from '../../../shared/lib/pricing.mjs';
6
+ import { projectPrice } from '../../../shared/lib/project-price.mjs';
7
+ import { agenticTask } from '../../../shared/lib/baselines.mjs';
8
+ import { scoreNumbers, scoreSummary } from '../../../shared/lib/scoring.mjs';
9
+ import { featureProvenance } from './requirements.mjs';
10
+
11
+ const sortedMap = (entries) => Object.fromEntries(entries.sort(([a], [b]) => a.localeCompare(b)));
12
+ const builders = (featureId, components) => components.filter((c) => (c.builds ?? []).some((b) => b.feature === featureId));
13
+
14
+ // The feature lands with the component most specific to it — fewest other
15
+ // features built, earliest milestone on a tie — so shared plumbing never
16
+ // drags a feature to the last milestone.
17
+ export function mainBuilder(featureId, components) {
18
+ return builders(featureId, components)
19
+ .sort((a, b) => a.builds.length - b.builds.length || String(a.milestone).localeCompare(String(b.milestone), undefined, { numeric: true }))[0];
20
+ }
21
+
22
+ function featureRow(feature, ctx) {
23
+ const n = scoreNumbers(feature.scores);
24
+ const p = featurePrice(n);
25
+ const req = ctx.req.features[feature.id];
26
+ ctx.priced.push({ point: p.point, spread: p.spread, unc: n.unc, risk: n.risk });
27
+ return {
28
+ name: req.name,
29
+ system: ctx.req.systemById[ctx.req.systemOf[feature.id]]?.name ?? null,
30
+ provenance: featureProvenance(req),
31
+ milestone: mainBuilder(feature.id, ctx.components)?.milestone ?? null,
32
+ builtBy: builders(feature.id, ctx.components).map((c) => c.id).sort(),
33
+ ...scoreSummary(feature),
34
+ point: round2(p.point), spread: round2(p.spread), priceLow: round2(p.low), priceHigh: round2(p.high), flag: p.flag,
35
+ };
36
+ }
37
+
38
+ function componentRow(c, ctx) {
39
+ const tasks = {};
40
+ let hours = 0; let low = 0; let high = 0;
41
+ for (const task of c.tasks ?? []) {
42
+ const a = agenticTask(task, ctx.agentic);
43
+ tasks[task.id] = { e: round2(a.e), low: round2(a.lowH), high: round2(a.highH), sigma: round2(a.sigma), confidence: a.confidence, calibrated: a.calibrated, matchLevel: a.matchLevel };
44
+ hours += a.e; low += a.lowH; high += a.highH;
45
+ }
46
+ return {
47
+ name: c.name, container: c.parent ?? null, milestone: c.milestone ?? null,
48
+ builds: (c.builds ?? []).map((b) => b.feature), hours: round2(hours), low: round2(low), high: round2(high),
49
+ tasks: sortedMap(Object.entries(tasks)),
50
+ };
51
+ }
52
+
53
+ function roundedPrice(price) {
54
+ const block = Object.fromEntries(Object.entries(price).map(([k, v]) => [k, typeof v === 'number' ? round2(v) : v]));
55
+ block.overheads = { ...price.overheads, amount: round2(price.overheads.amount) };
56
+ return block;
57
+ }
58
+
59
+ export function computeWorkflowEstimation(inputs, req, measurements) {
60
+ const agentContext = { ...inputs.agentContext, repository: inputs.agentContext.repository ?? inputs.project };
61
+ const ctx = { req, components: inputs.components, priced: [], agentic: { records: measurements ?? [], agentContext } };
62
+ const features = sortedMap(inputs.features.map((f) => [f.id, featureRow(f, ctx)]));
63
+ const components = sortedMap(inputs.components.map((c) => [c.id, componentRow(c, ctx)]));
64
+ const price = projectPrice({ features: ctx.priced, levels: inputs.contextLevels ?? {} });
65
+ return { inputs, computed: { features, components, price: roundedPrice(price) } };
66
+ }
@@ -0,0 +1,69 @@
1
+ // Components carry the work in workflow mode: builds[] (which features, why),
2
+ // a milestone and agentic tasks. A container that has components is structure
3
+ // only; a leaf container (no components) may build features itself.
4
+ import { checkAgenticTask } from '../../../shared/lib/agentic-task-schema.mjs';
5
+
6
+ const nonEmpty = (v) => typeof v === 'string' && v.trim() !== '';
7
+
8
+ function checkRoster(components, out) {
9
+ const byId = new Map(components.map((c) => [c.id, c]));
10
+ if (byId.size !== components.length) out.push('component roster: duplicate ids');
11
+ for (const c of components) {
12
+ if (!nonEmpty(c.id)) out.push('component roster: every entry needs a non-empty id');
13
+ if (!nonEmpty(c.name)) out.push(`component ${c.id}: name must be a non-empty string`);
14
+ if (c.notEstimated !== undefined && !nonEmpty(c.notEstimated)) out.push(`component ${c.id}: notEstimated must carry a reason`);
15
+ if (c.parent === undefined) continue;
16
+ const parent = byId.get(c.parent);
17
+ if (!parent) out.push(`component ${c.id}: parent "${c.parent}" not in roster`);
18
+ else if (parent.parent !== undefined) out.push(`component ${c.id}: parent "${c.parent}" is not top-level (two levels max)`);
19
+ }
20
+ }
21
+
22
+ function checkBuilds(c, featureIds, out) {
23
+ const seen = new Set();
24
+ for (const b of c.builds ?? []) {
25
+ if (!featureIds.has(b.feature)) out.push(`component ${c.id}: builds ${b.feature} unknown`);
26
+ if (!nonEmpty(b.why)) out.push(`component ${c.id}: builds ${b.feature} without a why`);
27
+ if (seen.has(b.feature)) out.push(`component ${c.id}: builds ${b.feature} twice`);
28
+ seen.add(b.feature);
29
+ }
30
+ }
31
+
32
+ // Only a component that builds something carries work: tasks anywhere else
33
+ // would be priced without ever being validated.
34
+ function checkIdle(c, out) {
35
+ if (c.tasks?.length) out.push(`component ${c.id}: tasks need a builds entry — link a feature or move the tasks`);
36
+ }
37
+
38
+ function checkWork(c, parents, out) {
39
+ const builds = c.builds ?? [];
40
+ if (parents.has(c.id)) {
41
+ if (builds.length) out.push(`component ${c.id}: a container with components cannot build features — link the component`);
42
+ checkIdle(c, out);
43
+ return;
44
+ }
45
+ if (!builds.length) {
46
+ checkIdle(c, out);
47
+ if (c.notEstimated === undefined) out.push(`component ${c.id}: no feature covers it — add a builds entry or set notEstimated with a reason`);
48
+ return;
49
+ }
50
+ if (c.notEstimated !== undefined) out.push(`component ${c.id}: notEstimated but builds features — drop one`);
51
+ if (!nonEmpty(c.milestone)) out.push(`component ${c.id}: builds features but has no milestone`);
52
+ if (!(c.tasks?.length > 0)) out.push(`component ${c.id}: builds features but has no tasks`);
53
+ for (const t of c.tasks ?? []) checkAgenticTask(t, out);
54
+ }
55
+
56
+ export function checkComponents(inputs, out) {
57
+ const components = inputs.components;
58
+ if (!Array.isArray(components) || !components.length) { out.push('components roster is required in workflow mode'); return; }
59
+ checkRoster(components, out);
60
+ const featureIds = new Set((inputs.features ?? []).map((f) => f.id));
61
+ const parents = new Set(components.map((c) => c.parent).filter(Boolean));
62
+ const built = new Set();
63
+ for (const c of components) {
64
+ checkBuilds(c, featureIds, out);
65
+ checkWork(c, parents, out);
66
+ for (const b of c.builds ?? []) built.add(b.feature);
67
+ }
68
+ for (const id of featureIds) if (!built.has(id)) out.push(`feature ${id}: no component builds it`);
69
+ }