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
|
@@ -183,39 +183,11 @@ function decodeRecord(value, index) {
|
|
|
183
183
|
cold_start: row.cold_start,
|
|
184
184
|
};
|
|
185
185
|
case "design_method":
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
"method",
|
|
192
|
-
"cells",
|
|
193
|
-
]);
|
|
194
|
-
return {
|
|
195
|
-
...base,
|
|
196
|
-
capability,
|
|
197
|
-
design_target_ref: key(row.design_target_ref, `${label}.design_target_ref`),
|
|
198
|
-
target_ref: key(row.target_ref, `${label}.target_ref`),
|
|
199
|
-
method: literal(row.method, DESIGN_RESOURCE_VERIFICATION_METHODS, `${label}.method`),
|
|
200
|
-
cells: array(row.cells, `${label}.cells`).map((item, cellIndex) => {
|
|
201
|
-
const cellLabel = `${label}.cells[${cellIndex}]`;
|
|
202
|
-
const cell = record(item, cellLabel);
|
|
203
|
-
exact(cell, cellLabel, [
|
|
204
|
-
"condition_key",
|
|
205
|
-
"artifact_path",
|
|
206
|
-
"observation_artifact_path",
|
|
207
|
-
"fact_refs",
|
|
208
|
-
"fact_results",
|
|
209
|
-
]);
|
|
210
|
-
return {
|
|
211
|
-
condition_key: key(cell.condition_key, `${cellLabel}.condition_key`),
|
|
212
|
-
artifact_path: nonEmpty(cell.artifact_path, `${cellLabel}.artifact_path`),
|
|
213
|
-
observation_artifact_path: nonEmpty(cell.observation_artifact_path, `${cellLabel}.observation_artifact_path`),
|
|
214
|
-
fact_refs: designFactRefs(cell.fact_refs, `${cellLabel}.fact_refs`),
|
|
215
|
-
fact_results: array(cell.fact_results, `${cellLabel}.fact_results`).map((result, resultIndex) => decodeDesignFactResult(result, `${cellLabel}.fact_results[${resultIndex}]`)),
|
|
216
|
-
};
|
|
217
|
-
}),
|
|
218
|
-
};
|
|
186
|
+
return Object.hasOwn(row, "fact_model")
|
|
187
|
+
? decodeSymbolicDesignMethodEvidence(row, label, base)
|
|
188
|
+
: decodeGroundDesignMethodEvidence(row, label, base);
|
|
189
|
+
case "design_symbolic_certificate":
|
|
190
|
+
return decodeDesignSymbolicCertificateEvidence(row, label, base);
|
|
219
191
|
case "semantic_fact":
|
|
220
192
|
return decodeSemanticFactEvidence(row, label, base);
|
|
221
193
|
case "input_variation":
|
|
@@ -224,6 +196,217 @@ function decodeRecord(value, index) {
|
|
|
224
196
|
throw invalidRecord(`${label}.capability_unsupported:${capability}`);
|
|
225
197
|
}
|
|
226
198
|
}
|
|
199
|
+
function decodeGroundDesignMethodEvidence(row, label, base) {
|
|
200
|
+
exact(row, label, [
|
|
201
|
+
"assertion_key",
|
|
202
|
+
"capability",
|
|
203
|
+
"design_target_ref",
|
|
204
|
+
"target_ref",
|
|
205
|
+
"method",
|
|
206
|
+
"cells",
|
|
207
|
+
]);
|
|
208
|
+
return {
|
|
209
|
+
...base,
|
|
210
|
+
capability: "design_method",
|
|
211
|
+
design_target_ref: key(row.design_target_ref, `${label}.design_target_ref`),
|
|
212
|
+
target_ref: key(row.target_ref, `${label}.target_ref`),
|
|
213
|
+
method: literal(row.method, DESIGN_RESOURCE_VERIFICATION_METHODS, `${label}.method`),
|
|
214
|
+
cells: array(row.cells, `${label}.cells`).map((item, cellIndex) => {
|
|
215
|
+
const cellLabel = `${label}.cells[${cellIndex}]`;
|
|
216
|
+
const cell = record(item, cellLabel);
|
|
217
|
+
exact(cell, cellLabel, [
|
|
218
|
+
"condition_key",
|
|
219
|
+
"artifact_path",
|
|
220
|
+
"observation_artifact_path",
|
|
221
|
+
"fact_refs",
|
|
222
|
+
"fact_results",
|
|
223
|
+
]);
|
|
224
|
+
return {
|
|
225
|
+
condition_key: key(cell.condition_key, `${cellLabel}.condition_key`),
|
|
226
|
+
artifact_path: nonEmpty(cell.artifact_path, `${cellLabel}.artifact_path`),
|
|
227
|
+
observation_artifact_path: nonEmpty(cell.observation_artifact_path, `${cellLabel}.observation_artifact_path`),
|
|
228
|
+
fact_refs: designFactRefs(cell.fact_refs, `${cellLabel}.fact_refs`),
|
|
229
|
+
fact_results: array(cell.fact_results, `${cellLabel}.fact_results`).map((result, resultIndex) => decodeDesignFactResult(result, `${cellLabel}.fact_results[${resultIndex}]`)),
|
|
230
|
+
};
|
|
231
|
+
}),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function decodeSymbolicDesignMethodEvidence(row, label, base) {
|
|
235
|
+
exact(row, label, [
|
|
236
|
+
"assertion_key",
|
|
237
|
+
"capability",
|
|
238
|
+
"fact_model",
|
|
239
|
+
"design_target_ref",
|
|
240
|
+
"target_ref",
|
|
241
|
+
"method",
|
|
242
|
+
"artifact_path",
|
|
243
|
+
"observation_artifact_path",
|
|
244
|
+
"rule_results",
|
|
245
|
+
]);
|
|
246
|
+
return {
|
|
247
|
+
...base,
|
|
248
|
+
capability: "design_method",
|
|
249
|
+
fact_model: literal(row.fact_model, ["symbolic_rules_v2"], `${label}.fact_model`),
|
|
250
|
+
design_target_ref: key(row.design_target_ref, `${label}.design_target_ref`),
|
|
251
|
+
target_ref: key(row.target_ref, `${label}.target_ref`),
|
|
252
|
+
method: literal(row.method, DESIGN_RESOURCE_VERIFICATION_METHODS, `${label}.method`),
|
|
253
|
+
artifact_path: nonEmpty(row.artifact_path, `${label}.artifact_path`),
|
|
254
|
+
observation_artifact_path: nonEmpty(row.observation_artifact_path, `${label}.observation_artifact_path`),
|
|
255
|
+
rule_results: array(row.rule_results, `${label}.rule_results`).map((item, index) => decodeDesignSymbolicRuleResult(item, `${label}.rule_results[${index}]`)),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function decodeDesignSymbolicRuleResult(value, label) {
|
|
259
|
+
const row = record(value, label);
|
|
260
|
+
exact(row, label, [
|
|
261
|
+
"obligation_ref",
|
|
262
|
+
"fact_rule_ref",
|
|
263
|
+
"region_sha256",
|
|
264
|
+
"subject_or_relation_ref",
|
|
265
|
+
"property_ref",
|
|
266
|
+
"population_ref",
|
|
267
|
+
"quantifier",
|
|
268
|
+
"actual_observation",
|
|
269
|
+
"actual_environment",
|
|
270
|
+
"observation_sensitivity",
|
|
271
|
+
"expected",
|
|
272
|
+
"proof_surface",
|
|
273
|
+
"observation_boundary",
|
|
274
|
+
"comparison",
|
|
275
|
+
"verdict",
|
|
276
|
+
"oracle",
|
|
277
|
+
"environment",
|
|
278
|
+
"protected_value_policy",
|
|
279
|
+
"completion_effect",
|
|
280
|
+
]);
|
|
281
|
+
const decoded = decodeDesignFactResult({
|
|
282
|
+
fact_ref: row.fact_rule_ref,
|
|
283
|
+
subject_ref: row.subject_or_relation_ref,
|
|
284
|
+
variation_ref: "symbolic",
|
|
285
|
+
property_ref: row.property_ref,
|
|
286
|
+
actual_observation: row.actual_observation,
|
|
287
|
+
actual_environment: row.actual_environment,
|
|
288
|
+
expected: row.expected,
|
|
289
|
+
comparison: row.comparison,
|
|
290
|
+
verdict: row.verdict,
|
|
291
|
+
oracle: row.oracle,
|
|
292
|
+
environment: row.environment,
|
|
293
|
+
}, label);
|
|
294
|
+
const quantifier = record(row.quantifier, `${label}.quantifier`);
|
|
295
|
+
exact(quantifier, `${label}.quantifier`, ["kind", "minimum", "maximum"]);
|
|
296
|
+
return {
|
|
297
|
+
obligation_ref: designFactRef(row.obligation_ref, `${label}.obligation_ref`),
|
|
298
|
+
fact_rule_ref: decoded.fact_ref,
|
|
299
|
+
region_sha256: sha(row.region_sha256, `${label}.region_sha256`),
|
|
300
|
+
subject_or_relation_ref: decoded.subject_ref,
|
|
301
|
+
property_ref: decoded.property_ref,
|
|
302
|
+
population_ref: nullable(row.population_ref, (item) => designFactRef(item, `${label}.population_ref`)),
|
|
303
|
+
quantifier: {
|
|
304
|
+
kind: literal(quantifier.kind, [
|
|
305
|
+
"one",
|
|
306
|
+
"all",
|
|
307
|
+
"any",
|
|
308
|
+
"none",
|
|
309
|
+
"exactly",
|
|
310
|
+
"at_least",
|
|
311
|
+
"at_most",
|
|
312
|
+
"range",
|
|
313
|
+
], `${label}.quantifier.kind`),
|
|
314
|
+
minimum: nullable(quantifier.minimum, (item) => nonnegativeInteger(item, `${label}.quantifier.minimum`)),
|
|
315
|
+
maximum: nullable(quantifier.maximum, (item) => nonnegativeInteger(item, `${label}.quantifier.maximum`)),
|
|
316
|
+
},
|
|
317
|
+
actual_observation: decoded.actual_observation,
|
|
318
|
+
actual_environment: decoded.actual_environment,
|
|
319
|
+
observation_sensitivity: literal(row.observation_sensitivity, ["plain", "protected"], `${label}.observation_sensitivity`),
|
|
320
|
+
expected: decoded.expected,
|
|
321
|
+
proof_surface: nonEmpty(row.proof_surface, `${label}.proof_surface`),
|
|
322
|
+
observation_boundary: nonEmpty(row.observation_boundary, `${label}.observation_boundary`),
|
|
323
|
+
comparison: decoded.comparison,
|
|
324
|
+
verdict: decoded.verdict,
|
|
325
|
+
oracle: decoded.oracle,
|
|
326
|
+
environment: decoded.environment,
|
|
327
|
+
protected_value_policy: nonEmpty(row.protected_value_policy, `${label}.protected_value_policy`),
|
|
328
|
+
completion_effect: nonEmpty(row.completion_effect, `${label}.completion_effect`),
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function decodeDesignSymbolicCertificateEvidence(row, label, base) {
|
|
332
|
+
exact(row, label, [
|
|
333
|
+
"assertion_key",
|
|
334
|
+
"capability",
|
|
335
|
+
"design_target_ref",
|
|
336
|
+
"target_ref",
|
|
337
|
+
"artifact_path",
|
|
338
|
+
"artifact_sha256",
|
|
339
|
+
"metrics",
|
|
340
|
+
"certificate_results",
|
|
341
|
+
]);
|
|
342
|
+
const metrics = record(row.metrics, `${label}.metrics`);
|
|
343
|
+
exact(metrics, `${label}.metrics`, [
|
|
344
|
+
"semantic_obligations",
|
|
345
|
+
"certificate_obligations",
|
|
346
|
+
"certificate_covered_omitted_axes",
|
|
347
|
+
"certificate_covered_dependency_edges",
|
|
348
|
+
"canonical_dag_nodes",
|
|
349
|
+
"canonical_partition_edges",
|
|
350
|
+
"canonical_bytes",
|
|
351
|
+
"theoretical_ground_cardinality",
|
|
352
|
+
]);
|
|
353
|
+
return {
|
|
354
|
+
...base,
|
|
355
|
+
capability: "design_symbolic_certificate",
|
|
356
|
+
design_target_ref: key(row.design_target_ref, `${label}.design_target_ref`),
|
|
357
|
+
target_ref: key(row.target_ref, `${label}.target_ref`),
|
|
358
|
+
artifact_path: nonEmpty(row.artifact_path, `${label}.artifact_path`),
|
|
359
|
+
artifact_sha256: sha(row.artifact_sha256, `${label}.artifact_sha256`),
|
|
360
|
+
metrics: {
|
|
361
|
+
semantic_obligations: nonnegativeInteger(metrics.semantic_obligations, `${label}.metrics.semantic_obligations`),
|
|
362
|
+
certificate_obligations: nonnegativeInteger(metrics.certificate_obligations, `${label}.metrics.certificate_obligations`),
|
|
363
|
+
certificate_covered_omitted_axes: nonnegativeInteger(metrics.certificate_covered_omitted_axes, `${label}.metrics.certificate_covered_omitted_axes`),
|
|
364
|
+
certificate_covered_dependency_edges: nonnegativeInteger(metrics.certificate_covered_dependency_edges, `${label}.metrics.certificate_covered_dependency_edges`),
|
|
365
|
+
canonical_dag_nodes: nonnegativeInteger(metrics.canonical_dag_nodes, `${label}.metrics.canonical_dag_nodes`),
|
|
366
|
+
canonical_partition_edges: nonnegativeInteger(metrics.canonical_partition_edges, `${label}.metrics.canonical_partition_edges`),
|
|
367
|
+
canonical_bytes: nonnegativeInteger(metrics.canonical_bytes, `${label}.metrics.canonical_bytes`),
|
|
368
|
+
theoretical_ground_cardinality: decimalCardinality(metrics.theoretical_ground_cardinality, `${label}.metrics.theoretical_ground_cardinality`),
|
|
369
|
+
},
|
|
370
|
+
certificate_results: array(row.certificate_results, `${label}.certificate_results`).map((item, index) => {
|
|
371
|
+
const itemLabel = `${label}.certificate_results[${index}]`;
|
|
372
|
+
const result = record(item, itemLabel);
|
|
373
|
+
exact(result, itemLabel, [
|
|
374
|
+
"certificate_ref",
|
|
375
|
+
"fact_rule_refs",
|
|
376
|
+
"omitted_axis_refs",
|
|
377
|
+
"dependency_edge_refs",
|
|
378
|
+
"canonical_rule_dag_sha256",
|
|
379
|
+
"recomputed",
|
|
380
|
+
"verdict",
|
|
381
|
+
...[
|
|
382
|
+
"source_noninterference_proof_sha256",
|
|
383
|
+
"production_noninterference_proof_sha256",
|
|
384
|
+
].filter((field) => Object.hasOwn(result, field)),
|
|
385
|
+
]);
|
|
386
|
+
if (result.recomputed !== true)
|
|
387
|
+
throw invalidRecord(`${itemLabel}.recomputed`);
|
|
388
|
+
return {
|
|
389
|
+
certificate_ref: designFactRef(result.certificate_ref, `${itemLabel}.certificate_ref`),
|
|
390
|
+
fact_rule_refs: designFactRefs(result.fact_rule_refs, `${itemLabel}.fact_rule_refs`),
|
|
391
|
+
omitted_axis_refs: designFactRefs(result.omitted_axis_refs, `${itemLabel}.omitted_axis_refs`),
|
|
392
|
+
dependency_edge_refs: designFactRefs(result.dependency_edge_refs, `${itemLabel}.dependency_edge_refs`),
|
|
393
|
+
canonical_rule_dag_sha256: sha(result.canonical_rule_dag_sha256, `${itemLabel}.canonical_rule_dag_sha256`),
|
|
394
|
+
...(result.source_noninterference_proof_sha256 === undefined
|
|
395
|
+
? {}
|
|
396
|
+
: {
|
|
397
|
+
source_noninterference_proof_sha256: sha(result.source_noninterference_proof_sha256, `${itemLabel}.source_noninterference_proof_sha256`),
|
|
398
|
+
}),
|
|
399
|
+
...(result.production_noninterference_proof_sha256 === undefined
|
|
400
|
+
? {}
|
|
401
|
+
: {
|
|
402
|
+
production_noninterference_proof_sha256: sha(result.production_noninterference_proof_sha256, `${itemLabel}.production_noninterference_proof_sha256`),
|
|
403
|
+
}),
|
|
404
|
+
recomputed: true,
|
|
405
|
+
verdict: literal(result.verdict, ["passed", "failed"], `${itemLabel}.verdict`),
|
|
406
|
+
};
|
|
407
|
+
}),
|
|
408
|
+
};
|
|
409
|
+
}
|
|
227
410
|
function decodeInputVariationEvidence(row, label, base) {
|
|
228
411
|
exact(row, label, [
|
|
229
412
|
"assertion_key",
|
|
@@ -249,7 +432,7 @@ function decodeInputVariationEvidence(row, label, base) {
|
|
|
249
432
|
};
|
|
250
433
|
}
|
|
251
434
|
function decodeSemanticFactEvidence(row, label, base) {
|
|
252
|
-
|
|
435
|
+
exactOptional(row, label, [
|
|
253
436
|
"assertion_key",
|
|
254
437
|
"capability",
|
|
255
438
|
"manifest_ref",
|
|
@@ -270,7 +453,21 @@ function decodeSemanticFactEvidence(row, label, base) {
|
|
|
270
453
|
"oracle",
|
|
271
454
|
"environment",
|
|
272
455
|
"observer_results",
|
|
456
|
+
], [
|
|
457
|
+
"fact_key",
|
|
458
|
+
"fact_revision_digest",
|
|
459
|
+
"obligation_key",
|
|
460
|
+
"obligation_revision_digest",
|
|
273
461
|
]);
|
|
462
|
+
const revisionFields = [
|
|
463
|
+
"fact_key",
|
|
464
|
+
"fact_revision_digest",
|
|
465
|
+
"obligation_key",
|
|
466
|
+
"obligation_revision_digest",
|
|
467
|
+
];
|
|
468
|
+
const revisionFieldCount = revisionFields.filter((field) => Object.hasOwn(row, field)).length;
|
|
469
|
+
if (revisionFieldCount !== 0 && revisionFieldCount !== revisionFields.length)
|
|
470
|
+
throw invalidRecord(`${label}.revision_identity.shape`);
|
|
274
471
|
const actual = record(row.actual_observation, `${label}.actual_observation`);
|
|
275
472
|
exact(actual, `${label}.actual_observation`, [
|
|
276
473
|
"artifact_path",
|
|
@@ -320,6 +517,14 @@ function decodeSemanticFactEvidence(row, label, base) {
|
|
|
320
517
|
manifest_sha256: sha(row.manifest_sha256, `${label}.manifest_sha256`),
|
|
321
518
|
outcome_ref: semanticFactRef(row.outcome_ref, `${label}.outcome_ref`),
|
|
322
519
|
target_ref: key(row.target_ref, `${label}.target_ref`),
|
|
520
|
+
...(revisionFieldCount
|
|
521
|
+
? {
|
|
522
|
+
fact_key: semanticFactRef(row.fact_key, `${label}.fact_key`),
|
|
523
|
+
fact_revision_digest: sha(row.fact_revision_digest, `${label}.fact_revision_digest`),
|
|
524
|
+
obligation_key: semanticFactRef(row.obligation_key, `${label}.obligation_key`),
|
|
525
|
+
obligation_revision_digest: sha(row.obligation_revision_digest, `${label}.obligation_revision_digest`),
|
|
526
|
+
}
|
|
527
|
+
: {}),
|
|
323
528
|
fact_ref: semanticFactRef(row.fact_ref, `${label}.fact_ref`),
|
|
324
529
|
proof_ref: semanticFactRef(row.proof_ref, `${label}.proof_ref`),
|
|
325
530
|
method: semanticFactRef(row.method, `${label}.method`),
|
|
@@ -611,6 +816,12 @@ function exact(row, label, fields) {
|
|
|
611
816
|
Object.keys(row).some((field) => !allowed.has(field)))
|
|
612
817
|
throw invalidRecord(`${label}.shape`);
|
|
613
818
|
}
|
|
819
|
+
function exactOptional(row, label, required, optional) {
|
|
820
|
+
const allowed = new Set([...required, ...optional]);
|
|
821
|
+
if (required.some((field) => !Object.hasOwn(row, field)) ||
|
|
822
|
+
Object.keys(row).some((field) => !allowed.has(field)))
|
|
823
|
+
throw invalidRecord(`${label}.shape`);
|
|
824
|
+
}
|
|
614
825
|
function array(value, label) {
|
|
615
826
|
if (!Array.isArray(value))
|
|
616
827
|
throw invalidRecord(label);
|
|
@@ -621,6 +832,17 @@ function nonEmpty(value, label) {
|
|
|
621
832
|
throw invalidRecord(label);
|
|
622
833
|
return value;
|
|
623
834
|
}
|
|
835
|
+
function nonnegativeInteger(value, label) {
|
|
836
|
+
if (!Number.isSafeInteger(value) || value < 0)
|
|
837
|
+
throw invalidRecord(label);
|
|
838
|
+
return value;
|
|
839
|
+
}
|
|
840
|
+
function decimalCardinality(value, label) {
|
|
841
|
+
const result = nonEmpty(value, label);
|
|
842
|
+
if (!/^(0|[1-9][0-9]*)$/u.test(result))
|
|
843
|
+
throw invalidRecord(label);
|
|
844
|
+
return result;
|
|
845
|
+
}
|
|
624
846
|
function key(value, label) {
|
|
625
847
|
const result = nonEmpty(value, label);
|
|
626
848
|
if (!/^[a-z0-9][a-z0-9-]*$/u.test(result))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CompiledCheckV2, DeliveryContractV2, EvidenceCapabilityRecordV2, LongTaskFindingV2 } from "./long-task-delivery-types.js";
|
|
1
|
+
import type { CompiledCheckV2, DeliveryContractV2, EvidenceCapabilityRecordV2, LongTaskFindingV2, RawCommandExecutionV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import { type PreparedAdmittedObservationSet } from "./long-task-admitted-observation.js";
|
|
2
3
|
export { decodeEvidenceCapabilityRecords } from "./long-task-evidence-capability-codec.js";
|
|
3
4
|
type Reporter = (message: string) => void;
|
|
4
5
|
export declare function validateEvidenceCapabilityDeclarations(contract: DeliveryContractV2, report?: Reporter): void;
|
|
5
|
-
export declare function evaluateEvidenceCapabilities(check: CompiledCheckV2, records: EvidenceCapabilityRecordV2[], artifactHashes: Record<string, string
|
|
6
|
+
export declare function evaluateEvidenceCapabilities(check: CompiledCheckV2, records: EvidenceCapabilityRecordV2[], artifactHashes: Record<string, string>, admittedObservations?: PreparedAdmittedObservationSet, rawExecution?: RawCommandExecutionV2): {
|
|
6
7
|
complete: Record<string, boolean>;
|
|
7
8
|
findings: LongTaskFindingV2[];
|
|
8
9
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { validateRuntimeEvidenceRecord } from "./long-task-evidence-capability-runtime.js";
|
|
2
2
|
import { validateDistinctSemanticFactEvidence } from "./long-task-semantic-fact-evidence.js";
|
|
3
3
|
import { checkFinding } from "./long-task-evidence-findings.js";
|
|
4
|
+
import { admittedObservationAuthorityKey, } from "./long-task-admitted-observation.js";
|
|
4
5
|
export { decodeEvidenceCapabilityRecords } from "./long-task-evidence-capability-codec.js";
|
|
5
6
|
export function validateEvidenceCapabilityDeclarations(contract, report) {
|
|
6
7
|
const targets = new Map(contract.task.execution_targets.map((target) => [target.key, target]));
|
|
@@ -45,6 +46,9 @@ function validateArtifactCapabilityDeclarations(assertion, check, label, report)
|
|
|
45
46
|
if (assertion.evidence_capabilities.includes("design_method") &&
|
|
46
47
|
!check.artifact_globs.length)
|
|
47
48
|
issue(report, "design_method_artifact_required", label);
|
|
49
|
+
if (assertion.evidence_capabilities.includes("design_symbolic_certificate") &&
|
|
50
|
+
!check.artifact_globs.length)
|
|
51
|
+
issue(report, "design_symbolic_certificate_artifact_required", label);
|
|
48
52
|
if (assertion.evidence_capabilities.includes("semantic_fact") &&
|
|
49
53
|
!check.artifact_globs.length)
|
|
50
54
|
issue(report, "semantic_fact_artifact_required", label);
|
|
@@ -58,6 +62,7 @@ function validateRunnerCapabilityDeclarations(assertion, check, targets, label,
|
|
|
58
62
|
capability !== "interaction_trace" &&
|
|
59
63
|
capability !== "design_conformance" &&
|
|
60
64
|
capability !== "design_method" &&
|
|
65
|
+
capability !== "design_symbolic_certificate" &&
|
|
61
66
|
capability !== "semantic_fact" &&
|
|
62
67
|
capability !== "target_runtime"))
|
|
63
68
|
issue(report, "playwright_evidence_capability_unsupported", label);
|
|
@@ -96,7 +101,7 @@ function validateJourneySeparation(contract, report) {
|
|
|
96
101
|
}
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
|
-
export function evaluateEvidenceCapabilities(check, records, artifactHashes) {
|
|
104
|
+
export function evaluateEvidenceCapabilities(check, records, artifactHashes, admittedObservations, rawExecution) {
|
|
100
105
|
const runtimeRecords = records ?? [];
|
|
101
106
|
const complete = {};
|
|
102
107
|
const findings = [];
|
|
@@ -125,15 +130,22 @@ export function evaluateEvidenceCapabilities(check, records, artifactHashes) {
|
|
|
125
130
|
for (const assertion of assertions) {
|
|
126
131
|
let assertionComplete = true;
|
|
127
132
|
for (const capability of assertion.evidence_capabilities) {
|
|
128
|
-
if (capability === "presence")
|
|
129
|
-
continue;
|
|
130
133
|
const matches = runtimeRecords.filter((record) => record.assertion_key === assertion.key &&
|
|
131
134
|
record.capability === capability);
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
const derived = packageDerivedCapability(check, assertion.key, capability, admittedObservations, rawExecution);
|
|
136
|
+
const submittedReason = matches.length === 1
|
|
137
|
+
? validateRuntimeEvidenceRecord(check, matches[0], artifactHashes, admittedObservations, rawExecution?.host_execution_attestation ?? null)
|
|
138
|
+
: matches.length > 1
|
|
139
|
+
? "record_duplicate"
|
|
140
|
+
: null;
|
|
141
|
+
const reason = submittedReason ??
|
|
142
|
+
(derived.supported
|
|
143
|
+
? derived.reason
|
|
144
|
+
: capability === "presence"
|
|
145
|
+
? null
|
|
146
|
+
: matches.length === 0
|
|
147
|
+
? "record_missing"
|
|
148
|
+
: null);
|
|
137
149
|
if (!reason)
|
|
138
150
|
continue;
|
|
139
151
|
assertionComplete = false;
|
|
@@ -145,6 +157,22 @@ export function evaluateEvidenceCapabilities(check, records, artifactHashes) {
|
|
|
145
157
|
actual: reason,
|
|
146
158
|
});
|
|
147
159
|
}
|
|
160
|
+
const authorityIssues = assertionObservationAuthorityIssues(check, assertion.key, assertion.claims.length > 0, admittedObservations);
|
|
161
|
+
if (authorityIssues.length) {
|
|
162
|
+
assertionComplete = false;
|
|
163
|
+
for (const authorityIssue of authorityIssues) {
|
|
164
|
+
findings.push({
|
|
165
|
+
...checkFinding(check, "evidence_capability_invalid", `Assertion ${assertion.key} has no complete package-admitted current-Actual chain for ${authorityIssue.obligation_ref ?? "an unplanned machine obligation"}: ${authorityIssue.reason}.`, "Bind every machine-closing or liveness-preserving obligation to its compiled package observation authority, or move unsupported observation to an explicit blocking External Confirmation."),
|
|
166
|
+
assertion_key: assertion.key,
|
|
167
|
+
claim_keys: assertion.claims,
|
|
168
|
+
expected: {
|
|
169
|
+
authority: authorityIssue.authority,
|
|
170
|
+
obligation_ref: authorityIssue.obligation_ref,
|
|
171
|
+
},
|
|
172
|
+
actual: authorityIssue.reason,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
148
176
|
complete[assertion.key] = assertionComplete;
|
|
149
177
|
}
|
|
150
178
|
validateDistinctDesignMethodArtifacts(check, runtimeRecords, artifactHashes, findings);
|
|
@@ -155,14 +183,105 @@ export function evaluateEvidenceCapabilities(check, records, artifactHashes) {
|
|
|
155
183
|
expected: "unique_fact_proof_and_artifact_locator_identity",
|
|
156
184
|
actual: semanticDistinctness,
|
|
157
185
|
});
|
|
186
|
+
for (const entry of admittedObservations?.entries ?? [])
|
|
187
|
+
if (!entry.authority_key && entry.reason)
|
|
188
|
+
findings.push({
|
|
189
|
+
...checkFinding(check, "evidence_capability_invalid", `A package observation was not bound to the compiled observation plan: ${entry.identity_ref}:${entry.reason}.`, "Emit only the exact identity set selected by the Harness-owned compiled observation plan."),
|
|
190
|
+
expected: "compiled_observation_identity",
|
|
191
|
+
actual: entry.identity_ref,
|
|
192
|
+
});
|
|
158
193
|
return { complete, findings };
|
|
159
194
|
}
|
|
195
|
+
function packageDerivedCapability(check, assertionKey, capability, admitted, raw) {
|
|
196
|
+
const authorities = (check.observation_authorities ?? []).filter((authority) => authority.assertion_ref === assertionKey);
|
|
197
|
+
const supported = capability === "presence" ||
|
|
198
|
+
capability === "semantic_fact" ||
|
|
199
|
+
capability === "design_method" ||
|
|
200
|
+
capability === "target_runtime";
|
|
201
|
+
if (!supported || !authorities.length)
|
|
202
|
+
return { supported: false, reason: null };
|
|
203
|
+
for (const authority of authorities) {
|
|
204
|
+
if (authority.authority === "external_confirmation")
|
|
205
|
+
return {
|
|
206
|
+
supported: true,
|
|
207
|
+
reason: "unsupported_observer_requires_external_confirmation",
|
|
208
|
+
};
|
|
209
|
+
const prepared = admitted?.by_authority_key.get(admittedObservationAuthorityKey(authority));
|
|
210
|
+
if (!prepared)
|
|
211
|
+
return { supported: true, reason: "admitted_observation_missing" };
|
|
212
|
+
if (prepared.reason)
|
|
213
|
+
return { supported: true, reason: prepared.reason };
|
|
214
|
+
if (!prepared.observation || !prepared.comparison)
|
|
215
|
+
return { supported: true, reason: "admitted_observation_missing" };
|
|
216
|
+
}
|
|
217
|
+
const processRequired = capability === "target_runtime" ||
|
|
218
|
+
authorities.some((authority) => authority.authority === "package_process_json_exact");
|
|
219
|
+
if (processRequired) {
|
|
220
|
+
const attestation = raw?.host_execution_attestation;
|
|
221
|
+
if (!attestation)
|
|
222
|
+
return { supported: true, reason: "host_attestation_required" };
|
|
223
|
+
if (!attestation.direct_root_match ||
|
|
224
|
+
attestation.raw_execution_identity !== check.raw_execution_identity ||
|
|
225
|
+
!attestation.snapshot_sha256 ||
|
|
226
|
+
!check.process_runtime_closure ||
|
|
227
|
+
attestation.process_runtime_closure_identity !==
|
|
228
|
+
check.process_runtime_closure.closure_identity ||
|
|
229
|
+
attestation.exit_code !== 0 ||
|
|
230
|
+
attestation.exit_code !== raw?.exit_code)
|
|
231
|
+
return { supported: true, reason: "host_attestation_mismatch" };
|
|
232
|
+
}
|
|
233
|
+
return { supported: true, reason: null };
|
|
234
|
+
}
|
|
235
|
+
function assertionObservationAuthorityIssues(check, assertionKey, machineClosing, admitted) {
|
|
236
|
+
const authorities = (check.observation_authorities ?? []).filter((authority) => authority.assertion_ref === assertionKey);
|
|
237
|
+
if (!authorities.length)
|
|
238
|
+
return machineClosing
|
|
239
|
+
? [
|
|
240
|
+
{
|
|
241
|
+
obligation_ref: null,
|
|
242
|
+
authority: null,
|
|
243
|
+
reason: "machine_observer_not_admitted",
|
|
244
|
+
},
|
|
245
|
+
]
|
|
246
|
+
: [];
|
|
247
|
+
const issues = [];
|
|
248
|
+
for (const authority of authorities) {
|
|
249
|
+
let reason = null;
|
|
250
|
+
if (authority.authority === "external_confirmation")
|
|
251
|
+
reason = "unsupported_observer_requires_external_confirmation";
|
|
252
|
+
else if (!admitted)
|
|
253
|
+
reason = "admitted_observation_runtime_required";
|
|
254
|
+
else {
|
|
255
|
+
const authorityKey = admittedObservationAuthorityKey(authority);
|
|
256
|
+
const prepared = admitted.by_authority_key.get(authorityKey);
|
|
257
|
+
reason =
|
|
258
|
+
prepared?.reason ??
|
|
259
|
+
(prepared?.observation ? null : "admitted_observation_missing");
|
|
260
|
+
}
|
|
261
|
+
if (reason)
|
|
262
|
+
issues.push({
|
|
263
|
+
obligation_ref: authority.obligation_ref,
|
|
264
|
+
authority: authority.authority,
|
|
265
|
+
reason,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
return issues;
|
|
269
|
+
}
|
|
160
270
|
function validateDistinctDesignMethodArtifacts(check, records, artifactHashes, findings) {
|
|
161
271
|
const pathOwners = new Map();
|
|
162
272
|
const digestOwners = new Map();
|
|
163
273
|
for (const record of records) {
|
|
274
|
+
if (record.capability === "design_symbolic_certificate") {
|
|
275
|
+
addDistinctArtifact(check, findings, pathOwners, digestOwners, record.assertion_key, `symbolic-certificate:${record.design_target_ref}`, record.artifact_path, artifactHashes);
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
164
278
|
if (record.capability !== "design_method")
|
|
165
279
|
continue;
|
|
280
|
+
if ("fact_model" in record) {
|
|
281
|
+
addDistinctArtifact(check, findings, pathOwners, digestOwners, record.assertion_key, `symbolic-method:${record.design_target_ref}:${record.method}:observation`, record.observation_artifact_path, artifactHashes);
|
|
282
|
+
addDistinctArtifact(check, findings, pathOwners, digestOwners, record.assertion_key, `symbolic-method:${record.design_target_ref}:${record.method}:comparison`, record.artifact_path, artifactHashes);
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
166
285
|
for (const cell of record.cells) {
|
|
167
286
|
const currentOwner = `${record.method}:${cell.condition_key}`;
|
|
168
287
|
const pathOwner = pathOwners.get(cell.observation_artifact_path);
|
|
@@ -181,6 +300,21 @@ function validateDistinctDesignMethodArtifacts(check, records, artifactHashes, f
|
|
|
181
300
|
}
|
|
182
301
|
}
|
|
183
302
|
}
|
|
303
|
+
function addDistinctArtifact(check, findings, pathOwners, digestOwners, assertionKey, currentOwner, path, artifactHashes) {
|
|
304
|
+
const pathOwner = pathOwners.get(path);
|
|
305
|
+
if (pathOwner)
|
|
306
|
+
findings.push(reusedDesignMethodArtifactFinding(check, assertionKey, currentOwner, pathOwner, "path", path));
|
|
307
|
+
else
|
|
308
|
+
pathOwners.set(path, currentOwner);
|
|
309
|
+
const digest = artifactHashes[path];
|
|
310
|
+
if (!digest)
|
|
311
|
+
return;
|
|
312
|
+
const digestOwner = digestOwners.get(digest);
|
|
313
|
+
if (digestOwner)
|
|
314
|
+
findings.push(reusedDesignMethodArtifactFinding(check, assertionKey, currentOwner, digestOwner, "sha256", digest));
|
|
315
|
+
else
|
|
316
|
+
digestOwners.set(digest, currentOwner);
|
|
317
|
+
}
|
|
184
318
|
function reusedDesignMethodArtifactFinding(check, assertionKey, currentOwner, previousOwner, identityKind, identity) {
|
|
185
319
|
return {
|
|
186
320
|
...checkFinding(check, "design_method_evidence_reused", `Design-method evidence ${identityKind} ${identity} is reused by ${previousOwner} and ${currentOwner}.`, "Emit method-and-condition evidence whose path and current content digest are both distinct for every verification-method cell."),
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import type { CompiledCheckV2, EvidenceCapabilityRecordV2 } from "./long-task-delivery-types.js";
|
|
2
|
-
|
|
1
|
+
import type { CompiledCheckV2, EvidenceCapabilityRecordV2, HostExecutionAttestationV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import { evaluateExactDigestComparison, exactComparisonResultIdentity } from "./long-task-exact-comparison.js";
|
|
3
|
+
import { type PreparedAdmittedObservationSet } from "./long-task-admitted-observation.js";
|
|
4
|
+
export { evaluateExactDigestComparison, exactComparisonResultIdentity };
|
|
5
|
+
export declare function validateRuntimeEvidenceRecord(check: CompiledCheckV2, record: EvidenceCapabilityRecordV2, artifactHashes: Record<string, string>, admittedObservations?: PreparedAdmittedObservationSet, hostAttestation?: HostExecutionAttestationV2 | null): string | null;
|