@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,27 @@
|
|
|
1
|
+
import type { ConfidenceDecayConfig, ScoringElement, ViewScore } from '../confidence/index.js';
|
|
2
|
+
import type { IndexAssertion, IndexRequirement } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Lifts a compliance projection (requirement / assertion) to the DQ-1
|
|
5
|
+
* ScoringElement shape. `sources` is intentionally left undefined here:
|
|
6
|
+
* resolving a canon element's `derived_from` to the source_quality of the
|
|
7
|
+
* cited field artefacts (§11.4) needs the field-zone provenance model
|
|
8
|
+
* that Studio's compliance scan does not yet ingest (the DSM equivalent
|
|
9
|
+
* is escalated as DQ-3/DQ-4/DQ-5 on the strategy hub). Until then the
|
|
10
|
+
* scorer treats every element as unsourced — counted separately per §11.5
|
|
11
|
+
* — so the headline honestly reports `0% sourced` rather than guessing a
|
|
12
|
+
* trust label. The freshness signal is fully wired and remains useful.
|
|
13
|
+
*/
|
|
14
|
+
export declare function requirementToScoringElement(r: IndexRequirement): ScoringElement;
|
|
15
|
+
export declare function assertionToScoringElement(a: IndexAssertion): ScoringElement;
|
|
16
|
+
/**
|
|
17
|
+
* Scores a compliance view composed of the given requirements + assertions.
|
|
18
|
+
* Pure / derived per §11.6 — recomputed on read, never stored.
|
|
19
|
+
*/
|
|
20
|
+
export declare function scoreComplianceView(requirements: IndexRequirement[], assertions: IndexAssertion[], today: string | Date, config?: ConfidenceDecayConfig): ViewScore;
|
|
21
|
+
/**
|
|
22
|
+
* Convenience wrapper — scores the view and formats the §11.6 header line.
|
|
23
|
+
* Returns an empty string for an empty element set so the caller can suppress
|
|
24
|
+
* the header (e.g. a single-law tree with no requirements). Re-exports
|
|
25
|
+
* {@link formatConfidenceHeader} for callers that already hold a `ViewScore`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function complianceConfidenceHeader(requirements: IndexRequirement[], assertions: IndexAssertion[], today: string | Date, config?: ConfidenceDecayConfig): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Confidence bridge for the compliance views (vkgeorgia/strategy#162 — DQ-2).
|
|
2
|
+
// Maps the compliance index projections (IndexRequirement / IndexAssertion) onto
|
|
3
|
+
// the DQ-1 ScoringElement shape, scores the view, and renders the §11.6 header
|
|
4
|
+
// line. Lives in @transitrix/diagrams so Studio and DSM share one bridge and
|
|
5
|
+
// the headline reads the same on both surfaces.
|
|
6
|
+
import { formatConfidenceHeader, scoreView, } from '../confidence/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Lifts a compliance projection (requirement / assertion) to the DQ-1
|
|
9
|
+
* ScoringElement shape. `sources` is intentionally left undefined here:
|
|
10
|
+
* resolving a canon element's `derived_from` to the source_quality of the
|
|
11
|
+
* cited field artefacts (§11.4) needs the field-zone provenance model
|
|
12
|
+
* that Studio's compliance scan does not yet ingest (the DSM equivalent
|
|
13
|
+
* is escalated as DQ-3/DQ-4/DQ-5 on the strategy hub). Until then the
|
|
14
|
+
* scorer treats every element as unsourced — counted separately per §11.5
|
|
15
|
+
* — so the headline honestly reports `0% sourced` rather than guessing a
|
|
16
|
+
* trust label. The freshness signal is fully wired and remains useful.
|
|
17
|
+
*/
|
|
18
|
+
export function requirementToScoringElement(r) {
|
|
19
|
+
return { type: 'REQUIREMENT', admitted_at: r.admitted_at };
|
|
20
|
+
}
|
|
21
|
+
export function assertionToScoringElement(a) {
|
|
22
|
+
return { type: 'ASSERTION', admitted_at: a.admitted_at };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Scores a compliance view composed of the given requirements + assertions.
|
|
26
|
+
* Pure / derived per §11.6 — recomputed on read, never stored.
|
|
27
|
+
*/
|
|
28
|
+
export function scoreComplianceView(requirements, assertions, today, config) {
|
|
29
|
+
const elements = [
|
|
30
|
+
...requirements.map(requirementToScoringElement),
|
|
31
|
+
...assertions.map(assertionToScoringElement),
|
|
32
|
+
];
|
|
33
|
+
return scoreView(elements, today, config);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Convenience wrapper — scores the view and formats the §11.6 header line.
|
|
37
|
+
* Returns an empty string for an empty element set so the caller can suppress
|
|
38
|
+
* the header (e.g. a single-law tree with no requirements). Re-exports
|
|
39
|
+
* {@link formatConfidenceHeader} for callers that already hold a `ViewScore`.
|
|
40
|
+
*/
|
|
41
|
+
export function complianceConfidenceHeader(requirements, assertions, today, config) {
|
|
42
|
+
return formatConfidenceHeader(scoreComplianceView(requirements, assertions, today, config));
|
|
43
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ComplianceCanon } from './classify.js';
|
|
2
|
+
export interface CoverageMetricSubjects {
|
|
3
|
+
products?: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface CoverageMetricScope {
|
|
6
|
+
jurisdictions?: string[];
|
|
7
|
+
codex?: string[];
|
|
8
|
+
subjects?: CoverageMetricSubjects;
|
|
9
|
+
}
|
|
10
|
+
export interface CoverageMetricThresholds {
|
|
11
|
+
/** Coverage fraction (0–1) at or above which the status is green. */
|
|
12
|
+
green: number;
|
|
13
|
+
/** Coverage fraction at or above which the status is amber (below green). */
|
|
14
|
+
amber: number;
|
|
15
|
+
}
|
|
16
|
+
export interface CoverageMetricConfig {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
date?: string;
|
|
21
|
+
version?: string;
|
|
22
|
+
scope: CoverageMetricScope;
|
|
23
|
+
thresholds: CoverageMetricThresholds;
|
|
24
|
+
}
|
|
25
|
+
export type ParseCoverageMetricResult = {
|
|
26
|
+
ok: true;
|
|
27
|
+
config: CoverageMetricConfig;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
errors: string[];
|
|
31
|
+
};
|
|
32
|
+
export type RagStatus = 'green' | 'amber' | 'red' | 'no_data';
|
|
33
|
+
export interface CoverageRow {
|
|
34
|
+
codexId: string;
|
|
35
|
+
/** Jurisdiction from the scanned canon codex doc, if available. */
|
|
36
|
+
jurisdiction?: string;
|
|
37
|
+
totalRequirements: number;
|
|
38
|
+
compliant: number;
|
|
39
|
+
partial: number;
|
|
40
|
+
non_compliant: number;
|
|
41
|
+
under_review: number;
|
|
42
|
+
/** Requirements with no admitted assertion for the scoped products. */
|
|
43
|
+
gap: number;
|
|
44
|
+
/** compliant + partial. */
|
|
45
|
+
coveredCount: number;
|
|
46
|
+
/** coveredCount / totalRequirements (0–1). 0 when totalRequirements === 0. */
|
|
47
|
+
coveragePct: number;
|
|
48
|
+
ragStatus: RagStatus;
|
|
49
|
+
}
|
|
50
|
+
export interface CoverageMatrix {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
date?: string;
|
|
55
|
+
version?: string;
|
|
56
|
+
rows: CoverageRow[];
|
|
57
|
+
thresholds: CoverageMetricThresholds;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Validate and normalise a raw (YAML-parsed) document into a
|
|
61
|
+
* `CoverageMetricConfig`. Accepts both the bare top-level object and the
|
|
62
|
+
* wrapped form (`{ coverage_metric: { … } }`).
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseCoverageMetricConfig(raw: unknown): ParseCoverageMetricResult;
|
|
65
|
+
/**
|
|
66
|
+
* Compute per-codex coverage statistics.
|
|
67
|
+
*
|
|
68
|
+
* For each law (codex ID) in `config.scope.codex`:
|
|
69
|
+
* - Collect requirements whose `derived_from` includes that law.
|
|
70
|
+
* - Optionally restrict to assertions for `config.scope.subjects.products`.
|
|
71
|
+
* - Compute compliant / partial / non_compliant / under_review / gap counts.
|
|
72
|
+
* - Compute coverage % = (compliant + partial) / total and apply RAG.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildCoverageMatrix(canon: ComplianceCanon, config: CoverageMetricConfig): CoverageMatrix;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// Coverage-metric view renderer — methodology/notations/views/22-coverage-metric.md
|
|
2
|
+
//
|
|
3
|
+
// Builds a per-codex (law) coverage summary: for each law in scope, how many
|
|
4
|
+
// of its requirements are covered by at least one compliant/partial assertion
|
|
5
|
+
// across the scoped products, and what is the RAG status against the configured
|
|
6
|
+
// thresholds.
|
|
7
|
+
import { buildComplianceIndex } from './reverse-index.js';
|
|
8
|
+
// ── Parser ───────────────────────────────────────────────────────────────────
|
|
9
|
+
/**
|
|
10
|
+
* Validate and normalise a raw (YAML-parsed) document into a
|
|
11
|
+
* `CoverageMetricConfig`. Accepts both the bare top-level object and the
|
|
12
|
+
* wrapped form (`{ coverage_metric: { … } }`).
|
|
13
|
+
*/
|
|
14
|
+
export function parseCoverageMetricConfig(raw) {
|
|
15
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
16
|
+
return { ok: false, errors: ['coverage-metric: expected an object at the document root'] };
|
|
17
|
+
}
|
|
18
|
+
const top = raw;
|
|
19
|
+
// Unwrap optional `coverage_metric:` wrapper.
|
|
20
|
+
const v = 'coverage_metric' in top &&
|
|
21
|
+
top.coverage_metric &&
|
|
22
|
+
typeof top.coverage_metric === 'object' &&
|
|
23
|
+
!Array.isArray(top.coverage_metric)
|
|
24
|
+
? top.coverage_metric
|
|
25
|
+
: top;
|
|
26
|
+
const errors = [];
|
|
27
|
+
if (!v.id || typeof v.id !== 'string')
|
|
28
|
+
errors.push('coverage_metric.id: required string');
|
|
29
|
+
if (!v.name || typeof v.name !== 'string')
|
|
30
|
+
errors.push('coverage_metric.name: required string');
|
|
31
|
+
if (errors.length)
|
|
32
|
+
return { ok: false, errors };
|
|
33
|
+
const rawScope = v.scope && typeof v.scope === 'object' && !Array.isArray(v.scope)
|
|
34
|
+
? v.scope
|
|
35
|
+
: {};
|
|
36
|
+
const rawSubjects = rawScope.subjects && typeof rawScope.subjects === 'object' && !Array.isArray(rawScope.subjects)
|
|
37
|
+
? rawScope.subjects
|
|
38
|
+
: {};
|
|
39
|
+
const rawThresholds = v.thresholds && typeof v.thresholds === 'object' && !Array.isArray(v.thresholds)
|
|
40
|
+
? v.thresholds
|
|
41
|
+
: {};
|
|
42
|
+
const greenRaw = typeof rawThresholds.green === 'number' ? rawThresholds.green : 0.8;
|
|
43
|
+
const amberRaw = typeof rawThresholds.amber === 'number' ? rawThresholds.amber : 0.5;
|
|
44
|
+
const config = {
|
|
45
|
+
id: v.id,
|
|
46
|
+
name: v.name,
|
|
47
|
+
description: typeof v.description === 'string' ? v.description : undefined,
|
|
48
|
+
date: typeof v.date === 'string' ? v.date : undefined,
|
|
49
|
+
version: typeof v.version === 'string' ? v.version : undefined,
|
|
50
|
+
scope: {
|
|
51
|
+
jurisdictions: Array.isArray(rawScope.jurisdictions)
|
|
52
|
+
? rawScope.jurisdictions.filter((x) => typeof x === 'string')
|
|
53
|
+
: undefined,
|
|
54
|
+
codex: Array.isArray(rawScope.codex)
|
|
55
|
+
? rawScope.codex.filter((x) => typeof x === 'string')
|
|
56
|
+
: undefined,
|
|
57
|
+
subjects: {
|
|
58
|
+
products: Array.isArray(rawSubjects.products)
|
|
59
|
+
? rawSubjects.products.filter((x) => typeof x === 'string')
|
|
60
|
+
: undefined,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
thresholds: {
|
|
64
|
+
green: Math.max(0, Math.min(1, greenRaw)),
|
|
65
|
+
amber: Math.max(0, Math.min(1, amberRaw)),
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
return { ok: true, config };
|
|
69
|
+
}
|
|
70
|
+
// ── Builder ───────────────────────────────────────────────────────────────────
|
|
71
|
+
const ADMITTED = new Set(['compliant', 'partial', 'non_compliant', 'under_review', 'n_a']);
|
|
72
|
+
/** Worst-case aggregate across multiple assertions (excludes n_a when others exist). */
|
|
73
|
+
function aggregateStatus(assertions) {
|
|
74
|
+
let sawPartial = false;
|
|
75
|
+
let sawUnderReview = false;
|
|
76
|
+
let sawCompliant = false;
|
|
77
|
+
for (const a of assertions) {
|
|
78
|
+
if (a.status === 'non_compliant')
|
|
79
|
+
return 'non_compliant';
|
|
80
|
+
if (a.status === 'partial')
|
|
81
|
+
sawPartial = true;
|
|
82
|
+
else if (a.status === 'under_review')
|
|
83
|
+
sawUnderReview = true;
|
|
84
|
+
else if (a.status === 'compliant')
|
|
85
|
+
sawCompliant = true;
|
|
86
|
+
}
|
|
87
|
+
if (sawPartial)
|
|
88
|
+
return 'partial';
|
|
89
|
+
if (sawUnderReview)
|
|
90
|
+
return 'under_review';
|
|
91
|
+
if (sawCompliant)
|
|
92
|
+
return 'compliant';
|
|
93
|
+
return 'n_a';
|
|
94
|
+
}
|
|
95
|
+
function ragFromPct(pct, thresholds, hasData) {
|
|
96
|
+
if (!hasData)
|
|
97
|
+
return 'no_data';
|
|
98
|
+
if (pct >= thresholds.green)
|
|
99
|
+
return 'green';
|
|
100
|
+
if (pct >= thresholds.amber)
|
|
101
|
+
return 'amber';
|
|
102
|
+
return 'red';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Compute per-codex coverage statistics.
|
|
106
|
+
*
|
|
107
|
+
* For each law (codex ID) in `config.scope.codex`:
|
|
108
|
+
* - Collect requirements whose `derived_from` includes that law.
|
|
109
|
+
* - Optionally restrict to assertions for `config.scope.subjects.products`.
|
|
110
|
+
* - Compute compliant / partial / non_compliant / under_review / gap counts.
|
|
111
|
+
* - Compute coverage % = (compliant + partial) / total and apply RAG.
|
|
112
|
+
*/
|
|
113
|
+
export function buildCoverageMatrix(canon, config) {
|
|
114
|
+
const index = buildComplianceIndex({
|
|
115
|
+
requirements: canon.requirements,
|
|
116
|
+
assertions: canon.assertions,
|
|
117
|
+
});
|
|
118
|
+
const codexList = config.scope.codex ?? [];
|
|
119
|
+
const productList = config.scope.subjects?.products ?? [];
|
|
120
|
+
const rows = [];
|
|
121
|
+
for (const codexId of codexList) {
|
|
122
|
+
const reqs = index.requirementsByLaw.get(codexId) ?? [];
|
|
123
|
+
const codexDoc = canon.codex.find(c => c.id === codexId);
|
|
124
|
+
const jurisdiction = codexDoc?.jurisdiction;
|
|
125
|
+
let compliant = 0;
|
|
126
|
+
let partial = 0;
|
|
127
|
+
let non_compliant = 0;
|
|
128
|
+
let under_review = 0;
|
|
129
|
+
let gap = 0;
|
|
130
|
+
for (const req of reqs) {
|
|
131
|
+
const allAssertions = index.assertionsByRequirement.get(req.id) ?? [];
|
|
132
|
+
// Filter to admitted statuses, then optionally to scoped products.
|
|
133
|
+
const admitted = allAssertions.filter(a => ADMITTED.has(a.status));
|
|
134
|
+
const scoped = productList.length > 0
|
|
135
|
+
? admitted.filter(a => productList.includes(a.subject))
|
|
136
|
+
: admitted;
|
|
137
|
+
// Exclude pure n_a assertions from counting as coverage.
|
|
138
|
+
const active = scoped.filter(a => a.status !== 'n_a');
|
|
139
|
+
if (active.length === 0) {
|
|
140
|
+
gap++;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const status = aggregateStatus(active);
|
|
144
|
+
if (status === 'compliant')
|
|
145
|
+
compliant++;
|
|
146
|
+
else if (status === 'partial')
|
|
147
|
+
partial++;
|
|
148
|
+
else if (status === 'non_compliant')
|
|
149
|
+
non_compliant++;
|
|
150
|
+
else if (status === 'under_review')
|
|
151
|
+
under_review++;
|
|
152
|
+
else
|
|
153
|
+
gap++;
|
|
154
|
+
}
|
|
155
|
+
const total = reqs.length;
|
|
156
|
+
const coveredCount = compliant + partial;
|
|
157
|
+
const coveragePct = total > 0 ? coveredCount / total : 0;
|
|
158
|
+
rows.push({
|
|
159
|
+
codexId,
|
|
160
|
+
jurisdiction,
|
|
161
|
+
totalRequirements: total,
|
|
162
|
+
compliant,
|
|
163
|
+
partial,
|
|
164
|
+
non_compliant,
|
|
165
|
+
under_review,
|
|
166
|
+
gap,
|
|
167
|
+
coveredCount,
|
|
168
|
+
coveragePct,
|
|
169
|
+
ragStatus: ragFromPct(coveragePct, config.thresholds, total > 0),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
id: config.id,
|
|
174
|
+
name: config.name,
|
|
175
|
+
description: config.description,
|
|
176
|
+
date: config.date,
|
|
177
|
+
version: config.version,
|
|
178
|
+
rows,
|
|
179
|
+
thresholds: config.thresholds,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComplianceIndex, IndexAssertion, IndexRequirement } from './types.js';
|
|
2
|
+
export interface GapReport {
|
|
3
|
+
/** Requirements with no assertion about them, severity-sorted then id. */
|
|
4
|
+
requirementsWithoutAssertions: IndexRequirement[];
|
|
5
|
+
/** ASSERT-007: positive status (compliant/partial) with empty evidence. */
|
|
6
|
+
assertionsWithoutEvidence: IndexAssertion[];
|
|
7
|
+
/** ASSERT-008: next_review_at in the past (only when `today` is supplied). */
|
|
8
|
+
staleAssertions: IndexAssertion[];
|
|
9
|
+
/**
|
|
10
|
+
* CV-5: requirements whose `deadline` is `past_due` (deadline < today) AND
|
|
11
|
+
* that lack a fully-compliant assertion. Deadline-missed gaps, deadline-sorted
|
|
12
|
+
* (oldest first). Empty when `today` is not supplied.
|
|
13
|
+
*/
|
|
14
|
+
pastDeadlineRequirements: IndexRequirement[];
|
|
15
|
+
}
|
|
16
|
+
export interface GapReportOptions {
|
|
17
|
+
/** Today as ISO `YYYY-MM-DD`; required for the stale-assertion list. */
|
|
18
|
+
today?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function buildGapReport(index: ComplianceIndex, options?: GapReportOptions): GapReport;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Gap dashboard report (vkgeorgia/strategy#84 Phase 4 / CV-5).
|
|
2
|
+
//
|
|
3
|
+
// Four operational gap lists computed from the shared reverse-index (Phase 3):
|
|
4
|
+
// 1. Requirements with no Assertion targeting them (severity-sorted).
|
|
5
|
+
// 2. Assertions without evidence — the ASSERT-007 case: status ∈
|
|
6
|
+
// {compliant, partial} AND no evidence. `under_review` / `non_compliant` /
|
|
7
|
+
// `n_a` are NOT positive statuses, so an empty-evidence assertion in those
|
|
8
|
+
// states is legitimate and is not flagged (matches 16-assertion.md §5).
|
|
9
|
+
// 3. Stale Assertions — the ASSERT-008 case: `next_review_at` is in the past.
|
|
10
|
+
// 4. Past-deadline requirements (CV-5) — REQUIREMENT.deadline < today AND
|
|
11
|
+
// the requirement has no fully-compliant assertion. Deadline-missed gaps.
|
|
12
|
+
import { computeDeadlineStatus } from './impact.js';
|
|
13
|
+
const SEVERITY_RANK = { high: 0, medium: 1, low: 2 };
|
|
14
|
+
function severityRank(s) {
|
|
15
|
+
return s !== undefined && s in SEVERITY_RANK ? SEVERITY_RANK[s] : 3;
|
|
16
|
+
}
|
|
17
|
+
/** Flattens the by-requirement index back to the full assertion set (each
|
|
18
|
+
* assertion has exactly one `about`, so it appears once). */
|
|
19
|
+
function allAssertions(index) {
|
|
20
|
+
const out = [];
|
|
21
|
+
for (const list of index.assertionsByRequirement.values())
|
|
22
|
+
out.push(...list);
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
export function buildGapReport(index, options = {}) {
|
|
26
|
+
const { today } = options;
|
|
27
|
+
const requirementsWithoutAssertions = [...index.requirementById.values()]
|
|
28
|
+
.filter(r => (index.assertionsByRequirement.get(r.id) ?? []).length === 0)
|
|
29
|
+
.sort((a, b) => {
|
|
30
|
+
const d = severityRank(a.severity) - severityRank(b.severity);
|
|
31
|
+
return d !== 0 ? d : a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
32
|
+
});
|
|
33
|
+
const assertions = allAssertions(index);
|
|
34
|
+
const assertionsWithoutEvidence = assertions
|
|
35
|
+
.filter(a => (a.status === 'compliant' || a.status === 'partial') && (a.evidenceCount ?? 0) === 0)
|
|
36
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
37
|
+
const staleAssertions = (today
|
|
38
|
+
? assertions.filter(a => typeof a.next_review_at === 'string' && a.next_review_at < today)
|
|
39
|
+
: []).sort((a, b) => {
|
|
40
|
+
// Oldest review first — most overdue at the top.
|
|
41
|
+
const ra = a.next_review_at ?? '';
|
|
42
|
+
const rb = b.next_review_at ?? '';
|
|
43
|
+
return ra < rb ? -1 : ra > rb ? 1 : a.id < b.id ? -1 : 1;
|
|
44
|
+
});
|
|
45
|
+
// CV-5: past-deadline requirements — deadline < today, not fully compliant.
|
|
46
|
+
const pastDeadlineRequirements = today
|
|
47
|
+
? [...index.requirementById.values()]
|
|
48
|
+
.filter(r => {
|
|
49
|
+
if (computeDeadlineStatus(r.deadline, today) !== 'past_due')
|
|
50
|
+
return false;
|
|
51
|
+
// Check if any assertion claims compliant status for this requirement.
|
|
52
|
+
const assertions = index.assertionsByRequirement.get(r.id) ?? [];
|
|
53
|
+
const hasCompliant = assertions.some(a => a.status === 'compliant');
|
|
54
|
+
return !hasCompliant;
|
|
55
|
+
})
|
|
56
|
+
.sort((a, b) => {
|
|
57
|
+
// Oldest deadline first — most overdue at the top.
|
|
58
|
+
const da = a.deadline ?? '';
|
|
59
|
+
const db = b.deadline ?? '';
|
|
60
|
+
return da < db ? -1 : da > db ? 1 : a.id < b.id ? -1 : 1;
|
|
61
|
+
})
|
|
62
|
+
: [];
|
|
63
|
+
return { requirementsWithoutAssertions, assertionsWithoutEvidence, staleAssertions, pastDeadlineRequirements };
|
|
64
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComplianceCanon } from './classify.js';
|
|
2
|
+
import type { ReportScope } from './markdown.js';
|
|
3
|
+
import type { ImpactMatrix } from './impact.js';
|
|
4
|
+
export interface HtmlOptions {
|
|
5
|
+
/** Today as ISO YYYY-MM-DD — enables the gap dashboard's stale-assertion list and is stamped in the footer. */
|
|
6
|
+
today?: string;
|
|
7
|
+
/** Title override; defaults to the per-scope title. */
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Renders the requested compliance view from a scanned canon to a complete HTML document. */
|
|
11
|
+
export declare function renderComplianceHtml(canon: ComplianceCanon, scope: ReportScope, options?: HtmlOptions): string;
|
|
12
|
+
export interface ImpactMatrixHtmlOptions {
|
|
13
|
+
/** Today as ISO YYYY-MM-DD — stamped in the document header. */
|
|
14
|
+
today?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders an `ImpactMatrix` (from `buildImpactMatrix`) as a self-contained
|
|
18
|
+
* A4 HTML document suitable for WeasyPrint PDF output.
|
|
19
|
+
*
|
|
20
|
+
* Used by `cervin export-compliance --report <id> --format pdf`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function renderImpactMatrixHtml(matrix: ImpactMatrix, options?: ImpactMatrixHtmlOptions): string;
|