@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,188 @@
|
|
|
1
|
+
// Pins CONTRACT §11 — source-trust scale, freshness curve, element confidence,
|
|
2
|
+
// view composite, unsourced handling, manifest decay resolution, A–D bands.
|
|
3
|
+
import { describe, it, expect } from 'vitest';
|
|
4
|
+
import { IMPLICIT_DECAY_DEFAULTS, composeView, confidenceBand, formatConfidenceHeader, freshness, resolveDecayParams, scoreElement, scoreView, sourceTrustWeight, } from '../score.js';
|
|
5
|
+
const D = { fresh_days: 100, stale_days: 200, floor: 0.3 };
|
|
6
|
+
describe('sourceTrustWeight (§11.2)', () => {
|
|
7
|
+
it('matches the closed scale', () => {
|
|
8
|
+
expect(sourceTrustWeight('authoritative')).toBe(1.0);
|
|
9
|
+
expect(sourceTrustWeight('corroborated')).toBe(0.8);
|
|
10
|
+
expect(sourceTrustWeight('single_source')).toBe(0.5);
|
|
11
|
+
expect(sourceTrustWeight('unverified')).toBe(0.25);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
describe('freshness (§11.3)', () => {
|
|
15
|
+
const today = '2026-06-05';
|
|
16
|
+
it('returns 1.0 when age ≤ fresh_days', () => {
|
|
17
|
+
expect(freshness('2026-05-01', today, D)).toBe(1.0);
|
|
18
|
+
expect(freshness('2026-06-05', today, D)).toBe(1.0);
|
|
19
|
+
});
|
|
20
|
+
it('returns floor when age ≥ stale_days', () => {
|
|
21
|
+
expect(freshness('2025-01-01', today, D)).toBeCloseTo(0.3, 10);
|
|
22
|
+
const exactlyStale = '2025-11-17';
|
|
23
|
+
expect(freshness(exactlyStale, today, { fresh_days: 100, stale_days: 200, floor: 0.3 })).toBeCloseTo(0.3, 10);
|
|
24
|
+
});
|
|
25
|
+
it('interpolates linearly between fresh_days and stale_days', () => {
|
|
26
|
+
// midpoint: age 150 → 1.0 − (1.0 − 0.3) · (150 − 100) / (200 − 100) = 0.65
|
|
27
|
+
const midAge = new Date(Date.UTC(2026, 5, 5));
|
|
28
|
+
midAge.setUTCDate(midAge.getUTCDate() - 150);
|
|
29
|
+
const iso = midAge.toISOString().slice(0, 10);
|
|
30
|
+
expect(freshness(iso, today, D)).toBeCloseTo(0.65, 10);
|
|
31
|
+
});
|
|
32
|
+
it('clamps future-dated admitted_at to 1.0', () => {
|
|
33
|
+
expect(freshness('2030-01-01', today, D)).toBe(1.0);
|
|
34
|
+
});
|
|
35
|
+
it('treats absent admitted_at as fully stale (returns floor)', () => {
|
|
36
|
+
expect(freshness(undefined, today, D)).toBe(0.3);
|
|
37
|
+
});
|
|
38
|
+
it('treats unparseable admitted_at as fully stale', () => {
|
|
39
|
+
expect(freshness('not-a-date', today, D)).toBe(0.3);
|
|
40
|
+
expect(freshness('2026/06/05', today, D)).toBe(0.3);
|
|
41
|
+
expect(freshness('2026-13-01', today, D)).toBe(0.3);
|
|
42
|
+
});
|
|
43
|
+
it('returns floor when stale_days <= fresh_days (degenerate config) and age exceeds fresh', () => {
|
|
44
|
+
// age 365d for 2025-06-05; both branches collapse to floor.
|
|
45
|
+
expect(freshness('2025-06-05', today, { fresh_days: 100, stale_days: 100, floor: 0.4 })).toBe(0.4);
|
|
46
|
+
expect(freshness('2025-06-05', today, { fresh_days: 200, stale_days: 100, floor: 0.4 })).toBe(0.4);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('resolveDecayParams (§11.3 + MANIFEST §2)', () => {
|
|
50
|
+
const config = {
|
|
51
|
+
defaults: { fresh_days: 180, stale_days: 730, floor: 0.3 },
|
|
52
|
+
by_type: {
|
|
53
|
+
CAPABILITY: { fresh_days: 365, stale_days: 1825 },
|
|
54
|
+
APPLICATION: { fresh_days: 180, stale_days: 730 },
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
it('uses by_type overrides and inherits missing fields from defaults', () => {
|
|
58
|
+
// Pins the §11.3 example: CAPABILITY overrides fresh/stale but inherits floor=0.3.
|
|
59
|
+
expect(resolveDecayParams('CAPABILITY', config)).toEqual({ fresh_days: 365, stale_days: 1825, floor: 0.3 });
|
|
60
|
+
});
|
|
61
|
+
it('falls back to defaults for an unknown TYPE', () => {
|
|
62
|
+
expect(resolveDecayParams('PROCESS', config)).toEqual({ fresh_days: 180, stale_days: 730, floor: 0.3 });
|
|
63
|
+
});
|
|
64
|
+
it('falls back to §11.3 implicit defaults when the whole block is omitted', () => {
|
|
65
|
+
expect(resolveDecayParams('CAPABILITY', undefined)).toEqual(IMPLICIT_DECAY_DEFAULTS);
|
|
66
|
+
expect(resolveDecayParams('CAPABILITY', {})).toEqual(IMPLICIT_DECAY_DEFAULTS);
|
|
67
|
+
});
|
|
68
|
+
it('fills missing defaults fields from §11.3 implicit defaults', () => {
|
|
69
|
+
const partial = { defaults: { floor: 0.5 } };
|
|
70
|
+
expect(resolveDecayParams('PROCESS', partial)).toEqual({
|
|
71
|
+
fresh_days: IMPLICIT_DECAY_DEFAULTS.fresh_days,
|
|
72
|
+
stale_days: IMPLICIT_DECAY_DEFAULTS.stale_days,
|
|
73
|
+
floor: 0.5,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('scoreElement (§11.4–11.5)', () => {
|
|
78
|
+
const today = '2026-06-05';
|
|
79
|
+
it('takes the max source-trust weight (§11.4): extra weak sources never subtract', () => {
|
|
80
|
+
const score = scoreElement({ type: 'CAPABILITY', admitted_at: today, sources: ['unverified', 'authoritative', 'single_source'] }, today);
|
|
81
|
+
expect(score.source_trust).toBe(1.0);
|
|
82
|
+
expect(score.confidence).toBe(1.0);
|
|
83
|
+
expect(score.sourced).toBe(true);
|
|
84
|
+
});
|
|
85
|
+
it('multiplies source_trust by freshness', () => {
|
|
86
|
+
// §11.4 worked example: authoritative · floor.
|
|
87
|
+
const score = scoreElement({ type: 'X', admitted_at: '2024-01-01', sources: ['authoritative'] }, today, { defaults: D });
|
|
88
|
+
expect(score.source_trust).toBe(1.0);
|
|
89
|
+
expect(score.freshness).toBeCloseTo(0.3, 10);
|
|
90
|
+
expect(score.confidence).toBeCloseTo(0.3, 10);
|
|
91
|
+
});
|
|
92
|
+
it('marks unsourced elements at the unverified floor (§11.5) and sourced=false', () => {
|
|
93
|
+
const undef = scoreElement({ type: 'X', admitted_at: today }, today);
|
|
94
|
+
const empty = scoreElement({ type: 'X', admitted_at: today, sources: [] }, today);
|
|
95
|
+
for (const score of [undef, empty]) {
|
|
96
|
+
expect(score.source_trust).toBe(0.25);
|
|
97
|
+
expect(score.sourced).toBe(false);
|
|
98
|
+
expect(score.confidence).toBeCloseTo(0.25, 10);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
it('distinguishes unsourced (counted separately) from sourced-but-unverified', () => {
|
|
102
|
+
const unsourced = scoreElement({ type: 'X', admitted_at: today }, today);
|
|
103
|
+
const sourcedUnverified = scoreElement({ type: 'X', admitted_at: today, sources: ['unverified'] }, today);
|
|
104
|
+
expect(unsourced.source_trust).toBe(sourcedUnverified.source_trust);
|
|
105
|
+
expect(unsourced.sourced).toBe(false);
|
|
106
|
+
expect(sourcedUnverified.sourced).toBe(true);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe('confidenceBand (§11.6)', () => {
|
|
110
|
+
it('uses the documented thresholds', () => {
|
|
111
|
+
expect(confidenceBand(1.0)).toBe('A');
|
|
112
|
+
expect(confidenceBand(0.8)).toBe('A');
|
|
113
|
+
expect(confidenceBand(0.79)).toBe('B');
|
|
114
|
+
expect(confidenceBand(0.6)).toBe('B');
|
|
115
|
+
expect(confidenceBand(0.59)).toBe('C');
|
|
116
|
+
expect(confidenceBand(0.4)).toBe('C');
|
|
117
|
+
expect(confidenceBand(0.39)).toBe('D');
|
|
118
|
+
expect(confidenceBand(0)).toBe('D');
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe('composeView (§11.6)', () => {
|
|
122
|
+
it('headlines weakest link, reports mean and coverage', () => {
|
|
123
|
+
const composite = composeView([
|
|
124
|
+
{ source_trust: 1.0, freshness: 1.0, confidence: 1.0, sourced: true },
|
|
125
|
+
{ source_trust: 0.5, freshness: 0.8, confidence: 0.4, sourced: true },
|
|
126
|
+
{ source_trust: 0.25, freshness: 1.0, confidence: 0.25, sourced: false },
|
|
127
|
+
]);
|
|
128
|
+
expect(composite.weakest_link).toBeCloseTo(0.25, 10);
|
|
129
|
+
expect(composite.band).toBe('D');
|
|
130
|
+
expect(composite.mean).toBeCloseTo((1.0 + 0.4 + 0.25) / 3, 10);
|
|
131
|
+
expect(composite.coverage).toBeCloseTo(2 / 3, 10);
|
|
132
|
+
expect(composite.element_count).toBe(3);
|
|
133
|
+
expect(composite.unsourced_count).toBe(1);
|
|
134
|
+
});
|
|
135
|
+
it('returns a degenerate composite (band D, counts 0) for an empty set', () => {
|
|
136
|
+
const composite = composeView([]);
|
|
137
|
+
expect(composite.element_count).toBe(0);
|
|
138
|
+
expect(composite.weakest_link).toBe(0);
|
|
139
|
+
expect(composite.mean).toBe(0);
|
|
140
|
+
expect(composite.coverage).toBe(0);
|
|
141
|
+
expect(composite.band).toBe('D');
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
describe('scoreView end-to-end', () => {
|
|
145
|
+
const today = '2026-06-05';
|
|
146
|
+
it('composes weakest-link / mean / coverage / band from heterogenous elements', () => {
|
|
147
|
+
const view = scoreView([
|
|
148
|
+
// weakest link = 0.50 → band C
|
|
149
|
+
{ type: 'X', admitted_at: today, sources: ['authoritative'] }, // 1.00
|
|
150
|
+
{ type: 'X', admitted_at: today, sources: ['corroborated'] }, // 0.80
|
|
151
|
+
{ type: 'X', admitted_at: today, sources: ['single_source'] }, // 0.50
|
|
152
|
+
{ type: 'X', admitted_at: today, sources: ['corroborated'] }, // 0.80
|
|
153
|
+
], today);
|
|
154
|
+
expect(view.composite.weakest_link).toBeCloseTo(0.5, 10);
|
|
155
|
+
expect(view.composite.band).toBe('C');
|
|
156
|
+
expect(view.composite.mean).toBeCloseTo((1.0 + 0.8 + 0.5 + 0.8) / 4, 10);
|
|
157
|
+
expect(view.composite.coverage).toBe(1);
|
|
158
|
+
expect(view.composite.unsourced_count).toBe(0);
|
|
159
|
+
expect(view.today).toBe(today);
|
|
160
|
+
});
|
|
161
|
+
it('accepts Date for today and converts to ISO', () => {
|
|
162
|
+
const view = scoreView([{ type: 'X', admitted_at: '2026-06-05', sources: ['authoritative'] }], new Date(Date.UTC(2026, 5, 5)));
|
|
163
|
+
expect(view.today).toBe('2026-06-05');
|
|
164
|
+
expect(view.composite.band).toBe('A');
|
|
165
|
+
});
|
|
166
|
+
it('reports band D and 0% coverage when every element is unsourced and fully stale', () => {
|
|
167
|
+
const view = scoreView([
|
|
168
|
+
{ type: 'X' },
|
|
169
|
+
{ type: 'X' },
|
|
170
|
+
], '2026-06-05', { defaults: D });
|
|
171
|
+
// unsourced (0.25) · freshness floor (0.3) = 0.075 → band D.
|
|
172
|
+
expect(view.composite.coverage).toBe(0);
|
|
173
|
+
expect(view.composite.unsourced_count).toBe(2);
|
|
174
|
+
expect(view.composite.band).toBe('D');
|
|
175
|
+
expect(view.composite.weakest_link).toBeCloseTo(0.075, 10);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe('formatConfidenceHeader (§11.6)', () => {
|
|
179
|
+
it('renders the documented header shape', () => {
|
|
180
|
+
const view = scoreView([{ type: 'X', admitted_at: '2026-06-05', sources: ['corroborated'] }], '2026-06-05');
|
|
181
|
+
// corroborated (0.8) · freshness 1.0 = 0.80 → band A (A is ≥ 0.8).
|
|
182
|
+
expect(formatConfidenceHeader(view)).toBe('Data confidence (as of 2026-06-05): A (weakest link) · 0.80 mean · 100% sourced');
|
|
183
|
+
});
|
|
184
|
+
it('returns an empty string for an empty composite', () => {
|
|
185
|
+
const view = scoreView([], '2026-06-05');
|
|
186
|
+
expect(formatConfidenceHeader(view)).toBe('');
|
|
187
|
+
});
|
|
188
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { IMPLICIT_DECAY_DEFAULTS, composeView, confidenceBand, formatConfidenceHeader, freshness, resolveDecayParams, scoreElement, scoreView, sourceTrustWeight, } from './score.js';
|
|
2
|
+
export type { ConfidenceBand, ConfidenceDecayConfig, DecayParams, ElementScore, ScoringElement, SourceQuality, ViewComposite, ViewScore, } from './types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IMPLICIT_DECAY_DEFAULTS, composeView, confidenceBand, formatConfidenceHeader, freshness, resolveDecayParams, scoreElement, scoreView, sourceTrustWeight, } from './score.js';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ConfidenceBand, ConfidenceDecayConfig, DecayParams, ElementScore, ScoringElement, SourceQuality, ViewComposite, ViewScore } from './types.js';
|
|
2
|
+
/** §11.3 implicit defaults — used when the adopter omits `confidence_decay`. */
|
|
3
|
+
export declare const IMPLICIT_DECAY_DEFAULTS: DecayParams;
|
|
4
|
+
export declare function sourceTrustWeight(q: SourceQuality): number;
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the decay parameters for one element TYPE: `by_type[type]` overrides
|
|
7
|
+
* `defaults`, which overrides {@link IMPLICIT_DECAY_DEFAULTS}. Each field
|
|
8
|
+
* resolves independently — a `by_type` entry that sets only `fresh_days` /
|
|
9
|
+
* `stale_days` inherits `floor` from `defaults` (per the §11.3 example).
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveDecayParams(type: string, config?: ConfidenceDecayConfig): DecayParams;
|
|
12
|
+
/**
|
|
13
|
+
* Computes freshness per CONTRACT §11.3.
|
|
14
|
+
*
|
|
15
|
+
* ```
|
|
16
|
+
* freshness = 1.0 if age_days ≤ fresh_days
|
|
17
|
+
* = floor if age_days ≥ stale_days
|
|
18
|
+
* = 1.0 − (1.0 − floor) · (age_days − fresh_days) / (stale_days − fresh_days) otherwise
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Future-dated `admitted_at` (negative age) is clamped to 1.0. An absent or
|
|
22
|
+
* unparseable `admitted_at` returns `floor` — the element is treated as fully
|
|
23
|
+
* stale, never as fresh.
|
|
24
|
+
*/
|
|
25
|
+
export declare function freshness(admittedAt: string | undefined, today: string, params: DecayParams): number;
|
|
26
|
+
/**
|
|
27
|
+
* Scores one element per §11.4–11.5. The element's `sources` list is the
|
|
28
|
+
* resolved `derived_from` provenance: max trust wins (`max` in §11.4), and
|
|
29
|
+
* an empty / absent list marks the element unsourced — scored at the
|
|
30
|
+
* `unverified` floor and `sourced: false` so the view composite can count
|
|
31
|
+
* it separately per §11.5.
|
|
32
|
+
*/
|
|
33
|
+
export declare function scoreElement(element: ScoringElement, today: string, config?: ConfidenceDecayConfig): ElementScore;
|
|
34
|
+
/** Confidence band per §11.6: A ≥ 0.8, B ≥ 0.6, C ≥ 0.4, D < 0.4. */
|
|
35
|
+
export declare function confidenceBand(confidence: number): ConfidenceBand;
|
|
36
|
+
/**
|
|
37
|
+
* Rolls per-element scores up to the view composite per §11.6. The weakest
|
|
38
|
+
* link is the headline; mean and coverage are reported alongside. An empty
|
|
39
|
+
* element set returns a degenerate composite (`weakest_link` and `mean` of 0,
|
|
40
|
+
* coverage 0, band `D`) — callers should detect `element_count === 0` if they
|
|
41
|
+
* want to suppress the header entirely rather than display the floor.
|
|
42
|
+
*/
|
|
43
|
+
export declare function composeView(scores: ElementScore[]): ViewComposite;
|
|
44
|
+
/**
|
|
45
|
+
* Scores a view's elements end-to-end. The caller passes the rendered set,
|
|
46
|
+
* the adopter manifest's `confidence_decay` block (optional), and the
|
|
47
|
+
* reference date (`today`); the result is purely derived and never stored
|
|
48
|
+
* — re-running on the same inputs yields the same numbers (§11.6).
|
|
49
|
+
*/
|
|
50
|
+
export declare function scoreView(elements: ScoringElement[], today: string | Date, config?: ConfidenceDecayConfig): ViewScore;
|
|
51
|
+
/**
|
|
52
|
+
* Renders the §11.6 example header line, e.g.:
|
|
53
|
+
*
|
|
54
|
+
* ```
|
|
55
|
+
* Data confidence (as of 2026-06-05): B (weakest link) · 0.71 mean · 92% sourced
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* Shared between Studio (DQ-2) and DSM (DQ-5) so the banding/labels stay
|
|
59
|
+
* consistent across the two consumers. Returns an empty string for an empty
|
|
60
|
+
* composite — callers decide whether to suppress the header in that case.
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatConfidenceHeader(view: ViewScore): string;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// Pure confidence-scoring per methodology CONTRACT §11. No I/O, no mutation:
|
|
2
|
+
// callers (Studio previews, DSM React) pass already-resolved element inputs
|
|
3
|
+
// and a `today` reference; this module returns the per-element scores and
|
|
4
|
+
// the view composite. Lives in @transitrix/diagrams so Studio and DSM share
|
|
5
|
+
// one implementation (see vkgeorgia/strategy#159 — DQ-1).
|
|
6
|
+
/** §11.3 implicit defaults — used when the adopter omits `confidence_decay`. */
|
|
7
|
+
export const IMPLICIT_DECAY_DEFAULTS = {
|
|
8
|
+
fresh_days: 180,
|
|
9
|
+
stale_days: 730,
|
|
10
|
+
floor: 0.3,
|
|
11
|
+
};
|
|
12
|
+
/** §11.2 source-trust weights. The fallback for an unknown label is `unverified`. */
|
|
13
|
+
const SOURCE_TRUST_WEIGHTS = {
|
|
14
|
+
authoritative: 1.0,
|
|
15
|
+
corroborated: 0.8,
|
|
16
|
+
single_source: 0.5,
|
|
17
|
+
unverified: 0.25,
|
|
18
|
+
};
|
|
19
|
+
/** Weight for the `unverified` floor — both an explicit label and the unsourced fallback. */
|
|
20
|
+
const UNVERIFIED_WEIGHT = SOURCE_TRUST_WEIGHTS.unverified;
|
|
21
|
+
export function sourceTrustWeight(q) {
|
|
22
|
+
return SOURCE_TRUST_WEIGHTS[q] ?? UNVERIFIED_WEIGHT;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolves the decay parameters for one element TYPE: `by_type[type]` overrides
|
|
26
|
+
* `defaults`, which overrides {@link IMPLICIT_DECAY_DEFAULTS}. Each field
|
|
27
|
+
* resolves independently — a `by_type` entry that sets only `fresh_days` /
|
|
28
|
+
* `stale_days` inherits `floor` from `defaults` (per the §11.3 example).
|
|
29
|
+
*/
|
|
30
|
+
export function resolveDecayParams(type, config) {
|
|
31
|
+
const typeOverride = config?.by_type?.[type] ?? {};
|
|
32
|
+
const defaults = config?.defaults ?? {};
|
|
33
|
+
return {
|
|
34
|
+
fresh_days: pick(typeOverride.fresh_days, defaults.fresh_days, IMPLICIT_DECAY_DEFAULTS.fresh_days),
|
|
35
|
+
stale_days: pick(typeOverride.stale_days, defaults.stale_days, IMPLICIT_DECAY_DEFAULTS.stale_days),
|
|
36
|
+
floor: pick(typeOverride.floor, defaults.floor, IMPLICIT_DECAY_DEFAULTS.floor),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function pick(...values) {
|
|
40
|
+
for (const v of values)
|
|
41
|
+
if (typeof v === 'number' && Number.isFinite(v))
|
|
42
|
+
return v;
|
|
43
|
+
// The trailing implicit default is always finite; this is only reached if a
|
|
44
|
+
// caller passes a non-finite implicit default — which we treat as 0.
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Computes freshness per CONTRACT §11.3.
|
|
49
|
+
*
|
|
50
|
+
* ```
|
|
51
|
+
* freshness = 1.0 if age_days ≤ fresh_days
|
|
52
|
+
* = floor if age_days ≥ stale_days
|
|
53
|
+
* = 1.0 − (1.0 − floor) · (age_days − fresh_days) / (stale_days − fresh_days) otherwise
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* Future-dated `admitted_at` (negative age) is clamped to 1.0. An absent or
|
|
57
|
+
* unparseable `admitted_at` returns `floor` — the element is treated as fully
|
|
58
|
+
* stale, never as fresh.
|
|
59
|
+
*/
|
|
60
|
+
export function freshness(admittedAt, today, params) {
|
|
61
|
+
if (!admittedAt)
|
|
62
|
+
return params.floor;
|
|
63
|
+
const age = daysBetween(admittedAt, today);
|
|
64
|
+
if (age === null)
|
|
65
|
+
return params.floor;
|
|
66
|
+
if (age <= params.fresh_days)
|
|
67
|
+
return 1.0;
|
|
68
|
+
if (age >= params.stale_days)
|
|
69
|
+
return params.floor;
|
|
70
|
+
// Linear interpolation. Guard against a degenerate fresh==stale config: the
|
|
71
|
+
// two equalities above would already have returned, but if a caller passes
|
|
72
|
+
// stale_days < fresh_days we keep monotonic behaviour by returning floor.
|
|
73
|
+
const span = params.stale_days - params.fresh_days;
|
|
74
|
+
if (span <= 0)
|
|
75
|
+
return params.floor;
|
|
76
|
+
return 1.0 - (1.0 - params.floor) * ((age - params.fresh_days) / span);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Scores one element per §11.4–11.5. The element's `sources` list is the
|
|
80
|
+
* resolved `derived_from` provenance: max trust wins (`max` in §11.4), and
|
|
81
|
+
* an empty / absent list marks the element unsourced — scored at the
|
|
82
|
+
* `unverified` floor and `sourced: false` so the view composite can count
|
|
83
|
+
* it separately per §11.5.
|
|
84
|
+
*/
|
|
85
|
+
export function scoreElement(element, today, config) {
|
|
86
|
+
const sources = element.sources ?? [];
|
|
87
|
+
const sourced = sources.length > 0;
|
|
88
|
+
const source_trust = sourced
|
|
89
|
+
? Math.max(...sources.map(sourceTrustWeight))
|
|
90
|
+
: UNVERIFIED_WEIGHT;
|
|
91
|
+
const params = resolveDecayParams(element.type, config);
|
|
92
|
+
const f = freshness(element.admitted_at, today, params);
|
|
93
|
+
return {
|
|
94
|
+
source_trust,
|
|
95
|
+
freshness: f,
|
|
96
|
+
confidence: source_trust * f,
|
|
97
|
+
sourced,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** Confidence band per §11.6: A ≥ 0.8, B ≥ 0.6, C ≥ 0.4, D < 0.4. */
|
|
101
|
+
export function confidenceBand(confidence) {
|
|
102
|
+
if (confidence >= 0.8)
|
|
103
|
+
return 'A';
|
|
104
|
+
if (confidence >= 0.6)
|
|
105
|
+
return 'B';
|
|
106
|
+
if (confidence >= 0.4)
|
|
107
|
+
return 'C';
|
|
108
|
+
return 'D';
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Rolls per-element scores up to the view composite per §11.6. The weakest
|
|
112
|
+
* link is the headline; mean and coverage are reported alongside. An empty
|
|
113
|
+
* element set returns a degenerate composite (`weakest_link` and `mean` of 0,
|
|
114
|
+
* coverage 0, band `D`) — callers should detect `element_count === 0` if they
|
|
115
|
+
* want to suppress the header entirely rather than display the floor.
|
|
116
|
+
*/
|
|
117
|
+
export function composeView(scores) {
|
|
118
|
+
if (scores.length === 0) {
|
|
119
|
+
return {
|
|
120
|
+
weakest_link: 0,
|
|
121
|
+
mean: 0,
|
|
122
|
+
coverage: 0,
|
|
123
|
+
band: 'D',
|
|
124
|
+
element_count: 0,
|
|
125
|
+
unsourced_count: 0,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
let min = Infinity;
|
|
129
|
+
let sum = 0;
|
|
130
|
+
let sourcedCount = 0;
|
|
131
|
+
for (const s of scores) {
|
|
132
|
+
if (s.confidence < min)
|
|
133
|
+
min = s.confidence;
|
|
134
|
+
sum += s.confidence;
|
|
135
|
+
if (s.sourced)
|
|
136
|
+
sourcedCount += 1;
|
|
137
|
+
}
|
|
138
|
+
const mean = sum / scores.length;
|
|
139
|
+
return {
|
|
140
|
+
weakest_link: min,
|
|
141
|
+
mean,
|
|
142
|
+
coverage: sourcedCount / scores.length,
|
|
143
|
+
band: confidenceBand(min),
|
|
144
|
+
element_count: scores.length,
|
|
145
|
+
unsourced_count: scores.length - sourcedCount,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Scores a view's elements end-to-end. The caller passes the rendered set,
|
|
150
|
+
* the adopter manifest's `confidence_decay` block (optional), and the
|
|
151
|
+
* reference date (`today`); the result is purely derived and never stored
|
|
152
|
+
* — re-running on the same inputs yields the same numbers (§11.6).
|
|
153
|
+
*/
|
|
154
|
+
export function scoreView(elements, today, config) {
|
|
155
|
+
const todayIso = toIsoDate(today);
|
|
156
|
+
const elementScores = elements.map(e => scoreElement(e, todayIso, config));
|
|
157
|
+
return {
|
|
158
|
+
elements: elementScores,
|
|
159
|
+
composite: composeView(elementScores),
|
|
160
|
+
today: todayIso,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Renders the §11.6 example header line, e.g.:
|
|
165
|
+
*
|
|
166
|
+
* ```
|
|
167
|
+
* Data confidence (as of 2026-06-05): B (weakest link) · 0.71 mean · 92% sourced
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* Shared between Studio (DQ-2) and DSM (DQ-5) so the banding/labels stay
|
|
171
|
+
* consistent across the two consumers. Returns an empty string for an empty
|
|
172
|
+
* composite — callers decide whether to suppress the header in that case.
|
|
173
|
+
*/
|
|
174
|
+
export function formatConfidenceHeader(view) {
|
|
175
|
+
const c = view.composite;
|
|
176
|
+
if (c.element_count === 0)
|
|
177
|
+
return '';
|
|
178
|
+
const mean = c.mean.toFixed(2);
|
|
179
|
+
const coverage = Math.round(c.coverage * 100);
|
|
180
|
+
return `Data confidence (as of ${view.today}): ${c.band} (weakest link) · ${mean} mean · ${coverage}% sourced`;
|
|
181
|
+
}
|
|
182
|
+
// ── Date helpers ────────────────────────────────────────────────────────────
|
|
183
|
+
/** Strict ISO-date parser. Accepts `YYYY-MM-DD`; returns null on anything else. */
|
|
184
|
+
const ISO_DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
185
|
+
function parseIsoDate(s) {
|
|
186
|
+
const m = ISO_DATE_RE.exec(s);
|
|
187
|
+
if (!m)
|
|
188
|
+
return null;
|
|
189
|
+
const year = Number(m[1]);
|
|
190
|
+
const month = Number(m[2]);
|
|
191
|
+
const day = Number(m[3]);
|
|
192
|
+
// UTC to avoid the host TZ shifting age_days by ±1.
|
|
193
|
+
const d = new Date(Date.UTC(year, month - 1, day));
|
|
194
|
+
if (d.getUTCFullYear() !== year ||
|
|
195
|
+
d.getUTCMonth() !== month - 1 ||
|
|
196
|
+
d.getUTCDate() !== day)
|
|
197
|
+
return null;
|
|
198
|
+
return d;
|
|
199
|
+
}
|
|
200
|
+
function toIsoDate(d) {
|
|
201
|
+
if (typeof d === 'string')
|
|
202
|
+
return d;
|
|
203
|
+
const y = d.getUTCFullYear();
|
|
204
|
+
const m = String(d.getUTCMonth() + 1).padStart(2, '0');
|
|
205
|
+
const day = String(d.getUTCDate()).padStart(2, '0');
|
|
206
|
+
return `${y}-${m}-${day}`;
|
|
207
|
+
}
|
|
208
|
+
function daysBetween(fromIso, toIso) {
|
|
209
|
+
const from = parseIsoDate(fromIso);
|
|
210
|
+
const to = parseIsoDate(toIso);
|
|
211
|
+
if (!from || !to)
|
|
212
|
+
return null;
|
|
213
|
+
const ms = to.getTime() - from.getTime();
|
|
214
|
+
return Math.floor(ms / (24 * 60 * 60 * 1000));
|
|
215
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** Closed source-trust scale per CONTRACT §11.2. */
|
|
2
|
+
export type SourceQuality = 'authoritative' | 'corroborated' | 'single_source' | 'unverified';
|
|
3
|
+
/** Confidence band per CONTRACT §11.6 — derived from a numeric confidence. */
|
|
4
|
+
export type ConfidenceBand = 'A' | 'B' | 'C' | 'D';
|
|
5
|
+
/** Per-TYPE freshness-decay parameters per CONTRACT §11.3. */
|
|
6
|
+
export interface DecayParams {
|
|
7
|
+
fresh_days: number;
|
|
8
|
+
stale_days: number;
|
|
9
|
+
floor: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Adopter-manifest `confidence_decay` block (MANIFEST.md §2). Both halves
|
|
13
|
+
* are optional: an absent `defaults` block falls back to the §11.3 implicit
|
|
14
|
+
* defaults, and an absent `by_type` entry inherits from `defaults`.
|
|
15
|
+
*/
|
|
16
|
+
export interface ConfidenceDecayConfig {
|
|
17
|
+
defaults?: Partial<DecayParams>;
|
|
18
|
+
by_type?: Record<string, Partial<DecayParams>>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One canonical element fed to the scorer. The caller (Studio / DSM) has
|
|
22
|
+
* already resolved `derived_from` to the field artefacts and extracted their
|
|
23
|
+
* `source_quality` labels — this module never reads files.
|
|
24
|
+
*/
|
|
25
|
+
export interface ScoringElement {
|
|
26
|
+
/** Element TYPE name, used to look up per-TYPE decay (e.g. `CAPABILITY`). */
|
|
27
|
+
type: string;
|
|
28
|
+
/**
|
|
29
|
+
* ISO 8601 date the admission gate last ran for this element
|
|
30
|
+
* (`admitted_at`, CONTRACT §6). Reaffirmation bumps this date — the cure
|
|
31
|
+
* for staleness. Absent ⇒ treated as fully stale (freshness = floor).
|
|
32
|
+
*/
|
|
33
|
+
admitted_at?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Source qualities resolved from `derived_from` — one entry per cited
|
|
36
|
+
* field artefact. Undefined or empty ⇒ unsourced: scored as `unverified`
|
|
37
|
+
* (0.25) and counted separately per §11.5.
|
|
38
|
+
*/
|
|
39
|
+
sources?: SourceQuality[];
|
|
40
|
+
}
|
|
41
|
+
/** Per-element scoring output. */
|
|
42
|
+
export interface ElementScore {
|
|
43
|
+
/** Max source-trust weight over `sources`; 0.25 (`unverified`) if unsourced. */
|
|
44
|
+
source_trust: number;
|
|
45
|
+
/** Freshness in [floor, 1.0] per the §11.3 curve. */
|
|
46
|
+
freshness: number;
|
|
47
|
+
/** `source_trust × freshness`. */
|
|
48
|
+
confidence: number;
|
|
49
|
+
/**
|
|
50
|
+
* True iff at least one resolvable `derived_from` source was supplied.
|
|
51
|
+
* Drives the §11.5 "counted separately" gap signal and view coverage.
|
|
52
|
+
*/
|
|
53
|
+
sourced: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* View-level composite per CONTRACT §11.6. Three numbers surfaced alongside
|
|
57
|
+
* the view's formation date; the headline `band` is the band of the
|
|
58
|
+
* weakest link.
|
|
59
|
+
*/
|
|
60
|
+
export interface ViewComposite {
|
|
61
|
+
/** `min(confidence)` over the rendered elements. The headline figure. */
|
|
62
|
+
weakest_link: number;
|
|
63
|
+
/** Arithmetic mean of `confidence` (equal element weight in v1). */
|
|
64
|
+
mean: number;
|
|
65
|
+
/** Fraction of elements with `sourced === true`. */
|
|
66
|
+
coverage: number;
|
|
67
|
+
/** Band of the weakest link. */
|
|
68
|
+
band: ConfidenceBand;
|
|
69
|
+
element_count: number;
|
|
70
|
+
/** Elements with no resolvable `derived_from` — `unsourced_count` / `element_count` is the gap. */
|
|
71
|
+
unsourced_count: number;
|
|
72
|
+
}
|
|
73
|
+
/** Full scorer output: per-element + composite, plus the `today` used. */
|
|
74
|
+
export interface ViewScore {
|
|
75
|
+
elements: ElementScore[];
|
|
76
|
+
composite: ViewComposite;
|
|
77
|
+
/** The date used as `today` (the reference for `age_days`). */
|
|
78
|
+
today: string;
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Confidence-scoring types per methodology CONTRACT §11 (Confidence and
|
|
2
|
+
// freshness). Two independent signals — source trust (authored, fixed) and
|
|
3
|
+
// freshness (derived, recomputed on read) — combined per element and rolled
|
|
4
|
+
// up to a view composite. See packages/diagrams/src/confidence/score.ts for
|
|
5
|
+
// the pure scoring functions.
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base handle length floor + span factors. The handle grows with both the
|
|
3
|
+
* horizontal and vertical span so the curve stays visibly horizontal long
|
|
4
|
+
* enough for the arrowhead to sit flush against the line.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EDGE_MIN_HANDLE = 64;
|
|
7
|
+
/** Multiplier applied to the base handle length. 1 = historical appearance. */
|
|
8
|
+
export declare const DEFAULT_EDGE_CURVATURE = 1;
|
|
9
|
+
/**
|
|
10
|
+
* Builds the SVG `d` for a horizontal-tangent cubic Bézier from (sx,sy) to
|
|
11
|
+
* (tx,ty).
|
|
12
|
+
*
|
|
13
|
+
* `curvature` scales the control-handle length:
|
|
14
|
+
* - 0 → control points collapse onto the endpoints ⇒ a straight line.
|
|
15
|
+
* - 1 → the historical curve (no visual change from before #76).
|
|
16
|
+
* - >1 → progressively stronger arc.
|
|
17
|
+
*/
|
|
18
|
+
export declare function horizontalCubicEdgePath(sx: number, sy: number, tx: number, ty: number, curvature?: number): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Shared edge geometry for the static notation previews (Goals, FGCA, FGA,
|
|
2
|
+
// Activities). All four render dependency/relationship edges as a single cubic
|
|
3
|
+
// Bézier with horizontal control handles: each control point shares its
|
|
4
|
+
// endpoint's Y, so the tangent is horizontal at both ends and the marker-end
|
|
5
|
+
// arrow reads as perpendicular to the node's vertical edge.
|
|
6
|
+
//
|
|
7
|
+
// Pulling the path math here (rather than duplicating it inline in each
|
|
8
|
+
// preview) makes the configurable-curvature behaviour (vkgeorgia/strategy#76)
|
|
9
|
+
// unit-testable — the extension has no test harness.
|
|
10
|
+
/**
|
|
11
|
+
* Base handle length floor + span factors. The handle grows with both the
|
|
12
|
+
* horizontal and vertical span so the curve stays visibly horizontal long
|
|
13
|
+
* enough for the arrowhead to sit flush against the line.
|
|
14
|
+
*/
|
|
15
|
+
export const EDGE_MIN_HANDLE = 64;
|
|
16
|
+
const DX_FACTOR = 0.5;
|
|
17
|
+
const DY_FACTOR = 0.8;
|
|
18
|
+
/** Multiplier applied to the base handle length. 1 = historical appearance. */
|
|
19
|
+
export const DEFAULT_EDGE_CURVATURE = 1;
|
|
20
|
+
/**
|
|
21
|
+
* Builds the SVG `d` for a horizontal-tangent cubic Bézier from (sx,sy) to
|
|
22
|
+
* (tx,ty).
|
|
23
|
+
*
|
|
24
|
+
* `curvature` scales the control-handle length:
|
|
25
|
+
* - 0 → control points collapse onto the endpoints ⇒ a straight line.
|
|
26
|
+
* - 1 → the historical curve (no visual change from before #76).
|
|
27
|
+
* - >1 → progressively stronger arc.
|
|
28
|
+
*/
|
|
29
|
+
export function horizontalCubicEdgePath(sx, sy, tx, ty, curvature = DEFAULT_EDGE_CURVATURE) {
|
|
30
|
+
const dx = tx - sx;
|
|
31
|
+
const dy = ty - sy;
|
|
32
|
+
const baseHandle = Math.max(EDGE_MIN_HANDLE, Math.abs(dx) * DX_FACTOR, Math.abs(dy) * DY_FACTOR);
|
|
33
|
+
const handle = baseHandle * curvature;
|
|
34
|
+
return `M${sx},${sy} C${sx + handle},${sy} ${tx - handle},${ty} ${tx},${ty}`;
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ValidationError } from './validation-types.js';
|
|
2
|
+
export interface EnvelopeOptions {
|
|
3
|
+
/** Fixed `notation:` tag — lowercased TYPE short name (e.g. `factor`). */
|
|
4
|
+
notation: string;
|
|
5
|
+
/** Required `id:` TYPE prefix (e.g. `FACTOR`). */
|
|
6
|
+
idType: string;
|
|
7
|
+
/** Error code used for every envelope failure (e.g. `FACTOR-001`). */
|
|
8
|
+
code: string;
|
|
9
|
+
}
|
|
10
|
+
export interface EnvelopeResult {
|
|
11
|
+
/** The input narrowed to a record on success; `null` when the input is not a mapping. */
|
|
12
|
+
record: Record<string, unknown> | null;
|
|
13
|
+
errors: ValidationError[];
|
|
14
|
+
}
|
|
15
|
+
export declare function validateElementEnvelope(input: unknown, opts: EnvelopeOptions): EnvelopeResult;
|