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,332 @@
|
|
|
1
|
+
import { chmod, copyFile, mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { createJsonPointerExactBudget } from "./long-task-json-pointer-observation.js";
|
|
5
|
+
import { matchesRepoPattern } from "./long-task-paths.js";
|
|
6
|
+
import { StaticObservationFreezeError, createObservationInputFreezeBudget, freezeObservationInputFile, freezeStaticObservationCarrier, } from "./long-task-static-observation-freeze.js";
|
|
7
|
+
const PROCESS_INPUT_FREEZE_LIMITS = Object.freeze({
|
|
8
|
+
max_artifacts: 4_096,
|
|
9
|
+
max_file_bytes: 268_435_456,
|
|
10
|
+
max_total_artifact_bytes: 536_870_912,
|
|
11
|
+
});
|
|
12
|
+
function createProcessInputFreezeBudget() {
|
|
13
|
+
return createObservationInputFreezeBudget({
|
|
14
|
+
max_artifacts: PROCESS_INPUT_FREEZE_LIMITS.max_artifacts,
|
|
15
|
+
max_total_artifact_bytes: PROCESS_INPUT_FREEZE_LIMITS.max_total_artifact_bytes,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Freezes every selected Raw Execution group's observation inputs before the
|
|
20
|
+
* caller is allowed to start any runner. Keeping this as one owner prevents a
|
|
21
|
+
* prior execution from priming a later group's supposedly pre-run carrier.
|
|
22
|
+
*/
|
|
23
|
+
export async function prepareExecutionObservationUniverse(input) {
|
|
24
|
+
const prepared = [];
|
|
25
|
+
const processInputBudget = createProcessInputFreezeBudget();
|
|
26
|
+
for (const checks of input.groups)
|
|
27
|
+
prepared.push(await prepareExecutionObservationGroupWithBudget({
|
|
28
|
+
checks,
|
|
29
|
+
snapshot_root: input.snapshot_root,
|
|
30
|
+
workspace_manifest: input.workspace_manifest,
|
|
31
|
+
protected_authority_paths: input.protected_authority_paths,
|
|
32
|
+
process_input_budget: processInputBudget,
|
|
33
|
+
}));
|
|
34
|
+
return prepared;
|
|
35
|
+
}
|
|
36
|
+
export async function prepareExecutionObservationGroup(input) {
|
|
37
|
+
return prepareExecutionObservationGroupWithBudget({
|
|
38
|
+
...input,
|
|
39
|
+
process_input_budget: createProcessInputFreezeBudget(),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async function prepareExecutionObservationGroupWithBudget(input) {
|
|
43
|
+
if (!input.checks.length)
|
|
44
|
+
throw new Error("execution_observation_check_group_required");
|
|
45
|
+
const rawIdentity = input.checks[0].raw_execution_identity;
|
|
46
|
+
if (input.checks.some((check) => check.raw_execution_identity !== rawIdentity))
|
|
47
|
+
throw new Error("execution_observation_raw_identity_mismatch");
|
|
48
|
+
const states = authorityCarrierStates(input.checks, input.workspace_manifest);
|
|
49
|
+
const groups = observationCarrierGroups(states);
|
|
50
|
+
const exactBudget = createJsonPointerExactBudget();
|
|
51
|
+
const processInputBudget = input.process_input_budget;
|
|
52
|
+
const processExecution = states.some((state) => state.authority.authority === "package_process_json_exact");
|
|
53
|
+
const executionRoot = processExecution
|
|
54
|
+
? await mkdtemp(path.join(os.tmpdir(), "ty-context-process-snapshot-"))
|
|
55
|
+
: input.snapshot_root;
|
|
56
|
+
if (processExecution)
|
|
57
|
+
await mkdir(path.resolve(executionRoot, input.checks[0].runner.resolved_cwd), { recursive: true });
|
|
58
|
+
for (const group of groups) {
|
|
59
|
+
if ((input.protected_authority_paths ?? []).some((pattern) => matchesRepoPattern(group.artifact_path, pattern))) {
|
|
60
|
+
for (const state of group.authority_states)
|
|
61
|
+
recordAuthorityFailure(state, "observation_expected_authority_forbidden");
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const includesStaticAuthority = group.authority_states.some((state) => state.authority.authority === "package_static_json_exact");
|
|
66
|
+
const includesProcessAuthority = group.authority_states.some((state) => state.authority.authority === "package_process_json_exact");
|
|
67
|
+
let sourceIdentity = null;
|
|
68
|
+
if (processExecution) {
|
|
69
|
+
const sourceFrozen = await freezeObservationInputFile({
|
|
70
|
+
snapshot_root: input.snapshot_root,
|
|
71
|
+
workspace_manifest: input.workspace_manifest,
|
|
72
|
+
artifact_path: group.artifact_path,
|
|
73
|
+
max_file_bytes: PROCESS_INPUT_FREEZE_LIMITS.max_file_bytes,
|
|
74
|
+
budget: processInputBudget,
|
|
75
|
+
});
|
|
76
|
+
try {
|
|
77
|
+
const target = path.resolve(executionRoot, ...group.artifact_path.split("/"));
|
|
78
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
79
|
+
await copyFile(path.resolve(input.snapshot_root, ...group.artifact_path.split("/")), target);
|
|
80
|
+
const verifiedSource = await sourceFrozen.verifyPostRun();
|
|
81
|
+
sourceIdentity = verifiedSource.pre_run_identity;
|
|
82
|
+
await chmod(target, sourceIdentity.mode & 0o777);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
sourceFrozen.dispose();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
group.frozen = includesStaticAuthority
|
|
89
|
+
? await freezeStaticObservationCarrier({
|
|
90
|
+
snapshot_root: executionRoot,
|
|
91
|
+
workspace_manifest: input.workspace_manifest,
|
|
92
|
+
artifact_path: group.artifact_path,
|
|
93
|
+
budget: exactBudget,
|
|
94
|
+
input_freeze_budget: includesProcessAuthority
|
|
95
|
+
? processInputBudget
|
|
96
|
+
: undefined,
|
|
97
|
+
})
|
|
98
|
+
: await freezeObservationInputFile({
|
|
99
|
+
snapshot_root: executionRoot,
|
|
100
|
+
workspace_manifest: input.workspace_manifest,
|
|
101
|
+
artifact_path: group.artifact_path,
|
|
102
|
+
max_file_bytes: PROCESS_INPUT_FREEZE_LIMITS.max_file_bytes,
|
|
103
|
+
budget: processInputBudget,
|
|
104
|
+
});
|
|
105
|
+
if (sourceIdentity &&
|
|
106
|
+
(group.frozen.pre_run_identity.content_sha256 !==
|
|
107
|
+
sourceIdentity.content_sha256 ||
|
|
108
|
+
group.frozen.pre_run_identity.size !== sourceIdentity.size))
|
|
109
|
+
throw new Error("process_observation_input_snapshot_copy_mismatch");
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const reason = observationFailureReason(error);
|
|
113
|
+
for (const state of group.authority_states)
|
|
114
|
+
recordAuthorityFailure(state, reason);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const processAuthorities = states
|
|
118
|
+
.filter((state) => state.authority.authority === "package_process_json_exact")
|
|
119
|
+
.map((state) => state.authority);
|
|
120
|
+
const processRuntimeClosureIdentities = [
|
|
121
|
+
...new Set(input.checks
|
|
122
|
+
.filter((check) => (check.observation_authorities ?? []).some((authority) => authority.authority === "package_process_json_exact"))
|
|
123
|
+
.map((check) => check.process_runtime_closure?.closure_identity ?? null)),
|
|
124
|
+
];
|
|
125
|
+
if (processExecution &&
|
|
126
|
+
(processRuntimeClosureIdentities.length !== 1 ||
|
|
127
|
+
processRuntimeClosureIdentities[0] === null))
|
|
128
|
+
throw new Error("process_runtime_closure_identity_mismatch");
|
|
129
|
+
let disposed = false;
|
|
130
|
+
const dispose = async () => {
|
|
131
|
+
if (disposed)
|
|
132
|
+
return;
|
|
133
|
+
disposed = true;
|
|
134
|
+
for (const group of groups)
|
|
135
|
+
group.frozen?.dispose();
|
|
136
|
+
if (processExecution)
|
|
137
|
+
await rm(executionRoot, { recursive: true, force: true });
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
execution_root: executionRoot,
|
|
141
|
+
runner_context: {
|
|
142
|
+
snapshot_sha256: input.workspace_manifest.snapshot_sha256,
|
|
143
|
+
observation_authorities: processAuthorities,
|
|
144
|
+
...(processExecution
|
|
145
|
+
? {
|
|
146
|
+
process_runtime_closure_identity: processRuntimeClosureIdentities[0],
|
|
147
|
+
}
|
|
148
|
+
: {}),
|
|
149
|
+
},
|
|
150
|
+
finalize: async (raw) => {
|
|
151
|
+
try {
|
|
152
|
+
const verified = new Map();
|
|
153
|
+
for (const group of groups) {
|
|
154
|
+
if (!group.frozen)
|
|
155
|
+
continue;
|
|
156
|
+
try {
|
|
157
|
+
verified.set(group.artifact_path, await group.frozen.verifyPostRun());
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
const reason = observationFailureReason(error);
|
|
161
|
+
for (const state of group.authority_states)
|
|
162
|
+
recordAuthorityFailure(state, reason);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
...raw,
|
|
167
|
+
package_observations: finalizePackageObservations(states, verified, raw.package_observations ?? [], exactBudget),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
await dispose();
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
dispose,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function authorityCarrierStates(checks, manifest) {
|
|
178
|
+
const states = [];
|
|
179
|
+
for (const check of checks)
|
|
180
|
+
for (const authority of check.observation_authorities ?? []) {
|
|
181
|
+
if (authority.authority !== "package_static_json_exact" &&
|
|
182
|
+
authority.authority !== "package_process_json_exact")
|
|
183
|
+
continue;
|
|
184
|
+
const state = {
|
|
185
|
+
check,
|
|
186
|
+
authority: authority,
|
|
187
|
+
artifact_paths: [],
|
|
188
|
+
reason: null,
|
|
189
|
+
};
|
|
190
|
+
const carrierPatterns = authority.carrier_refs.flatMap((carrier) => carrier.carrier_paths);
|
|
191
|
+
addPatternClosure(state, manifest, carrierPatterns);
|
|
192
|
+
if (authority.authority === "package_process_json_exact") {
|
|
193
|
+
const closure = check.process_runtime_closure;
|
|
194
|
+
if (!closure)
|
|
195
|
+
recordAuthorityFailure(state, "process_runtime_closure_identity_mismatch");
|
|
196
|
+
else
|
|
197
|
+
state.artifact_paths.push(...closure.allowed_runtime_files);
|
|
198
|
+
}
|
|
199
|
+
state.artifact_paths = [...new Set(state.artifact_paths)].sort();
|
|
200
|
+
if (authority.authority === "package_static_json_exact" &&
|
|
201
|
+
state.artifact_paths.length !== 1)
|
|
202
|
+
recordAuthorityFailure(state, "static_observation_manifest_invalid");
|
|
203
|
+
states.push(state);
|
|
204
|
+
}
|
|
205
|
+
return states;
|
|
206
|
+
}
|
|
207
|
+
function addPatternClosure(state, manifest, patterns) {
|
|
208
|
+
for (const pattern of new Set(patterns)) {
|
|
209
|
+
let matches;
|
|
210
|
+
try {
|
|
211
|
+
matches = manifest.files
|
|
212
|
+
.filter((file) => matchesRepoPattern(file.path, pattern))
|
|
213
|
+
.map((file) => file.path);
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
recordAuthorityFailure(state, "static_observation_manifest_invalid");
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
if (!matches.length) {
|
|
220
|
+
recordAuthorityFailure(state, "static_observation_not_in_pre_run_snapshot");
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
state.artifact_paths.push(...matches);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function observationCarrierGroups(states) {
|
|
227
|
+
const groups = new Map();
|
|
228
|
+
for (const state of states)
|
|
229
|
+
for (const artifactPath of state.artifact_paths) {
|
|
230
|
+
const existing = groups.get(artifactPath);
|
|
231
|
+
if (existing)
|
|
232
|
+
existing.authority_states.push(state);
|
|
233
|
+
else
|
|
234
|
+
groups.set(artifactPath, {
|
|
235
|
+
artifact_path: artifactPath,
|
|
236
|
+
authority_states: [state],
|
|
237
|
+
frozen: null,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return [...groups.values()].sort((left, right) => left.artifact_path.localeCompare(right.artifact_path));
|
|
241
|
+
}
|
|
242
|
+
function finalizePackageObservations(states, verified, submitted, budget) {
|
|
243
|
+
const processStates = states.filter((state) => state.authority.authority === "package_process_json_exact");
|
|
244
|
+
const observations = submitted.filter((candidate) => {
|
|
245
|
+
const matching = processStates.filter((state) => packageObservationMatchesAuthority(candidate, state.authority));
|
|
246
|
+
return !matching.some((state) => state.reason !== null);
|
|
247
|
+
});
|
|
248
|
+
for (const state of processStates)
|
|
249
|
+
if (state.reason)
|
|
250
|
+
observations.push(failedObservation(state.authority, state.reason));
|
|
251
|
+
for (const state of states.filter((candidate) => candidate.authority.authority === "package_static_json_exact")) {
|
|
252
|
+
if (state.reason) {
|
|
253
|
+
observations.push(failedObservation(state.authority, state.reason));
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
const carrier = verified.get(state.artifact_paths[0]);
|
|
257
|
+
if (!carrier || !isVerifiedStaticObservationCarrier(carrier)) {
|
|
258
|
+
observations.push(failedObservation(state.authority, "static_observation_not_in_pre_run_snapshot"));
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
const extracted = carrier.extractJsonPointerExactValue({
|
|
263
|
+
locator: {
|
|
264
|
+
kind: "json_pointer",
|
|
265
|
+
value: state.authority.locator_policy.value,
|
|
266
|
+
},
|
|
267
|
+
sensitivity: "plain",
|
|
268
|
+
budget,
|
|
269
|
+
});
|
|
270
|
+
observations.push({
|
|
271
|
+
authority: "package_static_json_exact",
|
|
272
|
+
observation_identity: state.authority.observation_identity,
|
|
273
|
+
assertion_ref: state.authority.assertion_ref,
|
|
274
|
+
obligation_ref: state.authority.obligation_ref,
|
|
275
|
+
method: state.authority.method,
|
|
276
|
+
raw_value: extracted.raw_value,
|
|
277
|
+
observation: extracted.observation,
|
|
278
|
+
reason: null,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
observations.push(failedObservation(state.authority, observationFailureReason(error)));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return observations;
|
|
286
|
+
}
|
|
287
|
+
function isVerifiedStaticObservationCarrier(value) {
|
|
288
|
+
return "extractJsonPointerExactValue" in value;
|
|
289
|
+
}
|
|
290
|
+
function packageObservationMatchesAuthority(observation, authority) {
|
|
291
|
+
return (observation.authority === authority.authority &&
|
|
292
|
+
observation.observation_identity === authority.observation_identity &&
|
|
293
|
+
observation.assertion_ref === authority.assertion_ref &&
|
|
294
|
+
observation.obligation_ref === authority.obligation_ref &&
|
|
295
|
+
observation.method === authority.method);
|
|
296
|
+
}
|
|
297
|
+
function failedObservation(authority, reason) {
|
|
298
|
+
return {
|
|
299
|
+
authority: authority.authority,
|
|
300
|
+
observation_identity: authority.observation_identity,
|
|
301
|
+
assertion_ref: authority.assertion_ref,
|
|
302
|
+
obligation_ref: authority.obligation_ref,
|
|
303
|
+
method: authority.method,
|
|
304
|
+
raw_value: undefined,
|
|
305
|
+
observation: null,
|
|
306
|
+
reason,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function recordAuthorityFailure(state, reason) {
|
|
310
|
+
if (state.reason)
|
|
311
|
+
return;
|
|
312
|
+
state.reason =
|
|
313
|
+
state.authority.authority === "package_process_json_exact"
|
|
314
|
+
? processInputFailureReason(reason)
|
|
315
|
+
: reason;
|
|
316
|
+
}
|
|
317
|
+
function processInputFailureReason(reason) {
|
|
318
|
+
if (reason === "observation_expected_authority_forbidden")
|
|
319
|
+
return reason;
|
|
320
|
+
if (reason === "process_runtime_closure_identity_mismatch")
|
|
321
|
+
return reason;
|
|
322
|
+
if (reason.startsWith("process_observation_input_"))
|
|
323
|
+
return reason;
|
|
324
|
+
if (reason.startsWith("static_observation_"))
|
|
325
|
+
return `process_observation_input_${reason.slice("static_observation_".length)}`;
|
|
326
|
+
return "process_observation_input_freeze_invalid";
|
|
327
|
+
}
|
|
328
|
+
function observationFailureReason(error) {
|
|
329
|
+
if (error instanceof StaticObservationFreezeError)
|
|
330
|
+
return error.code;
|
|
331
|
+
return error instanceof Error ? error.message : String(error);
|
|
332
|
+
}
|
|
@@ -21,12 +21,16 @@ export declare function explainAcceptanceLinks(contract: DeliveryContractV2, cov
|
|
|
21
21
|
binding_ref: string;
|
|
22
22
|
owning_outcome_key: string;
|
|
23
23
|
expected_assertion_failures: string[];
|
|
24
|
+
preserved_assertions: string[];
|
|
25
|
+
allowed_fanout_assertions: string[];
|
|
24
26
|
}[] | {
|
|
25
27
|
key: string;
|
|
26
28
|
claims: string[];
|
|
27
29
|
binding_key: string;
|
|
28
30
|
owning_outcome_key: string | null;
|
|
29
31
|
expected_assertion_failures: string[];
|
|
32
|
+
preserved_assertions: string[];
|
|
33
|
+
allowed_fanout_assertions: string[];
|
|
30
34
|
}[];
|
|
31
35
|
} | {
|
|
32
36
|
type: string;
|
|
@@ -81,6 +81,8 @@ function acceptanceCounterfactuals(contract, scope, outcomeKey, checkKey, assert
|
|
|
81
81
|
binding_ref: control.binding_ref,
|
|
82
82
|
owning_outcome_key: control.binding_ref.split(".")[0],
|
|
83
83
|
expected_assertion_failures: control.expected_assertion_failures,
|
|
84
|
+
preserved_assertions: control.preserved_assertions,
|
|
85
|
+
allowed_fanout_assertions: control.allowed_fanout_assertions,
|
|
84
86
|
}));
|
|
85
87
|
const outcome = contract.outcomes.find((item) => item.key === outcomeKey);
|
|
86
88
|
return (outcome?.acceptance.counterfactual_controls ?? [])
|
|
@@ -92,5 +94,7 @@ function acceptanceCounterfactuals(contract, scope, outcomeKey, checkKey, assert
|
|
|
92
94
|
binding_key: control.binding_key,
|
|
93
95
|
owning_outcome_key: outcomeKey,
|
|
94
96
|
expected_assertion_failures: control.expected_assertion_failures,
|
|
97
|
+
preserved_assertions: control.preserved_assertions,
|
|
98
|
+
allowed_fanout_assertions: control.allowed_fanout_assertions,
|
|
95
99
|
}));
|
|
96
100
|
}
|
|
@@ -39,6 +39,8 @@ export declare function explainGlobalClaimLinks(contract: DeliveryContractV2, co
|
|
|
39
39
|
owner_paths: string[];
|
|
40
40
|
carrier_paths: string[];
|
|
41
41
|
expected_assertion_failures: string[];
|
|
42
|
+
preserved_assertions: string[];
|
|
43
|
+
allowed_fanout_assertions: string[];
|
|
42
44
|
mutation: import("./long-task-counterfactual-types.js").CounterfactualMutationV2;
|
|
43
45
|
}[];
|
|
44
46
|
}[];
|
|
@@ -58,6 +58,8 @@ export function explainGlobalClaimLinks(contract, coverage, disposition) {
|
|
|
58
58
|
owner_paths: outcome?.product.owner.path_globs ?? [],
|
|
59
59
|
carrier_paths: binding?.carrier_paths ?? [],
|
|
60
60
|
expected_assertion_failures: control.expected_assertion_failures,
|
|
61
|
+
preserved_assertions: control.preserved_assertions,
|
|
62
|
+
allowed_fanout_assertions: control.allowed_fanout_assertions,
|
|
61
63
|
mutation: control.mutation,
|
|
62
64
|
};
|
|
63
65
|
}),
|
|
@@ -21,12 +21,16 @@ export declare function explainSourceLinks(contract: DeliveryContractV2, coverag
|
|
|
21
21
|
binding_ref: string;
|
|
22
22
|
owning_outcome_key: string;
|
|
23
23
|
expected_assertion_failures: string[];
|
|
24
|
+
preserved_assertions: string[];
|
|
25
|
+
allowed_fanout_assertions: string[];
|
|
24
26
|
}[] | {
|
|
25
27
|
key: string;
|
|
26
28
|
claims: string[];
|
|
27
29
|
binding_key: string;
|
|
28
30
|
owning_outcome_key: string | null;
|
|
29
31
|
expected_assertion_failures: string[];
|
|
32
|
+
preserved_assertions: string[];
|
|
33
|
+
allowed_fanout_assertions: string[];
|
|
30
34
|
}[];
|
|
31
35
|
canonical_target: import("./long-task-source-target-index.js").CanonicalSourceTarget | null;
|
|
32
36
|
} | {
|
|
@@ -75,6 +79,8 @@ export declare function explainSourceLinks(contract: DeliveryContractV2, coverag
|
|
|
75
79
|
owner_paths: string[];
|
|
76
80
|
carrier_paths: string[];
|
|
77
81
|
expected_assertion_failures: string[];
|
|
82
|
+
preserved_assertions: string[];
|
|
83
|
+
allowed_fanout_assertions: string[];
|
|
78
84
|
mutation: import("./long-task-counterfactual-types.js").CounterfactualMutationV2;
|
|
79
85
|
}[];
|
|
80
86
|
canonical_target: import("./long-task-source-target-index.js").CanonicalSourceTarget | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { compileDeliveryContract } from "./long-task-delivery-compiler.js";
|
|
2
|
+
import { outcomeResultExternallyBlocked } from "./long-task-claims.js";
|
|
2
3
|
import { captureFinalGateProtectedInputIdentity, finalGateIntegrityFindings, } from "./long-task-final-integrity.js";
|
|
3
4
|
import { assertMatchingActiveBinding, loadActiveLongTaskAuthority, writeFinalReceipt, } from "./long-task-state.js";
|
|
4
5
|
import { assertVerifierAuthorityCurrent, deliveryCompileFreshness, } from "./long-task-freshness.js";
|
|
@@ -47,7 +48,7 @@ export async function runDeliveryFinalGate(workdirInput) {
|
|
|
47
48
|
workspace_identity_before: before.identity,
|
|
48
49
|
protected_inputs_before: protectedInputsBefore,
|
|
49
50
|
})));
|
|
50
|
-
const outcomeResults = projectOutcomes(compiled
|
|
51
|
+
const outcomeResults = projectOutcomes(compiled, run.check_results, run.findings);
|
|
51
52
|
const globalChecks = run.check_results.filter((check) => check.outcome_key === null);
|
|
52
53
|
const globalHardFailure = globalChecks.some((check) => check.status !== "passed" && check.status !== "blocked_external");
|
|
53
54
|
const globalBlocked = globalChecks.some((check) => check.status === "blocked_external");
|
|
@@ -131,13 +132,15 @@ function projectStages(compiled, outcomes) {
|
|
|
131
132
|
}
|
|
132
133
|
return result;
|
|
133
134
|
}
|
|
134
|
-
function projectOutcomes(
|
|
135
|
-
return Object.fromEntries(
|
|
135
|
+
function projectOutcomes(compiled, checks, findings) {
|
|
136
|
+
return Object.fromEntries(compiled.outcomes.map((outcome) => {
|
|
137
|
+
const outcomeKey = outcome.key;
|
|
136
138
|
const owned = checks.filter((check) => check.outcome_key === outcomeKey);
|
|
137
139
|
const ownFindings = findings.filter((finding) => finding.outcome_key === outcomeKey || finding.outcome_key === null);
|
|
138
140
|
const status = owned.some((check) => check.status !== "passed" && check.status !== "blocked_external") || ownFindings.some((finding) => finding.code !== "blocked_external")
|
|
139
141
|
? "failed"
|
|
140
|
-
:
|
|
142
|
+
: outcomeResultExternallyBlocked(compiled, outcomeKey) ||
|
|
143
|
+
owned.some((check) => check.status === "blocked_external")
|
|
141
144
|
? "blocked_external"
|
|
142
145
|
: "passed";
|
|
143
146
|
return [outcomeKey, status];
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
import { type Stats } from "node:fs";
|
|
1
2
|
import type { SyncReport } from "./sync-engine.js";
|
|
2
|
-
export declare
|
|
3
|
-
export
|
|
3
|
+
export declare const LONG_TASK_HOOK_TRUST_REVIEW_NOTICE = "Codex Hook review required: open /hooks and trust the current Tiny Context project Hook before relying on PreToolUse, SubagentStart, SessionStart or Stop behavior. Tiny Context cannot observe or persist Codex Hook trust.";
|
|
4
|
+
export interface LongTaskHookFileOperations {
|
|
5
|
+
lstat(target: string): Promise<Stats>;
|
|
6
|
+
readFile(target: string, encoding: "utf8"): Promise<string>;
|
|
7
|
+
mkdir(target: string, options: {
|
|
8
|
+
recursive: true;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
writeFile(target: string, content: string, options: {
|
|
11
|
+
flag: "wx";
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
rename(source: string, destination: string): Promise<void>;
|
|
14
|
+
rm(target: string, options: {
|
|
15
|
+
force: true;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
randomId(): string;
|
|
18
|
+
}
|
|
19
|
+
export declare function installLongTaskHooks(projectRoot: string, report: SyncReport, fileOperations?: Partial<LongTaskHookFileOperations>): Promise<void>;
|
|
20
|
+
export declare function uninstallLongTaskHooks(projectRoot: string, report: SyncReport, fileOperations?: Partial<LongTaskHookFileOperations>): Promise<void>;
|
|
4
21
|
export declare function packageOwnedCommand(entry: string): string;
|
|
5
22
|
export declare function removeManagedHookEntries(groups: unknown, currentPackageCommand?: string): {
|
|
6
23
|
groups: unknown[];
|