@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
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-package-cli.test.mjs
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
|
|
8
|
+
const CLI = 'plugins/solution-architect/skills/analyze-requirements/scripts/validate.mjs';
|
|
9
|
+
const FRONT = '---\nelectedDocs: [{"name":"threat-model","elected":false,"reason":"r"},{"name":"interface-contract","elected":false,"reason":"r"},{"name":"estimation","elected":false,"reason":"r"},{"name":"domain-overview","elected":false,"reason":"r"}]\n---\n\n';
|
|
10
|
+
const PKG = {
|
|
11
|
+
schemaVersion: '1.0', updated: '2026-10-01',
|
|
12
|
+
requirements: [{ id: 'FR-001', text: 'Members book up to 4 courts per week.', label: 'confirmed', source: 'kickoff call 2026-09-20' }],
|
|
13
|
+
nfrs: [{ id: 'NFR-001', area: 'availability', text: 'The booking page is up 99.95% of the time.', label: 'assumed' }],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function setUp(archRel, body, input = JSON.stringify(PKG)) {
|
|
17
|
+
const dir = mkdtempSync(join(tmpdir(), 'ba-cli-'));
|
|
18
|
+
mkdirSync(join(dir, 'docs'));
|
|
19
|
+
writeFileSync(join(dir, 'requirements.json'), input);
|
|
20
|
+
writeFileSync(join(dir, archRel), FRONT + body);
|
|
21
|
+
writeFileSync(join(dir, 'model.json'), JSON.stringify({ elements: {} }));
|
|
22
|
+
return dir;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const row = (cell) => `## 2 Constraints\n\n| Constraint | src |\n| --- | --- |\n| Courts | ${cell} |\n`;
|
|
26
|
+
const run = (dir, archRel) => spawnSync('node', [CLI, '--root', dir,
|
|
27
|
+
'--arch', join(dir, archRel), '--model', join(dir, 'model.json'),
|
|
28
|
+
'--inputs', join(dir, 'requirements.json')], { encoding: 'utf8' });
|
|
29
|
+
|
|
30
|
+
test('a citation to a confirmed row passes', () => {
|
|
31
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [FR-001 · kickoff call 2026-09-20](requirements.json)'));
|
|
32
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
33
|
+
assert.equal(r.status, 0, r.stdout);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('a citation to an assumed row fails with its label', () => {
|
|
37
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [NFR-001 · 2026-10-01](requirements.json)'));
|
|
38
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
39
|
+
assert.equal(r.status, 1);
|
|
40
|
+
assert.match(r.stdout, /^FAIL \[quotes\] NFR-001 is assumed in requirements.json/m);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('a reworded quote on a json citation fails once', () => {
|
|
44
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [FR-001 · kickoff call 2026-09-20](requirements.json) "up to five courts"'));
|
|
45
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
46
|
+
assert.equal(r.status, 1);
|
|
47
|
+
assert.equal(r.stdout.match(/^FAIL /gm).length, 1, r.stdout);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const Q = '"The page must show "open" 99.95% of the time."';
|
|
51
|
+
const q13 = (quote) => `## 13 Quality Requirements\n\n| Goal | Target | Brief says | src |\n| --- | --- | --- | --- |\n| Uptime | 99.95% | ${quote} | proposed |\n`;
|
|
52
|
+
const nfr = (label) => ({ ...PKG, nfrs: [{ ...PKG.nfrs[0], text: 'The page must show "open" 99.95% of the time.', label, source: 'kickoff call 2026-09-20' }] });
|
|
53
|
+
|
|
54
|
+
test('a Brief says quote from a confirmed row passes, even with a JSON-escaped quote', () => {
|
|
55
|
+
const dir = setUp('ARCHITECTURE.md', q13(Q), JSON.stringify(nfr('confirmed')));
|
|
56
|
+
assert.doesNotMatch(run(dir, 'ARCHITECTURE.md').stdout, /Brief says/);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('a Brief says quote from an assumed row fails', () => {
|
|
60
|
+
const dir = setUp('ARCHITECTURE.md', q13(Q), JSON.stringify(nfr('assumed')));
|
|
61
|
+
assert.match(run(dir, 'ARCHITECTURE.md').stdout, /Brief says .* is in no input file/);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('an inline quote on a confirmed citation cannot borrow a recommended row', () => {
|
|
65
|
+
const pkg = { ...PKG, requirements: [...PKG.requirements, { id: 'FR-003', text: 'Members pay a deposit', label: 'recommended' }] };
|
|
66
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [FR-001 · kickoff call 2026-09-20](requirements.json) "Members pay a deposit"'), JSON.stringify(pkg));
|
|
67
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
68
|
+
assert.equal(r.status, 1);
|
|
69
|
+
assert.match(r.stdout, /^FAIL \[quotes\]/m);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('a citation label that is not the row cite fails', () => {
|
|
73
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [FR-001 · made-up source](requirements.json)'));
|
|
74
|
+
assert.match(run(dir, 'ARCHITECTURE.md').stdout, /does not match requirements.json; cite it as FR-001 · kickoff call 2026-09-20/);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('citation paths resolve from a nested ARCHITECTURE.md', () => {
|
|
78
|
+
const dir = setUp('docs/ARCHITECTURE.md', row('stated [NFR-001 · 2026-10-01](../requirements.json)'));
|
|
79
|
+
const r = run(dir, 'docs/ARCHITECTURE.md');
|
|
80
|
+
assert.match(r.stdout, /NFR-001 is assumed/);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('a json input that is not a package is plain text, not a crash', () => {
|
|
84
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [C9 · 2026-10-01](requirements.json) "port"'), '{"port": 8080');
|
|
85
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
86
|
+
assert.equal(r.status, 0, r.stdout + r.stderr);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('valid json that is not a package is plain text, not a crash', () => {
|
|
90
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [C9 · 2026-10-01](requirements.json) "port"'), '{"port": 8080}');
|
|
91
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
92
|
+
assert.equal(r.status, 0, r.stdout + r.stderr);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('a citation to requirements.md fails when requirements.json is beside it', () => {
|
|
96
|
+
const dir = setUp('ARCHITECTURE.md', row('stated [FR-001 · kickoff call 2026-09-20](requirements.md)'));
|
|
97
|
+
writeFileSync(join(dir, 'requirements.md'), '# Requirements\n');
|
|
98
|
+
const r = run(dir, 'ARCHITECTURE.md');
|
|
99
|
+
assert.equal(r.status, 1);
|
|
100
|
+
assert.match(r.stdout, /^FAIL \[quotes\] requirements.md is the BA package for people; cite requirements.json by row id/m);
|
|
101
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/ba-package.test.mjs
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// scripts/test/ba-package.test.mjs
|
|
2
|
+
import { test } from 'node:test';
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import { isPackage, baRows, isStated, statedText, validateBaCitations } from '../lib/ba-package.mjs';
|
|
5
|
+
|
|
6
|
+
const PKG = {
|
|
7
|
+
schemaVersion: '1.0', updated: '2026-10-01',
|
|
8
|
+
requirements: [
|
|
9
|
+
{ id: 'FR-001', text: 'Members book up to 4 courts per week.', label: 'confirmed', source: 'kickoff call 2026-09-20' },
|
|
10
|
+
{ id: 'FR-002', text: 'Members pay a deposit online.', label: 'recommended' },
|
|
11
|
+
],
|
|
12
|
+
nfrs: [{ id: 'NFR-001', area: 'availability', text: 'The booking page is up 99.95% of the time.', label: 'assumed' }],
|
|
13
|
+
integrations: [{ id: 'INT-001', system: 'Stripe', direction: 'write', label: 'confirmed', source: 'PO brief' }],
|
|
14
|
+
data: [{ id: 'DAT-001', entity: 'Booking', sensitivity: 'personal', volume: 'about 900 per week', label: 'confirmed' }],
|
|
15
|
+
constraints: [{ id: 'CON-001', text: 'Must run in AWS eu-west-1.', source: 'client IT policy' }],
|
|
16
|
+
assumptions: [{ id: 'ASM-001', text: 'Members log in with email.', impact: 'high', status: 'unconfirmed' }],
|
|
17
|
+
};
|
|
18
|
+
const rows = baRows(PKG);
|
|
19
|
+
const byId = (id) => rows.find((r) => r.id === id);
|
|
20
|
+
|
|
21
|
+
test('isPackage needs schemaVersion and a requirements array', () => {
|
|
22
|
+
assert.equal(isPackage(PKG), true);
|
|
23
|
+
assert.equal(isPackage({ name: 'x' }), false);
|
|
24
|
+
assert.equal(isPackage(null), false);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('baRows reads each section with its fact text and section', () => {
|
|
28
|
+
assert.deepEqual(byId('FR-001'), {
|
|
29
|
+
id: 'FR-001', fact: 'Members book up to 4 courts per week.', label: 'confirmed',
|
|
30
|
+
source: 'kickoff call 2026-09-20', section: 'goals and scope', cite: 'FR-001 · kickoff call 2026-09-20',
|
|
31
|
+
});
|
|
32
|
+
assert.equal(byId('NFR-001').section, 'quality');
|
|
33
|
+
assert.equal(byId('INT-001').fact, 'Stripe (write)');
|
|
34
|
+
assert.equal(byId('DAT-001').fact, 'Booking, personal, about 900 per week');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('a row with no source cites the package date', () => {
|
|
38
|
+
assert.equal(byId('DAT-001').cite, 'DAT-001 · 2026-10-01');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('a constraint with a source and no label counts as confirmed', () => {
|
|
42
|
+
assert.equal(byId('CON-001').label, 'confirmed');
|
|
43
|
+
assert.equal(isStated(byId('CON-001')), true);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('assumptions are never rows; assumed and recommended are not stated', () => {
|
|
47
|
+
assert.equal(byId('ASM-001'), undefined);
|
|
48
|
+
assert.equal(isStated(byId('NFR-001')), false);
|
|
49
|
+
assert.equal(isStated(byId('FR-002')), false);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const packages = new Map([['requirements.json', rows]]);
|
|
53
|
+
const cite = (label) => ({ label, path: 'requirements.json', quote: null });
|
|
54
|
+
|
|
55
|
+
test('a citation to a confirmed row passes', () => {
|
|
56
|
+
assert.deepEqual(validateBaCitations({ citations: [cite('FR-001 · kickoff call 2026-09-20')], packages }), []);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('a citation to an unknown id fails', () => {
|
|
60
|
+
assert.deepEqual(validateBaCitations({ citations: [cite('FR-009 · x')], packages }), [
|
|
61
|
+
{ check: 'quotes', message: 'FR-009 is not in requirements.json' },
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('a citation to an assumed row fails with its label', () => {
|
|
66
|
+
assert.deepEqual(validateBaCitations({ citations: [cite('NFR-001 · 2026-10-01')], packages }), [
|
|
67
|
+
{ check: 'quotes', message: 'NFR-001 is assumed in requirements.json; only confirmed rows are stated' },
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('citations to other files are ignored', () => {
|
|
72
|
+
const other = { label: 'C1 · 2026-09-10', path: 'inputs/C1.txt', quote: 'x' };
|
|
73
|
+
assert.deepEqual(validateBaCitations({ citations: [other], packages }), []);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('statedText joins the facts of confirmed rows only', () => {
|
|
77
|
+
assert.equal(statedText(rows), [
|
|
78
|
+
'Members book up to 4 courts per week.', 'Must run in AWS eu-west-1.',
|
|
79
|
+
'Stripe (write)', 'Booking, personal, about 900 per week',
|
|
80
|
+
].join('\n'));
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('a citation whose label is not the row cite fails', () => {
|
|
84
|
+
assert.deepEqual(validateBaCitations({ citations: [cite('FR-001 · made-up source')], packages }), [
|
|
85
|
+
{ check: 'quotes', message: 'FR-001 · made-up source does not match requirements.json; cite it as FR-001 · kickoff call 2026-09-20' },
|
|
86
|
+
]);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('a row with no label and no source is unlabelled, so proposed', () => {
|
|
90
|
+
const [row] = baRows({ schemaVersion: '1.0', requirements: [{ id: 'FR-7', text: 'x' }, { text: 'no id' }] });
|
|
91
|
+
assert.equal(row.label, 'unlabelled');
|
|
92
|
+
assert.equal(isStated(row), false);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('a malformed package is read without throwing', () => {
|
|
96
|
+
const bad = { schemaVersion: '1.0', requirements: [null, 5, { id: 'FR-1', text: 'x', label: 'confirmed' }], nfrs: {} };
|
|
97
|
+
assert.deepEqual(baRows(bad).map((r) => r.id), ['FR-1']);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('a citation to requirements.md fails when requirements.json sits beside it', () => {
|
|
101
|
+
const md = { label: 'FR-001 · x', path: 'requirements.md', quote: null };
|
|
102
|
+
assert.deepEqual(validateBaCitations({ citations: [md], packages }), [
|
|
103
|
+
{ check: 'quotes', message: 'requirements.md is the BA package for people; cite requirements.json by row id' },
|
|
104
|
+
]);
|
|
105
|
+
const nested = new Map([['docs/requirements.json', rows]]);
|
|
106
|
+
const deep = { label: 'FR-001 · x', path: 'docs/requirements.md', quote: null };
|
|
107
|
+
assert.equal(validateBaCitations({ citations: [deep], packages: nested }).length, 1);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test('a requirements.md with no json beside it is a normal input', () => {
|
|
111
|
+
const md = { label: 'R1 · x', path: 'requirements.md', quote: 'x' };
|
|
112
|
+
assert.deepEqual(validateBaCitations({ citations: [md], packages: new Map() }), []);
|
|
113
|
+
const other = new Map([['docs/requirements.json', rows]]);
|
|
114
|
+
assert.deepEqual(validateBaCitations({ citations: [md], packages: other }), []);
|
|
115
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test, before, after, describe } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
3
|
import { execFileSync } from 'node:child_process';
|
|
4
|
-
import { readFileSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { readFileSync, mkdtempSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
5
5
|
import { tmpdir } from 'node:os';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { openPage } from '../lib/cdp.mjs';
|
|
@@ -71,15 +71,29 @@ const REFLOW_DOC = [
|
|
|
71
71
|
// injectSectionHelp still leaves "an excluded document grew an explainer"
|
|
72
72
|
// green, because none of this fixture's real headings matches a lookup key.
|
|
73
73
|
['## Security', ''],
|
|
74
|
+
// Two consecutive view markers render as one tab group, the shape §5 of a real
|
|
75
|
+
// architecture document has. Another page links to a single view by its panel
|
|
76
|
+
// id, so the second tab is the one a deep link has to open.
|
|
77
|
+
// Prose after the group gives the jump room to overshoot: at the end of the
|
|
78
|
+
// page the scroll clamps, and a link that lands past the tab bar looks fine.
|
|
79
|
+
['## Views', '', '<!-- likec4:view index -->', '<!-- likec4:view containers -->', ''],
|
|
80
|
+
Array.from({ length: 12 }, (_, i) => `Paragraph ${i + 1} after the views keeps the page`
|
|
81
|
+
+ ' long enough that a jump to the second view is not clamped by the end of the document.\n'),
|
|
74
82
|
).join('\n');
|
|
75
83
|
|
|
76
84
|
function buildViewer() {
|
|
77
85
|
const out = mkdtempSync(join(tmpdir(), 'analyze-requirements-browser-'));
|
|
78
86
|
const stub = (name, body) => { const p = join(out, name); writeFileSync(p, body); return p; };
|
|
87
|
+
mkdirSync(join(out, 'adr'));
|
|
88
|
+
const longAdr = stub(join('adr', '0009-long.md'), ['# ADR 0009: Long record', '', '## Context', '',
|
|
89
|
+
...Array.from({ length: 40 }, (_, i) => `Context paragraph ${i + 1} keeps the record taller than the drawer.\n`),
|
|
90
|
+
'## Decision', '', 'Land here.', '',
|
|
91
|
+
// Without text below it the heading cannot reach the top: the drawer clamps.
|
|
92
|
+
...Array.from({ length: 30 }, (_, i) => `Consequence paragraph ${i + 1} fills the space under the decision.\n`)].join('\n'));
|
|
79
93
|
execFileSync('node', [
|
|
80
94
|
'plugins/solution-architect/skills/analyze-requirements/scripts/render.mjs',
|
|
81
95
|
'--root', fixtures, '--arch', `${fixtures}ARCHITECTURE.md`,
|
|
82
|
-
'--docs', `${fixtures}docs/adr/0001-sample.md`, stub('reflow.md', REFLOW_DOC),
|
|
96
|
+
'--docs', `${fixtures}docs/adr/0001-sample.md`, stub('reflow.md', REFLOW_DOC), longAdr,
|
|
83
97
|
'--out', out,
|
|
84
98
|
'--likec4-bundle', stub('l.js', LIKEC4_STUB),
|
|
85
99
|
// Mermaid is stubbed: the diagram renderer is not what these check, and a
|
|
@@ -212,6 +226,25 @@ describe('the viewer in a real browser', { skip: findChrome() ? false : 'no chro
|
|
|
212
226
|
assert.equal(nav.after, 1, 'navigation left more than one page visible');
|
|
213
227
|
});
|
|
214
228
|
|
|
229
|
+
// The estimate's component page links straight to the C2 or C3 view instead of
|
|
230
|
+
// redrawing it. Those views are tabs, and a panel that is not the first one is
|
|
231
|
+
// hidden, so a link to its id used to land on the tab group's first view.
|
|
232
|
+
test('a link to a view panel opens that tab', async () => {
|
|
233
|
+
const tab = await page.eval(`(async () => {
|
|
234
|
+
location.hash = '#panel-containers';
|
|
235
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
236
|
+
const panel = document.getElementById('panel-containers');
|
|
237
|
+
return { hidden: panel.hidden, selected: document.getElementById('tab-containers').getAttribute('aria-selected'),
|
|
238
|
+
first: document.getElementById('panel-index').hidden, onPage: Boolean(panel.closest('.page').offsetParent),
|
|
239
|
+
// the reader lands on the tab bar, not under the sticky top bar past it
|
|
240
|
+
barTop: Math.round(panel.closest('.view-tabs').querySelector('.view-tabs__bar').getBoundingClientRect().top),
|
|
241
|
+
topbar: Math.round(document.querySelector('.topbar')?.getBoundingClientRect().bottom ?? 0) };
|
|
242
|
+
})()`);
|
|
243
|
+
assert.ok(tab.barTop >= tab.topbar, `tab bar at ${tab.barTop}px is under the top bar (ends ${tab.topbar}px)`);
|
|
244
|
+
delete tab.barTop; delete tab.topbar;
|
|
245
|
+
assert.deepEqual(tab, { hidden: false, selected: 'true', first: true, onPage: true });
|
|
246
|
+
});
|
|
247
|
+
|
|
215
248
|
// Paper has no router. Every page is already in the DOM, only hidden, so print
|
|
216
249
|
// shows the whole set — which is what somebody printing an architecture
|
|
217
250
|
// document meant.
|
|
@@ -550,4 +583,46 @@ describe('the viewer in a real browser', { skip: findChrome() ? false : 'no chro
|
|
|
550
583
|
test('driving the diagram and the rail logs no error', async () => {
|
|
551
584
|
assert.deepEqual(page.errors, []);
|
|
552
585
|
});
|
|
586
|
+
|
|
587
|
+
// openDrawer resets the scroll and the click handler rewrote the link to the
|
|
588
|
+
// record's route, so a link to a heading inside an ADR opened it at the top.
|
|
589
|
+
test('a link to a heading inside a record opens the drawer at that heading', async () => {
|
|
590
|
+
const r = await page.eval(`(async () => {
|
|
591
|
+
const h = document.querySelector('[id^="0009-long__"][id$="__decision"]');
|
|
592
|
+
const a = document.createElement('a');
|
|
593
|
+
a.href = '#' + h.id; a.textContent = 'jump';
|
|
594
|
+
document.querySelector('.page:not([hidden])').appendChild(a);
|
|
595
|
+
a.click();
|
|
596
|
+
await new Promise((res) => setTimeout(res, 200));
|
|
597
|
+
const body = document.getElementById('drawer-body');
|
|
598
|
+
const out = { open: document.getElementById('drawer').classList.contains('is-open'),
|
|
599
|
+
inDrawer: body.contains(h), scrolled: body.scrollTop > 0,
|
|
600
|
+
top: Math.round(h.getBoundingClientRect().top - body.getBoundingClientRect().top) };
|
|
601
|
+
a.remove();
|
|
602
|
+
document.getElementById('drawer-close').click();
|
|
603
|
+
await new Promise((res) => setTimeout(res, 100));
|
|
604
|
+
return out;
|
|
605
|
+
})()`);
|
|
606
|
+
assert.deepEqual({ open: r.open, inDrawer: r.inDrawer, scrolled: r.scrolled },
|
|
607
|
+
{ open: true, inDrawer: true, scrolled: true });
|
|
608
|
+
assert.ok(r.top < 150, `heading sits ${r.top}px below the drawer top`);
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
test('a deep link to a heading inside a record opens the drawer at that heading', async () => {
|
|
612
|
+
const r = await page.eval(`(async () => {
|
|
613
|
+
const h = document.querySelector('[id^="0009-long__"][id$="__decision"]');
|
|
614
|
+
location.hash = '#' + h.id;
|
|
615
|
+
await new Promise((res) => setTimeout(res, 200));
|
|
616
|
+
const body = document.getElementById('drawer-body');
|
|
617
|
+
const out = { open: document.getElementById('drawer').classList.contains('is-open'),
|
|
618
|
+
inDrawer: body.contains(h), scrolled: body.scrollTop > 0,
|
|
619
|
+
top: Math.round(h.getBoundingClientRect().top - body.getBoundingClientRect().top) };
|
|
620
|
+
document.getElementById('drawer-close').click();
|
|
621
|
+
await new Promise((res) => setTimeout(res, 100));
|
|
622
|
+
return out;
|
|
623
|
+
})()`);
|
|
624
|
+
assert.deepEqual({ open: r.open, inDrawer: r.inDrawer, scrolled: r.scrolled },
|
|
625
|
+
{ open: true, inDrawer: true, scrolled: true });
|
|
626
|
+
assert.ok(r.top < 150, `heading sits ${r.top}px below the drawer top`);
|
|
627
|
+
});
|
|
553
628
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { spawnSync } 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
|
+
|
|
8
|
+
const CLI = 'plugins/solution-architect/skills/analyze-requirements/scripts/check-quotes.mjs';
|
|
9
|
+
|
|
10
|
+
function check(facts) {
|
|
11
|
+
const dir = mkdtempSync(join(tmpdir(), 'check-quotes-'));
|
|
12
|
+
const call = join(dir, 'C1.txt');
|
|
13
|
+
writeFileSync(call, 'Maya: We pay for Azure already, so it has to run there.\n');
|
|
14
|
+
const withPath = facts.map((f) => ({ section: 'constraints', src: 'C1', date: '2026-09-10', path: call, ...f }));
|
|
15
|
+
writeFileSync(join(dir, 'in.json'), JSON.stringify({ facts: withPath }));
|
|
16
|
+
const r = spawnSync('node', [CLI, '--facts', join(dir, 'in.json'), '--out', join(dir, 'out.json')], { encoding: 'utf8' });
|
|
17
|
+
return { r, out: JSON.parse(readFileSync(join(dir, 'out.json'), 'utf8')) };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
test('all quotes found: exit 0, every fact kept', () => {
|
|
21
|
+
const { r, out } = check([{ fact: 'must run on Azure', quote: 'it has to run there' }]);
|
|
22
|
+
assert.equal(r.status, 0, r.stdout);
|
|
23
|
+
assert.equal(out.facts.length, 1);
|
|
24
|
+
assert.deepEqual(out.misses, []);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('a reworded quote is a miss with the closest sentence; the rest are kept', () => {
|
|
28
|
+
const { r, out } = check([
|
|
29
|
+
{ fact: 'Azure', quote: 'it has to run there' },
|
|
30
|
+
{ fact: 'Azure', quote: 'it must run on Azure' },
|
|
31
|
+
]);
|
|
32
|
+
assert.equal(r.status, 1);
|
|
33
|
+
assert.match(r.stdout, /^MISS \[C1\] "it must run on Azure" — closest: "Maya: We pay for Azure/m);
|
|
34
|
+
assert.equal(out.facts.length, 1);
|
|
35
|
+
assert.equal(out.misses[0].closest.startsWith('Maya: We pay'), true);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('an unreadable input file is a miss, not a crash', () => {
|
|
39
|
+
const { r, out } = check([{ fact: 'x', quote: 'y', path: '/nonexistent/C9.txt', src: 'C9' }]);
|
|
40
|
+
assert.equal(r.status, 1);
|
|
41
|
+
assert.match(out.misses[0].closest, /file not readable/);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('an empty or missing quote is a miss, not a pass or a crash', () => {
|
|
45
|
+
const { r, out } = check([{ fact: 'a', quote: '' }, { fact: 'b' }]);
|
|
46
|
+
assert.equal(r.status, 1);
|
|
47
|
+
assert.equal(out.misses.length, 2);
|
|
48
|
+
assert.equal(out.misses.every((m) => m.closest === 'empty quote'), true);
|
|
49
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-links.test.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { rewriteDocLinks } from '../lib/doc-links.mjs';
|
|
3
|
+
import { rewriteDocLinks, anchorIds } from '../lib/doc-links.mjs';
|
|
4
4
|
|
|
5
5
|
const ids = new Map([
|
|
6
6
|
['/repo/docs/adr/0002-rls.md', 'doc-adr-0002-multi-tenancy'],
|
|
@@ -28,9 +28,9 @@ test('a root-relative href resolves the same way', () => {
|
|
|
28
28
|
assert.match(html, /href="#doc-adr-0002-multi-tenancy"/);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
test('
|
|
31
|
+
// A fragment that names no heading in the target (here: ids has no #context
|
|
32
|
+
// entry) falls back to the document anchor rather than a dead id.
|
|
33
|
+
test('an unknown fragment on a document link falls back to the document', () => {
|
|
34
34
|
const html = rewriteDocLinks(
|
|
35
35
|
'<p><a href="0002-rls.md#context">why</a></p>', '/repo/docs/adr/index.md', ids,
|
|
36
36
|
);
|
|
@@ -102,3 +102,48 @@ test('a root-absolute path is unwrapped: a single file has no site root', () =>
|
|
|
102
102
|
);
|
|
103
103
|
assert.match(html, /class="ext-ref"/);
|
|
104
104
|
});
|
|
105
|
+
|
|
106
|
+
// The author writes #q3 against the log's own headings; the renderer dedupes
|
|
107
|
+
// ids across the whole set, so the log's Q3 may have been minted q3-2.
|
|
108
|
+
test('a fragment resolves to the id its heading was minted as', () => {
|
|
109
|
+
const map = new Map([...ids,
|
|
110
|
+
['/repo/interview-log.md', 'doc-interview-log'],
|
|
111
|
+
['/repo/interview-log.md#q3', 'q3-2']]);
|
|
112
|
+
const html = rewriteDocLinks(
|
|
113
|
+
'<p><a href="interview-log.md#q3">Q3</a></p>', '/repo/ARCHITECTURE.md', map,
|
|
114
|
+
);
|
|
115
|
+
assert.match(html, /<a href="#q3-2">Q3<\/a>/);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// A heading with no ASCII letters slugs to '' — its key must not win over
|
|
119
|
+
// the document anchor, or the link renders as a dead href="#".
|
|
120
|
+
test('an empty minted slug falls back to the document anchor', () => {
|
|
121
|
+
const map = new Map([...ids,
|
|
122
|
+
['/repo/notes.md', 'doc-notes'], ['/repo/notes.md#', '']]);
|
|
123
|
+
const html = rewriteDocLinks('<a href="notes.md#">N</a>', '/repo/ARCHITECTURE.md', map);
|
|
124
|
+
assert.match(html, /<a href="#doc-notes">N<\/a>/);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('anchorIds maps each heading\'s own-document slug to its minted id', () => {
|
|
128
|
+
const page = { path: '/repo/log.md', headings: [
|
|
129
|
+
{ level: 3, text: 'Q3', slug: 'log__q3', local: 'q3' },
|
|
130
|
+
{ level: 3, text: 'Q3', slug: 'log__q3-2', local: 'q3-2' },
|
|
131
|
+
] };
|
|
132
|
+
assert.deepEqual(anchorIds(page), [
|
|
133
|
+
['/repo/log.md#q3', 'log__q3'],
|
|
134
|
+
['/repo/log.md#q3-2', 'log__q3-2'],
|
|
135
|
+
]);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Inside an ADR, #context means this ADR's Context, not the spine's.
|
|
139
|
+
test('a same-page anchor resolves against its own document', () => {
|
|
140
|
+
const map = new Map([['/repo/docs/adr/0007.md#context', '0007__context']]);
|
|
141
|
+
const html = rewriteDocLinks('<a href="#context">C</a>', '/repo/docs/adr/0007.md', map);
|
|
142
|
+
assert.match(html, /<a href="#0007__context">C<\/a>/);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// View panels, doc heads and anything else that is not an h2/h3 keep their id.
|
|
146
|
+
test('a same-page anchor that names no heading is left alone', () => {
|
|
147
|
+
const html = rewriteDocLinks('<a href="#panel-containers">V</a>', '/repo/ARCHITECTURE.md', new Map());
|
|
148
|
+
assert.equal(html, '<a href="#panel-containers">V</a>');
|
|
149
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const src = readFileSync(new URL('../../workflows/extract.js', import.meta.url), 'utf8')
|
|
6
|
+
.replace(/^export const meta =/m, 'const meta =');
|
|
7
|
+
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
|
|
8
|
+
|
|
9
|
+
function run({ agentImpl, args }) {
|
|
10
|
+
const calls = { prompts: [], logs: [] };
|
|
11
|
+
const agent = (p, o) => { calls.prompts.push(p); return agentImpl(p, o); };
|
|
12
|
+
const fn = new AsyncFunction('agent', 'parallel', 'pipeline', 'phase', 'log', 'args', 'budget', src);
|
|
13
|
+
const parallel = (thunks) => Promise.all(thunks.map((t) => t().catch(() => null)));
|
|
14
|
+
return fn(agent, parallel, null, () => {}, (m) => calls.logs.push(m), args,
|
|
15
|
+
{ total: null, spent: () => 0, remaining: () => Infinity }).then((result) => ({ result, calls }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const FILES = [
|
|
19
|
+
{ id: 'C1', path: '/set/inputs/C1-kickoff-call.txt', date: '2026-09-10' },
|
|
20
|
+
{ id: 'E1', path: '/set/inputs/E1-intro-email.md', date: '2026-09-08' },
|
|
21
|
+
];
|
|
22
|
+
const okAgent = async () => ({ facts: [{ fact: 'runs on Azure', quote: 'it has to run there', section: 'deployment and hosting' }] });
|
|
23
|
+
|
|
24
|
+
test('one agent per file; facts tagged with the file id, date and path', async () => {
|
|
25
|
+
const { result, calls } = await run({ agentImpl: okAgent, args: { files: FILES } });
|
|
26
|
+
assert.equal(calls.prompts.length, 2);
|
|
27
|
+
assert.deepEqual(result.facts.map((f) => [f.src, f.date, f.path]), [
|
|
28
|
+
['C1', '2026-09-10', '/set/inputs/C1-kickoff-call.txt'],
|
|
29
|
+
['E1', '2026-09-08', '/set/inputs/E1-intro-email.md'],
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('default prompt names the file, the exact-quote rule and the checklist', async () => {
|
|
34
|
+
const { calls } = await run({ agentImpl: okAgent, args: { files: [FILES[0]] } });
|
|
35
|
+
assert.match(calls.prompts[0], /\/set\/inputs\/C1-kickoff-call\.txt/);
|
|
36
|
+
assert.match(calls.prompts[0], /character for character/);
|
|
37
|
+
assert.match(calls.prompts[0], /deployment and hosting/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('question mode asks only the question', async () => {
|
|
41
|
+
const { calls } = await run({ agentImpl: okAgent, args: { files: [FILES[0]], question: 'what about hosting?' } });
|
|
42
|
+
assert.match(calls.prompts[0], /Answer only this: what about hosting\?/);
|
|
43
|
+
assert.doesNotMatch(calls.prompts[0], /users and actors/);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('fix mode hands back the missed quotes', async () => {
|
|
47
|
+
const fix = [{ fact: 'Azure', quote: 'it must run on Azure', closest: 'We pay for Azure already' }];
|
|
48
|
+
const { calls } = await run({ agentImpl: okAgent, args: { files: [{ ...FILES[0], fix }] } });
|
|
49
|
+
assert.match(calls.prompts[0], /it must run on Azure/);
|
|
50
|
+
assert.match(calls.prompts[0], /not found in the file/);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('a failed agent lands in dropped; other files still return facts', async () => {
|
|
54
|
+
const flaky = async (p) => (p.includes('E1-intro') ? null : okAgent());
|
|
55
|
+
const { result, calls } = await run({ agentImpl: flaky, args: { files: FILES } });
|
|
56
|
+
assert.deepEqual(result.dropped, [{ item: 'E1', reason: 'agent returned nothing' }]);
|
|
57
|
+
assert.equal(result.facts.length, 1);
|
|
58
|
+
assert.ok(calls.logs.some((l) => l.includes('DROPPED E1')));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('a BA package file gets the confirmed-only rule; other files do not', async () => {
|
|
62
|
+
const files = [
|
|
63
|
+
{ id: 'D1', path: '/set/requirements.md', date: '2026-10-01', ba: true },
|
|
64
|
+
{ id: 'C1', path: '/set/inputs/C1-kickoff-call.txt', date: '2026-09-10' },
|
|
65
|
+
];
|
|
66
|
+
const { calls } = await run({ agentImpl: okAgent, args: { files } });
|
|
67
|
+
assert.match(calls.prompts[0], /only rows labelled confirmed/);
|
|
68
|
+
assert.doesNotMatch(calls.prompts[1], /labelled confirmed/);
|
|
69
|
+
});
|
|
@@ -70,3 +70,17 @@ test('accepts a link to a deduped -2 anchor matching the renderer', async () =>
|
|
|
70
70
|
const inputs = await anchorInputs('## Consequences\n\n## Consequences\n\n[ok](#consequences-2)\n');
|
|
71
71
|
assert.deepEqual(validateLinks(inputs), []);
|
|
72
72
|
});
|
|
73
|
+
|
|
74
|
+
// md-render skips fenced code and frontmatter; the validator must count the same
|
|
75
|
+
// headings, or `#setup-2` passes the check and lands nowhere in the viewer.
|
|
76
|
+
test('a heading inside a code fence or frontmatter is not an anchor', async () => {
|
|
77
|
+
const inputs = await anchorInputs('---\n## hidden\ntitle: x\n---\n## Setup\n\n```\n## Setup\n```\n\n## Setup\n');
|
|
78
|
+
assert.deepEqual(inputs.anchors['ARCHITECTURE.md'], ['setup', 'setup-2']);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// md-render closes a fence only on a bare ``` line; a ```js inside an open fence
|
|
82
|
+
// is content, not a closer.
|
|
83
|
+
test('only a bare fence line closes a fence', async () => {
|
|
84
|
+
const inputs = await anchorInputs('## A\n\n```md\n## A\n```js\n## B\n```\n## A\n');
|
|
85
|
+
assert.deepEqual(inputs.anchors['ARCHITECTURE.md'], ['a', 'a-2']);
|
|
86
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-render.test.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { renderMarkdown } from '../lib/md-render.mjs';
|
|
|
5
5
|
test('renders headings with slug ids and collects them', () => {
|
|
6
6
|
const { html, headings } = renderMarkdown('## Core Components\ntext');
|
|
7
7
|
assert.match(html, /<h2 id="core-components">Core Components<\/h2>/);
|
|
8
|
-
assert.deepEqual(headings, [{ level: 2, text: 'Core Components', slug: 'core-components' }]);
|
|
8
|
+
assert.deepEqual(headings, [{ level: 2, text: 'Core Components', slug: 'core-components', local: 'core-components' }]);
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders tables, links, mermaid fences, likec4 markers', () => {
|
|
@@ -31,8 +31,8 @@ test('makes repeated heading ids unique within a document', () => {
|
|
|
31
31
|
|
|
32
32
|
test('keeps heading ids unique across docs sharing a slug registry', () => {
|
|
33
33
|
const seen = new Map();
|
|
34
|
-
renderMarkdown('## Considered Options', seen);
|
|
35
|
-
const { headings } = renderMarkdown('## Considered Options', seen);
|
|
34
|
+
renderMarkdown('## Considered Options', { slugs: seen });
|
|
35
|
+
const { headings } = renderMarkdown('## Considered Options', { slugs: seen });
|
|
36
36
|
assert.equal(headings[0].slug, 'considered-options-2');
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -79,8 +79,8 @@ test('h1 gets a doc-prefixed id and is reported as the page title', () => {
|
|
|
79
79
|
test('doc ids use their own namespace so section slugs keep their numbering', () => {
|
|
80
80
|
const slugs = new Map();
|
|
81
81
|
const docSlugs = new Map();
|
|
82
|
-
renderMarkdown('# Related\n\n## Related', slugs, docSlugs);
|
|
83
|
-
const second = renderMarkdown('# Related\n\n## Related', slugs, docSlugs);
|
|
82
|
+
renderMarkdown('# Related\n\n## Related', { slugs, docSlugs });
|
|
83
|
+
const second = renderMarkdown('# Related\n\n## Related', { slugs, docSlugs });
|
|
84
84
|
assert.equal(second.docId, 'doc-related-2');
|
|
85
85
|
assert.equal(second.headings[0].slug, 'related-2');
|
|
86
86
|
});
|
|
@@ -224,3 +224,17 @@ test('view markers separated by prose stay separate diagram shells', () => {
|
|
|
224
224
|
assert.doesNotMatch(html, /view-tabs/);
|
|
225
225
|
assert.equal([...html.matchAll(/diagram-shell/g)].length, 2);
|
|
226
226
|
});
|
|
227
|
+
|
|
228
|
+
test('a prefix scopes heading ids to their document', () => {
|
|
229
|
+
const { html, headings } = renderMarkdown('## Context\n\n## Context', { prefix: '0007-cache' });
|
|
230
|
+
assert.match(html, /<h2 id="0007-cache__context">Context<\/h2>/);
|
|
231
|
+
assert.deepEqual(headings.map((h) => [h.slug, h.local]), [
|
|
232
|
+
['0007-cache__context', 'context'],
|
|
233
|
+
['0007-cache__context-2', 'context-2'],
|
|
234
|
+
]);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
test('without a prefix a heading id is its bare slug', () => {
|
|
238
|
+
const { headings } = renderMarkdown('## Core Components');
|
|
239
|
+
assert.deepEqual(headings.map((h) => [h.slug, h.local]), [['core-components', 'core-components']]);
|
|
240
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/record-cli.test.mjs
CHANGED
|
@@ -32,7 +32,7 @@ function run(script, args) {
|
|
|
32
32
|
return { code: status, stdout, stderr };
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// What step
|
|
35
|
+
// What step 6 leaves on disk: the package, and nothing recorded about it yet.
|
|
36
36
|
function packageDir() {
|
|
37
37
|
const dir = mkdtempSync(join(tmpdir(), 'rerun-safety-record-'));
|
|
38
38
|
mkdirSync(join(dir, 'docs', 'adr'), { recursive: true });
|