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
|
@@ -1,93 +1,112 @@
|
|
|
1
|
-
# Open Design Provider Orchestration
|
|
2
|
-
|
|
3
|
-
Use Open Design as the generation engine. This Skill supplies a bounded product commission and retrieves results; it does not recreate the provider's prompts, template logic or catalogue.
|
|
4
|
-
|
|
5
|
-
## Execution priority
|
|
6
|
-
|
|
7
|
-
1. **Structured Open Design MCP** for discovery, project/run control and artifact retrieval.
|
|
8
|
-
2. **Open Design CLI or daemon API** when MCP is unavailable or cannot expose a required current capability but equivalent structured behavior is locally available.
|
|
9
|
-
3. **Browser/desktop interaction** only for bootstrap, unavoidable UI-only selection, signed-in provider interaction, visual preview inspection or recovery. Prefer browser-specific control over general Computer Use when both can operate the page.
|
|
10
|
-
|
|
11
|
-
Do not silently install an MCP server/plugin, alter the user's global Open Design/Codex configuration, sign in, create a paid-provider dependency or expand data disclosure. Explain the exact setup need and obtain separate authorization when persistence or a new disclosure path is required.
|
|
12
|
-
|
|
13
|
-
## Live capability discovery
|
|
14
|
-
|
|
15
|
-
Discover rather than remember:
|
|
16
|
-
|
|
17
|
-
- configured agents and models, including whether Open Design's inner agent is Codex CLI;
|
|
18
|
-
- functional skills and plugins;
|
|
19
|
-
- rendering templates or project types;
|
|
20
|
-
- design systems and their selected project binding;
|
|
21
|
-
- specialist paths such as collaborative design platforms, image, video or 3D/WebGL;
|
|
22
|
-
- supported project creation, run, cancellation, file and artifact operations.
|
|
23
|
-
|
|
24
|
-
Current structured tool names may include `list_agents`, `list_skills`, `list_plugins`, `create_project`, `get_project`, `get_active_context`, `start_run`, `get_run`, `cancel_run`, `list_files`, `get_file` and `get_artifact`. Feature-detect them; tool names and provider versions may evolve.
|
|
25
|
-
|
|
26
|
-
Functional skills and rendering templates are different registries. Finding `frontend-design` does not prove that a `mobile-app` or `wireframe-mobile-flow` template is installed, and a remembered template ID is not live capability evidence.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
# Open Design Provider Orchestration
|
|
2
|
+
|
|
3
|
+
Use Open Design as the generation engine. This Skill supplies a bounded product commission and retrieves results; it does not recreate the provider's prompts, template logic or catalogue.
|
|
4
|
+
|
|
5
|
+
## Execution priority
|
|
6
|
+
|
|
7
|
+
1. **Structured Open Design MCP** for discovery, project/run control and artifact retrieval.
|
|
8
|
+
2. **Open Design CLI or daemon API** when MCP is unavailable or cannot expose a required current capability but equivalent structured behavior is locally available.
|
|
9
|
+
3. **Browser/desktop interaction** only for bootstrap, unavoidable UI-only selection, signed-in provider interaction, visual preview inspection or recovery. Prefer browser-specific control over general Computer Use when both can operate the page.
|
|
10
|
+
|
|
11
|
+
Do not silently install an MCP server/plugin, alter the user's global Open Design/Codex configuration, sign in, create a paid-provider dependency or expand data disclosure. Explain the exact setup need and obtain separate authorization when persistence or a new disclosure path is required.
|
|
12
|
+
|
|
13
|
+
## Live capability discovery
|
|
14
|
+
|
|
15
|
+
Discover rather than remember:
|
|
16
|
+
|
|
17
|
+
- configured agents and models, including whether Open Design's inner agent is Codex CLI;
|
|
18
|
+
- functional skills and plugins;
|
|
19
|
+
- rendering templates or project types;
|
|
20
|
+
- design systems and their selected project binding;
|
|
21
|
+
- specialist paths such as collaborative design platforms, image, video or 3D/WebGL;
|
|
22
|
+
- supported project creation, run, cancellation, file and artifact operations.
|
|
23
|
+
|
|
24
|
+
Current structured tool names may include `list_agents`, `list_skills`, `list_plugins`, `create_project`, `get_project`, `get_active_context`, `start_run`, `get_run`, `cancel_run`, `list_files`, `get_file` and `get_artifact`. Feature-detect them; tool names and provider versions may evolve.
|
|
25
|
+
|
|
26
|
+
Functional skills and rendering templates are different registries. Finding `frontend-design` does not prove that a `mobile-app` or `wireframe-mobile-flow` template is installed, and a remembered template ID is not live capability evidence.
|
|
27
|
+
|
|
28
|
+
## Highest-performance generation selection
|
|
29
|
+
|
|
30
|
+
Open Design quality takes precedence over model-call price for every formal first generation, every major revision and every final-candidate defect repair that requires material regeneration. A major revision changes the adopted visual direction or design system, cross-surface information architecture, primary interaction model, or enough of the selected canonical source/Fact manifest to invalidate the former candidate. Pure discovery, reads, resource enumeration, metadata queries and review of an already sufficient selected resource do not trigger this policy.
|
|
31
|
+
|
|
32
|
+
The durable policy is `highest_available_capability + highest_supported_reasoning_effort`, not a permanent model name. Apply it immediately before each applicable run:
|
|
33
|
+
|
|
34
|
+
1. Discover the live provider/tool schemas and returned agent/model metadata. Determine whether the actual run surface exposes model, reasoning-effort or service-tier inputs and which run/project/result fields can confirm their effective values. Never invent an input or result field that the provider does not expose.
|
|
35
|
+
2. Filter to eligible models before ranking. Eligibility requires every tool, visual/multimodal capability, context capacity, authentication path and data-residency/disclosure boundary required by the commission. An ineligible model cannot win on nominal capability.
|
|
36
|
+
3. Rank eligible models only by the provider's explicit capability order or documented recommended-replacement relation. If that is absent, the sole permitted fallback is one versioned, evidence-linked provider-local mapping owned in this reference; do not duplicate it in the main Skill, Context, README, tests or adapters. Price, model-name shape, publication date, apparent generation number and provider list order are not ranking evidence. This reference currently defines no fallback entries: when live provider evidence cannot order two or more eligible candidates, stop formal generation or major revision with `highest_performance_unverified` instead of guessing.
|
|
37
|
+
4. For the selected model, use its actually declared ordered legal reasoning-effort values and select the highest supported value. Examples such as `max` or `xhigh` illustrate possible highest values; they are not a cross-provider ordering or permanent product vocabulary. If several advertised values cannot be authoritatively ordered, the highest effort is unverified and the applicable generation must fail closed.
|
|
38
|
+
5. Keep service tier distinct from model capability and reasoning effort. Discover and report it when the provider exposes control or provenance, but never use price, latency tier or a service-tier label to rank model capability.
|
|
39
|
+
6. When model selection is controllable, requesting anything below the proved highest eligible model is an invocation error. When reasoning is controllable, requesting anything below the proved highest supported effort is likewise an error. A missing remembered example model is not an error when live evidence selects a different actual highest model.
|
|
40
|
+
7. Compare requested values with the effective model, reasoning effort and service tier reported by the completed run. A mismatch fails the run. If the provider accepts a request but does not expose effective provenance, keep the result `highest_performance_unverified`; do not claim the requested values were used.
|
|
41
|
+
8. If the provider exposes reasoning control but no model control, request the proved highest effort and report that model selection could not be independently enforced. If it exposes neither control nor enough candidates to create an unresolved ranking choice, its current default generation path may be used, but the result remains `highest_performance_unverified`. If it explicitly exposes multiple eligible models and no authoritative order, rule 3 blocks the run.
|
|
42
|
+
|
|
43
|
+
Capability discovery happens at call time so a provider's new highest model or effort can replace an older example without a Skill edit. This is a provider adapter policy, not a scheduler: create no persistent model registry, routing state, retry loop or cross-provider optimizer. Reduce cost by avoiding unnecessary generations, irrelevant resources and separable revisions, or by reusing a sufficient selected resource—never by lowering the generation model or effort.
|
|
44
|
+
|
|
45
|
+
Repository tests can prove only that these branches remain distributed in the managed guidance. Only a normalized live provider trace that freezes provider/version, candidate and eligibility metadata, ranking authority, request fields and effective result provenance can prove the model and effort actually used. Without that trace, report the boundary as unverified.
|
|
46
|
+
|
|
47
|
+
### Rendering-template discovery compatibility
|
|
48
|
+
|
|
49
|
+
Prefer, in order:
|
|
50
|
+
|
|
51
|
+
1. a live `list_design_templates`-style method/resource when the provider exposes one;
|
|
52
|
+
2. an explicit template ID supplied by the current project/user and validated by the provider;
|
|
53
|
+
3. a version-guarded structured daemon query that reads the provider's current registry;
|
|
54
|
+
4. provider UI inspection when no structured registry is exposed;
|
|
55
|
+
5. an honest `unavailable` or degraded-discovery result.
|
|
56
|
+
|
|
57
|
+
Never vendor a fallback template catalogue or guess a template ID from prior runs. Do not implement a transport helper unless the live host truly lacks a safe structured path; any helper may normalize metadata and transport only.
|
|
58
|
+
|
|
59
|
+
## Conditional Design Authority gate and binding
|
|
60
|
+
|
|
61
|
+
Before any style-bearing commission, read project `DESIGN.md` and its declared authored exact-value token source/generation direction. Style-bearing means the resource materially expresses visual fidelity, brand, typography/color/density, component visual treatment or a production-style prototype. Low-fidelity structure, IA/flow topology and semantics-only behavior/state studies are non-fidelity and do not require the gate.
|
|
62
|
+
|
|
63
|
+
If authority is absent, explicitly `unconfigured`, still a starter, style-only/inspiration-only, or lacks one authored token source/generation direction, stop before creating a project or run. Direct the user to explicitly invoke `$design-system-authoring`; never auto-run it. A combined explicit request authorizes the sequence.
|
|
64
|
+
|
|
65
|
+
For configured style-bearing work:
|
|
66
|
+
|
|
67
|
+
1. read the adopted Open Design design-system ID and digest/provenance from project Design Authority;
|
|
68
|
+
2. confirm `od://design-systems/<id>/DESIGN.md` is readable through MCP;
|
|
69
|
+
3. pass that ID as `designSystem` to `create_project`;
|
|
70
|
+
4. immediately call `get_project` and require `designSystemId` to match;
|
|
71
|
+
5. when reusing a project, check its binding before every new style-bearing run;
|
|
72
|
+
6. on missing/mismatch, prefer a new bounded project with the correct binding when MCP has no safe update method; otherwise feature-detect and verify the provider's structured update.
|
|
73
|
+
|
|
74
|
+
Never silently use the provider's default or a different system. A provider-side mismatch is a synchronization/rebinding issue; it does not erase the canonical project `DESIGN.md`.
|
|
75
|
+
|
|
57
76
|
## Structured commission sequence
|
|
58
77
|
|
|
59
|
-
1. Record provider version, selected agent/model, functional capability, rendering template, adopted design system and relevant plugin/export readiness as reported live.
|
|
78
|
+
1. Record provider version, selected agent/model, reasoning effort and service tier when exposed, functional capability, rendering template, adopted design system and relevant plugin/export readiness as reported live. For an applicable generation, retain the eligibility/ranking basis and the request-versus-effective comparison required by the highest-performance policy.
|
|
60
79
|
2. Reuse an existing task-local project only when its scope, prior inputs and required design-system binding match; otherwise create a bounded project. For style-bearing work, pass `designSystem` and verify `get_project.designSystemId` before the run.
|
|
61
80
|
3. Start a run with the product-specific commission envelope, provider-native capability identifier and—when the intent is a formal Web/App implementation handoff—the complete prederived authoring obligation universe. That universe is based on requested scope, product semantics, adopted design system and target environments; it must not be inferred only from provider output.
|
|
62
|
-
4. Poll with a bounded cadence. During a long run, report meaningful progress at least once per minute without flooding the user.
|
|
63
|
-
5. Preserve run IDs and the latest provider diagnostic. Support cancellation when the user requests it and the provider exposes it.
|
|
64
|
-
6. Resolve the actual entry explicitly, retrieve the artifact/source, inspect it according to intent and preserve its immutable identity before later iterations or handoff.
|
|
65
|
-
|
|
66
|
-
Open Design may launch Codex CLI as its configured inner agent. That is provider execution, not recursive invocation of this outer Skill. Do not hardcode a model when
|
|
67
|
-
|
|
68
|
-
## Separate three kinds of state
|
|
69
|
-
|
|
70
|
-
### Provider execution state
|
|
71
|
-
|
|
72
|
-
Examples: queued, running, succeeded, failed, cancelled, timed out or unknown.
|
|
73
|
-
|
|
74
|
-
### Artifact readiness
|
|
75
|
-
|
|
76
|
-
Examples: missing, partial, corrupt, retrievable, rendered or snapshot-preserved.
|
|
77
|
-
|
|
78
|
-
### Design suitability
|
|
79
|
-
|
|
80
|
-
Examples: unreviewed, scope-sane, handoff-checked, human-selected or rejected.
|
|
81
|
-
|
|
82
|
-
Never collapse these into one “success.” A provider success does not prove a good design; a complete artifact can exist even when a provider run later fails.
|
|
83
|
-
|
|
84
|
-
Use these qualifiers when needed:
|
|
85
|
-
|
|
86
|
-
- `artifact-ready/run-unreconciled`: a complete retrievable artifact exists, but the provider run remains nonterminal or inconsistent;
|
|
87
|
-
- `artifact-ready/provider-failed`: the artifact remains complete and retrievable, but the provider later reports failure/timeout.
|
|
88
|
-
|
|
89
|
-
In both cases preserve the exact run locator, last update, failure diagnostic and artifact hash. Do not claim provider success or downstream acceptance. Retry only when the promised resource is incomplete/corrupt or the user requests another attempt; do not discard a useful independently inspected artifact merely because the terminal state differs.
|
|
90
|
-
|
|
81
|
+
4. Poll with a bounded cadence. During a long run, report meaningful progress at least once per minute without flooding the user.
|
|
82
|
+
5. Preserve run IDs and the latest provider diagnostic. Support cancellation when the user requests it and the provider exposes it.
|
|
83
|
+
6. Resolve the actual entry explicitly, retrieve the artifact/source, inspect it according to intent and preserve its immutable identity before later iterations or handoff.
|
|
84
|
+
|
|
85
|
+
Open Design may launch Codex CLI as its configured inner agent. That is provider execution, not recursive invocation of this outer Skill. Do not hardcode a remembered model when live discovery and authoritative ranking can select the current highest eligible model.
|
|
86
|
+
|
|
87
|
+
## Separate three kinds of state
|
|
88
|
+
|
|
89
|
+
### Provider execution state
|
|
90
|
+
|
|
91
|
+
Examples: queued, running, succeeded, failed, cancelled, timed out or unknown.
|
|
92
|
+
|
|
93
|
+
### Artifact readiness
|
|
94
|
+
|
|
95
|
+
Examples: missing, partial, corrupt, retrievable, rendered or snapshot-preserved.
|
|
96
|
+
|
|
97
|
+
### Design suitability
|
|
98
|
+
|
|
99
|
+
Examples: unreviewed, scope-sane, handoff-checked, human-selected or rejected.
|
|
100
|
+
|
|
101
|
+
Never collapse these into one “success.” A provider success does not prove a good design; a complete artifact can exist even when a provider run later fails.
|
|
102
|
+
|
|
103
|
+
Use these qualifiers when needed:
|
|
104
|
+
|
|
105
|
+
- `artifact-ready/run-unreconciled`: a complete retrievable artifact exists, but the provider run remains nonterminal or inconsistent;
|
|
106
|
+
- `artifact-ready/provider-failed`: the artifact remains complete and retrievable, but the provider later reports failure/timeout.
|
|
107
|
+
|
|
108
|
+
In both cases preserve the exact run locator, last update, failure diagnostic and artifact hash. Do not claim provider success or downstream acceptance. Retry only when the promised resource is incomplete/corrupt or the user requests another attempt; do not discard a useful independently inspected artifact merely because the terminal state differs.
|
|
109
|
+
|
|
91
110
|
## Implementation-level output profile
|
|
92
111
|
|
|
93
112
|
Open Design has demonstrated that a complex Web page can emit a machine-readable implementation set such as `index.html`, component/design specifications, tokens and an asset manifest. Capability is not a per-run guarantee. When the selected resource will drive Web/App implementation, make this an explicit commission and retrieval invariant:
|
|
@@ -104,37 +123,38 @@ Open Design has demonstrated that a complex Web page can emit a machine-readable
|
|
|
104
123
|
10. mark protected observations before downstream use. Sensitive raw UI values must not be persisted in Contract/runtime evidence: the canonical source remains the value owner while later evidence carries an attributable digest-only or redacted representation and policy reference.
|
|
105
124
|
|
|
106
125
|
The authoring Skill then projects the exact manifest identities into the residual handoff and shared preflight enforces `Expected Fact Universe = Canonical Resource Facts = Handoff Indexed Facts`. This is authoring source QA, never production acceptance. If the live Open Design capability cannot generate, expose or retrieve this profile, report the missing capability and keep the formal handoff blocked; provider success does not authorize a coarser replacement.
|
|
107
|
-
|
|
108
|
-
A PNG may be a useful derived visual baseline, but it cannot be the sole source for implementation-level state, interaction, adaptation, accessibility or motion facts. Non-Web resources use the `reference` profile; do not manufacture HTML merely to satisfy this profile.
|
|
109
|
-
|
|
110
|
-
## Explicit entry and immutable identity
|
|
111
|
-
|
|
112
|
-
Provider project metadata may omit or stale its entry file. Resolve in this order:
|
|
113
|
-
|
|
114
|
-
1. validate an explicit project entry path when present;
|
|
115
|
-
2. enumerate project files;
|
|
116
|
-
3. identify the intended provider-native entry from the current run/output rather than guessing;
|
|
117
|
-
4. retrieve that exact file/artifact;
|
|
118
|
-
5. preserve an SHA-256 digest or immutable snapshot before selection/handoff.
|
|
119
|
-
|
|
120
|
-
A preview URL is mutable navigation, not immutable identity. It may be reported for convenience only beside project/run/entry provenance and a digest. If the user explicitly selects the resource for durable use, export or snapshot it to a user-approved location; never silently choose a repository path.
|
|
121
|
-
|
|
122
|
-
## Review proportional to intent
|
|
123
|
-
|
|
124
|
-
- **Exploration:** open/render the requested entry, confirm artifact count/scope and obvious corruption, then show it. Do not launch a packaging or validator sequence.
|
|
125
|
-
- **Handoff:** additionally perform the method-proportional source QA above, including relevant structure, states/transitions, viewport behavior, accessibility semantics, assets, obvious console/runtime errors and requested interaction hooks. State exactly what was and was not checked.
|
|
126
|
-
- **Selected-source preparation:** require explicit human selection basis, preserve identity/snapshot, and prepare downstream metadata. It still does not verify production behavior.
|
|
127
|
-
|
|
128
|
-
Provider self-checks, outer artifact sanity review and downstream project verification are separate evidence layers. Never claim native rendering, accessibility, responsive coverage, product correctness or acceptance unless the appropriate downstream project checks actually prove them.
|
|
129
|
-
|
|
130
|
-
## Specialist paths
|
|
131
|
-
|
|
132
|
-
Figma, Penpot, OpenPencil, image, video, 3D/WebGL and other providers are optional upstream producers. Use one only when its collaboration/editability or native inspection value is material and its connector/auth/read/export path is operational. A listed plugin, URL, thumbnail or metadata response is not proof of usable native input. If a requested provider is unavailable, report the missing capability precisely, offer another artifact only when it preserves the requested design decision, and never relabel an export as native editable design. Every selected provider still emits repository-readable immutable resources through the same provider-neutral handoff.
|
|
133
|
-
|
|
134
|
-
## Failure and recovery
|
|
135
|
-
|
|
136
|
-
- Preserve provider diagnostics; do not replace failures with generated placeholders.
|
|
137
|
-
- Avoid unbounded polling or repeated blind reruns.
|
|
138
|
-
- Re-discover capability after provider upgrades or registry mismatches.
|
|
139
|
-
- If structured paths fail but a UI artifact exists, UI inspection may recover it while retaining the degraded-provider qualifier.
|
|
140
|
-
- If the provider is unavailable and no justified fallback exists, return `unavailable` with the minimum setup needed rather than generating with an unrelated image tool and calling it equivalent.
|
|
126
|
+
|
|
127
|
+
A PNG may be a useful derived visual baseline, but it cannot be the sole source for implementation-level state, interaction, adaptation, accessibility or motion facts. Non-Web resources use the `reference` profile; do not manufacture HTML merely to satisfy this profile.
|
|
128
|
+
|
|
129
|
+
## Explicit entry and immutable identity
|
|
130
|
+
|
|
131
|
+
Provider project metadata may omit or stale its entry file. Resolve in this order:
|
|
132
|
+
|
|
133
|
+
1. validate an explicit project entry path when present;
|
|
134
|
+
2. enumerate project files;
|
|
135
|
+
3. identify the intended provider-native entry from the current run/output rather than guessing;
|
|
136
|
+
4. retrieve that exact file/artifact;
|
|
137
|
+
5. preserve an SHA-256 digest or immutable snapshot before selection/handoff.
|
|
138
|
+
|
|
139
|
+
A preview URL is mutable navigation, not immutable identity. It may be reported for convenience only beside project/run/entry provenance and a digest. If the user explicitly selects the resource for durable use, export or snapshot it to a user-approved location; never silently choose a repository path.
|
|
140
|
+
|
|
141
|
+
## Review proportional to intent
|
|
142
|
+
|
|
143
|
+
- **Exploration:** open/render the requested entry, confirm artifact count/scope and obvious corruption, then show it. Do not launch a packaging or validator sequence.
|
|
144
|
+
- **Handoff:** additionally perform the method-proportional source QA above, including relevant structure, states/transitions, viewport behavior, accessibility semantics, assets, obvious console/runtime errors and requested interaction hooks. State exactly what was and was not checked.
|
|
145
|
+
- **Selected-source preparation:** require explicit human selection basis, preserve identity/snapshot, and prepare downstream metadata. It still does not verify production behavior.
|
|
146
|
+
|
|
147
|
+
Provider self-checks, outer artifact sanity review and downstream project verification are separate evidence layers. Never claim native rendering, accessibility, responsive coverage, product correctness or acceptance unless the appropriate downstream project checks actually prove them.
|
|
148
|
+
|
|
149
|
+
## Specialist paths
|
|
150
|
+
|
|
151
|
+
Figma, Penpot, OpenPencil, image, video, 3D/WebGL and other providers are optional upstream producers. Use one only when its collaboration/editability or native inspection value is material and its connector/auth/read/export path is operational. A listed plugin, URL, thumbnail or metadata response is not proof of usable native input. If a requested provider is unavailable, report the missing capability precisely, offer another artifact only when it preserves the requested design decision, and never relabel an export as native editable design. Every selected provider still emits repository-readable immutable resources through the same provider-neutral handoff.
|
|
152
|
+
|
|
153
|
+
## Failure and recovery
|
|
154
|
+
|
|
155
|
+
- Preserve provider diagnostics; do not replace failures with generated placeholders.
|
|
156
|
+
- Avoid unbounded polling or repeated blind reruns.
|
|
157
|
+
- Re-discover capability after provider upgrades or registry mismatches.
|
|
158
|
+
- If structured paths fail but a UI artifact exists, UI inspection may recover it while retaining the degraded-provider qualifier.
|
|
159
|
+
- If the provider is unavailable and no justified fallback exists, return `unavailable` with the minimum setup needed rather than generating with an unrelated image tool and calling it equivalent.
|
|
160
|
+
- Provider recovery and DRA semantic recovery are separate: this reference may re-read the current run/resource identity, while [recovery-and-writeback.md](recovery-and-writeback.md) alone owns Base/Delta replay, the conditional checkpoint and Proposal CAS. Never restore a live Provider state or suitability conclusion from that checkpoint.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# DRA Semantic Replay, Recovery And Proposal Writeback
|
|
2
|
+
|
|
3
|
+
Load this reference only for a material generation/revision loop which needs complete semantic replay, a selected-Proposal writeback, current bidirectional audit or real recovery across interruption. It strengthens upstream Source quality and does not become Design Authority, implementation acceptance or Long-Task proof.
|
|
4
|
+
|
|
5
|
+
## Simple path and admission
|
|
6
|
+
|
|
7
|
+
A simple scoped preview creates zero recovery files and persisted recovery bytes, adds no user pause or Provider generation beyond the one requested commission, runs no formal handoff/preflight, performs no Proposal writeback and opens no helper write transaction. Its ordinary requested preview is the commission itself; recovery adds and reports zero tool actions. Keep its temporary reasoning in the current turn.
|
|
8
|
+
|
|
9
|
+
Use a recovery checkpoint only when interruption would otherwise lose material accepted/rejected/unresolved semantics, immutable Provider identity or a pending CAS writeback. It is versioned, ignored, task-local, non-authoritative and deletable. It is not Source, Context, a Contract, Authority, Evidence, Receipt, Gate, Provider registry, scheduler, acceptance state or completion conclusion. There is no global session registry, event log, heartbeat, polling loop or state-machine service.
|
|
10
|
+
|
|
11
|
+
For deterministic classification, apply four fail-closed invariants before details: validate every semantic key independently; retain every valid accepted/rejected/unresolved decision and its authority row even when a later patch, audit or owner fails; reject deterministic checkpoint input whose claimed Source authority is invalid; and report a requested or pending unsafe reconciliation/writeback as blocked rather than as no action. Provider/resource selection never fills a missing authority row, and one key's authority never covers another key.
|
|
12
|
+
|
|
13
|
+
## Base and replayable Delta
|
|
14
|
+
|
|
15
|
+
Freeze one current Base with:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
locator: repository/relative/file
|
|
19
|
+
raw_byte_digest: sha256
|
|
20
|
+
encoding: detected-by-helper
|
|
21
|
+
eol_policy: detected-by-helper
|
|
22
|
+
scope_ceiling: bounded-scope-key
|
|
23
|
+
in_scope_keys: []
|
|
24
|
+
explicitly_excluded_keys: []
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The Base must be repository-readable and raw-digest verifiable: ordinary project Source, a materialized project-native Proposal, or an explicitly authorized disclosure-reviewed recovery snapshot. A Provider resource is recoverable only when its immutable identity can be fetched again and checked. Conversation-only input, expiring external documents, unavailable attachments and sensitive inputs are not recovered from locators. Materialize only with explicit user authorization. Never persist credentials, tokens, secrets, protected raw values or sensitive originals. Otherwise report exactly `cross-session deterministic recovery unavailable`; when no checkpoint exists, its checkpoint disposition is `none`, not rejection of a nonexistent file.
|
|
28
|
+
|
|
29
|
+
Every Delta stores actual replay semantics, never only an ID:
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
delta_id: stable-key
|
|
33
|
+
sequence: 1
|
|
34
|
+
supersedes: []
|
|
35
|
+
proposes_replacement_of: []
|
|
36
|
+
operation: add | replace | remove | preserve
|
|
37
|
+
semantic_kind: exact-visual | product | business | permission | data | algorithm | commercial | safety-security | technical
|
|
38
|
+
target_keys: []
|
|
39
|
+
before_semantics: complete-value-or-null
|
|
40
|
+
after_semantics: complete-value-or-null
|
|
41
|
+
origin: user-direct | necessary-derived | repository-evidence-backed | provider-suggested
|
|
42
|
+
decision_authority: explicit-user | delegated:<bounded-scope-key> | none
|
|
43
|
+
evidence_refs: []
|
|
44
|
+
source_refs: []
|
|
45
|
+
explicitly_unchanged_keys: []
|
|
46
|
+
status: accepted | rejected | unresolved
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Retain all statuses, exact ordering, one-way supersession and explicit unchanged keys. Only an accepted Delta may supersede an earlier active accepted Delta, and it must replace the same target set, semantic kind and exact prior `after_semantics`; a rejected or unresolved Delta never deactivates accepted meaning. Use `proposes_replacement_of` for a rejected/unresolved proposal which may be decided later. Cross-target or semantic mismatch fails closed.
|
|
50
|
+
|
|
51
|
+
After legal supersession, every stable semantic target key has at most one active accepted Delta owner. Two active accepted Deltas for one target without a legal replacement relationship fail closed. This version deliberately has no generic merge or composition DSL; a future need to compose one semantic key from several Deltas requires a separately admitted mechanism.
|
|
52
|
+
|
|
53
|
+
Derive the complete inactive universe as rejected plus unresolved plus superseded accepted Delta IDs. The current audit supplies exactly one leakage row for every inactive ID with the matching reason and `leaked: false`; missing, extra, duplicate or active-ID rows fail closed. If an inactive meaning remains in the Proposal, selected-resource projection or resulting writeback, reconciliation is blocked.
|
|
54
|
+
|
|
55
|
+
Status inventories contain stable target-key identities, never `key=value` strings; semantic values stay in the Delta rows. The same key can therefore remain in the accepted inventory while a later rejected or unresolved proposal for that key remains visible in its own inventory. A blocked audit or illegal final owner does not rewrite an independently authorized accepted Delta as unresolved.
|
|
56
|
+
|
|
57
|
+
Each `source_ref` resolves through `authority_sources` to one repository-contained Source document, its current raw-byte digest, one actual marked Source item, the item kind and item-text digest. An arbitrary string or conversation-only locator cannot create authority or enter deterministic recovery. For deterministic accepted authority, that same marked Source Item also contains one strict, non-rendered, package-owned single-line `ty-dra-authority-v1` JSON projection covered by the Item text digest. Free text without this projection can continue through ordinary conversational DRA, but it cannot machine-close deterministic recovery authority or enter a checkpoint as accepted authority.
|
|
58
|
+
|
|
59
|
+
An explicit projection uses `mode: explicit-user` and enumerates exact target keys, semantic kinds, allowed origins and the canonical `after_semantics` SHA-256. Its `target_keys` set must equal the bound Delta target set; a coupled `[A, B]` decision cannot be rebound as an independently authorized `[A]` meaning. A delegation projection uses `mode: delegation` and enumerates its stable delegation key plus exact allowed target keys, semantic kinds and origins. `delegated:<id>` names the matching task-local delegation row, and the accepted Delta binds that same decision Source. Delegation is deliberately a bounded superset: every Delta target must be a member of the delegation's allowed targets. Do not substitute an incidental target path for delegation identity. A hierarchical-looking key such as `checkout.confirmation` does not implicitly authorize `checkout.confirmation.fade_duration`, a sibling or a broader target.
|
|
60
|
+
|
|
61
|
+
`origin` records where the meaning arose, not where its Source item happens to be stored. Materializing a direct user choice in the repository leaves it `user-direct`; use `repository-evidence-backed` only when repository evidence itself supplies the meaning. A separate decision Source can authorize a meaning without changing that meaning's origin.
|
|
62
|
+
|
|
63
|
+
A selected resource is evidence and never authorizes itself. An accepted Provider suggestion requires explicit user authority or a delegation which covers its origin, semantic kind and every target. Delegation authorizes bounded choice; it is not automatically the Source for the chosen non-visual meaning. Product capability, business, permission, data, algorithm, commercial and safety/security meaning additionally binds an independent authoritative Source Item, separate from the delegation item, whose own projection simultaneously matches the exact target set, semantic kind, origin and canonical `after_semantics` digest. An unrelated requirement kind cannot fill that slot. A specific explicit-user decision item may carry both meaning and acceptance, but a general bounded-delegation decision alone is not the meaning. Exact visual values may remain exclusively resource-owned, but their adoption authority remains independently Source-bound. A visual-color delegation therefore cannot be rebound to product, business or permission meaning. Provider-added meaning lacking authority remains `unresolved` unless an authoritative decision explicitly rejects it. Rejected/unresolved meaning never enters accepted requirements or writeback.
|
|
64
|
+
|
|
65
|
+
The helper proves consistency between Source-owned structured scope and Delta fields. Interpreting the higher-level semantics of arbitrary free text remains part of the Authoring TCB; the helper does not implement general natural-language entailment.
|
|
66
|
+
|
|
67
|
+
Reconstruct each round only from:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
current Base@raw digest
|
|
71
|
+
+ ordered active accepted Delta semantics
|
|
72
|
+
+ current unresolved decisions
|
|
73
|
+
+ current scope/exclusions
|
|
74
|
+
+ current Design Authority identity
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Never use a prior Agent summary or generated resource as the next Base. Missing semantics, stale Base, invalid sequence/supersession/delegation or an out-of-scope/excluded target fails closed.
|
|
78
|
+
|
|
79
|
+
## Conditional checkpoint and helper
|
|
80
|
+
|
|
81
|
+
Prepare one disclosure-reviewed JSON input using schema `design-resource-recovery-input-v4`, including session identity, Base, `authority_sources`, delegations/Deltas, exact accepted/rejected/unresolved sets, current Design Authority identity, immutable Provider project/run/resource references, `selected_resource_bindings`, one frozen `audit_expectations` catalog and optional writeback. The catalog owns the exact changed, unchanged, resource-decision, blast-radius and inactive-leakage row expectations, including Delta/resource/condition/basis/binding identities. Every resource-decision binding freezes one and only one `final_disposition`: `proposal-written` with its exact operation ID, `resource-owned-exact-visual` with its selected resource/conditions/structured owner, `not-adopted` for rejected or superseded meaning, or `unresolved` for unresolved meaning. Audit observes and verifies this owner; it never selects it. Changing an owner requires checkpoint `update` with digest CAS. The catalog is the only checkpoint audit-universe/owner owner; current audit rows must be set-equal to it rather than merely non-empty. Selected resource bindings declare one unique resource key, generic `repository-snapshot` or `external-immutable` identity, locator, raw-byte digest and exact condition identities. Arbitrary condition strings and duplicate identities fail closed.
|
|
82
|
+
|
|
83
|
+
Create/retain a checkpoint for a real interruption or pending CAS writeback; use `none` when neither exists, and `reject` when a requested new checkpoint, input, destination or existing checkpoint cannot be admitted. Never turn an invalid authority request into `none` merely because no file was written. Then explicitly create it when required:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
ty-context design-resource recovery create <session> --input <state.json>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When a real recovered loop changes Delta, resource or pending writeback inputs, replace the existing checkpoint only through digest CAS:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
ty-context design-resource recovery update <session> --input <state.json> --expected-sha256 <current-checkpoint-sha256>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The helper writes the next canonical checkpoint to an exclusive same-directory temporary file, rechecks the current digest, atomically replaces and rereads it. A mismatch retains the old checkpoint and fails closed. Repeated identical input is an idempotent no-write. This creates no session registry.
|
|
96
|
+
|
|
97
|
+
The helper writes only:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
tmp/ty-context/design-resource-recovery/<session>/checkpoint.json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
and requires the path to be ignored and untracked. It validates strict schema/version, canonical bytes, Base identity, complete Delta/delegation semantics, repository containment/no-follow parents, symlink/junction/hardlink and user collision boundaries. The checkpoint adds detected Base encoding/EOL and, when applicable, detected target encoding/EOL. It stores no current activity, live Provider execution, Artifact readiness, Design suitability, next action, readiness/completion or acceptance.
|
|
104
|
+
|
|
105
|
+
Use `inspect` after interruption. It re-reads Base and repository Design Authority, validates raw identities, reconstructs ordered active accepted/rejected/unresolved semantics and derives writeback state. External Provider/resource and external Design Authority identities remain explicitly listed for current revalidation; the helper does not contact or manage Providers.
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
ty-context design-resource recovery inspect <session> [--json]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Unknown schema, corrupt JSON, stale Base/authority or unavailable semantics fails closed. In particular, v3 input/checkpoint/audit and exact-patch-v3 are never silently interpreted as v4/exact-patch-v4; reconstruct current state from Source, Provider identities and Proposal instead of inferring missing bindings or establishing a migration registry. The helper's deterministic boundary is supported repository files and exact bytes; a locator alone is not proof of recoverability.
|
|
112
|
+
|
|
113
|
+
## Current audits and status card
|
|
114
|
+
|
|
115
|
+
Before selection/writeback and after every material revision, re-read current resources and perform three upstream audits:
|
|
116
|
+
|
|
117
|
+
1. **Requirements → Resource:** every frozen active accepted changed key has the catalog's exact Delta, selected immutable resource and condition bindings. Every frozen explicit-unchanged key has exactly the catalog's resource, condition and authority-basis Source bindings. A referenced condition must belong to the selected resource's declared conditions. Missing, extra, duplicate, unresolved, distorted or falsely claimed coverage fails closed.
|
|
118
|
+
2. **Resource → Requirements:** freeze every material resource-decision row and its one final disposition per binding in the checkpoint catalog. Each row binds exact Delta IDs and a separate stable binding ID plus requirement-key/Delta/origin/decision-authority/Source tuple for every key; authorization of one key never covers another. The global `(resource_ref, requirement_key, delta_id)` and `(delta_id, target_key)` identities are unique across all rows; duplicate arrays or cross-row bindings fail before any Map/Set normalization. Every active non-preserve `Delta × target` has exactly one final disposition. `proposal-written` binds one real patch operation ID. `resource-owned-exact-visual` is limited to exact visual meaning and binds one immutable selected resource, exact declared conditions and a structured `selected-source-record` or `external-immutable` owner. Rejected/superseded uses `not-adopted`; unresolved uses `unresolved` and blocks readiness. Provider success, audit choice or a selected file cannot create authority.
|
|
119
|
+
3. **Unexpected Blast Radius and inactive leakage:** the catalog freezes the complete blast-radius universe, including every explicit Base exclusion, and every inactive Delta leakage row. Inspect every blast row for out-of-scope pages, controls, copy, layout, tokens and states, and every leakage row for reappearance of rejected, unresolved or superseded meaning. Missing, extra, duplicate, unexpected or unresolved rows fail closed.
|
|
120
|
+
|
|
121
|
+
Provider execution, Artifact readiness and Design suitability are independent. Provider success, complete fields or repeated values never prove suitability; a valid shared Token or inherited component variant must not be rejected merely because a value repeats. Block direct/Design-Authority conflict, wrong target/condition, missing material state, placeholder-final content, unsupported added meaning, unresolved promotion, stale identity and incomplete formal closure.
|
|
122
|
+
|
|
123
|
+
Derive—not restore—a status card containing Base identity; accepted/rejected/unresolved Delta; current changed and explicitly unchanged keys; Provider run identity; current live Provider execution; current Artifact readiness; freshly audited Design suitability; all three audit findings; current digest-derived writeback CAS state; and next action. A requested status card re-runs the current audits: an executing run or incomplete current resource is `blocked`, not a restored or `not-applicable` audit conclusion. The checkpoint contains none of those live conclusions.
|
|
124
|
+
|
|
125
|
+
Derive status fields with one meaning each:
|
|
126
|
+
|
|
127
|
+
- checkpoint: `none` when no checkpoint exists or is needed, `create` for a real interruption/pending CAS writeback, `retain` for an existing valid checkpoint, and `reject` for a proposed or existing invalid/unsupported checkpoint, input or unsafe destination;
|
|
128
|
+
- write action: `none` when no Proposal writeback/promotion is pending or requested (including a recovery-availability inquiry), `preview` for a safe pending patch not yet approved for apply, `apply` only for pre-digest plus balanced audit, `idempotent-no-write` for expected-post bytes, and `block` when a requested/pending writeback is unauthorized, stale, conflicting or audit-blocked;
|
|
129
|
+
- audit: `not-applicable` only when no current selected/resource surface is available to audit, `blocked` when any current audit cannot balance, and `balanced` only after all three current audits and leakage checks pass.
|
|
130
|
+
|
|
131
|
+
An unauthorized meaning in a selected resource therefore blocks its Proposal promotion/writeback even if the file remains valid visual evidence; an unavailable conversation-only Base with no writeback request reports no write action.
|
|
132
|
+
|
|
133
|
+
Project the decision inventory before projecting the action result. An independently Source-valid accepted Delta stays in the accepted inventory and keeps its authority row when a later patch, resource identity, condition/basis binding, audit row or final owner is invalid; those later defects block reconciliation, readiness and writeback but do not demote or erase the accepted meaning. When balanced reconciliation, promotion, handoff or writeback is requested or imminent, any duplicate identity/cross-row binding, condition/basis mismatch, illegal/multiple/unreadable final owner, inactive leakage or patch mismatch means a blocked result, blocked current audit and blocked write action—not `none` or `unavailable`—with every affected audit direction reported. If the authority Source/projection itself fails target, semantic kind, origin, meaning digest or repository identity, reject the deterministic input/checkpoint and do not accept that meaning. For a deterministic create/update input, this is checkpoint `reject` even when no prior checkpoint exists; normalizing the invalid claimed acceptance into rejected or unresolved meaning does not turn the invalid input into checkpoint `none`. Retain an existing valid checkpoint when an update/cleanup conflict or partial cleanup prevents the requested operation.
|
|
134
|
+
|
|
135
|
+
Apply the table to imminent work, not only completed commands: a valid authorized Delta plus an immutable resource and a real interruption expected before writeback requires checkpoint `create` and write action `preview`; a handoff-ready request with any current audit/authority gap requires write action `block`; and frozen pre/post digests plus a balanced current audit are a pending CAS writeback requiring checkpoint `create` or `retain` and write action `apply`.
|
|
136
|
+
|
|
137
|
+
## Safe writeback and reconciliation
|
|
138
|
+
|
|
139
|
+
Create a writeback only when at least one frozen active binding is `proposal-written`. Freeze target locator, pre-write raw digest, exact `design-resource-exact-patch-v4`, canonical patch digest, expected post bytes/digest, selected resource identities and `proposal_written_delta_ids`. The immutable replay Base and mutable writeback target must be distinct locators; if the current Proposal itself must be updated, first use an explicitly authorized immutable Source/snapshot as Base. The exact patch universe is only the active accepted `Delta × target` bindings frozen as `proposal-written`; resource-owned exact values remain in effective requirements and audit but never enter or get copied into Proposal.
|
|
140
|
+
|
|
141
|
+
Every patch operation has one unique ID, exactly one Delta, one target, one semantic binding and one `source_span` in `utf16-code-unit-v1` coordinates over the original decoded pre-write Proposal. Every non-null before/after semantics has exactly one JSON scalar leaf, and the declared local text projection must cover that leaf. Ordinary string scalars containing CR, LF, NUL or another control character are unsupported; never permit a value such as `red\npermission.admin: true` to escape its scalar carrier.
|
|
142
|
+
|
|
143
|
+
For `replace`, split each local before/after text at its projected scalar. The complete prefix before the scalar and suffix after it must be character-for-character equal; only the projected scalar may change. Adding a permission line, renaming a label or deleting nearby prose inside the same operation is blocked and requires a separately authorized Delta rather than piggybacking on the scalar replacement.
|
|
144
|
+
|
|
145
|
+
Free-text add/remove cannot establish non-interference. `add` requires null before semantics, preserves one exact nonempty insertion anchor and adds exactly one package-canonical single-line `ty-dra-proposal-scalar-v1` carrier plus the current uniform EOL. That carrier contains only `target_key`, `semantic_path` and the canonical JSON scalar value. `remove` projects one before leaf to null, requires empty `after_text` and deletes exactly one already canonical carrier whose target/path/value match the Delta; it cannot widen over an adjacent heading, requirement, explanation or other target. `disabled`, `removed`, `deprecated` or another non-empty substitute is new meaning requiring a separate Delta. If the current Proposal has no supported anchor/carrier, report exactly `deterministic Proposal writeback unavailable`; return a complete revised Proposal for user confirmation or retain the exact value as resource-owned instead of falling back to generic string replacement.
|
|
146
|
+
|
|
147
|
+
Fail closed from the actual patch-v4 operation and Proposal bytes, not from omitted detail in a concise audit summary. A statement that an operation exactly projects its one leaf and that its anchor/carrier, preimage and expected post bytes are current is a positive claim of those named invariants unless another fact contradicts it; do not invent a missing carrier, malformed carrier or free-text fallback merely because the summary does not repeat the serialized carrier. Conversely, a claimed valid operation never overrides an observed parser, target/path/value, anchor, scaffold or span mismatch.
|
|
148
|
+
|
|
149
|
+
For a decision-only review whose supplied facts are an invariant summary rather than the serialized operation, treat these as sufficient positive patch-v4 claims unless another supplied fact names a mismatch: an add with null before semantics, exactly one after scalar, `before_text` used only as a preserved structural anchor, exact after projection and current pre/post bytes; or a remove with exactly one before scalar, null after semantics, empty `after_text`, exact before projection and current post bytes in which the old `before_text` is absent. Such a positive summary is `allow`/balanced and does not itself reveal missing carrier bytes. This interpretation never relaxes create/update: when actual operation bytes are available, the helper must parse and verify the canonical carrier, anchor and source span and fail closed on any mismatch.
|
|
150
|
+
|
|
151
|
+
A carrier, scaffold, projection or source-span defect is a downstream patch defect, not a new authority decision. When the Delta's Source and decision authority remain valid, preserve that Delta in `accepted_keys` and preserve its authority row while returning a blocked disposition/audit/write action and rejecting the invalid checkpoint input. Never erase or demote already accepted meaning merely to express that its proposed patch cannot be applied; only an actual Source/authority failure changes the accepted inventory.
|
|
152
|
+
|
|
153
|
+
Checkpoint create/update resolves every source span against the same original Proposal before mutation. The frozen interval must equal `before_text` and both text digests, and all spans must be pairwise disjoint and non-nested; operations cannot share a character or insertion anchor. Apply sorts original spans by descending offset and replaces only those intervals, so a later operation cannot consume output generated by an earlier operation. Readback calculates each final interval from original offsets and length deltas, checks its exact output plus the whole-file expected digest and thereby conserves untouched prefix, suffix and inter-operation gaps. A source span cannot represent two independent meanings. Inactive, unknown or resource-owned bindings cannot enter the patch, and changing red semantics to purple text without changing the Delta is rejected during create/update. For an active superseder, the declared prior `before_text` projection must also be absent from the computed and reread post-write Proposal; its survival is inactive-meaning leakage. This is a bounded scalar-carrier projection proof, not general NLP entailment or arbitrary text-diff semantics. Preview before mutation:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
ty-context design-resource recovery preview <session> [--json]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Current target digest determines state:
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
current == pre-write digest => unapplied
|
|
163
|
+
current == expected post digest => already applied/idempotent
|
|
164
|
+
otherwise => concurrent conflict; fail closed
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Produce a fresh `design-resource-reconciliation-audit-v4` bound to the same Base, Design Authority, Provider run, selected resource digests, optional expected target digest, current decision sets and the checkpoint's complete audit-expectations catalog. Include Requirements→Resource, per-key Resource→Requirements, blast-radius and inactive-leakage rows. For a Proposal writeback, apply:
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
ty-context design-resource recovery apply <session> --audit <audit.json>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The helper first requires a balanced fresh audit, validates checkpoint-frozen structured downstream owners and CAS, reapplies the exact patch from the frozen original spans in memory, preserves supported UTF-8/BOM or UTF-16 encoding and the existing non-mixed EOL policy, writes a same-directory exclusive temporary file, syncs it, rechecks the target, atomically renames, rereads expected bytes, verifies every operation's calculated final interval—or removed canonical carrier—plus whole-file digest, and reconciles again. An already-post state performs no write. A `selected-source-record` owner must be repository-readable at its bound digest; an external-only Provider locator stays revalidation-pending.
|
|
174
|
+
|
|
175
|
+
When no binding is `proposal-written`, omit writeback and do not invent an empty patch or transaction. Re-read Source, selected resources and downstream owners and reconcile the complete catalog read-only:
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
ty-context design-resource recovery reconcile <session> --audit <audit.json>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Recovery uses only generic repository snapshot/source-record identity. It does not accept a `formal-handoff-target` label or duplicate the formal handoff parser; formal Web/App handoff readiness remains owned by `ty-context design-resource preflight`.
|
|
182
|
+
|
|
183
|
+
A valid resource-owned-only case may be `allow` plus `reconciliation-balanced` with `write_action: none`, but the helper-level `handoff_ready` projection remains false. Any later readiness claim waits for the Skill-owned composition of current Provider/resource revalidation, durable final ownership and applicable formal preflight; never infer readiness merely from a balanced read-only reconcile.
|
|
184
|
+
|
|
185
|
+
The helper reports only `reconciliation-balanced`, `writeback-applied`, `writeback-idempotent`, `blocked` or `external-resource-revalidation-pending`. It does not report `handoff-ready`. Missing/extra/duplicate/unresolved/distorted/unsupported coverage, per-key authority mismatch, ambiguous/illegal final ownership, inactive leakage, changed explicit-unchanged meaning, unexpected blast radius or any identity mismatch returns `blocked`. A selected external resource which the helper cannot currently reread keeps external revalidation pending even after a valid Proposal writeback.
|
|
186
|
+
|
|
187
|
+
Same-directory rename, filesystem durability and the remaining same-user pre-rename race are the named Windows/macOS filesystem TCB. This is not hostile-writer linearizability or crash-proof storage. Cleanup failure is explicit. The helper removes only an exact digest-matched valid checkpoint and its now-empty session directory:
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
ty-context design-resource recovery remove <session> --expected-sha256 <sha256>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Before removal it inventories the session directory. It removes the checkpoint and directory only when the directory contains exactly the helper-owned digest-matched checkpoint. Any other entry returns an explicit `partial` result and preserves both the checkpoint and unowned content; a race after checkpoint removal also returns `partial` with the retained entries. It never scans or deletes unrelated `tmp`, `.work_products`, `artifacts` or reports.
|
|
194
|
+
|
|
195
|
+
## Downstream boundary
|
|
196
|
+
|
|
197
|
+
Proposal–Resource reconciliation is upstream diagnostic information. It never replaces the Proposal, selected immutable resources, formal handoff, downstream UI Authority Closure or project implementation checks. A later Long-Task can prove only final Source/Contract bindings, current implementation and current Evidence. Its sole Final Gate cannot prove historical Provider execution, and the checkpoint/audits/status card never enter Long-Task Source, Contract, Authority, Evidence or completion.
|
|
198
|
+
|
|
199
|
+
Only the DRA Skill may derive final `handoff-ready`, and only from helper reconciliation balance plus current Provider/resource revalidation, one durable final owner per active binding, every applicable formal handoff/preflight and no unresolved blocker. This composition is not a new Gate and says nothing about Provider history, subjective optimality, arbitrary natural-language truth or completed product implementation.
|