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
|
@@ -3,7 +3,7 @@ export function validateSemanticFactProvenance(manifest, sourceItems) {
|
|
|
3
3
|
const sourceRefs = new Set(sourceItems.map((item) => item.key));
|
|
4
4
|
const inputByKey = new Map(manifest.inputs.map((item) => [item.key, item]));
|
|
5
5
|
const materialInputRefs = new Set(manifest.inputs
|
|
6
|
-
.filter((item) => item.disposition
|
|
6
|
+
.filter((item) => ["non_ui_material", "fact_bearing"].includes(item.disposition))
|
|
7
7
|
.map((item) => item.key));
|
|
8
8
|
const facts = new Map(manifest.facts.map((item) => [item.key, item]));
|
|
9
9
|
const isMaterialAuthority = (ref) => sourceRefs.has(ref) || materialInputRefs.has(ref);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { SemanticFactManifestRefV2, SemanticFactOutcomeBindingsV2 } from "./semantic-fact-types.js";
|
|
1
|
+
import type { SemanticFactGlobalBindingsV2, SemanticFactManifestRefV2, SemanticFactOutcomeBindingsV2 } from "./semantic-fact-types.js";
|
|
2
2
|
export declare function parseSemanticFactManifestRef(value: unknown, label: string): SemanticFactManifestRefV2;
|
|
3
3
|
export declare function parseSemanticFactOutcomeBindings(value: unknown, label: string): SemanticFactOutcomeBindingsV2;
|
|
4
|
+
export declare function parseSemanticFactGlobalBindings(value: unknown, label: string): SemanticFactGlobalBindingsV2;
|
|
@@ -13,7 +13,7 @@ export function parseSemanticFactOutcomeBindings(value, label) {
|
|
|
13
13
|
manifest_ref: semanticRef(row.manifest_ref, `${label}.manifest_ref`),
|
|
14
14
|
facts: array(row.facts, `${label}.facts`).map((item, index) => {
|
|
15
15
|
const itemLabel = `${label}.facts[${index}]`;
|
|
16
|
-
const entry = object(item, itemLabel, ["fact_ref", "claim_ref", "applicability_ref"], ["fact_revision_digest"]);
|
|
16
|
+
const entry = object(item, itemLabel, ["fact_ref", "claim_ref", "applicability_ref"], ["fact_revision_digest", "required_polarity"]);
|
|
17
17
|
return {
|
|
18
18
|
fact_ref: semanticRef(entry.fact_ref, `${itemLabel}.fact_ref`),
|
|
19
19
|
...(Object.hasOwn(entry, "fact_revision_digest")
|
|
@@ -23,6 +23,11 @@ export function parseSemanticFactOutcomeBindings(value, label) {
|
|
|
23
23
|
: {}),
|
|
24
24
|
claim_ref: semanticRef(entry.claim_ref, `${itemLabel}.claim_ref`),
|
|
25
25
|
applicability_ref: semanticRef(entry.applicability_ref, `${itemLabel}.applicability_ref`),
|
|
26
|
+
...(Object.hasOwn(entry, "required_polarity")
|
|
27
|
+
? {
|
|
28
|
+
required_polarity: literal(entry.required_polarity, ["positive", "negative"], `${itemLabel}.required_polarity`),
|
|
29
|
+
}
|
|
30
|
+
: {}),
|
|
26
31
|
};
|
|
27
32
|
}),
|
|
28
33
|
proofs: array(row.proofs, `${label}.proofs`).map((item, index) => {
|
|
@@ -76,6 +81,35 @@ export function parseSemanticFactOutcomeBindings(value, label) {
|
|
|
76
81
|
}),
|
|
77
82
|
};
|
|
78
83
|
}
|
|
84
|
+
export function parseSemanticFactGlobalBindings(value, label) {
|
|
85
|
+
const row = object(value, label, ["manifest_ref", "obligations"]);
|
|
86
|
+
return {
|
|
87
|
+
manifest_ref: semanticRef(row.manifest_ref, `${label}.manifest_ref`),
|
|
88
|
+
obligations: array(row.obligations, `${label}.obligations`).map((item, index) => {
|
|
89
|
+
const itemLabel = `${label}.obligations[${index}]`;
|
|
90
|
+
const entry = object(item, itemLabel, [
|
|
91
|
+
"claim_ref",
|
|
92
|
+
"applicability_ref",
|
|
93
|
+
"target_ref",
|
|
94
|
+
"outcome_ref",
|
|
95
|
+
"fact_ref",
|
|
96
|
+
"proof_ref",
|
|
97
|
+
"method",
|
|
98
|
+
"required_polarity",
|
|
99
|
+
]);
|
|
100
|
+
return {
|
|
101
|
+
claim_ref: semanticRef(entry.claim_ref, `${itemLabel}.claim_ref`),
|
|
102
|
+
applicability_ref: semanticRef(entry.applicability_ref, `${itemLabel}.applicability_ref`),
|
|
103
|
+
target_ref: semanticRef(entry.target_ref, `${itemLabel}.target_ref`),
|
|
104
|
+
outcome_ref: semanticRef(entry.outcome_ref, `${itemLabel}.outcome_ref`),
|
|
105
|
+
fact_ref: semanticRef(entry.fact_ref, `${itemLabel}.fact_ref`),
|
|
106
|
+
proof_ref: semanticRef(entry.proof_ref, `${itemLabel}.proof_ref`),
|
|
107
|
+
method: semanticRef(entry.method, `${itemLabel}.method`),
|
|
108
|
+
required_polarity: literal(entry.required_polarity, ["positive", "negative"], `${itemLabel}.required_polarity`),
|
|
109
|
+
};
|
|
110
|
+
}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
79
113
|
function semanticRef(value, label) {
|
|
80
114
|
const result = string(value, label);
|
|
81
115
|
if (!/^[a-z0-9][a-z0-9._:-]*$/u.test(result))
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { semanticFactProofCapabilityFloor, validateSemanticFactProofProfileClosure, } from "./long-task-semantic-proof-profile.js";
|
|
2
|
+
export function validateSemanticFactProofFloors(manifest) {
|
|
3
|
+
validateSemanticFactProofProfileClosure(manifest);
|
|
4
|
+
const facts = new Map(manifest.facts.map((fact) => [fact.key, fact]));
|
|
5
|
+
for (const proof of manifest.proof_obligations) {
|
|
6
|
+
const fact = facts.get(proof.fact_ref);
|
|
7
|
+
const required = semanticFactProofCapabilityFloor(manifest, fact, proof);
|
|
8
|
+
const missing = [...required].filter((capability) => !proof.evidence_capabilities.includes(capability));
|
|
9
|
+
if (missing.length)
|
|
10
|
+
fail("semantic_fact_proof_adequacy_capability_missing", `${proof.key}:${missing.sort().join(",")}`);
|
|
11
|
+
if (required.has("population_coverage") &&
|
|
12
|
+
proof.comparison.comparator !== "set_equality" &&
|
|
13
|
+
proof.method !== "population_set_equality")
|
|
14
|
+
fail("semantic_fact_population_set_equality_required", proof.key);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function fail(code, detail) {
|
|
18
|
+
throw new Error(`delivery_contract_invalid:${code}:${detail}`);
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EvidenceCapabilityV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import type { SemanticFactManifestV1 } from "./semantic-fact-types.js";
|
|
3
|
+
export declare function semanticFactCustomPropertyHasClosedStandardProfile(property: SemanticFactManifestV1["property_dispositions"][number]): boolean;
|
|
4
|
+
export declare function validateSemanticFactProofProfileClosure(manifest: SemanticFactManifestV1): void;
|
|
5
|
+
export declare function semanticFactProofCapabilityFloor(manifest: SemanticFactManifestV1, fact: SemanticFactManifestV1["facts"][number], proof: SemanticFactManifestV1["proof_obligations"][number]): Set<EvidenceCapabilityV2>;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { semanticFactClosureInvalid } from "./long-task-semantic-fact-closure-primitives.js";
|
|
2
|
+
import { isCustomSemanticFactName, SEMANTIC_FACT_PROOF_METHODS, SEMANTIC_FACT_STANDARD_PROPERTIES, } from "./semantic-fact-catalog.js";
|
|
3
|
+
import { canonicalValueJson, sha256Hex } from "./strict-codec.js";
|
|
4
|
+
const STANDARD_PROPERTY_CATALOG_SHA256 = "dd71ac2bb67144bd0e9df30c69a0231cc6ba71a72cd202a7e400cd59a3ab7d02";
|
|
5
|
+
const METHOD_CAPABILITY_FLOORS = {
|
|
6
|
+
exact_value: ["semantic_fact"],
|
|
7
|
+
schema_contract: ["semantic_fact"],
|
|
8
|
+
decision_table: ["semantic_fact"],
|
|
9
|
+
formula_evaluation: ["semantic_fact"],
|
|
10
|
+
invariant: ["semantic_fact"],
|
|
11
|
+
transition_trace: ["semantic_fact", "interaction_trace", "state_delta"],
|
|
12
|
+
sequence_trace: ["semantic_fact", "interaction_trace"],
|
|
13
|
+
durable_roundtrip: ["semantic_fact", "data_state", "durable_readback"],
|
|
14
|
+
boundary_invocation: [
|
|
15
|
+
"semantic_fact",
|
|
16
|
+
"boundary_invocation",
|
|
17
|
+
"actual_provenance",
|
|
18
|
+
],
|
|
19
|
+
external_side_effect: [
|
|
20
|
+
"semantic_fact",
|
|
21
|
+
"boundary_invocation",
|
|
22
|
+
"actual_provenance",
|
|
23
|
+
"external_side_effect",
|
|
24
|
+
"state_delta",
|
|
25
|
+
],
|
|
26
|
+
population_set_equality: ["semantic_fact", "population_coverage"],
|
|
27
|
+
concurrency_schedule: ["semantic_fact", "input_variation", "state_delta"],
|
|
28
|
+
idempotency_repetition: ["semantic_fact", "input_variation", "state_delta"],
|
|
29
|
+
fault_injection: ["semantic_fact", "failure_injection"],
|
|
30
|
+
recovery_drill: ["semantic_fact", "failure_injection", "recovery"],
|
|
31
|
+
migration: ["semantic_fact", "data_state", "durable_readback"],
|
|
32
|
+
compatibility: ["semantic_fact", "input_variation"],
|
|
33
|
+
performance: ["semantic_fact", "target_runtime"],
|
|
34
|
+
capacity: ["semantic_fact", "target_runtime"],
|
|
35
|
+
security: ["semantic_fact", "target_runtime", "data_state"],
|
|
36
|
+
privacy: ["semantic_fact", "data_state"],
|
|
37
|
+
audit: ["semantic_fact", "data_state", "durable_readback"],
|
|
38
|
+
observability: ["semantic_fact", "target_runtime"],
|
|
39
|
+
deployment: ["semantic_fact", "presence", "target_runtime"],
|
|
40
|
+
implementation_structure: ["semantic_fact", "presence"],
|
|
41
|
+
};
|
|
42
|
+
const PROPERTY_CLASS_CAPABILITIES = {
|
|
43
|
+
durable: ["data_state", "durable_readback"],
|
|
44
|
+
boundary: ["boundary_invocation", "actual_provenance"],
|
|
45
|
+
identity: ["distinct_identity", "data_state", "target_runtime"],
|
|
46
|
+
transition: ["interaction_trace", "state_delta"],
|
|
47
|
+
recovery: ["failure_injection", "recovery"],
|
|
48
|
+
population: ["population_coverage"],
|
|
49
|
+
visual: ["visual_render", "design_conformance"],
|
|
50
|
+
};
|
|
51
|
+
const PROPERTY_CLASSES = {
|
|
52
|
+
durable: new Set([
|
|
53
|
+
"persistence_cache_search.persistence",
|
|
54
|
+
"persistence_cache_search.archive",
|
|
55
|
+
"persistence_cache_search.retention",
|
|
56
|
+
"persistence_cache_search.deletion",
|
|
57
|
+
"transaction_consistency_concurrency_idempotency.durability",
|
|
58
|
+
"reliability_slo.durability",
|
|
59
|
+
"event_message_job.retention",
|
|
60
|
+
"backup_restore_disaster_recovery.backup_scope",
|
|
61
|
+
"commercial_billing.audit",
|
|
62
|
+
]),
|
|
63
|
+
boundary: new Set([
|
|
64
|
+
"api_protocol.operation_identity",
|
|
65
|
+
"api_protocol.request_body",
|
|
66
|
+
"api_protocol.callback_webhook",
|
|
67
|
+
"external_integration.provider_protocol_identity",
|
|
68
|
+
"external_integration.request_contract",
|
|
69
|
+
"external_integration.callback_contract",
|
|
70
|
+
"external_integration.side_effect_observation",
|
|
71
|
+
"commercial_billing.processor_confirmation",
|
|
72
|
+
]),
|
|
73
|
+
identity: new Set([
|
|
74
|
+
"actor_role_tenant_entitlement.identity",
|
|
75
|
+
"actor_role_tenant_entitlement.impersonation",
|
|
76
|
+
"actor_role_tenant_entitlement.isolation_boundary",
|
|
77
|
+
"data_model.identity",
|
|
78
|
+
"security.authentication",
|
|
79
|
+
"security.identity_proofing",
|
|
80
|
+
"security.authorization",
|
|
81
|
+
"security.tenant_isolation",
|
|
82
|
+
"api_protocol.authentication",
|
|
83
|
+
"api_protocol.authorization",
|
|
84
|
+
]),
|
|
85
|
+
transition: new Set([
|
|
86
|
+
"operation_workflow.trigger",
|
|
87
|
+
"operation_workflow.ordered_step",
|
|
88
|
+
"operation_workflow.state_transition",
|
|
89
|
+
"operation_workflow.synchronous_effect",
|
|
90
|
+
"operation_workflow.asynchronous_effect",
|
|
91
|
+
"state_machine.transition",
|
|
92
|
+
"state_machine.illegal_transition",
|
|
93
|
+
"state_machine.reentry",
|
|
94
|
+
"state_machine.interruption",
|
|
95
|
+
"commercial_billing.payment_state",
|
|
96
|
+
]),
|
|
97
|
+
recovery: new Set([
|
|
98
|
+
"state_machine.recovery",
|
|
99
|
+
"state_machine.restoration",
|
|
100
|
+
"input_validation.lossless_recovery",
|
|
101
|
+
"output_error.recovery",
|
|
102
|
+
"fault_degradation_recovery.recovery_trigger",
|
|
103
|
+
"fault_degradation_recovery.restoration_point",
|
|
104
|
+
"fault_degradation_recovery.data_loss_prevention",
|
|
105
|
+
"backup_restore_disaster_recovery.restore_procedure",
|
|
106
|
+
"backup_restore_disaster_recovery.restore_verification",
|
|
107
|
+
"backup_restore_disaster_recovery.drill_evidence",
|
|
108
|
+
"compatibility_migration_rollout.failure_recovery",
|
|
109
|
+
"reliability_slo.recovery_response",
|
|
110
|
+
"architecture_ownership.recovery",
|
|
111
|
+
]),
|
|
112
|
+
population: new Set([
|
|
113
|
+
"data_model.cardinality",
|
|
114
|
+
"performance_capacity_cost.dataset_cardinality",
|
|
115
|
+
"reliability_slo.population",
|
|
116
|
+
"ai_ml.evaluation_population",
|
|
117
|
+
]),
|
|
118
|
+
visual: new Set([
|
|
119
|
+
"architecture_ownership.selected_design",
|
|
120
|
+
"notification_file_media.dimensions",
|
|
121
|
+
"notification_file_media.accessibility_alternative",
|
|
122
|
+
]),
|
|
123
|
+
};
|
|
124
|
+
export function semanticFactCustomPropertyHasClosedStandardProfile(property) {
|
|
125
|
+
return (!property.standard &&
|
|
126
|
+
isCustomSemanticFactName(property.property) &&
|
|
127
|
+
property.required_methods.length > 0 &&
|
|
128
|
+
property.required_methods.every((method) => Object.hasOwn(METHOD_CAPABILITY_FLOORS, method)));
|
|
129
|
+
}
|
|
130
|
+
export function validateSemanticFactProofProfileClosure(manifest) {
|
|
131
|
+
const digest = sha256Hex(canonicalValueJson(SEMANTIC_FACT_STANDARD_PROPERTIES));
|
|
132
|
+
if (digest !== STANDARD_PROPERTY_CATALOG_SHA256)
|
|
133
|
+
semanticFactClosureInvalid("standard_property_profile_catalog_changed", `${digest}:${STANDARD_PROPERTY_CATALOG_SHA256}`);
|
|
134
|
+
if (Object.keys(METHOD_CAPABILITY_FLOORS).length !==
|
|
135
|
+
SEMANTIC_FACT_PROOF_METHODS.length ||
|
|
136
|
+
SEMANTIC_FACT_PROOF_METHODS.some((method) => !Object.hasOwn(METHOD_CAPABILITY_FLOORS, method)))
|
|
137
|
+
semanticFactClosureInvalid("standard_proof_method_profile_incomplete", SEMANTIC_FACT_PROOF_METHODS.join(","));
|
|
138
|
+
const families = new Map(manifest.family_dispositions.map((family) => [family.key, family.family]));
|
|
139
|
+
for (const property of manifest.property_dispositions) {
|
|
140
|
+
const family = families.get(property.family_ref);
|
|
141
|
+
if (!family)
|
|
142
|
+
semanticFactClosureInvalid("proof_profile_property_family_unknown", property.key);
|
|
143
|
+
const catalog = SEMANTIC_FACT_STANDARD_PROPERTIES[family];
|
|
144
|
+
const catalogStandard = Boolean(catalog?.includes(property.property));
|
|
145
|
+
if (property.standard !== catalogStandard)
|
|
146
|
+
semanticFactClosureInvalid("proof_profile_property_standard_mismatch", `${property.key}:${family}.${property.property}`);
|
|
147
|
+
}
|
|
148
|
+
const known = new Set(Object.entries(SEMANTIC_FACT_STANDARD_PROPERTIES).flatMap(([family, properties]) => properties.map((property) => `${family}.${property}`)));
|
|
149
|
+
for (const [className, members] of Object.entries(PROPERTY_CLASSES))
|
|
150
|
+
for (const member of members)
|
|
151
|
+
if (!known.has(member))
|
|
152
|
+
semanticFactClosureInvalid("proof_profile_property_member_unknown", `${className}:${member}`);
|
|
153
|
+
}
|
|
154
|
+
export function semanticFactProofCapabilityFloor(manifest, fact, proof) {
|
|
155
|
+
const property = manifest.property_dispositions.find((row) => row.key === fact.property_ref);
|
|
156
|
+
if (!property)
|
|
157
|
+
semanticFactClosureInvalid("proof_profile_fact_property_unknown", `${fact.key}:${fact.property_ref}`);
|
|
158
|
+
const standardMethod = Object.hasOwn(METHOD_CAPABILITY_FLOORS, proof.method);
|
|
159
|
+
if (proof.authority === "machine" &&
|
|
160
|
+
(!standardMethod ||
|
|
161
|
+
(!property.standard &&
|
|
162
|
+
!semanticFactCustomPropertyHasClosedStandardProfile(property))))
|
|
163
|
+
semanticFactClosureInvalid("semantic_fact_custom_machine_authority_forbidden", `${proof.key}:${property.property}:${proof.method}`);
|
|
164
|
+
const result = new Set(["semantic_fact"]);
|
|
165
|
+
if (standardMethod)
|
|
166
|
+
for (const capability of METHOD_CAPABILITY_FLOORS[proof.method])
|
|
167
|
+
result.add(capability);
|
|
168
|
+
for (const capability of property.required_evidence_capabilities)
|
|
169
|
+
result.add(capability);
|
|
170
|
+
const family = manifest.family_dispositions.find((row) => row.key === fact.family_ref)?.family;
|
|
171
|
+
const propertyIdentity = `${family}.${property.property}`;
|
|
172
|
+
for (const [className, members] of Object.entries(PROPERTY_CLASSES))
|
|
173
|
+
if (members.has(propertyIdentity))
|
|
174
|
+
for (const capability of PROPERTY_CLASS_CAPABILITIES[className])
|
|
175
|
+
result.add(capability);
|
|
176
|
+
if (fact.observation_scope === "implementation_structure")
|
|
177
|
+
result.add("presence");
|
|
178
|
+
if (fact.observation_scope === "data_boundary")
|
|
179
|
+
result.add("data_state");
|
|
180
|
+
if (fact.observation_scope === "external_boundary") {
|
|
181
|
+
result.add("boundary_invocation");
|
|
182
|
+
result.add("actual_provenance");
|
|
183
|
+
}
|
|
184
|
+
if (fact.quantifier.kind !== "one")
|
|
185
|
+
result.add("population_coverage");
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
@@ -17,5 +17,5 @@ export declare function semanticRef(value: unknown, label: string): string;
|
|
|
17
17
|
export declare function nullable<T>(value: unknown, parser: (value: unknown) => T): T | null;
|
|
18
18
|
export declare const PROOF_SURFACES: readonly ["ui_browser", "runtime_behavior", "api_contract", "data_state", "security_boundary", "population_coverage", "implementation_structure"];
|
|
19
19
|
export declare const JOURNEY_ROLES: readonly ["success", "degradation", "recovery", "stage_gate", "conformance"];
|
|
20
|
-
export declare const EVIDENCE_CAPABILITIES: readonly ["presence", "interaction_trace", "state_delta", "cross_surface_consistency", "durable_readback", "boundary_invocation", "external_side_effect", "failure_injection", "visual_render", "design_conformance", "design_method", "design_symbolic_certificate", "semantic_fact", "target_runtime", "input_variation"];
|
|
20
|
+
export declare const EVIDENCE_CAPABILITIES: readonly ["presence", "interaction_trace", "state_delta", "cross_surface_consistency", "durable_readback", "boundary_invocation", "actual_provenance", "external_side_effect", "distinct_identity", "data_state", "population_coverage", "failure_injection", "recovery", "visual_render", "design_conformance", "design_method", "design_symbolic_certificate", "semantic_fact", "target_runtime", "input_variation"];
|
|
21
21
|
export declare function fail(label: string, message: string): never;
|
|
@@ -101,8 +101,13 @@ export const EVIDENCE_CAPABILITIES = [
|
|
|
101
101
|
"cross_surface_consistency",
|
|
102
102
|
"durable_readback",
|
|
103
103
|
"boundary_invocation",
|
|
104
|
+
"actual_provenance",
|
|
104
105
|
"external_side_effect",
|
|
106
|
+
"distinct_identity",
|
|
107
|
+
"data_state",
|
|
108
|
+
"population_coverage",
|
|
105
109
|
"failure_injection",
|
|
110
|
+
"recovery",
|
|
106
111
|
"visual_render",
|
|
107
112
|
"design_conformance",
|
|
108
113
|
"design_method",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaterialSourceFragmentV2, SemanticSourceAnchorV2 } from "./long-task-source-authority-types.js";
|
|
2
|
+
export type SemanticModalPolarity = "positive" | "negative";
|
|
3
|
+
export interface SemanticModalOccurrenceV2 {
|
|
4
|
+
value: string;
|
|
5
|
+
polarity: SemanticModalPolarity;
|
|
6
|
+
}
|
|
7
|
+
export declare function semanticSourceAnchorRef(anchor: Pick<SemanticSourceAnchorV2, "fragment_ref" | "kind" | "value_sha256">): string;
|
|
8
|
+
export declare function deriveSemanticSourceAnchors(fragment: MaterialSourceFragmentV2): SemanticSourceAnchorV2[];
|
|
9
|
+
export declare function semanticModalOccurrences(text: string): SemanticModalOccurrenceV2[];
|
|
10
|
+
export declare function semanticModalPolarity(value: string): SemanticModalPolarity | null;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { sha256Hex } from "./strict-codec.js";
|
|
2
|
+
const POSITIVE_MODAL_TERMS = [
|
|
3
|
+
"must",
|
|
4
|
+
"shall",
|
|
5
|
+
"required",
|
|
6
|
+
"必须",
|
|
7
|
+
"应当",
|
|
8
|
+
];
|
|
9
|
+
const NEGATIVE_MODAL_TERMS = [
|
|
10
|
+
"must not",
|
|
11
|
+
"shall not",
|
|
12
|
+
"forbidden",
|
|
13
|
+
"never",
|
|
14
|
+
"不得",
|
|
15
|
+
"禁止",
|
|
16
|
+
"不可",
|
|
17
|
+
"只能",
|
|
18
|
+
"仅可",
|
|
19
|
+
];
|
|
20
|
+
export function semanticSourceAnchorRef(anchor) {
|
|
21
|
+
return `${anchor.fragment_ref}#anchor:${anchor.kind}:${anchor.value_sha256.slice(0, 16)}`;
|
|
22
|
+
}
|
|
23
|
+
export function deriveSemanticSourceAnchors(fragment) {
|
|
24
|
+
const found = [];
|
|
25
|
+
collectMatches(found, fragment.normalized_text, "code_mark", /`([^`\n]+)`/gu, 1);
|
|
26
|
+
collectMatches(found, fragment.normalized_text, "exact_quote", /["“”'‘’]([^"“”'‘’\n]{2,})["“”'‘’]/gu, 1);
|
|
27
|
+
collectMatches(found, fragment.normalized_text, "api_path", /(?:^|[\s`"'(])((?:\/[A-Za-z0-9._~!$&*+,;=:@%{}-]*[A-Za-z0-9_~!$&*+=@%{}-])+)(?=$|[\s`"'),.;:])/gu, 1);
|
|
28
|
+
collectMatches(found, fragment.normalized_text, "version", /\bv?\d+\.\d+(?:\.\d+)?(?:[-+][A-Za-z0-9.-]+)?\b/gu);
|
|
29
|
+
collectMatches(found, fragment.normalized_text, "symbol", /\b[A-Z][A-Z0-9_]{2,}\b/gu);
|
|
30
|
+
collectMatches(found, fragment.normalized_text, "frozen_identifier", /(?:\b(?:[Pp]rovider|[Pp]rotocol)\b|(?:提供商|供应商|协议))\s*(?:(?:[::=]|is\b|named\b|called\b|为|是|采用|使用)\s*)?([A-Z][A-Za-z0-9]*(?:[-._][A-Za-z0-9]+)*)/gu, 1);
|
|
31
|
+
collectMatches(found, fragment.normalized_text, "file_or_schema_key", /\b[A-Za-z_][\w-]*(?:\.[A-Za-z_][\w-]*)+\b/gu);
|
|
32
|
+
collectMatches(found, fragment.normalized_text, "file_or_schema_key", /\b([A-Za-z_][\w.-]*)\s*(?=[:=])/gu, 1);
|
|
33
|
+
collectMatches(found, fragment.normalized_text, "number_or_unit", /\b\d+(?:\.\d+)?(?:\s*(?:-|–|—|\.\.)\s*\d+(?:\.\d+)?)?(?:\s*(?:ms|s|sec|seconds?|min|minutes?|h|hours?|bytes?|KB|MB|GB|%|px|rem|em|rps|qps))?\b/giu);
|
|
34
|
+
addModalAnchors(found, fragment.normalized_text);
|
|
35
|
+
return materializeAnchors(fragment, found);
|
|
36
|
+
}
|
|
37
|
+
function addModalAnchors(found, text) {
|
|
38
|
+
for (const occurrence of semanticModalOccurrences(text))
|
|
39
|
+
found.push({ kind: "modal_term", value: occurrence.value });
|
|
40
|
+
}
|
|
41
|
+
export function semanticModalOccurrences(text) {
|
|
42
|
+
const alternatives = [...NEGATIVE_MODAL_TERMS, ...POSITIVE_MODAL_TERMS].sort((left, right) => right.length - left.length);
|
|
43
|
+
const pattern = new RegExp(`(?:^|[^a-z])(${alternatives
|
|
44
|
+
.filter((term) => !/[\u3400-\u9fff]/u.test(term))
|
|
45
|
+
.map(escapeRegex)
|
|
46
|
+
.join("|")})(?=$|[^a-z])|(${alternatives
|
|
47
|
+
.filter((term) => /[\u3400-\u9fff]/u.test(term))
|
|
48
|
+
.map(escapeRegex)
|
|
49
|
+
.join("|")})`, "giu");
|
|
50
|
+
const negative = new Set(NEGATIVE_MODAL_TERMS);
|
|
51
|
+
return [...text.matchAll(pattern)].map((match) => {
|
|
52
|
+
const value = (match[1] ?? match[2]).toLocaleLowerCase("en-US");
|
|
53
|
+
return {
|
|
54
|
+
value,
|
|
55
|
+
polarity: negative.has(value) ? "negative" : "positive",
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export function semanticModalPolarity(value) {
|
|
60
|
+
const normalized = value.toLocaleLowerCase("en-US");
|
|
61
|
+
if (NEGATIVE_MODAL_TERMS.includes(normalized))
|
|
62
|
+
return "negative";
|
|
63
|
+
if (POSITIVE_MODAL_TERMS.includes(normalized))
|
|
64
|
+
return "positive";
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
function materializeAnchors(fragment, found) {
|
|
68
|
+
const seen = new Set();
|
|
69
|
+
return found
|
|
70
|
+
.map(({ kind, value }) => ({ kind, value: value.trim() }))
|
|
71
|
+
.filter(({ kind, value }) => {
|
|
72
|
+
if (!value)
|
|
73
|
+
return false;
|
|
74
|
+
const identity = `${kind}\0${value}`;
|
|
75
|
+
if (seen.has(identity))
|
|
76
|
+
return false;
|
|
77
|
+
seen.add(identity);
|
|
78
|
+
return true;
|
|
79
|
+
})
|
|
80
|
+
.map(({ kind, value }) => {
|
|
81
|
+
const valueSha256 = sha256Hex(value);
|
|
82
|
+
const base = {
|
|
83
|
+
fragment_ref: fragment.key,
|
|
84
|
+
source_item_ref: fragment.source_item_ref,
|
|
85
|
+
authority_source_item_refs: [...fragment.authority_source_item_refs],
|
|
86
|
+
authority_domain: fragment.authority_domain,
|
|
87
|
+
kind,
|
|
88
|
+
value,
|
|
89
|
+
value_sha256: valueSha256,
|
|
90
|
+
};
|
|
91
|
+
return { ...base, key: semanticSourceAnchorRef(base) };
|
|
92
|
+
})
|
|
93
|
+
.sort((left, right) => left.key.localeCompare(right.key));
|
|
94
|
+
}
|
|
95
|
+
function collectMatches(result, value, kind, pattern, group = 0) {
|
|
96
|
+
for (const match of value.matchAll(pattern))
|
|
97
|
+
if (match[group])
|
|
98
|
+
result.push({ kind, value: match[group] });
|
|
99
|
+
}
|
|
100
|
+
function escapeRegex(value) {
|
|
101
|
+
return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
102
|
+
}
|
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
import type { RiskFactName } from "./long-task-risk-types.js";
|
|
2
2
|
export type SourceItemKind = "outcome_result" | "requirement" | "control" | "acceptance" | "technical_obligation" | "non_completing" | "non_goal" | "forbidden_shortcut" | "risk_fact" | "external_confirmation" | "decision";
|
|
3
3
|
export type SourceItemAspect = "architecture";
|
|
4
|
+
export type SourceAuthorityDomain = "product" | "technical" | "design" | "acceptance" | "external";
|
|
5
|
+
export type MaterialSourceFragmentKind = "heading" | "paragraph" | "list_item" | "table_row" | "blockquote" | "given_when_then" | "fenced_code" | "structured_config_line" | "textual_html";
|
|
6
|
+
export interface MaterialTextInputV2 {
|
|
7
|
+
input_key: string;
|
|
8
|
+
input_kind: "source_item" | "attachment" | "canonical_spec" | "repository_preservation" | "external_constraint" | "delegated_instruction" | "design_resource";
|
|
9
|
+
source_ref: string;
|
|
10
|
+
sha256: string;
|
|
11
|
+
authority_source_item_refs: string[];
|
|
12
|
+
authority_domain: SourceAuthorityDomain;
|
|
13
|
+
normalized_text: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MaterialFragmentCoverageV2 {
|
|
16
|
+
material_nonblank_lines: number[];
|
|
17
|
+
covered_lines: number[];
|
|
18
|
+
excluded_separator_lines: number[];
|
|
19
|
+
}
|
|
20
|
+
export interface MaterialFragmentScanResultV2 {
|
|
21
|
+
fragments: MaterialSourceFragmentV2[];
|
|
22
|
+
coverage: MaterialFragmentCoverageV2;
|
|
23
|
+
}
|
|
24
|
+
export type SemanticAnchorKind = "code_mark" | "api_path" | "version" | "symbol" | "frozen_identifier" | "file_or_schema_key" | "number_or_unit" | "exact_quote" | "modal_term";
|
|
25
|
+
export interface MaterialSourceFragmentV2 {
|
|
26
|
+
key: string;
|
|
27
|
+
input_key: string;
|
|
28
|
+
source_item_ref: string;
|
|
29
|
+
authority_source_item_refs: string[];
|
|
30
|
+
source_path: string;
|
|
31
|
+
authority_domain: SourceAuthorityDomain;
|
|
32
|
+
kind: MaterialSourceFragmentKind;
|
|
33
|
+
ordinal: number;
|
|
34
|
+
start_line: number;
|
|
35
|
+
end_line: number;
|
|
36
|
+
normalized_text: string;
|
|
37
|
+
text_sha256: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SemanticSourceAnchorV2 {
|
|
40
|
+
key: string;
|
|
41
|
+
fragment_ref: string;
|
|
42
|
+
source_item_ref: string;
|
|
43
|
+
authority_source_item_refs: string[];
|
|
44
|
+
authority_domain: SourceAuthorityDomain;
|
|
45
|
+
kind: SemanticAnchorKind;
|
|
46
|
+
value: string;
|
|
47
|
+
value_sha256: string;
|
|
48
|
+
}
|
|
49
|
+
export type SemanticFactClassV2 = "delivery_semantic" | "source_integrity";
|
|
4
50
|
export interface CompiledSourceItemV2 {
|
|
5
51
|
key: string;
|
|
6
52
|
kind: SourceItemKind;
|
|
@@ -7,6 +7,10 @@ export function validateSourceClaimMappings(contract, compiledClaims, report) {
|
|
|
7
7
|
const productClaims = new Set(Object.values(compiledClaims.by_outcome)
|
|
8
8
|
.flat()
|
|
9
9
|
.map((claim) => claim.id));
|
|
10
|
+
const claimApplicability = new Map([
|
|
11
|
+
...compiledClaims.by_global,
|
|
12
|
+
...Object.values(compiledClaims.by_outcome).flat(),
|
|
13
|
+
].map((claim) => [claim.id, new Set(claim.applicability_refs)]));
|
|
10
14
|
const executionTargetClaims = new Set(contract.task.execution_targets.map((target) => executionTargetSourceTargetRef(target.key)));
|
|
11
15
|
const globalClaims = new Map(compiledClaims.by_global.map((claim) => [claim.local_key, claim]));
|
|
12
16
|
const coveredGlobalClaims = new Set(Object.entries(compiledClaims.summary.claims_by_global)
|
|
@@ -51,8 +55,40 @@ export function validateSourceClaimMappings(contract, compiledClaims, report) {
|
|
|
51
55
|
validateGlobalRefs(claim.key, disposition.refs, forbiddenPaths, globalClaims, coveredGlobalClaims, report);
|
|
52
56
|
if (disposition.type === "risk_fact")
|
|
53
57
|
validateRiskRefs(contract, claim.key, disposition.refs, report);
|
|
58
|
+
validateJudgmentBasis(contract, claim, claimApplicability, report);
|
|
54
59
|
}
|
|
55
60
|
}
|
|
61
|
+
function validateJudgmentBasis(contract, claim, claimApplicability, report) {
|
|
62
|
+
const basis = claim.judgment_basis;
|
|
63
|
+
if (!basis)
|
|
64
|
+
return;
|
|
65
|
+
if (!sourceClaimOwnsClaim(contract, claim, basis))
|
|
66
|
+
issue(report, "source_claim_judgment_basis_claim_not_owned", `${claim.key}:${basis.claim_ref}`);
|
|
67
|
+
const applicability = claimApplicability.get(basis.claim_ref);
|
|
68
|
+
if (!applicability)
|
|
69
|
+
issue(report, "source_claim_judgment_basis_claim_unknown", `${claim.key}:${basis.claim_ref}`);
|
|
70
|
+
if (!basis.applicability_refs.length ||
|
|
71
|
+
new Set(basis.applicability_refs).size !== basis.applicability_refs.length)
|
|
72
|
+
issue(report, "source_claim_judgment_basis_applicability_set_invalid", claim.key);
|
|
73
|
+
for (const applicabilityRef of basis.applicability_refs)
|
|
74
|
+
if (!applicability?.has(applicabilityRef))
|
|
75
|
+
issue(report, "source_claim_judgment_basis_applicability_unknown", `${claim.key}:${basis.claim_ref}:${applicabilityRef}`);
|
|
76
|
+
}
|
|
77
|
+
function sourceClaimOwnsClaim(contract, claim, basis) {
|
|
78
|
+
const disposition = claim.disposition;
|
|
79
|
+
if (disposition.type === "claim" || disposition.type === "global_constraint")
|
|
80
|
+
return disposition.refs.includes(basis.claim_ref);
|
|
81
|
+
if (disposition.type === "outcome_result")
|
|
82
|
+
return disposition.ref === basis.claim_ref;
|
|
83
|
+
if (disposition.type !== "external_confirmation")
|
|
84
|
+
return false;
|
|
85
|
+
return basis.applicability_refs.every((applicabilityRef) => contract.global.acceptance.external_confirmations.some((confirmation) => disposition.refs.includes(confirmation.key) &&
|
|
86
|
+
confirmation.obligations?.some((obligation) => obligation.claim_ref === basis.claim_ref &&
|
|
87
|
+
obligation.applicability_ref === applicabilityRef &&
|
|
88
|
+
obligation.result_kind === "judgment" &&
|
|
89
|
+
obligation.judgment_basis?.kind === basis.kind &&
|
|
90
|
+
obligation.judgment_basis.source_ref === claim.key)));
|
|
91
|
+
}
|
|
56
92
|
function validateSourcePresence(contract, report) {
|
|
57
93
|
if (!contract.task.source_paths.length || !contract.source_claims.length)
|
|
58
94
|
issue(report, "source_authority_required", "source_paths and source_claims must be non-empty");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SemanticFactClassV2, SourceAuthorityDomain } from "./long-task-source-authority-types.js";
|
|
2
|
+
import type { SemanticFactManifestV1 } from "./semantic-fact-types.js";
|
|
3
|
+
import type { SourceConservationFactProjectionV2 } from "./long-task-source-conservation-types.js";
|
|
4
|
+
export declare function addSourceConservationFact(facts: Map<string, SourceConservationFactProjectionV2>, fact: SourceConservationFactProjectionV2): void;
|
|
5
|
+
export declare function semanticFactClass(fact: SemanticFactManifestV1["facts"][number]): SemanticFactClassV2;
|
|
6
|
+
export declare function semanticFactAuthorityDomain(fact: SemanticFactManifestV1["facts"][number], sourceDomains: ReadonlyMap<string, SourceAuthorityDomain>): SourceAuthorityDomain;
|
|
7
|
+
export declare function semanticExpectedContains(fact: SourceConservationFactProjectionV2, value: string): boolean;
|
|
8
|
+
export declare function semanticFactExpectedSearchText(fact: SemanticFactManifestV1["facts"][number]): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { semanticFactClosureInvalid } from "./long-task-semantic-fact-closure-primitives.js";
|
|
2
|
+
export function addSourceConservationFact(facts, fact) {
|
|
3
|
+
if (facts.has(fact.key))
|
|
4
|
+
semanticFactClosureInvalid("source_projection_fact_duplicate", fact.key);
|
|
5
|
+
facts.set(fact.key, fact);
|
|
6
|
+
}
|
|
7
|
+
export function semanticFactClass(fact) {
|
|
8
|
+
const structuralLocator = [
|
|
9
|
+
"source_item",
|
|
10
|
+
"whole_resource",
|
|
11
|
+
"code_symbol",
|
|
12
|
+
].includes(fact.expected.locator.kind);
|
|
13
|
+
return fact.observation_scope === "implementation_structure" &&
|
|
14
|
+
(fact.value_kind === "digest" ||
|
|
15
|
+
fact.expected.representation === "digest_only" ||
|
|
16
|
+
structuralLocator)
|
|
17
|
+
? "source_integrity"
|
|
18
|
+
: "delivery_semantic";
|
|
19
|
+
}
|
|
20
|
+
export function semanticFactAuthorityDomain(fact, sourceDomains) {
|
|
21
|
+
const available = new Set(fact.source_item_refs
|
|
22
|
+
.map((ref) => sourceDomains.get(ref))
|
|
23
|
+
.filter((value) => Boolean(value)));
|
|
24
|
+
if (available.size === 1)
|
|
25
|
+
return [...available][0];
|
|
26
|
+
const preferred = fact.observation_scope === "external_boundary"
|
|
27
|
+
? "external"
|
|
28
|
+
: fact.observation_scope === "product_boundary"
|
|
29
|
+
? "product"
|
|
30
|
+
: "technical";
|
|
31
|
+
if (available.has(preferred))
|
|
32
|
+
return preferred;
|
|
33
|
+
for (const candidate of [
|
|
34
|
+
"acceptance",
|
|
35
|
+
"product",
|
|
36
|
+
"technical",
|
|
37
|
+
"external",
|
|
38
|
+
"design",
|
|
39
|
+
])
|
|
40
|
+
if (available.has(candidate))
|
|
41
|
+
return candidate;
|
|
42
|
+
semanticFactClosureInvalid("fact_authority_domain_missing", fact.key);
|
|
43
|
+
}
|
|
44
|
+
export function semanticExpectedContains(fact, value) {
|
|
45
|
+
return fact.expected_search_text.includes(value);
|
|
46
|
+
}
|
|
47
|
+
export function semanticFactExpectedSearchText(fact) {
|
|
48
|
+
return [
|
|
49
|
+
fact.expected.representation === "inline"
|
|
50
|
+
? JSON.stringify(fact.expected.value)
|
|
51
|
+
: "",
|
|
52
|
+
fact.expected.locator.value,
|
|
53
|
+
fact.property_ref,
|
|
54
|
+
fact.unit_ref,
|
|
55
|
+
fact.owner_ref,
|
|
56
|
+
].join("\n");
|
|
57
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { MaterialSourceFragmentV2, SemanticFactClassV2, SemanticSourceAnchorV2, SourceAuthorityDomain } from "./long-task-source-authority-types.js";
|
|
2
|
+
import type { SemanticFactSupportingRelationV1 } from "./semantic-fact-inventory-types.js";
|
|
3
|
+
export type SourceProjectionDispositionV2 = "fact_bearing" | "supporting_basis" | "superseded" | "decision_required" | "scope_excluded";
|
|
4
|
+
export interface ResolvedSourceProjectionV2 {
|
|
5
|
+
input_key: string;
|
|
6
|
+
disposition: SourceProjectionDispositionV2;
|
|
7
|
+
fact_refs: string[];
|
|
8
|
+
basis_refs: string[];
|
|
9
|
+
supporting_relation?: SemanticFactSupportingRelationV1;
|
|
10
|
+
explicit: boolean;
|
|
11
|
+
authority_derived: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SourceConservationFactProjectionV2 {
|
|
14
|
+
key: string;
|
|
15
|
+
source_item_refs: string[];
|
|
16
|
+
basis_refs: string[];
|
|
17
|
+
semantic_class: SemanticFactClassV2;
|
|
18
|
+
authority_domain: SourceAuthorityDomain;
|
|
19
|
+
expected_search_text: string;
|
|
20
|
+
semantic_cell: {
|
|
21
|
+
outcome_ref: string;
|
|
22
|
+
unit_ref: string;
|
|
23
|
+
family_ref: string;
|
|
24
|
+
condition_ref: string;
|
|
25
|
+
property_ref: string;
|
|
26
|
+
value_kind: string;
|
|
27
|
+
} | null;
|
|
28
|
+
}
|
|
29
|
+
export interface SourceSemanticConservationV2 {
|
|
30
|
+
fragments: MaterialSourceFragmentV2[];
|
|
31
|
+
anchors: SemanticSourceAnchorV2[];
|
|
32
|
+
fact_classes: Record<string, SemanticFactClassV2>;
|
|
33
|
+
fact_domains: Record<string, SourceAuthorityDomain>;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|