@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,237 @@
|
|
|
1
|
+
// Activity Card notation — single-project narrative view.
|
|
2
|
+
//
|
|
3
|
+
// Spec: transitrix/methodology `notations/views/18-activity-card.md` (v0.1).
|
|
4
|
+
// Epic vkgeorgia/strategy#97, Studio track #134.
|
|
5
|
+
//
|
|
6
|
+
// The Activity Card is the first MULTI-DOCUMENT Studio notation. The card
|
|
7
|
+
// YAML itself holds only `id`, `project` (an Activity ID), `description`,
|
|
8
|
+
// and `milestones[]`. Everything painted on the card — the project name,
|
|
9
|
+
// dates, motivation chain (Factors → Goals → Changes), and child activities
|
|
10
|
+
// — is pulled BY REFERENCE at view time from the canonical ELEMENT and
|
|
11
|
+
// RELATION store (`canon/elements/**`, `canon/relations/**`), never from
|
|
12
|
+
// other view documents. This honours the view-purity invariant: a view is a
|
|
13
|
+
// projection over elements + relations (methodology ELEMENT_PRIMITIVES.md §1).
|
|
14
|
+
// See `resolver.ts`.
|
|
15
|
+
//
|
|
16
|
+
// This file declares two model layers:
|
|
17
|
+
// 1. the RAW card document (what the YAML parses into), and
|
|
18
|
+
// 2. the ASSEMBLED card view-model (what the resolver produces and the
|
|
19
|
+
// layout consumes).
|
|
20
|
+
|
|
21
|
+
import type {
|
|
22
|
+
ValidationError as SharedValidationError,
|
|
23
|
+
ValidationWarning as SharedValidationWarning,
|
|
24
|
+
ValidationResult as SharedValidationResult,
|
|
25
|
+
} from '../validation-types.js';
|
|
26
|
+
|
|
27
|
+
// Keep PREFIXED aliases consistent with the other notation modules so
|
|
28
|
+
// external consumers can name the activity-card result types directly.
|
|
29
|
+
export type ActivityCardValidationError = SharedValidationError;
|
|
30
|
+
export type ActivityCardValidationWarning = SharedValidationWarning;
|
|
31
|
+
export type ActivityCardValidationResult = SharedValidationResult;
|
|
32
|
+
|
|
33
|
+
// ── Raw card document (the `*.activity-card.transitrix.yaml` shape) ──────────
|
|
34
|
+
|
|
35
|
+
export interface RawMilestone {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
/** Quoted ISO 8601 date (YYYY-MM-DD) when the milestone is reached. */
|
|
39
|
+
date: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
/** CHANGE-… IDs; each must be a subset of the project Activity's delivers_changes. */
|
|
42
|
+
delivers_changes?: string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ActivityCardBlock {
|
|
46
|
+
id: string;
|
|
47
|
+
/** Canonical ID of the referenced project Activity (ACTIVITY-…). */
|
|
48
|
+
project: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
milestones?: RawMilestone[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ActivityCardDoc {
|
|
54
|
+
notation: string;
|
|
55
|
+
spec_version?: string;
|
|
56
|
+
activity_card: ActivityCardBlock;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── Canon sources consumed by the resolver ──────────────────────────────────
|
|
60
|
+
//
|
|
61
|
+
// View-purity invariant (methodology ELEMENT_PRIMITIVES.md §1): a view is a
|
|
62
|
+
// projection over the canonical ELEMENTS + RELATIONS, never over other view
|
|
63
|
+
// documents. The Activity Card therefore resolves its project, child
|
|
64
|
+
// activities, and motivation chain from the canon element store
|
|
65
|
+
// (`canon/elements/**` — one ACTIVITY / FACTOR / GOAL / CHANGE element per
|
|
66
|
+
// file, each a `notation: <type>` document carrying its own `id`) and the
|
|
67
|
+
// relation store (`canon/relations/**` — `notation: relation` files), NOT from
|
|
68
|
+
// sibling `*.activities.*` / `*.fgca.*` view documents.
|
|
69
|
+
//
|
|
70
|
+
// The resolver is filesystem-free: the extension reads + parses the element and
|
|
71
|
+
// relation files and hands the parsed objects in. We model them as `unknown[]`
|
|
72
|
+
// at the boundary and narrow defensively inside the resolver, so a malformed
|
|
73
|
+
// element / relation degrades to a resolution error rather than a crash.
|
|
74
|
+
|
|
75
|
+
export interface ActivityCardSources {
|
|
76
|
+
/** Parsed canon element documents — one element per file (`notation: activity|factor|goal|change|…`). */
|
|
77
|
+
elements: unknown[];
|
|
78
|
+
/** Parsed canon relation documents (`notation: relation`). */
|
|
79
|
+
relations: unknown[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ── Assembled card view-model (resolver output → layout input) ───────────────
|
|
83
|
+
|
|
84
|
+
export interface ResolvedProject {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
/** Full description from the Activity (the card's own `description` is separate). */
|
|
88
|
+
description?: string;
|
|
89
|
+
/** Lifecycle: decision-to-initiate date (CONTRACT.md §7). */
|
|
90
|
+
valid_from?: string;
|
|
91
|
+
/** Lifecycle: when the project ceased effect, or undefined if active. */
|
|
92
|
+
valid_to?: string;
|
|
93
|
+
/** Planned work range. */
|
|
94
|
+
start_date?: string;
|
|
95
|
+
end_date?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface ResolvedMilestone {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
date: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
/** CHANGE-… IDs this milestone delivers (subset of the project's). */
|
|
104
|
+
deliversChanges: string[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface ResolvedFactor {
|
|
108
|
+
id: string;
|
|
109
|
+
name: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ResolvedGoal {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
/** FACTOR-… IDs that motivate this goal (canonical `goal.factors`). */
|
|
116
|
+
factorIds: string[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ResolvedChange {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
/** GOAL-… IDs this change advances (canonical `change.goals`). */
|
|
123
|
+
goalIds: string[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Motivation chain: Factors → Goals → Changes, scoped to the project. */
|
|
127
|
+
export interface ResolvedMotivation {
|
|
128
|
+
factors: ResolvedFactor[];
|
|
129
|
+
goals: ResolvedGoal[];
|
|
130
|
+
changes: ResolvedChange[];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface ResolvedChildActivity {
|
|
134
|
+
id: string;
|
|
135
|
+
name: string;
|
|
136
|
+
activity_type?: string;
|
|
137
|
+
start_date?: string;
|
|
138
|
+
end_date?: string;
|
|
139
|
+
owner?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface ResolvedActivityCard {
|
|
143
|
+
cardId: string;
|
|
144
|
+
/** The card's own executive-summary description (distinct from the project's). */
|
|
145
|
+
cardDescription?: string;
|
|
146
|
+
project: ResolvedProject;
|
|
147
|
+
/** Sorted ascending by `date`. */
|
|
148
|
+
milestones: ResolvedMilestone[];
|
|
149
|
+
motivation: ResolvedMotivation;
|
|
150
|
+
/** Activities whose `parent` = the project Activity id. */
|
|
151
|
+
childActivities: ResolvedChildActivity[];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ── Layout geometry (pure; the preview turns this into SVG) ───────────────────
|
|
155
|
+
|
|
156
|
+
import type { LayoutBounds } from '../geometry.js';
|
|
157
|
+
export type { LayoutBounds };
|
|
158
|
+
|
|
159
|
+
/** A boxed value-pair shown in the dates band. */
|
|
160
|
+
export interface DateField {
|
|
161
|
+
label: string;
|
|
162
|
+
value: string;
|
|
163
|
+
x: number;
|
|
164
|
+
y: number;
|
|
165
|
+
width: number;
|
|
166
|
+
height: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** One milestone marker on the timeline. */
|
|
170
|
+
export interface MilestoneMarker {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
date: string;
|
|
174
|
+
/** ArchiMate class label appended by the renderer (§5.1). */
|
|
175
|
+
archimateClass: string;
|
|
176
|
+
x: number;
|
|
177
|
+
y: number;
|
|
178
|
+
width: number;
|
|
179
|
+
height: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** One node in a motivation-chain column. */
|
|
183
|
+
export interface ChainNode {
|
|
184
|
+
id: string;
|
|
185
|
+
name: string;
|
|
186
|
+
x: number;
|
|
187
|
+
y: number;
|
|
188
|
+
width: number;
|
|
189
|
+
height: number;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** An edge between two chain nodes (factor→goal or goal→change). */
|
|
193
|
+
export interface ChainEdge {
|
|
194
|
+
sourceId: string;
|
|
195
|
+
targetId: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface ChildActivityRow {
|
|
199
|
+
id: string;
|
|
200
|
+
name: string;
|
|
201
|
+
/** ArchiMate class label appended by the renderer (§5.1). */
|
|
202
|
+
archimateClass: string;
|
|
203
|
+
meta: string;
|
|
204
|
+
x: number;
|
|
205
|
+
y: number;
|
|
206
|
+
width: number;
|
|
207
|
+
height: number;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface SectionHeader {
|
|
211
|
+
label: string;
|
|
212
|
+
x: number;
|
|
213
|
+
y: number;
|
|
214
|
+
width: number;
|
|
215
|
+
height: number;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface ActivityCardLayoutOptions {
|
|
219
|
+
/** Outer card width (px). */
|
|
220
|
+
cardWidth?: number;
|
|
221
|
+
/** Horizontal gap (px) between the three motivation-chain columns. */
|
|
222
|
+
columnGap?: number;
|
|
223
|
+
/** Vertical gap (px) between stacked rows within a section. */
|
|
224
|
+
rowGap?: number;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface ActivityCardLayout {
|
|
228
|
+
bounds: LayoutBounds;
|
|
229
|
+
title: { name: string; x: number; y: number };
|
|
230
|
+
dateFields: DateField[];
|
|
231
|
+
sectionHeaders: SectionHeader[];
|
|
232
|
+
milestones: MilestoneMarker[];
|
|
233
|
+
/** Three columns of the motivation chain, in F→G→C order. */
|
|
234
|
+
chainColumns: { factors: ChainNode[]; goals: ChainNode[]; changes: ChainNode[] };
|
|
235
|
+
chainEdges: ChainEdge[];
|
|
236
|
+
childActivities: ChildActivityRow[];
|
|
237
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// Activity Card — document-local structural validation.
|
|
2
|
+
//
|
|
3
|
+
// This validator checks only what can be known from the card document ALONE:
|
|
4
|
+
// the header, the `activity_card` block shape, the project-reference grammar
|
|
5
|
+
// (PC-001's "missing or malformed" half), and each milestone's shape.
|
|
6
|
+
//
|
|
7
|
+
// The cross-document rules — PC-001 "does not resolve", PC-002
|
|
8
|
+
// (activity_type), PC-003 (milestone changes ⊆ project changes), PC-004
|
|
9
|
+
// (milestone date within the project lifecycle window) and the LIFECYCLE-*
|
|
10
|
+
// checks — require the sibling `*.activities.*` / `*.fgca.*` documents and so
|
|
11
|
+
// live in `resolver.ts`. The preview merges both result sets.
|
|
12
|
+
//
|
|
13
|
+
// Codes:
|
|
14
|
+
// AC-001 document structure (root object, `activity_card` block)
|
|
15
|
+
// AC-002 `activity_card.id` grammar
|
|
16
|
+
// AC-003 milestone structure (missing id / name / date)
|
|
17
|
+
// AC-004 milestone id grammar / duplicate
|
|
18
|
+
// AC-005 milestone date format
|
|
19
|
+
// AC-006 milestone `delivers_changes` shape / grammar
|
|
20
|
+
// HDR-001 missing `notation` (CONTRACT.md §2)
|
|
21
|
+
// HDR-002 wrong `notation` (CONTRACT.md §2)
|
|
22
|
+
// PC-001 `project` missing or malformed (the document-local half; the
|
|
23
|
+
// "does not resolve" half is emitted by the resolver)
|
|
24
|
+
|
|
25
|
+
import type { ValidationError, ValidationWarning, ValidationResult } from '../validation-types.js';
|
|
26
|
+
|
|
27
|
+
export type { ValidationError, ValidationWarning, ValidationResult };
|
|
28
|
+
|
|
29
|
+
const ACTIVITY_CARD_ID_RE = /^ACTIVITY_CARD(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
30
|
+
const ACTIVITY_ID_RE = /^ACTIVITY(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
31
|
+
const MILESTONE_ID_RE = /^MILESTONE(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
32
|
+
const CHANGE_ID_RE = /^CHANGE(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
|
|
33
|
+
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
34
|
+
|
|
35
|
+
function isNonEmptyString(v: unknown): v is string {
|
|
36
|
+
return typeof v === 'string' && v.trim().length > 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function validateActivityCard(input: unknown): ValidationResult {
|
|
40
|
+
const errors: ValidationError[] = [];
|
|
41
|
+
const warnings: ValidationWarning[] = [];
|
|
42
|
+
|
|
43
|
+
if (!input || typeof input !== 'object') {
|
|
44
|
+
return { valid: false, errors: [{ code: 'AC-001', message: 'document root is not an object' }], warnings };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const raw = input as Record<string, unknown>;
|
|
48
|
+
|
|
49
|
+
// ── Header (CONTRACT.md §2) ────────────────────────────────────────────────
|
|
50
|
+
if (!('notation' in raw)) {
|
|
51
|
+
errors.push({ code: 'HDR-001', message: 'notation field is required' });
|
|
52
|
+
} else if (raw['notation'] !== 'activity-card') {
|
|
53
|
+
errors.push({
|
|
54
|
+
code: 'HDR-002',
|
|
55
|
+
message: `notation must be "activity-card", got "${String(raw['notation'])}"`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── activity_card block ─────────────────────────────────────────────────────
|
|
60
|
+
const block = raw['activity_card'];
|
|
61
|
+
if (!block || typeof block !== 'object' || Array.isArray(block)) {
|
|
62
|
+
errors.push({ code: 'AC-001', message: 'Missing required root key: activity_card (object)' });
|
|
63
|
+
return { valid: false, errors, warnings };
|
|
64
|
+
}
|
|
65
|
+
const card = block as Record<string, unknown>;
|
|
66
|
+
|
|
67
|
+
if (!isNonEmptyString(card['id'])) {
|
|
68
|
+
errors.push({ code: 'AC-002', message: 'activity_card.id is required' });
|
|
69
|
+
} else if (!ACTIVITY_CARD_ID_RE.test(card['id'])) {
|
|
70
|
+
errors.push({
|
|
71
|
+
code: 'AC-002',
|
|
72
|
+
message: `activity_card.id "${card['id']}" must match ACTIVITY_CARD-[<middle>-]<INTEGER>`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// PC-001 (document-local half): project present + well-formed.
|
|
77
|
+
if (!isNonEmptyString(card['project'])) {
|
|
78
|
+
errors.push({ code: 'PC-001', message: 'activity_card.project is required (an ACTIVITY-… id)' });
|
|
79
|
+
} else if (!ACTIVITY_ID_RE.test(card['project'])) {
|
|
80
|
+
errors.push({
|
|
81
|
+
code: 'PC-001',
|
|
82
|
+
message: `activity_card.project "${card['project']}" is malformed; must match ACTIVITY-[<middle>-]<INTEGER>`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (card['description'] !== undefined && typeof card['description'] !== 'string') {
|
|
87
|
+
errors.push({ code: 'AC-001', message: 'activity_card.description must be a string' });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ── milestones[] (optional) ─────────────────────────────────────────────────
|
|
91
|
+
const milestonesRaw = card['milestones'];
|
|
92
|
+
if (milestonesRaw !== undefined) {
|
|
93
|
+
if (!Array.isArray(milestonesRaw)) {
|
|
94
|
+
errors.push({ code: 'AC-003', message: 'activity_card.milestones must be an array', path: 'milestones' });
|
|
95
|
+
} else {
|
|
96
|
+
const seenIds = new Set<string>();
|
|
97
|
+
milestonesRaw.forEach((el, i) => {
|
|
98
|
+
const p = `milestones[${i}]`;
|
|
99
|
+
if (!el || typeof el !== 'object' || Array.isArray(el)) {
|
|
100
|
+
errors.push({ code: 'AC-003', message: `${p} must be an object`, path: p });
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const m = el as Record<string, unknown>;
|
|
104
|
+
|
|
105
|
+
if (!isNonEmptyString(m['id'])) {
|
|
106
|
+
errors.push({ code: 'AC-003', message: `${p}.id is required`, path: p });
|
|
107
|
+
} else {
|
|
108
|
+
const mid = m['id'].trim();
|
|
109
|
+
if (!MILESTONE_ID_RE.test(mid)) {
|
|
110
|
+
errors.push({ code: 'AC-004', message: `${p}.id "${mid}" must match MILESTONE-[<middle>-]<INTEGER>`, path: p });
|
|
111
|
+
}
|
|
112
|
+
if (seenIds.has(mid)) {
|
|
113
|
+
errors.push({ code: 'AC-004', message: `Duplicate milestone id "${mid}"`, path: p });
|
|
114
|
+
} else {
|
|
115
|
+
seenIds.add(mid);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (!isNonEmptyString(m['name'])) {
|
|
120
|
+
errors.push({ code: 'AC-003', message: `${p}.name is required`, path: p });
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (!isNonEmptyString(m['date'])) {
|
|
124
|
+
errors.push({ code: 'AC-003', message: `${p}.date is required`, path: p });
|
|
125
|
+
} else if (!DATE_RE.test(m['date'])) {
|
|
126
|
+
errors.push({
|
|
127
|
+
code: 'AC-005',
|
|
128
|
+
message: `${p}.date "${m['date']}" must be a quoted ISO 8601 date (YYYY-MM-DD)`,
|
|
129
|
+
path: p,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (m['description'] !== undefined && typeof m['description'] !== 'string') {
|
|
134
|
+
errors.push({ code: 'AC-003', message: `${p}.description must be a string`, path: p });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const dc = m['delivers_changes'];
|
|
138
|
+
if (dc !== undefined) {
|
|
139
|
+
if (!Array.isArray(dc)) {
|
|
140
|
+
errors.push({ code: 'AC-006', message: `${p}.delivers_changes must be an array of CHANGE-… ids`, path: p });
|
|
141
|
+
} else {
|
|
142
|
+
dc.forEach((c) => {
|
|
143
|
+
if (typeof c !== 'string' || !CHANGE_ID_RE.test(c)) {
|
|
144
|
+
errors.push({
|
|
145
|
+
code: 'AC-006',
|
|
146
|
+
message: `${p}.delivers_changes[] entry "${String(c)}" must match CHANGE-[<middle>-]<INTEGER>`,
|
|
147
|
+
path: p,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
158
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { validateActor } from '../validate.js';
|
|
3
|
+
|
|
4
|
+
function valid(): Record<string, unknown> {
|
|
5
|
+
return {
|
|
6
|
+
notation: 'actor',
|
|
7
|
+
id: 'ACTOR-PERSON-1',
|
|
8
|
+
name: 'Alex Doe (example)',
|
|
9
|
+
type: 'person',
|
|
10
|
+
description: 'Synthetic person actor demonstrating identity-vs-engagement.',
|
|
11
|
+
contact: 'alex.doe@example.test',
|
|
12
|
+
zone: 'canon',
|
|
13
|
+
admitted_at: '2026-05-29',
|
|
14
|
+
admitted_by: 'v.korobeinikov',
|
|
15
|
+
gate_checks: { uniqueness: 'pass', consistency: 'pass', completeness: 'pass' },
|
|
16
|
+
valid_from: '2025-03-01',
|
|
17
|
+
valid_to: null,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const codes = (input: unknown): string[] => validateActor(input).errors.map(e => e.code);
|
|
22
|
+
|
|
23
|
+
describe('validateActor — positive', () => {
|
|
24
|
+
it('accepts the worked-example ACTOR-PERSON-1', () => {
|
|
25
|
+
const r = validateActor(valid());
|
|
26
|
+
expect(r.valid, JSON.stringify(r.errors)).toBe(true);
|
|
27
|
+
expect(r.errors).toHaveLength(0);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('accepts each permitted type', () => {
|
|
31
|
+
for (const t of ['person', 'business_unit', 'system']) {
|
|
32
|
+
expect(validateActor({ ...valid(), type: t }).valid).toBe(true);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('validateActor — ACTOR-001 (envelope / shape)', () => {
|
|
38
|
+
it('flags a non-object', () => {
|
|
39
|
+
expect(codes(null)).toEqual(['ACTOR-001']);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('flags a wrong notation tag', () => {
|
|
43
|
+
expect(codes({ ...valid(), notation: 'agent' })).toContain('ACTOR-001');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('flags an id with the wrong TYPE prefix', () => {
|
|
47
|
+
expect(codes({ ...valid(), id: 'ROLE-CEO-1' })).toContain('ACTOR-001');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('flags missing name', () => {
|
|
51
|
+
const r = valid();
|
|
52
|
+
delete r.name;
|
|
53
|
+
expect(codes(r)).toContain('ACTOR-001');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('validateActor — ACTOR-002 (identity discriminator)', () => {
|
|
58
|
+
it('flags a missing type (the identity discriminator is required)', () => {
|
|
59
|
+
const r = valid();
|
|
60
|
+
delete r.type;
|
|
61
|
+
expect(codes(r)).toContain('ACTOR-002');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('flags a type outside person/business_unit/system', () => {
|
|
65
|
+
expect(codes({ ...valid(), type: 'employee' })).toContain('ACTOR-002');
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// ACTOR — business-layer identity primitive (ArchiMate Business Actor).
|
|
2
|
+
// Schema: methodology notations/ELEMENT_PRIMITIVES.md §7.10 +
|
|
3
|
+
// notations/elements/19-actors.md + envelope §3.
|
|
4
|
+
|
|
5
|
+
import type { GateChecks } from '../requirement/types.js';
|
|
6
|
+
|
|
7
|
+
/** Identity discriminator — what kind of actor (person, business_unit, system). */
|
|
8
|
+
export type ActorType = 'person' | 'business_unit' | 'system';
|
|
9
|
+
|
|
10
|
+
export const ACTOR_TYPES = ['person', 'business_unit', 'system'] as const;
|
|
11
|
+
|
|
12
|
+
export interface Actor {
|
|
13
|
+
notation: 'actor';
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
/** Required identity discriminator. */
|
|
17
|
+
type: ActorType;
|
|
18
|
+
description?: string;
|
|
19
|
+
contact?: string;
|
|
20
|
+
external_ref?: string;
|
|
21
|
+
|
|
22
|
+
zone: 'canon';
|
|
23
|
+
admitted_at: string;
|
|
24
|
+
admitted_by: string;
|
|
25
|
+
gate_checks: GateChecks;
|
|
26
|
+
|
|
27
|
+
valid_from: string;
|
|
28
|
+
valid_to: string | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ACTOR validator — methodology notations/ELEMENT_PRIMITIVES.md §7.10 +
|
|
2
|
+
// notations/elements/19-actors.md.
|
|
3
|
+
//
|
|
4
|
+
// Implements ACTOR-001..002. Employment / role-assignment / unit-parent
|
|
5
|
+
// relations live in first-class time-aware REL files (elements/17-relations.md
|
|
6
|
+
// §3) and are out of scope for this single-artefact validator.
|
|
7
|
+
|
|
8
|
+
import type { ValidationError, ValidationResult, ValidationWarning } from '../validation-types.js';
|
|
9
|
+
import { validateElementEnvelope } from '../element-envelope.js';
|
|
10
|
+
import { ACTOR_TYPES } from './types.js';
|
|
11
|
+
|
|
12
|
+
export function validateActor(input: unknown): ValidationResult {
|
|
13
|
+
const errors: ValidationError[] = [];
|
|
14
|
+
const warnings: ValidationWarning[] = [];
|
|
15
|
+
|
|
16
|
+
const { record, errors: envErrors } = validateElementEnvelope(input, {
|
|
17
|
+
notation: 'actor',
|
|
18
|
+
idType: 'ACTOR',
|
|
19
|
+
code: 'ACTOR-001',
|
|
20
|
+
});
|
|
21
|
+
errors.push(...envErrors);
|
|
22
|
+
if (!record) return { valid: false, errors, warnings };
|
|
23
|
+
|
|
24
|
+
// ACTOR-002 — `type` is required (the identity discriminator) and must be
|
|
25
|
+
// one of person / business_unit / system. The split with the former UNIT /
|
|
26
|
+
// EMPLOYEE TYPEs (Actors decision, 2026-05-29; §7.11) hinges on this.
|
|
27
|
+
if (record.type === undefined || record.type === null) {
|
|
28
|
+
errors.push({ code: 'ACTOR-002', message: 'type is required (person | business_unit | system).', path: 'type' });
|
|
29
|
+
} else if (!ACTOR_TYPES.includes(record.type as never)) {
|
|
30
|
+
errors.push({
|
|
31
|
+
code: 'ACTOR-002',
|
|
32
|
+
message: `type "${String(record.type)}" must be one of ${ACTOR_TYPES.join(', ')}.`,
|
|
33
|
+
path: 'type',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return { valid: errors.length === 0, errors, warnings };
|
|
38
|
+
}
|