project-tiny-context-harness 0.8.11 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +514 -472
- package/assets/README.md +803 -749
- package/assets/README.zh-CN.md +468 -431
- package/assets/agents/.gitkeep +1 -1
- package/assets/agents/AGENTS_CORE.md +22 -24
- package/assets/agents/long-task-implementation.toml +15 -0
- package/assets/context_templates/architecture.md +18 -18
- package/assets/context_templates/area.md +30 -30
- package/assets/context_templates/context.toml +24 -24
- package/assets/context_templates/deployment.md +35 -35
- package/assets/context_templates/global.md +56 -56
- package/assets/context_templates/product-surface-contract.md +70 -70
- package/assets/context_templates/screen-contract.md +189 -189
- package/assets/context_templates/verification.md +25 -25
- package/assets/github/.gitkeep +1 -1
- package/assets/github/harness.yml +39 -39
- package/assets/make/.gitkeep +1 -1
- package/assets/make/ty-context.mk +48 -48
- package/assets/skills/context_development_engineer/SKILL.md +72 -185
- package/assets/skills/context_full_project_export/SKILL.md +28 -28
- package/assets/skills/context_harness_upgrade/SKILL.md +60 -60
- package/assets/skills/context_product_plan/SKILL.md +35 -101
- package/assets/skills/context_surface_contract/SKILL.md +194 -191
- package/assets/skills/context_uiux_design/SKILL.md +49 -172
- package/assets/skills/design-resource-authoring/SKILL.md +54 -88
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +51 -163
- package/assets/skills/design-resource-authoring/references/formal-selected-web-app-handoff.md +96 -0
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +140 -120
- package/assets/skills/design-resource-authoring/references/recovery-and-writeback.md +199 -0
- package/assets/skills/design-resource-authoring/references/resource-selection.md +158 -181
- package/assets/skills/design-system-authoring/SKILL.md +57 -57
- package/assets/skills/design-system-authoring/agents/openai.yaml +6 -6
- package/assets/skills/design-system-authoring/references/authority-adoption.md +48 -48
- package/assets/skills/design-system-authoring/references/open-design-design-system-provider.md +110 -110
- package/assets/skills/long-task-workflow/SKILL.md +71 -106
- package/assets/skills/long-task-workflow/agents/openai.yaml +1 -1
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +71 -69
- package/assets/skills/long-task-workflow/references/contract-authoring.md +110 -101
- package/assets/skills/long-task-workflow/references/evidence-design.md +99 -78
- package/assets/skills/long-task-workflow/references/source-authoring.md +90 -90
- package/assets/tools/validate_context.py +442 -442
- package/dist/commands/design-resource-recovery.d.ts +1 -0
- package/dist/commands/design-resource-recovery.js +152 -0
- package/dist/commands/design-resource.js +29 -3
- package/dist/commands/enable.js +2 -0
- package/dist/commands/index.js +2 -2
- package/dist/commands/long-task-revision.js +8 -7
- package/dist/commands/sync.js +2 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -0
- package/dist/lib/compact-authoring-support.d.ts +22 -0
- package/dist/lib/compact-authoring-support.js +143 -0
- package/dist/lib/compact-shared-structure-authoring.d.ts +5 -0
- package/dist/lib/compact-shared-structure-authoring.js +9 -0
- package/dist/lib/compact-shared-structure-types.d.ts +61 -0
- package/dist/lib/compact-shared-structure-types.js +1 -0
- package/dist/lib/compact-shared-structure-validation.d.ts +2 -0
- package/dist/lib/compact-shared-structure-validation.js +159 -0
- package/dist/lib/compact-shared-structures.d.ts +3 -0
- package/dist/lib/compact-shared-structures.js +204 -0
- package/dist/lib/design-resource-fact-enums.d.ts +4 -0
- package/dist/lib/design-resource-fact-enums.js +12 -0
- package/dist/lib/design-resource-fact-manifest-shape-evidence.js +2 -2
- package/dist/lib/design-resource-fact-policy.d.ts +2 -2
- package/dist/lib/design-resource-fact-types.d.ts +2 -2
- package/dist/lib/design-resource-handoff-bundle-draft.js +4 -2
- package/dist/lib/design-resource-handoff-input-types.d.ts +3 -0
- package/dist/lib/design-resource-handoff-parser.d.ts +2 -2
- package/dist/lib/design-resource-handoff-parser.js +2 -2
- package/dist/lib/design-resource-handoff-shape.d.ts +2 -0
- package/dist/lib/design-resource-handoff-shape.js +10 -0
- package/dist/lib/design-resource-handoff-snapshot.js +4 -0
- package/dist/lib/design-resource-handoff-validation.d.ts +4 -1
- package/dist/lib/design-resource-handoff-validation.js +11 -0
- package/dist/lib/design-resource-handoff-web-dependency-validation.d.ts +4 -2
- package/dist/lib/design-resource-reconciliation-codec.d.ts +2 -0
- package/dist/lib/design-resource-reconciliation-codec.js +174 -0
- package/dist/lib/design-resource-reconciliation-types.d.ts +62 -0
- package/dist/lib/design-resource-reconciliation-types.js +1 -0
- package/dist/lib/design-resource-reconciliation.d.ts +3 -0
- package/dist/lib/design-resource-reconciliation.js +224 -0
- package/dist/lib/design-resource-recovery-authority-policy.d.ts +8 -0
- package/dist/lib/design-resource-recovery-authority-policy.js +123 -0
- package/dist/lib/design-resource-recovery-catalog-resources.d.ts +6 -0
- package/dist/lib/design-resource-recovery-catalog-resources.js +121 -0
- package/dist/lib/design-resource-recovery-catalog-shape.d.ts +3 -0
- package/dist/lib/design-resource-recovery-catalog-shape.js +104 -0
- package/dist/lib/design-resource-recovery-catalog.d.ts +9 -0
- package/dist/lib/design-resource-recovery-catalog.js +103 -0
- package/dist/lib/design-resource-recovery-cleanup.d.ts +2 -0
- package/dist/lib/design-resource-recovery-cleanup.js +11 -0
- package/dist/lib/design-resource-recovery-codec-primitives.d.ts +19 -0
- package/dist/lib/design-resource-recovery-codec-primitives.js +92 -0
- package/dist/lib/design-resource-recovery-codec.d.ts +4 -0
- package/dist/lib/design-resource-recovery-codec.js +93 -0
- package/dist/lib/design-resource-recovery-current.d.ts +9 -0
- package/dist/lib/design-resource-recovery-current.js +41 -0
- package/dist/lib/design-resource-recovery-delta-policy.d.ts +5 -0
- package/dist/lib/design-resource-recovery-delta-policy.js +108 -0
- package/dist/lib/design-resource-recovery-files.d.ts +37 -0
- package/dist/lib/design-resource-recovery-files.js +204 -0
- package/dist/lib/design-resource-recovery-final-disposition-shape.d.ts +2 -0
- package/dist/lib/design-resource-recovery-final-disposition-shape.js +47 -0
- package/dist/lib/design-resource-recovery-patch-types.d.ts +54 -0
- package/dist/lib/design-resource-recovery-patch-types.js +1 -0
- package/dist/lib/design-resource-recovery-replay.d.ts +7 -0
- package/dist/lib/design-resource-recovery-replay.js +112 -0
- package/dist/lib/design-resource-recovery-repository-bindings.d.ts +9 -0
- package/dist/lib/design-resource-recovery-repository-bindings.js +49 -0
- package/dist/lib/design-resource-recovery-schema.d.ts +5 -0
- package/dist/lib/design-resource-recovery-schema.js +5 -0
- package/dist/lib/design-resource-recovery-shape.d.ts +10 -0
- package/dist/lib/design-resource-recovery-shape.js +184 -0
- package/dist/lib/design-resource-recovery-source-authority.d.ts +5 -0
- package/dist/lib/design-resource-recovery-source-authority.js +219 -0
- package/dist/lib/design-resource-recovery-text.d.ts +17 -0
- package/dist/lib/design-resource-recovery-text.js +186 -0
- package/dist/lib/design-resource-recovery-types.d.ts +197 -0
- package/dist/lib/design-resource-recovery-types.js +1 -0
- package/dist/lib/design-resource-recovery-writeback-policy.d.ts +5 -0
- package/dist/lib/design-resource-recovery-writeback-policy.js +326 -0
- package/dist/lib/design-resource-recovery-writeback-shape.d.ts +6 -0
- package/dist/lib/design-resource-recovery-writeback-shape.js +155 -0
- package/dist/lib/design-resource-recovery.d.ts +44 -0
- package/dist/lib/design-resource-recovery.js +216 -0
- package/dist/lib/design-resource-symbolic-applicability-authority.d.ts +7 -0
- package/dist/lib/design-resource-symbolic-applicability-authority.js +19 -0
- package/dist/lib/design-resource-symbolic-applicability-policy.d.ts +12 -0
- package/dist/lib/design-resource-symbolic-applicability-policy.js +79 -0
- package/dist/lib/design-resource-symbolic-applicability-profiles.d.ts +8 -0
- package/dist/lib/design-resource-symbolic-applicability-profiles.js +55 -0
- package/dist/lib/design-resource-symbolic-applicability-shape.d.ts +2 -0
- package/dist/lib/design-resource-symbolic-applicability-shape.js +76 -0
- package/dist/lib/design-resource-symbolic-applicability-validation.d.ts +7 -0
- package/dist/lib/design-resource-symbolic-applicability-validation.js +128 -0
- package/dist/lib/design-resource-symbolic-compilation.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-compilation.js +13 -0
- package/dist/lib/design-resource-symbolic-denotation.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-denotation.js +167 -0
- package/dist/lib/design-resource-symbolic-disposition-validation.d.ts +4 -0
- package/dist/lib/design-resource-symbolic-disposition-validation.js +28 -0
- package/dist/lib/design-resource-symbolic-fact-policy.d.ts +12 -0
- package/dist/lib/design-resource-symbolic-fact-policy.js +12 -0
- package/dist/lib/design-resource-symbolic-fact-shape.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-fact-shape.js +138 -0
- package/dist/lib/design-resource-symbolic-fact-types.d.ts +213 -0
- package/dist/lib/design-resource-symbolic-fact-types.js +1 -0
- package/dist/lib/design-resource-symbolic-fact-validation.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-fact-validation.js +86 -0
- package/dist/lib/design-resource-symbolic-indexes.d.ts +23 -0
- package/dist/lib/design-resource-symbolic-indexes.js +54 -0
- package/dist/lib/design-resource-symbolic-manifest-shape.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-manifest-shape.js +155 -0
- package/dist/lib/design-resource-symbolic-manifest-validation.d.ts +6 -0
- package/dist/lib/design-resource-symbolic-manifest-validation.js +132 -0
- package/dist/lib/design-resource-symbolic-noninterference-artifact.d.ts +33 -0
- package/dist/lib/design-resource-symbolic-noninterference-artifact.js +110 -0
- package/dist/lib/design-resource-symbolic-noninterference-equivalence.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-noninterference-equivalence.js +77 -0
- package/dist/lib/design-resource-symbolic-noninterference-recompute.d.ts +4 -0
- package/dist/lib/design-resource-symbolic-noninterference-recompute.js +146 -0
- package/dist/lib/design-resource-symbolic-noninterference-scope.d.ts +7 -0
- package/dist/lib/design-resource-symbolic-noninterference-scope.js +49 -0
- package/dist/lib/design-resource-symbolic-noninterference-shape.d.ts +2 -0
- package/dist/lib/design-resource-symbolic-noninterference-shape.js +152 -0
- package/dist/lib/design-resource-symbolic-noninterference-types.d.ts +103 -0
- package/dist/lib/design-resource-symbolic-noninterference-types.js +1 -0
- package/dist/lib/design-resource-symbolic-noninterference-validation.d.ts +5 -0
- package/dist/lib/design-resource-symbolic-noninterference-validation.js +62 -0
- package/dist/lib/design-resource-symbolic-oracle-fingerprint.d.ts +1 -0
- package/dist/lib/design-resource-symbolic-oracle-fingerprint.js +47 -0
- package/dist/lib/design-resource-symbolic-predicate-shape.d.ts +6 -0
- package/dist/lib/design-resource-symbolic-predicate-shape.js +123 -0
- package/dist/lib/design-resource-symbolic-production-closure.d.ts +4 -0
- package/dist/lib/design-resource-symbolic-production-closure.js +144 -0
- package/dist/lib/design-resource-symbolic-proof-authority-validation.d.ts +10 -0
- package/dist/lib/design-resource-symbolic-proof-authority-validation.js +68 -0
- package/dist/lib/design-resource-symbolic-proof-validation.d.ts +10 -0
- package/dist/lib/design-resource-symbolic-proof-validation.js +89 -0
- package/dist/lib/design-resource-symbolic-region-validation.d.ts +19 -0
- package/dist/lib/design-resource-symbolic-region-validation.js +146 -0
- package/dist/lib/design-resource-symbolic-resource-validation.d.ts +5 -0
- package/dist/lib/design-resource-symbolic-resource-validation.js +90 -0
- package/dist/lib/design-resource-symbolic-rule-shape.d.ts +27 -0
- package/dist/lib/design-resource-symbolic-rule-shape.js +158 -0
- package/dist/lib/design-resource-symbolic-safety-validation.d.ts +6 -0
- package/dist/lib/design-resource-symbolic-safety-validation.js +29 -0
- package/dist/lib/design-resource-symbolic-source-ir-evaluation.d.ts +19 -0
- package/dist/lib/design-resource-symbolic-source-ir-evaluation.js +74 -0
- package/dist/lib/design-resource-symbolic-source-ir-evidence.d.ts +44 -0
- package/dist/lib/design-resource-symbolic-source-ir-evidence.js +88 -0
- package/dist/lib/design-resource-symbolic-source-ir-oracle.d.ts +13 -0
- package/dist/lib/design-resource-symbolic-source-ir-oracle.js +96 -0
- package/dist/lib/design-resource-symbolic-source-ir-proof.d.ts +14 -0
- package/dist/lib/design-resource-symbolic-source-ir-proof.js +98 -0
- package/dist/lib/design-resource-symbolic-source-ir-shape.d.ts +2 -0
- package/dist/lib/design-resource-symbolic-source-ir-shape.js +38 -0
- package/dist/lib/design-resource-symbolic-source-ir-types.d.ts +17 -0
- package/dist/lib/design-resource-symbolic-source-ir-types.js +2 -0
- package/dist/lib/design-resource-symbolic-static-dependency-validation.d.ts +2 -0
- package/dist/lib/design-resource-symbolic-static-dependency-validation.js +83 -0
- package/dist/lib/design-resource-symbolic-structural-closure-validation.d.ts +6 -0
- package/dist/lib/design-resource-symbolic-structural-closure-validation.js +79 -0
- package/dist/lib/design-resource-symbolic-validation-support.d.ts +29 -0
- package/dist/lib/design-resource-symbolic-validation-support.js +111 -0
- package/dist/lib/design-resource-v1-capacity-header.d.ts +8 -0
- package/dist/lib/design-resource-v1-capacity-header.js +231 -0
- package/dist/lib/design-resource-v1-capacity.d.ts +5 -0
- package/dist/lib/design-resource-v1-capacity.js +45 -0
- package/dist/lib/init.js +1 -0
- package/dist/lib/long-task-acceptance-shape.js +8 -2
- package/dist/lib/long-task-activation-validation.js +13 -3
- package/dist/lib/long-task-admitted-observation-records.d.ts +25 -0
- package/dist/lib/long-task-admitted-observation-records.js +40 -0
- package/dist/lib/long-task-admitted-observation.d.ts +93 -0
- package/dist/lib/long-task-admitted-observation.js +201 -0
- package/dist/lib/long-task-artifacts.d.ts +1 -0
- package/dist/lib/long-task-artifacts.js +1 -0
- package/dist/lib/long-task-authority-material-diff.js +1 -0
- package/dist/lib/long-task-authority-policy.d.ts +5 -0
- package/dist/lib/long-task-authority-policy.js +5 -0
- package/dist/lib/long-task-authority-revision-details.js +3 -1
- package/dist/lib/long-task-authority.js +2 -1
- package/dist/lib/long-task-check-execution-policy.js +5 -0
- package/dist/lib/long-task-check-runner.d.ts +2 -2
- package/dist/lib/long-task-check-runner.js +440 -23
- package/dist/lib/long-task-claims.d.ts +18 -0
- package/dist/lib/long-task-claims.js +35 -0
- package/dist/lib/long-task-codex-agent-profile.d.ts +42 -0
- package/dist/lib/long-task-codex-agent-profile.js +276 -0
- package/dist/lib/long-task-compact-authoring-projections.d.ts +12 -0
- package/dist/lib/long-task-compact-authoring-projections.js +67 -0
- package/dist/lib/long-task-compact-authoring.d.ts +3 -0
- package/dist/lib/long-task-compact-authoring.js +173 -0
- package/dist/lib/long-task-compact-carrier.d.ts +7 -0
- package/dist/lib/long-task-compact-carrier.js +132 -0
- package/dist/lib/long-task-compact-parser.d.ts +14 -0
- package/dist/lib/long-task-compact-parser.js +123 -0
- package/dist/lib/long-task-compact-primitives.d.ts +22 -0
- package/dist/lib/long-task-compact-primitives.js +132 -0
- package/dist/lib/long-task-compact-projections.d.ts +4 -0
- package/dist/lib/long-task-compact-projections.js +153 -0
- package/dist/lib/long-task-compact-structure-targets.d.ts +2 -0
- package/dist/lib/long-task-compact-structure-targets.js +91 -0
- package/dist/lib/long-task-conformance-policy.js +3 -1
- package/dist/lib/long-task-counterfactual-claim-policy.d.ts +3 -4
- package/dist/lib/long-task-counterfactual-claim-policy.js +11 -3
- package/dist/lib/long-task-counterfactual-sandbox.d.ts +1 -1
- package/dist/lib/long-task-counterfactual-sandbox.js +8 -5
- package/dist/lib/long-task-counterfactual-types.d.ts +2 -0
- package/dist/lib/long-task-delivery-compiler.js +2 -0
- package/dist/lib/long-task-delivery-parser.d.ts +1 -0
- package/dist/lib/long-task-delivery-parser.js +38 -6
- package/dist/lib/long-task-design-resource-handoff.d.ts +2 -1
- package/dist/lib/long-task-design-resource-handoff.js +71 -11
- package/dist/lib/long-task-design-resource-method-binding.d.ts +8 -1
- package/dist/lib/long-task-design-resource-method-binding.js +150 -0
- package/dist/lib/long-task-evidence-capability-codec.js +256 -34
- package/dist/lib/long-task-evidence-capability-policy.d.ts +3 -2
- package/dist/lib/long-task-evidence-capability-policy.js +142 -8
- package/dist/lib/long-task-evidence-capability-runtime.d.ts +5 -2
- package/dist/lib/long-task-evidence-capability-runtime.js +420 -68
- package/dist/lib/long-task-evidence-capability-types.d.ts +70 -2
- package/dist/lib/long-task-evidence-sensitivity-policy.d.ts +9 -0
- package/dist/lib/long-task-evidence-sensitivity-policy.js +31 -1
- package/dist/lib/long-task-evidence-v2.d.ts +4 -4
- package/dist/lib/long-task-evidence-v2.js +322 -44
- package/dist/lib/long-task-exact-comparison.d.ts +16 -0
- package/dist/lib/long-task-exact-comparison.js +28 -0
- package/dist/lib/long-task-execution-observation.d.ts +24 -0
- package/dist/lib/long-task-execution-observation.js +332 -0
- package/dist/lib/long-task-explain-acceptance-link.d.ts +4 -0
- package/dist/lib/long-task-explain-acceptance-link.js +4 -0
- package/dist/lib/long-task-explain-claim-links.d.ts +2 -0
- package/dist/lib/long-task-explain-claim-links.js +2 -0
- package/dist/lib/long-task-explain-source-links.d.ts +6 -0
- package/dist/lib/long-task-final-v2.js +7 -4
- package/dist/lib/long-task-hook-install.d.ts +19 -2
- package/dist/lib/long-task-hook-install.js +288 -91
- package/dist/lib/long-task-json-pointer-observation.d.ts +59 -0
- package/dist/lib/long-task-json-pointer-observation.js +184 -0
- package/dist/lib/long-task-observation-artifact.d.ts +8 -0
- package/dist/lib/long-task-observation-artifact.js +58 -0
- package/dist/lib/long-task-observation-authority.d.ts +17 -0
- package/dist/lib/long-task-observation-authority.js +348 -0
- package/dist/lib/long-task-paths.js +1 -1
- package/dist/lib/long-task-playwright-capability-records.d.ts +2 -0
- package/dist/lib/long-task-playwright-capability-records.js +74 -2
- package/dist/lib/long-task-process-observation.d.ts +6 -0
- package/dist/lib/long-task-process-observation.js +117 -0
- package/dist/lib/long-task-process-runtime-closure.d.ts +13 -0
- package/dist/lib/long-task-process-runtime-closure.js +175 -0
- package/dist/lib/long-task-progress.js +2 -0
- package/dist/lib/long-task-protected-files.d.ts +1 -1
- package/dist/lib/long-task-protected-files.js +1 -30
- package/dist/lib/long-task-risk.js +8 -3
- package/dist/lib/long-task-root-shape.js +10 -1
- package/dist/lib/long-task-runner-environment.d.ts +1 -1
- package/dist/lib/long-task-runner-environment.js +4 -4
- package/dist/lib/long-task-runner-freeze.d.ts +4 -2
- package/dist/lib/long-task-runner-freeze.js +130 -28
- package/dist/lib/long-task-runtime-types.d.ts +111 -0
- package/dist/lib/long-task-scoped-binding.d.ts +13 -0
- package/dist/lib/long-task-scoped-binding.js +11 -0
- package/dist/lib/long-task-semantic-contract-types.d.ts +2 -1
- package/dist/lib/long-task-semantic-fact-binding-types.d.ts +8 -0
- package/dist/lib/long-task-semantic-fact-closure.js +4 -1
- package/dist/lib/long-task-semantic-fact-contract-closure.d.ts +1 -1
- package/dist/lib/long-task-semantic-fact-contract-closure.js +18 -6
- package/dist/lib/long-task-semantic-fact-contract-facts.d.ts +1 -1
- package/dist/lib/long-task-semantic-fact-contract-facts.js +4 -1
- package/dist/lib/long-task-semantic-fact-contract-proofs.d.ts +1 -1
- package/dist/lib/long-task-semantic-fact-contract-proofs.js +12 -3
- package/dist/lib/long-task-semantic-fact-evidence.d.ts +8 -4
- package/dist/lib/long-task-semantic-fact-evidence.js +103 -43
- package/dist/lib/long-task-semantic-fact-shape.js +17 -6
- package/dist/lib/long-task-shape-primitives.d.ts +1 -1
- package/dist/lib/long-task-shape-primitives.js +1 -0
- package/dist/lib/long-task-source-claim-validation.js +4 -1
- package/dist/lib/long-task-source-item-parser.d.ts +2 -2
- package/dist/lib/long-task-source-item-parser.js +20 -11
- package/dist/lib/long-task-source-target-continuity.d.ts +2 -2
- package/dist/lib/long-task-source-target-continuity.js +35 -2
- package/dist/lib/long-task-source-target-index.d.ts +3 -0
- package/dist/lib/long-task-source-target-index.js +19 -0
- package/dist/lib/long-task-stage-policy.js +10 -4
- package/dist/lib/long-task-static-observation-freeze.d.ts +83 -0
- package/dist/lib/long-task-static-observation-freeze.js +428 -0
- package/dist/lib/long-task-status-projection.js +5 -1
- package/dist/lib/long-task-target-policy.d.ts +1 -1
- package/dist/lib/long-task-target-policy.js +3 -0
- package/dist/lib/long-task-ui-design-policy.js +64 -4
- package/dist/lib/long-task-ui-surface-shape.js +195 -0
- package/dist/lib/long-task-ui-surface-types.d.ts +53 -0
- package/dist/lib/long-task-verifier-dependency-closure.js +7 -3
- package/dist/lib/long-task-verifier-v2.js +70 -9
- package/dist/lib/long-task-worker-selection.d.ts +2 -0
- package/dist/lib/long-task-worker-selection.js +7 -0
- package/dist/lib/long-task-workspace-scope.js +3 -1
- package/dist/lib/long-task-workspace.d.ts +1 -1
- package/dist/lib/long-task-workspace.js +12 -13
- package/dist/lib/migrations.js +58 -0
- package/dist/lib/profiles.js +0 -1
- package/dist/lib/repository-path-safety.d.ts +14 -0
- package/dist/lib/repository-path-safety.js +126 -0
- package/dist/lib/semantic-fact-compact-authoring.d.ts +2 -0
- package/dist/lib/semantic-fact-compact-authoring.js +160 -0
- package/dist/lib/semantic-fact-compact-capacity.d.ts +9 -0
- package/dist/lib/semantic-fact-compact-capacity.js +40 -0
- package/dist/lib/semantic-fact-compact-carrier.d.ts +16 -0
- package/dist/lib/semantic-fact-compact-carrier.js +146 -0
- package/dist/lib/semantic-fact-compact-parser.d.ts +17 -0
- package/dist/lib/semantic-fact-compact-parser.js +168 -0
- package/dist/lib/semantic-fact-compact-revision.d.ts +11 -0
- package/dist/lib/semantic-fact-compact-revision.js +64 -0
- package/dist/lib/semantic-fact-compact-support.d.ts +23 -0
- package/dist/lib/semantic-fact-compact-support.js +159 -0
- package/dist/lib/semantic-fact-policy-census.d.ts +1 -0
- package/dist/lib/semantic-fact-policy-census.js +43 -0
- 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/semantic-fact-source-parser.d.ts +5 -0
- package/dist/lib/semantic-fact-source-parser.js +47 -6
- package/dist/lib/structural-closure-cost.d.ts +79 -0
- package/dist/lib/structural-closure-cost.js +91 -0
- package/dist/lib/symbolic-denotation-dag-builder.d.ts +25 -0
- package/dist/lib/symbolic-denotation-dag-builder.js +176 -0
- package/dist/lib/symbolic-denotation-domain-validation.d.ts +3 -0
- package/dist/lib/symbolic-denotation-domain-validation.js +56 -0
- package/dist/lib/symbolic-denotation-engine.d.ts +32 -0
- package/dist/lib/symbolic-denotation-engine.js +140 -0
- package/dist/lib/symbolic-denotation-public.d.ts +11 -0
- package/dist/lib/symbolic-denotation-public.js +12 -0
- package/dist/lib/symbolic-denotation-runtime.d.ts +20 -0
- package/dist/lib/symbolic-denotation-runtime.js +90 -0
- package/dist/lib/symbolic-denotation-support.d.ts +11 -0
- package/dist/lib/symbolic-denotation-support.js +49 -0
- package/dist/lib/symbolic-denotation-types.d.ts +133 -0
- package/dist/lib/symbolic-denotation-types.js +18 -0
- package/dist/lib/symbolic-denotation-validation.d.ts +6 -0
- package/dist/lib/symbolic-denotation-validation.js +126 -0
- package/dist/lib/sync-engine.d.ts +1 -0
- package/dist/lib/sync-engine.js +4 -1
- package/dist/lib/upgrade.js +1 -0
- package/dist/long-task-hook.js +40 -1
- package/dist/public-types.d.ts +8 -0
- package/dist/public-types.js +1 -0
- package/dist/schemas/design-resource-symbolic-noninterference-artifact-v2.schema.json +289 -0
- package/dist/schemas/design-resource-symbolic-source-ir-v1.schema.json +130 -0
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +435 -5
- package/migrations/README.md +92 -15
- package/package.json +2 -2
- package/source-mappings.yaml +28 -25
- package/assets/skills/source-plan-authoring/SKILL.md +0 -14
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { sourceItemKeys, stableKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
|
|
2
|
+
import { array, literal, object, string, } from "./long-task-shape-primitives.js";
|
|
3
|
+
export function parseSymbolicStructuralApplicability(value, label) {
|
|
4
|
+
const root = object(value, label, [
|
|
5
|
+
"profile_catalog",
|
|
6
|
+
"subject_profile_bindings",
|
|
7
|
+
"inspector_custom_property_closure",
|
|
8
|
+
"instance_exceptions",
|
|
9
|
+
]);
|
|
10
|
+
return {
|
|
11
|
+
profile_catalog: literal(root.profile_catalog, ["package-subject-property-applicability-v1"], `${label}.profile_catalog`),
|
|
12
|
+
subject_profile_bindings: array(root.subject_profile_bindings, `${label}.subject_profile_bindings`).map((item, index) => parseProfileBinding(item, `${label}.subject_profile_bindings[${index}]`)),
|
|
13
|
+
inspector_custom_property_closure: array(root.inspector_custom_property_closure, `${label}.inspector_custom_property_closure`).map((item, index) => parseCustomPropertyClosure(item, `${label}.inspector_custom_property_closure[${index}]`)),
|
|
14
|
+
instance_exceptions: array(root.instance_exceptions, `${label}.instance_exceptions`).map((item, index) => parseInstanceException(item, `${label}.instance_exceptions[${index}]`)),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function parseProfileBinding(value, label) {
|
|
18
|
+
const row = object(value, label, [
|
|
19
|
+
"key",
|
|
20
|
+
"subject_refs",
|
|
21
|
+
"profile_refs",
|
|
22
|
+
"census_refs",
|
|
23
|
+
"source_item_refs",
|
|
24
|
+
"basis_refs",
|
|
25
|
+
"rationale",
|
|
26
|
+
]);
|
|
27
|
+
return {
|
|
28
|
+
key: stableKey(row.key, `${label}.key`),
|
|
29
|
+
subject_refs: stableKeys(row.subject_refs, `${label}.subject_refs`),
|
|
30
|
+
profile_refs: stableKeys(row.profile_refs, `${label}.profile_refs`),
|
|
31
|
+
census_refs: stableKeys(row.census_refs, `${label}.census_refs`),
|
|
32
|
+
source_item_refs: sourceItemKeys(row.source_item_refs, `${label}.source_item_refs`),
|
|
33
|
+
basis_refs: stableKeys(row.basis_refs, `${label}.basis_refs`),
|
|
34
|
+
rationale: string(row.rationale, `${label}.rationale`),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function parseCustomPropertyClosure(value, label) {
|
|
38
|
+
const row = object(value, label, [
|
|
39
|
+
"property_ref",
|
|
40
|
+
"applicable_subject_refs",
|
|
41
|
+
"census_refs",
|
|
42
|
+
"source_item_refs",
|
|
43
|
+
"basis_refs",
|
|
44
|
+
"rationale",
|
|
45
|
+
]);
|
|
46
|
+
return {
|
|
47
|
+
property_ref: stableKey(row.property_ref, `${label}.property_ref`),
|
|
48
|
+
applicable_subject_refs: stableKeys(row.applicable_subject_refs, `${label}.applicable_subject_refs`),
|
|
49
|
+
census_refs: stableKeys(row.census_refs, `${label}.census_refs`),
|
|
50
|
+
source_item_refs: sourceItemKeys(row.source_item_refs, `${label}.source_item_refs`),
|
|
51
|
+
basis_refs: stableKeys(row.basis_refs, `${label}.basis_refs`),
|
|
52
|
+
rationale: string(row.rationale, `${label}.rationale`),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function parseInstanceException(value, label) {
|
|
56
|
+
const row = object(value, label, [
|
|
57
|
+
"key",
|
|
58
|
+
"subject_ref",
|
|
59
|
+
"property_ref",
|
|
60
|
+
"disposition",
|
|
61
|
+
"census_refs",
|
|
62
|
+
"source_item_refs",
|
|
63
|
+
"basis_refs",
|
|
64
|
+
"rationale",
|
|
65
|
+
]);
|
|
66
|
+
return {
|
|
67
|
+
key: stableKey(row.key, `${label}.key`),
|
|
68
|
+
subject_ref: stableKey(row.subject_ref, `${label}.subject_ref`),
|
|
69
|
+
property_ref: stableKey(row.property_ref, `${label}.property_ref`),
|
|
70
|
+
disposition: literal(row.disposition, ["applicable", "not_applicable"], `${label}.disposition`),
|
|
71
|
+
census_refs: stableKeys(row.census_refs, `${label}.census_refs`),
|
|
72
|
+
source_item_refs: sourceItemKeys(row.source_item_refs, `${label}.source_item_refs`),
|
|
73
|
+
basis_refs: stableKeys(row.basis_refs, `${label}.basis_refs`),
|
|
74
|
+
rationale: string(row.rationale, `${label}.rationale`),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DesignResourceObservableRuleManifestV2 } from "./design-resource-symbolic-fact-types.js";
|
|
2
|
+
import type { SymbolicManifestIndexes } from "./design-resource-symbolic-indexes.js";
|
|
3
|
+
export interface SymbolicApplicabilityIndex {
|
|
4
|
+
mode: "legacy_physical_partitions" | "package_profiles";
|
|
5
|
+
isApplicable(subjectRef: string, propertyRef: string): boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildSymbolicApplicabilityIndex(manifest: DesignResourceObservableRuleManifestV2, indexes: SymbolicManifestIndexes): SymbolicApplicabilityIndex;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { DESIGN_RESOURCE_SYMBOLIC_APPLICABILITY_PROFILE_CATALOG, resolveSymbolicApplicabilityProfiles, } from "./design-resource-symbolic-applicability-profiles.js";
|
|
2
|
+
import { deriveRequiredSymbolicStandardApplicability } from "./design-resource-symbolic-applicability-policy.js";
|
|
3
|
+
import { validateSymbolicApplicabilityAuthorityRefs as validateAuthorityRefs } from "./design-resource-symbolic-applicability-authority.js";
|
|
4
|
+
import { assertSameSet, invalid, requireKnownRefs, unique, } from "./design-resource-symbolic-validation-support.js";
|
|
5
|
+
export function buildSymbolicApplicabilityIndex(manifest, indexes) {
|
|
6
|
+
const compact = manifest.structural_applicability;
|
|
7
|
+
if (!compact)
|
|
8
|
+
return {
|
|
9
|
+
mode: "legacy_physical_partitions",
|
|
10
|
+
isApplicable: () => true,
|
|
11
|
+
};
|
|
12
|
+
if (compact.profile_catalog !==
|
|
13
|
+
DESIGN_RESOURCE_SYMBOLIC_APPLICABILITY_PROFILE_CATALOG)
|
|
14
|
+
invalid("v2_applicability_profile_catalog_unknown", compact.profile_catalog);
|
|
15
|
+
const artifactRefs = new Set(manifest.noninterference_certificates.flatMap((certificate) => [
|
|
16
|
+
certificate.source_noninterference_proof,
|
|
17
|
+
certificate.production_noninterference_proof,
|
|
18
|
+
]
|
|
19
|
+
.filter((proof) => proof != null)
|
|
20
|
+
.map((proof) => proof.artifact_resource_ref)));
|
|
21
|
+
const { effective, expected } = validateProfileBindings(manifest, indexes, artifactRefs);
|
|
22
|
+
validateCustomPropertyClosure(manifest, indexes, effective, expected, artifactRefs);
|
|
23
|
+
validateInstanceExceptions(manifest, indexes, effective, expected, artifactRefs);
|
|
24
|
+
for (const subjectRef of indexes.subjects.keys())
|
|
25
|
+
assertSameSet([...(effective.get(subjectRef) ?? [])], [...(expected.get(subjectRef) ?? [])], "v2_applicability_package_derived_set_mismatch", subjectRef);
|
|
26
|
+
return {
|
|
27
|
+
mode: "package_profiles",
|
|
28
|
+
isApplicable(subjectRef, propertyRef) {
|
|
29
|
+
const properties = effective.get(subjectRef);
|
|
30
|
+
if (!properties)
|
|
31
|
+
invalid("v2_applicability_subject_unknown", subjectRef);
|
|
32
|
+
if (!indexes.properties.has(propertyRef))
|
|
33
|
+
invalid("v2_applicability_property_unknown", propertyRef);
|
|
34
|
+
return properties.has(propertyRef);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function validateProfileBindings(manifest, indexes, artifactRefs) {
|
|
39
|
+
const bindings = manifest.structural_applicability.subject_profile_bindings;
|
|
40
|
+
unique(bindings.map((binding) => binding.key), "v2_applicability_profile_binding_key_duplicate");
|
|
41
|
+
const boundSubjects = bindings.flatMap((binding) => binding.subject_refs);
|
|
42
|
+
unique(boundSubjects, "v2_applicability_subject_profile_ambiguous");
|
|
43
|
+
assertSameSet(boundSubjects, [...indexes.subjects.keys()], "v2_applicability_subject_profile_set_mismatch", manifest.target_key);
|
|
44
|
+
const effective = new Map();
|
|
45
|
+
const expected = new Map();
|
|
46
|
+
for (const binding of bindings) {
|
|
47
|
+
if (!binding.subject_refs.length || !binding.profile_refs.length)
|
|
48
|
+
invalid("v2_applicability_profile_binding_empty", binding.key);
|
|
49
|
+
validateAuthorityRefs(binding, indexes, artifactRefs, binding.key);
|
|
50
|
+
unique(binding.profile_refs, `v2_applicability_profile_ref_duplicate:${binding.key}`);
|
|
51
|
+
const properties = resolveSymbolicApplicabilityProfiles(binding.profile_refs, binding.key);
|
|
52
|
+
const subjectCensusRefs = binding.subject_refs.flatMap((subjectRef) => {
|
|
53
|
+
const subject = indexes.subjects.get(subjectRef);
|
|
54
|
+
if (!subject)
|
|
55
|
+
invalid("v2_applicability_profile_subject_unknown", subjectRef);
|
|
56
|
+
return subject.census_refs;
|
|
57
|
+
});
|
|
58
|
+
assertSameSet(binding.census_refs, subjectCensusRefs, "v2_applicability_subject_census_set_mismatch", binding.key);
|
|
59
|
+
for (const subjectRef of binding.subject_refs) {
|
|
60
|
+
const subject = indexes.subjects.get(subjectRef);
|
|
61
|
+
if (!subject)
|
|
62
|
+
invalid("v2_applicability_profile_subject_unknown", subjectRef);
|
|
63
|
+
const derived = deriveRequiredSymbolicStandardApplicability(subject, indexes.census);
|
|
64
|
+
for (const basisRef of derived.policy_basis_refs)
|
|
65
|
+
if (!binding.basis_refs.includes(basisRef))
|
|
66
|
+
invalid("v2_applicability_package_policy_basis_missing", `${binding.key}:${subjectRef}:${basisRef}`);
|
|
67
|
+
effective.set(subjectRef, new Set(properties));
|
|
68
|
+
expected.set(subjectRef, new Set(derived.property_refs));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { effective, expected };
|
|
72
|
+
}
|
|
73
|
+
function validateCustomPropertyClosure(manifest, indexes, effective, expected, artifactRefs) {
|
|
74
|
+
const rows = manifest.structural_applicability.inspector_custom_property_closure;
|
|
75
|
+
unique(rows.map((row) => row.property_ref), "v2_custom_property_closure_duplicate");
|
|
76
|
+
const customProperties = manifest.properties.filter((property) => !property.standard);
|
|
77
|
+
assertSameSet(rows.map((row) => row.property_ref), customProperties.map((property) => property.key), "v2_custom_property_closure_set_mismatch", manifest.target_key);
|
|
78
|
+
for (const row of rows) {
|
|
79
|
+
const property = indexes.properties.get(row.property_ref);
|
|
80
|
+
if (!property || property.standard)
|
|
81
|
+
invalid("v2_custom_property_closure_property_unknown", row.property_ref);
|
|
82
|
+
validateAuthorityRefs(row, indexes, artifactRefs, row.property_ref);
|
|
83
|
+
requireKnownRefs(row.applicable_subject_refs, indexes.subjects, "v2_custom_property_subject_unknown");
|
|
84
|
+
unique(row.applicable_subject_refs, `v2_custom_property_subject_duplicate:${row.property_ref}`);
|
|
85
|
+
assertSameSet(row.census_refs, property.census_refs, "v2_custom_property_census_set_mismatch", row.property_ref);
|
|
86
|
+
for (const censusRef of row.census_refs) {
|
|
87
|
+
const census = indexes.census.get(censusRef);
|
|
88
|
+
if (census?.kind !== "custom_property" ||
|
|
89
|
+
census.disposition !== "covered")
|
|
90
|
+
invalid("v2_custom_property_census_authority_invalid", `${row.property_ref}:${censusRef}`);
|
|
91
|
+
}
|
|
92
|
+
for (const subjectRef of row.applicable_subject_refs)
|
|
93
|
+
for (const index of [effective, expected])
|
|
94
|
+
index.get(subjectRef).add(row.property_ref);
|
|
95
|
+
}
|
|
96
|
+
assertSameSet(rows.flatMap((row) => row.census_refs), manifest.inspector.census
|
|
97
|
+
.filter((row) => row.kind === "custom_property")
|
|
98
|
+
.map((row) => row.key), "v2_custom_property_census_closure_mismatch", manifest.target_key);
|
|
99
|
+
}
|
|
100
|
+
function validateInstanceExceptions(manifest, indexes, effective, expected, artifactRefs) {
|
|
101
|
+
const exceptions = manifest.structural_applicability.instance_exceptions;
|
|
102
|
+
unique(exceptions.map((item) => item.key), "v2_applicability_exception_key_duplicate");
|
|
103
|
+
const tupleKeys = exceptions.map((item) => `${item.subject_ref}\u0000${item.property_ref}`);
|
|
104
|
+
unique(tupleKeys, "v2_applicability_exception_tuple_duplicate");
|
|
105
|
+
for (const exception of exceptions) {
|
|
106
|
+
const subject = indexes.subjects.get(exception.subject_ref);
|
|
107
|
+
if (!subject)
|
|
108
|
+
invalid("v2_applicability_exception_subject_unknown", exception.key);
|
|
109
|
+
const property = indexes.properties.get(exception.property_ref);
|
|
110
|
+
if (!property)
|
|
111
|
+
invalid("v2_applicability_exception_property_unknown", exception.key);
|
|
112
|
+
validateAuthorityRefs(exception, indexes, artifactRefs, exception.key);
|
|
113
|
+
assertSameSet(exception.census_refs, [...subject.census_refs, ...property.census_refs], "v2_applicability_exception_census_set_mismatch", exception.key);
|
|
114
|
+
const properties = effective.get(exception.subject_ref);
|
|
115
|
+
const requestedApplicability = exception.disposition === "applicable";
|
|
116
|
+
if (properties.has(exception.property_ref) === requestedApplicability)
|
|
117
|
+
invalid("v2_applicability_exception_noop", exception.key);
|
|
118
|
+
if (exception.disposition === "applicable")
|
|
119
|
+
properties.add(exception.property_ref);
|
|
120
|
+
else
|
|
121
|
+
properties.delete(exception.property_ref);
|
|
122
|
+
const expectedProperties = expected.get(exception.subject_ref);
|
|
123
|
+
if (exception.disposition === "applicable")
|
|
124
|
+
expectedProperties.add(exception.property_ref);
|
|
125
|
+
else
|
|
126
|
+
expectedProperties.delete(exception.property_ref);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DesignResourceObservableRuleManifestV2 } from "./design-resource-symbolic-fact-types.js";
|
|
2
|
+
export declare function createDesignResourceSymbolicCompilationSession(manifest: DesignResourceObservableRuleManifestV2): import("./symbolic-denotation-engine.js").SymbolicDenotationCompilationSession;
|
|
3
|
+
export type DesignResourceSymbolicCompilationSession = ReturnType<typeof createDesignResourceSymbolicCompilationSession>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSymbolicDenotationCompilationSession } from "./symbolic-denotation-engine.js";
|
|
2
|
+
export function createDesignResourceSymbolicCompilationSession(manifest) {
|
|
3
|
+
return createSymbolicDenotationCompilationSession(manifest.axis_domains, [
|
|
4
|
+
manifest.reachable_region,
|
|
5
|
+
...manifest.fact_rules.map((rule) => rule.region),
|
|
6
|
+
...manifest.disposition_regions.map((row) => row.region),
|
|
7
|
+
...manifest.populations.flatMap((population) => population.exclusions.map((exclusion) => exclusion.region)),
|
|
8
|
+
...manifest.noninterference_certificates.flatMap((certificate) => [certificate.production_noninterference_proof].flatMap((proof) => proof?.equivalence_cases.flatMap((item) => [
|
|
9
|
+
item.side_predicate,
|
|
10
|
+
item.axis_erased_predicate,
|
|
11
|
+
]) ?? [])),
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DesignResourceHandoffPreflightV2 } from "./design-resource-symbolic-fact-types.js";
|
|
2
|
+
import type { SymbolicExtensionalPointV1, SymbolicPointDenotationV1 } from "./symbolic-denotation-types.js";
|
|
3
|
+
export declare function denoteDesignResourceSymbolicPoint(preflight: DesignResourceHandoffPreflightV2, point: SymbolicExtensionalPointV1): SymbolicPointDenotationV1;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { buildSymbolicApplicabilityIndex } from "./design-resource-symbolic-applicability-validation.js";
|
|
2
|
+
import { createDesignResourceSymbolicCompilationSession } from "./design-resource-symbolic-compilation.js";
|
|
3
|
+
import { buildSymbolicManifestIndexes, symbolicSemanticTupleKey, } from "./design-resource-symbolic-indexes.js";
|
|
4
|
+
import { evaluateCanonicalSymbolicDenotation } from "./symbolic-denotation-engine.js";
|
|
5
|
+
const queryIndexCache = new WeakMap();
|
|
6
|
+
export function denoteDesignResourceSymbolicPoint(preflight, point) {
|
|
7
|
+
const manifest = preflight.manifest;
|
|
8
|
+
const assignment = {
|
|
9
|
+
...point.condition_assignment,
|
|
10
|
+
...point.variation_assignment,
|
|
11
|
+
};
|
|
12
|
+
validateCompleteAssignment(manifest.axis_domains, assignment);
|
|
13
|
+
const query = queryIndex(preflight);
|
|
14
|
+
validatePointTupleAuthority(preflight, query.indexes, point);
|
|
15
|
+
const reachable = query.reachable;
|
|
16
|
+
if (!evaluateCanonicalSymbolicDenotation(reachable.canonical_dag, assignment))
|
|
17
|
+
invalid("extensional_point_unreachable", pointIdentity(point));
|
|
18
|
+
if (!query.applicability.isApplicable(point.subject_or_relation_ref, point.property_ref))
|
|
19
|
+
return {
|
|
20
|
+
disposition: "not_applicable",
|
|
21
|
+
expected_semantics: null,
|
|
22
|
+
proof_obligations: [],
|
|
23
|
+
};
|
|
24
|
+
const tupleKey = symbolicSemanticTupleKey(point);
|
|
25
|
+
const rules = (query.rulesByTuple.get(tupleKey) ?? []).filter((projection) => evaluateCanonicalSymbolicDenotation(projection.compiled_region.canonical_dag, assignment));
|
|
26
|
+
const dispositions = (query.dispositionsByTuple.get(tupleKey) ?? []).filter((projection) => evaluateCanonicalSymbolicDenotation(projection.compiled.canonical_dag, assignment));
|
|
27
|
+
if (rules.length + dispositions.length !== 1)
|
|
28
|
+
invalid("extensional_point_effective_region_invalid", `${pointIdentity(point)}:rules=${rules.length}:dispositions=${dispositions.length}`);
|
|
29
|
+
if (dispositions.length)
|
|
30
|
+
return {
|
|
31
|
+
disposition: dispositions[0].row.disposition,
|
|
32
|
+
expected_semantics: null,
|
|
33
|
+
proof_obligations: [],
|
|
34
|
+
};
|
|
35
|
+
const rule = rules[0].rule;
|
|
36
|
+
const obligations = rule.semantic_obligation_refs
|
|
37
|
+
.map((ref) => query.indexes.obligations.get(ref))
|
|
38
|
+
.map((obligation) => {
|
|
39
|
+
if (!obligation)
|
|
40
|
+
invalid("semantic_obligation_unknown", rule.key);
|
|
41
|
+
const oracle = query.indexes.oracles.get(obligation.oracle_ref);
|
|
42
|
+
const environment = query.indexes.environments.get(obligation.environment_ref);
|
|
43
|
+
if (!oracle || !environment)
|
|
44
|
+
invalid("semantic_obligation_authority_unknown", obligation.key);
|
|
45
|
+
return {
|
|
46
|
+
method: obligation.method,
|
|
47
|
+
proof_surface: obligation.proof_surface,
|
|
48
|
+
observation_boundary: obligation.observation_boundary,
|
|
49
|
+
comparison: structuredClone(obligation.comparison),
|
|
50
|
+
oracle: structuredClone(oracle),
|
|
51
|
+
environment: structuredClone(environment),
|
|
52
|
+
protected_value_policy: obligation.protected_value_policy,
|
|
53
|
+
completion_effect: obligation.completion_effect,
|
|
54
|
+
};
|
|
55
|
+
})
|
|
56
|
+
.sort((left, right) => compareText(left.method, right.method));
|
|
57
|
+
return {
|
|
58
|
+
disposition: "specified",
|
|
59
|
+
expected_semantics: {
|
|
60
|
+
value_type: rule.value_kind,
|
|
61
|
+
expected: structuredClone(rule.expected),
|
|
62
|
+
provenance_ref: rule.provenance_ref,
|
|
63
|
+
sensitivity: rule.observation_sensitivity,
|
|
64
|
+
population_ref: rule.population_ref,
|
|
65
|
+
quantifier: structuredClone(rule.quantifier),
|
|
66
|
+
lineage: structuredClone(rule.lineage),
|
|
67
|
+
},
|
|
68
|
+
proof_obligations: obligations,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function validatePointTupleAuthority(preflight, indexes, point) {
|
|
72
|
+
const manifest = preflight.manifest;
|
|
73
|
+
const subject = indexes.subjects.get(point.subject_or_relation_ref);
|
|
74
|
+
if (!subject || point.target_ref !== manifest.target_key)
|
|
75
|
+
invalid("extensional_point_subject_target_unknown", pointIdentity(point));
|
|
76
|
+
if (!indexes.properties.has(point.property_ref))
|
|
77
|
+
invalid("extensional_point_property_unknown", point.property_ref);
|
|
78
|
+
const expectedQuantifier = subject.population_ref
|
|
79
|
+
? indexes.populations.get(subject.population_ref)?.quantifier
|
|
80
|
+
: { kind: "one", minimum: 1, maximum: 1 };
|
|
81
|
+
if (point.population_ref !== subject.population_ref ||
|
|
82
|
+
canonicalJson(point.quantifier) !== canonicalJson(expectedQuantifier))
|
|
83
|
+
invalid("extensional_point_population_quantifier_mismatch", pointIdentity(point));
|
|
84
|
+
}
|
|
85
|
+
function queryIndex(preflight) {
|
|
86
|
+
const cached = queryIndexCache.get(preflight);
|
|
87
|
+
if (cached)
|
|
88
|
+
return cached;
|
|
89
|
+
const built = buildQueryIndex(preflight);
|
|
90
|
+
queryIndexCache.set(preflight, built);
|
|
91
|
+
return built;
|
|
92
|
+
}
|
|
93
|
+
function buildQueryIndex(preflight) {
|
|
94
|
+
const indexes = buildSymbolicManifestIndexes(preflight.manifest, preflight);
|
|
95
|
+
const applicability = buildSymbolicApplicabilityIndex(preflight.manifest, indexes);
|
|
96
|
+
const compilation = createDesignResourceSymbolicCompilationSession(preflight.manifest);
|
|
97
|
+
const rulesByTuple = new Map();
|
|
98
|
+
for (const projection of preflight.rule_projections) {
|
|
99
|
+
const key = symbolicSemanticTupleKey(projection.rule);
|
|
100
|
+
const values = rulesByTuple.get(key);
|
|
101
|
+
if (values)
|
|
102
|
+
values.push(projection);
|
|
103
|
+
else
|
|
104
|
+
rulesByTuple.set(key, [projection]);
|
|
105
|
+
}
|
|
106
|
+
const dispositionsByTuple = new Map();
|
|
107
|
+
for (const row of preflight.manifest.disposition_regions) {
|
|
108
|
+
const key = symbolicSemanticTupleKey(row);
|
|
109
|
+
const projection = { row, compiled: compilation.compile(row.region) };
|
|
110
|
+
const values = dispositionsByTuple.get(key);
|
|
111
|
+
if (values)
|
|
112
|
+
values.push(projection);
|
|
113
|
+
else
|
|
114
|
+
dispositionsByTuple.set(key, [projection]);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
indexes,
|
|
118
|
+
applicability,
|
|
119
|
+
rulesByTuple,
|
|
120
|
+
dispositionsByTuple,
|
|
121
|
+
reachable: compilation.compile(preflight.manifest.reachable_region),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function validateCompleteAssignment(domains, assignment) {
|
|
125
|
+
const actual = Object.keys(assignment).sort(compareText);
|
|
126
|
+
const expected = domains.map((domain) => domain.key).sort(compareText);
|
|
127
|
+
if (actual.length !== expected.length ||
|
|
128
|
+
actual.some((key, index) => key !== expected[index]))
|
|
129
|
+
invalid("extensional_assignment_axis_set_mismatch", `${actual.join(",")}:${expected.join(",")}`);
|
|
130
|
+
for (const domain of domains) {
|
|
131
|
+
const value = assignment[domain.key];
|
|
132
|
+
if (domain.kind === "enum"
|
|
133
|
+
? typeof value !== "string" || !domain.values.includes(value)
|
|
134
|
+
: typeof value !== "number" ||
|
|
135
|
+
!Number.isSafeInteger(value) ||
|
|
136
|
+
value < domain.minimum ||
|
|
137
|
+
value > domain.maximum)
|
|
138
|
+
invalid("extensional_assignment_value_outside_domain", `${domain.key}:${String(value)}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function pointIdentity(point) {
|
|
142
|
+
return [
|
|
143
|
+
point.subject_or_relation_ref,
|
|
144
|
+
point.target_ref,
|
|
145
|
+
point.property_ref,
|
|
146
|
+
point.population_ref ?? "none",
|
|
147
|
+
canonicalJson(point.quantifier),
|
|
148
|
+
canonicalJson(point.condition_assignment),
|
|
149
|
+
canonicalJson(point.variation_assignment),
|
|
150
|
+
].join(":");
|
|
151
|
+
}
|
|
152
|
+
function canonicalJson(value) {
|
|
153
|
+
if (Array.isArray(value))
|
|
154
|
+
return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
|
|
155
|
+
if (value && typeof value === "object")
|
|
156
|
+
return `{${Object.entries(value)
|
|
157
|
+
.sort(([left], [right]) => compareText(left, right))
|
|
158
|
+
.map(([key, entry]) => `${JSON.stringify(key)}:${canonicalJson(entry)}`)
|
|
159
|
+
.join(",")}}`;
|
|
160
|
+
return JSON.stringify(value);
|
|
161
|
+
}
|
|
162
|
+
function compareText(left, right) {
|
|
163
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
164
|
+
}
|
|
165
|
+
function invalid(code, detail) {
|
|
166
|
+
throw new Error(`design_resource_symbolic_denotation_invalid:${code}:${detail}`);
|
|
167
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DesignResourceObservableRuleManifestV2 } from "./design-resource-symbolic-fact-types.js";
|
|
2
|
+
import type { DesignResourceSymbolicCompilationSession } from "./design-resource-symbolic-compilation.js";
|
|
3
|
+
import type { SymbolicManifestIndexes } from "./design-resource-symbolic-indexes.js";
|
|
4
|
+
export declare function validateSymbolicDispositions(manifest: DesignResourceObservableRuleManifestV2, targetKey: string, indexes: SymbolicManifestIndexes, compilation: DesignResourceSymbolicCompilationSession): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { assertNoUnprovedOmittedAxes } from "./design-resource-symbolic-safety-validation.js";
|
|
2
|
+
import { validateSymbolicPopulationAndQuantifier, validateSymbolicRegionWithinReachable, } from "./design-resource-symbolic-region-validation.js";
|
|
3
|
+
import { invalid, requireKnownRefs, unique, } from "./design-resource-symbolic-validation-support.js";
|
|
4
|
+
export function validateSymbolicDispositions(manifest, targetKey, indexes, compilation) {
|
|
5
|
+
for (const disposition of manifest.disposition_regions) {
|
|
6
|
+
const subject = indexes.subjects.get(disposition.subject_or_relation_ref);
|
|
7
|
+
if (!subject)
|
|
8
|
+
invalid("v2_disposition_subject_unknown", disposition.key);
|
|
9
|
+
if (!indexes.properties.has(disposition.property_ref))
|
|
10
|
+
invalid("v2_disposition_property_unknown", disposition.key);
|
|
11
|
+
if (disposition.target_ref !== targetKey)
|
|
12
|
+
invalid("v2_disposition_target_mismatch", disposition.key);
|
|
13
|
+
validateSymbolicPopulationAndQuantifier(disposition, subject.population_ref, indexes.populations);
|
|
14
|
+
if (!disposition.basis_refs.length || !disposition.source_item_refs.length)
|
|
15
|
+
invalid("v2_disposition_basis_source_required", disposition.key);
|
|
16
|
+
unique(disposition.census_refs, `v2_disposition_census_duplicate:${disposition.key}`);
|
|
17
|
+
unique(disposition.source_item_refs, `v2_disposition_source_item_duplicate:${disposition.key}`);
|
|
18
|
+
unique(disposition.basis_refs, `v2_disposition_basis_duplicate:${disposition.key}`);
|
|
19
|
+
requireKnownRefs(disposition.census_refs, indexes.census, "v2_disposition_census_unknown");
|
|
20
|
+
requireKnownRefs(disposition.source_item_refs, indexes.sourceItems, "v2_disposition_source_item_unknown");
|
|
21
|
+
validateSymbolicRegionWithinReachable(disposition.region, manifest.reachable_region, disposition.key, compilation);
|
|
22
|
+
assertNoUnprovedOmittedAxes(compilation.compile(disposition.region), disposition.key);
|
|
23
|
+
if (disposition.disposition === "decision_required" ||
|
|
24
|
+
disposition.disposition === "unavailable" ||
|
|
25
|
+
disposition.disposition === "blocking")
|
|
26
|
+
invalid("v2_unresolved_disposition", `${disposition.key}:${disposition.disposition}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY: {
|
|
2
|
+
readonly symbolic_denotation_efficiency_delivery: true;
|
|
3
|
+
readonly control_relations_unchanged: true;
|
|
4
|
+
readonly forbidden_symbolic_shortcuts_absent: true;
|
|
5
|
+
readonly symbolic_inventory_is_not_completion: true;
|
|
6
|
+
readonly v1_capacity: {
|
|
7
|
+
readonly embedded_handoff_max_bytes: 8388608;
|
|
8
|
+
readonly canonical_manifest_max_bytes: 33554432;
|
|
9
|
+
readonly expected_fact_cells_max: 16384;
|
|
10
|
+
readonly capacity_header_prefix_max_bytes: 65536;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const DESIGN_RESOURCE_SYMBOLIC_FACT_POLICY = {
|
|
2
|
+
symbolic_denotation_efficiency_delivery: true,
|
|
3
|
+
control_relations_unchanged: true,
|
|
4
|
+
forbidden_symbolic_shortcuts_absent: true,
|
|
5
|
+
symbolic_inventory_is_not_completion: true,
|
|
6
|
+
v1_capacity: {
|
|
7
|
+
embedded_handoff_max_bytes: 8_388_608,
|
|
8
|
+
canonical_manifest_max_bytes: 33_554_432,
|
|
9
|
+
expected_fact_cells_max: 16_384,
|
|
10
|
+
capacity_header_prefix_max_bytes: 65_536,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DesignResourceHandoffV2 } from "./design-resource-symbolic-fact-types.js";
|
|
2
|
+
export { parseDesignResourceObservableRuleManifestJson, parseDesignResourceObservableRuleManifestShape, } from "./design-resource-symbolic-manifest-shape.js";
|
|
3
|
+
export declare function parseDesignResourceSymbolicHandoffShape(value: unknown): DesignResourceHandoffV2;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { parseDesignResourceHandoffResources } from "./design-resource-handoff-shape-structure.js";
|
|
2
|
+
import { contractKey, sourceItemKeys, stableKey, stableKeys, } from "./design-resource-handoff-shape-primitives.js";
|
|
3
|
+
import { array, literal, object, repositoryFile, string, strings, } from "./long-task-shape-primitives.js";
|
|
4
|
+
export { parseDesignResourceObservableRuleManifestJson, parseDesignResourceObservableRuleManifestShape, } from "./design-resource-symbolic-manifest-shape.js";
|
|
5
|
+
export function parseDesignResourceSymbolicHandoffShape(value) {
|
|
6
|
+
const label = "design_resource_handoff_v2";
|
|
7
|
+
const root = object(value, label, [
|
|
8
|
+
"schema_version",
|
|
9
|
+
"representation",
|
|
10
|
+
"intent",
|
|
11
|
+
"scope",
|
|
12
|
+
"provenance",
|
|
13
|
+
"resources",
|
|
14
|
+
"targets",
|
|
15
|
+
"coverage",
|
|
16
|
+
"proposal",
|
|
17
|
+
]);
|
|
18
|
+
return {
|
|
19
|
+
schema_version: literal(root.schema_version, ["design-resource-handoff-v2"], `${label}.schema_version`),
|
|
20
|
+
representation: literal(root.representation, ["symbolic_rules_v2"], `${label}.representation`),
|
|
21
|
+
intent: literal(root.intent, ["implementation_handoff"], `${label}.intent`),
|
|
22
|
+
scope: parseScope(root.scope, label),
|
|
23
|
+
provenance: parseProvenance(root.provenance, label),
|
|
24
|
+
resources: parseDesignResourceHandoffResources(root.resources),
|
|
25
|
+
targets: parseTargets(root.targets, label),
|
|
26
|
+
coverage: parseCoverage(root.coverage, label),
|
|
27
|
+
proposal: parseProposal(root.proposal, label),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function parseScope(value, label) {
|
|
31
|
+
const row = object(value, `${label}.scope`, [
|
|
32
|
+
"key",
|
|
33
|
+
"style_dependency",
|
|
34
|
+
"surface_keys",
|
|
35
|
+
"necessary_context",
|
|
36
|
+
"exclusions",
|
|
37
|
+
]);
|
|
38
|
+
return {
|
|
39
|
+
key: contractKey(row.key, `${label}.scope.key`),
|
|
40
|
+
style_dependency: literal(row.style_dependency, ["style-bearing", "non-fidelity", "mixed"], `${label}.scope.style_dependency`),
|
|
41
|
+
surface_keys: stableKeys(row.surface_keys, `${label}.scope.surface_keys`),
|
|
42
|
+
necessary_context: strings(row.necessary_context, `${label}.scope.necessary_context`),
|
|
43
|
+
exclusions: strings(row.exclusions, `${label}.scope.exclusions`),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function parseProvenance(value, label) {
|
|
47
|
+
const row = object(value, `${label}.provenance`, [
|
|
48
|
+
"provider",
|
|
49
|
+
"provider_version",
|
|
50
|
+
"project",
|
|
51
|
+
"run",
|
|
52
|
+
"capability",
|
|
53
|
+
"agent",
|
|
54
|
+
"model",
|
|
55
|
+
"design_system_id",
|
|
56
|
+
]);
|
|
57
|
+
return {
|
|
58
|
+
provider: string(row.provider, `${label}.provenance.provider`),
|
|
59
|
+
provider_version: string(row.provider_version, `${label}.provenance.provider_version`),
|
|
60
|
+
project: string(row.project, `${label}.provenance.project`),
|
|
61
|
+
run: string(row.run, `${label}.provenance.run`),
|
|
62
|
+
capability: string(row.capability, `${label}.provenance.capability`),
|
|
63
|
+
agent: string(row.agent, `${label}.provenance.agent`),
|
|
64
|
+
model: string(row.model, `${label}.provenance.model`),
|
|
65
|
+
design_system_id: string(row.design_system_id, `${label}.provenance.design_system_id`),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function parseTargets(value, label) {
|
|
69
|
+
return array(value, `${label}.targets`).map((item, index) => {
|
|
70
|
+
const itemLabel = `${label}.targets[${index}]`;
|
|
71
|
+
const row = object(item, itemLabel, [
|
|
72
|
+
"key",
|
|
73
|
+
"interpretation",
|
|
74
|
+
"resource_refs",
|
|
75
|
+
"source_profile",
|
|
76
|
+
"selection_basis",
|
|
77
|
+
]);
|
|
78
|
+
const profile = object(row.source_profile, `${itemLabel}.source_profile`, [
|
|
79
|
+
"kind",
|
|
80
|
+
"entry_resource_ref",
|
|
81
|
+
"dependency_resource_refs",
|
|
82
|
+
"fact_manifest_resource_ref",
|
|
83
|
+
"acquisition",
|
|
84
|
+
]);
|
|
85
|
+
return {
|
|
86
|
+
key: contractKey(row.key, `${itemLabel}.key`),
|
|
87
|
+
interpretation: literal(row.interpretation, ["exact_target", "constraint"], `${itemLabel}.interpretation`),
|
|
88
|
+
resource_refs: stableKeys(row.resource_refs, `${itemLabel}.resource_refs`),
|
|
89
|
+
source_profile: {
|
|
90
|
+
kind: literal(profile.kind, ["implementation_web", "implementation_app", "reference"], `${itemLabel}.source_profile.kind`),
|
|
91
|
+
entry_resource_ref: stableKey(profile.entry_resource_ref, `${itemLabel}.source_profile.entry_resource_ref`),
|
|
92
|
+
dependency_resource_refs: stableKeys(profile.dependency_resource_refs, `${itemLabel}.source_profile.dependency_resource_refs`),
|
|
93
|
+
fact_manifest_resource_ref: stableKey(profile.fact_manifest_resource_ref, `${itemLabel}.source_profile.fact_manifest_resource_ref`),
|
|
94
|
+
acquisition: literal(profile.acquisition, ["complete"], `${itemLabel}.source_profile.acquisition`),
|
|
95
|
+
},
|
|
96
|
+
selection_basis: string(row.selection_basis, `${itemLabel}.selection_basis`),
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function parseCoverage(value, label) {
|
|
101
|
+
return array(value, `${label}.coverage`).map((item, index) => {
|
|
102
|
+
const itemLabel = `${label}.coverage[${index}]`;
|
|
103
|
+
const row = object(item, itemLabel, [
|
|
104
|
+
"key",
|
|
105
|
+
"target_ref",
|
|
106
|
+
"subject_or_relation_refs",
|
|
107
|
+
"property_refs",
|
|
108
|
+
"fact_rule_refs",
|
|
109
|
+
"semantic_obligation_refs",
|
|
110
|
+
"certificate_refs",
|
|
111
|
+
"source_item_refs",
|
|
112
|
+
"rationale",
|
|
113
|
+
]);
|
|
114
|
+
return {
|
|
115
|
+
key: stableKey(row.key, `${itemLabel}.key`),
|
|
116
|
+
target_ref: contractKey(row.target_ref, `${itemLabel}.target_ref`),
|
|
117
|
+
subject_or_relation_refs: stableKeys(row.subject_or_relation_refs, `${itemLabel}.subject_or_relation_refs`),
|
|
118
|
+
property_refs: stableKeys(row.property_refs, `${itemLabel}.property_refs`),
|
|
119
|
+
fact_rule_refs: stableKeys(row.fact_rule_refs, `${itemLabel}.fact_rule_refs`),
|
|
120
|
+
semantic_obligation_refs: stableKeys(row.semantic_obligation_refs, `${itemLabel}.semantic_obligation_refs`),
|
|
121
|
+
certificate_refs: stableKeys(row.certificate_refs, `${itemLabel}.certificate_refs`),
|
|
122
|
+
source_item_refs: sourceItemKeys(row.source_item_refs, `${itemLabel}.source_item_refs`),
|
|
123
|
+
rationale: string(row.rationale, `${itemLabel}.rationale`),
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function parseProposal(value, label) {
|
|
128
|
+
const row = object(value, `${label}.proposal`, [
|
|
129
|
+
"reconciliation_status",
|
|
130
|
+
"path",
|
|
131
|
+
"revision",
|
|
132
|
+
]);
|
|
133
|
+
return {
|
|
134
|
+
reconciliation_status: literal(row.reconciliation_status, ["applied", "returned", "not_applicable"], `${label}.proposal.reconciliation_status`),
|
|
135
|
+
path: repositoryFile(row.path, `${label}.proposal.path`),
|
|
136
|
+
revision: string(row.revision, `${label}.proposal.revision`),
|
|
137
|
+
};
|
|
138
|
+
}
|