project-tiny-context-harness 0.8.17 → 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 +93 -30
- package/assets/README.md +158 -44
- package/assets/README.zh-CN.md +88 -29
- package/assets/agents/AGENTS_CORE.md +2 -2
- package/assets/context_templates/context.toml +6 -1
- 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/design-resource-authoring/SKILL.md +6 -3
- package/assets/skills/design-resource-authoring/references/authority-delta-assessment.md +52 -0
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +5 -1
- 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 +8 -1
- 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-input-types.d.ts +1 -1
- package/dist/lib/design-resource-handoff-manifest-projection.js +3 -0
- package/dist/lib/design-resource-handoff-shape.js +14 -2
- package/dist/lib/design-resource-handoff-types.d.ts +3 -0
- package/dist/lib/design-resource-handoff-validation.js +16 -4
- package/dist/lib/design-resource-implementation-feasibility-validation-support.js +1 -1
- 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 +7 -1
- package/dist/lib/design-resource-symbolic-fact-types.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-fact-validation.js +15 -3
- 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 +72 -69
- 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-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.js +3 -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 +6 -1
- package/dist/lib/long-task-delivery-validation.js +19 -4
- package/dist/lib/long-task-design-feasibility-binding.d.ts +1 -0
- package/dist/lib/long-task-design-feasibility-binding.js +3 -3
- package/dist/lib/long-task-design-feasibility-source-closure.js +11 -2
- 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 +3 -1
- package/dist/lib/long-task-design-resource-handoff.js +36 -12
- package/dist/lib/long-task-design-resource-method-binding.js +12 -0
- 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 +128 -5
- 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 +2 -5
- package/dist/lib/long-task-process-table.js +21 -53
- package/dist/lib/long-task-process-tree.d.ts +0 -1
- package/dist/lib/long-task-process-tree.js +24 -54
- 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-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-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 +1 -0
- package/dist/lib/repository-path-safety.js +3 -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 +5 -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
|
@@ -4,6 +4,7 @@ import type { CompiledSourceItemV2, DeliveryContractV2 } from "./long-task-deliv
|
|
|
4
4
|
import type { ContractDesignTarget } from "./long-task-design-resource-handoff.js";
|
|
5
5
|
type DesignResourcePreflight = DesignResourceHandoffPreflightV1 | DesignResourceHandoffPreflightV2;
|
|
6
6
|
export interface LongTaskDesignFeasibilityBindingValidationResult {
|
|
7
|
+
attribution_mode: "feasibility" | "legacy";
|
|
7
8
|
consumed_component_binding_refs: string[];
|
|
8
9
|
}
|
|
9
10
|
export interface LongTaskDesignFeasibilityBindingValidationOptions {
|
|
@@ -9,9 +9,8 @@ export function validateLongTaskDesignFeasibilityBindings(contract, contractTarg
|
|
|
9
9
|
if (!contractTarget.binding.component_binding_refs.length)
|
|
10
10
|
invalid("componentless_surface_requires_blocker_only_feasibility", contractTarget.target.key);
|
|
11
11
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
],
|
|
12
|
+
attribution_mode: "legacy",
|
|
13
|
+
consumed_component_binding_refs: [],
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
const model = feasibilityTargetModel(preflight, contractTarget.target.key);
|
|
@@ -74,6 +73,7 @@ export function validateLongTaskDesignFeasibilityBindings(contract, contractTarg
|
|
|
74
73
|
validateComponentBindingAttribution(contractTarget, consumedComponentBindings);
|
|
75
74
|
validateFeasibilityBlockers(contract, contractTarget, document, model, decisions);
|
|
76
75
|
return {
|
|
76
|
+
attribution_mode: "feasibility",
|
|
77
77
|
consumed_component_binding_refs: [...consumedComponentBindings].sort(),
|
|
78
78
|
};
|
|
79
79
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DESIGN_RESOURCE_FEASIBILITY_DECISION_SCHEMA, deriveDesignResourceFeasibilityConditionScopeSha256, requireExactFeasibilityDecisionProjection, } from "./design-resource-implementation-feasibility-source-decision.js";
|
|
2
|
+
import { designFactObligationDescriptors, externalDesignObligationMatches, } from "./long-task-design-obligation.js";
|
|
2
3
|
import { invalid } from "./long-task-design-resource-method-binding.js";
|
|
3
4
|
export function validateSelectedPlannedOwnerClaims(contract, contractTarget, document, model, decisions, realization, bindings, cell) {
|
|
4
5
|
for (const owner of realization.owner_candidates) {
|
|
@@ -45,15 +46,23 @@ export function validateFeasibilityBlockers(contract, contractTarget, document,
|
|
|
45
46
|
if (claim.disposition.type !== "external_confirmation")
|
|
46
47
|
invalid("feasibility_blocker_external_confirmation_required", `${blocker.key}:${claim.key}:${claim.disposition.type}`);
|
|
47
48
|
const impactedTargetClaims = new Set(contractTarget.target.claim_refs.map((claimRef) => `${contractTarget.outcome_key}.${claimRef}`));
|
|
49
|
+
const exactTargetDesignObligations = designFactObligationDescriptors(contract).filter((descriptor) => descriptor.outcome_key === contractTarget.outcome_key &&
|
|
50
|
+
descriptor.target_key === contractTarget.target.key);
|
|
48
51
|
for (const confirmationRef of claim.disposition.refs) {
|
|
49
52
|
const confirmation = contract.global.acceptance.external_confirmations.find((candidate) => candidate.key === confirmationRef);
|
|
50
53
|
if (!confirmation)
|
|
51
54
|
invalid("feasibility_blocker_confirmation_unknown", `${blocker.key}:${confirmationRef}`);
|
|
52
55
|
if (!confirmation.blocks_target)
|
|
53
56
|
invalid("feasibility_blocker_confirmation_not_blocking", `${blocker.key}:${confirmationRef}`);
|
|
54
|
-
if (!confirmation.
|
|
55
|
-
|
|
57
|
+
if (!confirmation.obligations?.some((obligation) => obligation.result_kind === "actual" &&
|
|
58
|
+
obligation.fact_ref !== null &&
|
|
59
|
+
obligation.proof_ref !== null))
|
|
60
|
+
invalid("feasibility_blocker_confirmation_exact_fact_required", `${blocker.key}:${confirmationRef}`);
|
|
56
61
|
}
|
|
62
|
+
if (!contract.global.acceptance.external_confirmations.some((confirmation) => confirmation.blocks_target &&
|
|
63
|
+
confirmation.impact_claims.some((claimRef) => impactedTargetClaims.has(claimRef)) &&
|
|
64
|
+
confirmation.obligations?.some((obligation) => exactTargetDesignObligations.some((descriptor) => externalDesignObligationMatches(obligation, descriptor)))))
|
|
65
|
+
invalid("feasibility_blocker_confirmation_target_claim_missing", `${blocker.key}:${contractTarget.target.key}`);
|
|
57
66
|
}
|
|
58
67
|
}
|
|
59
68
|
function requireDecisionSource(sourceRefs, decisions, expectation, label, allowedItemKinds, allReferencesMustBeSourceItems) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { DeliveryCheckV2, DeliveryContractV2, DeliveryDesignFactExpectationV2, EvidenceCapabilityV2, ExternalConfirmationV2, ProofSurface } from "./long-task-delivery-types.js";
|
|
2
|
+
type DesignObligationContract = {
|
|
3
|
+
outcomes: ReadonlyArray<{
|
|
4
|
+
key: string;
|
|
5
|
+
product: Pick<DeliveryContractV2["outcomes"][number]["product"], "surface_bindings">;
|
|
6
|
+
acceptance: {
|
|
7
|
+
checks: ReadonlyArray<Pick<DeliveryCheckV2, "key" | "proof_surface" | "positive_assertions" | "negative_assertions">>;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export interface DesignFactObligationDescriptorV1 {
|
|
12
|
+
source_obligation_ref: string;
|
|
13
|
+
outcome_key: string;
|
|
14
|
+
check_key: string;
|
|
15
|
+
target_key: string;
|
|
16
|
+
assertion_ref: string;
|
|
17
|
+
local_claim_ref: string;
|
|
18
|
+
claim_ref: string;
|
|
19
|
+
applicability_ref: string;
|
|
20
|
+
fact_ref: string;
|
|
21
|
+
method: string;
|
|
22
|
+
proof_surface: ProofSurface;
|
|
23
|
+
evidence_capabilities: EvidenceCapabilityV2[];
|
|
24
|
+
expected_authority_ref: string;
|
|
25
|
+
expected: DeliveryDesignFactExpectationV2["expected"];
|
|
26
|
+
comparison: DeliveryDesignFactExpectationV2["comparison"];
|
|
27
|
+
observation_sensitivity: "plain" | "protected";
|
|
28
|
+
}
|
|
29
|
+
export declare function designGroundObligationRef(targetKey: string, method: string, conditionKey: string, factRef: string): string;
|
|
30
|
+
export declare function designFactObligationDescriptors(contract: DesignObligationContract): DesignFactObligationDescriptorV1[];
|
|
31
|
+
export declare function exactExternalDesignObligationRefs(contract: DesignObligationContract & {
|
|
32
|
+
global: {
|
|
33
|
+
acceptance: {
|
|
34
|
+
external_confirmations: readonly ExternalConfirmationV2[];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}, outcomeKey: string, checkKey: string): Set<string>;
|
|
38
|
+
export declare function externalDesignObligationMatches(obligation: NonNullable<ExternalConfirmationV2["obligations"]>[number], descriptor: DesignFactObligationDescriptorV1): boolean;
|
|
39
|
+
export declare function findDesignFactObligation(contract: DesignObligationContract, identity: {
|
|
40
|
+
outcome_key: string | null;
|
|
41
|
+
claim_ref: string;
|
|
42
|
+
applicability_ref: string;
|
|
43
|
+
fact_ref: string | null;
|
|
44
|
+
proof_ref: string | null;
|
|
45
|
+
method: string;
|
|
46
|
+
proof_surface: ProofSurface;
|
|
47
|
+
required_evidence_capabilities?: readonly EvidenceCapabilityV2[];
|
|
48
|
+
evidence_capabilities?: readonly EvidenceCapabilityV2[];
|
|
49
|
+
}): DesignFactObligationDescriptorV1 | null;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export function designGroundObligationRef(targetKey, method, conditionKey, factRef) {
|
|
2
|
+
return `design.${targetKey}.${method}.${conditionKey}.${factRef}`;
|
|
3
|
+
}
|
|
4
|
+
export function designFactObligationDescriptors(contract) {
|
|
5
|
+
const result = [];
|
|
6
|
+
for (const outcome of contract.outcomes)
|
|
7
|
+
for (const surface of outcome.product.surface_bindings ?? [])
|
|
8
|
+
for (const target of surface.design_targets) {
|
|
9
|
+
const check = outcome.acceptance.checks.find((candidate) => candidate.key === target.conformance_check_ref);
|
|
10
|
+
if (!check)
|
|
11
|
+
continue;
|
|
12
|
+
for (const binding of target.verification_method_bindings)
|
|
13
|
+
for (const artifact of binding.evidence_artifacts)
|
|
14
|
+
for (const expectation of artifact.fact_expectations) {
|
|
15
|
+
const descriptor = descriptorForExpectation(outcome.key, check, target.key, binding.assertion_ref, designGroundObligationRef(target.key, binding.method, artifact.condition_key, expectation.fact_ref), expectation.fact_ref, binding.method, expectation);
|
|
16
|
+
if (descriptor)
|
|
17
|
+
result.push(descriptor);
|
|
18
|
+
}
|
|
19
|
+
for (const binding of target.symbolic_method_bindings ?? [])
|
|
20
|
+
for (const expectation of binding.rule_expectations) {
|
|
21
|
+
const descriptor = descriptorForExpectation(outcome.key, check, target.key, binding.assertion_ref, expectation.obligation_ref, expectation.fact_rule_ref, binding.method, expectation);
|
|
22
|
+
if (descriptor)
|
|
23
|
+
result.push(descriptor);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
export function exactExternalDesignObligationRefs(contract, outcomeKey, checkKey) {
|
|
29
|
+
const confirmations = contract.global.acceptance.external_confirmations;
|
|
30
|
+
return new Set(designFactObligationDescriptors(contract)
|
|
31
|
+
.filter((descriptor) => descriptor.outcome_key === outcomeKey &&
|
|
32
|
+
descriptor.check_key === checkKey &&
|
|
33
|
+
confirmations.some((confirmation) => confirmation.blocks_target &&
|
|
34
|
+
confirmation.obligations?.some((obligation) => externalDesignObligationMatches(obligation, descriptor))))
|
|
35
|
+
.map((descriptor) => descriptor.source_obligation_ref));
|
|
36
|
+
}
|
|
37
|
+
export function externalDesignObligationMatches(obligation, descriptor) {
|
|
38
|
+
return (obligation.claim_ref === descriptor.claim_ref &&
|
|
39
|
+
obligation.applicability_ref === descriptor.applicability_ref &&
|
|
40
|
+
obligation.fact_ref === descriptor.fact_ref &&
|
|
41
|
+
obligation.proof_ref === descriptor.source_obligation_ref &&
|
|
42
|
+
obligation.method === descriptor.method &&
|
|
43
|
+
obligation.proof_surface === descriptor.proof_surface &&
|
|
44
|
+
sameSet(obligation.evidence_capabilities, descriptor.evidence_capabilities) &&
|
|
45
|
+
obligation.expected_authority_ref === descriptor.expected_authority_ref &&
|
|
46
|
+
obligation.result_kind === "actual" &&
|
|
47
|
+
obligation.judgment_basis === undefined);
|
|
48
|
+
}
|
|
49
|
+
export function findDesignFactObligation(contract, identity) {
|
|
50
|
+
if (!identity.outcome_key || !identity.fact_ref || !identity.proof_ref)
|
|
51
|
+
return null;
|
|
52
|
+
const capabilities = identity.evidence_capabilities ??
|
|
53
|
+
identity.required_evidence_capabilities ??
|
|
54
|
+
[];
|
|
55
|
+
const candidates = designFactObligationDescriptors(contract).filter((descriptor) => descriptor.source_obligation_ref === identity.proof_ref &&
|
|
56
|
+
descriptor.outcome_key === identity.outcome_key &&
|
|
57
|
+
descriptor.claim_ref === identity.claim_ref &&
|
|
58
|
+
descriptor.applicability_ref === identity.applicability_ref &&
|
|
59
|
+
descriptor.fact_ref === identity.fact_ref &&
|
|
60
|
+
descriptor.method === identity.method &&
|
|
61
|
+
descriptor.proof_surface === identity.proof_surface &&
|
|
62
|
+
sameSet(descriptor.evidence_capabilities, capabilities));
|
|
63
|
+
return candidates.length === 1 ? candidates[0] : null;
|
|
64
|
+
}
|
|
65
|
+
function descriptorForExpectation(outcomeKey, check, targetKey, assertionRef, sourceObligationRef, factRef, method, expectation) {
|
|
66
|
+
const assertion = findAssertion(check, assertionRef);
|
|
67
|
+
if (!assertion ||
|
|
68
|
+
assertion.claims.length !== 1 ||
|
|
69
|
+
!assertion.applicability_ref)
|
|
70
|
+
return null;
|
|
71
|
+
const localClaimRef = assertion.claims[0];
|
|
72
|
+
return {
|
|
73
|
+
source_obligation_ref: sourceObligationRef,
|
|
74
|
+
outcome_key: outcomeKey,
|
|
75
|
+
check_key: check.key,
|
|
76
|
+
target_key: targetKey,
|
|
77
|
+
assertion_ref: assertionRef,
|
|
78
|
+
local_claim_ref: localClaimRef,
|
|
79
|
+
claim_ref: `${outcomeKey}.${localClaimRef}`,
|
|
80
|
+
applicability_ref: assertion.applicability_ref,
|
|
81
|
+
fact_ref: factRef,
|
|
82
|
+
method,
|
|
83
|
+
proof_surface: check.proof_surface,
|
|
84
|
+
evidence_capabilities: [...assertion.evidence_capabilities].sort(),
|
|
85
|
+
expected_authority_ref: `design-proof:${sourceObligationRef}`,
|
|
86
|
+
expected: expectation.expected,
|
|
87
|
+
comparison: expectation.comparison,
|
|
88
|
+
observation_sensitivity: expectation.observation_sensitivity,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function findAssertion(check, assertionRef) {
|
|
92
|
+
return ([...check.positive_assertions, ...check.negative_assertions].find((assertion) => assertion.key === assertionRef) ?? null);
|
|
93
|
+
}
|
|
94
|
+
function sameSet(left, right) {
|
|
95
|
+
return (left.length === right.length &&
|
|
96
|
+
new Set(left).size === left.length &&
|
|
97
|
+
new Set(right).size === right.length &&
|
|
98
|
+
left.every((value) => right.includes(value)));
|
|
99
|
+
}
|
|
@@ -14,5 +14,7 @@ export interface LongTaskDesignHandoffConsumer {
|
|
|
14
14
|
consume(preflight: DesignResourceHandoffPreflightV1 | DesignResourceHandoffPreflightV2): void;
|
|
15
15
|
finish(): void;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type LongTaskDesignHandoffPreflight = DesignResourceHandoffPreflightV1 | DesignResourceHandoffPreflightV2;
|
|
18
|
+
export declare function validateLongTaskDesignResourceHandoffs(contract: DeliveryContractV2, repository: string, sourceItems: CompiledSourceItemV2[]): Promise<LongTaskDesignHandoffPreflight[]>;
|
|
19
|
+
export declare function validateProjectDesignAuthoritySet(preflights: LongTaskDesignHandoffPreflight[]): void;
|
|
18
20
|
export declare function createLongTaskDesignHandoffConsumer(contract: DeliveryContractV2, sourceItems?: CompiledSourceItemV2[]): LongTaskDesignHandoffConsumer;
|
|
@@ -9,6 +9,7 @@ import { assertProtectedRepositoryFile } from "./long-task-protected-files.js";
|
|
|
9
9
|
import { validateLongTaskDesignFeasibilityBindings } from "./long-task-design-feasibility-binding.js";
|
|
10
10
|
export async function validateLongTaskDesignResourceHandoffs(contract, repository, sourceItems) {
|
|
11
11
|
const consumer = createLongTaskDesignHandoffConsumer(contract, sourceItems);
|
|
12
|
+
const preflights = [];
|
|
12
13
|
for (const sourcePath of contract.task.source_paths) {
|
|
13
14
|
if (!sourcePath.toLowerCase().endsWith(".md"))
|
|
14
15
|
continue;
|
|
@@ -16,9 +17,26 @@ export async function validateLongTaskDesignResourceHandoffs(contract, repositor
|
|
|
16
17
|
const content = await readFile(file, "utf8");
|
|
17
18
|
if (!containsDesignResourceHandoff(content))
|
|
18
19
|
continue;
|
|
19
|
-
|
|
20
|
+
const preflight = await preflightParsedDesignResourceHandoffAny(repository, parseDesignResourceHandoffMarkdown(sourcePath, content));
|
|
21
|
+
preflights.push(preflight);
|
|
22
|
+
consumer.consume(preflight);
|
|
20
23
|
}
|
|
24
|
+
validateProjectDesignAuthoritySet(preflights);
|
|
21
25
|
consumer.finish();
|
|
26
|
+
return preflights;
|
|
27
|
+
}
|
|
28
|
+
export function validateProjectDesignAuthoritySet(preflights) {
|
|
29
|
+
let expected = null;
|
|
30
|
+
for (const preflight of preflights) {
|
|
31
|
+
const identity = preflight.project_design_authority_resolution.identity;
|
|
32
|
+
if (!identity)
|
|
33
|
+
continue;
|
|
34
|
+
const canonical = JSON.stringify(identity);
|
|
35
|
+
if (expected === null)
|
|
36
|
+
expected = canonical;
|
|
37
|
+
else if (expected !== canonical)
|
|
38
|
+
invalid("project_design_authority_identity_conflict", `${JSON.parse(expected).closure_digest}:${identity.closure_digest}`);
|
|
39
|
+
}
|
|
22
40
|
}
|
|
23
41
|
export function createLongTaskDesignHandoffConsumer(contract, sourceItems = []) {
|
|
24
42
|
const contractTargets = contract.outcomes.flatMap((outcome) => outcome.product.surface_bindings.flatMap((binding) => binding.design_targets.map((target) => ({
|
|
@@ -30,7 +48,7 @@ export function createLongTaskDesignHandoffConsumer(contract, sourceItems = [])
|
|
|
30
48
|
const indexedTargetKeys = new Set();
|
|
31
49
|
const consumed = new Set();
|
|
32
50
|
const validationErrors = new Map();
|
|
33
|
-
const
|
|
51
|
+
const feasibilityBindingAttributionBySurface = new Map();
|
|
34
52
|
let duplicate = null;
|
|
35
53
|
const unbound = [];
|
|
36
54
|
const handoffSetIntegrity = createDesignResourceHandoffSetIntegrity(invalid);
|
|
@@ -86,7 +104,7 @@ export function createLongTaskDesignHandoffConsumer(contract, sourceItems = [])
|
|
|
86
104
|
};
|
|
87
105
|
validateSymbolicTargetIdentity(contractTarget, indexedTarget);
|
|
88
106
|
const feasibility = validateLongTaskDesignFeasibilityBindings(contract, contractTarget, preflight, sourceItems, { deferComponentBindingAttribution: true });
|
|
89
|
-
recordFeasibilityBindingAttribution(
|
|
107
|
+
recordFeasibilityBindingAttribution(feasibilityBindingAttributionBySurface, contractTarget, feasibility);
|
|
90
108
|
validateSymbolicCoverageClaims(contract, contractTarget, indexedTarget);
|
|
91
109
|
validateBlockerBindings(contract, contractTarget, indexedTarget);
|
|
92
110
|
}
|
|
@@ -97,7 +115,7 @@ export function createLongTaskDesignHandoffConsumer(contract, sourceItems = [])
|
|
|
97
115
|
};
|
|
98
116
|
validateTargetIdentity(contractTarget, indexedTarget);
|
|
99
117
|
const feasibility = validateLongTaskDesignFeasibilityBindings(contract, contractTarget, preflight, sourceItems, { deferComponentBindingAttribution: true });
|
|
100
|
-
recordFeasibilityBindingAttribution(
|
|
118
|
+
recordFeasibilityBindingAttribution(feasibilityBindingAttributionBySurface, contractTarget, feasibility);
|
|
101
119
|
validateLongTaskDesignTargetCapabilities(contract, contractTarget, indexedTarget);
|
|
102
120
|
validateCoverageClaims(contract, contractTarget, indexedTarget);
|
|
103
121
|
validateBlockerBindings(contract, contractTarget, indexedTarget);
|
|
@@ -120,27 +138,33 @@ export function createLongTaskDesignHandoffConsumer(contract, sourceItems = [])
|
|
|
120
138
|
if (validationErrors.has(contractTarget.target.key))
|
|
121
139
|
throw validationErrors.get(contractTarget.target.key);
|
|
122
140
|
}
|
|
123
|
-
validateSurfaceFeasibilityBindingAttribution(contractTargets,
|
|
141
|
+
validateSurfaceFeasibilityBindingAttribution(contractTargets, feasibilityBindingAttributionBySurface);
|
|
124
142
|
if (unbound.length)
|
|
125
143
|
invalid("handoff_target_unbound", unbound[0]);
|
|
126
144
|
},
|
|
127
145
|
};
|
|
128
146
|
}
|
|
129
|
-
function recordFeasibilityBindingAttribution(bySurface, contractTarget,
|
|
147
|
+
function recordFeasibilityBindingAttribution(bySurface, contractTarget, result) {
|
|
130
148
|
const key = surfaceBindingIdentity(contractTarget);
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
149
|
+
const attribution = bySurface.get(key) ?? {
|
|
150
|
+
modes: new Set(),
|
|
151
|
+
consumed_component_binding_refs: new Set(),
|
|
152
|
+
};
|
|
153
|
+
attribution.modes.add(result.attribution_mode);
|
|
154
|
+
for (const bindingRef of result.consumed_component_binding_refs)
|
|
155
|
+
attribution.consumed_component_binding_refs.add(bindingRef);
|
|
156
|
+
bySurface.set(key, attribution);
|
|
135
157
|
}
|
|
136
158
|
function validateSurfaceFeasibilityBindingAttribution(contractTargets, bySurface) {
|
|
137
159
|
const surfaces = new Map();
|
|
138
160
|
for (const contractTarget of contractTargets)
|
|
139
161
|
surfaces.set(surfaceBindingIdentity(contractTarget), contractTarget);
|
|
140
162
|
for (const [surfaceKey, contractTarget] of surfaces) {
|
|
141
|
-
const
|
|
163
|
+
const attribution = bySurface.get(surfaceKey);
|
|
164
|
+
if (!attribution?.modes.has("feasibility"))
|
|
165
|
+
continue;
|
|
142
166
|
for (const bindingRef of contractTarget.binding.component_binding_refs)
|
|
143
|
-
if (!
|
|
167
|
+
if (!attribution.consumed_component_binding_refs.has(bindingRef))
|
|
144
168
|
invalid("feasibility_component_binding_unattributed", `${contractTarget.binding.key}:${bindingRef}`);
|
|
145
169
|
}
|
|
146
170
|
}
|
|
@@ -62,6 +62,8 @@ export function validateSymbolicVerificationMethodBindings(contract, contractTar
|
|
|
62
62
|
const expected = preflight.manifest.semantic_proof_obligations
|
|
63
63
|
.filter((obligation) => obligation.method === binding.method)
|
|
64
64
|
.map((obligation) => symbolicRuleExpectation(preflight, obligation.key));
|
|
65
|
+
const sourceItems = new Set(expected.flatMap((expectation) => preflight.manifest.fact_rules.find((item) => item.key === expectation.fact_rule_ref)?.source_item_refs ?? []));
|
|
66
|
+
validateMethodAssertionClaimOwnership(target, assertion.claims, sourceItems, claimsBySourceItem, "v2_verification_method_claim_not_owned", `${target.key}:${binding.method}`);
|
|
65
67
|
assertCanonicalRowsByKey(binding.rule_expectations, expected, "obligation_ref", "v2_rule_expectations_mismatch", `${target.key}:${binding.method}`);
|
|
66
68
|
for (const expectation of expected) {
|
|
67
69
|
const rule = preflight.manifest.fact_rules.find((item) => item.key === expectation.fact_rule_ref);
|
|
@@ -156,6 +158,7 @@ export function validateVerificationMethodBindings(target, check, facts, proofs,
|
|
|
156
158
|
const sourceItems = new Set(facts
|
|
157
159
|
.filter((fact) => proofs.some((proof) => proof.fact_ref === fact.key && proof.method === binding.method))
|
|
158
160
|
.flatMap((fact) => fact.source_item_refs));
|
|
161
|
+
validateMethodAssertionClaimOwnership(target, assertion.claims, sourceItems, claimsBySourceItem, "verification_method_claim_not_owned", `${target.key}:${binding.method}`);
|
|
159
162
|
for (const sourceItemRef of sourceItems)
|
|
160
163
|
for (const claimRef of claimsBySourceItem.get(sourceItemRef) ?? [])
|
|
161
164
|
if (!assertedClaims.has(claimRef))
|
|
@@ -185,6 +188,15 @@ function claimsAssertedByRootOrMethod(target, check, methodClaims) {
|
|
|
185
188
|
const rootAssertion = check.positive_assertions.find((item) => item.key === target.conformance_assertion_ref);
|
|
186
189
|
return new Set([...(rootAssertion?.claims ?? []), ...methodClaims]);
|
|
187
190
|
}
|
|
191
|
+
function validateMethodAssertionClaimOwnership(target, methodClaims, sourceItems, claimsBySourceItem, code, detail) {
|
|
192
|
+
const allowedClaims = new Set(target.claim_refs);
|
|
193
|
+
for (const sourceItemRef of sourceItems)
|
|
194
|
+
for (const claimRef of claimsBySourceItem.get(sourceItemRef) ?? [])
|
|
195
|
+
allowedClaims.add(claimRef);
|
|
196
|
+
for (const claimRef of methodClaims)
|
|
197
|
+
if (!allowedClaims.has(claimRef))
|
|
198
|
+
invalid(code, `${detail}:${claimRef}`);
|
|
199
|
+
}
|
|
188
200
|
function designFactExpectation(indexed, factRef, proofRef) {
|
|
189
201
|
const handoff = indexed.preflight.handoff;
|
|
190
202
|
const fact = handoff.facts.find((item) => item.key === factRef);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ClaimApplicabilityV2, CompiledOutcomeV2, DeliveryContractV2, DeliveryOutcomeV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import type { AcceptanceReachabilityV1 } from "./long-task-acceptance-reachability-types.js";
|
|
3
|
+
export declare function effectiveBlockingExternalRows(reachability: AcceptanceReachabilityV1 | null | undefined): AcceptanceReachabilityV1["effective_external_routes"];
|
|
4
|
+
export declare function outcomePopulationSemanticProofFullyEffectivelyExternallyBlocked(outcome: DeliveryOutcomeV2, reachability: AcceptanceReachabilityV1 | null | undefined): boolean;
|
|
5
|
+
export declare function resultApplicabilityEffectivelyExternallyBlocked(reachability: AcceptanceReachabilityV1 | null | undefined, outcomeKey: string, applicabilityRef: string, targetRef: string): boolean;
|
|
6
|
+
export declare function resultApplicabilityProfiles(outcome: Pick<CompiledOutcomeV2, "applicability" | "product">, options?: {
|
|
7
|
+
target_ref?: string;
|
|
8
|
+
journey_role?: ClaimApplicabilityV2["journey_role"];
|
|
9
|
+
}): ClaimApplicabilityV2[];
|
|
10
|
+
export declare function outcomeResultScopeFullyEffectivelyExternallyBlocked(outcome: Pick<CompiledOutcomeV2, "key" | "applicability" | "product">, reachability: AcceptanceReachabilityV1 | null | undefined, options?: {
|
|
11
|
+
target_ref?: string;
|
|
12
|
+
journey_role?: ClaimApplicabilityV2["journey_role"];
|
|
13
|
+
}): boolean;
|
|
14
|
+
export declare function outcomeResultFullyEffectivelyExternallyBlocked(outcome: Pick<CompiledOutcomeV2, "key" | "applicability" | "product">, reachability: AcceptanceReachabilityV1 | null | undefined): boolean;
|
|
15
|
+
export declare function allOutcomeResultsFullyEffectivelyExternallyBlocked(contract: Pick<DeliveryContractV2, "outcomes">, reachability: AcceptanceReachabilityV1 | null | undefined): boolean;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { claimObligationRef, sameSet, } from "./long-task-acceptance-reachability-helpers.js";
|
|
2
|
+
export function effectiveBlockingExternalRows(reachability) {
|
|
3
|
+
return (reachability?.effective_external_routes ?? []).filter((row) => row.authority === "external_confirmation" &&
|
|
4
|
+
row.status === "external_fulfillable" &&
|
|
5
|
+
row.completion_role === "blocking" &&
|
|
6
|
+
row.acceptance_effect === "required");
|
|
7
|
+
}
|
|
8
|
+
function effectivePopulationRows(outcomeKey, reachability) {
|
|
9
|
+
return effectiveBlockingExternalRows(reachability).filter((row) => row.outcome_key === outcomeKey &&
|
|
10
|
+
row.proof_surface === "population_coverage" &&
|
|
11
|
+
row.method === "population_set_equality" &&
|
|
12
|
+
row.fact_ref !== null &&
|
|
13
|
+
row.proof_ref !== null &&
|
|
14
|
+
row.source_obligation_ref === row.proof_ref &&
|
|
15
|
+
row.required_evidence_capabilities.includes("semantic_fact") &&
|
|
16
|
+
row.required_evidence_capabilities.includes("population_coverage"));
|
|
17
|
+
}
|
|
18
|
+
function requiredExternalPopulationProofs(outcome, localClaimRef) {
|
|
19
|
+
return outcome.semantic_fact_bindings.facts
|
|
20
|
+
.filter((binding) => binding.claim_ref === localClaimRef)
|
|
21
|
+
.flatMap((factBinding) => outcome.semantic_fact_bindings.proofs
|
|
22
|
+
.filter((proofBinding) => proofBinding.fact_ref === factBinding.fact_ref &&
|
|
23
|
+
proofBinding.authority === "external_confirmation" &&
|
|
24
|
+
proofBinding.method === "population_set_equality" &&
|
|
25
|
+
proofBinding.proof_surface === "population_coverage")
|
|
26
|
+
.map((proofBinding) => ({
|
|
27
|
+
factBinding,
|
|
28
|
+
proofBinding,
|
|
29
|
+
confirmationRef: proofBinding.authority === "external_confirmation"
|
|
30
|
+
? proofBinding.confirmation_ref
|
|
31
|
+
: null,
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
34
|
+
function populationProofRequirementEffectivelyBlocked(outcome, requirement, rows) {
|
|
35
|
+
const { factBinding, proofBinding, confirmationRef } = requirement;
|
|
36
|
+
const profile = outcome.applicability.find((candidate) => candidate.key === factBinding.applicability_ref);
|
|
37
|
+
if (!profile)
|
|
38
|
+
return false;
|
|
39
|
+
return (rows.filter((row) => row.claim_ref === `${outcome.key}.${factBinding.claim_ref}` &&
|
|
40
|
+
row.local_claim_ref === factBinding.claim_ref &&
|
|
41
|
+
row.applicability_ref === factBinding.applicability_ref &&
|
|
42
|
+
row.target_ref === profile.target_ref &&
|
|
43
|
+
row.fact_ref === factBinding.fact_ref &&
|
|
44
|
+
row.proof_ref === proofBinding.proof_ref &&
|
|
45
|
+
row.source_obligation_ref === proofBinding.proof_ref &&
|
|
46
|
+
row.method === proofBinding.method &&
|
|
47
|
+
row.proof_surface === proofBinding.proof_surface &&
|
|
48
|
+
row.confirmation_ref === confirmationRef &&
|
|
49
|
+
sameSet(row.required_evidence_capabilities, proofBinding.evidence_capabilities)).length === 1);
|
|
50
|
+
}
|
|
51
|
+
function populationClaimFullyEffectivelyExternallyBlocked(outcome, localClaimRef, rows) {
|
|
52
|
+
const requirements = requiredExternalPopulationProofs(outcome, localClaimRef);
|
|
53
|
+
return (requirements.length > 0 &&
|
|
54
|
+
requirements.every((requirement) => populationProofRequirementEffectivelyBlocked(outcome, requirement, rows)));
|
|
55
|
+
}
|
|
56
|
+
export function outcomePopulationSemanticProofFullyEffectivelyExternallyBlocked(outcome, reachability) {
|
|
57
|
+
const population = outcome.acceptance.population;
|
|
58
|
+
if (!population?.claims.length)
|
|
59
|
+
return false;
|
|
60
|
+
const rows = effectivePopulationRows(outcome.key, reachability);
|
|
61
|
+
return population.claims.every((localClaimRef) => populationClaimFullyEffectivelyExternallyBlocked(outcome, localClaimRef, rows));
|
|
62
|
+
}
|
|
63
|
+
function effectiveBlockingResultRows(reachability, outcomeKey) {
|
|
64
|
+
const claimRef = `${outcomeKey}.result`;
|
|
65
|
+
return effectiveBlockingExternalRows(reachability).filter((row) => {
|
|
66
|
+
const ordinaryObligationRef = claimObligationRef(claimRef, row.applicability_ref, row.proof_surface);
|
|
67
|
+
return (row.outcome_key === outcomeKey &&
|
|
68
|
+
row.claim_ref === claimRef &&
|
|
69
|
+
row.local_claim_ref === "result" &&
|
|
70
|
+
row.fact_ref === null &&
|
|
71
|
+
row.proof_ref === null &&
|
|
72
|
+
row.source_obligation_ref === ordinaryObligationRef);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export function resultApplicabilityEffectivelyExternallyBlocked(reachability, outcomeKey, applicabilityRef, targetRef) {
|
|
76
|
+
const rows = effectiveBlockingResultRows(reachability, outcomeKey).filter((row) => row.applicability_ref === applicabilityRef &&
|
|
77
|
+
row.target_ref === targetRef);
|
|
78
|
+
return rows.length === 1;
|
|
79
|
+
}
|
|
80
|
+
export function resultApplicabilityProfiles(outcome, options = {}) {
|
|
81
|
+
const profiles = new Map(outcome.applicability.map((profile) => [profile.key, profile]));
|
|
82
|
+
return outcome.product.result_applicability_refs
|
|
83
|
+
.map((ref) => profiles.get(ref))
|
|
84
|
+
.filter((profile) => Boolean(profile))
|
|
85
|
+
.filter((profile) => (options.target_ref === undefined ||
|
|
86
|
+
profile.target_ref === options.target_ref) &&
|
|
87
|
+
(options.journey_role === undefined ||
|
|
88
|
+
profile.journey_role === options.journey_role));
|
|
89
|
+
}
|
|
90
|
+
export function outcomeResultScopeFullyEffectivelyExternallyBlocked(outcome, reachability, options = {}) {
|
|
91
|
+
const profiles = resultApplicabilityProfiles(outcome, options);
|
|
92
|
+
if (!profiles.length)
|
|
93
|
+
return false;
|
|
94
|
+
const requiredRefs = new Set(profiles.map((profile) => profile.key));
|
|
95
|
+
const rows = effectiveBlockingResultRows(reachability, outcome.key).filter((row) => requiredRefs.has(row.applicability_ref));
|
|
96
|
+
return (rows.length === profiles.length &&
|
|
97
|
+
profiles.every((profile) => rows.filter((row) => row.applicability_ref === profile.key &&
|
|
98
|
+
row.target_ref === profile.target_ref).length === 1));
|
|
99
|
+
}
|
|
100
|
+
export function outcomeResultFullyEffectivelyExternallyBlocked(outcome, reachability) {
|
|
101
|
+
if (resultApplicabilityProfiles(outcome).length !==
|
|
102
|
+
outcome.product.result_applicability_refs.length)
|
|
103
|
+
return false;
|
|
104
|
+
return outcomeResultScopeFullyEffectivelyExternallyBlocked(outcome, reachability);
|
|
105
|
+
}
|
|
106
|
+
export function allOutcomeResultsFullyEffectivelyExternallyBlocked(contract, reachability) {
|
|
107
|
+
return (contract.outcomes.length > 0 &&
|
|
108
|
+
contract.outcomes.every((outcome) => outcomeResultFullyEffectivelyExternallyBlocked(outcome, reachability)));
|
|
109
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DeliveryContractV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import type { AcceptanceReachabilityV1 } from "./long-task-acceptance-reachability-types.js";
|
|
3
|
+
type DeliveryOutcomeV2 = DeliveryContractV2["outcomes"][number];
|
|
4
|
+
export declare function outcomeUiProofFullyEffectivelyExternallyBlocked(contract: DeliveryContractV2, outcome: DeliveryOutcomeV2, reachability: AcceptanceReachabilityV1 | null | undefined): boolean;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { controlFieldFacts } from "./long-task-control-fields.js";
|
|
2
|
+
import { designFactObligationDescriptors } from "./long-task-design-obligation.js";
|
|
3
|
+
import { effectiveBlockingExternalRows } from "./long-task-effective-external-takeover.js";
|
|
4
|
+
function designObligationEffectivelyBlocked(descriptor, rows) {
|
|
5
|
+
return (rows.filter((row) => row.source_obligation_ref === descriptor.source_obligation_ref &&
|
|
6
|
+
row.claim_ref === descriptor.claim_ref &&
|
|
7
|
+
row.local_claim_ref === descriptor.local_claim_ref &&
|
|
8
|
+
row.applicability_ref === descriptor.applicability_ref &&
|
|
9
|
+
row.proof_surface === descriptor.proof_surface &&
|
|
10
|
+
row.fact_ref === descriptor.fact_ref &&
|
|
11
|
+
row.proof_ref === descriptor.source_obligation_ref).length === 1);
|
|
12
|
+
}
|
|
13
|
+
function claimApplicabilityKey(localClaimRef, applicabilityRef) {
|
|
14
|
+
return `${localClaimRef}\0${applicabilityRef}`;
|
|
15
|
+
}
|
|
16
|
+
function controlClaimApplicabilities(outcome) {
|
|
17
|
+
const entries = new Set();
|
|
18
|
+
for (const control of outcome.product.controls)
|
|
19
|
+
for (const fact of controlFieldFacts(control))
|
|
20
|
+
for (const applicabilityRef of fact.applicability_refs)
|
|
21
|
+
entries.add(claimApplicabilityKey(`control.${control.key}.${fact.claim_field}`, applicabilityRef));
|
|
22
|
+
return entries;
|
|
23
|
+
}
|
|
24
|
+
function designTargetAssertionRefs(target) {
|
|
25
|
+
return new Set([
|
|
26
|
+
target.conformance_assertion_ref,
|
|
27
|
+
...target.verification_method_bindings.map((binding) => binding.assertion_ref),
|
|
28
|
+
...(target.symbolic_method_bindings ?? []).map((binding) => binding.assertion_ref),
|
|
29
|
+
...(target.symbolic_certificate_binding
|
|
30
|
+
? [target.symbolic_certificate_binding.assertion_ref]
|
|
31
|
+
: []),
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
function addDesignAssertionClaimApplicabilities(entries, check, assertionRefs) {
|
|
35
|
+
for (const assertion of [
|
|
36
|
+
...check.positive_assertions,
|
|
37
|
+
...check.negative_assertions,
|
|
38
|
+
])
|
|
39
|
+
if (assertionRefs.has(assertion.key) &&
|
|
40
|
+
assertion.claims.length === 1 &&
|
|
41
|
+
assertion.applicability_ref)
|
|
42
|
+
entries.add(claimApplicabilityKey(assertion.claims[0], assertion.applicability_ref));
|
|
43
|
+
}
|
|
44
|
+
function allUiClaimApplicabilities(outcome) {
|
|
45
|
+
const entries = controlClaimApplicabilities(outcome);
|
|
46
|
+
for (const surface of outcome.product.surface_bindings)
|
|
47
|
+
for (const target of surface.design_targets) {
|
|
48
|
+
const check = outcome.acceptance.checks.find((candidate) => candidate.key === target.conformance_check_ref);
|
|
49
|
+
if (!check)
|
|
50
|
+
return null;
|
|
51
|
+
addDesignAssertionClaimApplicabilities(entries, check, designTargetAssertionRefs(target));
|
|
52
|
+
}
|
|
53
|
+
return entries;
|
|
54
|
+
}
|
|
55
|
+
function matchingCoordinates(outcome, localClaimRef, applicabilityRef, targetRef) {
|
|
56
|
+
return outcome.acceptance.checks.flatMap((check) => [...check.positive_assertions, ...check.negative_assertions]
|
|
57
|
+
.filter((assertion) => assertionMatchesClaimApplicability(assertion, localClaimRef, applicabilityRef))
|
|
58
|
+
.map(() => ({
|
|
59
|
+
local_claim_ref: localClaimRef,
|
|
60
|
+
applicability_ref: applicabilityRef,
|
|
61
|
+
target_ref: targetRef,
|
|
62
|
+
proof_surface: check.proof_surface,
|
|
63
|
+
})));
|
|
64
|
+
}
|
|
65
|
+
function assertionMatchesClaimApplicability(assertion, localClaimRef, applicabilityRef) {
|
|
66
|
+
return (assertion.claims.length === 1 &&
|
|
67
|
+
assertion.claims[0] === localClaimRef &&
|
|
68
|
+
assertion.applicability_ref === applicabilityRef);
|
|
69
|
+
}
|
|
70
|
+
function coordinateKey(coordinate) {
|
|
71
|
+
return [
|
|
72
|
+
coordinate.local_claim_ref,
|
|
73
|
+
coordinate.applicability_ref,
|
|
74
|
+
coordinate.target_ref,
|
|
75
|
+
coordinate.proof_surface,
|
|
76
|
+
].join("\0");
|
|
77
|
+
}
|
|
78
|
+
function uiClaimCoordinates(outcome) {
|
|
79
|
+
const entries = allUiClaimApplicabilities(outcome);
|
|
80
|
+
if (!entries)
|
|
81
|
+
return null;
|
|
82
|
+
const profiles = new Map(outcome.applicability.map((profile) => [profile.key, profile]));
|
|
83
|
+
const coordinates = new Map();
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
const [localClaimRef, applicabilityRef] = entry.split("\0");
|
|
86
|
+
const profile = profiles.get(applicabilityRef);
|
|
87
|
+
if (!profile)
|
|
88
|
+
return null;
|
|
89
|
+
const matching = matchingCoordinates(outcome, localClaimRef, applicabilityRef, profile.target_ref);
|
|
90
|
+
if (!matching.length)
|
|
91
|
+
return null;
|
|
92
|
+
for (const coordinate of matching)
|
|
93
|
+
coordinates.set(coordinateKey(coordinate), coordinate);
|
|
94
|
+
}
|
|
95
|
+
return coordinates;
|
|
96
|
+
}
|
|
97
|
+
function ordinaryUiCoordinateEffectivelyBlocked(outcomeKey, coordinate, rows) {
|
|
98
|
+
return (rows.filter((row) => row.claim_ref === `${outcomeKey}.${coordinate.local_claim_ref}` &&
|
|
99
|
+
row.local_claim_ref === coordinate.local_claim_ref &&
|
|
100
|
+
row.applicability_ref === coordinate.applicability_ref &&
|
|
101
|
+
row.target_ref === coordinate.target_ref &&
|
|
102
|
+
row.proof_surface === coordinate.proof_surface &&
|
|
103
|
+
row.fact_ref === null &&
|
|
104
|
+
row.proof_ref === null).length === 1);
|
|
105
|
+
}
|
|
106
|
+
export function outcomeUiProofFullyEffectivelyExternallyBlocked(contract, outcome, reachability) {
|
|
107
|
+
const rows = effectiveBlockingExternalRows(reachability).filter((row) => row.outcome_key === outcome.key);
|
|
108
|
+
const designObligations = designFactObligationDescriptors(contract).filter((descriptor) => descriptor.outcome_key === outcome.key);
|
|
109
|
+
if (!designObligations.every((descriptor) => designObligationEffectivelyBlocked(descriptor, rows)))
|
|
110
|
+
return false;
|
|
111
|
+
const coordinates = uiClaimCoordinates(outcome);
|
|
112
|
+
if (!coordinates)
|
|
113
|
+
return false;
|
|
114
|
+
if (!designObligations.length && !coordinates.size)
|
|
115
|
+
return false;
|
|
116
|
+
return [...coordinates.values()].every((coordinate) => ordinaryUiCoordinateEffectivelyBlocked(outcome.key, coordinate, rows));
|
|
117
|
+
}
|