@v11g/agents-rock 1.0.9 → 1.0.11
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 +3 -1
- package/package.json +2 -2
- package/plugins/business-analyst/.claude-plugin/plugin.json +2 -2
- 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/evals/draft-scope-rich/case.yaml +4 -0
- package/plugins/business-analyst/evals/draft-scope-rich/fixture.sh +5 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/conflict-question.md +11 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/keep-and-exclude.md +14 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/noise-and-shape.md +13 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/problem-not-solution.md +13 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/share-kept.md +11 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/draft-scope-rich/graders/vague-word.md +13 -0
- package/plugins/business-analyst/evals/draft-scope-rich/inputs/C1.txt +10 -0
- package/plugins/business-analyst/evals/draft-scope-rich/inputs/E1.txt +5 -0
- package/plugins/business-analyst/evals/draft-scope-rich/inputs/E2.txt +5 -0
- package/plugins/business-analyst/evals/draft-scope-rich/inputs/E3.txt +5 -0
- package/plugins/business-analyst/evals/draft-scope-rich/prompt.md +9 -0
- package/plugins/business-analyst/evals/draft-scope-thin/case.yaml +4 -0
- package/plugins/business-analyst/evals/draft-scope-thin/fixture.sh +4 -0
- package/plugins/business-analyst/evals/draft-scope-thin/graders/no-invention.md +18 -0
- package/plugins/business-analyst/evals/draft-scope-thin/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/draft-scope-thin/inputs/E1.txt +5 -0
- package/plugins/business-analyst/evals/draft-scope-thin/prompt.md +8 -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/business-analyst/skills/draft-scope/SKILL.md +46 -0
- package/plugins/business-analyst/skills/draft-scope/references/credits.md +12 -0
- package/plugins/business-analyst/skills/draft-scope/references/draft-schema.md +44 -0
- package/plugins/business-analyst/skills/draft-scope/references/rules.md +24 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_body.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_flow.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_package.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_xml.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_quotes.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_rules.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_schema.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/build_docx.py +36 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/check.py +53 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/docx_body.py +58 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/docx_flow.py +52 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/docx_package.py +62 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/docx_xml.py +44 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/draft_quotes.py +49 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/draft_rules.py +106 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/draft_schema.py +87 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/build-docx.test.mjs +76 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/check-rules.test.mjs +131 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/check-shape.test.mjs +70 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/fixtures/draft-pass.json +40 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/fixtures/sources/C1.txt +7 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/fixtures/sources/E1.txt +5 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/gates.test.mjs +39 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/helpers.mjs +30 -0
- package/plugins/business-analyst/skills/draft-scope/scripts/test/skill-files.test.mjs +59 -0
- package/plugins/business-analyst/skills/draft-scope/steps/assumptions.md +24 -0
- package/plugins/business-analyst/skills/draft-scope/steps/check.md +24 -0
- package/plugins/business-analyst/skills/draft-scope/steps/discover.md +53 -0
- package/plugins/business-analyst/skills/draft-scope/steps/draft.md +64 -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/SKILL.md +8 -7
- package/plugins/solution-architect/skills/analyze-requirements/assets/section-help.json +5 -5
- package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +26 -4
- package/plugins/solution-architect/skills/analyze-requirements/evals/evals.json +50 -6
- package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/ba-package-citations/requirements.json +31 -0
- package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/ba-package-citations/requirements.md +17 -0
- package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/transcript-citations/C1-kickoff-call.txt +16 -0
- package/plugins/solution-architect/skills/analyze-requirements/evals/fixtures/transcript-citations/E1-intro-email.md +9 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/extract.md +108 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/interview.md +39 -5
- package/plugins/solution-architect/skills/analyze-requirements/references/project-types.md +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/references/quality-goals.md +84 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/research.md +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/references/rewriting.md +7 -2
- package/plugins/solution-architect/skills/analyze-requirements/references/viewer.md +10 -6
- package/plugins/solution-architect/skills/analyze-requirements/references/writing.md +45 -3
- package/plugins/solution-architect/skills/analyze-requirements/scripts/ba-facts.mjs +32 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/check-quotes.mjs +39 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/ba-package.mjs +75 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-links.mjs +19 -7
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-routes.mjs +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/inputs.mjs +42 -11
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-render.mjs +15 -4
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/section-help.mjs +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/strategy-sections.mjs +30 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-provenance.mjs +14 -2
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-quotes.mjs +55 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-strategy.mjs +65 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/render.mjs +18 -5
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-facts-cli.test.mjs +55 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-package-cli.test.mjs +101 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-package.test.mjs +115 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +77 -2
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/check-quotes-cli.test.mjs +49 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-links.test.mjs +49 -4
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/extract-workflow.test.mjs +69 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/inputs.test.mjs +14 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-render.test.mjs +19 -5
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/record-cli.test.mjs +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/render.test.mjs +69 -2
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/rewriting.test.mjs +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/section-help.test.mjs +6 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-provenance.test.mjs +19 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-quotes-cli.test.mjs +58 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-quotes.test.mjs +81 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-strategy-cli.test.mjs +32 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-strategy.test.mjs +118 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/validate.mjs +17 -6
- package/plugins/solution-architect/skills/analyze-requirements/workflows/extract.js +51 -0
- package/plugins/solution-architect/skills/estimate/README.md +18 -3
- package/plugins/solution-architect/skills/estimate/SKILL.md +18 -75
- package/plugins/solution-architect/skills/estimate/classic/FLOW.md +77 -0
- package/plugins/solution-architect/skills/estimate/classic/assets/estimate-template.html +1337 -0
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/task-shapes.md +1 -1
- package/plugins/solution-architect/skills/estimate/{references → classic/references}/writing.md +2 -2
- 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 +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/roadmap.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/rollup.mjs +5 -5
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/schema.mjs +4 -26
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-csv.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/lib/score-html.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/render.mjs +8 -7
- 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/{scripts → classic/scripts}/test/browser-agentic.test.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/browser.test.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/compute.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/e2e.test.mjs +6 -6
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/estimate-math.test.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/measurements.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/pricing.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/project-price.test.mjs +1 -1
- 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 +6 -6
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/render.test.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/schema.test.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/score-review.test.mjs +6 -6
- 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 +1 -1
- package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/xlsx-export.test.mjs +3 -3
- package/plugins/solution-architect/skills/estimate/classic/scripts/test/zip-store.test.mjs +26 -0
- package/plugins/solution-architect/skills/estimate/evals/evals.json +37 -2
- 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/{scripts → shared}/lib/context-schema.mjs +2 -2
- package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/inline.mjs +8 -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 +1 -1
- 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/proposal/README.md +13 -0
- package/plugins/solution-architect/skills/proposal/SKILL.md +8 -0
- package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +143 -0
- 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/review.md +11 -0
- package/plugins/solution-architect/skills/proposal/references/workflow.md +88 -0
- 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/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/docx.test.mjs +68 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +2 -2
- package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +9 -2
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +17 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +2 -2
- package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +2 -2
- 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/assets/estimate-template.html +0 -1677
- /package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/estimate-template-agentic.html +0 -0
- /package/plugins/solution-architect/skills/estimate/{assets → classic/assets}/scores-review-template.html +0 -0
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/agentic-estimation.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/ai-multipliers.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/interview.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/scoring-guide.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/slicing.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{references → classic/references}/techniques.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/redact.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/agentic-estimation-fail.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-estimation-pass.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/agentic-inputs.json +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/booking-inputs.json +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-fail.md +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → classic/scripts}/test/fixtures/estimation-pass.md +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/estimate-math.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/pricing.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/project-price.mjs +0 -0
- /package/plugins/solution-architect/skills/estimate/{scripts → shared}/lib/score-diff.mjs +0 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { existsSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { pageData, undecided, idLeaks } from '../lib/review-data.mjs';
|
|
9
|
+
import { fillPage, pageHtml } from '../lib/review-page.mjs';
|
|
10
|
+
import { loadWorkflow, noFlows } from './scope-cases.mjs';
|
|
11
|
+
import { DATE, decided, drafted } from './review-fixture.mjs';
|
|
12
|
+
import { checkPackage } from '../lib/checks.mjs';
|
|
13
|
+
|
|
14
|
+
const script = fileURLToPath(new URL('../review.mjs', import.meta.url));
|
|
15
|
+
const IDS = /\b(?:G|ACT|SYS|WF|FEAT|FR|BR|SC|Q|ASM|NFR|INT|DAT|CON)-\d{3}\b/;
|
|
16
|
+
|
|
17
|
+
function runPage(pkg, extra = []) {
|
|
18
|
+
const dir = mkdtempSync(join(tmpdir(), 'ba-review-'));
|
|
19
|
+
writeFileSync(join(dir, 'r.json'), JSON.stringify(pkg));
|
|
20
|
+
const out = join(dir, 'review.html');
|
|
21
|
+
const args = [script, 'page', '--json', join(dir, 'r.json'), '--out', out, '--date', DATE, ...extra];
|
|
22
|
+
const r = spawnSync('node', args, { encoding: 'utf8' });
|
|
23
|
+
return { code: r.status, stdout: r.stdout, stderr: r.stderr, html: existsSync(out) ? readFileSync(out, 'utf8') : null };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
test('features keep their table order; interview additions carry their source', () => {
|
|
27
|
+
const [one, two] = pageData(decided(), DATE).systems;
|
|
28
|
+
assert.deepEqual(one.features.map((f) => [f.name, f.added]), [['Order pipeline & stage engine', null], ['Short-pack alert', null]]);
|
|
29
|
+
assert.deepEqual(two.features.map((f) => [f.name, f.added]), [
|
|
30
|
+
['Order intake & quotation', null], ['Invoice from packed quantities', 'PO in interview, 2026-10-07'], ['One login, role-based screens', null]]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('workflows: steps, side branches, loops back and the sub-flow note', () => {
|
|
34
|
+
const [one, two] = pageData(decided(), DATE).systems;
|
|
35
|
+
assert.deepEqual(one.flows, [{
|
|
36
|
+
name: 'Order pipeline', steps: ['Order In', 'Pack', 'Pack Review', 'Shipped'], sub: null, branches: [
|
|
37
|
+
{ from: 'Pack', to: 'Short-pack alert', label: "can't fulfil", back: false },
|
|
38
|
+
{ from: 'Pack Review', to: 'Pack', label: 'mismatch', back: true }],
|
|
39
|
+
}]);
|
|
40
|
+
assert.deepEqual(two.flows.map((w) => [w.name, w.sub]), [['Order to cash', null],
|
|
41
|
+
['Custom order', { startsAt: 'Order received', rejoins: 'Order pipeline', share: 'about 20% of orders' }]]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('assumptions: resolved ones are not shown; interview ones carry their source', () => {
|
|
45
|
+
const pkg = decided();
|
|
46
|
+
pkg.assumptions.push({ id: 'ASM-003', text: 'Old belief.', impact: 'low', status: 'resolved' });
|
|
47
|
+
assert.deepEqual(pageData(pkg, DATE).assumptions, [
|
|
48
|
+
{ text: 'Packers carry a phone with a camera on the warehouse floor.', added: null },
|
|
49
|
+
{ text: 'Offline scan gaps last under 1 hour; longer outages are a change request.', added: 'PO in interview, 2026-10-07' }]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('undecided scope is listed, systems then workflows then features (R2)', () => {
|
|
53
|
+
assert.deepEqual(undecided(decided()), []);
|
|
54
|
+
const pkg = drafted();
|
|
55
|
+
pkg.systems[1].label = 'assumed';
|
|
56
|
+
assert.deepEqual(undecided(pkg), [
|
|
57
|
+
'SYS-002: not decided; ask the PO in the interview',
|
|
58
|
+
'WF-003: not decided; ask the PO in the interview',
|
|
59
|
+
'FEAT-004: not decided; ask the PO in the interview',
|
|
60
|
+
]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('the page is static html in the shape of the document', () => {
|
|
64
|
+
const html = pageHtml(decided(), DATE);
|
|
65
|
+
assert.doesNotMatch(html, /<script|<button|<input|<textarea|@TITLE@|@BODY@/);
|
|
66
|
+
assert.doesNotMatch(html, IDS);
|
|
67
|
+
assert.doesNotMatch(html, /flowcap|<nav/);
|
|
68
|
+
assert.match(html, /<title>Sin Kowa Mini<\/title>/);
|
|
69
|
+
for (const part of [
|
|
70
|
+
'<p class="summary">2 systems · 5 features · 2 assumptions · <span class="tag">★ New</span> 2 added in interview</p>',
|
|
71
|
+
'<h2><span class="sysno">System 2:</span> Orders & invoicing</h2>',
|
|
72
|
+
'<p class="flow-name">Main workflow · Order pipeline</p>\n<div class="flow">',
|
|
73
|
+
'<tr class="new"><td><span class="tag">★ New</span> Invoice from packed quantities<span class="src">Added: PO in interview, 2026-10-07</span></td><td>Raises the invoice from what was packed and shipped</td></tr>',
|
|
74
|
+
'<p class="flow-name">Sub-workflow · Custom order — starts at Order received, rejoins Order pipeline · about 20% of orders</p>',
|
|
75
|
+
'<li class="new"><span class="tag">★ New</span> Offline scan gaps last under 1 hour; longer outages are a change request.<span class="src">Added: PO in interview, 2026-10-07</span></li>',
|
|
76
|
+
]) assert.ok(html.includes(part), part);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('no assumptions and no additions: no section, no ★ anywhere', () => {
|
|
80
|
+
const pkg = decided();
|
|
81
|
+
pkg.assumptions = [];
|
|
82
|
+
pkg.features[3].source = 'PO brief, System 2';
|
|
83
|
+
const html = pageHtml(pkg, DATE);
|
|
84
|
+
assert.doesNotMatch(html, /<h2>Assumptions<\/h2>|★/);
|
|
85
|
+
assert.ok(html.includes('<p class="summary">2 systems · 5 features · 0 assumptions</p>'));
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test('markup in text is escaped, never drawn', () => {
|
|
89
|
+
const pkg = decided();
|
|
90
|
+
pkg.features[0].name = 'Order <b>pipeline</b> & "stage"';
|
|
91
|
+
assert.ok(pageHtml(pkg, DATE).includes('<td>Order <b>pipeline</b> & "stage"</td>'));
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('the template slots: title escaped, body as is, a missing slot refused', () => {
|
|
95
|
+
const t = '<title><!--@TITLE@--></title><main><!--@BODY@--></main>';
|
|
96
|
+
assert.equal(fillPage(t, 'A & B', '<p>x</p>'), '<title>A & B</title><main><p>x</p></main>');
|
|
97
|
+
assert.throws(() => fillPage('<title></title>', 't', 'b'), /slot/);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('an id in text the page shows is refused, one line per field (R3)', () => {
|
|
101
|
+
const pkg = decided();
|
|
102
|
+
assert.deepEqual(idLeaks(pkg), []);
|
|
103
|
+
pkg.features[0].does = 'Moves an order (see BR-001)';
|
|
104
|
+
pkg.workflows[1].branches[0].label = 'per FR-003';
|
|
105
|
+
pkg.features[3].source = 'PO in interview, after FR-004';
|
|
106
|
+
pkg.assumptions[1].text = 'Scans as in FR-002.';
|
|
107
|
+
assert.deepEqual(idLeaks(pkg), [
|
|
108
|
+
'WF-002: branch label names an id (FR-003); the PO page shows it',
|
|
109
|
+
'FEAT-001: does names an id (BR-001); the PO page shows it',
|
|
110
|
+
'FEAT-004: source names an id (FR-004); the PO page shows it',
|
|
111
|
+
'ASM-002: text names an id (FR-002); the PO page shows it',
|
|
112
|
+
]);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('text the page never shows may name ids', () => {
|
|
116
|
+
const pkg = decided();
|
|
117
|
+
pkg.features[2].source = 'PO brief, FR-003';
|
|
118
|
+
pkg.openQuestions[0].question = 'About WF-003?';
|
|
119
|
+
pkg.workflows[0].steps[0] = 'see FR-001';
|
|
120
|
+
pkg.assumptions.push({ id: 'ASM-003', text: 'Gone, see FR-001.', impact: 'low', status: 'resolved' });
|
|
121
|
+
assert.deepEqual(idLeaks(pkg), []);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test('review page: writes the file and says where', () => {
|
|
125
|
+
const r = runPage(decided());
|
|
126
|
+
assert.equal(r.code, 0);
|
|
127
|
+
assert.match(r.stdout, /^review page written: .*review\.html\n$/);
|
|
128
|
+
assert.equal(r.html, pageHtml(decided(), DATE));
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
test('review page: refuses undecided items, one line each, and writes nothing', () => {
|
|
132
|
+
const r = runPage(drafted());
|
|
133
|
+
assert.equal(r.code, 1);
|
|
134
|
+
assert.equal(r.stderr, 'WF-003: not decided; ask the PO in the interview\nFEAT-004: not decided; ask the PO in the interview\n');
|
|
135
|
+
assert.equal(r.html, null);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('review page: refuses a broken scope and writes nothing', () => {
|
|
139
|
+
const pkg = decided();
|
|
140
|
+
pkg.features[1].steps = ['WF-002:Nowhere'];
|
|
141
|
+
const r = runPage(pkg);
|
|
142
|
+
assert.equal(r.code, 1);
|
|
143
|
+
assert.match(r.stderr, /^FEAT-002: unknown step WF-002:Nowhere$/m);
|
|
144
|
+
assert.equal(r.html, null);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test('review page: refuses an id leak and writes nothing', () => {
|
|
148
|
+
const pkg = decided();
|
|
149
|
+
pkg.features[0].does = 'Moves an order (see BR-001)';
|
|
150
|
+
const r = runPage(pkg);
|
|
151
|
+
assert.equal(r.code, 1);
|
|
152
|
+
assert.equal(r.stderr, 'FEAT-001: does names an id (BR-001); the PO page shows it\n');
|
|
153
|
+
assert.equal(r.html, null);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('review page: classic mode writes nothing and exits 0', () => {
|
|
157
|
+
const pkg = decided();
|
|
158
|
+
for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
|
|
159
|
+
const r = runPage(pkg);
|
|
160
|
+
assert.equal(r.code, 0);
|
|
161
|
+
assert.equal(r.stdout, 'classic mode: no review page\n');
|
|
162
|
+
assert.equal(r.html, null);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('review: page is the only command; a flag needs a value', () => {
|
|
166
|
+
const dir = mkdtempSync(join(tmpdir(), 'ba-review-'));
|
|
167
|
+
writeFileSync(join(dir, 'r.json'), JSON.stringify(decided()));
|
|
168
|
+
const apply = spawnSync('node', [script, 'apply', '--json', join(dir, 'r.json')], { encoding: 'utf8' });
|
|
169
|
+
assert.equal(apply.status, 1);
|
|
170
|
+
assert.equal(apply.stderr, 'usage: review.mjs page --json <requirements.json> --out <review.html> [--date YYYY-MM-DD]\n');
|
|
171
|
+
const bare = spawnSync('node', [script, 'page', '--json', join(dir, 'r.json'), '--out'], { encoding: 'utf8' });
|
|
172
|
+
assert.equal(bare.status, 1);
|
|
173
|
+
assert.equal(bare.stderr, '--out: needs a value\n');
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test('a system with no workflow draws its feature table only', () => {
|
|
177
|
+
const { pkg } = noFlows();
|
|
178
|
+
assert.deepEqual(pageData(pkg, DATE).systems[1].flows, []);
|
|
179
|
+
assert.doesNotMatch(pageHtml(pkg, DATE).split('System 2:</span>')[1], /class="flow"/);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test('the canonical workflow fixture is R5-clean; drafted() rebuilds a 0.3.x re-run', () => {
|
|
183
|
+
const { pkg, md } = loadWorkflow();
|
|
184
|
+
assert.deepEqual(undecided(pkg), []);
|
|
185
|
+
assert.doesNotMatch(JSON.stringify(pkg) + md, /drafted|right shape/i);
|
|
186
|
+
const old = drafted();
|
|
187
|
+
assert.deepEqual(undecided(old), [
|
|
188
|
+
'WF-003: not decided; ask the PO in the interview',
|
|
189
|
+
'FEAT-004: not decided; ask the PO in the interview',
|
|
190
|
+
]);
|
|
191
|
+
assert.deepEqual(checkPackage({ pkg: old, md: null }), []);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const doc = (p) => readFileSync(new URL(`../../${p}`, import.meta.url), 'utf8');
|
|
195
|
+
const DOCS = ['SKILL.md', 'README.md', 'references/interview.md', 'references/writing.md', 'references/review.md'];
|
|
196
|
+
const flat = (p) => doc(p).replace(/\s+/g, ' ');
|
|
197
|
+
|
|
198
|
+
test('docs: the review page is read-only; nothing is pasted back', () => {
|
|
199
|
+
for (const p of DOCS) {
|
|
200
|
+
assert.doesNotMatch(doc(p), /Copy decisions|review\.mjs apply|--confirm|leftOut|review decisions|No, keep them|\(Recommended\)/, p);
|
|
201
|
+
}
|
|
202
|
+
assert.match(doc('SKILL.md'), /\*\*review page\*\*/);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
test('docs: interview options cite an input quote, assume with a boundary, never recommend', () => {
|
|
206
|
+
const t = doc('references/interview.md');
|
|
207
|
+
assert.match(t, /starts with "Assume"/);
|
|
208
|
+
assert.doesNotMatch(t, /no hint in the input|input hint/);
|
|
209
|
+
const f = flat('references/interview.md');
|
|
210
|
+
assert.match(f, /cites its input quote: the file, the place and the exact words, copied, not paraphrased/);
|
|
211
|
+
assert.match(f, /An option with no input quote cites nothing/);
|
|
212
|
+
assert.match(f, /a scale and a limit/);
|
|
213
|
+
assert.match(f, /else the smallest scope still safe to price/);
|
|
214
|
+
assert.match(t, /Every question you ask closes/);
|
|
215
|
+
assert.match(t, /must pick an assumption or leave it out/);
|
|
216
|
+
assert.doesNotMatch(t, /include "Don't know"|"Don't know" (?:becomes|takes|leaves)/);
|
|
217
|
+
assert.match(t, /Never draft systems, workflows or features/);
|
|
218
|
+
assert.match(t, /PO in interview, <date>/);
|
|
219
|
+
assert.match(t, /status `accepted`/);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
test('docs: the scope-mode question marks no pick and states the evidence', () => {
|
|
223
|
+
const t = doc('references/interview.md');
|
|
224
|
+
assert.match(t, /"Workflow: systems, their steps and features"/);
|
|
225
|
+
assert.match(t, /"Classic: one flat list of requirements"/);
|
|
226
|
+
assert.doesNotMatch(t + doc('SKILL.md'), /recommended option first|Recommend a mode|Recommend `workflow`|recommend `classic`|recommend one from the input/);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test('docs: an undecided workflow is asked with the input steps, No workflow, or Other only', () => {
|
|
230
|
+
const t = flat('references/interview.md');
|
|
231
|
+
assert.match(t, /the steps exactly as the input lists them/);
|
|
232
|
+
assert.match(t, /"No workflow for <system>: its features stay, on no step"/);
|
|
233
|
+
assert.match(t, /lists the steps through "Other"/);
|
|
234
|
+
assert.match(t, /Never offer a step order the input does not give/);
|
|
235
|
+
assert.match(t, /Leaving a workflow out never removes a feature/);
|
|
236
|
+
const grader = readFileSync(new URL('../../../../evals/ba-review-page/graders/decide-in-interview.md', import.meta.url), 'utf8');
|
|
237
|
+
assert.match(grader.replace(/\s+/g, ' '), /offers, as an option to pick, a step order the brief never gave/);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
test('docs: a real answer is confirmed (§2b is the one rule); scope waits for the md', () => {
|
|
241
|
+
assert.doesNotMatch(flat('references/interview.md'), /default to `assumed`/);
|
|
242
|
+
for (const p of ['references/interview.md', 'SKILL.md']) {
|
|
243
|
+
assert.match(flat(p), /`scope` once requirements\.md exists; before that,? validate with `--json` only/, p);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
test('docs: frameworks never leave an asked feature open', () => {
|
|
248
|
+
assert.doesNotMatch(flat('references/frameworks.md'), /becomes an open question/);
|
|
249
|
+
assert.match(flat('references/frameworks.md'), /closes like every asked question/);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
test('docs: after the page, one approval question; at the end, the handoff line', () => {
|
|
253
|
+
const t = flat('references/interview.md');
|
|
254
|
+
assert.match(t, /"Does the review page read like your document\?"/);
|
|
255
|
+
assert.match(t, /"Approve: go on to requirements\.md and the readiness report"/);
|
|
256
|
+
assert.match(t, /"Change something: say what in Other"/);
|
|
257
|
+
assert.match(flat('SKILL.md'), /send requirements\.md and requirements\.json to the engineering team for the estimate/);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
test('docs: branch labels are copied; the input assumptions stay word for word', () => {
|
|
261
|
+
const t = flat('references/writing.md');
|
|
262
|
+
assert.match(t, /A branch `label` is the input's own arrow text, copied; an arrow with no text has no `label`/);
|
|
263
|
+
assert.match(t, /Every assumption the input lists is an ASM row, word for word, in the input's order/);
|
|
264
|
+
assert.match(t, /even when it reads like a constraint/);
|
|
265
|
+
assert.match(t, /leaves the page only when the PO picks to drop it/);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
test('docs: an answered input assumption is accepted; dropping one is an option', () => {
|
|
269
|
+
const w = flat('references/writing.md');
|
|
270
|
+
assert.match(w, /Once the PO answers, the input row's status becomes `accepted`; its words stay\./);
|
|
271
|
+
assert.match(w, /A question about an input assumption adds the option "Drop this assumption"; picking it sets that row's status to `resolved`\./);
|
|
272
|
+
assert.match(flat('references/interview.md').split('## §2b')[1].split('## §3')[0], /"Drop this assumption"/);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
test('docs: the review page asks nothing first; a change comes through Other or chat', () => {
|
|
276
|
+
assert.doesNotMatch(flat('SKILL.md'), /Nothing else is asked/);
|
|
277
|
+
assert.match(flat('SKILL.md'), /Nothing is asked before the page; it ends with the approval question \(interview\.md §8\)\./);
|
|
278
|
+
assert.match(flat('references/interview.md'), /A change \(through Other, or in chat\) is a re-run/);
|
|
279
|
+
assert.match(flat('references/review.md'), /Input assumptions \(source names an input file\) are verbatim: flag a problem, never reword them\./);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
test('docs: step 11 ends with the handoff line', () => {
|
|
283
|
+
const step = flat('SKILL.md').split('11. **Finish**')[1].split('## Review page')[0];
|
|
284
|
+
const handoff = step.indexOf('send requirements.md and requirements.json to the engineering team');
|
|
285
|
+
assert.ok(step.indexOf('review page') >= 0 && handoff > step.indexOf('review page'));
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
const pipeline = (pkg) => pkg.workflows.find((w) => w.name === 'Order pipeline');
|
|
289
|
+
|
|
290
|
+
test('the diagram: main row, then each branch under its parent', () => {
|
|
291
|
+
const pkg = decided();
|
|
292
|
+
pipeline(pkg).branches.push({ from: 'Short-pack alert', to: 'Cancel or substitute' });
|
|
293
|
+
const html = pageHtml(pkg, DATE);
|
|
294
|
+
for (const part of [
|
|
295
|
+
'<div class="grid">',
|
|
296
|
+
'<div class="step" style="grid-area:1/1">Order In</div>',
|
|
297
|
+
'<div class="arrow" style="grid-area:1/2">→</div>',
|
|
298
|
+
'<div class="step" style="grid-area:1/3">Pack</div>',
|
|
299
|
+
'<div class="down" style="grid-area:2/3"><span class="lbl">can\'t fulfil</span></div>',
|
|
300
|
+
'<div class="step alt" style="grid-area:3/3">Short-pack alert</div>',
|
|
301
|
+
'<div class="down" style="grid-area:2/5"><span class="lbl">mismatch</span></div>',
|
|
302
|
+
'<div class="step back" style="grid-area:3/5">↺ back to Pack</div>',
|
|
303
|
+
'<div class="down" style="grid-area:4/3"></div>',
|
|
304
|
+
'<div class="step alt" style="grid-area:5/3">Cancel or substitute</div>',
|
|
305
|
+
]) assert.ok(html.includes(part), part);
|
|
306
|
+
assert.doesNotMatch(html, /↳|row side|class="row"/);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
test('two branches from one step sit side by side; the step spans them', () => {
|
|
310
|
+
const pkg = decided();
|
|
311
|
+
pipeline(pkg).branches.push({ from: 'Pack', to: 'Extra box', label: 'needs a box' });
|
|
312
|
+
const html = pageHtml(pkg, DATE);
|
|
313
|
+
for (const part of [
|
|
314
|
+
'<div class="step wide" style="grid-area:1/3/auto/span 2">Pack</div>',
|
|
315
|
+
'<div class="arrow" style="grid-area:1/5">→</div>',
|
|
316
|
+
'<div class="step" style="grid-area:1/6">Pack Review</div>',
|
|
317
|
+
'<div class="step alt" style="grid-area:3/3">Short-pack alert</div>',
|
|
318
|
+
'<div class="down" style="grid-area:2/4"><span class="lbl">needs a box</span></div>',
|
|
319
|
+
'<div class="step alt" style="grid-area:3/4">Extra box</div>',
|
|
320
|
+
'<div class="step back" style="grid-area:3/6">↺ back to Pack</div>',
|
|
321
|
+
]) assert.ok(html.includes(part), part);
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
test('a child listed before its parent is drawn one level below it', () => {
|
|
325
|
+
const pkg = decided();
|
|
326
|
+
pipeline(pkg).branches.unshift({ from: 'Short-pack alert', to: 'Cancel or substitute' });
|
|
327
|
+
const html = pageHtml(pkg, DATE);
|
|
328
|
+
assert.ok(html.includes('<div class="step alt" style="grid-area:3/3">Short-pack alert</div>'));
|
|
329
|
+
assert.ok(html.includes('<div class="step alt" style="grid-area:5/3">Cancel or substitute</div>'));
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
test('a cycle between two branch boxes draws each once, under the first step', () => {
|
|
333
|
+
const pkg = decided();
|
|
334
|
+
pipeline(pkg).branches.push({ from: 'Loop B', to: 'Loop A' }, { from: 'Loop A', to: 'Loop B' });
|
|
335
|
+
const html = pageHtml(pkg, DATE);
|
|
336
|
+
assert.ok(html.includes('<div class="step alt" style="grid-area:3/1">Loop A</div>'));
|
|
337
|
+
assert.ok(html.includes('<div class="step alt" style="grid-area:5/1">Loop B</div>'));
|
|
338
|
+
assert.equal(html.split('>Loop A<').length, 2);
|
|
339
|
+
assert.equal(html.split('>Loop B<').length, 2);
|
|
340
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Python twin of review.mjs: same bytes, same refusals, same exit codes.
|
|
2
|
+
import { test } from 'node:test';
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { existsSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
|
|
6
|
+
import { tmpdir } from 'node:os';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { noFlows } from './scope-cases.mjs';
|
|
10
|
+
import { DATE, decided, drafted } from './review-fixture.mjs';
|
|
11
|
+
|
|
12
|
+
const SCRIPT = {
|
|
13
|
+
node: fileURLToPath(new URL('../review.mjs', import.meta.url)),
|
|
14
|
+
python3: fileURLToPath(new URL('../review.py', import.meta.url)),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Runs one review command in a fresh dir; `rest` builds the flags after the script.
|
|
18
|
+
function runIn(cmd, pkg, rest) {
|
|
19
|
+
const dir = mkdtempSync(join(tmpdir(), 'ba-review-parity-'));
|
|
20
|
+
const json = join(dir, 'r.json');
|
|
21
|
+
const out = join(dir, 'p.html');
|
|
22
|
+
writeFileSync(json, JSON.stringify(pkg));
|
|
23
|
+
const r = spawnSync(cmd, [SCRIPT[cmd], ...rest(json, out)], { encoding: 'utf8' });
|
|
24
|
+
return { code: r.status, out: r.stdout.replace(out, 'OUT'), err: r.stderr, html: existsSync(out) ? readFileSync(out, 'utf8') : null };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const page = (json, out) => ['page', '--json', json, '--out', out, '--date', DATE];
|
|
28
|
+
const both = (pkg, rest = page) => ['node', 'python3'].map((cmd) => runIn(cmd, pkg, rest));
|
|
29
|
+
|
|
30
|
+
const unicode = () => {
|
|
31
|
+
const pkg = decided();
|
|
32
|
+
pkg.features[0].name = 'Café order — <stage> & "pack"';
|
|
33
|
+
return pkg;
|
|
34
|
+
};
|
|
35
|
+
const classic = () => {
|
|
36
|
+
const pkg = decided();
|
|
37
|
+
for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
|
|
38
|
+
return pkg;
|
|
39
|
+
};
|
|
40
|
+
const leak = () => {
|
|
41
|
+
const pkg = decided();
|
|
42
|
+
pkg.features[3].source = 'PO in interview, see FR-004';
|
|
43
|
+
return pkg;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const pipeline = (pkg) => pkg.workflows.find((w) => w.name === 'Order pipeline');
|
|
47
|
+
const branchy = () => {
|
|
48
|
+
const pkg = decided();
|
|
49
|
+
pipeline(pkg).branches.unshift({ from: 'Extra box', to: 'Courier' });
|
|
50
|
+
pipeline(pkg).branches.push({ from: 'Pack', to: 'Extra box', label: 'needs a box' },
|
|
51
|
+
{ from: 'Loop B', to: 'Loop A' }, { from: 'Loop A', to: 'Loop B' });
|
|
52
|
+
return pkg;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const PAGE_CASES = [
|
|
56
|
+
['siblings, a child before its parent, a cycle', branchy, 0],
|
|
57
|
+
['a decided package', decided, 0],
|
|
58
|
+
['markup and non-ascii text', unicode, 0],
|
|
59
|
+
['undecided drafts', drafted, 1],
|
|
60
|
+
['an id in a ★ New source', leak, 1],
|
|
61
|
+
['a system with no workflow', () => noFlows().pkg, 0],
|
|
62
|
+
['classic mode', classic, 0],
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
for (const [name, make, code] of PAGE_CASES) {
|
|
66
|
+
test(`review.py page matches review.mjs: ${name}`, () => {
|
|
67
|
+
const [n, p] = both(make());
|
|
68
|
+
assert.deepEqual(p, n);
|
|
69
|
+
assert.equal(n.code, code);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
test('review.py refuses apply and a bare flag like review.mjs', () => {
|
|
74
|
+
for (const rest of [(json) => ['apply', '--json', json], (json) => ['page', '--json', json, '--out']]) {
|
|
75
|
+
const [n, p] = both(decided(), rest);
|
|
76
|
+
assert.deepEqual(p, n);
|
|
77
|
+
assert.equal(n.code, 1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// One broken variant of the workflow pass fixture per scope rule (spec §5).
|
|
2
|
+
// Shared by scope-checks.test.mjs and python-parity.test.mjs.
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const fx = (f) => readFileSync(new URL(`./fixtures/${f}`, import.meta.url), 'utf8');
|
|
6
|
+
export const loadWorkflow = () => ({
|
|
7
|
+
pkg: JSON.parse(fx('requirements-workflow-pass.json')),
|
|
8
|
+
md: fx('requirements-workflow-pass.md'),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const toClassic = (pkg) => {
|
|
12
|
+
for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
|
|
13
|
+
};
|
|
14
|
+
const pkgCase = (name, finding, edit) => ({ name, finding, edit: (c) => { edit(c.pkg); return c; } });
|
|
15
|
+
const mdCase = (name, finding, edit) => ({ name, finding, edit: (c) => ({ ...c, md: edit(c.md) }) });
|
|
16
|
+
|
|
17
|
+
export const CASES = [
|
|
18
|
+
pkgCase('illegal scopeMode', 'scopeMode must be workflow|classic', (p) => { p.scopeMode = 'list'; }),
|
|
19
|
+
pkgCase('workflow without systems', 'scopeMode workflow needs systems and features', (p) => { delete p.systems; }),
|
|
20
|
+
pkgCase('classic with systems', 'systems/features only in workflow mode', (p) => { p.scopeMode = 'classic'; }),
|
|
21
|
+
pkgCase('bad feature id', 'features: bad id F-1', (p) => { p.features[0].id = 'F-1'; }),
|
|
22
|
+
pkgCase('system lists an as-is workflow', 'SYS-001: workflow WF-001 is not a to-be workflow', (p) => { p.systems[0].workflows.push('WF-001'); }),
|
|
23
|
+
pkgCase('workflow in two systems', 'WF-002: belongs to SYS-001 and SYS-002', (p) => { p.systems[1].workflows.push('WF-002'); }),
|
|
24
|
+
pkgCase('feature in no system', 'FEAT-002: listed by no system', (p) => { p.systems[0].features.pop(); }),
|
|
25
|
+
pkgCase('unknown feature step', 'FEAT-002: unknown step WF-002:Short-pack', (p) => { p.features[1].steps = ['WF-002:Short-pack']; }),
|
|
26
|
+
pkgCase('branch from unknown step', 'WF-002: branch from unknown step Packing', (p) => { p.workflows[1].branches[0].from = 'Packing'; }),
|
|
27
|
+
pkgCase('sub starts nowhere', 'WF-004: sub.startsAt unknown', (p) => { p.workflows[3].sub.startsAt = 'WF-003:Intake'; }),
|
|
28
|
+
pkgCase('sub rejoins as-is', 'WF-004: sub.rejoins is not a to-be workflow', (p) => { p.workflows[3].sub.rejoins = 'WF-001'; }),
|
|
29
|
+
pkgCase('replaces unknown', 'WF-002: replaces unknown as-is workflow WF-009', (p) => { p.workflows[1].replaces = ['WF-009']; }),
|
|
30
|
+
pkgCase('in-scope FR in no feature', 'FR-003: in scope but in no feature', (p) => { p.features[2].requirements = []; }),
|
|
31
|
+
pkgCase('feature cites missing FR', 'FEAT-003: dangling reference FR-099', (p) => { p.features[2].requirements = ['FR-003', 'FR-099']; }),
|
|
32
|
+
pkgCase('duplicate feature name', 'duplicate feature name: Order intake & quotation', (p) => { p.features[1].name = 'order intake & quotation'; }),
|
|
33
|
+
pkgCase('tech word in name', 'FEAT-001: name uses a tech word (API)', (p) => { p.features[0].name = 'Order APIs'; }),
|
|
34
|
+
pkgCase('system without source', 'SYS-001: missing source', (p) => { delete p.systems[0].source; }),
|
|
35
|
+
pkgCase('illegal feature label', 'FEAT-001: illegal label "maybe"', (p) => { p.features[0].label = 'maybe'; }),
|
|
36
|
+
pkgCase('recommended without question', 'FEAT-004: recommended without a paired open question', (p) => { p.features[3].label = 'recommended'; p.openQuestions[0].affects = ['INT-001']; }),
|
|
37
|
+
mdCase('frontmatter mode missing', 'md: scopeMode does not match json', (md) => md.replace('scopeMode: workflow\n', '')),
|
|
38
|
+
mdCase('hand-edited scope', 'md: To-be scope is stale — run scope', (md) => md.replace('n3["Paid"]', 'n3["Settled"]')),
|
|
39
|
+
{ name: 'classic with scope section', finding: 'md: To-be scope only in workflow mode', edit: (c) => { toClassic(c.pkg); return c; } },
|
|
40
|
+
mdCase('wrong Feature cell', 'md: FR-002 Feature column says Pack alert, json says Short-pack alert', (md) => md.replace('| in | Short-pack alert |', '| in | Pack alert |')),
|
|
41
|
+
pkgCase('feature without does', 'FEAT-001: missing does', (p) => { delete p.features[0].does; }),
|
|
42
|
+
pkgCase('feature without name', 'FEAT-002: missing name', (p) => { delete p.features[1].name; }),
|
|
43
|
+
pkgCase('system without purpose', 'SYS-001: missing purpose', (p) => { delete p.systems[0].purpose; }),
|
|
44
|
+
mdCase('unbalanced scope markers', 'md: scope markers unbalanced', (md) => md.replace('<!-- scope:end -->', '')),
|
|
45
|
+
mdCase('no Feature column', 'md: FR table has no Feature column', (md) => md.replace('| Label | Scope | Feature |', '| Label | Scope |')),
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
// SYS-002 as an input that lists features but draws no workflow: the
|
|
49
|
+
// system owns none and its features sit on no step.
|
|
50
|
+
export function noFlows() {
|
|
51
|
+
const { pkg, md } = loadWorkflow();
|
|
52
|
+
const gone = new Set(['WF-003', 'WF-004']);
|
|
53
|
+
pkg.workflows = pkg.workflows.filter((w) => !gone.has(w.id));
|
|
54
|
+
pkg.systems[1].workflows = [];
|
|
55
|
+
for (const f of pkg.features.slice(2, 4)) f.steps = [];
|
|
56
|
+
for (const fr of pkg.requirements) if (gone.has(fr.traces?.workflow)) delete fr.traces.workflow;
|
|
57
|
+
return { pkg, md };
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { checkPackage } from '../lib/checks.mjs';
|
|
4
|
+
import { CASES, loadWorkflow, noFlows } from './scope-cases.mjs';
|
|
5
|
+
|
|
6
|
+
test('the workflow pass pair has no findings', () => {
|
|
7
|
+
const { pkg, md } = loadWorkflow();
|
|
8
|
+
assert.deepEqual(checkPackage({ pkg, md }), []);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('a classic package without scope fields is untouched', () => {
|
|
12
|
+
const { pkg, md } = loadWorkflow();
|
|
13
|
+
for (const k of ['systems', 'features', 'scopeMode', 'mapLabel']) delete pkg[k];
|
|
14
|
+
const plain = md.replace(/<!-- scope:start -->[\s\S]*?<!-- scope:end -->\n*/, '').replace('scopeMode: workflow\n', '');
|
|
15
|
+
const findings = checkPackage({ pkg, md: plain });
|
|
16
|
+
assert.ok(findings.some((f) => f.includes('WF-002') && f.includes('absent')), 'classic still requires to-be workflow ids in md');
|
|
17
|
+
assert.ok(!findings.some((f) => f.includes('scope')));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
for (const c of CASES) {
|
|
21
|
+
test(`scope rule: ${c.name}`, () => {
|
|
22
|
+
const { pkg, md } = c.edit(loadWorkflow());
|
|
23
|
+
const findings = checkPackage({ pkg, md });
|
|
24
|
+
assert.ok(findings.includes(c.finding), `expected "${c.finding}" in:\n${findings.join('\n')}`);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test('a system with no workflow and features on no step are valid', () => {
|
|
29
|
+
const { pkg } = noFlows();
|
|
30
|
+
assert.deepEqual(checkPackage({ pkg, md: null }), []);
|
|
31
|
+
});
|
|
@@ -0,0 +1,140 @@
|
|
|
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 } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { applyScope } from '../lib/scope-md.mjs';
|
|
9
|
+
import { mermaid } from '../lib/scope-render.mjs';
|
|
10
|
+
import { checkPackage } from '../lib/checks.mjs';
|
|
11
|
+
import { loadWorkflow, noFlows } from './scope-cases.mjs';
|
|
12
|
+
|
|
13
|
+
const script = fileURLToPath(new URL('../scope.mjs', import.meta.url));
|
|
14
|
+
const BLOCK = /<!-- scope:start -->[\s\S]*?<!-- scope:end -->\n*/;
|
|
15
|
+
const strip = (md) => md.replace(BLOCK, '');
|
|
16
|
+
const OLD_HERE = '> **Product owner? Start here:** [To-be scope](#to-be-scope) shows the systems, '
|
|
17
|
+
+ 'workflows and features we propose to build. Items marked ⚠ are our draft; tell us in chat what to change.';
|
|
18
|
+
|
|
19
|
+
test('applyScope rebuilds the fixture from a file without the section', () => {
|
|
20
|
+
const { pkg, md } = loadWorkflow();
|
|
21
|
+
assert.equal(applyScope(strip(md), pkg), md);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('applyScope is idempotent', () => {
|
|
25
|
+
const { pkg, md } = loadWorkflow();
|
|
26
|
+
assert.equal(applyScope(md, pkg), md);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('classic mode removes the section', () => {
|
|
30
|
+
const { pkg, md } = loadWorkflow();
|
|
31
|
+
pkg.scopeMode = 'classic';
|
|
32
|
+
const out = applyScope(md, pkg);
|
|
33
|
+
assert.equal(out, strip(md));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('an old Start-here line is removed on re-run', () => {
|
|
37
|
+
const { pkg, md } = loadWorkflow();
|
|
38
|
+
const old = md.replace(/^(# .*)$/m, `$1\n\n${OLD_HERE}`);
|
|
39
|
+
assert.equal(applyScope(old, pkg), md);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('the section carries ids for engineers', () => {
|
|
43
|
+
const section = loadWorkflow().md.match(BLOCK)[0];
|
|
44
|
+
assert.match(section, /^### SYS-002 Orders & invoicing$/m);
|
|
45
|
+
assert.match(section, /^\*\*Main workflow: WF-003 Order to cash\*\*$/m);
|
|
46
|
+
assert.match(section, /^\| SYS-001 \| Warehouse operations \|/m);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('no draft marks anywhere; features list their requirements', () => {
|
|
50
|
+
const { md } = loadWorkflow();
|
|
51
|
+
assert.doesNotMatch(md, /⚠|please confirm|Start here/);
|
|
52
|
+
assert.match(md, /\| FEAT-004 \| Invoice from packed quantities \| .* \| Shipped \(in Order pipeline\); Invoice → Paid \| FR-004 \|/);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('mermaid: loops back to an existing step and side exits to a new one', () => {
|
|
56
|
+
const out = mermaid({ steps: ['A', 'B'], branches: [{ from: 'B', to: 'A', label: 'retry' }, { from: 'A', to: 'C' }] });
|
|
57
|
+
assert.equal(out, '```mermaid\nflowchart LR\n n0 --> n1\n n1 -.->|retry| n0\n n0 -.-> n2\n n0["A"]\n n1["B"]\n n2["C"]\n```');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('scope.mjs refuses a broken scope and leaves the md alone', () => {
|
|
61
|
+
const dir = mkdtempSync(join(tmpdir(), 'ba-scope-'));
|
|
62
|
+
const { pkg, md } = loadWorkflow();
|
|
63
|
+
pkg.features[1].steps = ['WF-002:Nowhere'];
|
|
64
|
+
writeFileSync(join(dir, 'r.json'), JSON.stringify(pkg));
|
|
65
|
+
writeFileSync(join(dir, 'r.md'), 'untouched');
|
|
66
|
+
assert.throws(() => execFileSync('node', [script, '--json', join(dir, 'r.json'), '--md', join(dir, 'r.md')], { stdio: 'pipe' }));
|
|
67
|
+
assert.equal(readFileSync(join(dir, 'r.md'), 'utf8'), 'untouched');
|
|
68
|
+
assert.ok(md.length > 0);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('a pipe inside feature text is escaped so the table holds', () => {
|
|
72
|
+
const { pkg, md } = loadWorkflow();
|
|
73
|
+
pkg.features[0].does = 'Moves an order | shows each stage';
|
|
74
|
+
const out = applyScope(md, pkg);
|
|
75
|
+
assert.match(out, /\| FEAT-001 \| Order pipeline & stage engine \| Moves an order \\\| shows each stage \|/);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('a step name with a colon resolves and renders', () => {
|
|
79
|
+
const { pkg, md } = loadWorkflow();
|
|
80
|
+
pkg.workflows[1].steps[1] = 'Pack: scan vs order';
|
|
81
|
+
pkg.workflows[1].branches = [{ from: 'Pack: scan vs order', to: 'Short-pack alert' }];
|
|
82
|
+
pkg.features[0].steps[1] = 'WF-002:Pack: scan vs order';
|
|
83
|
+
assert.deepEqual(checkPackage({ pkg, md: applyScope(md, pkg) }), []);
|
|
84
|
+
assert.match(applyScope(md, pkg), /Order In → Pack: scan vs order → Pack Review/);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('markers moved by hand stay where they are on re-run', () => {
|
|
88
|
+
const { pkg, md } = loadWorkflow();
|
|
89
|
+
const section = md.match(BLOCK)[0];
|
|
90
|
+
const moved = md.replace(section, '').replace('## Part 2 — Process & Domain\n\n', `## Part 2 — Process & Domain\n\n${section}`);
|
|
91
|
+
assert.equal(applyScope(moved, pkg), moved);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('a QUICK file (no Part 2) gets the section before Part 3', () => {
|
|
95
|
+
const { pkg, md } = loadWorkflow();
|
|
96
|
+
const quick = strip(md).replace(/## Part 2[\s\S]*?(?=## Part 3)/, '');
|
|
97
|
+
const out = applyScope(quick, pkg);
|
|
98
|
+
assert.ok(out.indexOf('<!-- scope:end -->') < out.indexOf('## Part 3'));
|
|
99
|
+
assert.ok(out.indexOf('## Part 1') < out.indexOf('<!-- scope:start -->'));
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('optional fields absent: no map column, no Replaces line', () => {
|
|
103
|
+
const { pkg, md } = loadWorkflow();
|
|
104
|
+
delete pkg.mapLabel;
|
|
105
|
+
for (const w of pkg.workflows) delete w.replaces;
|
|
106
|
+
const section = applyScope(md, pkg).match(BLOCK)[0];
|
|
107
|
+
assert.match(section, /\| ID \| System \| Purpose \|\n\| --- \| --- \| --- \|\n/);
|
|
108
|
+
assert.doesNotMatch(section, /Replaces today's/);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('scope.mjs refuses unbalanced markers and leaves the md alone', () => {
|
|
112
|
+
const dir = mkdtempSync(join(tmpdir(), 'ba-scope-'));
|
|
113
|
+
const { pkg, md } = loadWorkflow();
|
|
114
|
+
const broken = md.replace('<!-- scope:end -->', '');
|
|
115
|
+
writeFileSync(join(dir, 'r.json'), JSON.stringify(pkg));
|
|
116
|
+
writeFileSync(join(dir, 'r.md'), broken);
|
|
117
|
+
assert.throws(() => execFileSync('node', [script, '--json', join(dir, 'r.json'), '--md', join(dir, 'r.md')], { stdio: 'pipe' }));
|
|
118
|
+
assert.equal(readFileSync(join(dir, 'r.md'), 'utf8'), broken);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('a pipe inside a feature name passes the Feature column check', () => {
|
|
122
|
+
const { pkg, md } = loadWorkflow();
|
|
123
|
+
pkg.features[0].name = 'Pack | ship';
|
|
124
|
+
const out = applyScope(md, pkg).replace('| in | Order pipeline & stage engine |', '| in | Pack \\| ship |');
|
|
125
|
+
assert.deepEqual(checkPackage({ pkg, md: out }), []);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('a system with no workflow shows its feature table only; no step reads —', () => {
|
|
129
|
+
const { pkg, md } = noFlows();
|
|
130
|
+
const out = applyScope(md, pkg);
|
|
131
|
+
assert.ok(out.includes('### SYS-002 Orders & invoicing\n\nQuotation through to a paid invoice.\n\n| ID | Feature |'));
|
|
132
|
+
assert.ok(out.includes('| FEAT-003 | Order intake & quotation | Captures email and phone orders and prices them | — | FR-003 |'));
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test('a system with no workflows key renders like an empty list', () => {
|
|
136
|
+
const { pkg, md } = noFlows();
|
|
137
|
+
const want = applyScope(md, pkg);
|
|
138
|
+
delete pkg.systems[1].workflows;
|
|
139
|
+
assert.equal(applyScope(md, pkg), want);
|
|
140
|
+
});
|