project-tiny-context-harness 0.8.17 → 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 +93 -30
- package/assets/README.md +158 -44
- package/assets/README.zh-CN.md +88 -29
- package/assets/agents/AGENTS_CORE.md +2 -2
- package/assets/context_templates/context.toml +6 -1
- 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/design-resource-authoring/SKILL.md +6 -3
- package/assets/skills/design-resource-authoring/references/authority-delta-assessment.md +52 -0
- package/assets/skills/design-resource-authoring/references/downstream-handoff.md +5 -1
- 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 +8 -1
- 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-input-types.d.ts +1 -1
- package/dist/lib/design-resource-handoff-manifest-projection.js +3 -0
- package/dist/lib/design-resource-handoff-shape.js +14 -2
- package/dist/lib/design-resource-handoff-types.d.ts +3 -0
- package/dist/lib/design-resource-handoff-validation.js +16 -4
- package/dist/lib/design-resource-implementation-feasibility-validation-support.js +1 -1
- 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 +7 -1
- package/dist/lib/design-resource-symbolic-fact-types.d.ts +3 -0
- package/dist/lib/design-resource-symbolic-fact-validation.js +15 -3
- 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 +72 -69
- 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-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.js +3 -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 +6 -1
- package/dist/lib/long-task-delivery-validation.js +19 -4
- package/dist/lib/long-task-design-feasibility-binding.d.ts +1 -0
- package/dist/lib/long-task-design-feasibility-binding.js +3 -3
- package/dist/lib/long-task-design-feasibility-source-closure.js +11 -2
- 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 +3 -1
- package/dist/lib/long-task-design-resource-handoff.js +36 -12
- package/dist/lib/long-task-design-resource-method-binding.js +12 -0
- 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 +128 -5
- 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 +2 -5
- package/dist/lib/long-task-process-table.js +21 -53
- package/dist/lib/long-task-process-tree.d.ts +0 -1
- package/dist/lib/long-task-process-tree.js +24 -54
- 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-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-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 +1 -0
- package/dist/lib/repository-path-safety.js +3 -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 +5 -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,96 @@
|
|
|
1
|
+
import { counterfactualExecutionMayOverlap, evaluateGlobalCounterfactuals, evaluateOutcomeCounterfactuals, } from "./long-task-evidence-v2.js";
|
|
2
|
+
import { MAX_OVERLAPPING_RUNNERS } from "./long-task-verifier-execution.js";
|
|
3
|
+
export async function evaluateSelectedCounterfactuals(input) {
|
|
4
|
+
const passingCheckIds = new Set(input.baseline_results
|
|
5
|
+
.filter((result) => result.status === "passed")
|
|
6
|
+
.map((result) => result.internal_id));
|
|
7
|
+
const tasks = [
|
|
8
|
+
...globalCounterfactualTasks(input, passingCheckIds),
|
|
9
|
+
...outcomeCounterfactualTasks(input, passingCheckIds),
|
|
10
|
+
];
|
|
11
|
+
const findings = [];
|
|
12
|
+
for (let index = 0; index < tasks.length;) {
|
|
13
|
+
const batch = eligibleCounterfactualBatch(tasks, index);
|
|
14
|
+
const results = await Promise.all(batch.map((task) => task.run()));
|
|
15
|
+
for (const result of results)
|
|
16
|
+
findings.push(...result);
|
|
17
|
+
index += batch.length;
|
|
18
|
+
}
|
|
19
|
+
return findings;
|
|
20
|
+
}
|
|
21
|
+
function globalCounterfactualTasks(input, passingCheckIds) {
|
|
22
|
+
const selectedCheckKeys = new Set(input.selected_checks
|
|
23
|
+
.filter((check) => check.outcome_key === null && passingCheckIds.has(check.internal_id))
|
|
24
|
+
.map((check) => check.key));
|
|
25
|
+
return input.compiled.global.acceptance.counterfactual_controls
|
|
26
|
+
.filter((control) => selectedCheckKeys.has(control.check_key))
|
|
27
|
+
.map((control) => {
|
|
28
|
+
const selectedCompiled = {
|
|
29
|
+
...input.compiled,
|
|
30
|
+
global: {
|
|
31
|
+
...input.compiled.global,
|
|
32
|
+
acceptance: {
|
|
33
|
+
...input.compiled.global.acceptance,
|
|
34
|
+
counterfactual_controls: [control],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const check = input.compiled.global.acceptance.checks.find((candidate) => candidate.key === control.check_key);
|
|
39
|
+
return {
|
|
40
|
+
overlap_eligible: counterfactualExecutionMayOverlap({
|
|
41
|
+
check,
|
|
42
|
+
control,
|
|
43
|
+
protected_authority_paths: input.observation_authority_paths,
|
|
44
|
+
}),
|
|
45
|
+
run: () => evaluateGlobalCounterfactuals(selectedCompiled, input.snapshot_root, new Set([control.check_key]), input.snapshot_manifest, input.baseline_results, input.baseline_executions, input.complete_checks),
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function outcomeCounterfactualTasks(input, passingCheckIds) {
|
|
50
|
+
const selectedOutcomeKeys = new Set(input.selected_checks
|
|
51
|
+
.map((check) => check.outcome_key)
|
|
52
|
+
.filter((key) => Boolean(key)));
|
|
53
|
+
return input.compiled.outcomes
|
|
54
|
+
.filter((outcome) => selectedOutcomeKeys.has(outcome.key))
|
|
55
|
+
.flatMap((outcome) => {
|
|
56
|
+
const selectedCheckKeys = new Set(input.selected_checks
|
|
57
|
+
.filter((check) => check.outcome_key === outcome.key &&
|
|
58
|
+
passingCheckIds.has(check.internal_id))
|
|
59
|
+
.map((check) => check.key));
|
|
60
|
+
return outcome.acceptance.counterfactual_controls
|
|
61
|
+
.filter((control) => selectedCheckKeys.has(control.check_key))
|
|
62
|
+
.map((control) => {
|
|
63
|
+
const check = outcome.acceptance.checks.find((candidate) => candidate.key === control.check_key);
|
|
64
|
+
const selectedOutcome = {
|
|
65
|
+
...outcome,
|
|
66
|
+
acceptance: {
|
|
67
|
+
...outcome.acceptance,
|
|
68
|
+
counterfactual_controls: [control],
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
overlap_eligible: counterfactualExecutionMayOverlap({
|
|
73
|
+
check,
|
|
74
|
+
control,
|
|
75
|
+
protected_authority_paths: input.observation_authority_paths,
|
|
76
|
+
}),
|
|
77
|
+
run: () => evaluateOutcomeCounterfactuals(selectedOutcome, input.snapshot_root, input.snapshot_manifest, input.observation_authority_paths, input.baseline_results, input.baseline_executions, input.complete_checks),
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function eligibleCounterfactualBatch(tasks, index) {
|
|
83
|
+
const first = tasks[index];
|
|
84
|
+
if (!first)
|
|
85
|
+
return [];
|
|
86
|
+
const batch = [first];
|
|
87
|
+
if (!first.overlap_eligible)
|
|
88
|
+
return batch;
|
|
89
|
+
while (batch.length < MAX_OVERLAPPING_RUNNERS) {
|
|
90
|
+
const next = tasks[index + batch.length];
|
|
91
|
+
if (!next?.overlap_eligible)
|
|
92
|
+
break;
|
|
93
|
+
batch.push(next);
|
|
94
|
+
}
|
|
95
|
+
return batch;
|
|
96
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CompiledCheckV2, RawCommandExecutionV2 } from "./long-task-delivery-types.js";
|
|
2
|
+
import type { PreparedExecutionObservationGroupV2 } from "./long-task-execution-observation.js";
|
|
3
|
+
export declare const MAX_OVERLAPPING_RUNNERS = 3;
|
|
4
|
+
export declare function executePreparedRawExecutionGroups(input: {
|
|
5
|
+
selected_groups: readonly (readonly CompiledCheckV2[])[];
|
|
6
|
+
complete_groups: readonly (readonly CompiledCheckV2[])[];
|
|
7
|
+
prepared_groups: readonly PreparedExecutionObservationGroupV2[];
|
|
8
|
+
}): Promise<Map<string, RawCommandExecutionV2>>;
|
|
9
|
+
export declare function rawExecutionGroupMayOverlap(checks: readonly CompiledCheckV2[]): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { executeCheckRunner } from "./long-task-check-runner.js";
|
|
2
|
+
export const MAX_OVERLAPPING_RUNNERS = 3;
|
|
3
|
+
export async function executePreparedRawExecutionGroups(input) {
|
|
4
|
+
try {
|
|
5
|
+
const tasks = preparedRawExecutionTasks(input);
|
|
6
|
+
const pending = [];
|
|
7
|
+
for (let index = 0; index < tasks.length;) {
|
|
8
|
+
const batch = eligibleRunnerBatch(tasks, index);
|
|
9
|
+
pending.push(...(await Promise.all(batch.map((task) => task.run()))));
|
|
10
|
+
index += batch.length;
|
|
11
|
+
}
|
|
12
|
+
const finalized = await Promise.all(pending.map(async (entry) => ({
|
|
13
|
+
raw_execution_identity: entry.raw_execution_identity,
|
|
14
|
+
raw: await entry.prepared.finalize(entry.raw),
|
|
15
|
+
})));
|
|
16
|
+
return new Map(finalized.map((entry) => [entry.raw_execution_identity, entry.raw]));
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
await Promise.all(input.prepared_groups.map((prepared) => prepared.dispose()));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function preparedRawExecutionTasks(input) {
|
|
23
|
+
return input.selected_groups.map((group, index) => {
|
|
24
|
+
const prepared = input.prepared_groups[index];
|
|
25
|
+
const complete = input.complete_groups[index];
|
|
26
|
+
if (!prepared || !complete)
|
|
27
|
+
throw new Error("raw_execution_group_prepare_missing");
|
|
28
|
+
return {
|
|
29
|
+
overlap_eligible: rawExecutionGroupMayOverlap(complete),
|
|
30
|
+
run: async () => ({
|
|
31
|
+
raw_execution_identity: group[0].raw_execution_identity,
|
|
32
|
+
raw: await executeCheckRunner(group[0], prepared.execution_root, prepared.runner_context),
|
|
33
|
+
prepared,
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function eligibleRunnerBatch(tasks, index) {
|
|
39
|
+
const first = tasks[index];
|
|
40
|
+
if (!first)
|
|
41
|
+
return [];
|
|
42
|
+
const batch = [first];
|
|
43
|
+
if (!first.overlap_eligible)
|
|
44
|
+
return batch;
|
|
45
|
+
while (batch.length < MAX_OVERLAPPING_RUNNERS) {
|
|
46
|
+
const next = tasks[index + batch.length];
|
|
47
|
+
if (!next?.overlap_eligible)
|
|
48
|
+
break;
|
|
49
|
+
batch.push(next);
|
|
50
|
+
}
|
|
51
|
+
return batch;
|
|
52
|
+
}
|
|
53
|
+
export function rawExecutionGroupMayOverlap(checks) {
|
|
54
|
+
if (!checks.length)
|
|
55
|
+
return false;
|
|
56
|
+
const runner = checks[0].runner;
|
|
57
|
+
if (runner.effect !== "read_only" ||
|
|
58
|
+
!runner.idempotent ||
|
|
59
|
+
runner.retry_policy !== "none" ||
|
|
60
|
+
checks[0].environment_requirements.some((requirement) => requirement.kind === "loopback_tcp"))
|
|
61
|
+
return false;
|
|
62
|
+
const processChecks = checks.filter((check) => (check.observation_authorities ?? []).some((authority) => authority.authority === "package_process_json_exact"));
|
|
63
|
+
if (!processChecks.length)
|
|
64
|
+
return false;
|
|
65
|
+
const closureIdentities = new Set(processChecks.map((check) => check.process_runtime_closure?.closure_identity ?? null));
|
|
66
|
+
return closureIdentities.size === 1 && !closureIdentities.has(null);
|
|
67
|
+
}
|
|
@@ -6,6 +6,7 @@ import OUTCOMES_SCHEMA from "../schemas/long-task-delivery-v2/long-task-outcomes
|
|
|
6
6
|
import { checkLongTaskCompletionGate } from "./long-task-hook-preflight.js";
|
|
7
7
|
import { assertProtectedRepositoryFile } from "./long-task-protected-files.js";
|
|
8
8
|
import { canonicalValueJson, sha256Hex } from "./strict-codec.js";
|
|
9
|
+
import { WINDOWS_JOB_SUPERVISOR_ASSET_RELATIVE_FILES } from "./long-task-windows-job-supervisor-protocol.js";
|
|
9
10
|
const REQUIRED_ENTRYPOINTS = [
|
|
10
11
|
"cli.js",
|
|
11
12
|
"long-task-hook.js",
|
|
@@ -45,11 +46,21 @@ async function verifierBundleFiles(packageRoot) {
|
|
|
45
46
|
relativeFiles.add(`lib/${file}`);
|
|
46
47
|
relativeFiles.add("schemas/long-task-delivery-v2/long-task-delivery-v2.schema.json");
|
|
47
48
|
relativeFiles.add("schemas/long-task-delivery-v2/long-task-outcomes-v2.schema.json");
|
|
48
|
-
const
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const bundleTargets = [
|
|
50
|
+
...[...relativeFiles].map((relative) => ({
|
|
51
|
+
key: relative,
|
|
52
|
+
absolute: path.join(distRoot, ...relative.split("/")),
|
|
53
|
+
})),
|
|
54
|
+
...WINDOWS_JOB_SUPERVISOR_ASSET_RELATIVE_FILES.map((relative) => ({
|
|
55
|
+
key: relative,
|
|
56
|
+
absolute: path.join(packageRoot, ...relative.split("/")),
|
|
57
|
+
})),
|
|
58
|
+
];
|
|
59
|
+
const rows = await Promise.all(bundleTargets
|
|
60
|
+
.sort((left, right) => left.key.localeCompare(right.key))
|
|
61
|
+
.map(async ({ key, absolute }) => [
|
|
62
|
+
key,
|
|
63
|
+
sha256Hex(await readFile(await assertProtectedRepositoryFile(packageRoot, absolute, `package_owned_verifier:${key}`))),
|
|
53
64
|
]));
|
|
54
65
|
return Object.fromEntries(rows);
|
|
55
66
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { deliveryCompileFreshness } from "./long-task-freshness.js";
|
|
2
2
|
import { assertVerifierAuthorityCurrent } from "./long-task-freshness.js";
|
|
3
3
|
import { enrichCheckResultFindings, enrichFinding, } from "./long-task-finding-context.js";
|
|
4
|
-
import { executeCheckRunner } from "./long-task-check-runner.js";
|
|
5
4
|
import { prepareExecutionObservationUniverse } from "./long-task-execution-observation.js";
|
|
6
|
-
import { evaluateCheckEvidence
|
|
5
|
+
import { evaluateCheckEvidence } from "./long-task-evidence-v2.js";
|
|
7
6
|
import { matchesRepoPattern } from "./long-task-paths.js";
|
|
8
|
-
import {
|
|
7
|
+
import { deriveRepairFrontier } from "./long-task-repair-frontier.js";
|
|
8
|
+
import { activeAuthorityIdentityMatches, loadActiveLongTaskAuthority, readProgressRecords, writeProgressRecord, } from "./long-task-state.js";
|
|
9
9
|
import { createProgressRecord } from "./long-task-progress.js";
|
|
10
10
|
import { changedWorkspacePaths, createWorkspaceSnapshot, repositoryRoot, } from "./long-task-workspace.js";
|
|
11
11
|
import { classifyWorkspaceScope, protectedWorkspacePaths, } from "./long-task-workspace-scope.js";
|
|
12
|
+
import { evaluateSelectedCounterfactuals } from "./long-task-verifier-counterfactuals.js";
|
|
13
|
+
import { executePreparedRawExecutionGroups } from "./long-task-verifier-execution.js";
|
|
12
14
|
export async function verifyDeliveryContract(workdir, selection = {}) {
|
|
13
15
|
const repository = await repositoryRoot(process.cwd());
|
|
14
16
|
const active = (await loadActiveLongTaskAuthority(repository, { migrate_legacy: true })).authority;
|
|
@@ -25,6 +27,7 @@ export async function verifyDeliveryContract(workdir, selection = {}) {
|
|
|
25
27
|
worktree_identity: active.worktree_identity,
|
|
26
28
|
};
|
|
27
29
|
const selected = selectChecks(compiled, selection);
|
|
30
|
+
const existingProgress = await readProgressRecords(active.workdir);
|
|
28
31
|
const snapshot = await createWorkspaceSnapshot(compiled.repository_root, compiled.workdir, `verify-${compiled.task.id}`);
|
|
29
32
|
try {
|
|
30
33
|
const run = await runDeliveryChecks(compiled, snapshot, selected, true);
|
|
@@ -51,6 +54,12 @@ export async function verifyDeliveryContract(workdir, selection = {}) {
|
|
|
51
54
|
message: "Active Authority changed while targeted verification was running.",
|
|
52
55
|
next_action: "Discard the stale progress and rerun verification against the active Authority Revision.",
|
|
53
56
|
});
|
|
57
|
+
const repairFrontier = deriveRepairFrontier({
|
|
58
|
+
compiled,
|
|
59
|
+
manifest: snapshot.manifest,
|
|
60
|
+
progress: existingProgress,
|
|
61
|
+
findings: run.findings,
|
|
62
|
+
});
|
|
54
63
|
return {
|
|
55
64
|
schema_version: "long-task-targeted-progress-v2",
|
|
56
65
|
compiled_identity: compiled.compiled_identity,
|
|
@@ -61,10 +70,21 @@ export async function verifyDeliveryContract(workdir, selection = {}) {
|
|
|
61
70
|
updated_progress_records: [],
|
|
62
71
|
check_results: run.check_results,
|
|
63
72
|
findings: run.findings,
|
|
73
|
+
repair_frontier: repairFrontier,
|
|
64
74
|
completed_at: new Date().toISOString(),
|
|
65
75
|
};
|
|
66
76
|
}
|
|
67
77
|
await Promise.all(records.map((record) => writeProgressRecord(workdir, record)));
|
|
78
|
+
const updatedProgress = {
|
|
79
|
+
...existingProgress,
|
|
80
|
+
...Object.fromEntries(records.map((record) => [record.check_internal_id, record])),
|
|
81
|
+
};
|
|
82
|
+
const repairFrontier = deriveRepairFrontier({
|
|
83
|
+
compiled,
|
|
84
|
+
manifest: snapshot.manifest,
|
|
85
|
+
progress: updatedProgress,
|
|
86
|
+
findings: run.findings,
|
|
87
|
+
});
|
|
68
88
|
return {
|
|
69
89
|
schema_version: "long-task-targeted-progress-v2",
|
|
70
90
|
compiled_identity: compiled.compiled_identity,
|
|
@@ -75,6 +95,7 @@ export async function verifyDeliveryContract(workdir, selection = {}) {
|
|
|
75
95
|
updated_progress_records: records.map((record) => record.check_internal_id),
|
|
76
96
|
check_results: run.check_results,
|
|
77
97
|
findings: run.findings,
|
|
98
|
+
repair_frontier: repairFrontier,
|
|
78
99
|
completed_at: new Date().toISOString(),
|
|
79
100
|
};
|
|
80
101
|
}
|
|
@@ -86,12 +107,16 @@ async function resolved(workdir) {
|
|
|
86
107
|
return (await import("node:path")).default.resolve(workdir);
|
|
87
108
|
}
|
|
88
109
|
export async function runDeliveryChecks(compiled, snapshot, checks, includeCounterfactuals, finalGate = false) {
|
|
110
|
+
const completeChecks = allCompiledChecks(compiled);
|
|
89
111
|
const observationAuthorityPaths = [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
112
|
+
...new Set([
|
|
113
|
+
compiled.contract_file,
|
|
114
|
+
...Object.keys(compiled.contract_files),
|
|
115
|
+
...Object.keys(compiled.source_hashes),
|
|
116
|
+
...compiled.context_snapshot.files,
|
|
117
|
+
...completeChecks.flatMap((check) => check.protected_authority_paths ?? []),
|
|
118
|
+
]),
|
|
119
|
+
].sort((left, right) => Buffer.from(left).compare(Buffer.from(right)));
|
|
95
120
|
const findings = await preRunFindings(compiled, snapshot.manifest);
|
|
96
121
|
if (finalGate)
|
|
97
122
|
findings.push(...finalPathFindings(compiled, snapshot.manifest));
|
|
@@ -101,8 +126,6 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
|
|
|
101
126
|
check_results: [],
|
|
102
127
|
findings: findings.map((finding) => enrichFinding(compiled, finding)),
|
|
103
128
|
};
|
|
104
|
-
const rawExecutions = new Map();
|
|
105
|
-
const completeChecks = allCompiledChecks(compiled);
|
|
106
129
|
const selectedExecutionGroups = rawExecutionGroups(checks);
|
|
107
130
|
const completeExecutionGroups = selectedExecutionGroups.map((group) => completeChecks.filter((check) => check.raw_execution_identity === group[0].raw_execution_identity));
|
|
108
131
|
const preparedExecutionGroups = await prepareExecutionObservationUniverse({
|
|
@@ -111,28 +134,11 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
|
|
|
111
134
|
workspace_manifest: snapshot.manifest,
|
|
112
135
|
protected_authority_paths: observationAuthorityPaths,
|
|
113
136
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
throw new Error("raw_execution_group_prepare_missing");
|
|
120
|
-
pending.push({
|
|
121
|
-
raw_execution_identity: group[0].raw_execution_identity,
|
|
122
|
-
raw: await executeCheckRunner(group[0], prepared.execution_root, prepared.runner_context),
|
|
123
|
-
prepared,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
const finalized = await Promise.all(pending.map(async (entry) => ({
|
|
127
|
-
raw_execution_identity: entry.raw_execution_identity,
|
|
128
|
-
raw: await entry.prepared.finalize(entry.raw),
|
|
129
|
-
})));
|
|
130
|
-
for (const entry of finalized)
|
|
131
|
-
rawExecutions.set(entry.raw_execution_identity, entry.raw);
|
|
132
|
-
}
|
|
133
|
-
finally {
|
|
134
|
-
await Promise.all(preparedExecutionGroups.map((prepared) => prepared.dispose()));
|
|
135
|
-
}
|
|
137
|
+
const rawExecutions = await executePreparedRawExecutionGroups({
|
|
138
|
+
selected_groups: selectedExecutionGroups,
|
|
139
|
+
complete_groups: completeExecutionGroups,
|
|
140
|
+
prepared_groups: preparedExecutionGroups,
|
|
141
|
+
});
|
|
136
142
|
const mainCheckResults = [];
|
|
137
143
|
for (const check of checks) {
|
|
138
144
|
const raw = rawExecutions.get(check.raw_execution_identity);
|
|
@@ -143,39 +149,20 @@ export async function runDeliveryChecks(compiled, snapshot, checks, includeCount
|
|
|
143
149
|
: undefined;
|
|
144
150
|
mainCheckResults.push(await evaluateCheckEvidence(check, raw, snapshot.root, outcome, observationAuthorityPaths));
|
|
145
151
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (selectedGlobalCheckKeys.size)
|
|
161
|
-
counterfactualFindings.push(...(await evaluateGlobalCounterfactuals(compiled, snapshot.root, selectedGlobalCheckKeys, snapshot.manifest, mainCheckResults, rawExecutions, completeChecks)));
|
|
162
|
-
const outcomeKeys = new Set(checks
|
|
163
|
-
.map((check) => check.outcome_key)
|
|
164
|
-
.filter((key) => Boolean(key)));
|
|
165
|
-
for (const outcome of compiled.outcomes.filter((item) => outcomeKeys.has(item.key))) {
|
|
166
|
-
const selectedKeys = new Set(checks
|
|
167
|
-
.filter((check) => check.outcome_key === outcome.key &&
|
|
168
|
-
passingCheckIds.has(check.internal_id))
|
|
169
|
-
.map((check) => check.key));
|
|
170
|
-
counterfactualFindings.push(...(await evaluateOutcomeCounterfactuals({
|
|
171
|
-
...outcome,
|
|
172
|
-
acceptance: {
|
|
173
|
-
...outcome.acceptance,
|
|
174
|
-
counterfactual_controls: outcome.acceptance.counterfactual_controls.filter((control) => selectedKeys.has(control.check_key)),
|
|
175
|
-
},
|
|
176
|
-
}, snapshot.root, snapshot.manifest, observationAuthorityPaths, mainCheckResults, rawExecutions, completeChecks)));
|
|
177
|
-
}
|
|
178
|
-
}
|
|
152
|
+
// Sensitivity runs only for otherwise passing owners, so an external or
|
|
153
|
+
// failed primary result cannot be obscured by a mutated-sandbox finding.
|
|
154
|
+
const counterfactualFindings = includeCounterfactuals
|
|
155
|
+
? await evaluateSelectedCounterfactuals({
|
|
156
|
+
compiled,
|
|
157
|
+
selected_checks: checks,
|
|
158
|
+
complete_checks: completeChecks,
|
|
159
|
+
snapshot_root: snapshot.root,
|
|
160
|
+
snapshot_manifest: snapshot.manifest,
|
|
161
|
+
observation_authority_paths: observationAuthorityPaths,
|
|
162
|
+
baseline_results: mainCheckResults,
|
|
163
|
+
baseline_executions: rawExecutions,
|
|
164
|
+
})
|
|
165
|
+
: [];
|
|
179
166
|
const unassignedCounterfactuals = counterfactualFindings.filter((finding) => !mainCheckResults.some((result) => findingBelongsToCheck(finding, result)));
|
|
180
167
|
const unassignedFinding = unassignedCounterfactuals.length
|
|
181
168
|
? unassignedCounterfactualFinding(unassignedCounterfactuals)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runOneWindowsJobHelperRequest(powershell: string, helper: string, request: string, helperTimeoutMs: number): Promise<string>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
const HELPER_RESPONSE_LIMIT = 64 * 1024;
|
|
3
|
+
const HELPER_DIAGNOSTIC_LIMIT = 1024 * 1024;
|
|
4
|
+
const HELPER_TERMINATION_GRACE_MS = 5_000;
|
|
5
|
+
export function runOneWindowsJobHelperRequest(powershell, helper, request, helperTimeoutMs) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const child = spawn(powershell, [
|
|
8
|
+
"-NoLogo",
|
|
9
|
+
"-NoProfile",
|
|
10
|
+
"-NonInteractive",
|
|
11
|
+
"-ExecutionPolicy",
|
|
12
|
+
"Bypass",
|
|
13
|
+
"-File",
|
|
14
|
+
helper,
|
|
15
|
+
], {
|
|
16
|
+
shell: false,
|
|
17
|
+
windowsHide: true,
|
|
18
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
19
|
+
});
|
|
20
|
+
const stdout = [];
|
|
21
|
+
const stderr = [];
|
|
22
|
+
let stdoutBytes = 0;
|
|
23
|
+
let stderrBytes = 0;
|
|
24
|
+
let settled = false;
|
|
25
|
+
let pendingError = null;
|
|
26
|
+
let terminationTimer = null;
|
|
27
|
+
const timer = setTimeout(() => {
|
|
28
|
+
stopHelper(new Error("process_observer_windows_job_unavailable:helper_timeout"));
|
|
29
|
+
}, helperTimeoutMs);
|
|
30
|
+
child.stdout.on("data", (chunk) => {
|
|
31
|
+
stdoutBytes += chunk.length;
|
|
32
|
+
if (stdoutBytes > HELPER_RESPONSE_LIMIT) {
|
|
33
|
+
stopHelper(new Error("process_observer_windows_job_result_invalid:response_limit"));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
stdout.push(Buffer.from(chunk));
|
|
37
|
+
});
|
|
38
|
+
child.stderr.on("data", (chunk) => {
|
|
39
|
+
const remaining = HELPER_DIAGNOSTIC_LIMIT - stderrBytes;
|
|
40
|
+
if (remaining <= 0)
|
|
41
|
+
return;
|
|
42
|
+
const retained = Buffer.from(chunk).subarray(0, remaining);
|
|
43
|
+
stderr.push(retained);
|
|
44
|
+
stderrBytes += retained.length;
|
|
45
|
+
});
|
|
46
|
+
child.stdin.once("error", (error) => stopHelper(new Error(`process_observer_windows_job_unavailable:request_write:${message(error)}`)));
|
|
47
|
+
child.once("error", (error) => {
|
|
48
|
+
const helperError = new Error(`process_observer_windows_job_unavailable:helper_spawn:${message(error)}`);
|
|
49
|
+
if (child.pid)
|
|
50
|
+
stopHelper(helperError);
|
|
51
|
+
else
|
|
52
|
+
finish(helperError);
|
|
53
|
+
});
|
|
54
|
+
child.once("close", (status, signal) => {
|
|
55
|
+
if (pendingError) {
|
|
56
|
+
finish(pendingError);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (status !== 0) {
|
|
60
|
+
const diagnostic = Buffer.concat(stderr)
|
|
61
|
+
.toString("utf8")
|
|
62
|
+
.trim()
|
|
63
|
+
.slice(0, 16_384)
|
|
64
|
+
.replace(/[\r\n]+/gu, " ");
|
|
65
|
+
finish(new Error(`process_observer_windows_job_unavailable:helper_exit:${status}:${signal}:${diagnostic}`));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const response = Buffer.concat(stdout).toString("utf8");
|
|
69
|
+
if (!/^[^\r\n]+(?:\r?\n)?$/u.test(response)) {
|
|
70
|
+
finish(new Error("process_observer_windows_job_result_invalid:response_lines"));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
finish(undefined, response.replace(/\r?\n$/u, ""));
|
|
74
|
+
});
|
|
75
|
+
child.stdin.end(`${request}\n`, "utf8");
|
|
76
|
+
function stopHelper(error) {
|
|
77
|
+
if (settled)
|
|
78
|
+
return;
|
|
79
|
+
pendingError ??= error;
|
|
80
|
+
child.stdin.destroy();
|
|
81
|
+
if (!child.pid) {
|
|
82
|
+
finish(pendingError);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
child.kill("SIGKILL");
|
|
86
|
+
terminationTimer ??= setTimeout(() => finish(pendingError), HELPER_TERMINATION_GRACE_MS);
|
|
87
|
+
}
|
|
88
|
+
function finish(error, response) {
|
|
89
|
+
if (settled)
|
|
90
|
+
return;
|
|
91
|
+
settled = true;
|
|
92
|
+
clearTimeout(timer);
|
|
93
|
+
if (terminationTimer)
|
|
94
|
+
clearTimeout(terminationTimer);
|
|
95
|
+
if (error)
|
|
96
|
+
reject(error);
|
|
97
|
+
else
|
|
98
|
+
resolve(response);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function message(error) {
|
|
103
|
+
return error instanceof Error ? error.message : String(error);
|
|
104
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { parseWindowsJobSupervisorResult, type WindowsJobSupervisorResult, } from "./long-task-windows-job-supervisor-result.js";
|
|
2
|
+
export declare const WINDOWS_JOB_SUPERVISOR_REQUEST_SCHEMA = "formal-process-supervisor-request-v1";
|
|
3
|
+
export declare const WINDOWS_JOB_SUPERVISOR_ASSET_RELATIVE_FILES: readonly ["assets/runtime/windows-job-supervisor/formal_process_supervisor_native_types.cs", "assets/runtime/windows-job-supervisor/formal_process_supervisor_native_run.cs", "assets/runtime/windows-job-supervisor/formal_process_supervisor_native_helpers.cs", "assets/runtime/windows-job-supervisor/windows_job_process_supervisor.ps1"];
|
|
4
|
+
export interface WindowsJobSupervisorRequest {
|
|
5
|
+
schema_version: typeof WINDOWS_JOB_SUPERVISOR_REQUEST_SCHEMA;
|
|
6
|
+
request_id: string;
|
|
7
|
+
executable: string;
|
|
8
|
+
argv: string[];
|
|
9
|
+
cwd: string;
|
|
10
|
+
stdout_path: string;
|
|
11
|
+
stderr_path: string;
|
|
12
|
+
timeout_ms: number;
|
|
13
|
+
combined_output_limit_bytes: number;
|
|
14
|
+
environment: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createWindowsJobSupervisorRequest(input: {
|
|
17
|
+
requestId: string;
|
|
18
|
+
executable: string;
|
|
19
|
+
argv: readonly string[];
|
|
20
|
+
cwd: string;
|
|
21
|
+
stdoutPath: string;
|
|
22
|
+
stderrPath: string;
|
|
23
|
+
timeoutMs: number;
|
|
24
|
+
combinedOutputLimitBytes: number;
|
|
25
|
+
environment: NodeJS.ProcessEnv;
|
|
26
|
+
}): WindowsJobSupervisorRequest;
|
|
27
|
+
export declare function assertFreshWindowsJobStreamTarget(target: string): Promise<void>;
|
|
28
|
+
export declare function readWindowsJobStream(target: string, expectedBytes: number, maximumBytes: number): Promise<Buffer>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { lstat, open, realpath } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export { parseWindowsJobSupervisorResult, } from "./long-task-windows-job-supervisor-result.js";
|
|
4
|
+
export const WINDOWS_JOB_SUPERVISOR_REQUEST_SCHEMA = "formal-process-supervisor-request-v1";
|
|
5
|
+
export const WINDOWS_JOB_SUPERVISOR_ASSET_RELATIVE_FILES = [
|
|
6
|
+
"assets/runtime/windows-job-supervisor/formal_process_supervisor_native_types.cs",
|
|
7
|
+
"assets/runtime/windows-job-supervisor/formal_process_supervisor_native_run.cs",
|
|
8
|
+
"assets/runtime/windows-job-supervisor/formal_process_supervisor_native_helpers.cs",
|
|
9
|
+
"assets/runtime/windows-job-supervisor/windows_job_process_supervisor.ps1",
|
|
10
|
+
];
|
|
11
|
+
export function createWindowsJobSupervisorRequest(input) {
|
|
12
|
+
if (!validIdentity(input.requestId) ||
|
|
13
|
+
!validAbsolutePath(input.executable) ||
|
|
14
|
+
!validAbsolutePath(input.cwd) ||
|
|
15
|
+
!validAbsolutePath(input.stdoutPath) ||
|
|
16
|
+
!validAbsolutePath(input.stderrPath) ||
|
|
17
|
+
!Number.isSafeInteger(input.timeoutMs) ||
|
|
18
|
+
input.timeoutMs <= 0 ||
|
|
19
|
+
input.timeoutMs > 2_147_483_647 ||
|
|
20
|
+
!Number.isSafeInteger(input.combinedOutputLimitBytes) ||
|
|
21
|
+
input.combinedOutputLimitBytes <= 0 ||
|
|
22
|
+
!input.argv.every(validString))
|
|
23
|
+
invalidResult("request_invalid");
|
|
24
|
+
const environment = {};
|
|
25
|
+
for (const [key, value] of Object.entries(input.environment)) {
|
|
26
|
+
if (value === undefined)
|
|
27
|
+
continue;
|
|
28
|
+
if (!validEnvironmentKey(key) ||
|
|
29
|
+
!validString(value) ||
|
|
30
|
+
value.includes("\r") ||
|
|
31
|
+
value.includes("\n"))
|
|
32
|
+
invalidResult(`environment_invalid:${key}`);
|
|
33
|
+
environment[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
schema_version: WINDOWS_JOB_SUPERVISOR_REQUEST_SCHEMA,
|
|
37
|
+
request_id: input.requestId,
|
|
38
|
+
executable: input.executable,
|
|
39
|
+
argv: [...input.argv],
|
|
40
|
+
cwd: input.cwd,
|
|
41
|
+
stdout_path: input.stdoutPath,
|
|
42
|
+
stderr_path: input.stderrPath,
|
|
43
|
+
timeout_ms: input.timeoutMs,
|
|
44
|
+
combined_output_limit_bytes: input.combinedOutputLimitBytes,
|
|
45
|
+
environment,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export async function assertFreshWindowsJobStreamTarget(target) {
|
|
49
|
+
try {
|
|
50
|
+
await lstat(target);
|
|
51
|
+
invalidResult("stream_preexisting");
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (nodeErrorCode(error) !== "ENOENT")
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export async function readWindowsJobStream(target, expectedBytes, maximumBytes) {
|
|
59
|
+
if (!nonnegativeSafeInteger(expectedBytes) ||
|
|
60
|
+
!nonnegativeSafeInteger(maximumBytes) ||
|
|
61
|
+
expectedBytes > maximumBytes)
|
|
62
|
+
invalidResult("stream_bounds");
|
|
63
|
+
const before = await lstat(target).catch(() => invalidResult("stream_missing"));
|
|
64
|
+
if (!before.isFile() ||
|
|
65
|
+
before.isSymbolicLink() ||
|
|
66
|
+
before.nlink !== 1 ||
|
|
67
|
+
before.size !== expectedBytes ||
|
|
68
|
+
before.size > maximumBytes)
|
|
69
|
+
invalidResult("stream_identity");
|
|
70
|
+
if (normalizeHostPath(await realpath(target)) !==
|
|
71
|
+
normalizeHostPath(path.resolve(target)))
|
|
72
|
+
invalidResult("stream_reparse");
|
|
73
|
+
const handle = await open(target, "r");
|
|
74
|
+
try {
|
|
75
|
+
const opened = await handle.stat();
|
|
76
|
+
assertSameFile(opened, before);
|
|
77
|
+
const bytes = await handle.readFile();
|
|
78
|
+
const after = await handle.stat();
|
|
79
|
+
assertSameFile(after, opened);
|
|
80
|
+
if (bytes.length !== expectedBytes)
|
|
81
|
+
invalidResult("stream_identity");
|
|
82
|
+
return bytes;
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
await handle.close();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function assertSameFile(actual, expected) {
|
|
89
|
+
if (!actual.isFile() ||
|
|
90
|
+
actual.size !== expected.size ||
|
|
91
|
+
actual.dev !== expected.dev ||
|
|
92
|
+
actual.ino !== expected.ino)
|
|
93
|
+
invalidResult("stream_identity");
|
|
94
|
+
}
|
|
95
|
+
function nonnegativeSafeInteger(value) {
|
|
96
|
+
return Number.isSafeInteger(value) && Number(value) >= 0;
|
|
97
|
+
}
|
|
98
|
+
function validIdentity(value) {
|
|
99
|
+
return validString(value) && value.length > 0 && value.length <= 256;
|
|
100
|
+
}
|
|
101
|
+
function validString(value) {
|
|
102
|
+
return typeof value === "string" && !value.includes("\u0000");
|
|
103
|
+
}
|
|
104
|
+
function validAbsolutePath(value) {
|
|
105
|
+
return validString(value) && path.isAbsolute(value);
|
|
106
|
+
}
|
|
107
|
+
function validEnvironmentKey(value) {
|
|
108
|
+
return (validString(value) &&
|
|
109
|
+
value.length > 0 &&
|
|
110
|
+
!value.includes("=") &&
|
|
111
|
+
!value.includes("\r") &&
|
|
112
|
+
!value.includes("\n"));
|
|
113
|
+
}
|
|
114
|
+
function normalizeHostPath(value) {
|
|
115
|
+
return process.platform === "win32" ? value.toLowerCase() : value;
|
|
116
|
+
}
|
|
117
|
+
function nodeErrorCode(error) {
|
|
118
|
+
return error && typeof error === "object" && "code" in error
|
|
119
|
+
? String(error.code)
|
|
120
|
+
: null;
|
|
121
|
+
}
|
|
122
|
+
function invalidResult(detail) {
|
|
123
|
+
throw new Error(`process_observer_windows_job_result_invalid:${detail}`);
|
|
124
|
+
}
|