@v11g/agents-rock 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/package.json +2 -2
- package/plugins/business-analyst/.claude-plugin/plugin.json +1 -1
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/conflict-quoted.md +15 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/no-internal-ids.md +9 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/one-question.md +15 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/prompt.md +31 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-internal-ids.md +9 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-setup-questions.md +16 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/one-scope-question.md +19 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/prompt.md +31 -0
- package/plugins/business-analyst/evals/ba-review-page/case.yaml +4 -0
- package/plugins/business-analyst/evals/ba-review-page/fixture.sh +12 -0
- package/plugins/business-analyst/evals/ba-review-page/graders/decide-in-interview.md +26 -0
- package/plugins/business-analyst/evals/ba-review-page/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-review-page/prompt.md +9 -0
- package/plugins/business-analyst/skills/business-analyst/README.md +8 -0
- package/plugins/business-analyst/skills/business-analyst/SKILL.md +47 -16
- package/plugins/business-analyst/skills/business-analyst/assets/review-page.html +68 -0
- package/plugins/business-analyst/skills/business-analyst/evals/evals.json +1 -1
- package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +3 -2
- package/plugins/business-analyst/skills/business-analyst/references/interview.md +156 -8
- package/plugins/business-analyst/skills/business-analyst/references/review.md +18 -4
- package/plugins/business-analyst/skills/business-analyst/references/writing.md +49 -8
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +12 -6
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-data.mjs +66 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-layout.mjs +53 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-page.mjs +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-checks.mjs +73 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-md.mjs +53 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-render.mjs +72 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-rules.mjs +90 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review.mjs +48 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review.py +60 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_data.py +81 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_layout.py +50 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_page.py +115 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope.mjs +24 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope.py +35 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope_checks.py +168 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope_render.py +140 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +27 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.json +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.md +136 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/python-parity.test.mjs +88 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/quality-gates.test.mjs +26 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-browser.test.mjs +106 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-fixture.mjs +32 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-page.test.mjs +340 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-parity.test.mjs +79 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-cases.mjs +58 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-checks.test.mjs +31 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-md.test.mjs +140 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +1 -1
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.py +17 -8
- package/plugins/reasoning/.claude-plugin/plugin.json +1 -1
- package/plugins/reasoning/evals/format-handoff-folder/graders/folder-named.md +8 -0
- package/plugins/reasoning/evals/format-handoff-folder/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-handoff-folder/prompt.md +9 -0
- package/plugins/reasoning/evals/format-ids-and-supports/graders/ids-in-chat.md +8 -0
- package/plugins/reasoning/evals/format-ids-and-supports/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-ids-and-supports/graders/supports-resolve.md +11 -0
- package/plugins/reasoning/evals/format-ids-and-supports/prompt.md +8 -0
- package/plugins/reasoning/evals/format-root-candidate-status/graders/candidate-status.md +11 -0
- package/plugins/reasoning/evals/format-root-candidate-status/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-root-candidate-status/prompt.md +8 -0
- package/plugins/reasoning/evals/format-unsaved-continues/graders/analysis-completes.md +9 -0
- package/plugins/reasoning/evals/format-unsaved-continues/graders/not-saved-stated.md +9 -0
- package/plugins/reasoning/evals/format-unsaved-continues/graders/skill-fired.md +7 -0
- package/plugins/reasoning/evals/format-unsaved-continues/prompt.md +8 -0
- package/plugins/reasoning/skills/problem-router/README.md +6 -0
- package/plugins/reasoning/skills/problem-router/SKILL.md +4 -0
- package/plugins/reasoning/skills/problem-router/references/contract.md +114 -19
- package/plugins/reasoning/skills/problem-solving/README.md +6 -0
- package/plugins/reasoning/skills/problem-solving/SKILL.md +2 -0
- package/plugins/reasoning/skills/problem-solving/references/contract.md +114 -19
- package/plugins/reasoning/skills/problem-solving/references/interview.md +2 -0
- package/plugins/reasoning/skills/systemic-design/README.md +3 -0
- package/plugins/reasoning/skills/systemic-design/SKILL.md +2 -0
- package/plugins/reasoning/skills/systemic-design/references/contract.md +114 -19
- package/plugins/reasoning/skills/systemic-design/references/interview.md +2 -0
- package/plugins/reasoning/skills/systems-thinking/README.md +3 -0
- package/plugins/reasoning/skills/systems-thinking/SKILL.md +2 -0
- package/plugins/reasoning/skills/systems-thinking/frameworks/leverage-points.md +15 -6
- package/plugins/reasoning/skills/systems-thinking/references/contract.md +114 -19
- package/plugins/reasoning/skills/systems-thinking/references/interview.md +2 -0
- package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
- package/plugins/solution-architect/evals/proposal-workflow/case.yaml +6 -0
- package/plugins/solution-architect/evals/proposal-workflow/fixture.sh +6 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/inputs-written.md +23 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/no-proposal-md.md +7 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/validate-then-render.md +16 -0
- package/plugins/solution-architect/evals/proposal-workflow/prompt.md +10 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/case.yaml +4 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/fixture.sh +6 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +10 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/nothing-written.md +7 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +11 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/prompt.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/case.yaml +4 -0
- package/plugins/solution-architect/evals/workflow-happy-path/fixture.sh +6 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/no-estimation-md.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/pages-or-stop.md +16 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/routed-to-workflow.md +12 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/three-questions-max.md +14 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +15 -0
- package/plugins/solution-architect/evals/workflow-happy-path/prompt.md +9 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +11 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +4 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +16 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +27 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +9 -0
- package/plugins/solution-architect/skills/estimate/README.md +38 -18
- package/plugins/solution-architect/skills/estimate/SKILL.md +16 -69
- package/plugins/solution-architect/skills/estimate/classic/FLOW.md +77 -0
- package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template-agentic.html +111 -138
- package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template.html +219 -445
- package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/scores-review-template.html +5 -4
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/agentic-estimation.md +4 -2
- package/plugins/solution-architect/skills/estimate/classic/references/ai-multipliers.md +57 -0
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/interview.md +56 -35
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/scoring-guide.md +40 -4
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/task-shapes.md +1 -1
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/techniques.md +29 -21
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/writing.md +77 -45
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/compute.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/checks.mjs +38 -6
- package/plugins/solution-architect/skills/estimate/classic/scripts/lib/redact.mjs +112 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/roadmap.mjs +4 -5
- package/plugins/solution-architect/skills/estimate/classic/scripts/lib/rollup.mjs +129 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/schema.mjs +31 -38
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-csv.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-html.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/render.mjs +9 -8
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/score-review.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/baselines.test.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/browser-agentic.test.mjs +143 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser.test.mjs +211 -52
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/compute.test.mjs +58 -33
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/e2e.test.mjs +55 -3
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/estimate-math.test.mjs +44 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-fail.md +0 -10
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-pass.md +0 -10
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-inputs.json +1 -7
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/booking-inputs.json +11 -10
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-fail.md +6 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-pass.md +17 -21
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/measurements.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/pricing.test.mjs +88 -0
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/project-price.test.mjs +93 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/quality-gates.test.mjs +7 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/references.test.mjs +88 -26
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/render.test.mjs +405 -0
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/schema.test.mjs +114 -61
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/score-review.test.mjs +37 -4
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/scoring.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/url-state.test.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/validate.test.mjs +104 -10
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/xlsx-export.test.mjs +475 -0
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/zip-store.test.mjs +26 -0
- package/plugins/solution-architect/skills/estimate/evals/evals.json +44 -9
- package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +28 -0
- package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
- package/plugins/solution-architect/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.md +141 -0
- package/plugins/solution-architect/skills/estimate/shared/assets/xlsx-export.js +336 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/agentic-task-schema.mjs +24 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/context-schema.mjs +35 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/estimate-math.mjs +31 -0
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/inline.mjs +13 -5
- package/plugins/solution-architect/skills/estimate/shared/lib/pricing.mjs +78 -0
- package/plugins/solution-architect/skills/estimate/shared/lib/project-price.mjs +96 -0
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring-schema.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/scoring.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/shared/lib/zip.mjs +60 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/FLOW.md +91 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-components.html +994 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-template.html +440 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimator-system.xlsx +0 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/assets/score-review.html +838 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/references/hidden-work-by-type.md +429 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/references/linking.md +59 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-components-template.mjs +80 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-template.mjs +60 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +51 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-xlsx-template.py +144 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/compute.mjs +32 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-html.mjs +44 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-view.mjs +71 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/pair-findings.mjs +19 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/requirements.mjs +33 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/rollup.mjs +66 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema-components.mjs +69 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/schema.mjs +70 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-diff.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/score-html.mjs +52 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +51 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/render.mjs +42 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/score-review.mjs +46 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/arch-link.js +9 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/click.js +28 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/prelude.js +4 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/view.js +63 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/browser.test.mjs +127 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs +43 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-template.test.mjs +18 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/cli.test.mjs +48 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/estimator-system.test.mjs +66 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/ARCHITECTURE-mini.md +31 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/feedback.json +19 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/inputs-pass.json +80 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/measurements.jsonl +0 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/fixtures/requirements.json +79 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/page-view.test.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/pages-browser.test.mjs +209 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/quality-gates.test.mjs +25 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/render.test.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/requirements.test.mjs +33 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/rollup.test.mjs +80 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/schema.test.mjs +61 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/score-review.test.mjs +108 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/stage.mjs +32 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/workflow-script.test.mjs +24 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +58 -0
- package/plugins/solution-architect/skills/estimate/workflow-based/scripts/validate.mjs +19 -0
- package/plugins/solution-architect/skills/new-lead/SKILL.md +4 -3
- package/plugins/solution-architect/skills/proposal/README.md +22 -7
- package/plugins/solution-architect/skills/proposal/SKILL.md +18 -7
- package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +143 -0
- package/plugins/solution-architect/skills/proposal/evals/evals.json +29 -11
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/ARCHITECTURE.md +65 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/brief.md +21 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation-inputs.json +126 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation.json +215 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation-inputs.json +224 -34
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.json +103 -114
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.md +48 -22
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation-inputs.json +211 -33
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.json +102 -117
- package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.md +48 -25
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +31 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation-inputs.json +468 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation.json +773 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/measurements.jsonl +0 -0
- package/plugins/solution-architect/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/requirements.json +79 -0
- package/plugins/solution-architect/skills/proposal/references/interview.md +3 -6
- package/plugins/solution-architect/skills/proposal/references/review.md +16 -4
- package/plugins/solution-architect/skills/proposal/references/workflow.md +88 -0
- package/plugins/solution-architect/skills/proposal/references/writing.md +33 -31
- package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +1 -1
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +5 -22
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +18 -8
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +6 -2
- package/plugins/solution-architect/skills/proposal/scripts/lib/docx-body.mjs +42 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/docx-package.mjs +56 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/docx-xml.mjs +44 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +24 -33
- package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +1 -1
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-checks.mjs +71 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-cli.mjs +46 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-html.mjs +39 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-lead.mjs +45 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-page.mjs +30 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-view.mjs +80 -0
- package/plugins/solution-architect/skills/proposal/scripts/render.mjs +5 -1
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +50 -47
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +99 -40
- package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +11 -5
- package/plugins/solution-architect/skills/proposal/scripts/test/docx.test.mjs +68 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +3 -3
- package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +46 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +67 -54
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +6 -1
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +17 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +8 -12
- package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +3 -3
- package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +5 -4
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-browser.test.mjs +96 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-checks.test.mjs +98 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-docs.test.mjs +25 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-render.test.mjs +75 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-stage.mjs +15 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/workflow-view.test.mjs +78 -0
- package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +4 -1
- package/plugins/solution-architect/workflows/review-links.js +61 -0
- package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +0 -101
- package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +0 -89
- package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +0 -64
- package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +0 -154
- package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +0 -39
- package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +0 -131
- package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +0 -251
- package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +0 -254
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/slicing.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/agentic-checks.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/components.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/md-tables.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/scoring-checks.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/measurements.jsonl +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/zip.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/validate.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/baselines.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/measurements.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/score-diff.mjs +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Shape checks for estimation-inputs.json in workflow mode (spec §6). Features
|
|
2
|
+
// are ids + scores; their names live in requirements.json; components carry
|
|
3
|
+
// the work. Findings are strings with the offending id in them.
|
|
4
|
+
import { loadGuide } from '../../../shared/lib/scoring.mjs';
|
|
5
|
+
import { checkScoredFeature } from '../../../shared/lib/scoring-schema.mjs';
|
|
6
|
+
import { checkContext } from '../../../shared/lib/context-schema.mjs';
|
|
7
|
+
import { checkComponents } from './schema-components.mjs';
|
|
8
|
+
|
|
9
|
+
const FEATURE_BANNED = ['tasks', 'component', 'milestone', 'provenance'];
|
|
10
|
+
const nonEmpty = (v) => typeof v === 'string' && v.trim() !== '';
|
|
11
|
+
|
|
12
|
+
function checkMode(inputs, req, out) {
|
|
13
|
+
if (inputs.scopeMode !== 'workflow') out.push('scopeMode must be "workflow"');
|
|
14
|
+
if (!req) { out.push('requirements: file not found'); return; }
|
|
15
|
+
if (req.raw.scopeMode !== 'workflow') out.push('requirements: is not in workflow mode');
|
|
16
|
+
if (inputs.deliveryMode !== 'agentic' || inputs.depth !== 'STANDARD') out.push('workflow mode is agentic + STANDARD only');
|
|
17
|
+
const ctx = inputs.agentContext ?? {};
|
|
18
|
+
if (!(nonEmpty(ctx.agent) && nonEmpty(ctx.model))) out.push('agentContext.agent and .model are required');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function checkFeatureIds(inputs, req, out) {
|
|
22
|
+
const ids = (inputs.features ?? []).map((f) => f.id);
|
|
23
|
+
const have = new Set(ids);
|
|
24
|
+
ids.filter((id, i) => ids.indexOf(id) !== i).forEach((id) => out.push(`feature ${id}: duplicate id`));
|
|
25
|
+
for (const id of have) if (!req.features[id]) out.push(`feature ${id}: not in requirements.json`);
|
|
26
|
+
for (const id of Object.keys(req.features)) if (!have.has(id)) out.push(`requirements ${id}: not scored`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function checkFeatures(inputs, guide, out) {
|
|
30
|
+
for (const f of inputs.features ?? []) {
|
|
31
|
+
for (const key of FEATURE_BANNED) {
|
|
32
|
+
if (key in f) out.push(`feature ${f.id}: "${key}" belongs on components in workflow mode`);
|
|
33
|
+
}
|
|
34
|
+
checkScoredFeature(f, guide, out);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Familiarity is fixed at level 1 (spec D12) unless a human stated otherwise.
|
|
39
|
+
function checkFamiliarity(inputs, out) {
|
|
40
|
+
const level = inputs.contextLevels?.stackFamiliarity;
|
|
41
|
+
const src = inputs.contextProvenance?.stackFamiliarity?.source;
|
|
42
|
+
if (level !== undefined && level !== 1 && src !== 'stated') out.push(`stackFamiliarity: level ${level} needs a stated provenance`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function checkAssumptions(inputs, out) {
|
|
46
|
+
(inputs.assumptions ?? []).forEach((a, i) => {
|
|
47
|
+
if (!(typeof a.source === 'string' && /^(ASM-\d+|Q-\d+|new)$/.test(a.source))) out.push(`assumption ${i}: source missing`);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Commercial exclusions the BA never writes (hosting, support, security testing);
|
|
52
|
+
// the page lists them after requirements.json scope.out (spec 3 E3).
|
|
53
|
+
function checkExclusions(inputs, out) {
|
|
54
|
+
if (!('exclusions' in inputs)) return;
|
|
55
|
+
if (!(Array.isArray(inputs.exclusions) && inputs.exclusions.every(nonEmpty))) out.push('exclusions must be a list of non-empty strings');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function checkWorkflowInputs(inputs, req) {
|
|
59
|
+
const out = [];
|
|
60
|
+
checkMode(inputs, req, out);
|
|
61
|
+
if (!req) return out;
|
|
62
|
+
checkFeatureIds(inputs, req, out);
|
|
63
|
+
checkFeatures(inputs, loadGuide(), out);
|
|
64
|
+
checkComponents(inputs, out);
|
|
65
|
+
checkContext(inputs, out, { required: true });
|
|
66
|
+
checkFamiliarity(inputs, out);
|
|
67
|
+
checkAssumptions(inputs, out);
|
|
68
|
+
checkExclusions(inputs, out);
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// What the engineer changed on the page, folded back into the inputs: score
|
|
2
|
+
// moves (via the shared diff, anchors re-derived), component link changes,
|
|
3
|
+
// and asks for components that do not exist yet.
|
|
4
|
+
import { SCORE_FACTORS } from '../../../shared/lib/scoring.mjs';
|
|
5
|
+
import { diffScores, applyDiff } from '../../../shared/lib/score-diff.mjs';
|
|
6
|
+
|
|
7
|
+
const LINK_WHY = 'linked by the engineer in the score review';
|
|
8
|
+
const builds = (c) => (c.builds ?? []).map((b) => b.feature);
|
|
9
|
+
|
|
10
|
+
export function diffLinks(inputs, feedback) {
|
|
11
|
+
const out = [];
|
|
12
|
+
for (const fb of feedback.components ?? []) {
|
|
13
|
+
const c = inputs.components.find((x) => x.id === fb.id);
|
|
14
|
+
if (!c || !Array.isArray(fb.implements)) continue; // partial block: leave the links alone
|
|
15
|
+
const was = builds(c);
|
|
16
|
+
const now = fb.implements;
|
|
17
|
+
for (const f of now) if (!was.includes(f)) out.push({ component: c.id, feature: f, change: 'add' });
|
|
18
|
+
for (const f of was) if (!now.includes(f)) out.push({ component: c.id, feature: f, change: 'remove' });
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function applyLinks(inputs, linkDiff) {
|
|
24
|
+
return inputs.components.map((c) => {
|
|
25
|
+
const mine = linkDiff.filter((d) => d.component === c.id);
|
|
26
|
+
if (!mine.length) return c;
|
|
27
|
+
const removed = new Set(mine.filter((d) => d.change === 'remove').map((d) => d.feature));
|
|
28
|
+
const kept = (c.builds ?? []).filter((b) => !removed.has(b.feature));
|
|
29
|
+
const added = mine.filter((d) => d.change === 'add').map((d) => ({ feature: d.feature, why: LINK_WHY }));
|
|
30
|
+
return { ...c, builds: [...kept, ...added] };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Every moved score without a reason is a question the agent owes the
|
|
35
|
+
// reviewer; the old cite is the evidence the answer argues against.
|
|
36
|
+
function unreasoned(inputs, feedback, diff) {
|
|
37
|
+
const given = (c) => feedback.features.find((f) => f.id === c.id)?.reasons?.[c.field];
|
|
38
|
+
return diff.filter((c) => SCORE_FACTORS.includes(c.field) && !given(c))
|
|
39
|
+
.map((c) => ({ ...c, oldCite: inputs.features.find((f) => f.id === c.id).scores[c.field].cite }));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function readFeedback({ inputs, feedback, guide }) {
|
|
43
|
+
const known = new Set(inputs.features.map((f) => f.id));
|
|
44
|
+
// The page sends scoreNote '' when the engineer wrote no note: unchanged, not erased.
|
|
45
|
+
const features = (feedback.features ?? []).filter((f) => known.has(f.id))
|
|
46
|
+
.map(({ scoreNote, ...f }) => (scoreNote ? { ...f, scoreNote } : f));
|
|
47
|
+
const fb = { ...feedback, features };
|
|
48
|
+
const diff = diffScores(inputs, fb);
|
|
49
|
+
const links = diffLinks(inputs, fb);
|
|
50
|
+
return {
|
|
51
|
+
diff, needsReason: unreasoned(inputs, fb, diff), features: applyDiff({ draft: inputs, diff, guide }),
|
|
52
|
+
links, components: applyLinks(inputs, links), asks: fb.addComponent ?? [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Fills the score-review template: the BA package becomes the page's systems
|
|
2
|
+
// and features, the component roster its Built-by lists, the inputs its
|
|
3
|
+
// scores. Same slots discipline as the classic page (embed is strict).
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { embed } from '../../../../analyze-requirements/scripts/lib/embed.mjs';
|
|
6
|
+
import { inlineModule, extractExports } from '../../../shared/lib/inline.mjs';
|
|
7
|
+
import { SCORE_FACTORS } from '../../../shared/lib/scoring.mjs';
|
|
8
|
+
|
|
9
|
+
const flow = (w) => ({ id: w.id, name: w.name, steps: w.steps ?? [], branches: w.branches ?? [] });
|
|
10
|
+
|
|
11
|
+
export function systemData(s, req) {
|
|
12
|
+
const [main, ...subs] = (s.workflows ?? []).map((id) => flow(req.workflows[id]));
|
|
13
|
+
const features = (s.features ?? []).map((id) => {
|
|
14
|
+
const f = req.features[id];
|
|
15
|
+
return { id, name: f.name, steps: f.steps ?? [], does: f.does ?? '' };
|
|
16
|
+
});
|
|
17
|
+
return { id: s.id, name: s.name, main: main ?? null, subs, features };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Saved browser state is keyed to this, so stale edits never outlive a rebuild.
|
|
21
|
+
const fingerprint = (v) => createHash('sha256').update(JSON.stringify(v)).digest('hex').slice(0, 12);
|
|
22
|
+
|
|
23
|
+
export const MATH_EXPORTS = ['WEIGHTS', 'BANDS', 'MODEL_PARAMS', 'weightedScore', 'bandFor', 'pointEstimate', 'spreadFor', 'featurePrice'];
|
|
24
|
+
|
|
25
|
+
const isParent = (c, components) => components.some((x) => x.parent === c.id);
|
|
26
|
+
|
|
27
|
+
export function pageData({ inputs, req, guide }) {
|
|
28
|
+
const comps = inputs.components.filter((c) => !isParent(c, inputs.components));
|
|
29
|
+
const nameOf = Object.fromEntries(inputs.components.map((c) => [c.id, c.name]));
|
|
30
|
+
const implementsMap = Object.fromEntries(comps.map((c) => [c.id, (c.builds ?? []).map((b) => b.feature)]));
|
|
31
|
+
const scores = Object.fromEntries(inputs.features.map((f) => [f.id, SCORE_FACTORS.map((k) => f.scores[k].n)]));
|
|
32
|
+
return {
|
|
33
|
+
data: { project: inputs.project, mapLabel: req.mapLabel, systems: req.systems.map((s) => systemData(s, req)) },
|
|
34
|
+
eng: comps.map((c) => ({
|
|
35
|
+
id: c.id, name: c.name, container: c.parent ? nameOf[c.parent] : c.name, milestone: c.milestone ?? '', does: c.notEstimated ?? '',
|
|
36
|
+
})),
|
|
37
|
+
arch: 'index.html',
|
|
38
|
+
c3: Object.fromEntries(inputs.components.filter((c) => isParent(c, inputs.components)).map((c) => [c.name, c.id])),
|
|
39
|
+
implements: implementsMap, scores, anchor: guide, baseline: fingerprint([scores, implementsMap]),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function toHtml({ inputs, req, guide, template, mathSrc }) {
|
|
44
|
+
return embed({
|
|
45
|
+
template,
|
|
46
|
+
slots: {
|
|
47
|
+
TITLE: inputs.project,
|
|
48
|
+
DATA: JSON.stringify(pageData({ inputs, req, guide })).replaceAll('</script', '<\\/script'),
|
|
49
|
+
MATH: inlineModule(extractExports(mathSrc, MATH_EXPORTS)),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Feeds the shared v2 workbook export (shared/assets/xlsx-export.js) rows in
|
|
2
|
+
// the shape the classic page passes it: one per feature, its tasks under it.
|
|
3
|
+
// Workflow tasks live on components, so each component's tasks go under the
|
|
4
|
+
// first feature it builds — listed once, never dropped. Rows come grouped by
|
|
5
|
+
// system, for the workbook's SYSTEM / MODULE column.
|
|
6
|
+
import { mainBuilder } from './rollup.mjs';
|
|
7
|
+
import { featureProvenance } from './requirements.mjs';
|
|
8
|
+
|
|
9
|
+
// The pages' order: systems as requirements.json lists them, each system's
|
|
10
|
+
// features in its own order, then any feature no system claims.
|
|
11
|
+
function systemOrder(inputs, req) {
|
|
12
|
+
const placed = req.systems.flatMap((s) => (s.features ?? []).map((id) => [id, s.name]));
|
|
13
|
+
const ids = new Set(inputs.features.map((f) => f.id));
|
|
14
|
+
const loose = inputs.features.filter((f) => !placed.some(([id]) => id === f.id)).map((f) => [f.id, '']);
|
|
15
|
+
const seen = new Set(); // a feature two systems list is priced once, under the first
|
|
16
|
+
return [...placed.filter(([id]) => ids.has(id) && !seen.has(id) && seen.add(id)), ...loose];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function containerName(c, components) {
|
|
20
|
+
if (!c) return '';
|
|
21
|
+
return (c.parent && components.find((x) => x.id === c.parent))?.name ?? c.name;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function taskOwners(inputs) {
|
|
25
|
+
const owners = {};
|
|
26
|
+
for (const c of inputs.components) {
|
|
27
|
+
const first = inputs.features.find((f) => (c.builds ?? []).some((b) => b.feature === f.id));
|
|
28
|
+
if (first && c.tasks?.length) (owners[first.id] ??= []).push(c);
|
|
29
|
+
}
|
|
30
|
+
return owners;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function taskRows(c, computed) {
|
|
34
|
+
const done = computed.components[c.id].tasks;
|
|
35
|
+
return c.tasks.map((t) => ({
|
|
36
|
+
name: t.name, category: t.shape, o: done[t.id].low, m: done[t.id].e, p: done[t.id].high,
|
|
37
|
+
confidence: done[t.id].confidence, assumptions: t.assumptions ?? [],
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function xlsxRows(est, req) {
|
|
42
|
+
const { inputs, computed } = est;
|
|
43
|
+
const owners = taskOwners(inputs);
|
|
44
|
+
const byId = Object.fromEntries(inputs.features.map((f) => [f.id, f]));
|
|
45
|
+
return systemOrder(inputs, req).map(([id, system]) => [byId[id], system]).map(([f, system]) => ({
|
|
46
|
+
id: f.id, system, name: req.features[f.id].name, scores: f.scores, scoreNote: f.scoreNote ?? '',
|
|
47
|
+
scoreProvenance: f.scoreProvenance, provenance: featureProvenance(req.features[f.id]),
|
|
48
|
+
milestone: computed.features[f.id].milestone ?? '', container: containerName(mainBuilder(f.id, inputs.components), inputs.components),
|
|
49
|
+
tasks: (owners[f.id] ?? []).flatMap((c) => taskRows(c, computed)),
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Workflow-mode pages: estimate.html (Workflow-based) and
|
|
2
|
+
// estimate-components.html (Component-based), both internal, written into the
|
|
3
|
+
// lead's dist/ beside the architecture viewer. Validation runs first: an
|
|
4
|
+
// unvalidated estimate never renders (spec 3 W13).
|
|
5
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { loadPair } from './lib/requirements.mjs';
|
|
8
|
+
import { pairFindings } from './lib/pair-findings.mjs';
|
|
9
|
+
import { workflowHtml, componentsHtml } from './lib/page-html.mjs';
|
|
10
|
+
import { loadGuide } from '../../shared/lib/scoring.mjs';
|
|
11
|
+
import { withZip } from '../../shared/lib/inline.mjs';
|
|
12
|
+
|
|
13
|
+
const asset = (rel) => readFileSync(new URL(rel, import.meta.url), 'utf8');
|
|
14
|
+
|
|
15
|
+
function parseArgs(argv) {
|
|
16
|
+
const args = {};
|
|
17
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
18
|
+
if (argv[i].startsWith('--')) args[argv[i].slice(2)] = argv[++i];
|
|
19
|
+
}
|
|
20
|
+
return args;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const args = parseArgs(process.argv.slice(2));
|
|
24
|
+
if (!args.inputs || !args.json || !args.out) {
|
|
25
|
+
console.error('usage: render.mjs --inputs estimation-inputs.json --json estimation.json --out <lead>/dist');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
const { inputs, req } = loadPair(args.inputs);
|
|
29
|
+
const findings = pairFindings(inputs, req, args.json);
|
|
30
|
+
if (findings.length) { console.error(findings.join('\n')); process.exit(1); }
|
|
31
|
+
const est = JSON.parse(readFileSync(args.json, 'utf8'));
|
|
32
|
+
const assets = {
|
|
33
|
+
template: asset('../assets/estimate-components.html'), guide: loadGuide(),
|
|
34
|
+
mathSrc: asset('../../shared/lib/pricing.mjs'), xlsxSrc: withZip(asset('../../shared/assets/xlsx-export.js')),
|
|
35
|
+
xlsxTemplate: readFileSync(new URL('../assets/estimator-system.xlsx', import.meta.url)).toString('base64'),
|
|
36
|
+
};
|
|
37
|
+
mkdirSync(args.out, { recursive: true });
|
|
38
|
+
writeFileSync(join(args.out, 'estimate.html'), workflowHtml({ est, req, template: asset('../assets/estimate-template.html') }));
|
|
39
|
+
writeFileSync(join(args.out, 'estimate-components.html'), componentsHtml({ est, req, assets }));
|
|
40
|
+
if (!existsSync(join(args.out, 'index.html'))) console.log('Architecture viewer not found in dist/ — C2/C3 links will not open until it is rendered.');
|
|
41
|
+
console.log(join(args.out, 'estimate.html'));
|
|
42
|
+
console.log(join(args.out, 'estimate-components.html'));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Score review round-trip for workflow mode. --write renders the review page
|
|
2
|
+
// from inputs + the BA package; --read folds the page's feedback JSON back
|
|
3
|
+
// into scores, component links and asks. It scores nothing itself.
|
|
4
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { loadPair } from './lib/requirements.mjs';
|
|
6
|
+
import { toHtml } from './lib/score-html.mjs';
|
|
7
|
+
import { readFeedback } from './lib/score-diff.mjs';
|
|
8
|
+
import { loadGuide } from '../../shared/lib/scoring.mjs';
|
|
9
|
+
|
|
10
|
+
const templatePath = new URL('../assets/score-review.html', import.meta.url).pathname;
|
|
11
|
+
const mathPath = new URL('../../shared/lib/pricing.mjs', import.meta.url).pathname;
|
|
12
|
+
|
|
13
|
+
function parseArgs(argv) {
|
|
14
|
+
const args = {};
|
|
15
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
16
|
+
if (argv[i].startsWith('--')) args[argv[i].slice(2)] = argv[++i];
|
|
17
|
+
}
|
|
18
|
+
return args;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function requirePair(path) {
|
|
22
|
+
const pair = loadPair(path);
|
|
23
|
+
if (!pair.req) { console.error('requirements: file not found (inputs.requirements must point at the BA package)'); process.exit(1); }
|
|
24
|
+
return pair;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function write(args) {
|
|
28
|
+
const { inputs, req } = requirePair(args.write);
|
|
29
|
+
const html = toHtml({ inputs, req, guide: loadGuide(), template: readFileSync(templatePath, 'utf8'), mathSrc: readFileSync(mathPath, 'utf8') });
|
|
30
|
+
writeFileSync(args.out, html);
|
|
31
|
+
console.log(args.out);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function read(args) {
|
|
35
|
+
const { inputs } = requirePair(args.inputs);
|
|
36
|
+
const feedback = JSON.parse(readFileSync(args.read, 'utf8'));
|
|
37
|
+
console.log(JSON.stringify(readFeedback({ inputs, feedback, guide: loadGuide() }), null, 2));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const args = parseArgs(process.argv.slice(2));
|
|
41
|
+
if (args.write && args.out) write(args);
|
|
42
|
+
else if (args.read && args.inputs) read(args);
|
|
43
|
+
else {
|
|
44
|
+
console.error('usage: score-review.mjs --write estimation-inputs.json --out review.html\n score-review.mjs --read feedback.json --inputs estimation-inputs.json');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
package/plugins/solution-architect/skills/estimate/workflow-based/scripts/template/arch-link.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// the architecture document holds the C4 views; this page links there instead of redrawing them.
|
|
2
|
+
// PAGE.c3 maps a container's name to its id when it has components (a C3 view); the rest live in C2.
|
|
3
|
+
const ARCH = PAGE.arch;
|
|
4
|
+
const archLink = (containers) => {
|
|
5
|
+
const c3 = containers.filter((c) => Object.hasOwn(PAGE.c3, c));
|
|
6
|
+
const c2 = containers.some((c) => !Object.hasOwn(PAGE.c3, c));
|
|
7
|
+
return [...c3.map((c) => `<a class="archlink" href="${ARCH}#panel-components-${PAGE.c3[c]}" target="_blank" rel="noopener">C3 ${esc(c)} ↗</a>`),
|
|
8
|
+
c2 && `<a class="archlink" href="${ARCH}#panel-containers" target="_blank" rel="noopener">C2 containers ↗</a>`].filter(Boolean).join(' · ');
|
|
9
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function onEdit(e) {
|
|
2
|
+
const b = e.target.closest('.pick button');
|
|
3
|
+
if (b) { const { f, k } = b.dataset; cur[f][k] = +b.dataset.n; refresh(f); save(); return true; }
|
|
4
|
+
const un = e.target.closest('[data-unlink]')?.dataset.unlink;
|
|
5
|
+
if (un) { const [bid, c] = un.split(':'); links[bid] = links[bid].filter((x) => x !== c); relink(); return true; }
|
|
6
|
+
const ask = e.target.closest('[data-ask-btn]')?.dataset.askBtn;
|
|
7
|
+
if (ask) { asks[ask] = ''; relink(); $(`[data-ask="${ask}"]`)?.focus(); return true; }
|
|
8
|
+
const unask = e.target.closest('[data-unask]')?.dataset.unask;
|
|
9
|
+
if (unask) { delete asks[unask]; relink(); return true; }
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
function onCards(cards) {
|
|
13
|
+
sysFilter = cards === 'wf';
|
|
14
|
+
if (!sysFilter) openSystem(null); // All: every card, every system collapsed
|
|
15
|
+
if (sysFilter && !openSys) openSystem((DATA.systems.find((s) => s.features.some((c) => notBuilt(c.id))) || DATA.systems[0]).id);
|
|
16
|
+
refresh(); if (sysFilter) $('#map').scrollIntoView({ block: 'start', behavior: 'smooth' });
|
|
17
|
+
}
|
|
18
|
+
function onNav(e) {
|
|
19
|
+
const go = e.target.closest('[data-go]');
|
|
20
|
+
if (go && $(`#c-${go.dataset.go}`).classList.contains('hide')) { filter = 'all'; sysFilter = false; refresh(); }
|
|
21
|
+
const fl = e.target.closest('[data-filter]');
|
|
22
|
+
if (fl) { filter = filter === fl.dataset.filter ? 'all' : fl.dataset.filter; refresh(); if (filter === 'unlinked') { lastC = null; nextItem(true); } }
|
|
23
|
+
const sd = e.target.closest('[data-side]')?.dataset.side;
|
|
24
|
+
if (sd) { side = sd; document.body.classList.toggle('side-effort-on', side === 'effort'); totals(); }
|
|
25
|
+
const cards = e.target.closest('[data-cards]')?.dataset.cards;
|
|
26
|
+
if (cards) onCards(cards);
|
|
27
|
+
}
|
|
28
|
+
document.addEventListener('click', (e) => { if (!onEdit(e)) onNav(e); });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const PAGE = JSON.parse(document.getElementById('page-data').textContent);
|
|
2
|
+
const DATA = PAGE.data;
|
|
3
|
+
const $ = (s, el = document) => el.querySelector(s);
|
|
4
|
+
const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// ---- price sections, shared by the Workflow-based and Component-based pages ----
|
|
2
|
+
// Every amount arrives computed in PAGE (scripts/lib/page-view.mjs); this
|
|
3
|
+
// formats and places them and prices nothing.
|
|
4
|
+
const viewMoney = (n) => `${PAGE.currency === 'USD' ? '$' : `${PAGE.currency} `}${Math.round(n).toLocaleString('en-US')}`;
|
|
5
|
+
const viewKv = (rows, sum) => rows.map(([a, b]) => `<tr><td>${a}</td><td class="r">${b}</td></tr>`).join('')
|
|
6
|
+
+ `<tr class="sum"><td>${sum[0]}</td><td class="r">${sum[1]}</td></tr>`;
|
|
7
|
+
function viewBuRow(r, max) {
|
|
8
|
+
return `<div class="bu-row ${r.cls ?? ''}"><div class="lbl">${r.lbl}<small>${r.note}</small></div>
|
|
9
|
+
<div class="bu-bar"><i style="left:${r.from / max * 100}%;width:${Math.max(0.4, (r.to - r.from) / max * 100)}%"></i></div><div class="amt">${r.amt}</div></div>`;
|
|
10
|
+
}
|
|
11
|
+
function viewHeadline(p) {
|
|
12
|
+
$('#headline').innerHTML = `<div class="big"><span>Range to present</span><b>${viewMoney(p.presentLow)} – ${viewMoney(p.presentHigh)}</b><span>expected cost to worst realistic case</span></div>
|
|
13
|
+
<div><span>If one fixed number is unavoidable</span><b>${viewMoney(p.singleNumber)}</b><span>confident figure (80% chance at or under)</span></div>
|
|
14
|
+
<div><span>Expected cost</span><b>${viewMoney(p.p50)}</b><span>half the time lower, half higher</span></div>
|
|
15
|
+
<div><span>Implied accuracy</span><b>±${Math.round(p.impliedAccuracy * 100)}%</b><span>under 30%: a ballpark you can quote</span></div>`;
|
|
16
|
+
}
|
|
17
|
+
function viewSummary(v) {
|
|
18
|
+
const p = v.price; const base = p.adjustedBase; const out = base + p.overheads.amount;
|
|
19
|
+
viewHeadline(p);
|
|
20
|
+
const rows = [
|
|
21
|
+
{ lbl: 'Feature build', note: `${v.featureCount} scored features`, from: 0, to: p.featurePoints, amt: viewMoney(p.featurePoints) },
|
|
22
|
+
{ lbl: `× ${p.contextMultiplier.toFixed(2)} project context`, note: 'spec quality, decisions, compliance, familiarity', from: p.featurePoints, to: base, amt: `+${viewMoney(base - p.featurePoints)}` },
|
|
23
|
+
{ lbl: `+ ${Math.round(p.overheads.totalPct * 100)}% work outside features`, note: 'foundation, discovery, UX, QA, DevOps, docs, PM, integration', from: base, to: out, amt: `+${viewMoney(p.overheads.amount)}` },
|
|
24
|
+
{ lbl: `+ ${(p.contingencyRate * 100).toFixed(1)}% contingency`, note: 'known unknowns inside the agreed scope', from: out, to: p.p50, amt: `+${viewMoney(p.contingencyAmount)}` },
|
|
25
|
+
{ lbl: '= Expected cost', note: '', from: 0, to: p.p50, amt: viewMoney(p.p50), cls: 'total' },
|
|
26
|
+
{ lbl: 'Range to present', note: 'expected cost → worst realistic case, rounded up to 500', from: p.presentLow, to: p.presentHigh, amt: `${viewMoney(p.presentLow)}–${viewMoney(p.presentHigh)}`, cls: 'range' },
|
|
27
|
+
];
|
|
28
|
+
$('#buildup').innerHTML = `<h3>How the price builds up</h3>${rows.map((r) => viewBuRow(r, p.presentHigh || 1)).join('')}`;
|
|
29
|
+
}
|
|
30
|
+
function viewMs(m) {
|
|
31
|
+
const n = m.features.length;
|
|
32
|
+
return `<div class="m"><div class="dim num">${n} feature${n === 1 ? '' : 's'} finished<span class="internal"> · ${m.components} components</span></div>
|
|
33
|
+
<h4>${esc(m.title)}</h4>
|
|
34
|
+
<div class="amt internal"><b>${viewMoney(m.low)}–${viewMoney(m.high)}</b> · ${Math.round(m.share * 100)}% of the build</div>
|
|
35
|
+
<div>${m.features.map((f) => `<span class="chip" data-f="${esc(f.id)}" title="${esc(f.system ?? '')}">${esc(f.name)}</span>`).join('')}</div></div>`;
|
|
36
|
+
}
|
|
37
|
+
function viewRoadmap(page) {
|
|
38
|
+
$('#ms').innerHTML = page.milestones.map(viewMs).join('');
|
|
39
|
+
$('#assume').innerHTML = page.register.assumptions.map((a) => `<li>${esc(a)}</li>`).join('');
|
|
40
|
+
$('#exclude').innerHTML = page.register.exclusions.map((a) => `<li>${esc(a)}</li>`).join('');
|
|
41
|
+
}
|
|
42
|
+
function viewContext(v) {
|
|
43
|
+
$('#ctx').innerHTML = `<tr><th>Factor</th><th>Level</th><th class="r">Multiplier</th></tr>${v.context.map((c) =>
|
|
44
|
+
`<tr><td>${esc(c.label)}</td><td>${c.level} · ${esc(c.anchor)}</td><td class="r">${c.multiplier.toFixed(2)}</td></tr>`).join('')}
|
|
45
|
+
<tr class="sum"><td colspan="2">Composite (1 + sum of deviations, cap 2.5)</td><td class="r">${v.price.contextMultiplier.toFixed(2)}</td></tr>`;
|
|
46
|
+
}
|
|
47
|
+
function viewOverheads(v) {
|
|
48
|
+
const o = v.price.overheads;
|
|
49
|
+
$('#ovh').innerHTML = `<tr><th>Cost line</th><th class="r">% of base</th><th class="r">Amount</th></tr>${v.overheads.map((r) =>
|
|
50
|
+
`<tr><td>${esc(r.label)}</td><td class="r">${Math.round(r.pct * 100)}%</td><td class="r">${viewMoney(r.amount)}</td></tr>`).join('')}
|
|
51
|
+
<tr class="sum"><td>Total</td><td class="r">${Math.round(o.totalPct * 100)}%</td><td class="r">${viewMoney(o.amount)}</td></tr>`;
|
|
52
|
+
}
|
|
53
|
+
function viewMethod(v) {
|
|
54
|
+
const p = v.price; const e = v.effort;
|
|
55
|
+
viewContext(v); viewOverheads(v);
|
|
56
|
+
$('#cont').innerHTML = viewKv([['Average uncertainty across features', v.avgUnc.toFixed(2)], ['Average risk across features', v.avgRisk.toFixed(2)],
|
|
57
|
+
['Rate: 5% + 2% × uncertainty + 2% × risk', `${(p.contingencyRate * 100).toFixed(1)}%`]], ['On build + outside work', viewMoney(p.contingencyAmount)]);
|
|
58
|
+
$('#rng').innerHTML = viewKv([['Optimistic (20% chance at or under)', viewMoney(p.p20)], ['Expected cost', viewMoney(p.p50)],
|
|
59
|
+
['Confident (80%)', viewMoney(p.p80)], ['Worst realistic case (95%)', viewMoney(p.p95)]],
|
|
60
|
+
['Presented: expected → worst, rounded up to 500', `${viewMoney(p.presentLow)}–${viewMoney(p.presentHigh)}`]);
|
|
61
|
+
$('#xcheck').innerHTML = viewKv([['Components', e.components], ['Tasks', e.tasks], ['Expected effort (agentic baselines)', `${Math.round(e.hours).toLocaleString('en-US')}h`]],
|
|
62
|
+
['Implied rate at the expected cost', e.rate === null ? '—' : `${viewMoney(e.rate)}/h`]);
|
|
63
|
+
}
|
package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/browser.test.mjs
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { execFileSync } 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, pathToFileURL } from 'node:url';
|
|
8
|
+
import { noFlowsAt } from './stage.mjs';
|
|
9
|
+
import { findChrome } from '../../../../analyze-requirements/scripts/lib/chrome.mjs';
|
|
10
|
+
import { openPage } from '../../../../analyze-requirements/scripts/lib/cdp.mjs';
|
|
11
|
+
|
|
12
|
+
const script = fileURLToPath(new URL('../score-review.mjs', import.meta.url));
|
|
13
|
+
const fx = (n) => fileURLToPath(new URL(`./fixtures/${n}`, import.meta.url));
|
|
14
|
+
const skip = !findChrome();
|
|
15
|
+
|
|
16
|
+
function buildPage(mutate) {
|
|
17
|
+
const dir = mkdtempSync(join(tmpdir(), 'wf-page-'));
|
|
18
|
+
const inputs = JSON.parse(readFileSync(fx('inputs-pass.json'), 'utf8'));
|
|
19
|
+
if (mutate) mutate(inputs);
|
|
20
|
+
writeFileSync(join(dir, 'estimation-inputs.json'), JSON.stringify(inputs));
|
|
21
|
+
copyFileSync(fx('requirements.json'), join(dir, 'requirements.json'));
|
|
22
|
+
execFileSync('node', [script, '--write', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'review.html')]);
|
|
23
|
+
return pathToFileURL(join(dir, 'review.html')).href;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const settle = () => new Promise((r) => setTimeout(r, 1500));
|
|
27
|
+
// The lock lives in the Review & send dialog: opening it sets Copy feedback's state.
|
|
28
|
+
const sendLocked = (page) => page.eval(`(() => { document.getElementById('preview').click(); const d = document.getElementById('copy').disabled; document.getElementById('dlg').close(); return d; })()`);
|
|
29
|
+
const count = (page) => page.eval(`[...document.querySelectorAll('[id^="c-FEAT"]:not(.hide)')].length`);
|
|
30
|
+
|
|
31
|
+
test('renders five cards, no console errors, send unlocked', { skip }, async () => {
|
|
32
|
+
const page = await openPage(buildPage());
|
|
33
|
+
try {
|
|
34
|
+
await settle();
|
|
35
|
+
assert.deepEqual(page.errors, []);
|
|
36
|
+
assert.equal(await count(page), 5);
|
|
37
|
+
assert.equal(await sendLocked(page), false);
|
|
38
|
+
assert.match(await page.eval(`document.getElementById('subcount').textContent`), /5 features in 2 systems, built by 7 components/);
|
|
39
|
+
} finally { await page.close(); }
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('an unbuilt feature locks send; its ask unlocks it', { skip }, async () => {
|
|
43
|
+
const page = await openPage(buildPage((i) => { i.components.find((c) => c.id === 'worker.drafter').builds = []; }));
|
|
44
|
+
try {
|
|
45
|
+
await settle();
|
|
46
|
+
assert.equal(await sendLocked(page), true);
|
|
47
|
+
await page.eval(`document.querySelector('[data-ask-btn="FEAT-004"]').click()`);
|
|
48
|
+
await page.eval(`(() => { const t = document.querySelector('[data-ask="FEAT-004"]'); t.value = 'add a drafter'; t.dispatchEvent(new Event('input', { bubbles: true })); })()`);
|
|
49
|
+
assert.equal(await sendLocked(page), false);
|
|
50
|
+
const fb = await page.eval(`JSON.stringify(window.__feedback())`);
|
|
51
|
+
assert.deepEqual(JSON.parse(fb).addComponent, [{ feature: 'FEAT-004', note: 'add a drafter' }]);
|
|
52
|
+
} finally { await page.close(); }
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('opening a system switches the cards to that system', { skip }, async () => {
|
|
56
|
+
const page = await openPage(buildPage());
|
|
57
|
+
try {
|
|
58
|
+
await settle();
|
|
59
|
+
await page.eval(`document.querySelectorAll('details.capsys > summary')[1].click()`);
|
|
60
|
+
await new Promise((r) => setTimeout(r, 400));
|
|
61
|
+
assert.equal(await count(page), 3); // SYS-002: FEAT-003, FEAT-004, FEAT-005
|
|
62
|
+
assert.equal(await page.eval(`document.querySelector('[data-cards="wf"]').getAttribute('aria-pressed')`), 'true');
|
|
63
|
+
await page.eval(`document.querySelectorAll('details.capsys > summary')[1].click()`);
|
|
64
|
+
await new Promise((r) => setTimeout(r, 400));
|
|
65
|
+
assert.equal(await count(page), 5);
|
|
66
|
+
} finally { await page.close(); }
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('a star-step feature and a system without sub-workflows render clean', { skip }, async () => {
|
|
70
|
+
const page = await openPage(buildPage());
|
|
71
|
+
try {
|
|
72
|
+
await settle();
|
|
73
|
+
assert.deepEqual(page.errors, []);
|
|
74
|
+
assert.equal(await page.eval(`document.querySelectorAll('details.capsys').length`), 2);
|
|
75
|
+
} finally { await page.close(); }
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('a feature covering every step renders the "every step" chip, no errors', { skip }, async () => {
|
|
79
|
+
const dir = mkdtempSync(join(tmpdir(), 'wf-star-'));
|
|
80
|
+
const req = JSON.parse(readFileSync(fx('requirements.json'), 'utf8'));
|
|
81
|
+
req.features[0].steps = ['*'];
|
|
82
|
+
writeFileSync(join(dir, 'requirements.json'), JSON.stringify(req));
|
|
83
|
+
const inputs = JSON.parse(readFileSync(fx('inputs-pass.json'), 'utf8'));
|
|
84
|
+
writeFileSync(join(dir, 'estimation-inputs.json'), JSON.stringify(inputs));
|
|
85
|
+
execFileSync('node', [script, '--write', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'review.html')]);
|
|
86
|
+
const page = await openPage(pathToFileURL(join(dir, 'review.html')).href);
|
|
87
|
+
try {
|
|
88
|
+
await settle();
|
|
89
|
+
assert.deepEqual(page.errors, []);
|
|
90
|
+
assert.match(await page.eval(`document.querySelector('tr[data-cap="FEAT-001"]').textContent`), /every step/);
|
|
91
|
+
} finally { await page.close(); }
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('prices are the shared featurePrice, never NaN', { skip }, async () => {
|
|
95
|
+
const { featurePrice } = await import('../../../shared/lib/pricing.mjs');
|
|
96
|
+
const page = await openPage(buildPage());
|
|
97
|
+
try {
|
|
98
|
+
await settle();
|
|
99
|
+
assert.doesNotMatch(await page.eval('document.body.textContent'), /NaN/);
|
|
100
|
+
const point = featurePrice({ tech: 3, size: 3, deps: 2, unc: 3, risk: 3 }).point;
|
|
101
|
+
const want = `$${Math.round(2 * point).toLocaleString('en-US')}`; // SYS-001: FEAT-001 + FEAT-002
|
|
102
|
+
assert.equal(await page.eval(`document.querySelector('[data-sub="SYS-001"] .side-score b').textContent`), want);
|
|
103
|
+
} finally { await page.close(); }
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test('architecture links come from the roster', { skip }, async () => {
|
|
107
|
+
const page = await openPage(buildPage());
|
|
108
|
+
try {
|
|
109
|
+
await settle();
|
|
110
|
+
const hrefs = await page.eval(`JSON.stringify([...document.querySelectorAll('#c-FEAT-001 a.archlink')].map((a) => a.getAttribute('href')))`);
|
|
111
|
+
assert.deepEqual(JSON.parse(hrefs), ['index.html#panel-components-api', 'index.html#panel-containers']);
|
|
112
|
+
} finally { await page.close(); }
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('a system with no workflow renders clean on the score review', { skip }, async () => {
|
|
116
|
+
const dir = mkdtempSync(join(tmpdir(), 'wf-noflow-'));
|
|
117
|
+
copyFileSync(fx('requirements.json'), join(dir, 'requirements.json'));
|
|
118
|
+
noFlowsAt(dir);
|
|
119
|
+
writeFileSync(join(dir, 'estimation-inputs.json'), readFileSync(fx('inputs-pass.json'), 'utf8'));
|
|
120
|
+
execFileSync('node', [script, '--write', join(dir, 'estimation-inputs.json'), '--out', join(dir, 'review.html')]);
|
|
121
|
+
const page = await openPage(pathToFileURL(join(dir, 'review.html')).href);
|
|
122
|
+
try {
|
|
123
|
+
await settle();
|
|
124
|
+
assert.deepEqual(page.errors, []);
|
|
125
|
+
assert.match(await page.eval(`document.querySelector('tr[data-cap="FEAT-003"]').textContent`), /off-step/);
|
|
126
|
+
} finally { await page.close(); }
|
|
127
|
+
});
|
package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { mkdtempSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const at = (rel) => fileURLToPath(new URL(rel, import.meta.url));
|
|
10
|
+
|
|
11
|
+
// Every edit to a template lives in its builder, so a rebuild from the mockup
|
|
12
|
+
// never silently undoes one (as build-template.test.mjs does for the review).
|
|
13
|
+
function pinned(builder, asset) {
|
|
14
|
+
const out = join(mkdtempSync(join(tmpdir(), 'wf-pages-')), 'page.html');
|
|
15
|
+
execFileSync('node', [at(builder), '--out', out], { cwd: tmpdir() });
|
|
16
|
+
assert.equal(readFileSync(out, 'utf8'), readFileSync(at(asset), 'utf8'));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
test('build-workflow-template.mjs reproduces assets/estimate-template.html', () => {
|
|
20
|
+
pinned('../build-workflow-template.mjs', '../../assets/estimate-template.html');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('the Workflow-based template has its slots, no mockup leftovers, internal parts visible', () => {
|
|
24
|
+
const t = readFileSync(at('../../assets/estimate-template.html'), 'utf8');
|
|
25
|
+
assert.deepEqual([...new Set([...t.matchAll(/<!-- slot:(\w+) -->/g)].map((m) => m[1]))].sort(), ['DATA', 'TITLE']);
|
|
26
|
+
for (const gone of ['MOCKUP', 'Sin Kowa', 'estimate-feature-mockup.html', 'estimate-mockup.html', '/*DATA*/', '<body class="client">']) {
|
|
27
|
+
assert.ok(!t.includes(gone), `template still carries ${gone}`);
|
|
28
|
+
}
|
|
29
|
+
assert.ok(t.includes('href="estimate-components.html"'));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('build-components-template.mjs reproduces assets/estimate-components.html', () => {
|
|
33
|
+
pinned('../build-components-template.mjs', '../../assets/estimate-components.html');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('the Component-based template is the review read-only, with tasks, price and export', () => {
|
|
37
|
+
const t = readFileSync(at('../../assets/estimate-components.html'), 'utf8');
|
|
38
|
+
assert.deepEqual([...new Set([...t.matchAll(/<!-- slot:(\w+) -->/g)].map((m) => m[1]))].sort(), ['DATA', 'MATH', 'TITLE', 'XLSX']);
|
|
39
|
+
for (const want of ['const FINAL = true;', 'const TASKS = PAGE.tasks;', 'id="xlsx"', 'href="estimate.html"', 'id="method"', 'const XLSX_SOURCE']) {
|
|
40
|
+
assert.ok(t.includes(want), `template lacks ${want}`);
|
|
41
|
+
}
|
|
42
|
+
assert.ok(!t.includes('architecture.html'));
|
|
43
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { mkdtempSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const builder = fileURLToPath(new URL('../build-template.mjs', import.meta.url));
|
|
10
|
+
const committed = fileURLToPath(new URL('../../assets/score-review.html', import.meta.url));
|
|
11
|
+
|
|
12
|
+
// Every edit to the template lives in the builder, so a rebuild from the
|
|
13
|
+
// mockup never silently undoes one.
|
|
14
|
+
test('build-template.mjs reproduces assets/score-review.html byte for byte', () => {
|
|
15
|
+
const out = join(mkdtempSync(join(tmpdir(), 'wf-tpl-')), 'score-review.html');
|
|
16
|
+
execFileSync('node', [builder, '--out', out], { cwd: tmpdir() });
|
|
17
|
+
assert.equal(readFileSync(out, 'utf8'), readFileSync(committed, 'utf8'));
|
|
18
|
+
});
|