@transitrix/diagrams 1.0.0
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/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/__tests__/edge-path.test.d.ts +1 -0
- package/dist/__tests__/edge-path.test.js +39 -0
- package/dist/__tests__/scope.test.d.ts +1 -0
- package/dist/__tests__/scope.test.js +23 -0
- package/dist/__tests__/yaml-normalize.test.d.ts +1 -0
- package/dist/__tests__/yaml-normalize.test.js +148 -0
- package/dist/activities/__tests__/cpm.test.d.ts +1 -0
- package/dist/activities/__tests__/cpm.test.js +146 -0
- package/dist/activities/__tests__/gantt.test.d.ts +1 -0
- package/dist/activities/__tests__/gantt.test.js +224 -0
- package/dist/activities/__tests__/layout.test.d.ts +1 -0
- package/dist/activities/__tests__/layout.test.js +98 -0
- package/dist/activities/__tests__/validate.test.d.ts +1 -0
- package/dist/activities/__tests__/validate.test.js +363 -0
- package/dist/activities/cpm.d.ts +2 -0
- package/dist/activities/cpm.js +86 -0
- package/dist/activities/gantt.d.ts +6 -0
- package/dist/activities/gantt.js +250 -0
- package/dist/activities/index.d.ts +5 -0
- package/dist/activities/index.js +4 -0
- package/dist/activities/layout.d.ts +2 -0
- package/dist/activities/layout.js +103 -0
- package/dist/activities/types.d.ts +125 -0
- package/dist/activities/types.js +1 -0
- package/dist/activities/validate.d.ts +2 -0
- package/dist/activities/validate.js +326 -0
- package/dist/activity-card/__tests__/example.test.d.ts +1 -0
- package/dist/activity-card/__tests__/example.test.js +56 -0
- package/dist/activity-card/__tests__/layout.test.d.ts +1 -0
- package/dist/activity-card/__tests__/layout.test.js +57 -0
- package/dist/activity-card/__tests__/resolver.test.d.ts +1 -0
- package/dist/activity-card/__tests__/resolver.test.js +146 -0
- package/dist/activity-card/__tests__/validate.test.d.ts +1 -0
- package/dist/activity-card/__tests__/validate.test.js +116 -0
- package/dist/activity-card/index.d.ts +5 -0
- package/dist/activity-card/index.js +3 -0
- package/dist/activity-card/layout.d.ts +7 -0
- package/dist/activity-card/layout.js +167 -0
- package/dist/activity-card/resolver.d.ts +7 -0
- package/dist/activity-card/resolver.js +310 -0
- package/dist/activity-card/types.d.ts +175 -0
- package/dist/activity-card/types.js +20 -0
- package/dist/activity-card/validate.d.ts +3 -0
- package/dist/activity-card/validate.js +145 -0
- package/dist/actor/__tests__/validate.test.d.ts +1 -0
- package/dist/actor/__tests__/validate.test.js +57 -0
- package/dist/actor/index.d.ts +3 -0
- package/dist/actor/index.js +2 -0
- package/dist/actor/types.d.ts +20 -0
- package/dist/actor/types.js +4 -0
- package/dist/actor/validate.d.ts +2 -0
- package/dist/actor/validate.js +34 -0
- package/dist/applications/__tests__/validate.test.d.ts +1 -0
- package/dist/applications/__tests__/validate.test.js +223 -0
- package/dist/applications/index.d.ts +2 -0
- package/dist/applications/index.js +1 -0
- package/dist/applications/types.d.ts +39 -0
- package/dist/applications/types.js +1 -0
- package/dist/applications/validate.d.ts +3 -0
- package/dist/applications/validate.js +109 -0
- package/dist/assertion/__tests__/example.test.d.ts +1 -0
- package/dist/assertion/__tests__/example.test.js +32 -0
- package/dist/assertion/__tests__/validate.test.d.ts +1 -0
- package/dist/assertion/__tests__/validate.test.js +130 -0
- package/dist/assertion/index.d.ts +4 -0
- package/dist/assertion/index.js +2 -0
- package/dist/assertion/types.d.ts +43 -0
- package/dist/assertion/types.js +7 -0
- package/dist/assertion/validate.d.ts +9 -0
- package/dist/assertion/validate.js +137 -0
- package/dist/blocks/__tests__/layout.test.d.ts +1 -0
- package/dist/blocks/__tests__/layout.test.js +153 -0
- package/dist/blocks/__tests__/validate.test.d.ts +1 -0
- package/dist/blocks/__tests__/validate.test.js +235 -0
- package/dist/blocks/index.d.ts +4 -0
- package/dist/blocks/index.js +2 -0
- package/dist/blocks/layout.d.ts +4 -0
- package/dist/blocks/layout.js +145 -0
- package/dist/blocks/types.d.ts +56 -0
- package/dist/blocks/types.js +1 -0
- package/dist/blocks/validate.d.ts +9 -0
- package/dist/blocks/validate.js +186 -0
- package/dist/capability-map/__tests__/validate.test.d.ts +1 -0
- package/dist/capability-map/__tests__/validate.test.js +212 -0
- package/dist/capability-map/index.d.ts +2 -0
- package/dist/capability-map/index.js +1 -0
- package/dist/capability-map/types.d.ts +26 -0
- package/dist/capability-map/types.js +1 -0
- package/dist/capability-map/validate.d.ts +3 -0
- package/dist/capability-map/validate.js +103 -0
- package/dist/change/__tests__/validate.test.d.ts +1 -0
- package/dist/change/__tests__/validate.test.js +73 -0
- package/dist/change/index.d.ts +2 -0
- package/dist/change/index.js +1 -0
- package/dist/change/types.d.ts +17 -0
- package/dist/change/types.js +3 -0
- package/dist/change/validate.d.ts +2 -0
- package/dist/change/validate.js +57 -0
- package/dist/compliance/__tests__/classify.test.d.ts +1 -0
- package/dist/compliance/__tests__/classify.test.js +24 -0
- package/dist/compliance/__tests__/confidence.test.d.ts +1 -0
- package/dist/compliance/__tests__/confidence.test.js +78 -0
- package/dist/compliance/__tests__/coverage-metric.test.d.ts +1 -0
- package/dist/compliance/__tests__/coverage-metric.test.js +164 -0
- package/dist/compliance/__tests__/demo-scenario.test.d.ts +1 -0
- package/dist/compliance/__tests__/demo-scenario.test.js +226 -0
- package/dist/compliance/__tests__/example.test.d.ts +1 -0
- package/dist/compliance/__tests__/example.test.js +51 -0
- package/dist/compliance/__tests__/gap-report.test.d.ts +1 -0
- package/dist/compliance/__tests__/gap-report.test.js +113 -0
- package/dist/compliance/__tests__/html.test.d.ts +1 -0
- package/dist/compliance/__tests__/html.test.js +122 -0
- package/dist/compliance/__tests__/impact.test.d.ts +1 -0
- package/dist/compliance/__tests__/impact.test.js +410 -0
- package/dist/compliance/__tests__/markdown.test.d.ts +1 -0
- package/dist/compliance/__tests__/markdown.test.js +85 -0
- package/dist/compliance/__tests__/views.test.d.ts +1 -0
- package/dist/compliance/__tests__/views.test.js +59 -0
- package/dist/compliance/classify.d.ts +27 -0
- package/dist/compliance/classify.js +60 -0
- package/dist/compliance/confidence.d.ts +27 -0
- package/dist/compliance/confidence.js +43 -0
- package/dist/compliance/coverage-metric.d.ts +74 -0
- package/dist/compliance/coverage-metric.js +181 -0
- package/dist/compliance/gap-report.d.ts +20 -0
- package/dist/compliance/gap-report.js +64 -0
- package/dist/compliance/html.d.ts +22 -0
- package/dist/compliance/html.js +256 -0
- package/dist/compliance/impact.d.ts +251 -0
- package/dist/compliance/impact.js +464 -0
- package/dist/compliance/index.d.ts +16 -0
- package/dist/compliance/index.js +9 -0
- package/dist/compliance/markdown.d.ts +18 -0
- package/dist/compliance/markdown.js +129 -0
- package/dist/compliance/reverse-index.d.ts +8 -0
- package/dist/compliance/reverse-index.js +30 -0
- package/dist/compliance/types.d.ts +98 -0
- package/dist/compliance/types.js +5 -0
- package/dist/compliance/views.d.ts +14 -0
- package/dist/compliance/views.js +35 -0
- package/dist/compliance-matrix/__tests__/build.test.d.ts +1 -0
- package/dist/compliance-matrix/__tests__/build.test.js +183 -0
- package/dist/compliance-matrix/__tests__/example.test.d.ts +1 -0
- package/dist/compliance-matrix/__tests__/example.test.js +49 -0
- package/dist/compliance-matrix/build.d.ts +18 -0
- package/dist/compliance-matrix/build.js +0 -0
- package/dist/compliance-matrix/index.d.ts +2 -0
- package/dist/compliance-matrix/index.js +1 -0
- package/dist/compliance-matrix/types.d.ts +86 -0
- package/dist/compliance-matrix/types.js +8 -0
- package/dist/confidence/__tests__/score.test.d.ts +1 -0
- package/dist/confidence/__tests__/score.test.js +188 -0
- package/dist/confidence/index.d.ts +2 -0
- package/dist/confidence/index.js +1 -0
- package/dist/confidence/score.d.ts +62 -0
- package/dist/confidence/score.js +215 -0
- package/dist/confidence/types.d.ts +79 -0
- package/dist/confidence/types.js +6 -0
- package/dist/edge-path.d.ts +18 -0
- package/dist/edge-path.js +35 -0
- package/dist/element-envelope.d.ts +15 -0
- package/dist/element-envelope.js +55 -0
- package/dist/factor/__tests__/validate.test.d.ts +1 -0
- package/dist/factor/__tests__/validate.test.js +83 -0
- package/dist/factor/index.d.ts +3 -0
- package/dist/factor/index.js +2 -0
- package/dist/factor/types.d.ts +23 -0
- package/dist/factor/types.js +6 -0
- package/dist/factor/validate.d.ts +2 -0
- package/dist/factor/validate.js +69 -0
- package/dist/fgca/__tests__/chain-table.test.d.ts +1 -0
- package/dist/fgca/__tests__/chain-table.test.js +158 -0
- package/dist/fgca/__tests__/layout.test.d.ts +1 -0
- package/dist/fgca/__tests__/layout.test.js +140 -0
- package/dist/fgca/__tests__/parse-canonical.test.d.ts +1 -0
- package/dist/fgca/__tests__/parse-canonical.test.js +224 -0
- package/dist/fgca/__tests__/preview-layout.test.d.ts +1 -0
- package/dist/fgca/__tests__/preview-layout.test.js +106 -0
- package/dist/fgca/__tests__/validate.test.d.ts +1 -0
- package/dist/fgca/__tests__/validate.test.js +125 -0
- package/dist/fgca/chain-table.d.ts +36 -0
- package/dist/fgca/chain-table.js +177 -0
- package/dist/fgca/index.d.ts +16 -0
- package/dist/fgca/index.js +11 -0
- package/dist/fgca/layout.d.ts +27 -0
- package/dist/fgca/layout.js +156 -0
- package/dist/fgca/nodeTypes.d.ts +6 -0
- package/dist/fgca/nodeTypes.js +10 -0
- package/dist/fgca/nodes/FGCAActivityNode.d.ts +13 -0
- package/dist/fgca/nodes/FGCAActivityNode.js +35 -0
- package/dist/fgca/nodes/FGCAChangeNode.d.ts +12 -0
- package/dist/fgca/nodes/FGCAChangeNode.js +35 -0
- package/dist/fgca/nodes/FGCAFactorNode.d.ts +12 -0
- package/dist/fgca/nodes/FGCAFactorNode.js +35 -0
- package/dist/fgca/nodes/FGCAGoalNode.d.ts +14 -0
- package/dist/fgca/nodes/FGCAGoalNode.js +40 -0
- package/dist/fgca/parse-canonical.d.ts +58 -0
- package/dist/fgca/parse-canonical.js +339 -0
- package/dist/fgca/preview-layout.d.ts +87 -0
- package/dist/fgca/preview-layout.js +122 -0
- package/dist/fgca/types.d.ts +39 -0
- package/dist/fgca/types.js +7 -0
- package/dist/fgca/validate.d.ts +14 -0
- package/dist/fgca/validate.js +108 -0
- package/dist/geometry.d.ts +7 -0
- package/dist/geometry.js +2 -0
- package/dist/goals/__tests__/layout.test.d.ts +1 -0
- package/dist/goals/__tests__/layout.test.js +153 -0
- package/dist/goals/__tests__/mutations.test.d.ts +1 -0
- package/dist/goals/__tests__/mutations.test.js +95 -0
- package/dist/goals/__tests__/parse-canonical.test.d.ts +1 -0
- package/dist/goals/__tests__/parse-canonical.test.js +129 -0
- package/dist/goals/__tests__/validate.test.d.ts +1 -0
- package/dist/goals/__tests__/validate.test.js +183 -0
- package/dist/goals/index.d.ts +6 -0
- package/dist/goals/index.js +4 -0
- package/dist/goals/layout.d.ts +11 -0
- package/dist/goals/layout.js +147 -0
- package/dist/goals/mutations.d.ts +6 -0
- package/dist/goals/mutations.js +116 -0
- package/dist/goals/parse-canonical.d.ts +29 -0
- package/dist/goals/parse-canonical.js +257 -0
- package/dist/goals/types.d.ts +71 -0
- package/dist/goals/types.js +1 -0
- package/dist/goals/validate.d.ts +2 -0
- package/dist/goals/validate.js +122 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/issues/__tests__/layout.test.d.ts +1 -0
- package/dist/issues/__tests__/layout.test.js +62 -0
- package/dist/issues/__tests__/validate.test.d.ts +1 -0
- package/dist/issues/__tests__/validate.test.js +82 -0
- package/dist/issues/index.d.ts +4 -0
- package/dist/issues/index.js +2 -0
- package/dist/issues/layout.d.ts +10 -0
- package/dist/issues/layout.js +82 -0
- package/dist/issues/types.d.ts +61 -0
- package/dist/issues/types.js +6 -0
- package/dist/issues/validate.d.ts +3 -0
- package/dist/issues/validate.js +143 -0
- package/dist/process-blueprint/__tests__/compliance-lane.test.d.ts +1 -0
- package/dist/process-blueprint/__tests__/compliance-lane.test.js +272 -0
- package/dist/process-blueprint/__tests__/layout.test.d.ts +1 -0
- package/dist/process-blueprint/__tests__/layout.test.js +159 -0
- package/dist/process-blueprint/__tests__/validate.test.d.ts +1 -0
- package/dist/process-blueprint/__tests__/validate.test.js +280 -0
- package/dist/process-blueprint/index.d.ts +4 -0
- package/dist/process-blueprint/index.js +2 -0
- package/dist/process-blueprint/layout.d.ts +2 -0
- package/dist/process-blueprint/layout.js +416 -0
- package/dist/process-blueprint/types.d.ts +220 -0
- package/dist/process-blueprint/types.js +1 -0
- package/dist/process-blueprint/validate.d.ts +3 -0
- package/dist/process-blueprint/validate.js +165 -0
- package/dist/process-map/__tests__/validate.test.d.ts +1 -0
- package/dist/process-map/__tests__/validate.test.js +199 -0
- package/dist/process-map/index.d.ts +2 -0
- package/dist/process-map/index.js +1 -0
- package/dist/process-map/types.d.ts +32 -0
- package/dist/process-map/types.js +1 -0
- package/dist/process-map/validate.d.ts +3 -0
- package/dist/process-map/validate.js +115 -0
- package/dist/products/__tests__/validate.test.d.ts +1 -0
- package/dist/products/__tests__/validate.test.js +210 -0
- package/dist/products/index.d.ts +2 -0
- package/dist/products/index.js +1 -0
- package/dist/products/types.d.ts +28 -0
- package/dist/products/types.js +1 -0
- package/dist/products/validate.d.ts +3 -0
- package/dist/products/validate.js +93 -0
- package/dist/repo-validate/__tests__/validate-repo.test.d.ts +1 -0
- package/dist/repo-validate/__tests__/validate-repo.test.js +132 -0
- package/dist/repo-validate/index.d.ts +2 -0
- package/dist/repo-validate/index.js +1 -0
- package/dist/repo-validate/types.d.ts +34 -0
- package/dist/repo-validate/types.js +14 -0
- package/dist/repo-validate/validate-repo.d.ts +8 -0
- package/dist/repo-validate/validate-repo.js +189 -0
- package/dist/requirement/__tests__/example.test.d.ts +1 -0
- package/dist/requirement/__tests__/example.test.js +21 -0
- package/dist/requirement/__tests__/validate.test.d.ts +1 -0
- package/dist/requirement/__tests__/validate.test.js +80 -0
- package/dist/requirement/index.d.ts +4 -0
- package/dist/requirement/index.js +2 -0
- package/dist/requirement/types.d.ts +25 -0
- package/dist/requirement/types.js +4 -0
- package/dist/requirement/validate.d.ts +7 -0
- package/dist/requirement/validate.js +81 -0
- package/dist/scenarios/__tests__/validate.test.d.ts +1 -0
- package/dist/scenarios/__tests__/validate.test.js +183 -0
- package/dist/scenarios/index.d.ts +2 -0
- package/dist/scenarios/index.js +1 -0
- package/dist/scenarios/types.d.ts +45 -0
- package/dist/scenarios/types.js +1 -0
- package/dist/scenarios/validate.d.ts +3 -0
- package/dist/scenarios/validate.js +110 -0
- package/dist/schema-version.d.ts +16 -0
- package/dist/schema-version.js +16 -0
- package/dist/scope.d.ts +23 -0
- package/dist/scope.js +38 -0
- package/dist/stakeholder/__tests__/validate.test.d.ts +1 -0
- package/dist/stakeholder/__tests__/validate.test.js +86 -0
- package/dist/stakeholder/index.d.ts +3 -0
- package/dist/stakeholder/index.js +2 -0
- package/dist/stakeholder/types.d.ts +24 -0
- package/dist/stakeholder/types.js +5 -0
- package/dist/stakeholder/validate.d.ts +2 -0
- package/dist/stakeholder/validate.js +58 -0
- package/dist/target-state/__tests__/validate.test.d.ts +1 -0
- package/dist/target-state/__tests__/validate.test.js +62 -0
- package/dist/target-state/index.d.ts +2 -0
- package/dist/target-state/index.js +1 -0
- package/dist/target-state/types.d.ts +18 -0
- package/dist/target-state/types.js +7 -0
- package/dist/target-state/validate.d.ts +2 -0
- package/dist/target-state/validate.js +61 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/themes.d.ts +16 -0
- package/dist/theme/themes.js +213 -0
- package/dist/theme/tokens.d.ts +158 -0
- package/dist/theme/tokens.js +105 -0
- package/dist/typed-id.d.ts +20 -0
- package/dist/typed-id.js +38 -0
- package/dist/validation-types.d.ts +34 -0
- package/dist/validation-types.js +1 -0
- package/dist/webview/__tests__/entry-notations.test.d.ts +1 -0
- package/dist/webview/__tests__/entry-notations.test.js +62 -0
- package/dist/webview/__tests__/entry.test.d.ts +1 -0
- package/dist/webview/__tests__/entry.test.js +56 -0
- package/dist/webview/__tests__/render-goals.test.d.ts +1 -0
- package/dist/webview/__tests__/render-goals.test.js +65 -0
- package/dist/webview/entry.d.ts +38 -0
- package/dist/webview/entry.js +182 -0
- package/dist/webview/render-activities.d.ts +24 -0
- package/dist/webview/render-activities.js +127 -0
- package/dist/webview/render-activity-card.d.ts +5 -0
- package/dist/webview/render-activity-card.js +168 -0
- package/dist/webview/render-applications.d.ts +11 -0
- package/dist/webview/render-applications.js +105 -0
- package/dist/webview/render-blocks.d.ts +5 -0
- package/dist/webview/render-blocks.js +71 -0
- package/dist/webview/render-capability-map.d.ts +7 -0
- package/dist/webview/render-capability-map.js +88 -0
- package/dist/webview/render-fgca.d.ts +8 -0
- package/dist/webview/render-fgca.js +94 -0
- package/dist/webview/render-goals.d.ts +6 -0
- package/dist/webview/render-goals.js +92 -0
- package/dist/webview/render-process-blueprint.d.ts +5 -0
- package/dist/webview/render-process-blueprint.js +135 -0
- package/dist/webview/render-process-map.d.ts +7 -0
- package/dist/webview/render-process-map.js +82 -0
- package/dist/webview/render-products.d.ts +7 -0
- package/dist/webview/render-products.js +81 -0
- package/dist/webview/render-scenarios.d.ts +7 -0
- package/dist/webview/render-scenarios.js +75 -0
- package/dist/webview/render-util.d.ts +16 -0
- package/dist/webview/render-util.js +31 -0
- package/dist/webview/transitrix-render.css +323 -0
- package/dist/webview/transitrix-render.js +6452 -0
- package/dist/webview/transitrix-render.js.map +7 -0
- package/dist/yaml-normalize.d.ts +20 -0
- package/dist/yaml-normalize.js +57 -0
- package/package.json +40 -0
- package/src/__tests__/edge-path.test.ts +46 -0
- package/src/__tests__/scope.test.ts +27 -0
- package/src/__tests__/yaml-normalize.test.ts +158 -0
- package/src/activities/__tests__/cpm.test.ts +164 -0
- package/src/activities/__tests__/gantt.test.ts +245 -0
- package/src/activities/__tests__/layout.test.ts +112 -0
- package/src/activities/__tests__/validate.test.ts +409 -0
- package/src/activities/cpm.ts +95 -0
- package/src/activities/gantt.ts +276 -0
- package/src/activities/index.ts +28 -0
- package/src/activities/layout.ts +112 -0
- package/src/activities/types.ts +148 -0
- package/src/activities/validate.ts +357 -0
- package/src/activity-card/__tests__/example.test.ts +66 -0
- package/src/activity-card/__tests__/layout.test.ts +63 -0
- package/src/activity-card/__tests__/resolver.test.ts +161 -0
- package/src/activity-card/__tests__/validate.test.ts +131 -0
- package/src/activity-card/index.ts +32 -0
- package/src/activity-card/layout.ts +194 -0
- package/src/activity-card/resolver.ts +337 -0
- package/src/activity-card/types.ts +237 -0
- package/src/activity-card/validate.ts +158 -0
- package/src/actor/__tests__/validate.test.ts +67 -0
- package/src/actor/index.ts +3 -0
- package/src/actor/types.ts +29 -0
- package/src/actor/validate.ts +38 -0
- package/src/applications/__tests__/validate.test.ts +256 -0
- package/src/applications/index.ts +11 -0
- package/src/applications/types.ts +43 -0
- package/src/applications/validate.ts +131 -0
- package/src/assertion/__tests__/example.test.ts +37 -0
- package/src/assertion/__tests__/validate.test.ts +142 -0
- package/src/assertion/index.ts +12 -0
- package/src/assertion/types.ts +58 -0
- package/src/assertion/validate.ts +145 -0
- package/src/blocks/__tests__/layout.test.ts +169 -0
- package/src/blocks/__tests__/validate.test.ts +260 -0
- package/src/blocks/index.ts +17 -0
- package/src/blocks/layout.ts +186 -0
- package/src/blocks/types.ts +62 -0
- package/src/blocks/validate.ts +206 -0
- package/src/capability-map/__tests__/validate.test.ts +238 -0
- package/src/capability-map/index.ts +8 -0
- package/src/capability-map/types.ts +29 -0
- package/src/capability-map/validate.ts +127 -0
- package/src/change/__tests__/validate.test.ts +88 -0
- package/src/change/index.ts +2 -0
- package/src/change/types.ts +23 -0
- package/src/change/validate.ts +61 -0
- package/src/compliance/__tests__/classify.test.ts +27 -0
- package/src/compliance/__tests__/confidence.test.ts +98 -0
- package/src/compliance/__tests__/coverage-metric.test.ts +188 -0
- package/src/compliance/__tests__/demo-scenario.test.ts +273 -0
- package/src/compliance/__tests__/example.test.ts +57 -0
- package/src/compliance/__tests__/gap-report.test.ts +129 -0
- package/src/compliance/__tests__/html.test.ts +142 -0
- package/src/compliance/__tests__/impact.test.ts +482 -0
- package/src/compliance/__tests__/markdown.test.ts +95 -0
- package/src/compliance/__tests__/views.test.ts +64 -0
- package/src/compliance/classify.ts +84 -0
- package/src/compliance/confidence.ts +69 -0
- package/src/compliance/coverage-metric.ts +263 -0
- package/src/compliance/gap-report.ts +94 -0
- package/src/compliance/html.ts +295 -0
- package/src/compliance/impact.ts +677 -0
- package/src/compliance/index.ts +56 -0
- package/src/compliance/markdown.ts +135 -0
- package/src/compliance/reverse-index.ts +33 -0
- package/src/compliance/types.ts +120 -0
- package/src/compliance/views.ts +46 -0
- package/src/compliance-matrix/__tests__/build.test.ts +200 -0
- package/src/compliance-matrix/__tests__/example.test.ts +57 -0
- package/src/compliance-matrix/build.ts +0 -0
- package/src/compliance-matrix/index.ts +11 -0
- package/src/compliance-matrix/types.ts +102 -0
- package/src/confidence/__tests__/score.test.ts +254 -0
- package/src/confidence/index.ts +21 -0
- package/src/confidence/score.ts +243 -0
- package/src/confidence/types.ts +96 -0
- package/src/edge-path.ts +44 -0
- package/src/element-envelope.ts +76 -0
- package/src/factor/__tests__/validate.test.ts +98 -0
- package/src/factor/index.ts +8 -0
- package/src/factor/types.ts +41 -0
- package/src/factor/validate.ts +74 -0
- package/src/fgca/__tests__/chain-table.test.ts +172 -0
- package/src/fgca/__tests__/layout.test.ts +179 -0
- package/src/fgca/__tests__/parse-canonical.test.ts +248 -0
- package/src/fgca/__tests__/preview-layout.test.ts +124 -0
- package/src/fgca/__tests__/validate.test.ts +142 -0
- package/src/fgca/chain-table.ts +225 -0
- package/src/fgca/index.ts +45 -0
- package/src/fgca/layout.ts +204 -0
- package/src/fgca/nodeTypes.ts +11 -0
- package/src/fgca/nodes/FGCAActivityNode.tsx +65 -0
- package/src/fgca/nodes/FGCAChangeNode.tsx +64 -0
- package/src/fgca/nodes/FGCAFactorNode.tsx +64 -0
- package/src/fgca/nodes/FGCAGoalNode.tsx +72 -0
- package/src/fgca/parse-canonical.ts +400 -0
- package/src/fgca/preview-layout.ts +217 -0
- package/src/fgca/types.ts +50 -0
- package/src/fgca/validate.ts +126 -0
- package/src/geometry.ts +9 -0
- package/src/goals/__tests__/layout.test.ts +175 -0
- package/src/goals/__tests__/mutations.test.ts +111 -0
- package/src/goals/__tests__/parse-canonical.test.ts +145 -0
- package/src/goals/__tests__/validate.test.ts +202 -0
- package/src/goals/index.ts +21 -0
- package/src/goals/layout.ts +172 -0
- package/src/goals/mutations.ts +123 -0
- package/src/goals/parse-canonical.ts +286 -0
- package/src/goals/types.ts +85 -0
- package/src/goals/validate.ts +136 -0
- package/src/index.ts +23 -0
- package/src/process-blueprint/__tests__/compliance-lane.test.ts +320 -0
- package/src/process-blueprint/__tests__/layout.test.ts +195 -0
- package/src/process-blueprint/__tests__/validate.test.ts +310 -0
- package/src/process-blueprint/index.ts +31 -0
- package/src/process-blueprint/layout.ts +531 -0
- package/src/process-blueprint/types.ts +242 -0
- package/src/process-blueprint/validate.ts +181 -0
- package/src/process-map/__tests__/validate.test.ts +223 -0
- package/src/process-map/index.ts +10 -0
- package/src/process-map/types.ts +36 -0
- package/src/process-map/validate.ts +135 -0
- package/src/products/__tests__/validate.test.ts +239 -0
- package/src/products/index.ts +9 -0
- package/src/products/types.ts +31 -0
- package/src/products/validate.ts +112 -0
- package/src/repo-validate/__tests__/validate-repo.test.ts +149 -0
- package/src/repo-validate/index.ts +2 -0
- package/src/repo-validate/types.ts +50 -0
- package/src/repo-validate/validate-repo.ts +196 -0
- package/src/requirement/__tests__/example.test.ts +24 -0
- package/src/requirement/__tests__/validate.test.ts +96 -0
- package/src/requirement/index.ts +4 -0
- package/src/requirement/types.ts +35 -0
- package/src/requirement/validate.ts +92 -0
- package/src/scenarios/__tests__/validate.test.ts +209 -0
- package/src/scenarios/index.ts +15 -0
- package/src/scenarios/types.ts +37 -0
- package/src/scenarios/validate.ts +122 -0
- package/src/schema-version.ts +16 -0
- package/src/scope.ts +46 -0
- package/src/stakeholder/__tests__/validate.test.ts +101 -0
- package/src/stakeholder/index.ts +3 -0
- package/src/stakeholder/types.ts +33 -0
- package/src/stakeholder/validate.ts +63 -0
- package/src/target-state/__tests__/validate.test.ts +74 -0
- package/src/target-state/index.ts +2 -0
- package/src/target-state/types.ts +28 -0
- package/src/target-state/validate.ts +67 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/themes.ts +237 -0
- package/src/theme/tokens.ts +133 -0
- package/src/typed-id.ts +56 -0
- package/src/validation-types.ts +36 -0
- package/src/webview/__tests__/entry-notations.test.ts +77 -0
- package/src/webview/__tests__/entry.test.ts +64 -0
- package/src/webview/__tests__/render-goals.test.ts +72 -0
- package/src/webview/entry.ts +292 -0
- package/src/webview/render-activities.ts +156 -0
- package/src/webview/render-activity-card.ts +234 -0
- package/src/webview/render-applications.ts +123 -0
- package/src/webview/render-blocks.ts +91 -0
- package/src/webview/render-capability-map.ts +98 -0
- package/src/webview/render-fgca.ts +122 -0
- package/src/webview/render-goals.ts +110 -0
- package/src/webview/render-process-blueprint.ts +207 -0
- package/src/webview/render-process-map.ts +93 -0
- package/src/webview/render-products.ts +91 -0
- package/src/webview/render-scenarios.ts +90 -0
- package/src/webview/render-util.ts +34 -0
- package/src/webview/styles.css +323 -0
- package/src/yaml-normalize.ts +56 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { layoutProcessBlueprint } from '../layout.js';
|
|
3
|
+
function build(file) {
|
|
4
|
+
return {
|
|
5
|
+
notation: 'process-blueprint',
|
|
6
|
+
process_blueprint: {
|
|
7
|
+
id: 'PROCESS_BLUEPRINT-T-1',
|
|
8
|
+
name: 'Test',
|
|
9
|
+
stages: [],
|
|
10
|
+
...file,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
describe('layoutProcessBlueprint', () => {
|
|
15
|
+
it('lays out stage headers in input order across the legend offset', () => {
|
|
16
|
+
const layout = layoutProcessBlueprint(build({
|
|
17
|
+
stages: [
|
|
18
|
+
{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' },
|
|
19
|
+
{ id: 'STAGE-2', name: 'B', goal: 'g', result: 'r' },
|
|
20
|
+
{ id: 'STAGE-3', name: 'C', goal: 'g', result: 'r' },
|
|
21
|
+
],
|
|
22
|
+
}));
|
|
23
|
+
expect(layout.stageHeaders).toHaveLength(3);
|
|
24
|
+
expect(layout.stageHeaders[0].x).toBe(layout.legendColumnWidth);
|
|
25
|
+
expect(layout.stageHeaders[1].x).toBe(layout.legendColumnWidth + layout.stageColumnWidth);
|
|
26
|
+
expect(layout.stageHeaders[2].x).toBe(layout.legendColumnWidth + 2 * layout.stageColumnWidth);
|
|
27
|
+
expect(layout.stageHeaders[0].name).toBe('A');
|
|
28
|
+
});
|
|
29
|
+
it('produces goal and result cells aligned under each stage column', () => {
|
|
30
|
+
const layout = layoutProcessBlueprint(build({
|
|
31
|
+
stages: [
|
|
32
|
+
{ id: 'STAGE-1', name: 'A', goal: 'gA', result: 'rA' },
|
|
33
|
+
{ id: 'STAGE-2', name: 'B', goal: 'gB', result: 'rB' },
|
|
34
|
+
],
|
|
35
|
+
}));
|
|
36
|
+
expect(layout.goalCells.map(c => c.text)).toEqual(['gA', 'gB']);
|
|
37
|
+
expect(layout.resultCells.map(c => c.text)).toEqual(['rA', 'rB']);
|
|
38
|
+
expect(layout.goalCells[0].y).toBeLessThan(layout.resultCells[0].y);
|
|
39
|
+
expect(layout.goalCells[0].x).toBe(layout.stageHeaders[0].x);
|
|
40
|
+
});
|
|
41
|
+
it('omits aspect rows for categories without any entries', () => {
|
|
42
|
+
const layout = layoutProcessBlueprint(build({
|
|
43
|
+
stages: [{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' }],
|
|
44
|
+
}));
|
|
45
|
+
expect(layout.aspectRows).toHaveLength(0);
|
|
46
|
+
});
|
|
47
|
+
it('merges consecutive stages into a single spanning pill', () => {
|
|
48
|
+
const layout = layoutProcessBlueprint(build({
|
|
49
|
+
stages: [
|
|
50
|
+
{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' },
|
|
51
|
+
{ id: 'STAGE-2', name: 'B', goal: 'g', result: 'r' },
|
|
52
|
+
{ id: 'STAGE-3', name: 'C', goal: 'g', result: 'r' },
|
|
53
|
+
],
|
|
54
|
+
systems: [
|
|
55
|
+
{ id: 'APPLICATION-OMS-1', name: 'OMS', stages: ['STAGE-1', 'STAGE-2', 'STAGE-3'] },
|
|
56
|
+
],
|
|
57
|
+
}));
|
|
58
|
+
expect(layout.aspectRows).toHaveLength(1);
|
|
59
|
+
const row = layout.aspectRows[0];
|
|
60
|
+
expect(row.category).toBe('systems');
|
|
61
|
+
expect(row.pills).toHaveLength(1);
|
|
62
|
+
expect(row.pills[0].startStageIndex).toBe(0);
|
|
63
|
+
expect(row.pills[0].endStageIndex).toBe(2);
|
|
64
|
+
expect(row.pills[0].width).toBeGreaterThan(layout.stageColumnWidth);
|
|
65
|
+
});
|
|
66
|
+
it('splits non-consecutive stages into separate pills', () => {
|
|
67
|
+
const layout = layoutProcessBlueprint(build({
|
|
68
|
+
stages: [
|
|
69
|
+
{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' },
|
|
70
|
+
{ id: 'STAGE-2', name: 'B', goal: 'g', result: 'r' },
|
|
71
|
+
{ id: 'STAGE-3', name: 'C', goal: 'g', result: 'r' },
|
|
72
|
+
{ id: 'STAGE-4', name: 'D', goal: 'g', result: 'r' },
|
|
73
|
+
],
|
|
74
|
+
systems: [
|
|
75
|
+
{ id: 'APPLICATION-X-1', name: 'X', stages: ['STAGE-1', 'STAGE-3', 'STAGE-4'] },
|
|
76
|
+
],
|
|
77
|
+
}));
|
|
78
|
+
const pills = layout.aspectRows[0].pills;
|
|
79
|
+
expect(pills).toHaveLength(2);
|
|
80
|
+
expect(pills[0].startStageIndex).toBe(0);
|
|
81
|
+
expect(pills[0].endStageIndex).toBe(0);
|
|
82
|
+
expect(pills[1].startStageIndex).toBe(2);
|
|
83
|
+
expect(pills[1].endStageIndex).toBe(3);
|
|
84
|
+
});
|
|
85
|
+
it('stacks overlapping pills into vertical slots inside the same row', () => {
|
|
86
|
+
const layout = layoutProcessBlueprint(build({
|
|
87
|
+
stages: [
|
|
88
|
+
{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' },
|
|
89
|
+
{ id: 'STAGE-2', name: 'B', goal: 'g', result: 'r' },
|
|
90
|
+
],
|
|
91
|
+
systems: [
|
|
92
|
+
{ id: 'APPLICATION-A-1', name: 'A', stages: ['STAGE-1', 'STAGE-2'] },
|
|
93
|
+
{ id: 'APPLICATION-B-1', name: 'B', stages: ['STAGE-1'] },
|
|
94
|
+
],
|
|
95
|
+
}));
|
|
96
|
+
const row = layout.aspectRows[0];
|
|
97
|
+
expect(row.pills).toHaveLength(2);
|
|
98
|
+
// The two pills overlap at STAGE-1, so they should sit at different y.
|
|
99
|
+
expect(row.pills[0].y).not.toBe(row.pills[1].y);
|
|
100
|
+
// Row height must be tall enough for two stacked pills.
|
|
101
|
+
expect(row.height).toBeGreaterThan(row.pills[0].height);
|
|
102
|
+
});
|
|
103
|
+
it('preserves the fixed category order: systems, actors, equipment, information_entities', () => {
|
|
104
|
+
const layout = layoutProcessBlueprint(build({
|
|
105
|
+
stages: [{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' }],
|
|
106
|
+
information_entities: [{ name: 'Doc', stages: ['STAGE-1'] }],
|
|
107
|
+
actors: [{ id: 'ROLE-X-1', name: 'X', stages: ['STAGE-1'] }],
|
|
108
|
+
systems: [{ id: 'APPLICATION-X-1', name: 'X', stages: ['STAGE-1'] }],
|
|
109
|
+
equipment: [{ name: 'Scanner', stages: ['STAGE-1'] }],
|
|
110
|
+
}));
|
|
111
|
+
expect(layout.aspectRows.map(r => r.category)).toEqual([
|
|
112
|
+
'systems',
|
|
113
|
+
'actors',
|
|
114
|
+
'equipment',
|
|
115
|
+
'information_entities',
|
|
116
|
+
]);
|
|
117
|
+
});
|
|
118
|
+
it('builds the legend in row order: goal, result, then aspect categories', () => {
|
|
119
|
+
const layout = layoutProcessBlueprint(build({
|
|
120
|
+
stages: [{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' }],
|
|
121
|
+
systems: [{ id: 'APPLICATION-X-1', name: 'X', stages: ['STAGE-1'] }],
|
|
122
|
+
}));
|
|
123
|
+
expect(layout.legend.map(l => l.kind)).toEqual(['goal', 'result', 'aspect']);
|
|
124
|
+
expect(layout.legend[2].category).toBe('systems');
|
|
125
|
+
});
|
|
126
|
+
it('total bounds cover the legend column plus every stage column', () => {
|
|
127
|
+
const layout = layoutProcessBlueprint(build({
|
|
128
|
+
stages: [
|
|
129
|
+
{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' },
|
|
130
|
+
{ id: 'STAGE-2', name: 'B', goal: 'g', result: 'r' },
|
|
131
|
+
],
|
|
132
|
+
}));
|
|
133
|
+
expect(layout.bounds.width).toBe(layout.legendColumnWidth + 2 * layout.stageColumnWidth);
|
|
134
|
+
expect(layout.bounds.height).toBeGreaterThan(0);
|
|
135
|
+
});
|
|
136
|
+
it('ignores aspect entries that reference undeclared stages', () => {
|
|
137
|
+
const layout = layoutProcessBlueprint(build({
|
|
138
|
+
stages: [{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' }],
|
|
139
|
+
systems: [
|
|
140
|
+
{ id: 'APPLICATION-X-1', name: 'X', stages: ['STAGE-1', 'STAGE-999'] },
|
|
141
|
+
],
|
|
142
|
+
}));
|
|
143
|
+
const pills = layout.aspectRows[0].pills;
|
|
144
|
+
expect(pills).toHaveLength(1);
|
|
145
|
+
expect(pills[0].startStageIndex).toBe(0);
|
|
146
|
+
expect(pills[0].endStageIndex).toBe(0);
|
|
147
|
+
});
|
|
148
|
+
it('honours overridden LayoutOptions', () => {
|
|
149
|
+
const layout = layoutProcessBlueprint(build({
|
|
150
|
+
stages: [
|
|
151
|
+
{ id: 'STAGE-1', name: 'A', goal: 'g', result: 'r' },
|
|
152
|
+
{ id: 'STAGE-2', name: 'B', goal: 'g', result: 'r' },
|
|
153
|
+
],
|
|
154
|
+
}), { legendColumnWidth: 200, stageColumnWidth: 300 });
|
|
155
|
+
expect(layout.legendColumnWidth).toBe(200);
|
|
156
|
+
expect(layout.stageColumnWidth).toBe(300);
|
|
157
|
+
expect(layout.stageHeaders[1].x).toBe(200 + 300);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import yaml from 'js-yaml';
|
|
5
|
+
import { validateProcessBlueprint } from '../validate.js';
|
|
6
|
+
const EXAMPLES_DIR = path.resolve(process.cwd(), '..', '..', 'tests', 'fixtures', 'notation-corpus', 'process-blueprint');
|
|
7
|
+
const VALID_BLUEPRINT = {
|
|
8
|
+
notation: 'process-blueprint',
|
|
9
|
+
spec_version: '0.1',
|
|
10
|
+
process_blueprint: {
|
|
11
|
+
id: 'PROCESS_BLUEPRINT-FULFIL-1',
|
|
12
|
+
name: 'Order fulfilment blueprint',
|
|
13
|
+
stages: [
|
|
14
|
+
{ id: 'STAGE-1', name: 'Receive', goal: 'Capture order', result: 'Validated order' },
|
|
15
|
+
{ id: 'STAGE-2', name: 'Pack', goal: 'Assemble', result: 'Packed shipment' },
|
|
16
|
+
{ id: 'STAGE-3', name: 'Ship', goal: 'Hand to carrier', result: 'In transit' },
|
|
17
|
+
],
|
|
18
|
+
systems: [
|
|
19
|
+
{ id: 'APPLICATION-OMS-1', name: 'OMS', stages: ['STAGE-1', 'STAGE-2', 'STAGE-3'] },
|
|
20
|
+
],
|
|
21
|
+
actors: [
|
|
22
|
+
{ id: 'ROLE-WAREHOUSE-1', name: 'Warehouse op', stages: ['STAGE-2', 'STAGE-3'] },
|
|
23
|
+
],
|
|
24
|
+
equipment: [
|
|
25
|
+
{ name: 'Barcode scanner', stages: ['STAGE-2', 'STAGE-3'] },
|
|
26
|
+
],
|
|
27
|
+
information_entities: [
|
|
28
|
+
{ name: 'Customer order', stages: ['STAGE-1', 'STAGE-2', 'STAGE-3'] },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
describe('validateProcessBlueprint', () => {
|
|
33
|
+
it('passes on a valid blueprint', () => {
|
|
34
|
+
const r = validateProcessBlueprint(VALID_BLUEPRINT);
|
|
35
|
+
expect(r.valid).toBe(true);
|
|
36
|
+
expect(r.errors).toHaveLength(0);
|
|
37
|
+
});
|
|
38
|
+
it('BP-001: rejects non-object input', () => {
|
|
39
|
+
expect(validateProcessBlueprint(null).valid).toBe(false);
|
|
40
|
+
expect(validateProcessBlueprint(null).errors[0].code).toBe('BP-001');
|
|
41
|
+
expect(validateProcessBlueprint('string').errors[0].code).toBe('BP-001');
|
|
42
|
+
});
|
|
43
|
+
it('BP-001: rejects missing process_blueprint root key', () => {
|
|
44
|
+
const r = validateProcessBlueprint({ notation: 'process-blueprint' });
|
|
45
|
+
expect(r.errors.some(e => e.code === 'BP-001')).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('BP-001: rejects wrong notation value', () => {
|
|
48
|
+
const r = validateProcessBlueprint({ ...VALID_BLUEPRINT, notation: 'goals' });
|
|
49
|
+
expect(r.errors.some(e => e.code === 'BP-001')).toBe(true);
|
|
50
|
+
});
|
|
51
|
+
it('BP-001: tolerates a missing notation field (header check is contract-level)', () => {
|
|
52
|
+
const { notation: _, ...rest } = VALID_BLUEPRINT;
|
|
53
|
+
const r = validateProcessBlueprint(rest);
|
|
54
|
+
expect(r.errors.some(e => e.code === 'BP-001')).toBe(false);
|
|
55
|
+
});
|
|
56
|
+
it('BP-002: rejects missing id', () => {
|
|
57
|
+
const r = validateProcessBlueprint({
|
|
58
|
+
...VALID_BLUEPRINT,
|
|
59
|
+
process_blueprint: { ...VALID_BLUEPRINT.process_blueprint, id: '' },
|
|
60
|
+
});
|
|
61
|
+
expect(r.errors.some(e => e.code === 'BP-002')).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
it('BP-002: rejects id that does not match PROCESS_BLUEPRINT grammar', () => {
|
|
64
|
+
const r = validateProcessBlueprint({
|
|
65
|
+
...VALID_BLUEPRINT,
|
|
66
|
+
process_blueprint: { ...VALID_BLUEPRINT.process_blueprint, id: 'PB-1' },
|
|
67
|
+
});
|
|
68
|
+
expect(r.errors.some(e => e.code === 'BP-002')).toBe(true);
|
|
69
|
+
});
|
|
70
|
+
it('BP-003: rejects missing name', () => {
|
|
71
|
+
const r = validateProcessBlueprint({
|
|
72
|
+
...VALID_BLUEPRINT,
|
|
73
|
+
process_blueprint: { ...VALID_BLUEPRINT.process_blueprint, name: '' },
|
|
74
|
+
});
|
|
75
|
+
expect(r.errors.some(e => e.code === 'BP-003')).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
it('BP-004: rejects missing stages', () => {
|
|
78
|
+
const { stages: _, ...rest } = VALID_BLUEPRINT.process_blueprint;
|
|
79
|
+
const r = validateProcessBlueprint({ ...VALID_BLUEPRINT, process_blueprint: rest });
|
|
80
|
+
expect(r.errors.some(e => e.code === 'BP-004')).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
it('BP-004: rejects empty stages array', () => {
|
|
83
|
+
const r = validateProcessBlueprint({
|
|
84
|
+
...VALID_BLUEPRINT,
|
|
85
|
+
process_blueprint: { ...VALID_BLUEPRINT.process_blueprint, stages: [] },
|
|
86
|
+
});
|
|
87
|
+
expect(r.errors.some(e => e.code === 'BP-004')).toBe(true);
|
|
88
|
+
});
|
|
89
|
+
it('BP-005: rejects stage missing goal', () => {
|
|
90
|
+
const r = validateProcessBlueprint({
|
|
91
|
+
...VALID_BLUEPRINT,
|
|
92
|
+
process_blueprint: {
|
|
93
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
94
|
+
stages: [{ id: 'STAGE-1', name: 'X', goal: '', result: 'R' }],
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
expect(r.errors.some(e => e.code === 'BP-005' && /goal/.test(e.message))).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
it('BP-005: rejects stage missing result', () => {
|
|
100
|
+
const r = validateProcessBlueprint({
|
|
101
|
+
...VALID_BLUEPRINT,
|
|
102
|
+
process_blueprint: {
|
|
103
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
104
|
+
stages: [{ id: 'STAGE-1', name: 'X', goal: 'G', result: '' }],
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
expect(r.errors.some(e => e.code === 'BP-005' && /result/.test(e.message))).toBe(true);
|
|
108
|
+
});
|
|
109
|
+
it('BP-006: rejects duplicate stage ids', () => {
|
|
110
|
+
const r = validateProcessBlueprint({
|
|
111
|
+
...VALID_BLUEPRINT,
|
|
112
|
+
process_blueprint: {
|
|
113
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
114
|
+
stages: [
|
|
115
|
+
{ id: 'STAGE-1', name: 'A', goal: 'G', result: 'R' },
|
|
116
|
+
{ id: 'STAGE-1', name: 'B', goal: 'G', result: 'R' },
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
expect(r.errors.some(e => e.code === 'BP-006' && /Duplicate/.test(e.message))).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
it('BP-006: treats ids that differ only in surrounding whitespace as duplicates', () => {
|
|
123
|
+
const r = validateProcessBlueprint({
|
|
124
|
+
...VALID_BLUEPRINT,
|
|
125
|
+
process_blueprint: {
|
|
126
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
127
|
+
stages: [
|
|
128
|
+
{ id: 'STAGE-1', name: 'A', goal: 'G', result: 'R' },
|
|
129
|
+
{ id: 'STAGE-1 ', name: 'B', goal: 'G', result: 'R' },
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
expect(r.errors.some(e => e.code === 'BP-006' && /Duplicate/.test(e.message))).toBe(true);
|
|
134
|
+
});
|
|
135
|
+
it('BP-008: tolerates whitespace around aspect stage refs (matches trimmed stage ids)', () => {
|
|
136
|
+
const r = validateProcessBlueprint({
|
|
137
|
+
...VALID_BLUEPRINT,
|
|
138
|
+
process_blueprint: {
|
|
139
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
140
|
+
stages: [{ id: 'STAGE-1', name: 'A', goal: 'G', result: 'R' }],
|
|
141
|
+
systems: [{ id: 'APPLICATION-X-1', name: 'X', stages: [' STAGE-1 '] }],
|
|
142
|
+
actors: undefined,
|
|
143
|
+
equipment: undefined,
|
|
144
|
+
information_entities: undefined,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
expect(r.errors.some(e => e.code === 'BP-008')).toBe(false);
|
|
148
|
+
});
|
|
149
|
+
it('BP-006: rejects stage id that does not match STAGE grammar', () => {
|
|
150
|
+
const r = validateProcessBlueprint({
|
|
151
|
+
...VALID_BLUEPRINT,
|
|
152
|
+
process_blueprint: {
|
|
153
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
154
|
+
stages: [{ id: 'STG-1', name: 'A', goal: 'G', result: 'R' }],
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
expect(r.errors.some(e => e.code === 'BP-006')).toBe(true);
|
|
158
|
+
});
|
|
159
|
+
it('BP-007: rejects aspect entry missing name', () => {
|
|
160
|
+
const r = validateProcessBlueprint({
|
|
161
|
+
...VALID_BLUEPRINT,
|
|
162
|
+
process_blueprint: {
|
|
163
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
164
|
+
systems: [{ name: '', stages: ['STAGE-1'] }],
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
expect(r.errors.some(e => e.code === 'BP-007' && /name/.test(e.message))).toBe(true);
|
|
168
|
+
});
|
|
169
|
+
it('BP-007: rejects aspect entry with empty stages array', () => {
|
|
170
|
+
const r = validateProcessBlueprint({
|
|
171
|
+
...VALID_BLUEPRINT,
|
|
172
|
+
process_blueprint: {
|
|
173
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
174
|
+
systems: [{ name: 'X', stages: [] }],
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
expect(r.errors.some(e => e.code === 'BP-007' && /stages/.test(e.message))).toBe(true);
|
|
178
|
+
});
|
|
179
|
+
it('BP-008: rejects aspect entry referencing undeclared stage', () => {
|
|
180
|
+
const r = validateProcessBlueprint({
|
|
181
|
+
...VALID_BLUEPRINT,
|
|
182
|
+
process_blueprint: {
|
|
183
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
184
|
+
systems: [{ name: 'X', stages: ['STAGE-1', 'STAGE-999'] }],
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
expect(r.errors.some(e => e.code === 'BP-008')).toBe(true);
|
|
188
|
+
});
|
|
189
|
+
it('BP-009: rejects aspect entry id that does not match canonical grammar', () => {
|
|
190
|
+
const r = validateProcessBlueprint({
|
|
191
|
+
...VALID_BLUEPRINT,
|
|
192
|
+
process_blueprint: {
|
|
193
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
194
|
+
equipment: [{ id: 'lowercase-1', name: 'X', stages: ['STAGE-1'] }],
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
expect(r.errors.some(e => e.code === 'BP-009')).toBe(true);
|
|
198
|
+
});
|
|
199
|
+
it('BP-009: accepts an id for equipment as long as it matches general grammar', () => {
|
|
200
|
+
const r = validateProcessBlueprint({
|
|
201
|
+
...VALID_BLUEPRINT,
|
|
202
|
+
process_blueprint: {
|
|
203
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
204
|
+
equipment: [{ id: 'EQUIPMENT-SCANNER-1', name: 'Barcode scanner', stages: ['STAGE-2'] }],
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
expect(r.errors.some(e => e.code === 'BP-009')).toBe(false);
|
|
208
|
+
expect(r.errors.some(e => e.code === 'BP-010')).toBe(false);
|
|
209
|
+
});
|
|
210
|
+
it('BP-010: rejects systems entry id without APPLICATION- prefix', () => {
|
|
211
|
+
const r = validateProcessBlueprint({
|
|
212
|
+
...VALID_BLUEPRINT,
|
|
213
|
+
process_blueprint: {
|
|
214
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
215
|
+
systems: [{ id: 'SERVICE-OMS-1', name: 'OMS', stages: ['STAGE-1'] }],
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
expect(r.errors.some(e => e.code === 'BP-010')).toBe(true);
|
|
219
|
+
});
|
|
220
|
+
it('BP-010: rejects actors entry id without ROLE- prefix', () => {
|
|
221
|
+
const r = validateProcessBlueprint({
|
|
222
|
+
...VALID_BLUEPRINT,
|
|
223
|
+
process_blueprint: {
|
|
224
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
225
|
+
actors: [{ id: 'PERSON-1', name: 'X', stages: ['STAGE-1'] }],
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
expect(r.errors.some(e => e.code === 'BP-010')).toBe(true);
|
|
229
|
+
});
|
|
230
|
+
it('BP-010: accepts free-form aspect entries without id', () => {
|
|
231
|
+
const r = validateProcessBlueprint({
|
|
232
|
+
...VALID_BLUEPRINT,
|
|
233
|
+
process_blueprint: {
|
|
234
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
235
|
+
systems: [{ name: 'Legacy app', stages: ['STAGE-1'] }],
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
expect(r.errors.some(e => e.code === 'BP-009')).toBe(false);
|
|
239
|
+
expect(r.errors.some(e => e.code === 'BP-010')).toBe(false);
|
|
240
|
+
});
|
|
241
|
+
it('BP-011: warns when a stage has no aspect entries pointing at it', () => {
|
|
242
|
+
const r = validateProcessBlueprint({
|
|
243
|
+
...VALID_BLUEPRINT,
|
|
244
|
+
process_blueprint: {
|
|
245
|
+
...VALID_BLUEPRINT.process_blueprint,
|
|
246
|
+
stages: [
|
|
247
|
+
{ id: 'STAGE-1', name: 'A', goal: 'G', result: 'R' },
|
|
248
|
+
{ id: 'STAGE-99', name: 'Orphan', goal: 'G', result: 'R' },
|
|
249
|
+
],
|
|
250
|
+
systems: [{ id: 'APPLICATION-OMS-1', name: 'OMS', stages: ['STAGE-1'] }],
|
|
251
|
+
actors: undefined,
|
|
252
|
+
equipment: undefined,
|
|
253
|
+
information_entities: undefined,
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
expect(r.warnings.some(w => w.code === 'BP-011' && /STAGE-99/.test(w.message))).toBe(true);
|
|
257
|
+
expect(r.valid).toBe(true);
|
|
258
|
+
});
|
|
259
|
+
// BP-012 was removed from the spec on 2026-05-21 (methodology PR #15):
|
|
260
|
+
// a single-stage aspect entry is normal, valid blueprint content and the
|
|
261
|
+
// warning fired on the common case. Studio side dropped to match.
|
|
262
|
+
it('happy path: surfaces no warnings on a well-formed multi-stage blueprint', () => {
|
|
263
|
+
const r = validateProcessBlueprint(VALID_BLUEPRINT);
|
|
264
|
+
expect(r.valid).toBe(true);
|
|
265
|
+
expect(r.warnings).toHaveLength(0);
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
describe('process-blueprint examples (regression)', () => {
|
|
269
|
+
const files = fs.readdirSync(EXAMPLES_DIR).filter(f => f.endsWith('.yaml'));
|
|
270
|
+
expect(files.length).toBeGreaterThan(0);
|
|
271
|
+
for (const file of files) {
|
|
272
|
+
it(`validates tests/fixtures/notation-corpus/process-blueprint/${file}`, () => {
|
|
273
|
+
const text = fs.readFileSync(path.join(EXAMPLES_DIR, file), 'utf8');
|
|
274
|
+
const parsed = yaml.load(text);
|
|
275
|
+
const r = validateProcessBlueprint(parsed);
|
|
276
|
+
expect(r.errors).toEqual([]);
|
|
277
|
+
expect(r.valid).toBe(true);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AspectCategory, Stage, AspectEntry, LaneConfig, ProcessBlueprintHeader, ProcessBlueprintFile, ProcessBlueprintLayoutOptions, LegendCell, StageHeaderCell, StageTextCell, AspectPill, AspectRow, ProcessBlueprintLayout, ComplianceDecoration, ComplianceChip, ComplianceRow, ComplianceLaneConfig, ComplianceLaneAssertion, ComplianceLaneRequirement, ComplianceLaneInput, } from './types.js';
|
|
2
|
+
export { validateProcessBlueprint } from './validate.js';
|
|
3
|
+
export type { ValidationError as ProcessBlueprintValidationError, ValidationWarning as ProcessBlueprintValidationWarning, ValidationResult as ProcessBlueprintValidationResult, } from './validate.js';
|
|
4
|
+
export { layoutProcessBlueprint } from './layout.js';
|