@v11g/agents-rock 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +2 -2
- package/plugins/business-analyst/.claude-plugin/plugin.json +1 -1
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/conflict-quoted.md +15 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/no-internal-ids.md +9 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/one-question.md +15 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-interview-conflict/prompt.md +31 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-internal-ids.md +9 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/no-setup-questions.md +16 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/one-scope-question.md +19 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-interview-first-turn/prompt.md +31 -0
- package/plugins/business-analyst/evals/ba-review-page/case.yaml +4 -0
- package/plugins/business-analyst/evals/ba-review-page/fixture.sh +12 -0
- package/plugins/business-analyst/evals/ba-review-page/graders/decide-in-interview.md +26 -0
- package/plugins/business-analyst/evals/ba-review-page/graders/skill-fired.md +7 -0
- package/plugins/business-analyst/evals/ba-review-page/prompt.md +9 -0
- package/plugins/business-analyst/skills/business-analyst/README.md +8 -0
- package/plugins/business-analyst/skills/business-analyst/SKILL.md +47 -16
- package/plugins/business-analyst/skills/business-analyst/assets/review-page.html +68 -0
- package/plugins/business-analyst/skills/business-analyst/evals/evals.json +1 -1
- package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +3 -2
- package/plugins/business-analyst/skills/business-analyst/references/interview.md +156 -8
- package/plugins/business-analyst/skills/business-analyst/references/review.md +18 -4
- package/plugins/business-analyst/skills/business-analyst/references/writing.md +49 -8
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +12 -6
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-data.mjs +66 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-layout.mjs +53 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/review-page.mjs +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-checks.mjs +73 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-md.mjs +53 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-render.mjs +72 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/scope-rules.mjs +90 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review.mjs +48 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review.py +60 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_data.py +81 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_layout.py +50 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/review_page.py +115 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope.mjs +24 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope.py +35 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope_checks.py +168 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/scope_render.py +140 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +27 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.json +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-workflow-pass.md +136 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/python-parity.test.mjs +88 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/quality-gates.test.mjs +26 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-browser.test.mjs +106 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-fixture.mjs +32 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-page.test.mjs +340 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/review-parity.test.mjs +79 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-cases.mjs +58 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-checks.test.mjs +31 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/scope-md.test.mjs +140 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +1 -1
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.py +17 -8
- package/plugins/solution-architect/evals/proposal-workflow/case.yaml +6 -0
- package/plugins/solution-architect/evals/proposal-workflow/fixture.sh +6 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/inputs-written.md +23 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/no-proposal-md.md +7 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/proposal-workflow/graders/validate-then-render.md +16 -0
- package/plugins/solution-architect/evals/proposal-workflow/prompt.md +10 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/case.yaml +4 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/fixture.sh +6 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +10 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/nothing-written.md +7 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +11 -0
- package/plugins/solution-architect/evals/workflow-gate-no-architecture/prompt.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/case.yaml +4 -0
- package/plugins/solution-architect/evals/workflow-happy-path/fixture.sh +6 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/no-estimation-md.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/pages-or-stop.md +16 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/routed-to-workflow.md +12 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/skill-fired.md +7 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/three-questions-max.md +14 -0
- package/plugins/solution-architect/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +15 -0
- package/plugins/solution-architect/evals/workflow-happy-path/prompt.md +9 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +11 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +27 -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,838 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title><!-- slot:TITLE --> — score review</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme:light;
|
|
10
|
+
--paper:#e8ecef; --sheet:#fbfcfd; --ink:#141c24; --ink-dim:#5d6c78;
|
|
11
|
+
--rule:#d3dbe1; --grid:#edf1f4; --meter:#44586a; --mark:#b4232f; --mark-soft:#b4232f14;
|
|
12
|
+
--ok:#2f6b4a; --ok-soft:#2f6b4a14; --hi:#fbf1cf; --hi-line:#c8960c;
|
|
13
|
+
--t-s:#dfe6ec; --t-s-ink:#4a5a68; --t-m:#c3d2df; --t-m-ink:#2b3d4c; --t-l:#7d96ab; --t-l-ink:#fff; --t-xl:#2f4a60; --t-xl-ink:#fff;
|
|
14
|
+
--serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Liberation Serif",serif;
|
|
15
|
+
--sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
|
|
16
|
+
}
|
|
17
|
+
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) {
|
|
18
|
+
color-scheme:dark; --paper:#11171c; --sheet:#1a2229; --ink:#e6ecf1; --ink-dim:#93a3b0;
|
|
19
|
+
--rule:#2c3740; --grid:#222c34; --meter:#8fa8bb; --mark:#e26c60; --mark-soft:#e26c6021;
|
|
20
|
+
--ok:#7cc39a; --ok-soft:#7cc39a1c; --hi:#3b3519; --hi-line:#d9a92a;
|
|
21
|
+
--t-s:#263039; --t-s-ink:#9fb0bd; --t-m:#3a4a57; --t-m-ink:#d3dfe8; --t-l:#7d96ab; --t-l-ink:#0f161b; --t-xl:#bacdda; --t-xl-ink:#0f161b; } }
|
|
22
|
+
:root[data-theme="dark"] {
|
|
23
|
+
color-scheme:dark; --paper:#11171c; --sheet:#1a2229; --ink:#e6ecf1; --ink-dim:#93a3b0;
|
|
24
|
+
--rule:#2c3740; --grid:#222c34; --meter:#8fa8bb; --mark:#e26c60; --mark-soft:#e26c6021;
|
|
25
|
+
--ok:#7cc39a; --ok-soft:#7cc39a1c; --hi:#3b3519; --hi-line:#d9a92a;
|
|
26
|
+
--t-s:#263039; --t-s-ink:#9fb0bd; --t-m:#3a4a57; --t-m-ink:#d3dfe8; --t-l:#7d96ab; --t-l-ink:#0f161b; --t-xl:#bacdda; --t-xl-ink:#0f161b; }
|
|
27
|
+
* { box-sizing:border-box; }
|
|
28
|
+
body { margin:0; padding:2rem 1.5rem 6rem; background:var(--paper); color:var(--ink); font-family:var(--sans); font-size:.9rem; line-height:1.5; }
|
|
29
|
+
.page { max-width:78rem; margin:0 auto; }
|
|
30
|
+
:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
|
|
31
|
+
button, input, textarea { font:inherit; color:var(--ink); }
|
|
32
|
+
.hide { display:none !important; }
|
|
33
|
+
.mock { background:var(--mark); color:#fff; font-size:.72rem; font-weight:600; letter-spacing:.04em; padding:.2rem .6rem; display:inline-block; border-radius:.2rem; margin-bottom:.8rem; }
|
|
34
|
+
.head { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; }
|
|
35
|
+
h1 { font-family:var(--serif); font-size:2.1rem; font-weight:600; letter-spacing:-.015em; margin:0; }
|
|
36
|
+
.sub { margin:.15rem 0 .9rem; color:var(--ink-dim); font-size:.82rem; }
|
|
37
|
+
.lead { margin:0 0 1.2rem; max-width:70ch; color:var(--ink-dim); }
|
|
38
|
+
.btn { font-size:.78rem; font-weight:600; padding:.3rem .7rem; color:var(--ink-dim); background:var(--sheet); border:1px solid var(--rule); border-radius:.2rem; cursor:pointer; }
|
|
39
|
+
.btn:hover { color:var(--ink); border-color:var(--ink-dim); }
|
|
40
|
+
.btn.primary { background:var(--ink); color:var(--sheet); border-color:var(--ink); }
|
|
41
|
+
.btn.next { border-color:var(--mark); color:var(--mark); }
|
|
42
|
+
.btn:disabled { opacity:.55; cursor:default; }
|
|
43
|
+
.internal { font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--mark); border:1px solid var(--mark); padding:0 .4rem; border-radius:.2rem; margin-left:.4rem; vertical-align:middle; }
|
|
44
|
+
|
|
45
|
+
/* strip */
|
|
46
|
+
.strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); background:var(--sheet); border:1px solid var(--rule); margin-bottom:1rem; }
|
|
47
|
+
.strip div { padding:.6rem .9rem; border-left:1px solid var(--rule); }
|
|
48
|
+
.strip div:first-child { border-left:0; }
|
|
49
|
+
.strip b { display:block; font-family:var(--serif); font-size:1.4rem; font-variant-numeric:tabular-nums; }
|
|
50
|
+
.strip span { font-size:.74rem; color:var(--ink-dim); }
|
|
51
|
+
.strip .warn b { color:var(--mark); }
|
|
52
|
+
|
|
53
|
+
/* spine: one dot per feature on its weighted score */
|
|
54
|
+
.spine-wrap { background:var(--sheet); border:1px solid var(--rule); padding:.9rem 1rem .7rem; margin-bottom:1rem; }
|
|
55
|
+
.spine, .zones { display:grid; grid-template-columns:repeat(21,1fr); }
|
|
56
|
+
.spine { align-items:end; min-height:2.6rem; }
|
|
57
|
+
.spine .col { display:flex; flex-direction:column-reverse; align-items:center; gap:2px; border-left:1px solid var(--grid); }
|
|
58
|
+
.dot { width:11px; height:11px; padding:0; border:1px solid var(--ink); border-radius:50%; background:var(--sheet); cursor:pointer; }
|
|
59
|
+
.dot:hover, .dot.hl { background:var(--hi-line); border-color:var(--hi-line); }
|
|
60
|
+
.dot.changed { border-color:var(--mark); background:var(--mark); }
|
|
61
|
+
.dot.flag { box-shadow:0 0 0 2px var(--sheet), 0 0 0 3px var(--hi-line); }
|
|
62
|
+
.zones { border-top:1px solid var(--rule); margin-top:.35rem; padding-top:.3rem; font-size:.72rem; color:var(--ink-dim); }
|
|
63
|
+
.zones span { border-left:1px solid var(--rule); padding-left:.35rem; } .zones span:first-child { border-left:0; }
|
|
64
|
+
.zones b { color:var(--ink); }
|
|
65
|
+
.spine-note { margin:.45rem 0 0; font-size:.75rem; color:var(--ink-dim); }
|
|
66
|
+
|
|
67
|
+
/* nav + filters */
|
|
68
|
+
nav.sys { position:sticky; top:0; z-index:5; display:flex; gap:.4rem; flex-wrap:wrap; align-items:center; padding:.6rem 0; background:var(--paper); border-bottom:1px solid var(--rule); margin-bottom:1rem; }
|
|
69
|
+
nav.sys a { font-size:.8rem; text-decoration:none; color:var(--ink-dim); padding:.25rem .6rem; border:1px solid var(--rule); border-radius:1rem; background:var(--sheet); }
|
|
70
|
+
nav.sys a:hover { color:var(--ink); }
|
|
71
|
+
nav.sys a .n { font-variant-numeric:tabular-nums; margin-left:.35rem; font-weight:600; color:var(--ink); }
|
|
72
|
+
nav.sys .filters { margin-left:auto; display:flex; gap:.25rem; }
|
|
73
|
+
nav.sys .filters button { font-size:.74rem; padding:.2rem .6rem; border:1px solid var(--rule); border-radius:1rem; background:var(--sheet); color:var(--ink-dim); cursor:pointer; }
|
|
74
|
+
nav.sys .filters button[aria-pressed="true"] { background:var(--ink); color:var(--sheet); border-color:var(--ink); }
|
|
75
|
+
|
|
76
|
+
/* system */
|
|
77
|
+
section.system { background:var(--sheet); border:1px solid var(--rule); padding:1.2rem 1.4rem 1.2rem; margin-bottom:1.6rem; scroll-margin-top:3.5rem; }
|
|
78
|
+
.sys-head { display:flex; justify-content:space-between; gap:1rem; align-items:flex-end; border-bottom:1px solid var(--rule); padding-bottom:.8rem; margin-bottom:.8rem; }
|
|
79
|
+
.eyebrow { font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-dim); font-weight:600; }
|
|
80
|
+
h2 { font-family:var(--serif); font-size:1.5rem; font-weight:600; margin:.05rem 0 0; }
|
|
81
|
+
.subtotal { text-align:right; font-variant-numeric:tabular-nums; }
|
|
82
|
+
.subtotal b { font-family:var(--serif); font-size:1.35rem; display:block; }
|
|
83
|
+
.subtotal span { font-size:.74rem; color:var(--ink-dim); }
|
|
84
|
+
.subtotal .was { color:var(--mark); }
|
|
85
|
+
details.wf { margin:0 0 .6rem; }
|
|
86
|
+
details.wf summary { cursor:pointer; font-size:.74rem; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-dim); font-weight:700; }
|
|
87
|
+
.flow { border:1px solid var(--grid); background:var(--paper); padding:.6rem; overflow-x:auto; margin-top:.4rem; }
|
|
88
|
+
.flow-name { font-size:.72rem; color:var(--ink-dim); margin:.5rem 0 0; }
|
|
89
|
+
.flow g.node.hl rect, .flow g.node.hl polygon { stroke:var(--hi-line) !important; stroke-width:3px !important; }
|
|
90
|
+
|
|
91
|
+
/* feature card */
|
|
92
|
+
.feat { display:grid; grid-template-columns:17rem 1fr; gap:1.4rem; padding:1rem 0; border-top:1px solid var(--rule); scroll-margin-top:4rem; }
|
|
93
|
+
.feat.hl { background:linear-gradient(90deg,var(--hi),transparent 60%); }
|
|
94
|
+
.feat.flash { animation:flash 1.4s ease-out; }
|
|
95
|
+
@keyframes flash { 0%,40% { box-shadow:inset 3px 0 0 var(--hi-line); } 100% { box-shadow:inset 3px 0 0 transparent; } }
|
|
96
|
+
.rail h3 { font-family:var(--serif); font-size:1.05rem; font-weight:600; margin:0 0 .15rem; }
|
|
97
|
+
.rail .id { font-size:.72rem; color:var(--ink-dim); font-variant-numeric:tabular-nums; }
|
|
98
|
+
.rail .does { margin:.2rem 0 .4rem; font-size:.78rem; color:var(--ink-dim); }
|
|
99
|
+
.chip { display:inline-block; font-size:.7rem; padding:0 .4rem; margin:0 .2rem .2rem 0; border:1px solid var(--rule); border-radius:.8rem; background:var(--paper); white-space:nowrap; }
|
|
100
|
+
.verdict { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin:.5rem 0 .2rem; font-variant-numeric:tabular-nums; }
|
|
101
|
+
.verdict .total { font-size:.8rem; color:var(--ink-dim); } .verdict .total b { font-size:1.15rem; color:var(--ink); }
|
|
102
|
+
.tier { font-size:.75rem; font-weight:700; padding:.08rem .45rem; border:1px solid var(--rule); border-radius:.2rem; }
|
|
103
|
+
.tier.t-S { background:var(--t-s); color:var(--t-s-ink); } .tier.t-M { background:var(--t-m); color:var(--t-m-ink); }
|
|
104
|
+
.tier.t-L { background:var(--t-l); color:var(--t-l-ink); border-color:var(--t-l); } .tier.t-XL { background:var(--t-xl); color:var(--t-xl-ink); border-color:var(--t-xl); }
|
|
105
|
+
.price { font-size:.8rem; font-variant-numeric:tabular-nums; } .price b { font-size:.95rem; }
|
|
106
|
+
.moved { font-size:.72rem; color:var(--mark); font-weight:600; }
|
|
107
|
+
.flagchip { font-size:.7rem; font-weight:700; color:var(--hi-line); border:1px solid var(--hi-line); border-radius:.8rem; padding:0 .45rem; }
|
|
108
|
+
|
|
109
|
+
.factors { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.8rem 1rem; }
|
|
110
|
+
.factor .flabel { font-size:.72rem; font-weight:700; color:var(--ink-dim); display:flex; justify-content:space-between; }
|
|
111
|
+
.factor .flabel i { font-style:normal; font-weight:500; }
|
|
112
|
+
.pick { display:flex; gap:3px; margin:.3rem 0 .3rem; }
|
|
113
|
+
.pick button { flex:1; min-width:0; font-size:.78rem; font-weight:600; padding:.22rem 0; border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); color:var(--ink-dim); cursor:pointer; font-variant-numeric:tabular-nums; }
|
|
114
|
+
.pick button:hover { color:var(--ink); border-color:var(--ink-dim); }
|
|
115
|
+
.pick button.on { background:var(--meter); border-color:var(--meter); color:var(--sheet); }
|
|
116
|
+
.pick button.orig { box-shadow:inset 0 -2px 0 var(--ink-dim); }
|
|
117
|
+
.factor.changed .pick button.on { background:var(--mark); border-color:var(--mark); color:#fff; }
|
|
118
|
+
.anchor { margin:0; font-size:.74rem; line-height:1.35; color:var(--ink-dim); }
|
|
119
|
+
.why { margin:.2rem 0 0; font-size:.74rem; line-height:1.35; color:var(--ink); }
|
|
120
|
+
.why::before { content:'Evidence: '; color:var(--ink-dim); }
|
|
121
|
+
.factor.changed .why { text-decoration:line-through; opacity:.55; }
|
|
122
|
+
.note { display:block; margin-top:.7rem; font-size:.72rem; font-weight:700; color:var(--ink-dim); }
|
|
123
|
+
.note textarea { display:block; width:100%; max-width:70ch; margin-top:.25rem; padding:.35rem .5rem; min-height:2.2rem; field-sizing:content;
|
|
124
|
+
font-family:var(--serif); font-size:.86rem; font-weight:400; border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); resize:vertical; }
|
|
125
|
+
|
|
126
|
+
details.guide { margin:1.6rem 0; background:var(--sheet); border:1px solid var(--rule); padding:.8rem 1rem; }
|
|
127
|
+
details.guide summary { cursor:pointer; font-weight:600; }
|
|
128
|
+
.guide-table { border-collapse:collapse; width:100%; margin-top:.7rem; font-size:.76rem; }
|
|
129
|
+
.guide-table th, .guide-table td { border:1px solid var(--rule); padding:.35rem .45rem; text-align:left; vertical-align:top; }
|
|
130
|
+
.guide-table th { color:var(--ink-dim); } .guide-table td.dim { font-weight:600; white-space:nowrap; }
|
|
131
|
+
|
|
132
|
+
/* bottom bar + dialog */
|
|
133
|
+
.bar { position:fixed; left:0; right:0; bottom:0; background:var(--sheet); border-top:1px solid var(--rule); z-index:10; }
|
|
134
|
+
.bar .in { max-width:84rem; margin:0 auto; padding:.7rem 1.5rem; display:flex; gap:1rem; align-items:center; justify-content:space-between; flex-wrap:wrap; }
|
|
135
|
+
.bar .stat { font-size:.8rem; color:var(--ink-dim); font-variant-numeric:tabular-nums; } .bar .stat b { color:var(--ink); }
|
|
136
|
+
.saved { font-size:.72rem; color:var(--ink-dim); }
|
|
137
|
+
dialog { max-width:64rem; width:calc(100% - 3rem); border:1px solid var(--rule); background:var(--sheet); color:var(--ink); padding:1rem 1.2rem; box-shadow:0 18px 60px #0006; border-radius:.4rem; }
|
|
138
|
+
dialog::backdrop { background:rgb(10 14 18 / .45); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
|
|
139
|
+
dialog .sum { max-height:62vh; overflow:auto; }
|
|
140
|
+
.sum h4 { font-family:var(--serif); font-size:1.05rem; margin:1rem 0 .3rem; }
|
|
141
|
+
.sum table { width:100%; border-collapse:collapse; font-size:.82rem; font-variant-numeric:tabular-nums; }
|
|
142
|
+
.sum th { text-align:left; font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-dim); padding:.3rem .4rem; border-bottom:1px solid var(--rule); }
|
|
143
|
+
.sum td { padding:.3rem .4rem; border-bottom:1px solid var(--grid); vertical-align:top; }
|
|
144
|
+
.sum .up { color:var(--mark); font-weight:600; } .sum .down { color:var(--ok); font-weight:600; }
|
|
145
|
+
.quiet { color:var(--ink-dim); font-size:.82rem; }
|
|
146
|
+
#feedback { display:block; width:100%; min-height:5rem; margin-top:.5rem; padding:.5rem; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.7rem; border:1px solid var(--rule); background:var(--paper); color:var(--ink-dim); }
|
|
147
|
+
.dlg-foot { display:flex; justify-content:flex-end; align-items:center; gap:.5rem; margin-top:.8rem; border-top:1px solid var(--rule); padding-top:.8rem; }
|
|
148
|
+
#copied { font-size:.78rem; color:var(--ok); }
|
|
149
|
+
@media (max-width:980px) { .factors { grid-template-columns:repeat(2,minmax(0,1fr)); } }
|
|
150
|
+
@media (max-width:760px) { body { padding:1.2rem 1rem 8rem; } .feat { grid-template-columns:1fr; gap:.8rem; } nav.sys .filters { margin-left:0; } }
|
|
151
|
+
.reason { margin-top:.3rem; }
|
|
152
|
+
.reason .was { margin:0 0 .2rem; font-size:.72rem; color:var(--mark); font-weight:600; }
|
|
153
|
+
.reason textarea { display:block; width:100%; min-height:3.2rem; field-sizing:content; resize:vertical; font-size:.8rem; line-height:1.4;
|
|
154
|
+
padding:.35rem .45rem; border:1px solid var(--mark); border-radius:.2rem; background:var(--sheet); }
|
|
155
|
+
.reason:not(.missing) textarea { border-color:var(--rule); }
|
|
156
|
+
.warnbox { background:var(--mark-soft); color:var(--mark); padding:.5rem .7rem; font-size:.84rem; margin:.2rem 0 .6rem; }
|
|
157
|
+
.pinbar { position:fixed; right:1.2rem; bottom:4.6rem; z-index:11; display:flex; gap:.4rem; align-items:center; background:var(--sheet);
|
|
158
|
+
border:1px solid var(--hi-line); box-shadow:0 4px 18px #0002; padding:.45rem .6rem; border-radius:.3rem; max-width:calc(100% - 2.4rem); }
|
|
159
|
+
.pin-txt { display:flex; flex-direction:column; min-width:0; margin-right:.3rem; }
|
|
160
|
+
.pin-txt b { font-size:.8rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:22rem; }
|
|
161
|
+
.pin-txt small { font-size:.72rem; color:var(--ink-dim); }
|
|
162
|
+
.feat.cur { box-shadow:inset 3px 0 0 var(--hi-line); }
|
|
163
|
+
.flow g.node.cur rect, .flow g.node.cur polygon { stroke-width:5px !important; }
|
|
164
|
+
.flow g.node, .rail h3, .dot { cursor:pointer; }
|
|
165
|
+
.page { max-width:84rem; }
|
|
166
|
+
.feat { grid-template-columns:1fr; gap:.8rem; padding:1.2rem 0 1.3rem; }
|
|
167
|
+
.rail { display:flex; justify-content:space-between; gap:1.5rem; align-items:flex-start; }
|
|
168
|
+
.rail .who { max-width:44rem; }
|
|
169
|
+
.score-box { flex:none; min-width:15rem; text-align:right; }
|
|
170
|
+
.score-box .verdict { justify-content:flex-end; margin-top:0; }
|
|
171
|
+
.factors { grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; border:1px solid var(--grid); border-radius:.3rem; background:var(--paper); }
|
|
172
|
+
.factor { padding:.7rem .9rem .8rem; border-left:1px solid var(--rule); }
|
|
173
|
+
.factor:first-child { border-left:0; }
|
|
174
|
+
.factor .flabel { font-size:.76rem; }
|
|
175
|
+
.pick { gap:5px; margin:.45rem 0 .45rem; }
|
|
176
|
+
.pick button { padding:.34rem 0; font-size:.84rem; }
|
|
177
|
+
.anchor { font-size:.76rem; line-height:1.4; }
|
|
178
|
+
@media (max-width:980px) { .factors { grid-template-columns:repeat(2,minmax(0,1fr)); } .factor:nth-child(odd) { border-left:0; } .factor { border-top:1px solid var(--rule); } .rail { flex-direction:column; } .score-box { text-align:left; } .score-box .verdict { justify-content:flex-start; } }
|
|
179
|
+
.bar .actions { display:flex; gap:.5rem; align-items:center; margin-left:auto; }
|
|
180
|
+
|
|
181
|
+
/* capability map + links */
|
|
182
|
+
section.map .quiet { margin:.1rem 0 .6rem; }
|
|
183
|
+
.view { display:inline-flex; border:1px solid var(--rule); border-radius:.25rem; overflow:visible; background:var(--sheet); }
|
|
184
|
+
.view button { border:0; border-left:1px solid var(--rule); background:transparent; color:var(--ink-dim); font-size:.78rem; font-weight:600; padding:.3rem .75rem; cursor:pointer; }
|
|
185
|
+
.view button:first-child { border-left:0; }
|
|
186
|
+
.view button:hover { color:var(--ink); }
|
|
187
|
+
.view button[aria-pressed="true"] { background:var(--ink); color:var(--sheet); }
|
|
188
|
+
details.capsys { border-top:1px solid var(--rule); padding-top:.6rem; margin-top:.6rem; }
|
|
189
|
+
details.capsys summary { cursor:pointer; font-size:.82rem; font-weight:700; }
|
|
190
|
+
table.caps { width:100%; border-collapse:collapse; font-size:.82rem; margin:.5rem 0 .3rem; }
|
|
191
|
+
table.caps th { text-align:left; font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-dim); padding:.3rem .45rem; border-bottom:1px solid var(--rule); }
|
|
192
|
+
table.caps td { padding:.4rem .45rem; border-bottom:1px solid var(--grid); vertical-align:top; }
|
|
193
|
+
table.caps td:first-child { width:30%; } table.caps td:nth-child(2) { width:28%; }
|
|
194
|
+
table.caps tr[data-cap] { cursor:pointer; }
|
|
195
|
+
table.caps tr.hl td { background:var(--hi); }
|
|
196
|
+
table.caps tr.cur td { box-shadow:inset 0 2px 0 var(--hi-line), inset 0 -2px 0 var(--hi-line); }
|
|
197
|
+
table.caps tr.gap td { background:var(--mark-soft); }
|
|
198
|
+
table.caps tr.flash td { animation:flash 1.4s ease-out; }
|
|
199
|
+
.dim { color:var(--ink-dim); }
|
|
200
|
+
.chip.eng { cursor:pointer; border-color:var(--meter); }
|
|
201
|
+
.chip.hl { background:var(--hi); border-color:var(--hi-line); }
|
|
202
|
+
.gapnote { color:var(--mark); font-weight:700; font-size:.78rem; }
|
|
203
|
+
.ask { display:flex; flex-wrap:wrap; gap:.3rem .5rem; align-items:center; font-size:.78rem; }
|
|
204
|
+
.ask textarea { flex:1 1 100%; field-sizing:content; min-height:1.9rem; font-size:.8rem; padding:.25rem .4rem; border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); }
|
|
205
|
+
/* Builds: the link from this feature to the client's capabilities, tinted per system */
|
|
206
|
+
:root { --s1:#2f6fa3; --s2:#b5651d; --s3:#2f7d5b; --s4:#7b4fa8; }
|
|
207
|
+
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) { --s1:#6fa8d6; --s2:#e09a5a; --s3:#6cc39a; --s4:#b190dc; } }
|
|
208
|
+
:root[data-theme="dark"] { --s1:#6fa8d6; --s2:#e09a5a; --s3:#6cc39a; --s4:#b190dc; }
|
|
209
|
+
.builds { margin-top:.55rem; padding:.5rem .65rem .55rem; border:1px solid var(--rule); border-left:3px solid var(--meter); border-radius:.3rem; background:var(--paper); }
|
|
210
|
+
.builds.none { border-color:var(--hi-line); border-left-color:var(--hi-line); border-style:dashed; border-left-style:solid; background:var(--hi); }
|
|
211
|
+
.bhead { font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-dim); margin-bottom:.4rem; }
|
|
212
|
+
.bhead b { color:var(--ink); }
|
|
213
|
+
.builds.none .bhead { color:var(--ink); margin-bottom:.35rem; }
|
|
214
|
+
.bhead .hint { text-transform:none; letter-spacing:0; font-weight:500; color:var(--ink-dim); margin-left:.25rem; }
|
|
215
|
+
.btags { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; }
|
|
216
|
+
.cap { display:inline-flex; align-items:stretch; font-size:.78rem; border:1px solid var(--rule); border-left:3px solid var(--sc); border-radius:.3rem; background:var(--sheet); cursor:pointer; overflow:hidden; }
|
|
217
|
+
.cap > * { display:flex; align-items:center; padding:.18rem .45rem; }
|
|
218
|
+
.cap .cid { font-weight:700; font-size:.72rem; color:var(--sc); background:color-mix(in srgb, var(--sc) 12%, transparent); font-variant-numeric:tabular-nums; }
|
|
219
|
+
.cap .cname { font-weight:600; color:var(--ink); }
|
|
220
|
+
.cap .csys { font-size:.68rem; font-weight:600; color:var(--sc); padding-left:0; }
|
|
221
|
+
.cap button { all:unset; display:flex; align-items:center; cursor:pointer; color:var(--ink-dim); padding:0 .5rem; border-left:1px solid var(--grid); }
|
|
222
|
+
.cap button:hover { color:var(--mark); background:var(--mark-soft); }
|
|
223
|
+
.cap.added { box-shadow:0 0 0 1px var(--ok); }
|
|
224
|
+
.cap.added .cname::after { content:'new'; margin-left:.4rem; font-size:.62rem; font-weight:700; text-transform:uppercase; color:var(--ok); }
|
|
225
|
+
.cap.removed { opacity:.5; cursor:default; } .cap.removed .cname { text-decoration:line-through; }
|
|
226
|
+
.cap.hl { background:var(--hi); border-color:var(--hi-line); border-left-color:var(--sc); }
|
|
227
|
+
.builds select { font:inherit; font-size:.76rem; font-weight:600; color:var(--ink-dim); background:transparent; border:1px dashed var(--ink-dim); border-radius:.3rem; padding:.2rem .45rem; cursor:pointer; max-width:15rem; }
|
|
228
|
+
.builds select:hover { color:var(--ink); border-color:var(--ink); }
|
|
229
|
+
.note textarea { max-width:none; min-height:4.6rem; line-height:1.45; }
|
|
230
|
+
.feat.unasked .rail h3::after { content:' · not asked for'; font-family:var(--sans); font-size:.72rem; font-weight:600; color:var(--ink-dim); }
|
|
231
|
+
.warnbox.soft { background:var(--hi); color:var(--ink); }
|
|
232
|
+
/* nav: row 1 = system toggle + filters, row 2 = jump links; hints on hover */
|
|
233
|
+
nav.sys { flex-direction:column; align-items:stretch; gap:.45rem; }
|
|
234
|
+
nav.sys .navrow { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
|
|
235
|
+
nav.sys .filters { padding-left:1.5rem; }
|
|
236
|
+
nav.sys .navlbl { font-size:.68rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-dim); margin:0 .2rem 0 0; cursor:help; border-bottom:1px dotted var(--ink-dim); }
|
|
237
|
+
nav.sys .cnt { font-variant-numeric:tabular-nums; opacity:.7; margin-left:.15rem; }
|
|
238
|
+
.seg button { font-size:.8rem; padding:.32rem .9rem; }
|
|
239
|
+
[data-tip] { position:relative; }
|
|
240
|
+
[data-tip]:hover::after, [data-tip]:focus-visible::after { content:attr(data-tip); position:absolute; left:0; top:calc(100% + .45rem); z-index:20; width:max-content; max-width:18rem;
|
|
241
|
+
white-space:normal; text-transform:none; letter-spacing:0; font-size:.74rem; font-weight:500; line-height:1.4; color:var(--sheet); background:var(--ink); padding:.4rem .55rem; border-radius:.25rem; box-shadow:0 4px 14px #0003; pointer-events:none; }
|
|
242
|
+
nav.sys .filters [data-tip]:hover::after { left:auto; right:0; }
|
|
243
|
+
/* Built by: one row per component under the feature it builds */
|
|
244
|
+
.feat .builds { margin:.2rem 0 .1rem; }
|
|
245
|
+
.crows { display:flex; flex-direction:column; gap:.3rem; margin:.1rem 0 .45rem; }
|
|
246
|
+
.crow { display:grid; grid-template-columns:9.5rem minmax(12rem,1fr) auto auto auto; align-items:center; gap:.7rem; padding:.4rem .6rem; border:1px solid var(--grid); border-radius:.3rem; background:var(--sheet); font-size:.9rem; cursor:pointer; }
|
|
247
|
+
.crow .ccont { font-size:.76rem; font-weight:600; color:var(--ink-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
|
248
|
+
.crow .cname { font-weight:600; }
|
|
249
|
+
.crow .calso { font-size:.82rem; color:var(--ink-dim); display:flex; flex-wrap:wrap; gap:.25rem; align-items:center; }
|
|
250
|
+
.crow .chrs { font-variant-numeric:tabular-nums; font-weight:700; }
|
|
251
|
+
.crow button { all:unset; cursor:pointer; color:var(--ink-dim); padding:0 .3rem; }
|
|
252
|
+
.crow button:hover { color:var(--mark); }
|
|
253
|
+
.crow.hl { background:var(--hi); border-color:var(--hi-line); }
|
|
254
|
+
.crow.added { box-shadow:0 0 0 1px var(--ok); } .crow.added .cname::after { content:' new'; font-size:.7rem; color:var(--ok); text-transform:uppercase; }
|
|
255
|
+
.crow.removed { opacity:.5; cursor:default; } .crow.removed .cname { text-decoration:line-through; }
|
|
256
|
+
.cmini { font-size:.74rem; font-weight:700; color:var(--sc); border:1px solid var(--rule); border-left:3px solid var(--sc); border-radius:.25rem; padding:0 .35rem; background:var(--paper); cursor:pointer; }
|
|
257
|
+
.cmini.hl { background:var(--hi); }
|
|
258
|
+
.bhead .arch { margin-left:.6rem; text-transform:none; letter-spacing:0; font-weight:600; }
|
|
259
|
+
.archlink { color:var(--ink); font-weight:600; text-transform:none; letter-spacing:0; text-decoration:underline; text-underline-offset:2px; }
|
|
260
|
+
.archlink:hover { color:var(--mark); }
|
|
261
|
+
@media (max-width:760px) { .crow { grid-template-columns:1fr auto; } .crow .ccont, .crow .calso { grid-column:1 / -1; } }
|
|
262
|
+
/* long-reading comfort: bigger type, wider leading, shorter lines, calmer contrast */
|
|
263
|
+
body { font-size:1rem; line-height:1.65; }
|
|
264
|
+
.page { max-width:76rem; }
|
|
265
|
+
h1 { font-size:2.35rem; line-height:1.15; }
|
|
266
|
+
h2, section.card h2, section.system h2 { font-size:1.65rem; line-height:1.25; }
|
|
267
|
+
.sub { font-size:.9rem; }
|
|
268
|
+
.lead, .sec-lead, p.quiet { font-size:.98rem; line-height:1.7; max-width:68ch; }
|
|
269
|
+
.does, .fdoes, .demo, .anchor, .why, .meta, .spine-note, .bhead .hint { font-size:.9rem; line-height:1.6; }
|
|
270
|
+
section.card, section.system { padding:1.9rem 2.1rem; margin-bottom:2.2rem; }
|
|
271
|
+
.eyebrow, section.card h3, th, .bhead, .flabel { font-size:.76rem !important; letter-spacing:.06em; }
|
|
272
|
+
table.bd, table.caps, table.kv, details.tasks table, .sum table { font-size:.92rem; line-height:1.55; }
|
|
273
|
+
table.bd td, table.caps td, table.kv td, details.tasks td { padding-top:.55rem; padding-bottom:.55rem; }
|
|
274
|
+
.chip { font-size:.78rem; padding:.05rem .5rem; }
|
|
275
|
+
.twocol li { font-size:.96rem; line-height:1.65; margin:.4rem 0; }
|
|
276
|
+
.headline span { font-size:.84rem; }
|
|
277
|
+
.m .demo { font-size:.92rem; }
|
|
278
|
+
.feat { padding-top:1.6rem; padding-bottom:1.7rem; }
|
|
279
|
+
.rail h3 { font-size:1.25rem; margin-bottom:.25rem; }
|
|
280
|
+
.rail .does { font-size:.92rem; line-height:1.6; } .rail .id { font-size:.8rem; }
|
|
281
|
+
.cap { font-size:.84rem; }
|
|
282
|
+
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) { --ink:#dbe2e8; --ink-dim:#a3b2be; } }
|
|
283
|
+
:root[data-theme="dark"] { --ink:#dbe2e8; --ink-dim:#a3b2be; }
|
|
284
|
+
.sys .meta, .sys .eyebrow { font-size:.82rem !important; line-height:1.5; }
|
|
285
|
+
body.client .headline { grid-template-columns:1.4fr 1fr; }
|
|
286
|
+
/* every page: tables, strips, nav chips, hints and small notes */
|
|
287
|
+
table td { font-size:.92rem; line-height:1.55; }
|
|
288
|
+
.strip span, .legend, .pin-hint, small, nav.sys a, nav.toc a, p.map, .hint, .gone-note, .gapnote, .saved, .pin-txt small, .zones, label { font-size:.85rem; line-height:1.5; }
|
|
289
|
+
.pick button, .seg button, .view button, .btn { font-size:.84rem; }
|
|
290
|
+
textarea, input, select { font-size:.92rem; }
|
|
291
|
+
.flow-name { font-size:.84rem; } .cap .csys { font-size:.76rem; } .cap .cid { font-size:.78rem; } .flagchip { font-size:.78rem; }
|
|
292
|
+
|
|
293
|
+
/* how to read: the System → Feature → Block chain at the top of every page */
|
|
294
|
+
.howto { margin:0 0 1.4rem; padding:.85rem 1rem .8rem; border:1px solid var(--rule); border-radius:.35rem; background:var(--sheet); max-width:60rem; }
|
|
295
|
+
.howto-t { display:block; font-size:.74rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--ink-dim); margin-bottom:.55rem; }
|
|
296
|
+
.howto-chain { display:flex; flex-wrap:wrap; align-items:stretch; gap:.45rem; }
|
|
297
|
+
.howto-chain > span { flex:1 1 12rem; display:flex; flex-direction:column; gap:.1rem; padding:.5rem .7rem; border:1px solid var(--grid); border-radius:.3rem; background:var(--paper); font-size:.9rem; line-height:1.4; }
|
|
298
|
+
.howto-chain > span b { font-family:var(--serif); font-size:1.05rem; }
|
|
299
|
+
.howto-chain small { font-size:.8rem; color:var(--ink-dim); }
|
|
300
|
+
.howto-chain > i { align-self:center; font-style:normal; color:var(--ink-dim); }
|
|
301
|
+
.howto-rule { margin:.6rem 0 0; font-size:.9rem; color:var(--ink-dim); max-width:68ch; }
|
|
302
|
+
.howto-rule b { color:var(--ink); }
|
|
303
|
+
.howto-page { display:block; margin-top:.25rem; color:var(--ink); }
|
|
304
|
+
@media (max-width:640px) { .howto-chain > i { display:none; } }
|
|
305
|
+
|
|
306
|
+
/* native dropdowns follow the theme: dark popups in dark mode, readable option text */
|
|
307
|
+
:root { color-scheme:light; }
|
|
308
|
+
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) { color-scheme:dark; } }
|
|
309
|
+
:root[data-theme="dark"] { color-scheme:dark; }
|
|
310
|
+
select option, select optgroup { background:var(--sheet); color:var(--ink); }
|
|
311
|
+
</style>
|
|
312
|
+
</head>
|
|
313
|
+
<body>
|
|
314
|
+
<div class="page">
|
|
315
|
+
<div class="head">
|
|
316
|
+
<div>
|
|
317
|
+
<h1><!-- slot:TITLE --> — score review <span class="internal">internal</span></h1>
|
|
318
|
+
<p class="sub">After the PO's scope review · <span id="subcount"></span> · weights tech 20 · size 10 · deps 20 · uncertainty 30 · risk 20</p>
|
|
319
|
+
</div>
|
|
320
|
+
<button class="btn" id="theme" type="button">Dark</button>
|
|
321
|
+
</div>
|
|
322
|
+
<p class="lead">You score <b>features</b>, the business pieces from the scope review: that is what gets priced. Under each feature are the <b>components</b> that build it, so you can see what the score has to cover. A component shared with other features is a hint to check the deps score. <b>Review & send</b> unlocks when every feature is built by a component.</p>
|
|
323
|
+
<div class="howto"><b class="howto-t">How to read this page</b>
|
|
324
|
+
<div class="howto-chain"><span><b>System</b>a part of the business<small>e.g. Warehouse Mgmt System</small></span><i>→</i><span><b>Feature</b>something the client asked for<small>e.g. F04 Order intake & quotation entry</small></span><i>→</i><span><b>Component</b>a piece engineers build<small>e.g. Catalogue and item identity</small></span></div>
|
|
325
|
+
<p class="howto-rule">A feature is built by one or more components, and one component can serve several features. <span class="howto-page">You score the <b>features</b>; their scores set the price. The components under each feature show what will be built and carry no price of their own.</span></p></div>
|
|
326
|
+
|
|
327
|
+
<div class="strip" id="strip"></div>
|
|
328
|
+
<div class="spine-wrap">
|
|
329
|
+
<div class="spine" id="spine"></div>
|
|
330
|
+
<div class="zones">
|
|
331
|
+
<span style="grid-column:1/8">S <b><11.5</b></span><span style="grid-column:8/14">M <b>11.5–17.4</b></span>
|
|
332
|
+
<span style="grid-column:14/19">L <b>17.5–22.4</b></span><span style="grid-column:19/22">XL <b>22.5+</b></span>
|
|
333
|
+
</div>
|
|
334
|
+
<p class="spine-note">Each dot is one feature on its weighted score (5–25). Hover to see it, click to pin it and jump to its card. Red = you changed it; ringed = flagged for a deep estimate.</p>
|
|
335
|
+
</div>
|
|
336
|
+
|
|
337
|
+
<section class="system map" id="map">
|
|
338
|
+
<div class="sys-head"><div><div class="eyebrow">From the PO's scope review · read only</div><h2>Systems & workflows</h2></div>
|
|
339
|
+
<div class="subtotal" id="cover"></div></div>
|
|
340
|
+
<p class="quiet">Open a system to see its workflows, the features on each step, and the components that build them. Hover any box, feature or component to see its links; click to pin.</p>
|
|
341
|
+
<div id="systems"></div>
|
|
342
|
+
</section>
|
|
343
|
+
|
|
344
|
+
<nav class="sys" id="nav"></nav>
|
|
345
|
+
<div id="groups"></div>
|
|
346
|
+
<div id="unasked"></div>
|
|
347
|
+
|
|
348
|
+
<details class="guide"><summary>Scoring guide — what each 1–5 means</summary><div id="guide"></div></details>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div class="bar"><div class="in">
|
|
352
|
+
<span class="stat" id="stat"></span>
|
|
353
|
+
<span class="saved" id="saved">Your edits are saved in this browser as you go.</span>
|
|
354
|
+
<div class="actions">
|
|
355
|
+
<button class="btn" id="reset" type="button">Start over</button>
|
|
356
|
+
<button class="btn next" id="nextc" type="button" title="Jump to the next gap, changed or flagged item (n)">Next to check ↓</button>
|
|
357
|
+
<button class="btn primary" id="preview" type="button">Review & send →</button> <span class="quiet">You can reopen this page later; your changes stay in this browser.</span>
|
|
358
|
+
</div>
|
|
359
|
+
</div></div>
|
|
360
|
+
|
|
361
|
+
<div class="pinbar hide" id="pinbar" role="status">
|
|
362
|
+
<span>📌</span><div class="pin-txt"><b id="pinLabel"></b><small id="pinCount"></small></div>
|
|
363
|
+
<button class="btn" id="pinPrev" type="button" title="Previous (k)">↑</button>
|
|
364
|
+
<button class="btn" id="pinNext" type="button" title="Next (j)">↓ Next</button>
|
|
365
|
+
<button class="btn" id="pinClear" type="button" title="Esc">Clear</button>
|
|
366
|
+
</div>
|
|
367
|
+
<dialog id="dlg"><p><b>Your changes, before you send them</b></p><div class="sum" id="sum"></div>
|
|
368
|
+
<div id="sendable">
|
|
369
|
+
<p class="quiet" style="margin:.8rem 0 0">Feedback block — paste this into the chat. The agent asks why for every score you moved.</p>
|
|
370
|
+
<textarea id="feedback" readonly></textarea>
|
|
371
|
+
</div>
|
|
372
|
+
<div class="dlg-foot"><span id="copied"></span><form method="dialog"><button class="btn">Keep editing</button></form>
|
|
373
|
+
<button class="btn" id="goGap" type="button">Take me to the next gap</button>
|
|
374
|
+
<button class="btn primary" id="copy" type="button">Copy feedback</button></div></dialog>
|
|
375
|
+
|
|
376
|
+
<script type="application/json" id="page-data"><!-- slot:DATA --></script>
|
|
377
|
+
<script type="module">
|
|
378
|
+
const PAGE = JSON.parse(document.getElementById('page-data').textContent);
|
|
379
|
+
const DATA = PAGE.data; const ENG = PAGE.eng; const IMPLEMENTS = PAGE.implements; const CAP_SCORES = PAGE.scores; const TASKS = {};
|
|
380
|
+
// FINAL: the Component-based page of the estimate, the same layout read-only after sign-off, plus tasks and hours
|
|
381
|
+
const FINAL = false;
|
|
382
|
+
const K = ['tech', 'size', 'deps', 'unc', 'risk'];
|
|
383
|
+
const LABEL = { tech: 'Tech', size: 'Size', deps: 'Deps', unc: 'Uncertainty', risk: 'Risk' };
|
|
384
|
+
const ANCHOR = PAGE.anchor;
|
|
385
|
+
|
|
386
|
+
// ---- v2 pricing, inlined from shared/lib/pricing.mjs ----
|
|
387
|
+
<!-- slot:MATH -->
|
|
388
|
+
const price = (s) => featurePrice(s);
|
|
389
|
+
const money = (n) => `$${Math.round(n).toLocaleString('en-US')}`;
|
|
390
|
+
|
|
391
|
+
// ---- two layers: features (scored, priced) and components (what builds them, linked N-to-N) ----
|
|
392
|
+
const $ = (s, el = document) => el.querySelector(s);
|
|
393
|
+
const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
394
|
+
const CAPS = DATA.systems.flatMap((s) => s.features.map((c) => ({ ...c, sys: s })));
|
|
395
|
+
const capById = Object.fromEntries(CAPS.map((c) => [c.id, c]));
|
|
396
|
+
const COMPS = ENG;
|
|
397
|
+
const compById = Object.fromEntries(COMPS.map((b) => [b.id, b]));
|
|
398
|
+
const sysNo = (capId) => DATA.systems.indexOf(capById[capId].sys) + 1;
|
|
399
|
+
const sid = (s) => `s-${s.id}`;
|
|
400
|
+
const orig = (id) => Object.fromEntries(K.map((k, i) => [k, CAP_SCORES[id][i]]));
|
|
401
|
+
const cur = Object.fromEntries(CAPS.map((c) => [c.id, orig(c.id)]));
|
|
402
|
+
const links = Object.fromEntries(COMPS.map((b) => [b.id, [...(IMPLEMENTS[b.id] || [])]]));
|
|
403
|
+
const notes = {}; const reasons = {}; const asks = {}; // asks[capId] = note when the engineer asks the agent to add a component
|
|
404
|
+
let pin = null; // pinned highlight, see the hover/pin section
|
|
405
|
+
const STORE = `score-review:${DATA.project}:v4:${PAGE.baseline}`;
|
|
406
|
+
if (!FINAL) try { const v = JSON.parse(localStorage.getItem(STORE) || '{}');
|
|
407
|
+
for (const [o, src] of [[notes, v.notes], [reasons, v.reasons], [asks, v.asks]]) Object.assign(o, src || {});
|
|
408
|
+
for (const [id, sc] of Object.entries(v.scores || {})) if (cur[id]) Object.assign(cur[id], sc);
|
|
409
|
+
for (const [id, l] of Object.entries(v.links || {})) if (links[id]) links[id] = l.filter((c) => capById[c]); } catch { /* start fresh */ }
|
|
410
|
+
function save() {
|
|
411
|
+
if (FINAL) return;
|
|
412
|
+
try { localStorage.setItem(STORE, JSON.stringify({ scores: cur, notes, reasons, links, asks }));
|
|
413
|
+
$('#saved').textContent = `Saved in this browser at ${new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`; }
|
|
414
|
+
catch { $('#saved').textContent = 'This browser cannot save; copy the feedback before closing.'; }
|
|
415
|
+
}
|
|
416
|
+
const changedKeys = (id) => K.filter((k) => cur[id][k] !== orig(id)[k]);
|
|
417
|
+
const sameSet = (a, b) => a.length === b.length && a.every((x) => b.includes(x));
|
|
418
|
+
const buildersOf = (capId) => COMPS.filter((b) => links[b.id].includes(capId)).map((b) => b.id);
|
|
419
|
+
const origBuilders = (capId) => COMPS.filter((b) => (IMPLEMENTS[b.id] || []).includes(capId)).map((b) => b.id);
|
|
420
|
+
const isChanged = (id) => changedKeys(id).length > 0 || !sameSet(buildersOf(id), origBuilders(id));
|
|
421
|
+
// "unlinked" has two sides: a feature no component builds (blocks sending:
|
|
422
|
+
// nobody would build it) and a component that builds no feature (shown, so it gets a look)
|
|
423
|
+
const notBuilt = (capId) => !buildersOf(capId).length && asks[capId] === undefined;
|
|
424
|
+
const notAsked = (bid) => !links[bid].length;
|
|
425
|
+
const notBuiltCount = () => CAPS.filter((c) => notBuilt(c.id)).length;
|
|
426
|
+
const unlinkedCount = () => notBuiltCount() + COMPS.filter((b) => notAsked(b.id)).length;
|
|
427
|
+
// a feature lands in the milestone of its main component: the one most specific to it
|
|
428
|
+
// (fewest other features; earliest milestone on a tie), as the roll-up does
|
|
429
|
+
const mainComp = (capId) => buildersOf(capId).map((id) => compById[id]).sort((a, b) => links[a.id].length - links[b.id].length || a.milestone.localeCompare(b.milestone))[0];
|
|
430
|
+
|
|
431
|
+
// ---- systems & workflows: one panel per system, diagrams + feature table; one open at a time ----
|
|
432
|
+
function flowCode(fl) {
|
|
433
|
+
const ids = new Map(); const id = (n) => { if (!ids.has(n)) ids.set(n, `n${ids.size}`); return ids.get(n); };
|
|
434
|
+
const L = ['flowchart LR'];
|
|
435
|
+
fl.steps.forEach((st, i) => { if (i) L.push(` ${id(fl.steps[i - 1])} --> ${id(st)}`); });
|
|
436
|
+
fl.branches.forEach((b) => L.push(` ${id(b.from)} -.-> ${id(b.to)}`));
|
|
437
|
+
const map = {}; for (const [n, i] of ids) { L.push(` ${i}["${n.replace(/"/g, "'")}"]`); map[i] = `${fl.id}:${n}`; }
|
|
438
|
+
return { code: L.join('\n'), map };
|
|
439
|
+
}
|
|
440
|
+
const flowsOf = (s) => [s.main, ...s.subs].filter(Boolean);
|
|
441
|
+
const stepsOfSys = (s) => flowsOf(s).flatMap((fl) => [...fl.steps, ...fl.branches.map((b) => b.to)].map((st) => `${fl.id}:${st}`));
|
|
442
|
+
const capRefs = (c) => new Set(c.steps.includes('*') ? stepsOfSys(c.sys) : c.steps);
|
|
443
|
+
const stepName = (r) => r.slice(r.indexOf(':') + 1);
|
|
444
|
+
function diagrams(s) {
|
|
445
|
+
return flowsOf(s).map((fl) => { const m = flowCode(fl);
|
|
446
|
+
return `<p class="flow-name">${fl === s.main ? 'Main' : 'Sub'} · ${esc(fl.name)}</p><div class="flow" data-map="${esc(JSON.stringify(m.map))}"><pre class="mermaid">${esc(m.code)}</pre></div>`; }).join('');
|
|
447
|
+
}
|
|
448
|
+
function capRow(c) {
|
|
449
|
+
const steps = c.steps.includes('*') ? '<span class="chip">every step</span>' : c.steps.map((r) => `<span class="chip">${esc(stepName(r))}</span>`).join('') || '<span class="chip">off-step</span>';
|
|
450
|
+
return `<tr data-cap="${c.id}"><td><span class="dim">${c.id}</span> <b>${esc(c.name)}</b></td><td>${steps}</td><td class="built" data-built="${c.id}"></td></tr>`;
|
|
451
|
+
}
|
|
452
|
+
function renderMap() {
|
|
453
|
+
$('#systems').innerHTML = DATA.systems.map((s, i) => `<details class="capsys" data-sys="${s.id}"><summary>System ${i + 1} · ${esc(s.name)} <span class="dim" data-syscover="${s.id}"></span></summary>
|
|
454
|
+
${diagrams(s)}<table class="caps"><tr><th>Feature</th><th>Workflow steps</th><th>Built by (components)</th></tr>${s.features.map((c) => capRow({ ...c, sys: s })).join('')}</table></details>`).join('');
|
|
455
|
+
}
|
|
456
|
+
function paintCap(c) {
|
|
457
|
+
const by = buildersOf(c.id);
|
|
458
|
+
$(`tr[data-cap="${c.id}"]`).classList.toggle('gap', notBuilt(c.id));
|
|
459
|
+
$(`[data-built="${c.id}"]`).innerHTML = by.length ? by.map((id) => `<span class="chip eng" data-comp-chip="${id}">${esc(compById[id].name)}</span>`).join('')
|
|
460
|
+
: asks[c.id] !== undefined ? '<span class="dim">asked the agent to add a component</span>' : '<span class="gapnote">⚠ Not built yet: see its card</span>';
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// ---- feature cards, one section per system ----
|
|
464
|
+
function factorHtml(c, k) {
|
|
465
|
+
if (FINAL) { const n = cur[c.id][k];
|
|
466
|
+
return `<div class="factor ro"><div class="flabel">${LABEL[k]}<i>${WEIGHTS[k] * 100}%</i></div><div class="ro-n${n === 5 ? ' hot' : ''}">${n}<span>/5</span></div><p class="anchor">${esc(ANCHOR[k][n - 1])}</p></div>`; }
|
|
467
|
+
const pick = [1, 2, 3, 4, 5].map((n) => `<button type="button" data-f="${c.id}" data-k="${k}" data-n="${n}" title="${n} — ${esc(ANCHOR[k][n - 1])}">${n}</button>`).join('');
|
|
468
|
+
// the read-back contract: one hidden select per score, value 1–5, title = rubric anchor
|
|
469
|
+
const sel = `<select class="hide" data-id="${c.id}" data-key="${k}">${[1, 2, 3, 4, 5].map((n) => `<option value="${n}" title="${esc(ANCHOR[k][n - 1])}">${n}</option>`).join('')}</select>`;
|
|
470
|
+
return `<div class="factor" data-fk="${c.id}:${k}"><div class="flabel">${LABEL[k]}<i>${WEIGHTS[k] * 100}%</i></div>${sel}
|
|
471
|
+
<div class="pick">${pick}</div><p class="anchor"></p><div class="reason hide"><p class="was"></p><textarea data-reason="${c.id}:${k}" rows="2" placeholder="Why this score? e.g. no sample emails yet"></textarea></div></div>`;
|
|
472
|
+
}
|
|
473
|
+
function capHtml(c) {
|
|
474
|
+
const who = `<div class="who"><div class="id">${c.id} · System ${sysNo(c.id)} · ${esc(c.sys.name.split(' (')[0])}<span data-ms="${c.id}"></span></div><h3>${esc(c.name)}</h3><p class="does">${esc(c.does)}</p></div>`;
|
|
475
|
+
const effort = FINAL ? `<div class="side-effort effort"><b data-hrs="${c.id}"></b><span>expected effort of its components</span></div>` : '';
|
|
476
|
+
const box = `<div class="score-box"><div class="side-score"><div class="verdict"><span class="total">Σ <b data-total="${c.id}"></b></span><span class="tier" data-tier="${c.id}"></span><span class="moved" data-moved="${c.id}"></span></div>
|
|
477
|
+
<div class="price" data-price="${c.id}"></div><div data-flag="${c.id}"></div></div>${effort}</div>`;
|
|
478
|
+
const note = FINAL ? '' : `<label class="note">Note in plain words (optional)<textarea data-note="${c.id}" rows="3" placeholder="e.g. scan rules need sample barcodes before we can price it tighter"></textarea></label>`;
|
|
479
|
+
return `<article class="feat" id="c-${c.id}" data-feat="${c.id}"><div class="rail">${who}${box}</div>
|
|
480
|
+
<div class="builds" data-builtby="${c.id}"></div>
|
|
481
|
+
<div class="side-score"><div class="factors">${K.map((k) => factorHtml(c, k)).join('')}</div>${note}</div></article>`;
|
|
482
|
+
}
|
|
483
|
+
// ---- components: tasks and hours (Component-based page only) ----
|
|
484
|
+
const pert = ([, o, m, pp]) => (o + 4 * m + pp) / 6;
|
|
485
|
+
const hoursOf = (id) => Math.round((typeof TASKS === 'undefined' ? [] : TASKS[id] || []).reduce((n, x) => n + pert(x), 0));
|
|
486
|
+
function tasksHtml(b) {
|
|
487
|
+
const ts = TASKS[b.id] || [];
|
|
488
|
+
return `<details class="tasks side-effort"><summary>${esc(b.name)} · ${ts.length} tasks · ${hoursOf(b.id)}h expected</summary><table><tr><th>Task</th><th class="r">O / M / P h</th><th class="r">Expected</th><th>Confidence</th></tr>${ts.map((x) =>
|
|
489
|
+
`<tr><td>${esc(x[0])}${x[5] ? `<div class="dim">${esc(x[5])}</div>` : ''}</td><td class="r">${x[1]} / ${x[2]} / ${x[3]}</td><td class="r"><b>${Math.round(pert(x))}h</b></td><td><span class="conf c-${x[4]}">${x[4]}</span></td></tr>`).join('')}</table></details>`;
|
|
490
|
+
}
|
|
491
|
+
// the architecture document holds the C4 views; this page links there instead of redrawing them.
|
|
492
|
+
// PAGE.c3 maps a container's name to its id when it has components (a C3 view); the rest live in C2.
|
|
493
|
+
const ARCH = PAGE.arch;
|
|
494
|
+
const archLink = (containers) => {
|
|
495
|
+
const c3 = containers.filter((c) => Object.hasOwn(PAGE.c3, c));
|
|
496
|
+
const c2 = containers.some((c) => !Object.hasOwn(PAGE.c3, c));
|
|
497
|
+
return [...c3.map((c) => `<a class="archlink" href="${ARCH}#panel-components-${PAGE.c3[c]}" target="_blank" rel="noopener">C3 ${esc(c)} ↗</a>`),
|
|
498
|
+
c2 && `<a class="archlink" href="${ARCH}#panel-containers" target="_blank" rel="noopener">C2 containers ↗</a>`].filter(Boolean).join(' · ');
|
|
499
|
+
};
|
|
500
|
+
// one row per component: its container, its name, and the other features it builds
|
|
501
|
+
function compRow(bid, capId, cls = '') {
|
|
502
|
+
const b = compById[bid]; const others = links[bid].filter((c) => c !== capId);
|
|
503
|
+
const also = others.length ? `also builds ${others.map((c) => `<span class="cmini" style="--sc:var(--s${sysNo(c)})" data-cap-chip="${c}" title="${esc(capById[c].name)}">${c}</span>`).join('')}` : '<span class="dim">only this feature</span>';
|
|
504
|
+
const x = !FINAL && !cls.includes('removed') ? `<button type="button" data-unlink="${bid}:${capId}" title="This component does not build it">×</button>` : '';
|
|
505
|
+
return `<div class="crow${cls}" data-comp-chip="${bid}"><span class="ccont">${esc(b.container)}</span><b class="cname">${esc(b.name)}</b><span class="calso">${also}</span>${FINAL ? `<span class="chrs">${hoursOf(bid)}h</span>` : ''}${x}</div>`;
|
|
506
|
+
}
|
|
507
|
+
// the "Built by" panel on a feature card: rows (× unlinks), a picker to add one, or the gap
|
|
508
|
+
function paintBuilt(capId) {
|
|
509
|
+
const by = buildersOf(capId); const was = origBuilders(capId); const box = $(`[data-builtby="${capId}"]`);
|
|
510
|
+
const conts = [...new Set(by.map((b) => compById[b].container))]; const ms = mainComp(capId)?.milestone;
|
|
511
|
+
$(`[data-ms="${capId}"]`).textContent = ms ? ` · ${ms}` : '';
|
|
512
|
+
box.classList.toggle('none', !by.length);
|
|
513
|
+
const head = by.length ? `Built by <b>${by.length}</b> component${by.length > 1 ? 's' : ''} in <b>${conts.length}</b> container${conts.length > 1 ? 's' : ''}` : 'Not built yet';
|
|
514
|
+
if (FINAL) { const h = by.reduce((n, b) => n + hoursOf(b), 0); $(`[data-hrs="${capId}"]`).textContent = `${h.toLocaleString('en-US')}h`;
|
|
515
|
+
box.innerHTML = `<div class="bhead">${head}<span class="arch">${archLink(conts)}</span></div><div class="crows">${by.map((b) => compRow(b, capId)).join('')}</div>${by.map((b) => tasksHtml(compById[b])).join('')}`; return; }
|
|
516
|
+
const rows = by.map((b) => compRow(b, capId, was.includes(b) ? '' : ' added')).join('') + was.filter((b) => !by.includes(b)).map((b) => compRow(b, capId, ' removed')).join('');
|
|
517
|
+
const conts2 = [...new Set(COMPS.map((b) => b.container))];
|
|
518
|
+
const pick = `<select data-link="${capId}" aria-label="Link a component"><option value="">+ Link a component</option>${conts2.map((g) => `<optgroup label="${esc(g)}">${COMPS.filter((b) => b.container === g && !by.includes(b.id)).map((b) =>
|
|
519
|
+
`<option value="${b.id}">${esc(b.name)}${notAsked(b.id) ? ' · builds nothing yet' : ''}</option>`).join('')}</optgroup>`).join('')}</select>`;
|
|
520
|
+
const gap = by.length ? '' : asks[capId] !== undefined
|
|
521
|
+
? `<div class="ask"><b>Asked the agent to add a component</b> <button type="button" class="btn" data-unask="${capId}">undo</button><textarea data-ask="${capId}" rows="1" placeholder="What should it cover? e.g. parse emails/faxes into a draft order">${esc(asks[capId])}</textarea></div>`
|
|
522
|
+
: `<div class="ask"><span class="gapnote">⚠ No component builds this, so nobody would build it.</span> <button type="button" class="btn" data-ask-btn="${capId}">Ask the agent to add one</button> <span class="dim">or link one</span></div>`;
|
|
523
|
+
box.innerHTML = `<div class="bhead">${head}${conts.length ? `<span class="arch">${archLink(conts)}</span>` : ''}</div>${gap}<div class="crows">${rows}</div>${pick}`;
|
|
524
|
+
}
|
|
525
|
+
// components that build no feature: listed once below the cards, so they get a look
|
|
526
|
+
function paintUnasked() {
|
|
527
|
+
const un = COMPS.filter((b) => notAsked(b.id));
|
|
528
|
+
$('#unasked').innerHTML = un.length ? `<section class="system" id="unasked-sec"><div class="sys-head"><div><div class="eyebrow">Unlinked · ${un.length}</div><h2>Components that build no feature</h2></div></div>
|
|
529
|
+
<p class="quiet">If the roll-up already covers one (foundation, DevOps) or an assumption excludes it, it should go; otherwise link it from a feature card above.</p>
|
|
530
|
+
<div class="crows">${un.map((b) => `<div class="crow" data-comp-chip="${b.id}"><span class="ccont">${esc(b.container)}</span><b class="cname">${esc(b.name)}</b><span class="calso dim">${esc(b.does)}</span></div>`).join('')}</div></section>` : '';
|
|
531
|
+
}
|
|
532
|
+
function render() {
|
|
533
|
+
renderMap();
|
|
534
|
+
$('#groups').innerHTML = DATA.systems.map((s, i) => `<section class="system" id="${sid(s)}" data-sec="${s.id}"><div class="sys-head"><div><div class="eyebrow">System ${i + 1} · ${s.features.length} features</div><h2>${esc(s.name)}</h2></div>
|
|
535
|
+
<div class="subtotal" data-sub="${s.id}"></div></div>${s.features.map((c) => capHtml({ ...c, sys: s })).join('')}</section>`).join('');
|
|
536
|
+
$('#guide').innerHTML = `<table class="guide-table"><tr><th></th>${[1, 2, 3, 4, 5].map((n) => `<th>${n}</th>`).join('')}</tr>${K.map((k) =>
|
|
537
|
+
`<tr><td class="dim">${LABEL[k]} ${WEIGHTS[k] * 100}%</td>${ANCHOR[k].map((a) => `<td>${esc(a)}</td>`).join('')}</tr>`).join('')}</table>`;
|
|
538
|
+
if (!FINAL) CAPS.forEach((c) => { $(`[data-note="${c.id}"]`).value = notes[c.id] || ''; });
|
|
539
|
+
}
|
|
540
|
+
function paint(id) {
|
|
541
|
+
const s = cur[id]; const p = price(s); const o = price(orig(id));
|
|
542
|
+
$(`[data-total="${id}"]`).textContent = p.score.toFixed(1);
|
|
543
|
+
const t = $(`[data-tier="${id}"]`); t.textContent = p.tier; t.className = `tier t-${p.tier}`;
|
|
544
|
+
$(`[data-moved="${id}"]`).textContent = p.tier !== o.tier ? `was ${o.tier}` : '';
|
|
545
|
+
$(`[data-price="${id}"]`).innerHTML = `<b>${money(p.point)}</b> <span class="quiet">(${money(p.low)}–${money(p.high)})</span>${Math.round(p.point) !== Math.round(o.point) ? ` <span class="moved">was ${money(o.point)}</span>` : ''}`;
|
|
546
|
+
$(`[data-flag="${id}"]`).innerHTML = p.flag ? `<span class="flagchip">⚑ ${p.flag}</span>` : '';
|
|
547
|
+
if (!FINAL) K.forEach((k) => {
|
|
548
|
+
const box = $(`[data-fk="${id}:${k}"]`); const was = orig(id)[k];
|
|
549
|
+
box.classList.toggle('changed', s[k] !== was);
|
|
550
|
+
box.querySelectorAll('.pick button').forEach((b) => { b.classList.toggle('on', +b.dataset.n === s[k]); b.classList.toggle('orig', +b.dataset.n === was && s[k] !== was); });
|
|
551
|
+
$('select', box).value = String(s[k]);
|
|
552
|
+
$('.anchor', box).textContent = ANCHOR[k][s[k] - 1];
|
|
553
|
+
const r = $('.reason', box); r.classList.toggle('hide', s[k] === was);
|
|
554
|
+
$('.was', r).textContent = `Agent proposed ${was}. Your evidence for ${s[k]}:`;
|
|
555
|
+
const inp = $('textarea', r); if (document.activeElement !== inp) inp.value = reasons[`${id}:${k}`] || '';
|
|
556
|
+
r.classList.toggle('missing', s[k] !== was && !(reasons[`${id}:${k}`] || '').trim());
|
|
557
|
+
});
|
|
558
|
+
paintBuilt(id);
|
|
559
|
+
}
|
|
560
|
+
function strip(sum) {
|
|
561
|
+
const { now, tiers, flags, covered, gaps } = sum; const unasked = COMPS.filter((b) => notAsked(b.id)).length;
|
|
562
|
+
const scoring = `<div><b>${CAPS.length}</b><span>features scored</span></div>
|
|
563
|
+
<div class="${gaps ? 'warn' : ''}"><b>${covered} / ${CAPS.length}</b><span>built by a component</span></div>
|
|
564
|
+
<div><b>${tiers.S} · ${tiers.M} · ${tiers.L} · ${tiers.XL}</b><span>S · M · L · XL</span></div>
|
|
565
|
+
<div><b>${money(now)}</b><span>feature build subtotal (before context, overheads, contingency)</span></div>
|
|
566
|
+
<div class="${flags ? 'warn' : ''}"><b>${flags}</b><span>need a closer look (deep estimate recommended)</span></div>`;
|
|
567
|
+
// hours once per component: a shared component is listed under several features but built once
|
|
568
|
+
if (FINAL) { const H = COMPS.reduce((n, b) => n + hoursOf(b.id), 0); const T = COMPS.reduce((n, b) => n + (TASKS[b.id] || []).length, 0);
|
|
569
|
+
return `${scoring}<div><b>${COMPS.length}</b><span>components</span></div><div><b>${T}</b><span>tasks</span></div><div><b>${H.toLocaleString('en-US')}h</b><span>expected effort, each component counted once</span></div>`; }
|
|
570
|
+
return `${scoring}<div class="${unasked ? 'warn' : ''}"><b>${COMPS.length}${unasked ? ` · ${unasked}` : ''}</b><span>components${unasked ? ' · build no feature' : ''}</span></div>
|
|
571
|
+
<div class="${gaps ? 'warn' : ''}"><b>${gaps}</b><span>features not built yet (blocks sending)</span></div>`;
|
|
572
|
+
}
|
|
573
|
+
function navHtml(count) {
|
|
574
|
+
const openName = openSys && DATA.systems.find((s) => s.id === openSys).name.split(' (')[0];
|
|
575
|
+
const toggle = `<div class="view seg" role="group" aria-label="Cards"><button type="button" data-cards="all" aria-pressed="${!sysFilter}" data-tip="Every feature card">All</button><button type="button" data-cards="wf" aria-pressed="${sysFilter}" data-tip="Only the feature cards of the system open in Systems & workflows above. Open another system there to switch.">Workflows${sysFilter ? ` · ${esc(openName)}` : ''}</button></div>`;
|
|
576
|
+
const sides = FINAL ? `<div class="view seg" role="group" aria-label="Card view"><button type="button" data-side="score" aria-pressed="${side === 'score'}" data-tip="Each feature's scores, tier and price, as signed off in the score review">Scoring</button><button type="button" data-side="effort" aria-pressed="${side === 'effort'}" data-tip="The components behind each feature, with their tasks and hours">Effort</button></div>` : '';
|
|
577
|
+
const jumps = DATA.systems.map((s) => { const n = s.features.filter((c) => capVisible({ ...c, sys: s })).length; const c = s.features.filter((x) => isChanged(x.id)).length;
|
|
578
|
+
return n ? `<a href="#${sid(s)}" data-tip="Jump to the ${esc(s.name)} cards (${n} shown)">${esc(s.name.split(' (')[0])} <span class="cnt">${n}</span>${c ? `<span class="n">${c} edited</span>` : ''}</a>` : ''; }).join('');
|
|
579
|
+
const FILTERS = [...(FINAL ? [] : [['edits', 'my edits', 'Cards where you moved a score or a component link']]),
|
|
580
|
+
['closer', 'needs a closer look', 'The pricing rule recommends a deep estimate: the range is ±40% or wider, or the price is $6,000 or more'],
|
|
581
|
+
['unlinked', 'unlinked', 'Not built yet: a feature no component builds (blocks sending). Also lists components that build no feature.']];
|
|
582
|
+
return `<div class="navrow">${toggle}${sides}</div>`
|
|
583
|
+
+ `<div class="navrow"><span class="navlbl" data-tip="Each system is a section of feature cards below">Jump to</span>${jumps}`
|
|
584
|
+
+ `<span class="filters"><span class="navlbl" data-tip="Narrow the cards; click again to clear. Combines with All | Workflows.">Show</span>${FILTERS.map(([f, label, tip]) =>
|
|
585
|
+
`<button type="button" data-filter="${f}" aria-pressed="${filter === f}" data-tip="${tip}">${label} <span class="cnt">${count[f]}</span></button>`).join('')}</span></div>`;
|
|
586
|
+
}
|
|
587
|
+
function totals() {
|
|
588
|
+
let now = 0; let was = 0; let flags = 0; let changed = 0; const tiers = { S: 0, M: 0, L: 0, XL: 0 };
|
|
589
|
+
DATA.systems.forEach((s) => {
|
|
590
|
+
let sn = 0; let sw = 0;
|
|
591
|
+
s.features.forEach((c) => { const p = price(cur[c.id]); sn += p.point; sw += price(orig(c.id)).point; tiers[p.tier] += 1; if (p.flag) flags += 1; if (isChanged(c.id)) changed += 1; });
|
|
592
|
+
now += sn; was += sw;
|
|
593
|
+
$(`[data-sec="${s.id}"]`).classList.toggle('hide', !s.features.some((c) => capVisible({ ...c, sys: s })));
|
|
594
|
+
const hrs = FINAL ? new Set(s.features.flatMap((c) => buildersOf(c.id))) : null;
|
|
595
|
+
$(`[data-sub="${s.id}"]`).innerHTML = `<div class="side-score"><b>${money(sn)}</b><span>feature build subtotal</span>${Math.round(sn) !== Math.round(sw) ? `<span class="was"> · was ${money(sw)}</span>` : ''}</div>`
|
|
596
|
+
+ (FINAL ? `<div class="side-effort"><b>${[...hrs].reduce((n, b) => n + hoursOf(b), 0).toLocaleString('en-US')}h</b><span>${hrs.size} components, each counted once</span></div>` : '');
|
|
597
|
+
});
|
|
598
|
+
CAPS.forEach(paintCap);
|
|
599
|
+
const covered = CAPS.filter((c) => buildersOf(c.id).length).length; const gaps = notBuiltCount();
|
|
600
|
+
DATA.systems.forEach((s) => { const n = s.features.filter((c) => notBuilt(c.id)).length; $(`[data-syscover="${s.id}"]`).innerHTML = n ? `<span class="gapnote">· ⚠ ${n} not built</span>` : `· ${s.features.length} features, all built`; });
|
|
601
|
+
$('#cover').innerHTML = `<b class="${gaps ? 'gapnote' : ''}">${covered} / ${CAPS.length}</b><span>features built by a component</span>`;
|
|
602
|
+
$('#strip').innerHTML = strip({ now, tiers, flags, covered, gaps });
|
|
603
|
+
$('#stat').innerHTML = `<b>${changed}</b> edited · <b class="${gaps ? 'gapnote' : ''}">${gaps}</b> not built yet · subtotal <b>${money(now)}</b>${Math.round(now) !== Math.round(was) ? ` (was ${money(was)})` : ''}`;
|
|
604
|
+
$('#preview').title = gaps ? `${gaps} feature${gaps === 1 ? '' : 's'} not built yet: you can review, but not send` : '';
|
|
605
|
+
repaintNav();
|
|
606
|
+
}
|
|
607
|
+
function repaintNav() {
|
|
608
|
+
const count = { edits: CAPS.filter((c) => isChanged(c.id)).length, closer: CAPS.filter((c) => price(cur[c.id]).flag).length, unlinked: unlinkedCount() };
|
|
609
|
+
$('#nav').innerHTML = navHtml(count);
|
|
610
|
+
spine();
|
|
611
|
+
if (pin) highlight(...pin.hit);
|
|
612
|
+
}
|
|
613
|
+
function spine() {
|
|
614
|
+
const cols = Array.from({ length: 21 }, () => []);
|
|
615
|
+
CAPS.forEach((c) => { const p = price(cur[c.id]); cols[Math.min(20, Math.round(p.score) - 5)].push({ c, p }); });
|
|
616
|
+
$('#spine').innerHTML = cols.map((col) => `<div class="col">${col.map(({ c, p }) =>
|
|
617
|
+
`<button class="dot${isChanged(c.id) ? ' changed' : ''}${p.flag ? ' flag' : ''}" data-go="${c.id}" title="${c.id} ${esc(c.name)} · ${p.score.toFixed(1)} ${p.tier}"></button>`).join('')}</div>`).join('');
|
|
618
|
+
}
|
|
619
|
+
let filter = 'all';
|
|
620
|
+
let side = 'score'; // FINAL only: Scoring | Effort
|
|
621
|
+
let sysFilter = false; let openSys = null; // system open in Systems & workflows + the All | Workflows toggle
|
|
622
|
+
const PASS = { all: () => true, edits: (c) => isChanged(c.id), closer: (c) => !!price(cur[c.id]).flag, unlinked: (c) => notBuilt(c.id) };
|
|
623
|
+
const capVisible = (c) => PASS[filter](c) && (!sysFilter || c.sys.id === openSys);
|
|
624
|
+
function applyFilter() {
|
|
625
|
+
CAPS.forEach((c) => $(`#c-${c.id}`).classList.toggle('hide', !capVisible(c)));
|
|
626
|
+
$('#unasked').classList.toggle('hide', !['all', 'unlinked'].includes(filter));
|
|
627
|
+
}
|
|
628
|
+
function openSystem(s) {
|
|
629
|
+
openSys = s;
|
|
630
|
+
if (!s) sysFilter = false; // nothing picked: Workflows has nothing to follow
|
|
631
|
+
document.querySelectorAll('details.capsys').forEach((d) => { d.open = d.dataset.sys === s; });
|
|
632
|
+
}
|
|
633
|
+
const refresh = (id) => { if (id) paint(id); totals(); applyFilter(); };
|
|
634
|
+
const relink = () => { CAPS.forEach((c) => paintBuilt(c.id)); paintUnasked(); refresh(); save(); };
|
|
635
|
+
|
|
636
|
+
// ---- feedback: the --read contract (feature scores + component links) ----
|
|
637
|
+
const reasonsFor = (id) => Object.fromEntries(changedKeys(id).map((k) => [k, (reasons[`${id}:${k}`] || '').trim()]).filter(([, v]) => v));
|
|
638
|
+
window.__feedback = () => ({
|
|
639
|
+
features: CAPS.map((c) => ({ id: c.id, scores: { ...cur[c.id] }, scoreNote: notes[c.id] || '', ...(changedKeys(c.id).length ? { reasons: reasonsFor(c.id) } : {}) })),
|
|
640
|
+
components: COMPS.map((b) => ({ id: b.id, implements: [...links[b.id]] })),
|
|
641
|
+
addComponent: CAPS.filter((c) => asks[c.id] !== undefined && !buildersOf(c.id).length).map((c) => ({ feature: c.id, note: asks[c.id].trim() })) });
|
|
642
|
+
const missingReasons = () => CAPS.flatMap((c) => changedKeys(c.id).filter((k) => !(reasons[`${c.id}:${k}`] || '').trim()).map((k) => `${c.id} ${LABEL[k]}`));
|
|
643
|
+
function linkSummary() {
|
|
644
|
+
const rows = CAPS.filter((c) => !sameSet(buildersOf(c.id), origBuilders(c.id))).map((c) => { const was = origBuilders(c.id); const now = buildersOf(c.id);
|
|
645
|
+
return `<tr><td><b>${c.id} ${esc(c.name)}</b></td><td>${now.filter((b) => !was.includes(b)).map((b) => `<span class="down">+ ${esc(compById[b].name)}</span>`).join('<br>')}${was.filter((b) => !now.includes(b)).map((b) => `<span class="up">− ${esc(compById[b].name)}</span>`).join('<br>')}</td></tr>`; }).join('');
|
|
646
|
+
const asked = CAPS.filter((c) => asks[c.id] !== undefined && !buildersOf(c.id).length).map((c) => `<tr><td><b>${c.id}</b> ${esc(c.name)}</td><td>Ask the agent to add a component${asks[c.id].trim() ? `: “${esc(asks[c.id].trim())}”` : ''}</td></tr>`).join('');
|
|
647
|
+
return (rows ? `<h4>Components you linked or unlinked</h4><table><tr><th>Feature</th><th>Components</th></tr>${rows}</table>` : '')
|
|
648
|
+
+ (asked ? `<h4>Not built yet — you asked the agent to add a component</h4><table><tr><th>Feature</th><th>Request</th></tr>${asked}</table>` : '');
|
|
649
|
+
}
|
|
650
|
+
function summaryHtml() {
|
|
651
|
+
const rows = (s) => s.features.filter((c) => changedKeys(c.id).length || notes[c.id]).map((c) => {
|
|
652
|
+
const p = price(cur[c.id]); const o = price(orig(c.id)); const d = p.point - o.point;
|
|
653
|
+
return `<tr><td><b>${c.id} ${esc(c.name)}</b></td><td>${changedKeys(c.id).map((k) => { const why = (reasons[`${c.id}:${k}`] || '').trim();
|
|
654
|
+
return `${LABEL[k]} ${orig(c.id)[k]}→${cur[c.id][k]}<div class="${why ? 'quiet' : 'up'}">${why ? `“${esc(why)}”` : 'no reason yet'}</div>`; }).join('') || '—'}</td>
|
|
655
|
+
<td>${o.tier}${p.tier !== o.tier ? ` → <b>${p.tier}</b>` : ''}</td><td>${money(o.point)} → ${money(p.point)} <span class="${d > 0 ? 'up' : 'down'}">${d ? `${d > 0 ? '+' : '−'}${money(Math.abs(d))}` : ''}</span></td>
|
|
656
|
+
<td>${notes[c.id] ? `“${esc(notes[c.id])}”` : ''}</td></tr>`; }).join('');
|
|
657
|
+
const parts = DATA.systems.map((s) => { const r = rows(s); return r ? `<h4>${esc(s.name)}</h4><table><tr><th>Feature</th><th>Scores moved</th><th>Tier</th><th>Point price</th><th>Note</th></tr>${r}</table>` : ''; }).join('');
|
|
658
|
+
const gaps = notBuiltCount(); const miss = missingReasons(); const unasked = COMPS.filter((b) => notAsked(b.id));
|
|
659
|
+
const block = gaps ? `<div class="warnbox"><b>${gaps} feature${gaps > 1 ? 's' : ''} not built yet — you can't send until each is built by a component, or you ask the agent to add one.</b> ${CAPS.filter((c) => notBuilt(c.id)).map((c) => `${c.id} ${esc(c.name)}`).join(' · ')}</div>` : '';
|
|
660
|
+
const info = unasked.length ? `<p class="quiet">Components that build no feature (check they should stay): ${unasked.map((b) => esc(b.name)).join(' · ')}</p>` : '';
|
|
661
|
+
const warn = miss.length ? `<div class="warnbox soft">${miss.length} changed score${miss.length > 1 ? 's have' : ' has'} no reason (${esc(miss.join(', '))}). You can still send; the agent will ask in chat.</div>` : '';
|
|
662
|
+
const body = parts + linkSummary();
|
|
663
|
+
return block + warn + info + (body || '<p class="quiet">No changes: you accepted every proposed score and component link. The feedback block still records that.</p>');
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// ---- wiring ----
|
|
667
|
+
$('#subcount').textContent = `${CAPS.length} features in ${DATA.systems.length} systems, built by ${COMPS.length} components`;
|
|
668
|
+
render(); CAPS.forEach((c) => paint(c.id)); paintUnasked(); totals(); applyFilter();
|
|
669
|
+
function onEdit(e) {
|
|
670
|
+
const b = e.target.closest('.pick button');
|
|
671
|
+
if (b) { const { f, k } = b.dataset; cur[f][k] = +b.dataset.n; refresh(f); save(); return true; }
|
|
672
|
+
const un = e.target.closest('[data-unlink]')?.dataset.unlink;
|
|
673
|
+
if (un) { const [bid, c] = un.split(':'); links[bid] = links[bid].filter((x) => x !== c); relink(); return true; }
|
|
674
|
+
const ask = e.target.closest('[data-ask-btn]')?.dataset.askBtn;
|
|
675
|
+
if (ask) { asks[ask] = ''; relink(); $(`[data-ask="${ask}"]`)?.focus(); return true; }
|
|
676
|
+
const unask = e.target.closest('[data-unask]')?.dataset.unask;
|
|
677
|
+
if (unask) { delete asks[unask]; relink(); return true; }
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
function onCards(cards) {
|
|
681
|
+
sysFilter = cards === 'wf';
|
|
682
|
+
if (!sysFilter) openSystem(null); // All: every card, every system collapsed
|
|
683
|
+
if (sysFilter && !openSys) openSystem((DATA.systems.find((s) => s.features.some((c) => notBuilt(c.id))) || DATA.systems[0]).id);
|
|
684
|
+
refresh(); if (sysFilter) $('#map').scrollIntoView({ block: 'start', behavior: 'smooth' });
|
|
685
|
+
}
|
|
686
|
+
function onNav(e) {
|
|
687
|
+
const go = e.target.closest('[data-go]');
|
|
688
|
+
if (go && $(`#c-${go.dataset.go}`).classList.contains('hide')) { filter = 'all'; sysFilter = false; refresh(); }
|
|
689
|
+
const fl = e.target.closest('[data-filter]');
|
|
690
|
+
if (fl) { filter = filter === fl.dataset.filter ? 'all' : fl.dataset.filter; refresh(); if (filter === 'unlinked') { lastC = null; nextItem(true); } }
|
|
691
|
+
const sd = e.target.closest('[data-side]')?.dataset.side;
|
|
692
|
+
if (sd) { side = sd; document.body.classList.toggle('side-effort-on', side === 'effort'); totals(); }
|
|
693
|
+
const cards = e.target.closest('[data-cards]')?.dataset.cards;
|
|
694
|
+
if (cards) onCards(cards);
|
|
695
|
+
}
|
|
696
|
+
document.addEventListener('click', (e) => { if (!onEdit(e)) onNav(e); });
|
|
697
|
+
// one system open at a time; with Workflows on, the open system picks the cards
|
|
698
|
+
$('#systems').addEventListener('toggle', (e) => {
|
|
699
|
+
const d = e.target; if (!d.matches?.('details.capsys') || drawing) return;
|
|
700
|
+
if (d.open) { openSystem(d.dataset.sys); sysFilter = true; } // opening a system shows its cards
|
|
701
|
+
else if (openSys === d.dataset.sys) openSystem(null);
|
|
702
|
+
refresh();
|
|
703
|
+
}, true);
|
|
704
|
+
document.addEventListener('change', (e) => {
|
|
705
|
+
const capId = e.target.dataset.link;
|
|
706
|
+
if (capId && e.target.value) { links[e.target.value] = [...links[e.target.value], capId]; relink(); }
|
|
707
|
+
});
|
|
708
|
+
document.addEventListener('input', (e) => {
|
|
709
|
+
const n = e.target.dataset.note; if (n) { notes[n] = e.target.value; save(); }
|
|
710
|
+
const a = e.target.dataset.ask; if (a) { asks[a] = e.target.value; save(); }
|
|
711
|
+
const r = e.target.dataset.reason;
|
|
712
|
+
if (r) { reasons[r] = e.target.value; e.target.closest('.reason').classList.toggle('missing', !e.target.value.trim()); save(); }
|
|
713
|
+
});
|
|
714
|
+
// ---- hover previews, click pins: diagram box ↔ feature ↔ component, everywhere they show ----
|
|
715
|
+
// A step lights its features and the components that build them; a component
|
|
716
|
+
// lights every feature it builds and their steps, in every system.
|
|
717
|
+
const compsOf = (caps) => new Set([...caps].flatMap(buildersOf));
|
|
718
|
+
const refsOf = (caps) => new Set([...caps].flatMap((c) => [...capRefs(capById[c])]));
|
|
719
|
+
function fromStep(ref) { const caps = new Set(CAPS.filter((c) => capRefs(c).has(ref)).map((c) => c.id)); return [new Set([ref]), caps, compsOf(caps)]; }
|
|
720
|
+
function fromCap(id) { const caps = new Set([id]); return [refsOf(caps), caps, compsOf(caps)]; }
|
|
721
|
+
function fromComp(id) { const caps = new Set(links[id]); return [refsOf(caps), caps, new Set([id])]; }
|
|
722
|
+
function highlight(refs, caps, comps) {
|
|
723
|
+
document.querySelectorAll('.feat').forEach((c) => c.classList.toggle('hl', caps.has(c.dataset.feat)));
|
|
724
|
+
document.querySelectorAll('.dot').forEach((d) => d.classList.toggle('hl', caps.has(d.dataset.go)));
|
|
725
|
+
document.querySelectorAll('tr[data-cap]').forEach((t) => t.classList.toggle('hl', caps.has(t.dataset.cap)));
|
|
726
|
+
document.querySelectorAll('[data-cap-chip]').forEach((t) => t.classList.toggle('hl', caps.has(t.dataset.capChip)));
|
|
727
|
+
document.querySelectorAll('[data-comp-chip]').forEach((t) => t.classList.toggle('hl', comps.has(t.dataset.compChip)));
|
|
728
|
+
document.querySelectorAll('.flow').forEach((d) => { const map = JSON.parse(d.dataset.map);
|
|
729
|
+
d.querySelectorAll('g.node').forEach((g) => g.classList.toggle('hl', refs.has(map[(g.id.match(/flowchart-(n\d+)-/) || [])[1]]))); });
|
|
730
|
+
}
|
|
731
|
+
const clearHl = () => document.querySelectorAll('.hl, .cur').forEach((x) => x.classList.remove('hl', 'cur'));
|
|
732
|
+
function hitAt(t) {
|
|
733
|
+
if (t.closest('button:not(.dot), input, textarea, select, .factors, nav, .bar, dialog, details.tasks, a')) return null;
|
|
734
|
+
const node = t.closest('.flow g.node');
|
|
735
|
+
if (node) { const ref = JSON.parse(node.closest('.flow').dataset.map)[(node.id.match(/flowchart-(n\d+)-/) || [])[1]];
|
|
736
|
+
return ref ? { hit: fromStep(ref), label: `Step “${stepName(ref)}”` } : null; }
|
|
737
|
+
const cap = t.closest('[data-cap-chip]')?.dataset.capChip;
|
|
738
|
+
if (cap) return { hit: fromCap(cap), label: `${cap} ${capById[cap].name}` };
|
|
739
|
+
const comp = t.closest('[data-comp-chip]')?.dataset.compChip;
|
|
740
|
+
if (comp) return { hit: fromComp(comp), label: compById[comp].name };
|
|
741
|
+
const id = t.closest('tr[data-cap]')?.dataset.cap || t.closest('.rail')?.closest('[data-feat]')?.dataset.feat || t.closest('.dot')?.dataset.go;
|
|
742
|
+
return id ? { hit: fromCap(id), label: `${id} ${capById[id].name}` } : null;
|
|
743
|
+
}
|
|
744
|
+
// only what is on screen: skip parts inside a collapsed system or a hidden section
|
|
745
|
+
const onScreen = (x) => !x.closest('.hide, details:not([open])') && x.getClientRects().length > 0;
|
|
746
|
+
const litParts = () => [...document.querySelectorAll('.flow g.node.hl, tr[data-cap].hl, .feat.hl')].filter(onScreen);
|
|
747
|
+
function showPin() {
|
|
748
|
+
const n = litParts(); const [refs, caps, comps] = pin.hit; const pl = (x, w) => `${x} ${w}${x === 1 ? '' : 's'}`;
|
|
749
|
+
$('#pinLabel').textContent = pin.label;
|
|
750
|
+
$('#pinCount').textContent = `${pl(refs.size, 'step')} · ${pl(caps.size, 'feature')} · ${pl(comps.size, 'component')} · ${pin.i + 1}/${n.length}`;
|
|
751
|
+
$('#pinbar').classList.remove('hide');
|
|
752
|
+
}
|
|
753
|
+
function jump(d) {
|
|
754
|
+
const n = litParts(); if (!n.length) return;
|
|
755
|
+
pin.i = (pin.i + d + n.length) % n.length;
|
|
756
|
+
n.forEach((x) => x.classList.remove('cur')); n[pin.i].classList.add('cur');
|
|
757
|
+
n[pin.i].scrollIntoView({ block: 'center', behavior: 'smooth' }); showPin();
|
|
758
|
+
}
|
|
759
|
+
function unpin() { pin = null; clearHl(); $('#pinbar').classList.add('hide'); }
|
|
760
|
+
document.addEventListener('mouseover', (e) => { if (pin) return; const h2 = hitAt(e.target); if (h2) highlight(...h2.hit); else clearHl(); });
|
|
761
|
+
document.addEventListener('click', (e) => {
|
|
762
|
+
if (e.target.closest('#pinbar')) return;
|
|
763
|
+
const h2 = hitAt(e.target); if (!h2) return;
|
|
764
|
+
if (pin && pin.label === h2.label) { unpin(); return; }
|
|
765
|
+
pin = { ...h2, i: -1 }; clearHl(); highlight(...h2.hit); showPin();
|
|
766
|
+
const dot = e.target.closest('.dot'); // a spine dot pins and goes straight to its card
|
|
767
|
+
if (dot) { pin.i = litParts().indexOf($(`#c-${dot.dataset.go}`)) - 1; jump(1); }
|
|
768
|
+
});
|
|
769
|
+
document.addEventListener('keydown', (e) => {
|
|
770
|
+
if (!pin || e.target.closest('input, textarea, select')) return;
|
|
771
|
+
if (e.key === 'Escape') unpin(); else if (e.key === 'j') jump(1); else if (e.key === 'k') jump(-1);
|
|
772
|
+
});
|
|
773
|
+
$('#pinNext').onclick = () => jump(1); $('#pinPrev').onclick = () => jump(-1); $('#pinClear').onclick = unpin;
|
|
774
|
+
// next gap, changed or flagged card, in page order after the last one visited
|
|
775
|
+
let lastC = null;
|
|
776
|
+
function nextItem(onlyGaps) {
|
|
777
|
+
const gaps = CAPS.filter((c) => notBuilt(c.id)).map((c) => $(`#c-${c.id}`));
|
|
778
|
+
const rest = onlyGaps ? [] : CAPS.filter((c) => isChanged(c.id) || price(cur[c.id]).flag).map((c) => $(`#c-${c.id}`));
|
|
779
|
+
const items = [...gaps, ...rest].filter((el) => !el.closest('.hide')).sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
780
|
+
if (!items.length) return;
|
|
781
|
+
const el = (lastC?.isConnected && items.find((x) => lastC.compareDocumentPosition(x) & Node.DOCUMENT_POSITION_FOLLOWING)) || items[0]; lastC = el;
|
|
782
|
+
el.scrollIntoView({ block: 'center', behavior: 'smooth' }); el.classList.remove('flash'); void el.offsetWidth; el.classList.add('flash');
|
|
783
|
+
}
|
|
784
|
+
$('#nextc').onclick = () => nextItem(false);
|
|
785
|
+
document.addEventListener('keydown', (e) => { if (e.key === 'n' && !e.target.closest('input, textarea, select') && !pin) nextItem(false); });
|
|
786
|
+
$('#preview').onclick = () => {
|
|
787
|
+
const gaps = notBuiltCount();
|
|
788
|
+
$('#sum').innerHTML = summaryHtml(); $('#feedback').value = JSON.stringify(window.__feedback()); $('#copied').textContent = '';
|
|
789
|
+
$('#sendable').classList.toggle('hide', !!gaps); $('#copy').disabled = !!gaps; $('#goGap').classList.toggle('hide', !gaps);
|
|
790
|
+
$('#dlg').showModal();
|
|
791
|
+
};
|
|
792
|
+
$('#goGap').onclick = () => { $('#dlg').close(); filter = 'all'; refresh(); lastC = null; nextItem(true); };
|
|
793
|
+
$('#copy').onclick = async () => { try { await navigator.clipboard.writeText($('#feedback').value); $('#copied').textContent = 'Copied — paste it into the chat'; }
|
|
794
|
+
catch { $('#feedback').select(); $('#copied').textContent = 'Press Ctrl+C to copy'; } };
|
|
795
|
+
let armed = false;
|
|
796
|
+
$('#reset').onclick = () => { if (!armed) { armed = true; $('#reset').textContent = 'Click again to reset everything'; setTimeout(() => { armed = false; $('#reset').textContent = 'Start over'; }, 4000); return; }
|
|
797
|
+
try { localStorage.removeItem(STORE); } catch { /* nothing saved */ } location.reload(); };
|
|
798
|
+
|
|
799
|
+
// ---- theme + diagrams (mockup loads mermaid from a CDN; the real page inlines the skill's bundle) ----
|
|
800
|
+
const dark = () => document.documentElement.dataset.theme === 'dark' || (!document.documentElement.dataset.theme && matchMedia('(prefers-color-scheme: dark)').matches);
|
|
801
|
+
const src = [...document.querySelectorAll('pre.mermaid')].map((p) => p.textContent);
|
|
802
|
+
let mermaid; let drawing = false;
|
|
803
|
+
// Mermaid cannot measure boxes inside a closed <details>, so every system opens
|
|
804
|
+
// for the draw and the open one is restored afterwards; the toggle events that
|
|
805
|
+
// causes are ignored while `drawing` is set.
|
|
806
|
+
async function draw() {
|
|
807
|
+
drawing = true; const all = [...document.querySelectorAll('details.capsys')];
|
|
808
|
+
try {
|
|
809
|
+
mermaid ??= (await import('https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs')).default;
|
|
810
|
+
const t = (v) => getComputedStyle(document.documentElement).getPropertyValue(v).trim();
|
|
811
|
+
mermaid.initialize({ startOnLoad: false, theme: 'base', flowchart: { curve: 'basis', padding: 10 }, themeVariables: { fontFamily: 'system-ui,sans-serif', fontSize: '12px',
|
|
812
|
+
background: t('--paper'), primaryColor: t('--sheet'), primaryTextColor: t('--ink'), primaryBorderColor: t('--meter'), lineColor: t('--ink-dim'), edgeLabelBackground: t('--paper'), textColor: t('--ink') } });
|
|
813
|
+
all.forEach((d) => { d.open = true; });
|
|
814
|
+
const pres = [...document.querySelectorAll('#systems pre.mermaid')];
|
|
815
|
+
pres.forEach((p, i) => { p.removeAttribute('data-processed'); p.textContent = src[i]; });
|
|
816
|
+
await mermaid.run({ nodes: pres });
|
|
817
|
+
if (pin) highlight(...pin.hit); // redraw makes new boxes; re-light a pinned selection
|
|
818
|
+
} catch { /* diagrams need a connection */ } finally {
|
|
819
|
+
all.forEach((d) => { d.open = d.dataset.sys === openSys; });
|
|
820
|
+
setTimeout(() => { drawing = false; }, 100);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
$('#theme').onclick = () => { document.documentElement.dataset.theme = dark() ? 'light' : 'dark'; $('#theme').textContent = dark() ? 'Light' : 'Dark'; draw(); };
|
|
824
|
+
$('#theme').textContent = dark() ? 'Light' : 'Dark';
|
|
825
|
+
// a step link from the Workflow-based page (#step=<ref>) opens its system and pins it
|
|
826
|
+
function pinFromHash() {
|
|
827
|
+
const ref = decodeURIComponent(location.hash.match(/^#step=(.+)$/)?.[1] ?? '');
|
|
828
|
+
if (!ref || pin?.ref === ref) return;
|
|
829
|
+
const sys = DATA.systems.find((s) => stepsOfSys(s).includes(ref)); if (!sys) return;
|
|
830
|
+
openSystem(sys.id); refresh();
|
|
831
|
+
pin = { hit: fromStep(ref), label: `Step “${stepName(ref)}”`, ref, i: -1 }; clearHl(); highlight(...pin.hit); showPin();
|
|
832
|
+
$(`details.capsys[data-sys="${sys.id}"]`).scrollIntoView({ block: 'start' });
|
|
833
|
+
}
|
|
834
|
+
if (FINAL) addEventListener('hashchange', pinFromHash);
|
|
835
|
+
draw().then(() => { if (FINAL) setTimeout(pinFromHash, 150); });
|
|
836
|
+
</script>
|
|
837
|
+
</body>
|
|
838
|
+
</html>
|