project-tiny-context-harness 0.8.16 → 0.11.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/README.md +119 -41
- package/assets/README.md +184 -55
- package/assets/README.zh-CN.md +114 -40
- package/assets/agents/AGENTS_CORE.md +2 -2
- package/assets/context_templates/context.toml +6 -1
- package/assets/context_templates/screen-contract.md +16 -0
- package/assets/runtime/windows-job-supervisor/formal_process_supervisor_native_helpers.cs +301 -0
- package/assets/runtime/windows-job-supervisor/formal_process_supervisor_native_run.cs +197 -0
- package/assets/runtime/windows-job-supervisor/formal_process_supervisor_native_types.cs +215 -0
- package/assets/runtime/windows-job-supervisor/windows_job_process_supervisor.ps1 +117 -0
- package/assets/skills/context_development_engineer/SKILL.md +16 -30
- package/assets/skills/context_development_engineer/references/engineering-design-reasoning.md +93 -0
- package/assets/skills/context_surface_contract/SKILL.md +13 -2
- package/assets/skills/context_uiux_design/SKILL.md +7 -3
- package/assets/skills/context_uiux_design/references/task-uiux-analysis.md +82 -0
- package/assets/skills/design-resource-authoring/SKILL.md +18 -9
- package/assets/skills/design-resource-authoring/references/authority-delta-assessment.md +52 -0
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +22 -6
- package/assets/skills/design-resource-authoring/references/formal-selected-web-app-handoff.md +26 -8
- package/assets/skills/design-resource-authoring/references/implementation-feasibility.md +111 -0
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +45 -7
- package/assets/skills/design-resource-authoring/references/recovery-and-writeback.md +7 -1
- package/assets/skills/design-resource-authoring/references/resource-selection.md +115 -3
- package/assets/skills/design-system-authoring/SKILL.md +23 -17
- package/assets/skills/design-system-authoring/references/authority-adoption.md +19 -9
- package/assets/skills/design-system-authoring/references/open-design-design-system-provider.md +4 -0
- package/assets/skills/long-task-workflow/SKILL.md +6 -6
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +10 -4
- package/assets/skills/long-task-workflow/references/contract-authoring.md +5 -5
- package/assets/skills/long-task-workflow/references/evidence-design.md +14 -3
- package/assets/skills/long-task-workflow/references/source-authoring.md +11 -8
- package/assets/tools/context_rules.json +53 -0
- package/assets/tools/validate_context.py +302 -77
- package/dist/cli.js +2 -1
- package/dist/commands/context-create.d.ts +1 -0
- package/dist/commands/context-create.js +90 -0
- package/dist/commands/context-inspect.d.ts +1 -0
- package/dist/commands/context-inspect.js +98 -0
- package/dist/commands/context-move.d.ts +1 -0
- package/dist/commands/context-move.js +78 -0
- package/dist/commands/context-register.d.ts +1 -0
- package/dist/commands/context-register.js +110 -0
- package/dist/commands/context-transaction.d.ts +1 -0
- package/dist/commands/context-transaction.js +84 -0
- package/dist/commands/context.d.ts +1 -0
- package/dist/commands/context.js +36 -0
- package/dist/commands/design-authority-delta.d.ts +1 -0
- package/dist/commands/design-authority-delta.js +53 -0
- package/dist/commands/design-authority.d.ts +1 -0
- package/dist/commands/design-authority.js +104 -0
- package/dist/commands/design-resource.js +17 -3
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.js +61 -3
- package/dist/commands/index.js +19 -2
- package/dist/commands/long-task-authoring.js +20 -2
- package/dist/commands/long-task-workdir.d.ts +2 -0
- package/dist/commands/long-task-workdir.js +23 -0
- package/dist/commands/long-task.js +75 -6
- package/dist/commands/route.d.ts +15 -0
- package/dist/commands/route.js +142 -0
- package/dist/index.d.ts +3 -13
- package/dist/index.js +3 -12
- package/dist/lib/cli-exit.d.ts +14 -0
- package/dist/lib/cli-exit.js +19 -0
- package/dist/lib/context-catalog/catalog-default-footprint.d.ts +3 -0
- package/dist/lib/context-catalog/catalog-default-footprint.js +53 -0
- package/dist/lib/context-catalog/catalog-diagnostics.d.ts +9 -0
- package/dist/lib/context-catalog/catalog-diagnostics.js +34 -0
- package/dist/lib/context-catalog/catalog-discovery.d.ts +7 -0
- package/dist/lib/context-catalog/catalog-discovery.js +81 -0
- package/dist/lib/context-catalog/catalog-load.d.ts +8 -0
- package/dist/lib/context-catalog/catalog-load.js +187 -0
- package/dist/lib/context-catalog/catalog-path-validation.d.ts +7 -0
- package/dist/lib/context-catalog/catalog-path-validation.js +62 -0
- package/dist/lib/context-catalog/catalog-paths.d.ts +11 -0
- package/dist/lib/context-catalog/catalog-paths.js +41 -0
- package/dist/lib/context-catalog/catalog-portable-contract.d.ts +15 -0
- package/dist/lib/context-catalog/catalog-portable-contract.js +68 -0
- package/dist/lib/context-catalog/catalog-staged-path-safety.d.ts +1 -0
- package/dist/lib/context-catalog/catalog-staged-path-safety.js +36 -0
- package/dist/lib/context-catalog/catalog-types.d.ts +40 -0
- package/dist/lib/context-catalog/catalog-types.js +1 -0
- package/dist/lib/context-catalog/catalog-validation.d.ts +9 -0
- package/dist/lib/context-catalog/catalog-validation.js +148 -0
- package/dist/lib/context-create/context-create-path.d.ts +2 -0
- package/dist/lib/context-create/context-create-path.js +30 -0
- package/dist/lib/context-create/context-create-template.d.ts +2 -0
- package/dist/lib/context-create/context-create-template.js +95 -0
- package/dist/lib/context-create/context-create-types.d.ts +28 -0
- package/dist/lib/context-create/context-create-types.js +1 -0
- package/dist/lib/context-create/context-create-write.d.ts +1 -0
- package/dist/lib/context-create/context-create-write.js +85 -0
- package/dist/lib/context-create/context-create.d.ts +2 -0
- package/dist/lib/context-create/context-create.js +84 -0
- package/dist/lib/context-default-footprint.d.ts +2 -3
- package/dist/lib/context-default-footprint.js +49 -57
- package/dist/lib/context-doctor/context-doctor-types.d.ts +16 -0
- package/dist/lib/context-doctor/context-doctor-types.js +15 -0
- package/dist/lib/context-doctor/context-doctor.d.ts +2 -0
- package/dist/lib/context-doctor/context-doctor.js +130 -0
- package/dist/lib/context-graph-snapshot.d.ts +5 -0
- package/dist/lib/context-graph-snapshot.js +46 -25
- package/dist/lib/context-inspect/context-inspect-projection.d.ts +9 -0
- package/dist/lib/context-inspect/context-inspect-projection.js +49 -0
- package/dist/lib/context-inspect/context-inspect-render.d.ts +2 -0
- package/dist/lib/context-inspect/context-inspect-render.js +29 -0
- package/dist/lib/context-inspect/context-inspect-types.d.ts +43 -0
- package/dist/lib/context-inspect/context-inspect-types.js +1 -0
- package/dist/lib/context-inspect/context-inspect.d.ts +2 -0
- package/dist/lib/context-inspect/context-inspect.js +104 -0
- package/dist/lib/context-manifest-schema.d.ts +1 -1
- package/dist/lib/context-manifest-schema.js +4 -20
- package/dist/lib/context-markdown/context-markdown-analysis.d.ts +15 -0
- package/dist/lib/context-markdown/context-markdown-analysis.js +245 -0
- package/dist/lib/context-markdown/context-markdown-extract.d.ts +7 -0
- package/dist/lib/context-markdown/context-markdown-extract.js +114 -0
- package/dist/lib/context-markdown/context-markdown-types.d.ts +57 -0
- package/dist/lib/context-markdown/context-markdown-types.js +1 -0
- package/dist/lib/context-move/context-move-input.d.ts +8 -0
- package/dist/lib/context-move/context-move-input.js +17 -0
- package/dist/lib/context-move/context-move-literal-scan.d.ts +20 -0
- package/dist/lib/context-move/context-move-literal-scan.js +213 -0
- package/dist/lib/context-move/context-move-live-validation.d.ts +3 -0
- package/dist/lib/context-move/context-move-live-validation.js +56 -0
- package/dist/lib/context-move/context-move-markdown-plan.d.ts +22 -0
- package/dist/lib/context-move/context-move-markdown-plan.js +39 -0
- package/dist/lib/context-move/context-move-projection.d.ts +3 -0
- package/dist/lib/context-move/context-move-projection.js +11 -0
- package/dist/lib/context-move/context-move-reference-validation.d.ts +11 -0
- package/dist/lib/context-move/context-move-reference-validation.js +64 -0
- package/dist/lib/context-move/context-move-render.d.ts +2 -0
- package/dist/lib/context-move/context-move-render.js +24 -0
- package/dist/lib/context-move/context-move-support.d.ts +10 -0
- package/dist/lib/context-move/context-move-support.js +88 -0
- package/dist/lib/context-move/context-move-transaction-plan.d.ts +24 -0
- package/dist/lib/context-move/context-move-transaction-plan.js +108 -0
- package/dist/lib/context-move/context-move-types.d.ts +74 -0
- package/dist/lib/context-move/context-move-types.js +1 -0
- package/dist/lib/context-move/context-move.d.ts +8 -0
- package/dist/lib/context-move/context-move.js +180 -0
- package/dist/lib/context-mutation/manifest-lossless-patch.d.ts +28 -0
- package/dist/lib/context-mutation/manifest-lossless-patch.js +208 -0
- package/dist/lib/context-mutation/markdown-link-patch.d.ts +34 -0
- package/dist/lib/context-mutation/markdown-link-patch.js +143 -0
- package/dist/lib/context-mutation/markdown-link-spans.d.ts +10 -0
- package/dist/lib/context-mutation/markdown-link-spans.js +179 -0
- package/dist/lib/context-mutation/mutation-cas.d.ts +13 -0
- package/dist/lib/context-mutation/mutation-cas.js +365 -0
- package/dist/lib/context-mutation/mutation-command-support.d.ts +12 -0
- package/dist/lib/context-mutation/mutation-command-support.js +57 -0
- package/dist/lib/context-mutation/mutation-commit.d.ts +12 -0
- package/dist/lib/context-mutation/mutation-commit.js +89 -0
- package/dist/lib/context-mutation/mutation-directories.d.ts +5 -0
- package/dist/lib/context-mutation/mutation-directories.js +56 -0
- package/dist/lib/context-mutation/mutation-file-state.d.ts +14 -0
- package/dist/lib/context-mutation/mutation-file-state.js +137 -0
- package/dist/lib/context-mutation/mutation-journal-file-validation.d.ts +1 -0
- package/dist/lib/context-mutation/mutation-journal-file-validation.js +106 -0
- package/dist/lib/context-mutation/mutation-journal-io.d.ts +5 -0
- package/dist/lib/context-mutation/mutation-journal-io.js +55 -0
- package/dist/lib/context-mutation/mutation-journal-storage.d.ts +18 -0
- package/dist/lib/context-mutation/mutation-journal-storage.js +283 -0
- package/dist/lib/context-mutation/mutation-journal-validation-support.d.ts +16 -0
- package/dist/lib/context-mutation/mutation-journal-validation-support.js +140 -0
- package/dist/lib/context-mutation/mutation-journal-validation.d.ts +3 -0
- package/dist/lib/context-mutation/mutation-journal-validation.js +177 -0
- package/dist/lib/context-mutation/mutation-journal.d.ts +8 -0
- package/dist/lib/context-mutation/mutation-journal.js +111 -0
- package/dist/lib/context-mutation/mutation-live-validation.d.ts +3 -0
- package/dist/lib/context-mutation/mutation-live-validation.js +51 -0
- package/dist/lib/context-mutation/mutation-long-task-guard.d.ts +6 -0
- package/dist/lib/context-mutation/mutation-long-task-guard.js +57 -0
- package/dist/lib/context-mutation/mutation-recovery.d.ts +4 -0
- package/dist/lib/context-mutation/mutation-recovery.js +189 -0
- package/dist/lib/context-mutation/mutation-staged-fs.d.ts +5 -0
- package/dist/lib/context-mutation/mutation-staged-fs.js +56 -0
- package/dist/lib/context-mutation/mutation-types.d.ts +103 -0
- package/dist/lib/context-mutation/mutation-types.js +1 -0
- package/dist/lib/context-register/context-register-input.d.ts +11 -0
- package/dist/lib/context-register/context-register-input.js +43 -0
- package/dist/lib/context-register/context-register-render.d.ts +2 -0
- package/dist/lib/context-register/context-register-render.js +21 -0
- package/dist/lib/context-register/context-register-support.d.ts +6 -0
- package/dist/lib/context-register/context-register-support.js +46 -0
- package/dist/lib/context-register/context-register-types.d.ts +46 -0
- package/dist/lib/context-register/context-register-types.js +1 -0
- package/dist/lib/context-register/context-register.d.ts +8 -0
- package/dist/lib/context-register/context-register.js +155 -0
- package/dist/lib/context-router/context-route-budget.d.ts +15 -0
- package/dist/lib/context-router/context-route-budget.js +14 -0
- package/dist/lib/context-router/context-route-candidates.d.ts +15 -0
- package/dist/lib/context-router/context-route-candidates.js +112 -0
- package/dist/lib/context-router/context-route-order.d.ts +6 -0
- package/dist/lib/context-router/context-route-order.js +53 -0
- package/dist/lib/context-router/context-route-paths.d.ts +16 -0
- package/dist/lib/context-router/context-route-paths.js +109 -0
- package/dist/lib/context-router/context-route-render.d.ts +2 -0
- package/dist/lib/context-router/context-route-render.js +32 -0
- package/dist/lib/context-router/context-route-scan.d.ts +18 -0
- package/dist/lib/context-router/context-route-scan.js +156 -0
- package/dist/lib/context-router/context-route-selection.d.ts +16 -0
- package/dist/lib/context-router/context-route-selection.js +72 -0
- package/dist/lib/context-router/context-route-terms.d.ts +13 -0
- package/dist/lib/context-router/context-route-terms.js +202 -0
- package/dist/lib/context-router/context-route-types.d.ts +101 -0
- package/dist/lib/context-router/context-route-types.js +1 -0
- package/dist/lib/context-router/context-route.d.ts +2 -0
- package/dist/lib/context-router/context-route.js +127 -0
- package/dist/lib/context-units-migration.d.ts +13 -0
- package/dist/lib/context-units-migration.js +217 -0
- package/dist/lib/design-authority-binding.d.ts +7 -0
- package/dist/lib/design-authority-binding.js +96 -0
- package/dist/lib/design-authority-closure.d.ts +3 -0
- package/dist/lib/design-authority-closure.js +201 -0
- package/dist/lib/design-authority-delta-codec-primitives.d.ts +10 -0
- package/dist/lib/design-authority-delta-codec-primitives.js +58 -0
- package/dist/lib/design-authority-delta-codec.d.ts +2 -0
- package/dist/lib/design-authority-delta-codec.js +193 -0
- package/dist/lib/design-authority-delta-types.d.ts +65 -0
- package/dist/lib/design-authority-delta-types.js +6 -0
- package/dist/lib/design-authority-delta-validation.d.ts +2 -0
- package/dist/lib/design-authority-delta-validation.js +16 -0
- package/dist/lib/design-authority-digest.d.ts +8 -0
- package/dist/lib/design-authority-digest.js +36 -0
- package/dist/lib/design-authority-files.d.ts +9 -0
- package/dist/lib/design-authority-files.js +62 -0
- package/dist/lib/design-authority-format.d.ts +2 -0
- package/dist/lib/design-authority-format.js +93 -0
- package/dist/lib/design-authority-links.d.ts +10 -0
- package/dist/lib/design-authority-links.js +137 -0
- package/dist/lib/design-authority-manifest.d.ts +4 -0
- package/dist/lib/design-authority-manifest.js +144 -0
- package/dist/lib/design-authority-tokens.d.ts +9 -0
- package/dist/lib/design-authority-tokens.js +45 -0
- package/dist/lib/design-authority-types.d.ts +80 -0
- package/dist/lib/design-authority-types.js +23 -0
- package/dist/lib/design-md-tool-adapter.d.ts +9 -0
- package/dist/lib/design-md-tool-adapter.js +152 -0
- package/dist/lib/design-md-tool-normalization.d.ts +7 -0
- package/dist/lib/design-md-tool-normalization.js +78 -0
- package/dist/lib/design-md-tool-types.d.ts +99 -0
- package/dist/lib/design-md-tool-types.js +8 -0
- package/dist/lib/design-resource-handoff-bundle.js +5 -0
- package/dist/lib/design-resource-handoff-input-types.d.ts +1 -1
- package/dist/lib/design-resource-handoff-manifest-projection.js +4 -0
- package/dist/lib/design-resource-handoff-set-integrity.js +1 -0
- package/dist/lib/design-resource-handoff-shape.js +18 -2
- package/dist/lib/design-resource-handoff-types.d.ts +8 -0
- package/dist/lib/design-resource-handoff-validation.js +24 -0
- package/dist/lib/design-resource-implementation-feasibility-model.d.ts +35 -0
- package/dist/lib/design-resource-implementation-feasibility-model.js +62 -0
- package/dist/lib/design-resource-implementation-feasibility-shape-sections.d.ts +43 -0
- package/dist/lib/design-resource-implementation-feasibility-shape-sections.js +142 -0
- package/dist/lib/design-resource-implementation-feasibility-shape.d.ts +4 -0
- package/dist/lib/design-resource-implementation-feasibility-shape.js +154 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision-projection.d.ts +24 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision-projection.js +106 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision.d.ts +21 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision.js +75 -0
- package/dist/lib/design-resource-implementation-feasibility-types.d.ts +135 -0
- package/dist/lib/design-resource-implementation-feasibility-types.js +37 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-cells.d.ts +5 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-cells.js +125 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-document.d.ts +4 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-document.js +167 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-facts.d.ts +3 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-facts.js +76 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-realizations.d.ts +8 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-realizations.js +76 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-support.d.ts +10 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-support.js +75 -0
- package/dist/lib/design-resource-implementation-feasibility-validation.d.ts +3 -0
- package/dist/lib/design-resource-implementation-feasibility-validation.js +138 -0
- package/dist/lib/design-resource-recovery-current.js +22 -0
- package/dist/lib/design-resource-recovery-shape.js +64 -7
- package/dist/lib/design-resource-recovery-types.d.ts +4 -1
- package/dist/lib/design-resource-symbolic-fact-shape.js +9 -1
- package/dist/lib/design-resource-symbolic-fact-types.d.ts +8 -0
- package/dist/lib/design-resource-symbolic-fact-validation.js +25 -0
- package/dist/lib/doctor.d.ts +2 -1
- package/dist/lib/doctor.js +29 -1
- package/dist/lib/fs.js +1 -1
- package/dist/lib/long-task-acceptance-reachability-claims.d.ts +2 -0
- package/dist/lib/long-task-acceptance-reachability-claims.js +279 -0
- package/dist/lib/long-task-acceptance-reachability-design.d.ts +2 -0
- package/dist/lib/long-task-acceptance-reachability-design.js +96 -0
- package/dist/lib/long-task-acceptance-reachability-external.d.ts +9 -0
- package/dist/lib/long-task-acceptance-reachability-external.js +123 -0
- package/dist/lib/long-task-acceptance-reachability-helpers.d.ts +64 -0
- package/dist/lib/long-task-acceptance-reachability-helpers.js +473 -0
- package/dist/lib/long-task-acceptance-reachability-semantic.d.ts +2 -0
- package/dist/lib/long-task-acceptance-reachability-semantic.js +122 -0
- package/dist/lib/long-task-acceptance-reachability-types.d.ts +91 -0
- package/dist/lib/long-task-acceptance-reachability-types.js +1 -0
- package/dist/lib/long-task-acceptance-reachability.d.ts +4 -0
- package/dist/lib/long-task-acceptance-reachability.js +115 -0
- package/dist/lib/long-task-activation-validation.d.ts +6 -0
- package/dist/lib/long-task-activation-validation.js +96 -23
- package/dist/lib/long-task-active-authority-lock-context.d.ts +4 -0
- package/dist/lib/long-task-active-authority-lock-context.js +29 -0
- package/dist/lib/long-task-applicability-identity.d.ts +25 -0
- package/dist/lib/long-task-applicability-identity.js +60 -0
- package/dist/lib/long-task-authoring-preflight-diagnostics.js +8 -0
- package/dist/lib/long-task-authoring-preflight-types.d.ts +2 -0
- package/dist/lib/long-task-authoring-preflight-types.js +9 -0
- package/dist/lib/long-task-authoring-preflight.js +18 -2
- package/dist/lib/long-task-authority-material-diff.js +4 -0
- package/dist/lib/long-task-authority-materials.js +19 -0
- package/dist/lib/long-task-authority-policy.d.ts +3 -0
- package/dist/lib/long-task-authority-policy.js +3 -0
- package/dist/lib/long-task-authority-revision-details.js +2 -1
- package/dist/lib/long-task-authority-types.d.ts +2 -0
- package/dist/lib/long-task-authority.js +2 -0
- package/dist/lib/long-task-check-runner.js +3 -296
- package/dist/lib/long-task-check-shape.js +6 -1
- package/dist/lib/long-task-claim-definitions.js +1 -3
- package/dist/lib/long-task-claim-semantic-proof-floor.d.ts +3 -0
- package/dist/lib/long-task-claim-semantic-proof-floor.js +78 -0
- package/dist/lib/long-task-claims.d.ts +0 -18
- package/dist/lib/long-task-claims.js +15 -14
- package/dist/lib/long-task-command-process.d.ts +9 -0
- package/dist/lib/long-task-command-process.js +178 -0
- package/dist/lib/long-task-compact-authoring.js +3 -0
- package/dist/lib/long-task-compact-projections.js +10 -0
- package/dist/lib/long-task-complete-delivery-evidence-types.d.ts +38 -0
- package/dist/lib/long-task-complete-delivery-evidence-types.js +1 -0
- package/dist/lib/long-task-completion-types.d.ts +109 -0
- package/dist/lib/long-task-completion-types.js +1 -0
- package/dist/lib/long-task-conformance-policy.d.ts +2 -1
- package/dist/lib/long-task-conformance-policy.js +11 -4
- package/dist/lib/long-task-context-authority-topology.js +6 -4
- package/dist/lib/long-task-contract-types.d.ts +52 -1
- package/dist/lib/long-task-counterfactual-sandbox.d.ts +7 -1
- package/dist/lib/long-task-counterfactual-sandbox.js +86 -6
- package/dist/lib/long-task-delivery-compiler-preflight.d.ts +24 -0
- package/dist/lib/long-task-delivery-compiler-preflight.js +32 -0
- package/dist/lib/long-task-delivery-compiler.d.ts +1 -0
- package/dist/lib/long-task-delivery-compiler.js +59 -44
- package/dist/lib/long-task-delivery-parser.d.ts +3 -0
- package/dist/lib/long-task-delivery-parser.js +26 -8
- package/dist/lib/long-task-delivery-types.d.ts +2 -0
- package/dist/lib/long-task-delivery-types.js +2 -0
- package/dist/lib/long-task-delivery-validation.d.ts +11 -3
- package/dist/lib/long-task-delivery-validation.js +23 -8
- package/dist/lib/long-task-design-feasibility-binding-owners.d.ts +6 -0
- package/dist/lib/long-task-design-feasibility-binding-owners.js +52 -0
- package/dist/lib/long-task-design-feasibility-binding.d.ts +14 -0
- package/dist/lib/long-task-design-feasibility-binding.js +114 -0
- package/dist/lib/long-task-design-feasibility-source-closure.d.ts +11 -0
- package/dist/lib/long-task-design-feasibility-source-closure.js +87 -0
- package/dist/lib/long-task-design-obligation.d.ts +50 -0
- package/dist/lib/long-task-design-obligation.js +99 -0
- package/dist/lib/long-task-design-resource-handoff.d.ts +5 -3
- package/dist/lib/long-task-design-resource-handoff.js +64 -4
- package/dist/lib/long-task-design-resource-method-binding.js +20 -2
- package/dist/lib/long-task-effective-external-takeover.d.ts +15 -0
- package/dist/lib/long-task-effective-external-takeover.js +109 -0
- package/dist/lib/long-task-effective-external-ui-takeover.d.ts +5 -0
- package/dist/lib/long-task-effective-external-ui-takeover.js +117 -0
- package/dist/lib/long-task-evidence-capability-codec.js +91 -0
- package/dist/lib/long-task-evidence-capability-runtime.js +62 -14
- package/dist/lib/long-task-evidence-capability-types.d.ts +3 -2
- package/dist/lib/long-task-evidence-v2.d.ts +6 -1
- package/dist/lib/long-task-evidence-v2.js +253 -170
- package/dist/lib/long-task-execution-observation.d.ts +7 -0
- package/dist/lib/long-task-execution-observation.js +21 -4
- package/dist/lib/long-task-expected-authority.d.ts +4 -0
- package/dist/lib/long-task-expected-authority.js +126 -0
- package/dist/lib/long-task-external-confirmation-artifacts.d.ts +9 -0
- package/dist/lib/long-task-external-confirmation-artifacts.js +138 -0
- package/dist/lib/long-task-external-confirmation-attestation.d.ts +20 -0
- package/dist/lib/long-task-external-confirmation-attestation.js +115 -0
- package/dist/lib/long-task-external-confirmation-challenge.d.ts +23 -0
- package/dist/lib/long-task-external-confirmation-challenge.js +164 -0
- package/dist/lib/long-task-external-confirmation-context.d.ts +14 -0
- package/dist/lib/long-task-external-confirmation-context.js +53 -0
- package/dist/lib/long-task-external-confirmation-evaluation.d.ts +11 -0
- package/dist/lib/long-task-external-confirmation-evaluation.js +454 -0
- package/dist/lib/long-task-external-confirmation-expected.d.ts +8 -0
- package/dist/lib/long-task-external-confirmation-expected.js +200 -0
- package/dist/lib/long-task-external-confirmation-identity.d.ts +10 -0
- package/dist/lib/long-task-external-confirmation-identity.js +77 -0
- package/dist/lib/long-task-external-confirmation-plan.d.ts +25 -0
- package/dist/lib/long-task-external-confirmation-plan.js +148 -0
- package/dist/lib/long-task-external-confirmation-preparation.d.ts +4 -0
- package/dist/lib/long-task-external-confirmation-preparation.js +100 -0
- package/dist/lib/long-task-external-confirmation-shape.d.ts +8 -0
- package/dist/lib/long-task-external-confirmation-shape.js +387 -0
- package/dist/lib/long-task-external-confirmation-state.d.ts +10 -0
- package/dist/lib/long-task-external-confirmation-state.js +109 -0
- package/dist/lib/long-task-external-confirmation-types.d.ts +195 -0
- package/dist/lib/long-task-external-confirmation-types.js +1 -0
- package/dist/lib/long-task-final-integrity.d.ts +2 -0
- package/dist/lib/long-task-final-integrity.js +21 -10
- package/dist/lib/long-task-final-v2.d.ts +7 -2
- package/dist/lib/long-task-final-v2.js +179 -55
- package/dist/lib/long-task-finalization-identity.d.ts +27 -0
- package/dist/lib/long-task-finalization-identity.js +58 -0
- package/dist/lib/long-task-finding-context.d.ts +1 -1
- package/dist/lib/long-task-finding-context.js +139 -13
- package/dist/lib/long-task-freshness.d.ts +27 -0
- package/dist/lib/long-task-freshness.js +129 -6
- package/dist/lib/long-task-git.js +3 -3
- package/dist/lib/long-task-material-input-closure.d.ts +3 -0
- package/dist/lib/long-task-material-input-closure.js +92 -0
- package/dist/lib/long-task-obligation-authority-resolution.d.ts +12 -0
- package/dist/lib/long-task-obligation-authority-resolution.js +57 -0
- package/dist/lib/long-task-obligation-semantic-identity.d.ts +16 -0
- package/dist/lib/long-task-obligation-semantic-identity.js +116 -0
- package/dist/lib/long-task-observation-authority.d.ts +11 -0
- package/dist/lib/long-task-observation-authority.js +137 -6
- package/dist/lib/long-task-process-table.d.ts +9 -0
- package/dist/lib/long-task-process-table.js +87 -0
- package/dist/lib/long-task-process-tree.d.ts +8 -0
- package/dist/lib/long-task-process-tree.js +108 -0
- package/dist/lib/long-task-proof-adequacy.d.ts +12 -0
- package/dist/lib/long-task-proof-adequacy.js +57 -0
- package/dist/lib/long-task-proof-capability-floor.d.ts +6 -0
- package/dist/lib/long-task-proof-capability-floor.js +137 -0
- package/dist/lib/long-task-protected-files.d.ts +1 -1
- package/dist/lib/long-task-protected-files.js +1 -1
- package/dist/lib/long-task-repair-frontier-checks.d.ts +8 -0
- package/dist/lib/long-task-repair-frontier-checks.js +93 -0
- package/dist/lib/long-task-repair-frontier-groups.d.ts +2 -0
- package/dist/lib/long-task-repair-frontier-groups.js +64 -0
- package/dist/lib/long-task-repair-frontier-utils.d.ts +6 -0
- package/dist/lib/long-task-repair-frontier-utils.js +27 -0
- package/dist/lib/long-task-repair-frontier.d.ts +14 -0
- package/dist/lib/long-task-repair-frontier.js +132 -0
- package/dist/lib/long-task-risk.d.ts +3 -2
- package/dist/lib/long-task-risk.js +73 -24
- package/dist/lib/long-task-root-shape.js +148 -8
- package/dist/lib/long-task-runner-freeze.d.ts +2 -1
- package/dist/lib/long-task-runner-freeze.js +23 -8
- package/dist/lib/long-task-runtime-types.d.ts +34 -40
- package/dist/lib/long-task-semantic-assurance-policy.js +2 -11
- package/dist/lib/long-task-semantic-contract-types.d.ts +2 -1
- package/dist/lib/long-task-semantic-drift-migration.js +48 -2
- package/dist/lib/long-task-semantic-fact-binding-types.d.ts +20 -0
- package/dist/lib/long-task-semantic-fact-closure.d.ts +5 -1
- package/dist/lib/long-task-semantic-fact-closure.js +33 -5
- package/dist/lib/long-task-semantic-fact-contract-closure.js +176 -1
- package/dist/lib/long-task-semantic-fact-contract-proofs.js +18 -1
- package/dist/lib/long-task-semantic-fact-input-closure.d.ts +16 -2
- package/dist/lib/long-task-semantic-fact-input-closure.js +138 -15
- package/dist/lib/long-task-semantic-fact-provenance-closure.js +1 -1
- package/dist/lib/long-task-semantic-fact-shape.d.ts +2 -1
- package/dist/lib/long-task-semantic-fact-shape.js +35 -1
- package/dist/lib/long-task-semantic-proof-adequacy.d.ts +2 -0
- package/dist/lib/long-task-semantic-proof-adequacy.js +19 -0
- package/dist/lib/long-task-semantic-proof-profile.d.ts +5 -0
- package/dist/lib/long-task-semantic-proof-profile.js +187 -0
- package/dist/lib/long-task-shape-primitives.d.ts +1 -1
- package/dist/lib/long-task-shape-primitives.js +5 -0
- package/dist/lib/long-task-source-anchors.d.ts +10 -0
- package/dist/lib/long-task-source-anchors.js +102 -0
- package/dist/lib/long-task-source-authority-types.d.ts +46 -0
- package/dist/lib/long-task-source-claim-validation.js +36 -0
- package/dist/lib/long-task-source-conservation-facts.d.ts +8 -0
- package/dist/lib/long-task-source-conservation-facts.js +57 -0
- package/dist/lib/long-task-source-conservation-types.d.ts +34 -0
- package/dist/lib/long-task-source-conservation-types.js +1 -0
- package/dist/lib/long-task-source-conservation.d.ts +7 -0
- package/dist/lib/long-task-source-conservation.js +110 -0
- package/dist/lib/long-task-source-fragments.d.ts +6 -0
- package/dist/lib/long-task-source-fragments.js +219 -0
- package/dist/lib/long-task-source-projection-resolution.d.ts +5 -0
- package/dist/lib/long-task-source-projection-resolution.js +57 -0
- package/dist/lib/long-task-source-projection-validation.d.ts +17 -0
- package/dist/lib/long-task-source-projection-validation.js +154 -0
- package/dist/lib/long-task-source-shape.js +14 -6
- package/dist/lib/long-task-source-supersession.d.ts +5 -0
- package/dist/lib/long-task-source-supersession.js +138 -0
- package/dist/lib/long-task-stage-policy.d.ts +7 -2
- package/dist/lib/long-task-stage-policy.js +67 -23
- package/dist/lib/long-task-state.d.ts +18 -4
- package/dist/lib/long-task-state.js +319 -33
- package/dist/lib/long-task-static-observation-freeze.js +4 -3
- package/dist/lib/long-task-status-projection.d.ts +3 -1
- package/dist/lib/long-task-status-projection.js +44 -13
- package/dist/lib/long-task-status-v2.d.ts +10 -6
- package/dist/lib/long-task-status-v2.js +70 -58
- package/dist/lib/long-task-target-policy.d.ts +8 -3
- package/dist/lib/long-task-target-policy.js +40 -9
- package/dist/lib/long-task-terminal-finalization.d.ts +12 -0
- package/dist/lib/long-task-terminal-finalization.js +190 -0
- package/dist/lib/long-task-ui-design-policy.js +15 -4
- package/dist/lib/long-task-ui-surface-policy.d.ts +2 -1
- package/dist/lib/long-task-ui-surface-policy.js +7 -4
- package/dist/lib/long-task-ui-surface-validation.d.ts +3 -1
- package/dist/lib/long-task-ui-surface-validation.js +2 -2
- package/dist/lib/long-task-verifier-counterfactuals.d.ts +11 -0
- package/dist/lib/long-task-verifier-counterfactuals.js +96 -0
- package/dist/lib/long-task-verifier-execution.d.ts +9 -0
- package/dist/lib/long-task-verifier-execution.js +67 -0
- package/dist/lib/long-task-verifier-identity.js +16 -5
- package/dist/lib/long-task-verifier-v2.js +52 -65
- package/dist/lib/long-task-windows-job-supervisor-helper.d.ts +1 -0
- package/dist/lib/long-task-windows-job-supervisor-helper.js +104 -0
- package/dist/lib/long-task-windows-job-supervisor-protocol.d.ts +28 -0
- package/dist/lib/long-task-windows-job-supervisor-protocol.js +124 -0
- package/dist/lib/long-task-windows-job-supervisor-result.d.ts +11 -0
- package/dist/lib/long-task-windows-job-supervisor-result.js +152 -0
- package/dist/lib/long-task-windows-job-supervisor.d.ts +2 -0
- package/dist/lib/long-task-windows-job-supervisor.js +126 -0
- package/dist/lib/long-task-workspace-scope.d.ts +1 -0
- package/dist/lib/long-task-workspace-scope.js +4 -1
- package/dist/lib/long-task-workspace.d.ts +1 -0
- package/dist/lib/long-task-workspace.js +10 -0
- package/dist/lib/migrations.js +43 -2
- package/dist/lib/repository-path-safety.d.ts +3 -0
- package/dist/lib/repository-path-safety.js +39 -3
- package/dist/lib/semantic-fact-input-shape.d.ts +7 -2
- package/dist/lib/semantic-fact-input-shape.js +25 -1
- package/dist/lib/semantic-fact-inventory-types.d.ts +8 -2
- package/dist/lib/semantic-fact-policy-census.d.ts +1 -1
- package/dist/lib/semantic-fact-policy-census.js +5 -2
- package/dist/lib/semantic-fact-policy.d.ts +1 -1
- package/dist/lib/semantic-fact-policy.js +2 -2
- package/dist/lib/semantic-fact-proof-shape.d.ts +1 -1
- package/dist/lib/semantic-fact-property-shape.d.ts +1 -1
- package/dist/lib/validators.d.ts +3 -0
- package/dist/lib/validators.js +45 -157
- package/dist/public-api-core.d.ts +12 -0
- package/dist/public-api-core.js +12 -0
- package/dist/public-api-long-task.d.ts +10 -0
- package/dist/public-api-long-task.js +10 -0
- package/dist/public-types.d.ts +6 -1
- package/dist/schemas/design-authority-delta-assessment-v1.schema.json +191 -0
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +166 -2
- package/dist/schemas/long-task-external-confirmation-record-v1.schema.json +155 -0
- package/dist/schemas/long-task-external-confirmation-record-v2.schema.json +209 -0
- package/migrations/README.md +99 -0
- package/package.json +7 -5
- package/source-mappings.yaml +18 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { stableJson } from "./stable-json.js";
|
|
5
|
+
export function loadDesignMdToolIdentity() {
|
|
6
|
+
let directory = path.dirname(fileURLToPath(import.meta.resolve("@google/design.md")));
|
|
7
|
+
for (let depth = 0; depth < 4; depth += 1) {
|
|
8
|
+
const packagePath = path.join(directory, "package.json");
|
|
9
|
+
if (existsSync(packagePath)) {
|
|
10
|
+
const parsed = JSON.parse(readFileSync(packagePath, "utf8"));
|
|
11
|
+
if (parsed.name === "@google/design.md" &&
|
|
12
|
+
typeof parsed.version === "string") {
|
|
13
|
+
return {
|
|
14
|
+
package_name: "@google/design.md",
|
|
15
|
+
package_version: parsed.version,
|
|
16
|
+
api_surface: "@google/design.md/linter",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
directory = path.dirname(directory);
|
|
21
|
+
}
|
|
22
|
+
throw new Error("unable to resolve @google/design.md package identity");
|
|
23
|
+
}
|
|
24
|
+
export function normalizeDesignMdFinding(finding) {
|
|
25
|
+
return {
|
|
26
|
+
severity: finding.severity,
|
|
27
|
+
...(finding.path ? { path: finding.path } : {}),
|
|
28
|
+
message: finding.message,
|
|
29
|
+
...(finding.rule ? { rule: finding.rule } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function snapshotDesignSystem(state) {
|
|
33
|
+
return {
|
|
34
|
+
...(state.name ? { name: state.name } : {}),
|
|
35
|
+
...(state.description ? { description: state.description } : {}),
|
|
36
|
+
colors: mapToRecord(state.colors),
|
|
37
|
+
typography: mapToRecord(state.typography),
|
|
38
|
+
rounded: mapToRecord(state.rounded),
|
|
39
|
+
spacing: mapToRecord(state.spacing),
|
|
40
|
+
components: Object.fromEntries([...state.components.entries()]
|
|
41
|
+
.sort(([left], [right]) => compareText(left, right))
|
|
42
|
+
.map(([key, component]) => [
|
|
43
|
+
key,
|
|
44
|
+
{
|
|
45
|
+
properties: mapToRecord(component.properties),
|
|
46
|
+
unresolved_refs: [...component.unresolvedRefs].sort(compareText),
|
|
47
|
+
},
|
|
48
|
+
])),
|
|
49
|
+
sections: [...(state.sections ?? [])],
|
|
50
|
+
unknown_keys: [...(state.unknownKeys ?? [])].sort(compareText),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function componentProperties(components) {
|
|
54
|
+
return Object.fromEntries(Object.entries(components).map(([key, component]) => [
|
|
55
|
+
key,
|
|
56
|
+
component.properties,
|
|
57
|
+
]));
|
|
58
|
+
}
|
|
59
|
+
export function diffDesignMdRecords(before, after) {
|
|
60
|
+
const beforeKeys = Object.keys(before).sort(compareText);
|
|
61
|
+
const afterKeys = Object.keys(after).sort(compareText);
|
|
62
|
+
return {
|
|
63
|
+
added: afterKeys.filter((key) => !(key in before)),
|
|
64
|
+
removed: beforeKeys.filter((key) => !(key in after)),
|
|
65
|
+
modified: afterKeys.filter((key) => key in before && stableJson(before[key]) !== stableJson(after[key])),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function mapToRecord(map) {
|
|
69
|
+
return Object.fromEntries([...map.entries()]
|
|
70
|
+
.sort(([left], [right]) => compareText(left, right))
|
|
71
|
+
.map(([key, value]) => [key, toJsonValue(value)]));
|
|
72
|
+
}
|
|
73
|
+
function toJsonValue(value) {
|
|
74
|
+
return JSON.parse(JSON.stringify(value));
|
|
75
|
+
}
|
|
76
|
+
function compareText(left, right) {
|
|
77
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
78
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const DESIGN_MD_TOOL_ADAPTER_SCHEMA_VERSION = 1;
|
|
2
|
+
export declare const DESIGN_MD_EXPORT_FORMATS: readonly ["json-tailwind", "css-tailwind", "tailwind", "dtcg", "css-vars"];
|
|
3
|
+
export type DesignMdExportFormat = (typeof DESIGN_MD_EXPORT_FORMATS)[number];
|
|
4
|
+
export type DesignMdValidationMode = "parse-validate" | "lint";
|
|
5
|
+
export type DesignMdFindingSeverity = "error" | "warning" | "info";
|
|
6
|
+
export interface DesignMdToolIdentity {
|
|
7
|
+
package_name: "@google/design.md";
|
|
8
|
+
package_version: string;
|
|
9
|
+
api_surface: "@google/design.md/linter";
|
|
10
|
+
}
|
|
11
|
+
export interface DesignMdFinding {
|
|
12
|
+
severity: DesignMdFindingSeverity;
|
|
13
|
+
path?: string;
|
|
14
|
+
message: string;
|
|
15
|
+
rule?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DesignMdFindingSummary {
|
|
18
|
+
errors: number;
|
|
19
|
+
warnings: number;
|
|
20
|
+
infos: number;
|
|
21
|
+
}
|
|
22
|
+
export interface DesignMdComponentSnapshot {
|
|
23
|
+
properties: Record<string, unknown>;
|
|
24
|
+
unresolved_refs: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface DesignMdSystemSnapshot {
|
|
27
|
+
name?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
colors: Record<string, unknown>;
|
|
30
|
+
typography: Record<string, unknown>;
|
|
31
|
+
rounded: Record<string, unknown>;
|
|
32
|
+
spacing: Record<string, unknown>;
|
|
33
|
+
components: Record<string, DesignMdComponentSnapshot>;
|
|
34
|
+
sections: string[];
|
|
35
|
+
unknown_keys: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface DesignMdValidationResult {
|
|
38
|
+
schema_version: typeof DESIGN_MD_TOOL_ADAPTER_SCHEMA_VERSION;
|
|
39
|
+
mode: DesignMdValidationMode;
|
|
40
|
+
tool: DesignMdToolIdentity;
|
|
41
|
+
valid: boolean;
|
|
42
|
+
findings: DesignMdFinding[];
|
|
43
|
+
summary: DesignMdFindingSummary;
|
|
44
|
+
design_system: DesignMdSystemSnapshot | null;
|
|
45
|
+
}
|
|
46
|
+
export interface DesignMdExportSuccess {
|
|
47
|
+
success: true;
|
|
48
|
+
format: DesignMdExportFormat;
|
|
49
|
+
media_type: "application/json" | "text/css";
|
|
50
|
+
content: string;
|
|
51
|
+
options: DesignMdExportOptions;
|
|
52
|
+
validation: DesignMdValidationResult;
|
|
53
|
+
}
|
|
54
|
+
export interface DesignMdExportFailure {
|
|
55
|
+
success: false;
|
|
56
|
+
format: DesignMdExportFormat;
|
|
57
|
+
error: string;
|
|
58
|
+
options: DesignMdExportOptions;
|
|
59
|
+
validation: DesignMdValidationResult;
|
|
60
|
+
}
|
|
61
|
+
export interface DesignMdExportOptions {
|
|
62
|
+
css_variable_prefix?: string;
|
|
63
|
+
}
|
|
64
|
+
export type DesignMdExportResult = DesignMdExportSuccess | DesignMdExportFailure;
|
|
65
|
+
export interface DesignMdTokenChangeSet {
|
|
66
|
+
added: string[];
|
|
67
|
+
removed: string[];
|
|
68
|
+
modified: string[];
|
|
69
|
+
}
|
|
70
|
+
export interface DesignMdDiffSuccess {
|
|
71
|
+
success: true;
|
|
72
|
+
tool: DesignMdToolIdentity;
|
|
73
|
+
tokens: {
|
|
74
|
+
colors: DesignMdTokenChangeSet;
|
|
75
|
+
typography: DesignMdTokenChangeSet;
|
|
76
|
+
rounded: DesignMdTokenChangeSet;
|
|
77
|
+
spacing: DesignMdTokenChangeSet;
|
|
78
|
+
components: DesignMdTokenChangeSet;
|
|
79
|
+
};
|
|
80
|
+
findings: {
|
|
81
|
+
before: DesignMdFindingSummary;
|
|
82
|
+
after: DesignMdFindingSummary;
|
|
83
|
+
delta: {
|
|
84
|
+
errors: number;
|
|
85
|
+
warnings: number;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
regression: boolean;
|
|
89
|
+
before_validation: DesignMdValidationResult;
|
|
90
|
+
after_validation: DesignMdValidationResult;
|
|
91
|
+
}
|
|
92
|
+
export interface DesignMdDiffFailure {
|
|
93
|
+
success: false;
|
|
94
|
+
tool: DesignMdToolIdentity;
|
|
95
|
+
error: string;
|
|
96
|
+
before_validation: DesignMdValidationResult;
|
|
97
|
+
after_validation: DesignMdValidationResult;
|
|
98
|
+
}
|
|
99
|
+
export type DesignMdDiffResult = DesignMdDiffSuccess | DesignMdDiffFailure;
|
|
@@ -43,6 +43,11 @@ export async function publishDesignResourceHandoffBundle(options) {
|
|
|
43
43
|
if (!declaredManifestPaths.has(manifestResource.path))
|
|
44
44
|
invalid("target_manifest_not_declared", `${declaredTarget.key}:${manifestResource.path}`);
|
|
45
45
|
const preflight = await preflightParsedDesignResourceHandoff(repository, parsed);
|
|
46
|
+
const publishedTarget = preflight.handoff.targets[0];
|
|
47
|
+
if ((publishedTarget.source_profile.kind === "implementation_web" ||
|
|
48
|
+
publishedTarget.source_profile.kind === "implementation_app") &&
|
|
49
|
+
preflight.technical_feasibility_identities.length !== 1)
|
|
50
|
+
invalid("implementation_feasibility_input_required", `${publishedTarget.key}:${preflight.technical_feasibility_identities.length}`);
|
|
46
51
|
handoffSetIntegrity.consume(preflight);
|
|
47
52
|
const targetKey = preflight.handoff.targets[0].key;
|
|
48
53
|
if (seenTargets.has(targetKey))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DesignResourceHandoffV1 } from "./design-resource-handoff-types.js";
|
|
2
2
|
import type { DesignResourceHandoffV2, ParsedDesignResourceHandoffV2 } from "./design-resource-symbolic-fact-types.js";
|
|
3
|
-
export type DesignResourceHandoffManifestBackedV1 = Pick<DesignResourceHandoffV1, "schema_version" | "intent" | "scope" | "provenance" | "resources" | "targets" | "resource_fact_closure" | "coverage" | "proposal"> & {
|
|
3
|
+
export type DesignResourceHandoffManifestBackedV1 = Pick<DesignResourceHandoffV1, "schema_version" | "intent" | "scope" | "provenance" | "project_design_authority" | "technical_feasibility_inputs" | "resources" | "targets" | "resource_fact_closure" | "coverage" | "proposal"> & {
|
|
4
4
|
representation: "manifest_backed";
|
|
5
5
|
};
|
|
6
6
|
export type DesignResourceHandoffInputV1 = DesignResourceHandoffV1 | DesignResourceHandoffManifestBackedV1;
|
|
@@ -11,6 +11,10 @@ export function hydrateManifestBackedDesignResourceHandoff(descriptor, manifests
|
|
|
11
11
|
intent: descriptor.intent,
|
|
12
12
|
scope: descriptor.scope,
|
|
13
13
|
provenance: descriptor.provenance,
|
|
14
|
+
...(descriptor.project_design_authority === undefined
|
|
15
|
+
? {}
|
|
16
|
+
: { project_design_authority: descriptor.project_design_authority }),
|
|
17
|
+
technical_feasibility_inputs: descriptor.technical_feasibility_inputs,
|
|
14
18
|
resources: descriptor.resources,
|
|
15
19
|
axis_dispositions: manifest.axis_dispositions,
|
|
16
20
|
condition_exclusions: manifest.condition_exclusions,
|
|
@@ -35,6 +35,7 @@ export function createDesignResourceHandoffSetIntegrity(fail) {
|
|
|
35
35
|
sharedHeader(scope, "provenance", handoff.provenance);
|
|
36
36
|
sharedHeader(scope, "proposal", handoff.proposal);
|
|
37
37
|
sharedCollection(scope, "resources", handoff.resources);
|
|
38
|
+
sharedCollection(scope, "technical_feasibility_inputs", handoff.technical_feasibility_inputs);
|
|
38
39
|
sharedCollection(scope, "conditions", handoff.conditions);
|
|
39
40
|
sharedCollection(scope, "properties", handoff.properties);
|
|
40
41
|
sharedCollection(scope, "resource_fact_closure", handoff.resource_fact_closure);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { parseDesignResourceSymbolicHandoffShape } from "./design-resource-symbolic-fact-shape.js";
|
|
2
|
+
import { parseDesignResourceTechnicalFeasibilityInputs } from "./design-resource-implementation-feasibility-shape.js";
|
|
3
|
+
import { parseDesignAuthorityHandoffBinding } from "./design-authority-binding.js";
|
|
2
4
|
import { parseDesignResourceAssetBindings, parseDesignResourceAxisDispositions, parseDesignResourceConditionExclusions, parseDesignResourceEnvironments, parseDesignResourceFactCells, parseDesignResourceLineageNodes, parseDesignResourceOracles, parseDesignResourceProofObligations, parseDesignResourceProperties, parseDesignResourceVariationAxisDispositions, parseDesignResourceVariationExclusions, parseDesignResourceVariations, } from "./design-resource-fact-manifest-shape.js";
|
|
3
5
|
import { parseDesignResourceHandoffBlockers, parseDesignResourceHandoffCoverage, parseDesignResourceHandoffEvidence, parseDesignResourceHandoffFacts, parseDesignResourceHandoffResourceFactClosure, } from "./design-resource-handoff-shape-evidence.js";
|
|
4
6
|
import { contractKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
|
|
@@ -49,7 +51,7 @@ export function parseDesignResourceHandoffShape(value) {
|
|
|
49
51
|
"coverage",
|
|
50
52
|
"acceptance_blockers",
|
|
51
53
|
"proposal",
|
|
52
|
-
]);
|
|
54
|
+
], ["technical_feasibility_inputs", "project_design_authority"]);
|
|
53
55
|
const scope = object(root.scope, "design_resource_handoff.scope", [
|
|
54
56
|
"key",
|
|
55
57
|
"style_dependency",
|
|
@@ -92,6 +94,12 @@ export function parseDesignResourceHandoffShape(value) {
|
|
|
92
94
|
model: string(provenance.model, "design_resource_handoff.provenance.model"),
|
|
93
95
|
design_system_id: string(provenance.design_system_id, "design_resource_handoff.provenance.design_system_id"),
|
|
94
96
|
},
|
|
97
|
+
...(root.project_design_authority === undefined
|
|
98
|
+
? {}
|
|
99
|
+
: {
|
|
100
|
+
project_design_authority: parseDesignAuthorityHandoffBinding(root.project_design_authority, "design_resource_handoff.project_design_authority"),
|
|
101
|
+
}),
|
|
102
|
+
technical_feasibility_inputs: parseDesignResourceTechnicalFeasibilityInputs(root.technical_feasibility_inputs ?? []),
|
|
95
103
|
resources: parseDesignResourceHandoffResources(root.resources),
|
|
96
104
|
axis_dispositions: parseDesignResourceAxisDispositions(root.axis_dispositions),
|
|
97
105
|
condition_exclusions: parseDesignResourceConditionExclusions(root.condition_exclusions),
|
|
@@ -132,12 +140,16 @@ function parseManifestBackedDesignResourceHandoffShape(value) {
|
|
|
132
140
|
"resource_fact_closure",
|
|
133
141
|
"coverage",
|
|
134
142
|
"proposal",
|
|
135
|
-
]);
|
|
143
|
+
], ["technical_feasibility_inputs", "project_design_authority"]);
|
|
136
144
|
const parsed = parseDesignResourceHandoffShape({
|
|
137
145
|
schema_version: root.schema_version,
|
|
138
146
|
intent: root.intent,
|
|
139
147
|
scope: root.scope,
|
|
140
148
|
provenance: root.provenance,
|
|
149
|
+
...(root.project_design_authority === undefined
|
|
150
|
+
? {}
|
|
151
|
+
: { project_design_authority: root.project_design_authority }),
|
|
152
|
+
technical_feasibility_inputs: root.technical_feasibility_inputs ?? [],
|
|
141
153
|
resources: root.resources,
|
|
142
154
|
axis_dispositions: [],
|
|
143
155
|
condition_exclusions: [],
|
|
@@ -167,6 +179,10 @@ function parseManifestBackedDesignResourceHandoffShape(value) {
|
|
|
167
179
|
intent: parsed.intent,
|
|
168
180
|
scope: parsed.scope,
|
|
169
181
|
provenance: parsed.provenance,
|
|
182
|
+
...(parsed.project_design_authority === undefined
|
|
183
|
+
? {}
|
|
184
|
+
: { project_design_authority: parsed.project_design_authority }),
|
|
185
|
+
technical_feasibility_inputs: parsed.technical_feasibility_inputs,
|
|
170
186
|
resources: parsed.resources,
|
|
171
187
|
targets: parsed.targets,
|
|
172
188
|
resource_fact_closure: parsed.resource_fact_closure,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ExecutionTargetCapabilityV2 } from "./execution-target-capabilities.js";
|
|
2
2
|
import type { DesignResourceAssetBindingV1, DesignResourceAxisDispositionV1, DesignResourceConditionCombinationDispositionV1, DesignResourceEnvironmentV1, DesignResourceFactCellV1, DesignResourceFactV1, DesignResourceLineageNodeV1, DesignResourceManifestCollectionName, DesignResourceOracleV1, DesignResourcePropertyDefinitionV1, DesignResourceProofObligationV1, DesignResourceRelationEndpointV1, DesignResourceSubjectKind, DesignResourceSubjectPresenceKind, DesignResourceSubjectVariationV1, DesignResourceVariationAxisDispositionV1, DesignResourceVariationCombinationDispositionV1 } from "./design-resource-fact-manifest-types.js";
|
|
3
|
+
import type { DesignResourceImplementationFeasibilityIdentityV1, DesignResourceImplementationFeasibilityV1, DesignResourceTechnicalFeasibilityInputV1 } from "./design-resource-implementation-feasibility-types.js";
|
|
4
|
+
import type { DesignAuthorityHandoffBinding, DesignAuthorityHandoffResolution } from "./design-authority-types.js";
|
|
3
5
|
export declare const DESIGN_RESOURCE_DIMENSIONS: readonly ["surface_flow", "visual_content", "component_control", "state_interaction", "motion", "adaptation_input", "accessibility", "assets"];
|
|
4
6
|
export type DesignResourceDimension = (typeof DESIGN_RESOURCE_DIMENSIONS)[number];
|
|
5
7
|
export declare const DESIGN_RESOURCE_EVIDENCE_KINDS: readonly ["frame", "component_variant", "prototype_state", "prototype_transition", "motion_spec", "motion_capture", "responsive_spec", "input_spec", "accessibility_spec", "semantic_tree", "token_spec", "asset", "annotation", "localization_spec", "system_ui_spec", "haptic_spec", "sound_spec", "sound_capture", "render_environment", "relation_spec"];
|
|
@@ -30,6 +32,8 @@ export interface DesignResourceHandoffV1 {
|
|
|
30
32
|
model: string;
|
|
31
33
|
design_system_id: string;
|
|
32
34
|
};
|
|
35
|
+
project_design_authority?: DesignAuthorityHandoffBinding;
|
|
36
|
+
technical_feasibility_inputs: DesignResourceTechnicalFeasibilityInputV1[];
|
|
33
37
|
resources: DesignResourceHandoffResourceV1[];
|
|
34
38
|
axis_dispositions: DesignResourceAxisDispositionV1[];
|
|
35
39
|
condition_exclusions: DesignResourceConditionCombinationDispositionV1[];
|
|
@@ -219,7 +223,11 @@ export interface ParsedDesignResourceHandoffV1 {
|
|
|
219
223
|
export interface DesignResourceHandoffPreflightV1 extends ParsedDesignResourceHandoffV1 {
|
|
220
224
|
schema_version: "design-resource-handoff-preflight-v1";
|
|
221
225
|
status: "ready";
|
|
226
|
+
project_design_authority_resolution: DesignAuthorityHandoffResolution;
|
|
222
227
|
resource_hashes: Record<string, string>;
|
|
228
|
+
technical_feasibility_documents: DesignResourceImplementationFeasibilityV1[];
|
|
229
|
+
technical_feasibility_identities: DesignResourceImplementationFeasibilityIdentityV1[];
|
|
230
|
+
limitations: string[];
|
|
223
231
|
manifest_identities: Array<{
|
|
224
232
|
resource_ref: string;
|
|
225
233
|
path: string;
|
|
@@ -12,6 +12,9 @@ import { indexDesignResourceItems, invalidDesignResourceHandoff, requireNonempty
|
|
|
12
12
|
import { validateDesignResourceConditions, validateDesignResourceEvidence, validateDesignResourceScope, validateDesignResourceSubjects, validateDesignResourceTargets, } from "./design-resource-handoff-validation-structure.js";
|
|
13
13
|
import { assertProtectedRepositoryFile } from "./long-task-protected-files.js";
|
|
14
14
|
import { assertDesignResourceV1HandoffCapacity } from "./design-resource-v1-capacity.js";
|
|
15
|
+
import { createV1ImplementationFeasibilityTargetModel } from "./design-resource-implementation-feasibility-model.js";
|
|
16
|
+
import { readAndValidateDesignResourceImplementationFeasibility } from "./design-resource-implementation-feasibility-validation.js";
|
|
17
|
+
import { resolveDesignAuthorityHandoffBinding } from "./design-authority-binding.js";
|
|
15
18
|
export async function preflightDesignResourceHandoff(repository, handoffPath) {
|
|
16
19
|
const handoffFile = await assertProtectedRepositoryFile(repository, path.resolve(repository, ...handoffPath.split("/")), "design_resource_handoff");
|
|
17
20
|
await assertDesignResourceV1HandoffCapacity(handoffFile);
|
|
@@ -28,6 +31,11 @@ function isParsedSymbolicHandoff(parsed) {
|
|
|
28
31
|
}
|
|
29
32
|
export async function preflightParsedDesignResourceHandoff(repository, parsed) {
|
|
30
33
|
const inputHandoff = parsed.handoff;
|
|
34
|
+
const authorityResolution = await resolveDesignAuthorityHandoffBinding({
|
|
35
|
+
repository,
|
|
36
|
+
style_dependency: inputHandoff.scope.style_dependency,
|
|
37
|
+
binding: inputHandoff.project_design_authority,
|
|
38
|
+
});
|
|
31
39
|
if (isManifestBacked(inputHandoff) && inputHandoff.targets.length !== 1)
|
|
32
40
|
invalidDesignResourceHandoff("manifest_backed_one_target_required", String(inputHandoff.targets.length));
|
|
33
41
|
if (!isManifestBacked(inputHandoff))
|
|
@@ -46,11 +54,27 @@ export async function preflightParsedDesignResourceHandoff(repository, parsed) {
|
|
|
46
54
|
validateDesignResourceFiles(normalized, snapshot.contents);
|
|
47
55
|
validateDesignResourceFactManifests(normalized, snapshot.contents, manifests, !isManifestBacked(inputHandoff));
|
|
48
56
|
const resources = new Map(handoff.resources.map((resource) => [resource.key, resource]));
|
|
57
|
+
const feasibility = await readAndValidateDesignResourceImplementationFeasibility(repository, parsed.handoff_path, handoff.technical_feasibility_inputs, new Map(handoff.targets.map((target) => [
|
|
58
|
+
target.key,
|
|
59
|
+
createV1ImplementationFeasibilityTargetModel(handoff, target),
|
|
60
|
+
])), new Set(handoff.resources.map((resource) => resource.path)));
|
|
49
61
|
return {
|
|
50
62
|
schema_version: "design-resource-handoff-preflight-v1",
|
|
51
63
|
status: "ready",
|
|
64
|
+
project_design_authority_resolution: authorityResolution,
|
|
52
65
|
...normalized,
|
|
53
66
|
resource_hashes: snapshot.hashes,
|
|
67
|
+
technical_feasibility_documents: feasibility.map((item) => item.document),
|
|
68
|
+
technical_feasibility_identities: feasibility.map((item) => item.identity),
|
|
69
|
+
limitations: [
|
|
70
|
+
...(authorityResolution.compatibility_derived
|
|
71
|
+
? ["project Design Authority identity derived from legacy DESIGN.md"]
|
|
72
|
+
: []),
|
|
73
|
+
...(handoff.targets.some((target) => target.source_profile.kind !== "reference" &&
|
|
74
|
+
!feasibility.some((item) => item.index.target_ref === target.key))
|
|
75
|
+
? ["technical feasibility not declared"]
|
|
76
|
+
: []),
|
|
77
|
+
],
|
|
54
78
|
manifest_identities: handoff.targets.map((target) => {
|
|
55
79
|
const resourceRef = target.source_profile.fact_manifest_resource_ref;
|
|
56
80
|
const resource = resources.get(resourceRef);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DesignResourceHandoffV1 } from "./design-resource-handoff-types.js";
|
|
2
|
+
import type { DesignResourceObservableRuleManifestV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicHandoffTargetV2 } from "./design-resource-symbolic-fact-types.js";
|
|
3
|
+
import type { SymbolicDenotationAxisDomain, SymbolicDenotationPredicate } from "./symbolic-denotation-types.js";
|
|
4
|
+
interface FeasibilityTargetModelBase {
|
|
5
|
+
target_ref: string;
|
|
6
|
+
source_profile_kind: "implementation_web" | "implementation_app" | "reference";
|
|
7
|
+
component_family_refs: string[];
|
|
8
|
+
component_family_subject_refs: Map<string, Set<string>>;
|
|
9
|
+
}
|
|
10
|
+
export interface DesignResourceImplementationFeasibilityV1TargetModel extends FeasibilityTargetModelBase {
|
|
11
|
+
representation: "fact_cells_v1";
|
|
12
|
+
condition_refs: string[];
|
|
13
|
+
facts: Map<string, {
|
|
14
|
+
target_ref: string;
|
|
15
|
+
subject_ref: string;
|
|
16
|
+
condition_ref: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export interface DesignResourceImplementationFeasibilityV2TargetModel extends FeasibilityTargetModelBase {
|
|
20
|
+
representation: "symbolic_rules_v2";
|
|
21
|
+
axis_domains: SymbolicDenotationAxisDomain[];
|
|
22
|
+
reachable_region: SymbolicDenotationPredicate;
|
|
23
|
+
fact_rules: Map<string, DesignResourceSymbolicFactRuleV2>;
|
|
24
|
+
}
|
|
25
|
+
export type DesignResourceImplementationFeasibilityTargetModel = DesignResourceImplementationFeasibilityV1TargetModel | DesignResourceImplementationFeasibilityV2TargetModel;
|
|
26
|
+
export declare function createV1ImplementationFeasibilityTargetModel(handoff: DesignResourceHandoffV1, target: DesignResourceHandoffV1["targets"][number]): DesignResourceImplementationFeasibilityV1TargetModel;
|
|
27
|
+
export declare function createV2ImplementationFeasibilityTargetModel(target: DesignResourceSymbolicHandoffTargetV2, manifest: DesignResourceObservableRuleManifestV2): DesignResourceImplementationFeasibilityV2TargetModel;
|
|
28
|
+
export declare function deriveComponentFamilySubjectClosure(familyRefs: string[], subjects: Array<{
|
|
29
|
+
key: string;
|
|
30
|
+
family_ref: string | null;
|
|
31
|
+
parent_ref: string | null;
|
|
32
|
+
instance_of_ref: string | null;
|
|
33
|
+
override_of_ref: string | null;
|
|
34
|
+
}>): Map<string, Set<string>>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function createV1ImplementationFeasibilityTargetModel(handoff, target) {
|
|
2
|
+
const componentFamilies = handoff.subjects.filter((subject) => subject.kind === "component_family" &&
|
|
3
|
+
subject.target_refs.includes(target.key));
|
|
4
|
+
return {
|
|
5
|
+
representation: "fact_cells_v1",
|
|
6
|
+
target_ref: target.key,
|
|
7
|
+
source_profile_kind: target.source_profile.kind,
|
|
8
|
+
component_family_refs: componentFamilies.map((subject) => subject.key),
|
|
9
|
+
component_family_subject_refs: deriveComponentFamilySubjectClosure(componentFamilies.map((subject) => subject.key), handoff.subjects),
|
|
10
|
+
condition_refs: [...target.condition_refs],
|
|
11
|
+
facts: new Map(handoff.facts.map((fact) => [
|
|
12
|
+
fact.key,
|
|
13
|
+
{
|
|
14
|
+
target_ref: fact.target_ref,
|
|
15
|
+
subject_ref: fact.subject_ref,
|
|
16
|
+
condition_ref: fact.condition_ref,
|
|
17
|
+
},
|
|
18
|
+
])),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createV2ImplementationFeasibilityTargetModel(target, manifest) {
|
|
22
|
+
const componentFamilies = manifest.subjects.filter((subject) => subject.kind === "component_family" &&
|
|
23
|
+
subject.target_refs.includes(target.key));
|
|
24
|
+
return {
|
|
25
|
+
representation: "symbolic_rules_v2",
|
|
26
|
+
target_ref: target.key,
|
|
27
|
+
source_profile_kind: target.source_profile.kind,
|
|
28
|
+
component_family_refs: componentFamilies.map((subject) => subject.key),
|
|
29
|
+
component_family_subject_refs: deriveComponentFamilySubjectClosure(componentFamilies.map((subject) => subject.key), manifest.subjects),
|
|
30
|
+
axis_domains: manifest.axis_domains,
|
|
31
|
+
reachable_region: manifest.reachable_region,
|
|
32
|
+
fact_rules: new Map(manifest.fact_rules.map((rule) => [rule.key, rule])),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function deriveComponentFamilySubjectClosure(familyRefs, subjects) {
|
|
36
|
+
const result = new Map();
|
|
37
|
+
for (const familyRef of familyRefs) {
|
|
38
|
+
const closure = new Set(subjects
|
|
39
|
+
.filter((subject) => subject.key === familyRef ||
|
|
40
|
+
subject.family_ref === familyRef ||
|
|
41
|
+
subject.instance_of_ref === familyRef)
|
|
42
|
+
.map((subject) => subject.key));
|
|
43
|
+
let changed = true;
|
|
44
|
+
while (changed) {
|
|
45
|
+
changed = false;
|
|
46
|
+
for (const subject of subjects) {
|
|
47
|
+
if (closure.has(subject.key))
|
|
48
|
+
continue;
|
|
49
|
+
if ((subject.parent_ref !== null && closure.has(subject.parent_ref)) ||
|
|
50
|
+
(subject.instance_of_ref !== null &&
|
|
51
|
+
closure.has(subject.instance_of_ref)) ||
|
|
52
|
+
(subject.override_of_ref !== null &&
|
|
53
|
+
closure.has(subject.override_of_ref))) {
|
|
54
|
+
closure.add(subject.key);
|
|
55
|
+
changed = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
result.set(familyRef, closure);
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type DesignResourceImplementationConditionModelV1 } from "./design-resource-implementation-feasibility-types.js";
|
|
2
|
+
export declare function parseConditionModel(value: unknown, label: string): DesignResourceImplementationConditionModelV1;
|
|
3
|
+
export declare function parseComponentFamilyCells(value: unknown, label: string): {
|
|
4
|
+
key: string;
|
|
5
|
+
component_family_ref: string;
|
|
6
|
+
target_ref: string;
|
|
7
|
+
condition_profile_ref: string;
|
|
8
|
+
design_fact_refs: string[];
|
|
9
|
+
feasible_realizations: {
|
|
10
|
+
key: string;
|
|
11
|
+
strategy_steps: ("compose_existing" | "create_shared_component" | "extend_shared_component" | "reuse_existing" | "theme_with_tokens")[];
|
|
12
|
+
primitive_refs: string[];
|
|
13
|
+
owner_candidates: ({
|
|
14
|
+
kind: "existing_path";
|
|
15
|
+
locator: string;
|
|
16
|
+
existence: "existing";
|
|
17
|
+
authorization_source_refs?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "planned_logical_owner";
|
|
20
|
+
locator: string;
|
|
21
|
+
existence: "planned";
|
|
22
|
+
authorization_source_refs: string[];
|
|
23
|
+
})[];
|
|
24
|
+
supported_customization_surfaces: ("behavior_slot" | "component_variant" | "composition" | "content_slot" | "icon_slot" | "primitive_props" | "style_api" | "theme_tokens")[];
|
|
25
|
+
feasibility_basis_refs: string[];
|
|
26
|
+
observed_costs: string[];
|
|
27
|
+
observed_risks: string[];
|
|
28
|
+
}[];
|
|
29
|
+
required_realization: {
|
|
30
|
+
realization_ref: string | null;
|
|
31
|
+
technical_authority_source_refs: string[];
|
|
32
|
+
};
|
|
33
|
+
blocker_refs: string[];
|
|
34
|
+
}[];
|
|
35
|
+
export declare function parseBlockers(value: unknown, label: string): {
|
|
36
|
+
key: string;
|
|
37
|
+
component_family_ref: string;
|
|
38
|
+
target_ref: string;
|
|
39
|
+
condition_profile_ref: string;
|
|
40
|
+
source_record_refs: string[];
|
|
41
|
+
substrate_observation_refs: ("component_owner_roots" | "framework_runtime" | "platform" | "route_owner_roots" | "token_theming_adapter" | "ui_system")[];
|
|
42
|
+
description: string;
|
|
43
|
+
}[];
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { DESIGN_RESOURCE_CUSTOMIZATION_SURFACES, DESIGN_RESOURCE_IMPLEMENTATION_STRATEGY_STEPS, DESIGN_RESOURCE_SUBSTRATE_OBSERVATION_KINDS, } from "./design-resource-implementation-feasibility-types.js";
|
|
2
|
+
import { parseSymbolicPredicate } from "./design-resource-symbolic-predicate-shape.js";
|
|
3
|
+
import { contractKey, stableKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
|
|
4
|
+
import { array, literal, nullable, object, repositoryFile, string, strings, } from "./long-task-shape-primitives.js";
|
|
5
|
+
export function parseConditionModel(value, label) {
|
|
6
|
+
const itemLabel = `${label}.condition_model`;
|
|
7
|
+
const kind = object(value, itemLabel, ["kind", "profiles"]).kind;
|
|
8
|
+
if (kind === "explicit_conditions_v1") {
|
|
9
|
+
const row = object(value, itemLabel, ["kind", "profiles"]);
|
|
10
|
+
return {
|
|
11
|
+
kind: literal(row.kind, ["explicit_conditions_v1"], `${itemLabel}.kind`),
|
|
12
|
+
profiles: array(row.profiles, `${itemLabel}.profiles`).map((profile, index) => {
|
|
13
|
+
const profileLabel = `${itemLabel}.profiles[${index}]`;
|
|
14
|
+
const profileRow = object(profile, profileLabel, [
|
|
15
|
+
"key",
|
|
16
|
+
"condition_refs",
|
|
17
|
+
]);
|
|
18
|
+
return {
|
|
19
|
+
key: stableKey(profileRow.key, `${profileLabel}.key`),
|
|
20
|
+
condition_refs: stableKeys(profileRow.condition_refs, `${profileLabel}.condition_refs`),
|
|
21
|
+
};
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const row = object(value, itemLabel, ["kind", "profiles"]);
|
|
26
|
+
return {
|
|
27
|
+
kind: literal(row.kind, ["symbolic_regions_v2"], `${itemLabel}.kind`),
|
|
28
|
+
profiles: array(row.profiles, `${itemLabel}.profiles`).map((profile, index) => {
|
|
29
|
+
const profileLabel = `${itemLabel}.profiles[${index}]`;
|
|
30
|
+
const profileRow = object(profile, profileLabel, ["key", "region"]);
|
|
31
|
+
return {
|
|
32
|
+
key: stableKey(profileRow.key, `${profileLabel}.key`),
|
|
33
|
+
region: parseSymbolicPredicate(profileRow.region, `${profileLabel}.region`),
|
|
34
|
+
};
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function parseComponentFamilyCells(value, label) {
|
|
39
|
+
return array(value, `${label}.component_family_cells`).map((item, index) => {
|
|
40
|
+
const itemLabel = `${label}.component_family_cells[${index}]`;
|
|
41
|
+
const row = object(item, itemLabel, [
|
|
42
|
+
"key",
|
|
43
|
+
"component_family_ref",
|
|
44
|
+
"target_ref",
|
|
45
|
+
"condition_profile_ref",
|
|
46
|
+
"design_fact_refs",
|
|
47
|
+
"feasible_realizations",
|
|
48
|
+
"required_realization",
|
|
49
|
+
"blocker_refs",
|
|
50
|
+
]);
|
|
51
|
+
const required = object(row.required_realization, `${itemLabel}.required_realization`, ["realization_ref", "technical_authority_source_refs"]);
|
|
52
|
+
return {
|
|
53
|
+
key: stableKey(row.key, `${itemLabel}.key`),
|
|
54
|
+
component_family_ref: stableKey(row.component_family_ref, `${itemLabel}.component_family_ref`),
|
|
55
|
+
target_ref: contractKey(row.target_ref, `${itemLabel}.target_ref`),
|
|
56
|
+
condition_profile_ref: stableKey(row.condition_profile_ref, `${itemLabel}.condition_profile_ref`),
|
|
57
|
+
design_fact_refs: stableKeys(row.design_fact_refs, `${itemLabel}.design_fact_refs`),
|
|
58
|
+
feasible_realizations: parseRealizations(row.feasible_realizations, itemLabel),
|
|
59
|
+
required_realization: {
|
|
60
|
+
realization_ref: nullable(required.realization_ref, (entry) => stableKey(entry, `${itemLabel}.required_realization.realization_ref`)),
|
|
61
|
+
technical_authority_source_refs: stableKeys(required.technical_authority_source_refs, `${itemLabel}.required_realization.technical_authority_source_refs`),
|
|
62
|
+
},
|
|
63
|
+
blocker_refs: stableKeys(row.blocker_refs, `${itemLabel}.blocker_refs`),
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function parseRealizations(value, label) {
|
|
68
|
+
return array(value, `${label}.feasible_realizations`).map((item, index) => {
|
|
69
|
+
const itemLabel = `${label}.feasible_realizations[${index}]`;
|
|
70
|
+
const row = object(item, itemLabel, [
|
|
71
|
+
"key",
|
|
72
|
+
"strategy_steps",
|
|
73
|
+
"primitive_refs",
|
|
74
|
+
"owner_candidates",
|
|
75
|
+
"supported_customization_surfaces",
|
|
76
|
+
"feasibility_basis_refs",
|
|
77
|
+
"observed_costs",
|
|
78
|
+
"observed_risks",
|
|
79
|
+
]);
|
|
80
|
+
return {
|
|
81
|
+
key: stableKey(row.key, `${itemLabel}.key`),
|
|
82
|
+
strategy_steps: array(row.strategy_steps, `${itemLabel}.strategy_steps`).map((step, stepIndex) => literal(step, DESIGN_RESOURCE_IMPLEMENTATION_STRATEGY_STEPS, `${itemLabel}.strategy_steps[${stepIndex}]`)),
|
|
83
|
+
primitive_refs: stableKeys(row.primitive_refs, `${itemLabel}.primitive_refs`),
|
|
84
|
+
owner_candidates: parseOwnerCandidates(row.owner_candidates, itemLabel),
|
|
85
|
+
supported_customization_surfaces: array(row.supported_customization_surfaces, `${itemLabel}.supported_customization_surfaces`).map((surface, surfaceIndex) => literal(surface, DESIGN_RESOURCE_CUSTOMIZATION_SURFACES, `${itemLabel}.supported_customization_surfaces[${surfaceIndex}]`)),
|
|
86
|
+
feasibility_basis_refs: stableKeys(row.feasibility_basis_refs, `${itemLabel}.feasibility_basis_refs`),
|
|
87
|
+
observed_costs: strings(row.observed_costs, `${itemLabel}.observed_costs`),
|
|
88
|
+
observed_risks: strings(row.observed_risks, `${itemLabel}.observed_risks`),
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function parseOwnerCandidates(value, label) {
|
|
93
|
+
return array(value, `${label}.owner_candidates`).map((item, index) => {
|
|
94
|
+
const itemLabel = `${label}.owner_candidates[${index}]`;
|
|
95
|
+
const kind = object(item, itemLabel, ["kind", "locator", "existence"], ["authorization_source_refs"]).kind;
|
|
96
|
+
if (kind === "existing_path") {
|
|
97
|
+
const row = object(item, itemLabel, ["kind", "locator", "existence"]);
|
|
98
|
+
return {
|
|
99
|
+
kind: literal(row.kind, ["existing_path"], `${itemLabel}.kind`),
|
|
100
|
+
locator: repositoryFile(row.locator, `${itemLabel}.locator`),
|
|
101
|
+
existence: literal(row.existence, ["existing"], `${itemLabel}.existence`),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const row = object(item, itemLabel, [
|
|
105
|
+
"kind",
|
|
106
|
+
"locator",
|
|
107
|
+
"existence",
|
|
108
|
+
"authorization_source_refs",
|
|
109
|
+
]);
|
|
110
|
+
return {
|
|
111
|
+
kind: literal(row.kind, ["planned_logical_owner"], `${itemLabel}.kind`),
|
|
112
|
+
locator: stableKey(row.locator, `${itemLabel}.locator`),
|
|
113
|
+
existence: literal(row.existence, ["planned"], `${itemLabel}.existence`),
|
|
114
|
+
authorization_source_refs: stableKeys(row.authorization_source_refs, `${itemLabel}.authorization_source_refs`),
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
export function parseBlockers(value, label) {
|
|
119
|
+
return array(value, `${label}.blockers`).map((item, index) => {
|
|
120
|
+
const itemLabel = `${label}.blockers[${index}]`;
|
|
121
|
+
const row = object(item, itemLabel, [
|
|
122
|
+
"key",
|
|
123
|
+
"component_family_ref",
|
|
124
|
+
"target_ref",
|
|
125
|
+
"condition_profile_ref",
|
|
126
|
+
"source_record_refs",
|
|
127
|
+
"substrate_observation_refs",
|
|
128
|
+
"description",
|
|
129
|
+
]);
|
|
130
|
+
return {
|
|
131
|
+
key: stableKey(row.key, `${itemLabel}.key`),
|
|
132
|
+
component_family_ref: stableKey(row.component_family_ref, `${itemLabel}.component_family_ref`),
|
|
133
|
+
target_ref: contractKey(row.target_ref, `${itemLabel}.target_ref`),
|
|
134
|
+
condition_profile_ref: stableKey(row.condition_profile_ref, `${itemLabel}.condition_profile_ref`),
|
|
135
|
+
source_record_refs: stableKeys(row.source_record_refs, `${itemLabel}.source_record_refs`),
|
|
136
|
+
substrate_observation_refs: array(row.substrate_observation_refs, `${itemLabel}.substrate_observation_refs`)
|
|
137
|
+
.map((observationRef, observationIndex) => literal(observationRef, DESIGN_RESOURCE_SUBSTRATE_OBSERVATION_KINDS, `${itemLabel}.substrate_observation_refs[${observationIndex}]`))
|
|
138
|
+
.sort(),
|
|
139
|
+
description: string(row.description, `${itemLabel}.description`),
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
}
|