@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,242 @@
|
|
|
1
|
+
export type AspectCategory = 'systems' | 'actors' | 'equipment' | 'information_entities';
|
|
2
|
+
|
|
3
|
+
// ── Compliance lane types ────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* One of the three orthogonal decoration signals that can appear on a compliance
|
|
7
|
+
* law chip (ADR 2026-06-09-compliance-impact-as-blueprint-lane §3):
|
|
8
|
+
* - `new` — law's impact on this stage appeared since the previous snapshot
|
|
9
|
+
* - `gap` — a bound assertion has status `non_compliant` or `partial`
|
|
10
|
+
* - `deadline` — gap is present AND the requirement carries a deadline that is
|
|
11
|
+
* past, imminent, or in-force
|
|
12
|
+
*/
|
|
13
|
+
export type ComplianceDecoration = 'new' | 'gap' | 'deadline';
|
|
14
|
+
|
|
15
|
+
/** Input shape for a requirement — minimal projection the compliance lane needs. */
|
|
16
|
+
export interface ComplianceLaneRequirement {
|
|
17
|
+
id: string;
|
|
18
|
+
/** Typed IDs of codex sources (law IDs displayed as chips). */
|
|
19
|
+
derived_from?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* ISO 8601 compliance deadline on the external regulatory source.
|
|
22
|
+
* Used to compute the `deadline` decoration.
|
|
23
|
+
*/
|
|
24
|
+
deadline?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Input shape for an assertion — minimal projection the compliance lane needs. */
|
|
28
|
+
export interface ComplianceLaneAssertion {
|
|
29
|
+
/** Requirement ID this assertion is about. */
|
|
30
|
+
about: string;
|
|
31
|
+
/** Compliance realisation status. */
|
|
32
|
+
status: 'compliant' | 'partial' | 'non_compliant' | 'under_review' | 'n_a';
|
|
33
|
+
/**
|
|
34
|
+
* Typed IDs of stages / process steps where the requirement is realised.
|
|
35
|
+
* When empty/absent, the assertion covers the entire subject, not a specific stage.
|
|
36
|
+
*/
|
|
37
|
+
realised_via?: string[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Input data for the compliance lane derivation.
|
|
42
|
+
* Passed via `ProcessBlueprintLayoutOptions.complianceInput`.
|
|
43
|
+
*/
|
|
44
|
+
export interface ComplianceLaneInput {
|
|
45
|
+
assertions: ComplianceLaneAssertion[];
|
|
46
|
+
requirements: ComplianceLaneRequirement[];
|
|
47
|
+
/**
|
|
48
|
+
* Codex jurisdiction map: codexId → jurisdiction code.
|
|
49
|
+
* Required only when `ComplianceLaneConfig.jurisdictions` is non-empty.
|
|
50
|
+
*/
|
|
51
|
+
codexJurisdictions?: Record<string, string>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Runtime configuration for the compliance lane.
|
|
56
|
+
* Passed via `ProcessBlueprintLayoutOptions.complianceLane`.
|
|
57
|
+
*/
|
|
58
|
+
export interface ComplianceLaneConfig {
|
|
59
|
+
/** When false (default), the compliance lane is not rendered. */
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Jurisdiction filter: if non-empty, only show laws whose codex jurisdiction
|
|
63
|
+
* is in this list. Requires `ComplianceLaneInput.codexJurisdictions`.
|
|
64
|
+
*/
|
|
65
|
+
jurisdictions?: string[];
|
|
66
|
+
/**
|
|
67
|
+
* Per-stage map of law IDs known from the previous generated snapshot.
|
|
68
|
+
* Key: stage ID; Value: array of law IDs.
|
|
69
|
+
* A law not present in the previous snapshot is decorated as `new`.
|
|
70
|
+
*/
|
|
71
|
+
previousSnapshot?: Record<string, string[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Reference date for deadline-status computation (YYYY-MM-DD).
|
|
74
|
+
* Defaults to today when not supplied.
|
|
75
|
+
*/
|
|
76
|
+
referenceDate?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** One law chip rendered inside a compliance cell. */
|
|
80
|
+
export interface ComplianceChip {
|
|
81
|
+
stageIndex: number;
|
|
82
|
+
/** Codex / law ID shown as the chip label. */
|
|
83
|
+
lawId: string;
|
|
84
|
+
/** Active decorations — a subset of the three orthogonal signals. */
|
|
85
|
+
decorations: ComplianceDecoration[];
|
|
86
|
+
x: number;
|
|
87
|
+
y: number;
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Laid-out compliance row (one per blueprint when the lane is enabled). */
|
|
93
|
+
export interface ComplianceRow {
|
|
94
|
+
y: number;
|
|
95
|
+
height: number;
|
|
96
|
+
chips: ComplianceChip[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface Stage {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
goal: string;
|
|
103
|
+
result: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface AspectEntry {
|
|
108
|
+
id?: string;
|
|
109
|
+
name: string;
|
|
110
|
+
stages: string[];
|
|
111
|
+
description?: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Rendering-config block that selects which lanes are visible (spec §5 `lane_config:`). */
|
|
115
|
+
export interface LaneConfig {
|
|
116
|
+
/** Enable the derived compliance lane. Default: false. */
|
|
117
|
+
compliance?: boolean;
|
|
118
|
+
compliance_filter?: {
|
|
119
|
+
/** ISO jurisdiction codes; empty array means all jurisdictions. */
|
|
120
|
+
jurisdictions?: string[];
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface ProcessBlueprintHeader {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
description?: string;
|
|
128
|
+
period?: string;
|
|
129
|
+
version?: string;
|
|
130
|
+
date?: string;
|
|
131
|
+
author?: string;
|
|
132
|
+
process?: string;
|
|
133
|
+
scenario?: string;
|
|
134
|
+
stages: Stage[];
|
|
135
|
+
systems?: AspectEntry[];
|
|
136
|
+
actors?: AspectEntry[];
|
|
137
|
+
equipment?: AspectEntry[];
|
|
138
|
+
information_entities?: AspectEntry[];
|
|
139
|
+
/** Optional rendering config selecting which lanes to show. */
|
|
140
|
+
lane_config?: LaneConfig;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface ProcessBlueprintFile {
|
|
144
|
+
notation: string;
|
|
145
|
+
spec_version?: string;
|
|
146
|
+
process_blueprint: ProcessBlueprintHeader;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface ProcessBlueprintLayoutOptions {
|
|
150
|
+
legendColumnWidth?: number;
|
|
151
|
+
stageColumnWidth?: number;
|
|
152
|
+
stageHeaderHeight?: number;
|
|
153
|
+
goalRowHeight?: number;
|
|
154
|
+
resultRowHeight?: number;
|
|
155
|
+
aspectRowMinHeight?: number;
|
|
156
|
+
pillHeight?: number;
|
|
157
|
+
pillGap?: number;
|
|
158
|
+
cellPadding?: number;
|
|
159
|
+
/** Vertical advance between wrapped text lines in goal/result cells (px). */
|
|
160
|
+
textLineHeight?: number;
|
|
161
|
+
/** Approximate glyph width used to estimate wrap width (px per char). */
|
|
162
|
+
textCharWidth?: number;
|
|
163
|
+
/** Horizontal text inset inside goal/result cells (px, both sides). */
|
|
164
|
+
cellTextPadX?: number;
|
|
165
|
+
/** Top+bottom padding added around wrapped goal/result text (px). */
|
|
166
|
+
cellTextPadY?: number;
|
|
167
|
+
/** Maximum wrapped lines per goal/result cell before truncating with an ellipsis. */
|
|
168
|
+
maxTextLines?: number;
|
|
169
|
+
/** Enable and configure the derived compliance lane. Default: disabled. */
|
|
170
|
+
complianceLane?: ComplianceLaneConfig;
|
|
171
|
+
/** Assertion + requirement data for the compliance lane derivation. */
|
|
172
|
+
complianceInput?: ComplianceLaneInput;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
import type { LayoutBounds } from '../geometry.js';
|
|
176
|
+
export type { LayoutBounds };
|
|
177
|
+
|
|
178
|
+
export interface LegendCell {
|
|
179
|
+
kind: 'goal' | 'result' | 'aspect' | 'compliance';
|
|
180
|
+
category?: AspectCategory;
|
|
181
|
+
label: string;
|
|
182
|
+
y: number;
|
|
183
|
+
height: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface StageHeaderCell {
|
|
187
|
+
stageIndex: number;
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
x: number;
|
|
191
|
+
y: number;
|
|
192
|
+
width: number;
|
|
193
|
+
height: number;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface StageTextCell {
|
|
197
|
+
stageIndex: number;
|
|
198
|
+
text: string;
|
|
199
|
+
/** Word-wrapped lines of `text`, pre-fitted to the cell width by the layout. */
|
|
200
|
+
lines: string[];
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
width: number;
|
|
204
|
+
height: number;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface AspectPill {
|
|
208
|
+
category: AspectCategory;
|
|
209
|
+
entryIndex: number;
|
|
210
|
+
name: string;
|
|
211
|
+
id?: string;
|
|
212
|
+
startStageIndex: number;
|
|
213
|
+
endStageIndex: number;
|
|
214
|
+
x: number;
|
|
215
|
+
y: number;
|
|
216
|
+
width: number;
|
|
217
|
+
height: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface AspectRow {
|
|
221
|
+
category: AspectCategory;
|
|
222
|
+
y: number;
|
|
223
|
+
height: number;
|
|
224
|
+
pills: AspectPill[];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface ProcessBlueprintLayout {
|
|
228
|
+
bounds: LayoutBounds;
|
|
229
|
+
legendColumnWidth: number;
|
|
230
|
+
stageColumnWidth: number;
|
|
231
|
+
/** Vertical advance between wrapped text lines, so renderers stack tspans consistently. */
|
|
232
|
+
textLineHeight: number;
|
|
233
|
+
/** Horizontal text inset used for goal/result cells (px). */
|
|
234
|
+
cellTextPadX: number;
|
|
235
|
+
legend: LegendCell[];
|
|
236
|
+
stageHeaders: StageHeaderCell[];
|
|
237
|
+
goalCells: StageTextCell[];
|
|
238
|
+
resultCells: StageTextCell[];
|
|
239
|
+
aspectRows: AspectRow[];
|
|
240
|
+
/** Compliance lane row — present only when the lane is enabled and has data. */
|
|
241
|
+
complianceRow?: ComplianceRow;
|
|
242
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { AspectCategory } from './types.js';
|
|
2
|
+
import type { ValidationError, ValidationWarning, ValidationResult } from '../validation-types.js';
|
|
3
|
+
|
|
4
|
+
export type { ValidationError, ValidationWarning, ValidationResult };
|
|
5
|
+
|
|
6
|
+
const ID_GRAMMAR_RE = /^[A-Z][A-Z_]*(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
7
|
+
const PROCESS_BLUEPRINT_ID_RE = /^PROCESS_BLUEPRINT(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
8
|
+
const STAGE_ID_RE = /^STAGE(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
9
|
+
const APPLICATION_ID_RE = /^APPLICATION(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
10
|
+
const ROLE_ID_RE = /^ROLE(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
11
|
+
|
|
12
|
+
const ASPECT_CATEGORIES: AspectCategory[] = ['systems', 'actors', 'equipment', 'information_entities'];
|
|
13
|
+
|
|
14
|
+
function isNonEmptyString(v: unknown): v is string {
|
|
15
|
+
return typeof v === 'string' && v.trim().length > 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function validateProcessBlueprint(input: unknown): ValidationResult {
|
|
19
|
+
const errors: ValidationError[] = [];
|
|
20
|
+
const warnings: ValidationWarning[] = [];
|
|
21
|
+
|
|
22
|
+
if (!input || typeof input !== 'object') {
|
|
23
|
+
return {
|
|
24
|
+
valid: false,
|
|
25
|
+
errors: [{ code: 'BP-001', message: 'Input must be an object' }],
|
|
26
|
+
warnings,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const raw = input as Record<string, unknown>;
|
|
31
|
+
|
|
32
|
+
if ('notation' in raw && raw['notation'] !== 'process-blueprint') {
|
|
33
|
+
errors.push({
|
|
34
|
+
code: 'BP-001',
|
|
35
|
+
message: `notation must be "process-blueprint", got "${String(raw['notation'])}"`,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!('process_blueprint' in raw) || !raw['process_blueprint'] || typeof raw['process_blueprint'] !== 'object') {
|
|
40
|
+
errors.push({ code: 'BP-001', message: 'Missing required root key: process_blueprint' });
|
|
41
|
+
return { valid: false, errors, warnings };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const pb = raw['process_blueprint'] as Record<string, unknown>;
|
|
45
|
+
|
|
46
|
+
if (!isNonEmptyString(pb['id'])) {
|
|
47
|
+
errors.push({ code: 'BP-002', message: 'process_blueprint.id is required' });
|
|
48
|
+
} else if (!PROCESS_BLUEPRINT_ID_RE.test(pb['id'])) {
|
|
49
|
+
errors.push({
|
|
50
|
+
code: 'BP-002',
|
|
51
|
+
message: `process_blueprint.id "${pb['id']}" must match PROCESS_BLUEPRINT-[<middle>-]<INTEGER>`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!isNonEmptyString(pb['name'])) {
|
|
56
|
+
errors.push({ code: 'BP-003', message: 'process_blueprint.name is required' });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const stagesRaw = pb['stages'];
|
|
60
|
+
if (!Array.isArray(stagesRaw) || stagesRaw.length === 0) {
|
|
61
|
+
errors.push({ code: 'BP-004', message: 'process_blueprint.stages must be a non-empty array' });
|
|
62
|
+
return { valid: false, errors, warnings };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const stageIds = new Set<string>();
|
|
66
|
+
for (let i = 0; i < stagesRaw.length; i++) {
|
|
67
|
+
const s = stagesRaw[i] as Record<string, unknown> | undefined;
|
|
68
|
+
const path = `stages[${i}]`;
|
|
69
|
+
if (!s || typeof s !== 'object') {
|
|
70
|
+
errors.push({ code: 'BP-005', message: `${path} must be an object` });
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (!isNonEmptyString(s['id'])) {
|
|
74
|
+
errors.push({ code: 'BP-005', message: `${path}.id is required` });
|
|
75
|
+
} else {
|
|
76
|
+
const sid = s['id'].trim();
|
|
77
|
+
if (stageIds.has(sid)) {
|
|
78
|
+
errors.push({ code: 'BP-006', message: `Duplicate stage id: "${sid}"` });
|
|
79
|
+
} else {
|
|
80
|
+
stageIds.add(sid);
|
|
81
|
+
}
|
|
82
|
+
if (!STAGE_ID_RE.test(sid)) {
|
|
83
|
+
errors.push({
|
|
84
|
+
code: 'BP-006',
|
|
85
|
+
message: `${path}.id "${sid}" must match STAGE-[<middle>-]<INTEGER>`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (!isNonEmptyString(s['name'])) {
|
|
90
|
+
errors.push({ code: 'BP-005', message: `${path}.name is required` });
|
|
91
|
+
}
|
|
92
|
+
if (!isNonEmptyString(s['goal'])) {
|
|
93
|
+
errors.push({ code: 'BP-005', message: `${path}.goal is required` });
|
|
94
|
+
}
|
|
95
|
+
if (!isNonEmptyString(s['result'])) {
|
|
96
|
+
errors.push({ code: 'BP-005', message: `${path}.result is required` });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const usedStageIds = new Set<string>();
|
|
101
|
+
|
|
102
|
+
for (const category of ASPECT_CATEGORIES) {
|
|
103
|
+
const arr = pb[category];
|
|
104
|
+
if (arr === undefined) continue;
|
|
105
|
+
if (!Array.isArray(arr)) {
|
|
106
|
+
errors.push({ code: 'BP-007', message: `process_blueprint.${category} must be an array` });
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
for (let i = 0; i < arr.length; i++) {
|
|
111
|
+
const e = arr[i] as Record<string, unknown> | undefined;
|
|
112
|
+
const path = `${category}[${i}]`;
|
|
113
|
+
if (!e || typeof e !== 'object') {
|
|
114
|
+
errors.push({ code: 'BP-007', message: `${path} must be an object` });
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!isNonEmptyString(e['name'])) {
|
|
119
|
+
errors.push({ code: 'BP-007', message: `${path}.name is required` });
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const entryStages = e['stages'];
|
|
123
|
+
if (!Array.isArray(entryStages) || entryStages.length === 0) {
|
|
124
|
+
errors.push({
|
|
125
|
+
code: 'BP-007',
|
|
126
|
+
message: `${path}.stages must be a non-empty array of STAGE-… ids`,
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
for (let j = 0; j < entryStages.length; j++) {
|
|
130
|
+
const ref = entryStages[j];
|
|
131
|
+
if (typeof ref !== 'string') {
|
|
132
|
+
errors.push({ code: 'BP-008', message: `${path}.stages[${j}] must be a string` });
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const refTrimmed = ref.trim();
|
|
136
|
+
if (!stageIds.has(refTrimmed)) {
|
|
137
|
+
errors.push({
|
|
138
|
+
code: 'BP-008',
|
|
139
|
+
message: `${path}.stages[${j}] references undeclared stage "${ref}"`,
|
|
140
|
+
});
|
|
141
|
+
} else {
|
|
142
|
+
usedStageIds.add(refTrimmed);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const entryId = e['id'];
|
|
148
|
+
if (entryId !== undefined) {
|
|
149
|
+
if (typeof entryId !== 'string') {
|
|
150
|
+
errors.push({ code: 'BP-009', message: `${path}.id must be a string` });
|
|
151
|
+
} else if (!ID_GRAMMAR_RE.test(entryId)) {
|
|
152
|
+
errors.push({
|
|
153
|
+
code: 'BP-009',
|
|
154
|
+
message: `${path}.id "${entryId}" must match <TYPE>-[<middle>-]<INTEGER>`,
|
|
155
|
+
});
|
|
156
|
+
} else if (category === 'systems' && !APPLICATION_ID_RE.test(entryId)) {
|
|
157
|
+
errors.push({
|
|
158
|
+
code: 'BP-010',
|
|
159
|
+
message: `${path}.id "${entryId}" must use the APPLICATION- prefix`,
|
|
160
|
+
});
|
|
161
|
+
} else if (category === 'actors' && !ROLE_ID_RE.test(entryId)) {
|
|
162
|
+
errors.push({
|
|
163
|
+
code: 'BP-010',
|
|
164
|
+
message: `${path}.id "${entryId}" must use the ROLE- prefix`,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
for (const sid of stageIds) {
|
|
172
|
+
if (!usedStageIds.has(sid)) {
|
|
173
|
+
warnings.push({
|
|
174
|
+
code: 'BP-011',
|
|
175
|
+
message: `Stage "${sid}" has no aspect entries pointing at it — structurally empty`,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
181
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
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 { validateProcessMap } from '../validate.js';
|
|
6
|
+
|
|
7
|
+
const EXAMPLES_DIR = path.resolve(process.cwd(), '..', '..', 'tests', 'fixtures', 'notation-corpus', 'process-map');
|
|
8
|
+
|
|
9
|
+
const VALID_MAP = {
|
|
10
|
+
notation: 'process-map',
|
|
11
|
+
process_map: {
|
|
12
|
+
id: 'PM-ENT-001',
|
|
13
|
+
name: 'Enterprise Process Landscape',
|
|
14
|
+
updated_at: '2026-05-08',
|
|
15
|
+
groups: [
|
|
16
|
+
{
|
|
17
|
+
id: 'GRP-OPERATING',
|
|
18
|
+
name: 'Operating Processes',
|
|
19
|
+
type: 'operating',
|
|
20
|
+
processes: [
|
|
21
|
+
{ process_id: 'PROC-ORD-FULFILL-001', name: 'Order Fulfilment', status: 'Active', maturity: 2 },
|
|
22
|
+
{ process_id: 'PROC-CUST-ONBOARD-001', name: 'Customer Onboarding', status: 'Draft' },
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'GRP-SUPPORTING',
|
|
27
|
+
name: 'Supporting Processes',
|
|
28
|
+
type: 'supporting',
|
|
29
|
+
processes: [
|
|
30
|
+
{ process_id: 'PROC-HR-RECRUIT-001', name: 'Recruitment', status: 'Active' },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
describe('validateProcessMap', () => {
|
|
38
|
+
it('passes on valid input', () => {
|
|
39
|
+
const r = validateProcessMap(VALID_MAP);
|
|
40
|
+
expect(r.valid).toBe(true);
|
|
41
|
+
expect(r.errors).toHaveLength(0);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('PMAP-001: rejects non-object input', () => {
|
|
45
|
+
const r = validateProcessMap(null);
|
|
46
|
+
expect(r.valid).toBe(false);
|
|
47
|
+
expect(r.errors[0].code).toBe('PMAP-001');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('PMAP-001: rejects missing notation', () => {
|
|
51
|
+
const { notation: _, ...rest } = VALID_MAP;
|
|
52
|
+
const r = validateProcessMap(rest);
|
|
53
|
+
expect(r.errors.some(e => e.code === 'PMAP-001')).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('PMAP-001: rejects wrong notation value', () => {
|
|
57
|
+
const r = validateProcessMap({ ...VALID_MAP, notation: 'goals' });
|
|
58
|
+
expect(r.errors.some(e => e.code === 'PMAP-001')).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('PMAP-002: rejects missing process_map', () => {
|
|
62
|
+
const r = validateProcessMap({ notation: 'process-map' });
|
|
63
|
+
expect(r.errors.some(e => e.code === 'PMAP-002')).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('PMAP-002: rejects missing id/name/updated_at', () => {
|
|
67
|
+
const r = validateProcessMap({ notation: 'process-map', process_map: { groups: [] } });
|
|
68
|
+
expect(r.errors.filter(e => e.code === 'PMAP-002').length).toBeGreaterThanOrEqual(3);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('PMAP-002: rejects non-array groups', () => {
|
|
72
|
+
const map = { ...VALID_MAP.process_map, groups: 'oops' };
|
|
73
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
74
|
+
expect(r.errors.some(e => e.code === 'PMAP-002')).toBe(true);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('PMAP-003: rejects group missing id/name/type', () => {
|
|
78
|
+
const map = { ...VALID_MAP.process_map, groups: [{ processes: [] }] };
|
|
79
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
80
|
+
expect(r.errors.filter(e => e.code === 'PMAP-003').length).toBeGreaterThanOrEqual(3);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('PMAP-004: rejects invalid group type', () => {
|
|
84
|
+
const map = {
|
|
85
|
+
...VALID_MAP.process_map,
|
|
86
|
+
groups: [{ id: 'g1', name: 'X', type: 'random', processes: [] }],
|
|
87
|
+
};
|
|
88
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
89
|
+
expect(r.errors.some(e => e.code === 'PMAP-004')).toBe(true);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('PMAP-004: accepts all valid group types', () => {
|
|
93
|
+
for (const type of ['operating', 'supporting', 'management']) {
|
|
94
|
+
const map = {
|
|
95
|
+
...VALID_MAP.process_map,
|
|
96
|
+
groups: [{ id: 'g1', name: 'X', type, processes: [] }],
|
|
97
|
+
};
|
|
98
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
99
|
+
expect(r.errors.some(e => e.code === 'PMAP-004')).toBe(false);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('PMAP-005: rejects process missing process_id/name/status', () => {
|
|
104
|
+
const map = {
|
|
105
|
+
...VALID_MAP.process_map,
|
|
106
|
+
groups: [{ id: 'g1', name: 'G', type: 'operating', processes: [{}] }],
|
|
107
|
+
};
|
|
108
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
109
|
+
expect(r.errors.filter(e => e.code === 'PMAP-005').length).toBeGreaterThanOrEqual(3);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('PMAP-006: rejects invalid status', () => {
|
|
113
|
+
const map = {
|
|
114
|
+
...VALID_MAP.process_map,
|
|
115
|
+
groups: [{ id: 'g1', name: 'G', type: 'operating', processes: [
|
|
116
|
+
{ process_id: 'p1', name: 'X', status: 'Retired' },
|
|
117
|
+
]}],
|
|
118
|
+
};
|
|
119
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
120
|
+
expect(r.errors.some(e => e.code === 'PMAP-006')).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('PMAP-007: rejects out-of-range maturity', () => {
|
|
124
|
+
const map = {
|
|
125
|
+
...VALID_MAP.process_map,
|
|
126
|
+
groups: [{ id: 'g1', name: 'G', type: 'operating', processes: [
|
|
127
|
+
{ process_id: 'p1', name: 'X', status: 'Active', maturity: 6 },
|
|
128
|
+
]}],
|
|
129
|
+
};
|
|
130
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
131
|
+
expect(r.errors.some(e => e.code === 'PMAP-007')).toBe(true);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('PMAP-007: accepts maturity 1-5', () => {
|
|
135
|
+
for (const maturity of [1, 2, 3, 4, 5]) {
|
|
136
|
+
const map = {
|
|
137
|
+
...VALID_MAP.process_map,
|
|
138
|
+
groups: [{ id: 'g1', name: 'G', type: 'operating', processes: [
|
|
139
|
+
{ process_id: 'p1', name: 'X', status: 'Active', maturity },
|
|
140
|
+
]}],
|
|
141
|
+
};
|
|
142
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
143
|
+
expect(r.errors.some(e => e.code === 'PMAP-007')).toBe(false);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('PMAP-008: rejects malformed updated_at', () => {
|
|
148
|
+
const map = { ...VALID_MAP.process_map, updated_at: '13-05-2026' };
|
|
149
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
150
|
+
expect(r.errors.some(e => e.code === 'PMAP-008')).toBe(true);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('PMAP-009: rejects duplicate process_id across groups', () => {
|
|
154
|
+
const map = {
|
|
155
|
+
...VALID_MAP.process_map,
|
|
156
|
+
groups: [
|
|
157
|
+
{ id: 'g1', name: 'A', type: 'operating', processes: [{ process_id: 'P1', name: 'X', status: 'Active' }] },
|
|
158
|
+
{ id: 'g2', name: 'B', type: 'supporting', processes: [{ process_id: 'P1', name: 'Y', status: 'Active' }] },
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
162
|
+
expect(r.errors.some(e => e.code === 'PMAP-009')).toBe(true);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('PMAP-010: rejects duplicate group id', () => {
|
|
166
|
+
const map = {
|
|
167
|
+
...VALID_MAP.process_map,
|
|
168
|
+
groups: [
|
|
169
|
+
{ id: 'gdup', name: 'A', type: 'operating', processes: [] },
|
|
170
|
+
{ id: 'gdup', name: 'B', type: 'supporting', processes: [] },
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
174
|
+
expect(r.errors.some(e => e.code === 'PMAP-010')).toBe(true);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('accepts empty groups array', () => {
|
|
178
|
+
const map = { ...VALID_MAP.process_map, groups: [] };
|
|
179
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
180
|
+
expect(r.valid).toBe(true);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('accepts group with no processes field', () => {
|
|
184
|
+
const map = {
|
|
185
|
+
...VALID_MAP.process_map,
|
|
186
|
+
groups: [{ id: 'g1', name: 'G', type: 'operating' }],
|
|
187
|
+
};
|
|
188
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
189
|
+
expect(r.valid).toBe(true);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// Pre-release blocker regression (orchestrator review 2026-05-21).
|
|
193
|
+
it('[blocker] tolerates a null element in groups[] without throwing', () => {
|
|
194
|
+
const map = { ...VALID_MAP.process_map, groups: [null] };
|
|
195
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
196
|
+
expect(r.valid).toBe(false);
|
|
197
|
+
expect(r.errors.some(e => e.code === 'PMAP-003')).toBe(true);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('[blocker] tolerates a null element in processes[] without throwing', () => {
|
|
201
|
+
const map = {
|
|
202
|
+
...VALID_MAP.process_map,
|
|
203
|
+
groups: [{ id: 'g1', name: 'G', type: 'operating', processes: [null] }],
|
|
204
|
+
};
|
|
205
|
+
const r = validateProcessMap({ ...VALID_MAP, process_map: map });
|
|
206
|
+
expect(r.valid).toBe(false);
|
|
207
|
+
expect(r.errors.some(e => e.code === 'PMAP-005')).toBe(true);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
describe('process-map examples (regression)', () => {
|
|
212
|
+
const files = fs.readdirSync(EXAMPLES_DIR).filter(f => f.endsWith('.yaml'));
|
|
213
|
+
expect(files.length).toBeGreaterThan(0);
|
|
214
|
+
for (const file of files) {
|
|
215
|
+
it(`validates tests/fixtures/notation-corpus/process-map/${file}`, () => {
|
|
216
|
+
const text = fs.readFileSync(path.join(EXAMPLES_DIR, file), 'utf8');
|
|
217
|
+
const parsed = yaml.load(text);
|
|
218
|
+
const r = validateProcessMap(parsed);
|
|
219
|
+
expect(r.errors).toEqual([]);
|
|
220
|
+
expect(r.valid).toBe(true);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type ProcessGroupType = 'operating' | 'supporting' | 'management';
|
|
2
|
+
export type ProcessStatus = 'Draft' | 'Active' | 'Deprecated';
|
|
3
|
+
|
|
4
|
+
export interface MapProcess {
|
|
5
|
+
process_id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
status: ProcessStatus;
|
|
8
|
+
owner_role?: string;
|
|
9
|
+
capability?: string;
|
|
10
|
+
maturity?: number;
|
|
11
|
+
bpmn_file?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ProcessGroup {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
type: ProcessGroupType;
|
|
19
|
+
description?: string;
|
|
20
|
+
processes: MapProcess[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ProcessMapHeader {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
version?: string;
|
|
28
|
+
updated_at: string;
|
|
29
|
+
groups: ProcessGroup[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ProcessMapFile {
|
|
33
|
+
notation: string;
|
|
34
|
+
spec_version?: string;
|
|
35
|
+
process_map: ProcessMapHeader;
|
|
36
|
+
}
|