project-tiny-context-harness 0.8.16 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -41
- package/assets/README.md +184 -55
- package/assets/README.zh-CN.md +114 -40
- package/assets/agents/AGENTS_CORE.md +2 -2
- package/assets/context_templates/context.toml +6 -1
- package/assets/context_templates/screen-contract.md +16 -0
- package/assets/runtime/windows-job-supervisor/formal_process_supervisor_native_helpers.cs +301 -0
- package/assets/runtime/windows-job-supervisor/formal_process_supervisor_native_run.cs +197 -0
- package/assets/runtime/windows-job-supervisor/formal_process_supervisor_native_types.cs +215 -0
- package/assets/runtime/windows-job-supervisor/windows_job_process_supervisor.ps1 +117 -0
- package/assets/skills/context_development_engineer/SKILL.md +16 -30
- package/assets/skills/context_development_engineer/references/engineering-design-reasoning.md +93 -0
- package/assets/skills/context_surface_contract/SKILL.md +13 -2
- package/assets/skills/context_uiux_design/SKILL.md +7 -3
- package/assets/skills/context_uiux_design/references/task-uiux-analysis.md +82 -0
- package/assets/skills/design-resource-authoring/SKILL.md +18 -9
- package/assets/skills/design-resource-authoring/references/authority-delta-assessment.md +52 -0
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +22 -6
- package/assets/skills/design-resource-authoring/references/formal-selected-web-app-handoff.md +26 -8
- package/assets/skills/design-resource-authoring/references/implementation-feasibility.md +111 -0
- package/assets/skills/design-resource-authoring/references/open-design-provider.md +45 -7
- package/assets/skills/design-resource-authoring/references/recovery-and-writeback.md +7 -1
- package/assets/skills/design-resource-authoring/references/resource-selection.md +115 -3
- package/assets/skills/design-system-authoring/SKILL.md +23 -17
- package/assets/skills/design-system-authoring/references/authority-adoption.md +19 -9
- package/assets/skills/design-system-authoring/references/open-design-design-system-provider.md +4 -0
- package/assets/skills/long-task-workflow/SKILL.md +6 -6
- package/assets/skills/long-task-workflow/references/authority-lifecycle.md +10 -4
- package/assets/skills/long-task-workflow/references/contract-authoring.md +5 -5
- package/assets/skills/long-task-workflow/references/evidence-design.md +14 -3
- package/assets/skills/long-task-workflow/references/source-authoring.md +11 -8
- package/assets/tools/context_rules.json +53 -0
- package/assets/tools/validate_context.py +302 -77
- package/dist/cli.js +2 -1
- package/dist/commands/context-create.d.ts +1 -0
- package/dist/commands/context-create.js +90 -0
- package/dist/commands/context-inspect.d.ts +1 -0
- package/dist/commands/context-inspect.js +98 -0
- package/dist/commands/context-move.d.ts +1 -0
- package/dist/commands/context-move.js +78 -0
- package/dist/commands/context-register.d.ts +1 -0
- package/dist/commands/context-register.js +110 -0
- package/dist/commands/context-transaction.d.ts +1 -0
- package/dist/commands/context-transaction.js +84 -0
- package/dist/commands/context.d.ts +1 -0
- package/dist/commands/context.js +36 -0
- package/dist/commands/design-authority-delta.d.ts +1 -0
- package/dist/commands/design-authority-delta.js +53 -0
- package/dist/commands/design-authority.d.ts +1 -0
- package/dist/commands/design-authority.js +104 -0
- package/dist/commands/design-resource.js +17 -3
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.js +61 -3
- package/dist/commands/index.js +19 -2
- package/dist/commands/long-task-authoring.js +20 -2
- package/dist/commands/long-task-workdir.d.ts +2 -0
- package/dist/commands/long-task-workdir.js +23 -0
- package/dist/commands/long-task.js +75 -6
- package/dist/commands/route.d.ts +15 -0
- package/dist/commands/route.js +142 -0
- package/dist/index.d.ts +3 -13
- package/dist/index.js +3 -12
- package/dist/lib/cli-exit.d.ts +14 -0
- package/dist/lib/cli-exit.js +19 -0
- package/dist/lib/context-catalog/catalog-default-footprint.d.ts +3 -0
- package/dist/lib/context-catalog/catalog-default-footprint.js +53 -0
- package/dist/lib/context-catalog/catalog-diagnostics.d.ts +9 -0
- package/dist/lib/context-catalog/catalog-diagnostics.js +34 -0
- package/dist/lib/context-catalog/catalog-discovery.d.ts +7 -0
- package/dist/lib/context-catalog/catalog-discovery.js +81 -0
- package/dist/lib/context-catalog/catalog-load.d.ts +8 -0
- package/dist/lib/context-catalog/catalog-load.js +187 -0
- package/dist/lib/context-catalog/catalog-path-validation.d.ts +7 -0
- package/dist/lib/context-catalog/catalog-path-validation.js +62 -0
- package/dist/lib/context-catalog/catalog-paths.d.ts +11 -0
- package/dist/lib/context-catalog/catalog-paths.js +41 -0
- package/dist/lib/context-catalog/catalog-portable-contract.d.ts +15 -0
- package/dist/lib/context-catalog/catalog-portable-contract.js +68 -0
- package/dist/lib/context-catalog/catalog-staged-path-safety.d.ts +1 -0
- package/dist/lib/context-catalog/catalog-staged-path-safety.js +36 -0
- package/dist/lib/context-catalog/catalog-types.d.ts +40 -0
- package/dist/lib/context-catalog/catalog-types.js +1 -0
- package/dist/lib/context-catalog/catalog-validation.d.ts +9 -0
- package/dist/lib/context-catalog/catalog-validation.js +148 -0
- package/dist/lib/context-create/context-create-path.d.ts +2 -0
- package/dist/lib/context-create/context-create-path.js +30 -0
- package/dist/lib/context-create/context-create-template.d.ts +2 -0
- package/dist/lib/context-create/context-create-template.js +95 -0
- package/dist/lib/context-create/context-create-types.d.ts +28 -0
- package/dist/lib/context-create/context-create-types.js +1 -0
- package/dist/lib/context-create/context-create-write.d.ts +1 -0
- package/dist/lib/context-create/context-create-write.js +85 -0
- package/dist/lib/context-create/context-create.d.ts +2 -0
- package/dist/lib/context-create/context-create.js +84 -0
- package/dist/lib/context-default-footprint.d.ts +2 -3
- package/dist/lib/context-default-footprint.js +49 -57
- package/dist/lib/context-doctor/context-doctor-types.d.ts +16 -0
- package/dist/lib/context-doctor/context-doctor-types.js +15 -0
- package/dist/lib/context-doctor/context-doctor.d.ts +2 -0
- package/dist/lib/context-doctor/context-doctor.js +130 -0
- package/dist/lib/context-graph-snapshot.d.ts +5 -0
- package/dist/lib/context-graph-snapshot.js +46 -25
- package/dist/lib/context-inspect/context-inspect-projection.d.ts +9 -0
- package/dist/lib/context-inspect/context-inspect-projection.js +49 -0
- package/dist/lib/context-inspect/context-inspect-render.d.ts +2 -0
- package/dist/lib/context-inspect/context-inspect-render.js +29 -0
- package/dist/lib/context-inspect/context-inspect-types.d.ts +43 -0
- package/dist/lib/context-inspect/context-inspect-types.js +1 -0
- package/dist/lib/context-inspect/context-inspect.d.ts +2 -0
- package/dist/lib/context-inspect/context-inspect.js +104 -0
- package/dist/lib/context-manifest-schema.d.ts +1 -1
- package/dist/lib/context-manifest-schema.js +4 -20
- package/dist/lib/context-markdown/context-markdown-analysis.d.ts +15 -0
- package/dist/lib/context-markdown/context-markdown-analysis.js +245 -0
- package/dist/lib/context-markdown/context-markdown-extract.d.ts +7 -0
- package/dist/lib/context-markdown/context-markdown-extract.js +114 -0
- package/dist/lib/context-markdown/context-markdown-types.d.ts +57 -0
- package/dist/lib/context-markdown/context-markdown-types.js +1 -0
- package/dist/lib/context-move/context-move-input.d.ts +8 -0
- package/dist/lib/context-move/context-move-input.js +17 -0
- package/dist/lib/context-move/context-move-literal-scan.d.ts +20 -0
- package/dist/lib/context-move/context-move-literal-scan.js +213 -0
- package/dist/lib/context-move/context-move-live-validation.d.ts +3 -0
- package/dist/lib/context-move/context-move-live-validation.js +56 -0
- package/dist/lib/context-move/context-move-markdown-plan.d.ts +22 -0
- package/dist/lib/context-move/context-move-markdown-plan.js +39 -0
- package/dist/lib/context-move/context-move-projection.d.ts +3 -0
- package/dist/lib/context-move/context-move-projection.js +11 -0
- package/dist/lib/context-move/context-move-reference-validation.d.ts +11 -0
- package/dist/lib/context-move/context-move-reference-validation.js +64 -0
- package/dist/lib/context-move/context-move-render.d.ts +2 -0
- package/dist/lib/context-move/context-move-render.js +24 -0
- package/dist/lib/context-move/context-move-support.d.ts +10 -0
- package/dist/lib/context-move/context-move-support.js +88 -0
- package/dist/lib/context-move/context-move-transaction-plan.d.ts +24 -0
- package/dist/lib/context-move/context-move-transaction-plan.js +108 -0
- package/dist/lib/context-move/context-move-types.d.ts +74 -0
- package/dist/lib/context-move/context-move-types.js +1 -0
- package/dist/lib/context-move/context-move.d.ts +8 -0
- package/dist/lib/context-move/context-move.js +180 -0
- package/dist/lib/context-mutation/manifest-lossless-patch.d.ts +28 -0
- package/dist/lib/context-mutation/manifest-lossless-patch.js +208 -0
- package/dist/lib/context-mutation/markdown-link-patch.d.ts +34 -0
- package/dist/lib/context-mutation/markdown-link-patch.js +143 -0
- package/dist/lib/context-mutation/markdown-link-spans.d.ts +10 -0
- package/dist/lib/context-mutation/markdown-link-spans.js +179 -0
- package/dist/lib/context-mutation/mutation-cas.d.ts +13 -0
- package/dist/lib/context-mutation/mutation-cas.js +365 -0
- package/dist/lib/context-mutation/mutation-command-support.d.ts +12 -0
- package/dist/lib/context-mutation/mutation-command-support.js +57 -0
- package/dist/lib/context-mutation/mutation-commit.d.ts +12 -0
- package/dist/lib/context-mutation/mutation-commit.js +89 -0
- package/dist/lib/context-mutation/mutation-directories.d.ts +5 -0
- package/dist/lib/context-mutation/mutation-directories.js +56 -0
- package/dist/lib/context-mutation/mutation-file-state.d.ts +14 -0
- package/dist/lib/context-mutation/mutation-file-state.js +137 -0
- package/dist/lib/context-mutation/mutation-journal-file-validation.d.ts +1 -0
- package/dist/lib/context-mutation/mutation-journal-file-validation.js +106 -0
- package/dist/lib/context-mutation/mutation-journal-io.d.ts +5 -0
- package/dist/lib/context-mutation/mutation-journal-io.js +55 -0
- package/dist/lib/context-mutation/mutation-journal-storage.d.ts +18 -0
- package/dist/lib/context-mutation/mutation-journal-storage.js +283 -0
- package/dist/lib/context-mutation/mutation-journal-validation-support.d.ts +16 -0
- package/dist/lib/context-mutation/mutation-journal-validation-support.js +140 -0
- package/dist/lib/context-mutation/mutation-journal-validation.d.ts +3 -0
- package/dist/lib/context-mutation/mutation-journal-validation.js +177 -0
- package/dist/lib/context-mutation/mutation-journal.d.ts +8 -0
- package/dist/lib/context-mutation/mutation-journal.js +111 -0
- package/dist/lib/context-mutation/mutation-live-validation.d.ts +3 -0
- package/dist/lib/context-mutation/mutation-live-validation.js +51 -0
- package/dist/lib/context-mutation/mutation-long-task-guard.d.ts +6 -0
- package/dist/lib/context-mutation/mutation-long-task-guard.js +57 -0
- package/dist/lib/context-mutation/mutation-recovery.d.ts +4 -0
- package/dist/lib/context-mutation/mutation-recovery.js +189 -0
- package/dist/lib/context-mutation/mutation-staged-fs.d.ts +5 -0
- package/dist/lib/context-mutation/mutation-staged-fs.js +56 -0
- package/dist/lib/context-mutation/mutation-types.d.ts +103 -0
- package/dist/lib/context-mutation/mutation-types.js +1 -0
- package/dist/lib/context-register/context-register-input.d.ts +11 -0
- package/dist/lib/context-register/context-register-input.js +43 -0
- package/dist/lib/context-register/context-register-render.d.ts +2 -0
- package/dist/lib/context-register/context-register-render.js +21 -0
- package/dist/lib/context-register/context-register-support.d.ts +6 -0
- package/dist/lib/context-register/context-register-support.js +46 -0
- package/dist/lib/context-register/context-register-types.d.ts +46 -0
- package/dist/lib/context-register/context-register-types.js +1 -0
- package/dist/lib/context-register/context-register.d.ts +8 -0
- package/dist/lib/context-register/context-register.js +155 -0
- package/dist/lib/context-router/context-route-budget.d.ts +15 -0
- package/dist/lib/context-router/context-route-budget.js +14 -0
- package/dist/lib/context-router/context-route-candidates.d.ts +15 -0
- package/dist/lib/context-router/context-route-candidates.js +112 -0
- package/dist/lib/context-router/context-route-order.d.ts +6 -0
- package/dist/lib/context-router/context-route-order.js +53 -0
- package/dist/lib/context-router/context-route-paths.d.ts +16 -0
- package/dist/lib/context-router/context-route-paths.js +109 -0
- package/dist/lib/context-router/context-route-render.d.ts +2 -0
- package/dist/lib/context-router/context-route-render.js +32 -0
- package/dist/lib/context-router/context-route-scan.d.ts +18 -0
- package/dist/lib/context-router/context-route-scan.js +156 -0
- package/dist/lib/context-router/context-route-selection.d.ts +16 -0
- package/dist/lib/context-router/context-route-selection.js +72 -0
- package/dist/lib/context-router/context-route-terms.d.ts +13 -0
- package/dist/lib/context-router/context-route-terms.js +202 -0
- package/dist/lib/context-router/context-route-types.d.ts +101 -0
- package/dist/lib/context-router/context-route-types.js +1 -0
- package/dist/lib/context-router/context-route.d.ts +2 -0
- package/dist/lib/context-router/context-route.js +127 -0
- package/dist/lib/context-units-migration.d.ts +13 -0
- package/dist/lib/context-units-migration.js +217 -0
- package/dist/lib/design-authority-binding.d.ts +7 -0
- package/dist/lib/design-authority-binding.js +96 -0
- package/dist/lib/design-authority-closure.d.ts +3 -0
- package/dist/lib/design-authority-closure.js +201 -0
- package/dist/lib/design-authority-delta-codec-primitives.d.ts +10 -0
- package/dist/lib/design-authority-delta-codec-primitives.js +58 -0
- package/dist/lib/design-authority-delta-codec.d.ts +2 -0
- package/dist/lib/design-authority-delta-codec.js +193 -0
- package/dist/lib/design-authority-delta-types.d.ts +65 -0
- package/dist/lib/design-authority-delta-types.js +6 -0
- package/dist/lib/design-authority-delta-validation.d.ts +2 -0
- package/dist/lib/design-authority-delta-validation.js +16 -0
- package/dist/lib/design-authority-digest.d.ts +8 -0
- package/dist/lib/design-authority-digest.js +36 -0
- package/dist/lib/design-authority-files.d.ts +9 -0
- package/dist/lib/design-authority-files.js +62 -0
- package/dist/lib/design-authority-format.d.ts +2 -0
- package/dist/lib/design-authority-format.js +93 -0
- package/dist/lib/design-authority-links.d.ts +10 -0
- package/dist/lib/design-authority-links.js +137 -0
- package/dist/lib/design-authority-manifest.d.ts +4 -0
- package/dist/lib/design-authority-manifest.js +144 -0
- package/dist/lib/design-authority-tokens.d.ts +9 -0
- package/dist/lib/design-authority-tokens.js +45 -0
- package/dist/lib/design-authority-types.d.ts +80 -0
- package/dist/lib/design-authority-types.js +23 -0
- package/dist/lib/design-md-tool-adapter.d.ts +9 -0
- package/dist/lib/design-md-tool-adapter.js +152 -0
- package/dist/lib/design-md-tool-normalization.d.ts +7 -0
- package/dist/lib/design-md-tool-normalization.js +78 -0
- package/dist/lib/design-md-tool-types.d.ts +99 -0
- package/dist/lib/design-md-tool-types.js +8 -0
- package/dist/lib/design-resource-handoff-bundle.js +5 -0
- package/dist/lib/design-resource-handoff-input-types.d.ts +1 -1
- package/dist/lib/design-resource-handoff-manifest-projection.js +4 -0
- package/dist/lib/design-resource-handoff-set-integrity.js +1 -0
- package/dist/lib/design-resource-handoff-shape.js +18 -2
- package/dist/lib/design-resource-handoff-types.d.ts +8 -0
- package/dist/lib/design-resource-handoff-validation.js +24 -0
- package/dist/lib/design-resource-implementation-feasibility-model.d.ts +35 -0
- package/dist/lib/design-resource-implementation-feasibility-model.js +62 -0
- package/dist/lib/design-resource-implementation-feasibility-shape-sections.d.ts +43 -0
- package/dist/lib/design-resource-implementation-feasibility-shape-sections.js +142 -0
- package/dist/lib/design-resource-implementation-feasibility-shape.d.ts +4 -0
- package/dist/lib/design-resource-implementation-feasibility-shape.js +154 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision-projection.d.ts +24 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision-projection.js +106 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision.d.ts +21 -0
- package/dist/lib/design-resource-implementation-feasibility-source-decision.js +75 -0
- package/dist/lib/design-resource-implementation-feasibility-types.d.ts +135 -0
- package/dist/lib/design-resource-implementation-feasibility-types.js +37 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-cells.d.ts +5 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-cells.js +125 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-document.d.ts +4 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-document.js +167 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-facts.d.ts +3 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-facts.js +76 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-realizations.d.ts +8 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-realizations.js +76 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-support.d.ts +10 -0
- package/dist/lib/design-resource-implementation-feasibility-validation-support.js +75 -0
- package/dist/lib/design-resource-implementation-feasibility-validation.d.ts +3 -0
- package/dist/lib/design-resource-implementation-feasibility-validation.js +138 -0
- package/dist/lib/design-resource-recovery-current.js +22 -0
- package/dist/lib/design-resource-recovery-shape.js +64 -7
- package/dist/lib/design-resource-recovery-types.d.ts +4 -1
- package/dist/lib/design-resource-symbolic-fact-shape.js +9 -1
- package/dist/lib/design-resource-symbolic-fact-types.d.ts +8 -0
- package/dist/lib/design-resource-symbolic-fact-validation.js +25 -0
- package/dist/lib/doctor.d.ts +2 -1
- package/dist/lib/doctor.js +29 -1
- package/dist/lib/fs.js +1 -1
- package/dist/lib/long-task-acceptance-reachability-claims.d.ts +2 -0
- package/dist/lib/long-task-acceptance-reachability-claims.js +279 -0
- package/dist/lib/long-task-acceptance-reachability-design.d.ts +2 -0
- package/dist/lib/long-task-acceptance-reachability-design.js +96 -0
- package/dist/lib/long-task-acceptance-reachability-external.d.ts +9 -0
- package/dist/lib/long-task-acceptance-reachability-external.js +123 -0
- package/dist/lib/long-task-acceptance-reachability-helpers.d.ts +64 -0
- package/dist/lib/long-task-acceptance-reachability-helpers.js +473 -0
- package/dist/lib/long-task-acceptance-reachability-semantic.d.ts +2 -0
- package/dist/lib/long-task-acceptance-reachability-semantic.js +122 -0
- package/dist/lib/long-task-acceptance-reachability-types.d.ts +91 -0
- package/dist/lib/long-task-acceptance-reachability-types.js +1 -0
- package/dist/lib/long-task-acceptance-reachability.d.ts +4 -0
- package/dist/lib/long-task-acceptance-reachability.js +115 -0
- package/dist/lib/long-task-activation-validation.d.ts +6 -0
- package/dist/lib/long-task-activation-validation.js +96 -23
- package/dist/lib/long-task-active-authority-lock-context.d.ts +4 -0
- package/dist/lib/long-task-active-authority-lock-context.js +29 -0
- package/dist/lib/long-task-applicability-identity.d.ts +25 -0
- package/dist/lib/long-task-applicability-identity.js +60 -0
- package/dist/lib/long-task-authoring-preflight-diagnostics.js +8 -0
- package/dist/lib/long-task-authoring-preflight-types.d.ts +2 -0
- package/dist/lib/long-task-authoring-preflight-types.js +9 -0
- package/dist/lib/long-task-authoring-preflight.js +18 -2
- package/dist/lib/long-task-authority-material-diff.js +4 -0
- package/dist/lib/long-task-authority-materials.js +19 -0
- package/dist/lib/long-task-authority-policy.d.ts +3 -0
- package/dist/lib/long-task-authority-policy.js +3 -0
- package/dist/lib/long-task-authority-revision-details.js +2 -1
- package/dist/lib/long-task-authority-types.d.ts +2 -0
- package/dist/lib/long-task-authority.js +2 -0
- package/dist/lib/long-task-check-runner.js +3 -296
- package/dist/lib/long-task-check-shape.js +6 -1
- package/dist/lib/long-task-claim-definitions.js +1 -3
- package/dist/lib/long-task-claim-semantic-proof-floor.d.ts +3 -0
- package/dist/lib/long-task-claim-semantic-proof-floor.js +78 -0
- package/dist/lib/long-task-claims.d.ts +0 -18
- package/dist/lib/long-task-claims.js +15 -14
- package/dist/lib/long-task-command-process.d.ts +9 -0
- package/dist/lib/long-task-command-process.js +178 -0
- package/dist/lib/long-task-compact-authoring.js +3 -0
- package/dist/lib/long-task-compact-projections.js +10 -0
- package/dist/lib/long-task-complete-delivery-evidence-types.d.ts +38 -0
- package/dist/lib/long-task-complete-delivery-evidence-types.js +1 -0
- package/dist/lib/long-task-completion-types.d.ts +109 -0
- package/dist/lib/long-task-completion-types.js +1 -0
- package/dist/lib/long-task-conformance-policy.d.ts +2 -1
- package/dist/lib/long-task-conformance-policy.js +11 -4
- package/dist/lib/long-task-context-authority-topology.js +6 -4
- package/dist/lib/long-task-contract-types.d.ts +52 -1
- package/dist/lib/long-task-counterfactual-sandbox.d.ts +7 -1
- package/dist/lib/long-task-counterfactual-sandbox.js +86 -6
- package/dist/lib/long-task-delivery-compiler-preflight.d.ts +24 -0
- package/dist/lib/long-task-delivery-compiler-preflight.js +32 -0
- package/dist/lib/long-task-delivery-compiler.d.ts +1 -0
- package/dist/lib/long-task-delivery-compiler.js +59 -44
- package/dist/lib/long-task-delivery-parser.d.ts +3 -0
- package/dist/lib/long-task-delivery-parser.js +26 -8
- package/dist/lib/long-task-delivery-types.d.ts +2 -0
- package/dist/lib/long-task-delivery-types.js +2 -0
- package/dist/lib/long-task-delivery-validation.d.ts +11 -3
- package/dist/lib/long-task-delivery-validation.js +23 -8
- package/dist/lib/long-task-design-feasibility-binding-owners.d.ts +6 -0
- package/dist/lib/long-task-design-feasibility-binding-owners.js +52 -0
- package/dist/lib/long-task-design-feasibility-binding.d.ts +14 -0
- package/dist/lib/long-task-design-feasibility-binding.js +114 -0
- package/dist/lib/long-task-design-feasibility-source-closure.d.ts +11 -0
- package/dist/lib/long-task-design-feasibility-source-closure.js +87 -0
- package/dist/lib/long-task-design-obligation.d.ts +50 -0
- package/dist/lib/long-task-design-obligation.js +99 -0
- package/dist/lib/long-task-design-resource-handoff.d.ts +5 -3
- package/dist/lib/long-task-design-resource-handoff.js +64 -4
- package/dist/lib/long-task-design-resource-method-binding.js +20 -2
- package/dist/lib/long-task-effective-external-takeover.d.ts +15 -0
- package/dist/lib/long-task-effective-external-takeover.js +109 -0
- package/dist/lib/long-task-effective-external-ui-takeover.d.ts +5 -0
- package/dist/lib/long-task-effective-external-ui-takeover.js +117 -0
- package/dist/lib/long-task-evidence-capability-codec.js +91 -0
- package/dist/lib/long-task-evidence-capability-runtime.js +62 -14
- package/dist/lib/long-task-evidence-capability-types.d.ts +3 -2
- package/dist/lib/long-task-evidence-v2.d.ts +6 -1
- package/dist/lib/long-task-evidence-v2.js +253 -170
- package/dist/lib/long-task-execution-observation.d.ts +7 -0
- package/dist/lib/long-task-execution-observation.js +21 -4
- package/dist/lib/long-task-expected-authority.d.ts +4 -0
- package/dist/lib/long-task-expected-authority.js +126 -0
- package/dist/lib/long-task-external-confirmation-artifacts.d.ts +9 -0
- package/dist/lib/long-task-external-confirmation-artifacts.js +138 -0
- package/dist/lib/long-task-external-confirmation-attestation.d.ts +20 -0
- package/dist/lib/long-task-external-confirmation-attestation.js +115 -0
- package/dist/lib/long-task-external-confirmation-challenge.d.ts +23 -0
- package/dist/lib/long-task-external-confirmation-challenge.js +164 -0
- package/dist/lib/long-task-external-confirmation-context.d.ts +14 -0
- package/dist/lib/long-task-external-confirmation-context.js +53 -0
- package/dist/lib/long-task-external-confirmation-evaluation.d.ts +11 -0
- package/dist/lib/long-task-external-confirmation-evaluation.js +454 -0
- package/dist/lib/long-task-external-confirmation-expected.d.ts +8 -0
- package/dist/lib/long-task-external-confirmation-expected.js +200 -0
- package/dist/lib/long-task-external-confirmation-identity.d.ts +10 -0
- package/dist/lib/long-task-external-confirmation-identity.js +77 -0
- package/dist/lib/long-task-external-confirmation-plan.d.ts +25 -0
- package/dist/lib/long-task-external-confirmation-plan.js +148 -0
- package/dist/lib/long-task-external-confirmation-preparation.d.ts +4 -0
- package/dist/lib/long-task-external-confirmation-preparation.js +100 -0
- package/dist/lib/long-task-external-confirmation-shape.d.ts +8 -0
- package/dist/lib/long-task-external-confirmation-shape.js +387 -0
- package/dist/lib/long-task-external-confirmation-state.d.ts +10 -0
- package/dist/lib/long-task-external-confirmation-state.js +109 -0
- package/dist/lib/long-task-external-confirmation-types.d.ts +195 -0
- package/dist/lib/long-task-external-confirmation-types.js +1 -0
- package/dist/lib/long-task-final-integrity.d.ts +2 -0
- package/dist/lib/long-task-final-integrity.js +21 -10
- package/dist/lib/long-task-final-v2.d.ts +7 -2
- package/dist/lib/long-task-final-v2.js +179 -55
- package/dist/lib/long-task-finalization-identity.d.ts +27 -0
- package/dist/lib/long-task-finalization-identity.js +58 -0
- package/dist/lib/long-task-finding-context.d.ts +1 -1
- package/dist/lib/long-task-finding-context.js +139 -13
- package/dist/lib/long-task-freshness.d.ts +27 -0
- package/dist/lib/long-task-freshness.js +129 -6
- package/dist/lib/long-task-git.js +3 -3
- package/dist/lib/long-task-material-input-closure.d.ts +3 -0
- package/dist/lib/long-task-material-input-closure.js +92 -0
- package/dist/lib/long-task-obligation-authority-resolution.d.ts +12 -0
- package/dist/lib/long-task-obligation-authority-resolution.js +57 -0
- package/dist/lib/long-task-obligation-semantic-identity.d.ts +16 -0
- package/dist/lib/long-task-obligation-semantic-identity.js +116 -0
- package/dist/lib/long-task-observation-authority.d.ts +11 -0
- package/dist/lib/long-task-observation-authority.js +137 -6
- package/dist/lib/long-task-process-table.d.ts +9 -0
- package/dist/lib/long-task-process-table.js +87 -0
- package/dist/lib/long-task-process-tree.d.ts +8 -0
- package/dist/lib/long-task-process-tree.js +108 -0
- package/dist/lib/long-task-proof-adequacy.d.ts +12 -0
- package/dist/lib/long-task-proof-adequacy.js +57 -0
- package/dist/lib/long-task-proof-capability-floor.d.ts +6 -0
- package/dist/lib/long-task-proof-capability-floor.js +137 -0
- package/dist/lib/long-task-protected-files.d.ts +1 -1
- package/dist/lib/long-task-protected-files.js +1 -1
- package/dist/lib/long-task-repair-frontier-checks.d.ts +8 -0
- package/dist/lib/long-task-repair-frontier-checks.js +93 -0
- package/dist/lib/long-task-repair-frontier-groups.d.ts +2 -0
- package/dist/lib/long-task-repair-frontier-groups.js +64 -0
- package/dist/lib/long-task-repair-frontier-utils.d.ts +6 -0
- package/dist/lib/long-task-repair-frontier-utils.js +27 -0
- package/dist/lib/long-task-repair-frontier.d.ts +14 -0
- package/dist/lib/long-task-repair-frontier.js +132 -0
- package/dist/lib/long-task-risk.d.ts +3 -2
- package/dist/lib/long-task-risk.js +73 -24
- package/dist/lib/long-task-root-shape.js +148 -8
- package/dist/lib/long-task-runner-freeze.d.ts +2 -1
- package/dist/lib/long-task-runner-freeze.js +23 -8
- package/dist/lib/long-task-runtime-types.d.ts +34 -40
- package/dist/lib/long-task-semantic-assurance-policy.js +2 -11
- package/dist/lib/long-task-semantic-contract-types.d.ts +2 -1
- package/dist/lib/long-task-semantic-drift-migration.js +48 -2
- package/dist/lib/long-task-semantic-fact-binding-types.d.ts +20 -0
- package/dist/lib/long-task-semantic-fact-closure.d.ts +5 -1
- package/dist/lib/long-task-semantic-fact-closure.js +33 -5
- package/dist/lib/long-task-semantic-fact-contract-closure.js +176 -1
- package/dist/lib/long-task-semantic-fact-contract-proofs.js +18 -1
- package/dist/lib/long-task-semantic-fact-input-closure.d.ts +16 -2
- package/dist/lib/long-task-semantic-fact-input-closure.js +138 -15
- package/dist/lib/long-task-semantic-fact-provenance-closure.js +1 -1
- package/dist/lib/long-task-semantic-fact-shape.d.ts +2 -1
- package/dist/lib/long-task-semantic-fact-shape.js +35 -1
- package/dist/lib/long-task-semantic-proof-adequacy.d.ts +2 -0
- package/dist/lib/long-task-semantic-proof-adequacy.js +19 -0
- package/dist/lib/long-task-semantic-proof-profile.d.ts +5 -0
- package/dist/lib/long-task-semantic-proof-profile.js +187 -0
- package/dist/lib/long-task-shape-primitives.d.ts +1 -1
- package/dist/lib/long-task-shape-primitives.js +5 -0
- package/dist/lib/long-task-source-anchors.d.ts +10 -0
- package/dist/lib/long-task-source-anchors.js +102 -0
- package/dist/lib/long-task-source-authority-types.d.ts +46 -0
- package/dist/lib/long-task-source-claim-validation.js +36 -0
- package/dist/lib/long-task-source-conservation-facts.d.ts +8 -0
- package/dist/lib/long-task-source-conservation-facts.js +57 -0
- package/dist/lib/long-task-source-conservation-types.d.ts +34 -0
- package/dist/lib/long-task-source-conservation-types.js +1 -0
- package/dist/lib/long-task-source-conservation.d.ts +7 -0
- package/dist/lib/long-task-source-conservation.js +110 -0
- package/dist/lib/long-task-source-fragments.d.ts +6 -0
- package/dist/lib/long-task-source-fragments.js +219 -0
- package/dist/lib/long-task-source-projection-resolution.d.ts +5 -0
- package/dist/lib/long-task-source-projection-resolution.js +57 -0
- package/dist/lib/long-task-source-projection-validation.d.ts +17 -0
- package/dist/lib/long-task-source-projection-validation.js +154 -0
- package/dist/lib/long-task-source-shape.js +14 -6
- package/dist/lib/long-task-source-supersession.d.ts +5 -0
- package/dist/lib/long-task-source-supersession.js +138 -0
- package/dist/lib/long-task-stage-policy.d.ts +7 -2
- package/dist/lib/long-task-stage-policy.js +67 -23
- package/dist/lib/long-task-state.d.ts +18 -4
- package/dist/lib/long-task-state.js +319 -33
- package/dist/lib/long-task-static-observation-freeze.js +4 -3
- package/dist/lib/long-task-status-projection.d.ts +3 -1
- package/dist/lib/long-task-status-projection.js +44 -13
- package/dist/lib/long-task-status-v2.d.ts +10 -6
- package/dist/lib/long-task-status-v2.js +70 -58
- package/dist/lib/long-task-target-policy.d.ts +8 -3
- package/dist/lib/long-task-target-policy.js +40 -9
- package/dist/lib/long-task-terminal-finalization.d.ts +12 -0
- package/dist/lib/long-task-terminal-finalization.js +190 -0
- package/dist/lib/long-task-ui-design-policy.js +15 -4
- package/dist/lib/long-task-ui-surface-policy.d.ts +2 -1
- package/dist/lib/long-task-ui-surface-policy.js +7 -4
- package/dist/lib/long-task-ui-surface-validation.d.ts +3 -1
- package/dist/lib/long-task-ui-surface-validation.js +2 -2
- package/dist/lib/long-task-verifier-counterfactuals.d.ts +11 -0
- package/dist/lib/long-task-verifier-counterfactuals.js +96 -0
- package/dist/lib/long-task-verifier-execution.d.ts +9 -0
- package/dist/lib/long-task-verifier-execution.js +67 -0
- package/dist/lib/long-task-verifier-identity.js +16 -5
- package/dist/lib/long-task-verifier-v2.js +52 -65
- package/dist/lib/long-task-windows-job-supervisor-helper.d.ts +1 -0
- package/dist/lib/long-task-windows-job-supervisor-helper.js +104 -0
- package/dist/lib/long-task-windows-job-supervisor-protocol.d.ts +28 -0
- package/dist/lib/long-task-windows-job-supervisor-protocol.js +124 -0
- package/dist/lib/long-task-windows-job-supervisor-result.d.ts +11 -0
- package/dist/lib/long-task-windows-job-supervisor-result.js +152 -0
- package/dist/lib/long-task-windows-job-supervisor.d.ts +2 -0
- package/dist/lib/long-task-windows-job-supervisor.js +126 -0
- package/dist/lib/long-task-workspace-scope.d.ts +1 -0
- package/dist/lib/long-task-workspace-scope.js +4 -1
- package/dist/lib/long-task-workspace.d.ts +1 -0
- package/dist/lib/long-task-workspace.js +10 -0
- package/dist/lib/migrations.js +43 -2
- package/dist/lib/repository-path-safety.d.ts +3 -0
- package/dist/lib/repository-path-safety.js +39 -3
- package/dist/lib/semantic-fact-input-shape.d.ts +7 -2
- package/dist/lib/semantic-fact-input-shape.js +25 -1
- package/dist/lib/semantic-fact-inventory-types.d.ts +8 -2
- package/dist/lib/semantic-fact-policy-census.d.ts +1 -1
- package/dist/lib/semantic-fact-policy-census.js +5 -2
- package/dist/lib/semantic-fact-policy.d.ts +1 -1
- package/dist/lib/semantic-fact-policy.js +2 -2
- package/dist/lib/semantic-fact-proof-shape.d.ts +1 -1
- package/dist/lib/semantic-fact-property-shape.d.ts +1 -1
- package/dist/lib/validators.d.ts +3 -0
- package/dist/lib/validators.js +45 -157
- package/dist/public-api-core.d.ts +12 -0
- package/dist/public-api-core.js +12 -0
- package/dist/public-api-long-task.d.ts +10 -0
- package/dist/public-api-long-task.js +10 -0
- package/dist/public-types.d.ts +6 -1
- package/dist/schemas/design-authority-delta-assessment-v1.schema.json +191 -0
- package/dist/schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json +166 -2
- package/dist/schemas/long-task-external-confirmation-record-v1.schema.json +155 -0
- package/dist/schemas/long-task-external-confirmation-record-v2.schema.json +209 -0
- package/migrations/README.md +99 -0
- package/package.json +7 -5
- package/source-mappings.yaml +18 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface WindowsJobSupervisorResult {
|
|
2
|
+
process_id: number;
|
|
3
|
+
exit_code: number;
|
|
4
|
+
timed_out: boolean;
|
|
5
|
+
output_overflow: boolean;
|
|
6
|
+
stdout_bytes: number;
|
|
7
|
+
stderr_bytes: number;
|
|
8
|
+
started_at: string;
|
|
9
|
+
completed_at: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseWindowsJobSupervisorResult(line: string, requestId: string): WindowsJobSupervisorResult;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { parseStrictYaml } from "./strict-codec.js";
|
|
2
|
+
const RESULT_FIELDS = [
|
|
3
|
+
"AccountingSourceKind",
|
|
4
|
+
"ActiveProcessesAtResult",
|
|
5
|
+
"CompletedUnixMs",
|
|
6
|
+
"DescendantsCleaned",
|
|
7
|
+
"Error",
|
|
8
|
+
"ExitCode",
|
|
9
|
+
"KernelCpu100Ns",
|
|
10
|
+
"MonotonicClockId",
|
|
11
|
+
"MonotonicCompletedNs",
|
|
12
|
+
"MonotonicStartedNs",
|
|
13
|
+
"OutputOverflow",
|
|
14
|
+
"ProcessId",
|
|
15
|
+
"RequestId",
|
|
16
|
+
"StartedUnixMs",
|
|
17
|
+
"StderrBytes",
|
|
18
|
+
"StdoutBytes",
|
|
19
|
+
"TimedOut",
|
|
20
|
+
"TotalCpu100Ns",
|
|
21
|
+
"TotalProcesses",
|
|
22
|
+
"TotalTerminatedProcesses",
|
|
23
|
+
"UserCpu100Ns",
|
|
24
|
+
"WallClockId",
|
|
25
|
+
];
|
|
26
|
+
const FAILURE_FIELDS = ["Error", "RequestId"];
|
|
27
|
+
export function parseWindowsJobSupervisorResult(line, requestId) {
|
|
28
|
+
const response = parseResponse(line);
|
|
29
|
+
if (sameFields(response, FAILURE_FIELDS))
|
|
30
|
+
handleFailure(response, requestId);
|
|
31
|
+
assertFields(response, RESULT_FIELDS);
|
|
32
|
+
assertResultShape(response);
|
|
33
|
+
if (response.RequestId !== requestId)
|
|
34
|
+
invalidResult("response_identity");
|
|
35
|
+
if (response.ActiveProcessesAtResult !== 0 ||
|
|
36
|
+
response.DescendantsCleaned !== true)
|
|
37
|
+
throw new Error("process_observer_descendant_process_alive");
|
|
38
|
+
return {
|
|
39
|
+
process_id: response.ProcessId,
|
|
40
|
+
exit_code: response.ExitCode,
|
|
41
|
+
timed_out: response.TimedOut,
|
|
42
|
+
output_overflow: response.OutputOverflow,
|
|
43
|
+
stdout_bytes: response.StdoutBytes,
|
|
44
|
+
stderr_bytes: response.StderrBytes,
|
|
45
|
+
started_at: new Date(response.StartedUnixMs).toISOString(),
|
|
46
|
+
completed_at: new Date(response.CompletedUnixMs).toISOString(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function parseResponse(line) {
|
|
50
|
+
try {
|
|
51
|
+
if (!line.startsWith("{") || !line.endsWith("}"))
|
|
52
|
+
throw new Error();
|
|
53
|
+
return record(parseStrictYaml(line));
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
invalidResult("response_json");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function handleFailure(response, requestId) {
|
|
60
|
+
if (response.RequestId !== requestId)
|
|
61
|
+
invalidResult("response_identity");
|
|
62
|
+
if (!validDiagnostic(response.Error))
|
|
63
|
+
invalidResult("failure_shape");
|
|
64
|
+
if (response.Error.includes("descendants_alive"))
|
|
65
|
+
throw new Error("process_observer_descendant_process_alive");
|
|
66
|
+
throw new Error(`process_observer_windows_job_unavailable:${response.Error}`);
|
|
67
|
+
}
|
|
68
|
+
function assertResultShape(response) {
|
|
69
|
+
assertCoreResult(response);
|
|
70
|
+
assertClockResult(response);
|
|
71
|
+
assertAccountingResult(response);
|
|
72
|
+
}
|
|
73
|
+
function assertCoreResult(response) {
|
|
74
|
+
if (response.Error !== null ||
|
|
75
|
+
!positiveSafeInteger(response.ProcessId) ||
|
|
76
|
+
!signedInt32(response.ExitCode) ||
|
|
77
|
+
typeof response.TimedOut !== "boolean" ||
|
|
78
|
+
typeof response.OutputOverflow !== "boolean" ||
|
|
79
|
+
typeof response.DescendantsCleaned !== "boolean" ||
|
|
80
|
+
!nonnegativeSafeInteger(response.StdoutBytes) ||
|
|
81
|
+
!nonnegativeSafeInteger(response.StderrBytes) ||
|
|
82
|
+
!Number.isSafeInteger(response.StdoutBytes + response.StderrBytes))
|
|
83
|
+
invalidResult("result_shape");
|
|
84
|
+
}
|
|
85
|
+
function assertClockResult(response) {
|
|
86
|
+
if (!validUnixMilliseconds(response.StartedUnixMs) ||
|
|
87
|
+
!validUnixMilliseconds(response.CompletedUnixMs) ||
|
|
88
|
+
response.CompletedUnixMs < response.StartedUnixMs ||
|
|
89
|
+
!decimalString(response.MonotonicStartedNs) ||
|
|
90
|
+
!decimalString(response.MonotonicCompletedNs) ||
|
|
91
|
+
BigInt(response.MonotonicCompletedNs) <
|
|
92
|
+
BigInt(response.MonotonicStartedNs) ||
|
|
93
|
+
response.MonotonicClockId !== "windows-stopwatch-qpc-v1" ||
|
|
94
|
+
response.WallClockId !== "unix-epoch-ms-v1")
|
|
95
|
+
invalidResult("result_shape");
|
|
96
|
+
}
|
|
97
|
+
function assertAccountingResult(response) {
|
|
98
|
+
if (!nonnegativeSafeInteger(response.UserCpu100Ns) ||
|
|
99
|
+
!nonnegativeSafeInteger(response.KernelCpu100Ns) ||
|
|
100
|
+
!nonnegativeSafeInteger(response.TotalCpu100Ns) ||
|
|
101
|
+
response.TotalCpu100Ns !==
|
|
102
|
+
response.UserCpu100Ns + response.KernelCpu100Ns ||
|
|
103
|
+
!positiveSafeInteger(response.TotalProcesses) ||
|
|
104
|
+
!nonnegativeSafeInteger(response.ActiveProcessesAtResult) ||
|
|
105
|
+
!nonnegativeSafeInteger(response.TotalTerminatedProcesses) ||
|
|
106
|
+
response.TotalTerminatedProcesses > response.TotalProcesses ||
|
|
107
|
+
response.AccountingSourceKind !== "windows-job-object-accounting-v1")
|
|
108
|
+
invalidResult("result_shape");
|
|
109
|
+
}
|
|
110
|
+
function record(value) {
|
|
111
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
112
|
+
invalidResult("response_shape");
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
function sameFields(value, expected) {
|
|
116
|
+
const actual = Object.keys(value).sort();
|
|
117
|
+
const sortedExpected = [...expected].sort();
|
|
118
|
+
return (actual.length === sortedExpected.length &&
|
|
119
|
+
actual.every((field, index) => field === sortedExpected[index]));
|
|
120
|
+
}
|
|
121
|
+
function assertFields(value, expected) {
|
|
122
|
+
if (!sameFields(value, expected))
|
|
123
|
+
invalidResult("response_fields");
|
|
124
|
+
}
|
|
125
|
+
function positiveSafeInteger(value) {
|
|
126
|
+
return Number.isSafeInteger(value) && Number(value) > 0;
|
|
127
|
+
}
|
|
128
|
+
function nonnegativeSafeInteger(value) {
|
|
129
|
+
return Number.isSafeInteger(value) && Number(value) >= 0;
|
|
130
|
+
}
|
|
131
|
+
function signedInt32(value) {
|
|
132
|
+
return (Number.isSafeInteger(value) &&
|
|
133
|
+
Number(value) >= -2_147_483_648 &&
|
|
134
|
+
Number(value) <= 2_147_483_647);
|
|
135
|
+
}
|
|
136
|
+
function validUnixMilliseconds(value) {
|
|
137
|
+
return nonnegativeSafeInteger(value) && value <= 8_640_000_000_000_000;
|
|
138
|
+
}
|
|
139
|
+
function decimalString(value) {
|
|
140
|
+
return typeof value === "string" && /^[0-9]+$/u.test(value);
|
|
141
|
+
}
|
|
142
|
+
function validDiagnostic(value) {
|
|
143
|
+
return (typeof value === "string" &&
|
|
144
|
+
!value.includes("\u0000") &&
|
|
145
|
+
value.length > 0 &&
|
|
146
|
+
value.length <= 16_384 &&
|
|
147
|
+
!value.includes("\r") &&
|
|
148
|
+
!value.includes("\n"));
|
|
149
|
+
}
|
|
150
|
+
function invalidResult(detail) {
|
|
151
|
+
throw new Error(`process_observer_windows_job_result_invalid:${detail}`);
|
|
152
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { SpawnedCommandExecution } from "./long-task-command-process.js";
|
|
2
|
+
export declare function spawnWindowsJobCommandOnce(executable: string, argv: string[], cwd: string, timeoutMs: number, environment: NodeJS.ProcessEnv, combinedOutputLimitBytes: number): Promise<SpawnedCommandExecution>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { lstat, mkdtemp, realpath, rm } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { assertProtectedRepositoryFile } from "./long-task-protected-files.js";
|
|
7
|
+
import { runOneWindowsJobHelperRequest } from "./long-task-windows-job-supervisor-helper.js";
|
|
8
|
+
import { assertFreshWindowsJobStreamTarget, createWindowsJobSupervisorRequest, parseWindowsJobSupervisorResult, readWindowsJobStream, WINDOWS_JOB_SUPERVISOR_ASSET_RELATIVE_FILES, } from "./long-task-windows-job-supervisor-protocol.js";
|
|
9
|
+
const HELPER_CLOSE_GRACE_MS = 10_000;
|
|
10
|
+
export async function spawnWindowsJobCommandOnce(executable, argv, cwd, timeoutMs, environment, combinedOutputLimitBytes) {
|
|
11
|
+
if (process.platform !== "win32")
|
|
12
|
+
throw new Error("process_observer_windows_job_unavailable:platform");
|
|
13
|
+
const helper = await packageSupervisorHelper();
|
|
14
|
+
const powershell = await windowsPowerShellExecutable();
|
|
15
|
+
const createdTemporaryRoot = await mkdtemp(path.join(tmpdir(), "ty-context-windows-job-"));
|
|
16
|
+
const temporaryRoot = await assertPrivateTemporaryRoot(createdTemporaryRoot);
|
|
17
|
+
let execution;
|
|
18
|
+
let failure;
|
|
19
|
+
try {
|
|
20
|
+
const stdoutPath = path.join(temporaryRoot, "stdout.bin");
|
|
21
|
+
const stderrPath = path.join(temporaryRoot, "stderr.bin");
|
|
22
|
+
await Promise.all([
|
|
23
|
+
assertFreshWindowsJobStreamTarget(stdoutPath),
|
|
24
|
+
assertFreshWindowsJobStreamTarget(stderrPath),
|
|
25
|
+
]);
|
|
26
|
+
const request = createWindowsJobSupervisorRequest({
|
|
27
|
+
requestId: randomUUID(),
|
|
28
|
+
executable,
|
|
29
|
+
argv,
|
|
30
|
+
cwd,
|
|
31
|
+
stdoutPath,
|
|
32
|
+
stderrPath,
|
|
33
|
+
timeoutMs,
|
|
34
|
+
combinedOutputLimitBytes,
|
|
35
|
+
environment,
|
|
36
|
+
});
|
|
37
|
+
const response = await runOneWindowsJobHelperRequest(powershell, helper, JSON.stringify(request), timeoutMs + HELPER_CLOSE_GRACE_MS);
|
|
38
|
+
const result = parseWindowsJobSupervisorResult(response, request.request_id);
|
|
39
|
+
const [stdout, stderr] = await Promise.all([
|
|
40
|
+
readWindowsJobStream(stdoutPath, result.stdout_bytes, combinedOutputLimitBytes),
|
|
41
|
+
readWindowsJobStream(stderrPath, result.stderr_bytes, combinedOutputLimitBytes),
|
|
42
|
+
]);
|
|
43
|
+
if (stdout.length + stderr.length > combinedOutputLimitBytes)
|
|
44
|
+
throw new Error("process_observer_windows_job_result_invalid:stream_limit");
|
|
45
|
+
if (result.timed_out)
|
|
46
|
+
throw new Error("command_timeout");
|
|
47
|
+
if (result.output_overflow)
|
|
48
|
+
throw new Error("command_output_limit_exceeded");
|
|
49
|
+
execution = {
|
|
50
|
+
exit_code: result.exit_code,
|
|
51
|
+
stdout,
|
|
52
|
+
stderr,
|
|
53
|
+
pid: result.process_id,
|
|
54
|
+
started_at: result.started_at,
|
|
55
|
+
completed_at: result.completed_at,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
failure = error;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
await removePrivateTemporaryRoot(temporaryRoot);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
failure ??= new Error(`process_observer_windows_job_unavailable:cleanup:${message(error)}`);
|
|
66
|
+
}
|
|
67
|
+
if (failure)
|
|
68
|
+
throw failure;
|
|
69
|
+
return execution;
|
|
70
|
+
}
|
|
71
|
+
async function packageSupervisorHelper() {
|
|
72
|
+
const packageRoot = fileURLToPath(new URL("../../", import.meta.url));
|
|
73
|
+
let helper = "";
|
|
74
|
+
try {
|
|
75
|
+
for (const relative of WINDOWS_JOB_SUPERVISOR_ASSET_RELATIVE_FILES) {
|
|
76
|
+
const file = await assertProtectedRepositoryFile(packageRoot, path.join(packageRoot, ...relative.split("/")), `windows_job_supervisor_asset:${relative}`);
|
|
77
|
+
if (relative.endsWith("/windows_job_process_supervisor.ps1"))
|
|
78
|
+
helper = file;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw new Error(`process_observer_windows_job_unavailable:assets:${message(error)}`);
|
|
83
|
+
}
|
|
84
|
+
return helper;
|
|
85
|
+
}
|
|
86
|
+
async function windowsPowerShellExecutable() {
|
|
87
|
+
const windowsRoot = process.env.SystemRoot ?? process.env.WINDIR;
|
|
88
|
+
if (!windowsRoot || !path.isAbsolute(windowsRoot))
|
|
89
|
+
throw new Error("process_observer_windows_job_unavailable:powershell");
|
|
90
|
+
const executable = path.join(windowsRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
91
|
+
try {
|
|
92
|
+
const status = await lstat(executable);
|
|
93
|
+
if (!status.isFile() || status.isSymbolicLink())
|
|
94
|
+
throw new Error();
|
|
95
|
+
return await realpath(executable);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
throw new Error("process_observer_windows_job_unavailable:powershell");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async function assertPrivateTemporaryRoot(created) {
|
|
102
|
+
const status = await lstat(created);
|
|
103
|
+
if (!status.isDirectory() || status.isSymbolicLink())
|
|
104
|
+
throw new Error("process_observer_windows_job_unavailable:temporary_root_identity");
|
|
105
|
+
return realpath(created);
|
|
106
|
+
}
|
|
107
|
+
async function removePrivateTemporaryRoot(target) {
|
|
108
|
+
const status = await lstat(target);
|
|
109
|
+
if (!status.isDirectory() ||
|
|
110
|
+
status.isSymbolicLink() ||
|
|
111
|
+
normalizeHostPath(await realpath(target)) !==
|
|
112
|
+
normalizeHostPath(path.resolve(target)))
|
|
113
|
+
throw new Error("temporary_root_identity");
|
|
114
|
+
await rm(target, {
|
|
115
|
+
recursive: true,
|
|
116
|
+
force: true,
|
|
117
|
+
maxRetries: 10,
|
|
118
|
+
retryDelay: 100,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function normalizeHostPath(value) {
|
|
122
|
+
return process.platform === "win32" ? value.toLowerCase() : value;
|
|
123
|
+
}
|
|
124
|
+
function message(error) {
|
|
125
|
+
return error instanceof Error ? error.message : String(error);
|
|
126
|
+
}
|
|
@@ -29,6 +29,7 @@ export declare function protectedWorkspacePaths(input: {
|
|
|
29
29
|
context_hashes?: Record<string, string> | null;
|
|
30
30
|
checks?: Array<{
|
|
31
31
|
verification_input_hashes: Record<string, string>;
|
|
32
|
+
protected_authority_paths?: string[];
|
|
32
33
|
}>;
|
|
33
34
|
additional_files?: string[];
|
|
34
35
|
}): string[];
|
|
@@ -42,7 +42,10 @@ export function protectedWorkspacePaths(input) {
|
|
|
42
42
|
...Object.keys(input.contract_files ?? {}),
|
|
43
43
|
...Object.keys(input.source_hashes ?? {}),
|
|
44
44
|
...Object.keys(input.context_hashes ?? {}),
|
|
45
|
-
...(input.checks ?? []).flatMap((check) =>
|
|
45
|
+
...(input.checks ?? []).flatMap((check) => [
|
|
46
|
+
...Object.keys(check.verification_input_hashes),
|
|
47
|
+
...(check.protected_authority_paths ?? []),
|
|
48
|
+
]),
|
|
46
49
|
...(input.additional_files ?? []),
|
|
47
50
|
]);
|
|
48
51
|
}
|
|
@@ -3,3 +3,4 @@ export { currentGitState, currentGitTree, gitCommonDir, gitConfigGet, gitConfigS
|
|
|
3
3
|
export { captureWorkspaceFingerprint, captureWorkspaceManifest, changedWorkspacePaths, changedWorkspacePathsFromHead, } from "./long-task-workspace-manifest.js";
|
|
4
4
|
export { createWorkspaceSnapshot } from "./long-task-workspace-snapshot.js";
|
|
5
5
|
export type { WorkspaceSnapshotV2 } from "./long-task-workspace-snapshot.js";
|
|
6
|
+
export declare function canonicalExistingLongTaskWorkdir(repository: string, workdirInput: string): Promise<string>;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { realpath } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { assertProtectedRepositoryDirectory as assertProtectedDirectory } from "./repository-path-safety.js";
|
|
1
4
|
export { resolveInsideRepository } from "./repository-path-safety.js";
|
|
2
5
|
export { currentGitState, currentGitTree, gitCommonDir, gitConfigGet, gitConfigSet, gitConfigUnset, gitPath, repoRelative, repositoryRoot, } from "./long-task-git.js";
|
|
3
6
|
export { captureWorkspaceFingerprint, captureWorkspaceManifest, changedWorkspacePaths, changedWorkspacePathsFromHead, } from "./long-task-workspace-manifest.js";
|
|
4
7
|
export { createWorkspaceSnapshot } from "./long-task-workspace-snapshot.js";
|
|
8
|
+
export async function canonicalExistingLongTaskWorkdir(repository, workdirInput) {
|
|
9
|
+
const [canonicalRepository, physical] = await Promise.all([
|
|
10
|
+
realpath(path.resolve(repository)),
|
|
11
|
+
realpath(path.resolve(workdirInput)),
|
|
12
|
+
]);
|
|
13
|
+
return assertProtectedDirectory(canonicalRepository, physical, "long_task_workdir");
|
|
14
|
+
}
|
package/dist/lib/migrations.js
CHANGED
|
@@ -6,12 +6,15 @@ import { architectureContextTemplate, areaContextTemplate, globalContextTemplate
|
|
|
6
6
|
import { CURRENT_SCHEMA_VERSION } from "./constants.js";
|
|
7
7
|
import { defaultConfig, readConfig } from "./config.js";
|
|
8
8
|
import { createDesignMdIfMissing, DESIGN_MD_PATH } from "./design-md.js";
|
|
9
|
+
import { declaredDesignAuthorityFormat } from "./design-authority-format.js";
|
|
10
|
+
import { DESIGN_AUTHORITY_MANIFEST_PATH } from "./design-authority-types.js";
|
|
9
11
|
import { ensureDir, listFiles, pathExists, readText, writeTextIfChanged, } from "./fs.js";
|
|
10
12
|
import { harnessConfigPath, harnessRoot } from "./harness-root.js";
|
|
11
13
|
import { legacySdlcHarnessMigration } from "./legacy-sdlc-migration.js";
|
|
12
14
|
import { modularityCapabilityWaiverMigration } from "./modularity-capability-migration.js";
|
|
13
15
|
import { parseYaml, stringifyYaml } from "./yaml.js";
|
|
14
16
|
import { semanticDriftMigrationFields } from "./long-task-semantic-drift-migration.js";
|
|
17
|
+
import { contextUnitsMigration } from "./context-units-migration.js";
|
|
15
18
|
async function verifyNoop() {
|
|
16
19
|
return;
|
|
17
20
|
}
|
|
@@ -25,10 +28,10 @@ export const migrations = [
|
|
|
25
28
|
{
|
|
26
29
|
id: "long-task-v2-semantic-drift-authority",
|
|
27
30
|
introducedIn: "0.7.2",
|
|
28
|
-
description: "Require explicit Stage, target profile/root runtime, journey scenario
|
|
31
|
+
description: "Require explicit Stage, target profile/root runtime, journey scenario, evidence-capability authority and authenticated exact blocking External Confirmation in V2 Long-Task Contracts.",
|
|
29
32
|
scope: ".long-task/delivery-contract.yaml",
|
|
30
33
|
risk: "manual",
|
|
31
|
-
manualMessage: "These product and proof semantics cannot be inferred safely. Preserve Source, then explicitly author stages, vertical Outcome membership, target profile and execution targets, success/degradation requirements, Given/When scenarios, evidence capabilities and
|
|
34
|
+
manualMessage: "These product and proof semantics cannot be inferred safely. Preserve Source, then explicitly author stages, vertical Outcome membership, target profile and execution targets, success/degradation requirements, Given/When scenarios, evidence capabilities, exact obligation authority and authenticated blocking External Confirmation before recompiling. Missing completion_authority remains machine_only; resolve machine/external conflicts rather than synthesizing authority. Historical Progress, V1 External records and Receipts remain audit-only and must not be imported as acceptance.",
|
|
32
35
|
detect: detectLongTaskSemanticDriftAuthority,
|
|
33
36
|
verify: verifyNoop,
|
|
34
37
|
},
|
|
@@ -98,6 +101,7 @@ export const migrations = [
|
|
|
98
101
|
apply: migrateLegacyModulesToAreas,
|
|
99
102
|
verify: verifyNoop,
|
|
100
103
|
},
|
|
104
|
+
contextUnitsMigration,
|
|
101
105
|
{
|
|
102
106
|
id: "context-manifest-baseline",
|
|
103
107
|
introducedIn: "0.2.0",
|
|
@@ -131,6 +135,16 @@ export const migrations = [
|
|
|
131
135
|
apply: migrateDesignMd,
|
|
132
136
|
verify: verifyNoop,
|
|
133
137
|
},
|
|
138
|
+
{
|
|
139
|
+
id: "design-authority-bundle-marker-v1",
|
|
140
|
+
introducedIn: "0.11.0",
|
|
141
|
+
description: "Require the canonical DESIGN.md bundle-v1 marker and Design Authority manifest to be adopted or removed as one explicit Authority-format change.",
|
|
142
|
+
scope: "DESIGN.md and design_system/authority.manifest.json",
|
|
143
|
+
risk: "manual",
|
|
144
|
+
manualMessage: "Do not infer adoption or downgrade from file presence. Through explicit DSA adoption/Authority Revision, either add the canonical body-leading bundle-v1 marker and validate the manifest, or deliberately remove both marker and manifest for a true one-file Authority; then rebind affected DRA and Long-Task identities.",
|
|
145
|
+
detect: detectDesignAuthorityBundleMarker,
|
|
146
|
+
verify: verifyNoop,
|
|
147
|
+
},
|
|
134
148
|
{
|
|
135
149
|
id: "deprecated-skill-overrides",
|
|
136
150
|
introducedIn: "0.2.0",
|
|
@@ -533,6 +547,33 @@ async function detectDesignMdBaseline(projectRoot, _root, migration) {
|
|
|
533
547
|
item(migration, "safe_pending", DESIGN_MD_PATH, "DESIGN.md is missing and can be created with the package baseline."),
|
|
534
548
|
];
|
|
535
549
|
}
|
|
550
|
+
async function detectDesignAuthorityBundleMarker(projectRoot, _root, migration) {
|
|
551
|
+
const entry = path.join(projectRoot, DESIGN_MD_PATH);
|
|
552
|
+
const manifest = path.join(projectRoot, DESIGN_AUTHORITY_MANIFEST_PATH);
|
|
553
|
+
const [entryExists, manifestExists] = await Promise.all([
|
|
554
|
+
pathExists(entry),
|
|
555
|
+
pathExists(manifest),
|
|
556
|
+
]);
|
|
557
|
+
if (!entryExists && !manifestExists)
|
|
558
|
+
return [];
|
|
559
|
+
let marked = false;
|
|
560
|
+
let markerIssue = null;
|
|
561
|
+
if (entryExists)
|
|
562
|
+
try {
|
|
563
|
+
marked =
|
|
564
|
+
declaredDesignAuthorityFormat(await readText(entry)) === "bundle-v1";
|
|
565
|
+
}
|
|
566
|
+
catch (error) {
|
|
567
|
+
markerIssue = error instanceof Error ? error.message : String(error);
|
|
568
|
+
}
|
|
569
|
+
if (markerIssue === null && entryExists && marked === manifestExists)
|
|
570
|
+
return [];
|
|
571
|
+
return [
|
|
572
|
+
item(migration, "manual_required", DESIGN_AUTHORITY_MANIFEST_PATH, markerIssue
|
|
573
|
+
? `The Design Authority bundle declaration is invalid (${markerIssue}). Repair the canonical marker and manifest as one explicit DSA/Authority Revision.`
|
|
574
|
+
: `Design Authority bundle marker/manifest mismatch: entry=${entryExists}, marker=${marked}, manifest=${manifestExists}. Adopt or remove the pair only through explicit DSA/Authority Revision, then rebind affected identities.`),
|
|
575
|
+
];
|
|
576
|
+
}
|
|
536
577
|
async function detectCompositeCodexProfile(projectRoot, _root, migration) {
|
|
537
578
|
const relative = await harnessConfigPath(projectRoot);
|
|
538
579
|
const file = path.join(projectRoot, relative);
|
|
@@ -6,8 +6,11 @@ export interface SafeRepositoryPath {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function resolveInsideRepository(rootInput: string, relativeInput: string, label: string): string;
|
|
8
8
|
export declare function assertProtectedRepositoryFile(repositoryInput: string, fileInput: string, label: string): Promise<string>;
|
|
9
|
+
export declare function assertProtectedRepositoryDirectory(repositoryInput: string, directoryInput: string, label: string): Promise<string>;
|
|
10
|
+
export declare function assertProtectedRepositoryPath(repositoryInput: string, pathInput: string, label: string): Promise<string>;
|
|
9
11
|
export declare function assertSafeRepositoryFilePath(repositoryInput: string, relativeInput: string, label: string, options?: {
|
|
10
12
|
destinationMayBeAbsent?: boolean;
|
|
13
|
+
allowHardlinks?: boolean;
|
|
11
14
|
}): Promise<SafeRepositoryPath & {
|
|
12
15
|
status: Stats | null;
|
|
13
16
|
}>;
|
|
@@ -28,6 +28,42 @@ export async function assertProtectedRepositoryFile(repositoryInput, fileInput,
|
|
|
28
28
|
assertInside(repository, resolved, label, fileInput);
|
|
29
29
|
return resolved;
|
|
30
30
|
}
|
|
31
|
+
export async function assertProtectedRepositoryDirectory(repositoryInput, directoryInput, label) {
|
|
32
|
+
const repositoryPath = path.resolve(repositoryInput);
|
|
33
|
+
const repository = await realpath(repositoryPath);
|
|
34
|
+
const candidate = path.resolve(directoryInput);
|
|
35
|
+
assertInside(repositoryPath, candidate, label, directoryInput);
|
|
36
|
+
await assertExistingParents(repositoryPath, repository, candidate, label);
|
|
37
|
+
const info = await lstatOrNull(candidate);
|
|
38
|
+
if (!info)
|
|
39
|
+
throw new Error(`protected_input_not_found:${label}:${display(directoryInput)}`);
|
|
40
|
+
if (info.isSymbolicLink())
|
|
41
|
+
throw new Error(`protected_input_symlink_not_allowed:${label}:${display(directoryInput)}`);
|
|
42
|
+
if (!info.isDirectory())
|
|
43
|
+
throw new Error(`protected_input_not_directory:${label}:${display(directoryInput)}`);
|
|
44
|
+
const resolved = await realpath(candidate);
|
|
45
|
+
assertInside(repository, resolved, label, directoryInput);
|
|
46
|
+
return resolved;
|
|
47
|
+
}
|
|
48
|
+
export async function assertProtectedRepositoryPath(repositoryInput, pathInput, label) {
|
|
49
|
+
const repositoryPath = path.resolve(repositoryInput);
|
|
50
|
+
const repository = await realpath(repositoryPath);
|
|
51
|
+
const candidate = path.resolve(pathInput);
|
|
52
|
+
assertInside(repositoryPath, candidate, label, pathInput);
|
|
53
|
+
await assertExistingParents(repositoryPath, repository, candidate, label);
|
|
54
|
+
const info = await lstatOrNull(candidate);
|
|
55
|
+
if (!info)
|
|
56
|
+
throw new Error(`protected_input_not_found:${label}:${display(pathInput)}`);
|
|
57
|
+
if (info.isSymbolicLink())
|
|
58
|
+
throw new Error(`protected_input_symlink_not_allowed:${label}:${display(pathInput)}`);
|
|
59
|
+
if (!info.isFile() && !info.isDirectory())
|
|
60
|
+
throw new Error(`protected_input_not_file_or_directory:${label}:${display(pathInput)}`);
|
|
61
|
+
if (info.isFile() && typeof info.nlink === "number" && info.nlink > 1)
|
|
62
|
+
throw new Error(`protected_input_hardlink_not_allowed:${label}:${display(pathInput)}`);
|
|
63
|
+
const resolved = await realpath(candidate);
|
|
64
|
+
assertInside(repository, resolved, label, pathInput);
|
|
65
|
+
return resolved;
|
|
66
|
+
}
|
|
31
67
|
export async function assertSafeRepositoryFilePath(repositoryInput, relativeInput, label, options = {}) {
|
|
32
68
|
const repositoryPath = path.resolve(repositoryInput);
|
|
33
69
|
const repository = await realpath(repositoryPath);
|
|
@@ -37,7 +73,7 @@ export async function assertSafeRepositoryFilePath(repositoryInput, relativeInpu
|
|
|
37
73
|
if (!status && !options.destinationMayBeAbsent)
|
|
38
74
|
throw new Error(`protected_input_not_found:${label}:${display(relativeInput)}`);
|
|
39
75
|
if (status) {
|
|
40
|
-
assertRegularNoFollow(status, label, relativeInput);
|
|
76
|
+
assertRegularNoFollow(status, label, relativeInput, options.allowHardlinks === true);
|
|
41
77
|
assertInside(repository, await realpath(absolute), label, relativeInput);
|
|
42
78
|
}
|
|
43
79
|
return {
|
|
@@ -86,12 +122,12 @@ async function assertExistingParents(lexicalRepository, canonicalRepository, can
|
|
|
86
122
|
assertInside(canonicalRepository, await realpath(cursor), label, cursor);
|
|
87
123
|
}
|
|
88
124
|
}
|
|
89
|
-
function assertRegularNoFollow(info, label, original) {
|
|
125
|
+
function assertRegularNoFollow(info, label, original, allowHardlinks = false) {
|
|
90
126
|
if (info.isSymbolicLink())
|
|
91
127
|
throw new Error(`protected_input_symlink_not_allowed:${label}:${display(original)}`);
|
|
92
128
|
if (!info.isFile())
|
|
93
129
|
throw new Error(`protected_input_not_regular_file:${label}:${display(original)}`);
|
|
94
|
-
if (typeof info.nlink === "number" && info.nlink > 1)
|
|
130
|
+
if (!allowHardlinks && typeof info.nlink === "number" && info.nlink > 1)
|
|
95
131
|
throw new Error(`protected_input_hardlink_not_allowed:${label}:${display(original)}`);
|
|
96
132
|
}
|
|
97
133
|
function repositoryRelative(repository, candidate, label) {
|
|
@@ -14,13 +14,18 @@ export declare function parseSemanticFactCensus(value: unknown, label: string):
|
|
|
14
14
|
}[];
|
|
15
15
|
export declare function parseSemanticFactInputs(value: unknown, label: string): {
|
|
16
16
|
key: string;
|
|
17
|
-
kind: "attachment" | "canonical_spec" | "context" | "delegated_instruction" | "design_resource" | "external_constraint" | "repository_preservation" | "source_item";
|
|
17
|
+
kind: "attachment" | "canonical_spec" | "context" | "delegated_instruction" | "design_resource" | "external_constraint" | "repository_preservation" | "semantic_anchor" | "source_fragment" | "source_item";
|
|
18
18
|
source_ref: string;
|
|
19
19
|
sha256: string;
|
|
20
|
-
disposition: "excluded_by_scope" | "non_ui_material" | "supporting_only" | "ui_design";
|
|
20
|
+
disposition: "decision_required" | "excluded_by_scope" | "fact_bearing" | "non_ui_material" | "scope_excluded" | "superseded" | "supporting_basis" | "supporting_only" | "ui_design";
|
|
21
21
|
fact_refs: string[];
|
|
22
22
|
basis_refs: string[];
|
|
23
23
|
rationale: string;
|
|
24
|
+
supporting_relation?: {
|
|
25
|
+
kind: "same_semantic_cell_non_normative";
|
|
26
|
+
fact_ref: string;
|
|
27
|
+
fact_cell_ref: string;
|
|
28
|
+
} | undefined;
|
|
24
29
|
}[];
|
|
25
30
|
export declare function parseSemanticFactFamilyDispositions(value: unknown, label: string): {
|
|
26
31
|
key: string;
|
|
@@ -57,7 +57,7 @@ export function parseSemanticFactInputs(value, label) {
|
|
|
57
57
|
"fact_refs",
|
|
58
58
|
"basis_refs",
|
|
59
59
|
"rationale",
|
|
60
|
-
]);
|
|
60
|
+
], ["supporting_relation"]);
|
|
61
61
|
return {
|
|
62
62
|
key: semanticStableRef(row.key, `${itemLabel}.key`),
|
|
63
63
|
kind: semanticLiteral(row.kind, [
|
|
@@ -69,6 +69,8 @@ export function parseSemanticFactInputs(value, label) {
|
|
|
69
69
|
"external_constraint",
|
|
70
70
|
"delegated_instruction",
|
|
71
71
|
"design_resource",
|
|
72
|
+
"source_fragment",
|
|
73
|
+
"semantic_anchor",
|
|
72
74
|
], `${itemLabel}.kind`),
|
|
73
75
|
source_ref: semanticString(row.source_ref, `${itemLabel}.source_ref`),
|
|
74
76
|
sha256: semanticSha256(row.sha256, `${itemLabel}.sha256`),
|
|
@@ -77,13 +79,35 @@ export function parseSemanticFactInputs(value, label) {
|
|
|
77
79
|
"ui_design",
|
|
78
80
|
"supporting_only",
|
|
79
81
|
"excluded_by_scope",
|
|
82
|
+
"fact_bearing",
|
|
83
|
+
"supporting_basis",
|
|
84
|
+
"superseded",
|
|
85
|
+
"decision_required",
|
|
86
|
+
"scope_excluded",
|
|
80
87
|
], `${itemLabel}.disposition`),
|
|
81
88
|
fact_refs: semanticStableRefs(row.fact_refs, `${itemLabel}.fact_refs`),
|
|
82
89
|
basis_refs: semanticStableRefs(row.basis_refs, `${itemLabel}.basis_refs`),
|
|
83
90
|
rationale: semanticString(row.rationale, `${itemLabel}.rationale`),
|
|
91
|
+
...(row.supporting_relation === undefined
|
|
92
|
+
? {}
|
|
93
|
+
: {
|
|
94
|
+
supporting_relation: parseSupportingRelation(row.supporting_relation, `${itemLabel}.supporting_relation`),
|
|
95
|
+
}),
|
|
84
96
|
};
|
|
85
97
|
});
|
|
86
98
|
}
|
|
99
|
+
function parseSupportingRelation(value, label) {
|
|
100
|
+
const row = semanticObject(value, label, [
|
|
101
|
+
"kind",
|
|
102
|
+
"fact_ref",
|
|
103
|
+
"fact_cell_ref",
|
|
104
|
+
]);
|
|
105
|
+
return {
|
|
106
|
+
kind: semanticLiteral(row.kind, ["same_semantic_cell_non_normative"], `${label}.kind`),
|
|
107
|
+
fact_ref: semanticStableRef(row.fact_ref, `${label}.fact_ref`),
|
|
108
|
+
fact_cell_ref: semanticStableRef(row.fact_cell_ref, `${label}.fact_cell_ref`),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
87
111
|
export function parseSemanticFactFamilyDispositions(value, label) {
|
|
88
112
|
return semanticArray(value, label).map((item, index) => {
|
|
89
113
|
const itemLabel = `${label}[${index}]`;
|
|
@@ -2,13 +2,19 @@ import type { EvidenceCapabilityV2 } from "./long-task-delivery-types.js";
|
|
|
2
2
|
import type { SemanticFactDisposition, SemanticFactLocatedValueV1, SemanticFactLocatorKind, SemanticFactValueKind } from "./semantic-fact-base-types.js";
|
|
3
3
|
export interface SemanticFactInputV1 {
|
|
4
4
|
key: string;
|
|
5
|
-
kind: "source_item" | "context" | "attachment" | "canonical_spec" | "repository_preservation" | "external_constraint" | "delegated_instruction" | "design_resource";
|
|
5
|
+
kind: "source_item" | "context" | "attachment" | "canonical_spec" | "repository_preservation" | "external_constraint" | "delegated_instruction" | "design_resource" | "source_fragment" | "semantic_anchor";
|
|
6
6
|
source_ref: string;
|
|
7
7
|
sha256: string;
|
|
8
|
-
disposition: "non_ui_material" | "ui_design" | "supporting_only" | "excluded_by_scope";
|
|
8
|
+
disposition: "non_ui_material" | "ui_design" | "supporting_only" | "excluded_by_scope" | "fact_bearing" | "supporting_basis" | "superseded" | "decision_required" | "scope_excluded";
|
|
9
9
|
fact_refs: string[];
|
|
10
10
|
basis_refs: string[];
|
|
11
11
|
rationale: string;
|
|
12
|
+
supporting_relation?: SemanticFactSupportingRelationV1;
|
|
13
|
+
}
|
|
14
|
+
export interface SemanticFactSupportingRelationV1 {
|
|
15
|
+
kind: "same_semantic_cell_non_normative";
|
|
16
|
+
fact_ref: string;
|
|
17
|
+
fact_cell_ref: string;
|
|
12
18
|
}
|
|
13
19
|
export interface SemanticFactCensusEntryV1 {
|
|
14
20
|
key: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SemanticFactManifestV1 } from "./semantic-fact-types.js";
|
|
2
|
-
export declare function validateSemanticFactInspectorCensus(manifest: SemanticFactManifestV1): void;
|
|
2
|
+
export declare function validateSemanticFactInspectorCensus(manifest: SemanticFactManifestV1, externalFactRefs?: ReadonlySet<string>): void;
|
|
3
3
|
export declare function buildSemanticFactInspectorCensus(manifest: SemanticFactManifestV1): SemanticFactManifestV1["inspector"]["census"];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { assertSameSemanticFactSet, requireSemanticFactBasis, semanticFactInvalid, validateSemanticFactLocator, } from "./semantic-fact-policy-primitives.js";
|
|
2
2
|
import { canonicalValueJson, sha256Hex } from "./strict-codec.js";
|
|
3
|
-
export function validateSemanticFactInspectorCensus(manifest) {
|
|
4
|
-
const factRefs = new Set(
|
|
3
|
+
export function validateSemanticFactInspectorCensus(manifest, externalFactRefs = new Set()) {
|
|
4
|
+
const factRefs = new Set([
|
|
5
|
+
...manifest.facts.map((item) => item.key),
|
|
6
|
+
...externalFactRefs,
|
|
7
|
+
]);
|
|
5
8
|
const factsFor = (predicate) => manifest.facts.filter(predicate).map((item) => item.key);
|
|
6
9
|
const expected = expectedCensusRows(manifest, factsFor);
|
|
7
10
|
const actual = new Set();
|
|
@@ -10,7 +10,7 @@ export interface SemanticFactManifestIndexV1 {
|
|
|
10
10
|
oracle_by_ref: Map<string, SemanticFactManifestV1["oracles"][number]>;
|
|
11
11
|
environment_by_ref: Map<string, SemanticFactManifestV1["environments"][number]>;
|
|
12
12
|
}
|
|
13
|
-
export declare function validateSemanticFactManifestPolicy(manifest: SemanticFactManifestV1): SemanticFactManifestIndexV1;
|
|
13
|
+
export declare function validateSemanticFactManifestPolicy(manifest: SemanticFactManifestV1, externalFactRefs?: ReadonlySet<string>): SemanticFactManifestIndexV1;
|
|
14
14
|
export declare const complete_non_ui_semantic_fact_delivery = "expected=source=contract;proofs=current";
|
|
15
15
|
export declare const NO_UI_CONTROL_RELATIONS = true;
|
|
16
16
|
export declare const NO_SEMANTIC_FACT_SHORTCUTS = true;
|
|
@@ -7,7 +7,7 @@ import { validateSemanticFactProofClosure } from "./semantic-fact-policy-proofs.
|
|
|
7
7
|
import { validateSemanticFactPropertyClosure } from "./semantic-fact-policy-properties.js";
|
|
8
8
|
import { validateSemanticFactFamilyClosure, validateSemanticFactUnits, } from "./semantic-fact-policy-units.js";
|
|
9
9
|
export { semanticFactCollectionIdentity } from "./semantic-fact-policy-authority.js";
|
|
10
|
-
export function validateSemanticFactManifestPolicy(manifest) {
|
|
10
|
+
export function validateSemanticFactManifestPolicy(manifest, externalFactRefs = new Set()) {
|
|
11
11
|
validateSemanticFactUniqueIdentities(manifest);
|
|
12
12
|
validateSemanticFactGeneration(manifest);
|
|
13
13
|
validateSemanticFactInspector(manifest);
|
|
@@ -18,7 +18,7 @@ export function validateSemanticFactManifestPolicy(manifest) {
|
|
|
18
18
|
validateSemanticFactPropertyClosure(manifest, units);
|
|
19
19
|
validateSemanticFactClosure(manifest, units);
|
|
20
20
|
validateSemanticFactProofClosure(manifest);
|
|
21
|
-
validateSemanticFactInspectorCensus(manifest);
|
|
21
|
+
validateSemanticFactInspectorCensus(manifest, externalFactRefs);
|
|
22
22
|
if (manifest.blockers.length)
|
|
23
23
|
semanticFactInvalid("blockers_present", manifest.blockers
|
|
24
24
|
.map((item) => item.key)
|