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
package/dist/commands/doctor.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { runDoctor } from "../lib/doctor.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { CONTEXT_DOCTOR_DEFAULTS } from "../lib/context-doctor/context-doctor-types.js";
|
|
3
|
+
export async function doctor(args = []) {
|
|
4
|
+
const options = parseDoctorArgs(args);
|
|
5
|
+
if (options.help) {
|
|
6
|
+
console.log(doctorHelp());
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const report = await runDoctor(process.cwd(), options);
|
|
4
10
|
for (const line of report.info) {
|
|
5
11
|
console.log(line);
|
|
6
12
|
}
|
|
@@ -10,7 +16,59 @@ export async function doctor() {
|
|
|
10
16
|
for (const error of report.errors) {
|
|
11
17
|
console.error(`error: ${error}`);
|
|
12
18
|
}
|
|
13
|
-
if (report.errors.length > 0
|
|
19
|
+
if (report.errors.length > 0 ||
|
|
20
|
+
(options.strict && report.warnings.length > 0)) {
|
|
14
21
|
process.exitCode = 1;
|
|
15
22
|
}
|
|
16
23
|
}
|
|
24
|
+
function parseDoctorArgs(args) {
|
|
25
|
+
const options = {
|
|
26
|
+
strict: false,
|
|
27
|
+
help: false,
|
|
28
|
+
context_file_soft_budget_bytes: CONTEXT_DOCTOR_DEFAULTS.context_file_soft_budget_bytes,
|
|
29
|
+
long_line_code_points: CONTEXT_DOCTOR_DEFAULTS.long_line_code_points,
|
|
30
|
+
trigger_fanout_contexts: CONTEXT_DOCTOR_DEFAULTS.trigger_fanout_contexts,
|
|
31
|
+
};
|
|
32
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
33
|
+
const argument = args[index];
|
|
34
|
+
if (argument === "--strict")
|
|
35
|
+
options.strict = true;
|
|
36
|
+
else if (argument === "--help" || argument === "-h")
|
|
37
|
+
options.help = true;
|
|
38
|
+
else if (argument === "--max-line-length")
|
|
39
|
+
index = readPositiveInteger(args, index, argument, (value) => {
|
|
40
|
+
options.long_line_code_points = value;
|
|
41
|
+
});
|
|
42
|
+
else if (argument === "--context-file-soft-budget")
|
|
43
|
+
index = readPositiveInteger(args, index, argument, (value) => {
|
|
44
|
+
options.context_file_soft_budget_bytes = value;
|
|
45
|
+
});
|
|
46
|
+
else if (argument === "--trigger-fanout-threshold")
|
|
47
|
+
index = readPositiveInteger(args, index, argument, (value) => {
|
|
48
|
+
options.trigger_fanout_contexts = value;
|
|
49
|
+
});
|
|
50
|
+
else
|
|
51
|
+
throw new Error(`unknown doctor argument: ${argument}`);
|
|
52
|
+
}
|
|
53
|
+
return options;
|
|
54
|
+
}
|
|
55
|
+
function readPositiveInteger(args, index, flag, apply) {
|
|
56
|
+
const raw = args[index + 1];
|
|
57
|
+
if (!raw)
|
|
58
|
+
throw new Error(`doctor ${flag} requires a positive integer`);
|
|
59
|
+
const parsed = Number(raw);
|
|
60
|
+
if (!Number.isSafeInteger(parsed) || parsed < 1 || String(parsed) !== raw)
|
|
61
|
+
throw new Error(`doctor ${flag} requires a positive integer`);
|
|
62
|
+
apply(parsed);
|
|
63
|
+
return index + 1;
|
|
64
|
+
}
|
|
65
|
+
function doctorHelp() {
|
|
66
|
+
return `ty-context doctor [--strict]
|
|
67
|
+
[--max-line-length <code-points>]
|
|
68
|
+
[--context-file-soft-budget <bytes>]
|
|
69
|
+
[--trigger-fanout-threshold <contexts>]
|
|
70
|
+
|
|
71
|
+
All new size, line, fan-out, unregistered-file, explicit-link and stable-key
|
|
72
|
+
findings are advisory by default. --strict is opt-in and exits nonzero when a
|
|
73
|
+
warning exists; projects must adopt it explicitly before using it in CI.`;
|
|
74
|
+
}
|
package/dist/commands/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { compositeCampaign } from "./composite-campaign.js";
|
|
|
4
4
|
import { longTask } from "./long-task.js";
|
|
5
5
|
import { deliverySet } from "./delivery-set.js";
|
|
6
6
|
import { designResource } from "./design-resource.js";
|
|
7
|
+
import { designAuthority } from "./design-authority.js";
|
|
7
8
|
import { doctor } from "./doctor.js";
|
|
8
9
|
import { exportContext } from "./export-context.js";
|
|
9
10
|
import { enable } from "./enable.js";
|
|
@@ -13,6 +14,8 @@ import { packageSource } from "./package-source.js";
|
|
|
13
14
|
import { sync } from "./sync.js";
|
|
14
15
|
import { upgrade } from "./upgrade.js";
|
|
15
16
|
import { validate } from "./validate.js";
|
|
17
|
+
import { route } from "./route.js";
|
|
18
|
+
import { context } from "./context.js";
|
|
16
19
|
import { assertHarnessProfileEnabled } from "../lib/profiles.js";
|
|
17
20
|
export const commands = {
|
|
18
21
|
help,
|
|
@@ -22,6 +25,8 @@ export const commands = {
|
|
|
22
25
|
sync,
|
|
23
26
|
upgrade,
|
|
24
27
|
doctor,
|
|
28
|
+
route,
|
|
29
|
+
context,
|
|
25
30
|
"check-modularity": checkModularity,
|
|
26
31
|
"export-context": exportContext,
|
|
27
32
|
validate,
|
|
@@ -30,6 +35,7 @@ export const commands = {
|
|
|
30
35
|
"validate-harness": (args) => validate(["validate-harness", ...args]),
|
|
31
36
|
"long-task": (args) => withLongTaskProfile(args, longTask),
|
|
32
37
|
"design-resource": designResource,
|
|
38
|
+
"design-authority": designAuthority,
|
|
33
39
|
"delivery-set": deliverySet,
|
|
34
40
|
"composite-long-task": compositeLongTask,
|
|
35
41
|
"composite-campaign": compositeCampaign,
|
|
@@ -44,7 +50,16 @@ export function help() {
|
|
|
44
50
|
sync Refresh managed assets; does not run migrations
|
|
45
51
|
upgrade [--check] [--json]
|
|
46
52
|
Run safe migrations, sync managed assets and doctor
|
|
47
|
-
doctor
|
|
53
|
+
doctor [--strict] Diagnose project configuration and all Context files; new findings are advisory
|
|
54
|
+
route --task <text> Experimentally route to read-only Context candidates
|
|
55
|
+
context inspect <path>
|
|
56
|
+
Inspect one Context owner, references and optional route explanation
|
|
57
|
+
context register --path <path> --role <role> [--apply]
|
|
58
|
+
Dry-run or transactionally register one recoverable Context
|
|
59
|
+
context move --from <path> --to <path> [--apply]
|
|
60
|
+
Dry-run or transactionally move one registered Context
|
|
61
|
+
context transaction status|rollback|complete
|
|
62
|
+
Inspect or resolve an unfinished Context mutation journal
|
|
48
63
|
check-modularity --touched|--file <path>|--base <ref> [--limit 300] [--fail-on-warning]
|
|
49
64
|
Warn when selected handwritten source files exceed a line-count limit
|
|
50
65
|
export-context --full|--code|--all|--source-pack|--code-index|--task-context
|
|
@@ -55,7 +70,9 @@ export function help() {
|
|
|
55
70
|
Enforce touched handwritten source file modularity
|
|
56
71
|
validate-harness Run validate-context and validate-code-modularity
|
|
57
72
|
design-resource <subcommand>
|
|
58
|
-
Validate handoffs or
|
|
73
|
+
Validate handoffs, Authority assessments, or explicit DRA recovery
|
|
74
|
+
design-authority inspect|tokens
|
|
75
|
+
Inspect the complete authority closure or project Tokens; read-only
|
|
59
76
|
long-task <subcommand>
|
|
60
77
|
Manage one Canonical Delivery Contract in the current workspace
|
|
61
78
|
delivery-set <subcommand>
|
|
@@ -34,6 +34,7 @@ task:
|
|
|
34
34
|
description: The declared product target is usable from its root entrypoint.
|
|
35
35
|
required_state: target_profile_usable
|
|
36
36
|
required_target_refs: [replace-runtime]
|
|
37
|
+
completion_authority: machine_only
|
|
37
38
|
execution_targets:
|
|
38
39
|
- key: replace-runtime
|
|
39
40
|
description: The product runtime used by the acceptance oracle.
|
|
@@ -83,6 +84,7 @@ outcomes:
|
|
|
83
84
|
- fact_ref: replace.result.observable
|
|
84
85
|
claim_ref: semantic_fact.replace.result.observable
|
|
85
86
|
applicability_ref: root-success
|
|
87
|
+
- {fact_ref: replace.architecture.boundary, claim_ref: semantic_fact.replace.architecture.boundary, applicability_ref: root-success}
|
|
86
88
|
proofs:
|
|
87
89
|
- proof_ref: replace.result.observable.runtime
|
|
88
90
|
fact_ref: replace.result.observable
|
|
@@ -92,6 +94,14 @@ outcomes:
|
|
|
92
94
|
authority: machine
|
|
93
95
|
check_ref: replace-check
|
|
94
96
|
assertion_ref: replace-semantic-fact
|
|
97
|
+
- proof_ref: replace.architecture.boundary.runtime
|
|
98
|
+
fact_ref: replace.architecture.boundary
|
|
99
|
+
method: exact_value
|
|
100
|
+
proof_surface: runtime_behavior
|
|
101
|
+
evidence_capabilities: [semantic_fact]
|
|
102
|
+
authority: machine
|
|
103
|
+
check_ref: replace-check
|
|
104
|
+
assertion_ref: replace-architecture-semantic-fact
|
|
95
105
|
product:
|
|
96
106
|
observable_result: Describe what a user or system can observe.
|
|
97
107
|
result_applicability_refs: [root-success]
|
|
@@ -157,6 +167,14 @@ outcomes:
|
|
|
157
167
|
evidence_capabilities: [semantic_fact]
|
|
158
168
|
operator: equals
|
|
159
169
|
expected: true
|
|
170
|
+
- key: replace-architecture-semantic-fact
|
|
171
|
+
criterion: The exact Source-indexed architecture Fact passes its frozen comparison on the current target.
|
|
172
|
+
claims: [semantic_fact.replace.architecture.boundary]
|
|
173
|
+
applicability_ref: root-success
|
|
174
|
+
observation: semantic_fact_replace_architecture_boundary
|
|
175
|
+
evidence_capabilities: [semantic_fact]
|
|
176
|
+
operator: equals
|
|
177
|
+
expected: true
|
|
160
178
|
- key: replace-requirement
|
|
161
179
|
criterion: The atomic Source requirement is observable.
|
|
162
180
|
claims: [requirement.replace-requirement]
|
|
@@ -192,14 +210,14 @@ outcomes:
|
|
|
192
210
|
counterfactual_controls:
|
|
193
211
|
- key: replace-semantic-carrier
|
|
194
212
|
binding_key: replace-carrier
|
|
195
|
-
claims: [result, requirement.replace-requirement, obligation.architecture, semantic_fact.replace.result.observable]
|
|
213
|
+
claims: [result, requirement.replace-requirement, obligation.architecture, semantic_fact.replace.result.observable, semantic_fact.replace.architecture.boundary]
|
|
196
214
|
check_key: replace-check
|
|
197
215
|
mutation:
|
|
198
216
|
type: replace_text
|
|
199
217
|
path: src/replace-me.ts
|
|
200
218
|
match: IMPLEMENTED_STATE
|
|
201
219
|
replacement: SEMANTIC_FAILURE_STATE
|
|
202
|
-
expected_assertion_failures: [replace-result, replace-requirement, replace-architecture, replace-semantic-fact]
|
|
220
|
+
expected_assertion_failures: [replace-result, replace-requirement, replace-architecture, replace-semantic-fact, replace-architecture-semantic-fact]
|
|
203
221
|
preserved_assertions: [replace-liveness]
|
|
204
222
|
- key: replace-relation-applicability
|
|
205
223
|
binding_key: replace-carrier
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { realpath } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export async function resolveLongTaskCommandWorkdir(subcommand, workdirArgument) {
|
|
4
|
+
if (!workdirArgument)
|
|
5
|
+
throw new Error(`${subcommand} requires <workdir>`);
|
|
6
|
+
const lexicalWorkdir = path.resolve(process.cwd(), workdirArgument);
|
|
7
|
+
if (subcommand === "init")
|
|
8
|
+
return lexicalWorkdir;
|
|
9
|
+
return canonicalLongTaskCommandWorkdir(lexicalWorkdir, subcommand === "abandon");
|
|
10
|
+
}
|
|
11
|
+
export async function canonicalLongTaskCommandWorkdir(workdir, allowMissing) {
|
|
12
|
+
try {
|
|
13
|
+
return await realpath(workdir);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (allowMissing &&
|
|
17
|
+
error instanceof Error &&
|
|
18
|
+
"code" in error &&
|
|
19
|
+
error.code === "ENOENT")
|
|
20
|
+
return workdir;
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -8,15 +8,16 @@ import { initializeLongTask, preflightLongTask, } from "./long-task-authoring.js
|
|
|
8
8
|
import { flag, option, rejectOptions, rejectUnknown, } from "./long-task-command-args.js";
|
|
9
9
|
import { explainLongTask } from "./long-task-explain.js";
|
|
10
10
|
import { handleLongTaskRevisionCommand } from "./long-task-revision.js";
|
|
11
|
+
import { canonicalLongTaskCommandWorkdir, resolveLongTaskCommandWorkdir, } from "./long-task-workdir.js";
|
|
11
12
|
import { previewVerificationExecution } from "../lib/long-task-verification-preview.js";
|
|
13
|
+
import { externalConfirmationStatus, prepareExternalConfirmations, revokeExternalConfirmation, rotateExternalConfirmation, submitExternalConfirmation, } from "../lib/long-task-external-confirmation-plan.js";
|
|
12
14
|
export async function longTask(args) {
|
|
13
15
|
const subcommand = args[0] ?? "help";
|
|
14
16
|
if (subcommand === "help")
|
|
15
17
|
return help();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const workdir = path.resolve(process.cwd(), workdirArgument);
|
|
18
|
+
if (subcommand === "external")
|
|
19
|
+
return external(args.slice(1));
|
|
20
|
+
const workdir = await resolveLongTaskCommandWorkdir(subcommand, args[1]);
|
|
20
21
|
if (subcommand === "init") {
|
|
21
22
|
rejectUnknown(args.slice(2), []);
|
|
22
23
|
await initializeLongTask(workdir);
|
|
@@ -69,6 +70,7 @@ export async function longTask(args) {
|
|
|
69
70
|
workdir,
|
|
70
71
|
workflow_status: result.workflow_status,
|
|
71
72
|
external_confirmations: result.external_confirmations,
|
|
73
|
+
external_confirmation_results: result.external_confirmation_results,
|
|
72
74
|
target_profile: result.target_profile,
|
|
73
75
|
target_state: result.target_state,
|
|
74
76
|
stage_results: result.stage_results,
|
|
@@ -116,13 +118,75 @@ async function finalGate(workdir, args) {
|
|
|
116
118
|
const result = await runDeliveryFinalGate(workdir);
|
|
117
119
|
console.log(JSON.stringify({
|
|
118
120
|
...result,
|
|
119
|
-
acceptance_scope: "
|
|
121
|
+
acceptance_scope: "declared_delivery_authority",
|
|
120
122
|
native_goal_effect: "none",
|
|
121
123
|
}));
|
|
122
124
|
if (result.workflow_status !== "machine_accepted" &&
|
|
123
|
-
result.workflow_status !== "
|
|
125
|
+
result.workflow_status !== "delivery_accepted")
|
|
124
126
|
process.exitCode = 1;
|
|
125
127
|
}
|
|
128
|
+
async function external(args) {
|
|
129
|
+
const action = args[0];
|
|
130
|
+
const workdirArgument = args[1];
|
|
131
|
+
if (!action)
|
|
132
|
+
throw new Error("external requires prepare|submit|status|rotate|revoke");
|
|
133
|
+
if (!workdirArgument)
|
|
134
|
+
throw new Error(`external ${action} requires <workdir>`);
|
|
135
|
+
const workdir = await canonicalLongTaskCommandWorkdir(path.resolve(process.cwd(), workdirArgument), false);
|
|
136
|
+
const commandArgs = args.slice(2);
|
|
137
|
+
if (action === "prepare") {
|
|
138
|
+
const confirmation = option(commandArgs, "--confirmation");
|
|
139
|
+
rejectOptions(commandArgs, ["--confirmation"]);
|
|
140
|
+
console.log(JSON.stringify(await prepareExternalConfirmations(workdir, confirmation), null, 2));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (action === "submit") {
|
|
144
|
+
const confirmation = option(commandArgs, "--confirmation");
|
|
145
|
+
const record = option(commandArgs, "--record");
|
|
146
|
+
rejectOptions(commandArgs, ["--confirmation", "--record"]);
|
|
147
|
+
if (!confirmation)
|
|
148
|
+
throw new Error("--confirmation requires a value");
|
|
149
|
+
if (!record)
|
|
150
|
+
throw new Error("--record requires a value");
|
|
151
|
+
const result = await submitExternalConfirmation({
|
|
152
|
+
workdir,
|
|
153
|
+
confirmation_ref: confirmation,
|
|
154
|
+
record_path: path.resolve(process.cwd(), record),
|
|
155
|
+
});
|
|
156
|
+
console.log(JSON.stringify(result, null, 2));
|
|
157
|
+
if (result.state !== "fulfilled")
|
|
158
|
+
process.exitCode = 1;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (action === "status") {
|
|
162
|
+
rejectUnknown(commandArgs, []);
|
|
163
|
+
console.log(JSON.stringify(await externalConfirmationStatus(workdir), null, 2));
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (action === "revoke") {
|
|
167
|
+
const confirmation = option(commandArgs, "--confirmation");
|
|
168
|
+
rejectOptions(commandArgs, ["--confirmation"]);
|
|
169
|
+
if (!confirmation)
|
|
170
|
+
throw new Error("--confirmation requires a value");
|
|
171
|
+
console.log(JSON.stringify(await revokeExternalConfirmation({
|
|
172
|
+
workdir,
|
|
173
|
+
confirmation_ref: confirmation,
|
|
174
|
+
}), null, 2));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (action === "rotate") {
|
|
178
|
+
const confirmation = option(commandArgs, "--confirmation");
|
|
179
|
+
rejectOptions(commandArgs, ["--confirmation"]);
|
|
180
|
+
if (!confirmation)
|
|
181
|
+
throw new Error("--confirmation requires a value");
|
|
182
|
+
console.log(JSON.stringify(await rotateExternalConfirmation({
|
|
183
|
+
workdir,
|
|
184
|
+
confirmation_ref: confirmation,
|
|
185
|
+
}), null, 2));
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
throw new Error(`Unknown long-task external subcommand: ${action}`);
|
|
189
|
+
}
|
|
126
190
|
function help() {
|
|
127
191
|
console.log(`ty-context long-task commands:
|
|
128
192
|
init <workdir>
|
|
@@ -137,6 +201,11 @@ function help() {
|
|
|
137
201
|
resume <workdir>
|
|
138
202
|
doctor <workdir>
|
|
139
203
|
final-gate <workdir>
|
|
204
|
+
external prepare <workdir> [--confirmation <key>]
|
|
205
|
+
external submit <workdir> --confirmation <key> --record <path>
|
|
206
|
+
external status <workdir>
|
|
207
|
+
external rotate <workdir> --confirmation <key>
|
|
208
|
+
external revoke <workdir> --confirmation <key>
|
|
140
209
|
stop-check <workdir> [--message <text>]
|
|
141
210
|
close <workdir>
|
|
142
211
|
abandon <workdir> [--force-corrupt-state]`);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface RouteOptions {
|
|
2
|
+
task?: string;
|
|
3
|
+
paths: string[];
|
|
4
|
+
terms: string[];
|
|
5
|
+
includes: string[];
|
|
6
|
+
format: "text" | "json";
|
|
7
|
+
explain: boolean;
|
|
8
|
+
case_sensitive: boolean;
|
|
9
|
+
max_search_results: number;
|
|
10
|
+
help: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function route(args: string[]): Promise<void>;
|
|
13
|
+
export declare function parseRouteArgs(args: string[]): RouteOptions;
|
|
14
|
+
export declare function routeHelp(): string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { CLI_EXIT_CODES, CliCommandError } from "../lib/cli-exit.js";
|
|
2
|
+
import { CONTEXT_ROUTE_BUDGETS } from "../lib/context-router/context-route-budget.js";
|
|
3
|
+
import { renderContextRouteText } from "../lib/context-router/context-route-render.js";
|
|
4
|
+
import { routeContext } from "../lib/context-router/context-route.js";
|
|
5
|
+
export async function route(args) {
|
|
6
|
+
let options;
|
|
7
|
+
try {
|
|
8
|
+
options = parseRouteArgs(args);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
if (error instanceof CliCommandError)
|
|
12
|
+
throw error;
|
|
13
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, error instanceof Error ? error.message : String(error), { cause: error });
|
|
14
|
+
}
|
|
15
|
+
if (options.help) {
|
|
16
|
+
console.log(routeHelp());
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (options.task === undefined)
|
|
20
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, "route requires --task <text>");
|
|
21
|
+
let result;
|
|
22
|
+
try {
|
|
23
|
+
result = await routeContext({
|
|
24
|
+
project_root: process.cwd(),
|
|
25
|
+
task: options.task,
|
|
26
|
+
paths: options.paths,
|
|
27
|
+
explicit_terms: options.terms,
|
|
28
|
+
includes: options.includes,
|
|
29
|
+
case_sensitive: options.case_sensitive,
|
|
30
|
+
max_search_results: options.max_search_results,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (error instanceof CliCommandError)
|
|
35
|
+
throw error;
|
|
36
|
+
throw new CliCommandError(CLI_EXIT_CODES.internal, `route failed internally: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
37
|
+
}
|
|
38
|
+
if (options.format === "json")
|
|
39
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
40
|
+
else
|
|
41
|
+
process.stdout.write(renderContextRouteText(result, options.explain));
|
|
42
|
+
if (!result.catalog_valid)
|
|
43
|
+
process.exitCode = CLI_EXIT_CODES.catalog;
|
|
44
|
+
else if (!result.complete)
|
|
45
|
+
process.exitCode = CLI_EXIT_CODES.incomplete;
|
|
46
|
+
}
|
|
47
|
+
export function parseRouteArgs(args) {
|
|
48
|
+
const options = {
|
|
49
|
+
paths: [],
|
|
50
|
+
terms: [],
|
|
51
|
+
includes: [],
|
|
52
|
+
format: "text",
|
|
53
|
+
explain: false,
|
|
54
|
+
case_sensitive: false,
|
|
55
|
+
max_search_results: CONTEXT_ROUTE_BUDGETS.output_matches,
|
|
56
|
+
help: false,
|
|
57
|
+
};
|
|
58
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
59
|
+
const argument = args[index];
|
|
60
|
+
if (argument === "--help" || argument === "-h")
|
|
61
|
+
options.help = true;
|
|
62
|
+
else if (argument === "--explain")
|
|
63
|
+
options.explain = true;
|
|
64
|
+
else if (argument === "--case-sensitive")
|
|
65
|
+
options.case_sensitive = true;
|
|
66
|
+
else if (argument === "--json")
|
|
67
|
+
options.format = "json";
|
|
68
|
+
else if (argument === "--task")
|
|
69
|
+
index = readValue(args, index, "--task", (value) => (options.task = value));
|
|
70
|
+
else if (argument.startsWith("--task="))
|
|
71
|
+
options.task = inlineValue(argument, "--task");
|
|
72
|
+
else if (argument === "--path")
|
|
73
|
+
index = readValue(args, index, "--path", (value) => options.paths.push(value));
|
|
74
|
+
else if (argument.startsWith("--path="))
|
|
75
|
+
options.paths.push(inlineValue(argument, "--path"));
|
|
76
|
+
else if (argument === "--term")
|
|
77
|
+
index = readValue(args, index, "--term", (value) => options.terms.push(value));
|
|
78
|
+
else if (argument.startsWith("--term="))
|
|
79
|
+
options.terms.push(inlineValue(argument, "--term"));
|
|
80
|
+
else if (argument === "--include")
|
|
81
|
+
index = readValue(args, index, "--include", (value) => options.includes.push(value));
|
|
82
|
+
else if (argument.startsWith("--include="))
|
|
83
|
+
options.includes.push(inlineValue(argument, "--include"));
|
|
84
|
+
else if (argument === "--format")
|
|
85
|
+
index = readValue(args, index, "--format", (value) => (options.format = parseFormat(value)));
|
|
86
|
+
else if (argument.startsWith("--format="))
|
|
87
|
+
options.format = parseFormat(inlineValue(argument, "--format"));
|
|
88
|
+
else if (argument === "--max-search-results")
|
|
89
|
+
index = readValue(args, index, "--max-search-results", (value) => (options.max_search_results = parseMaximum(value)));
|
|
90
|
+
else if (argument.startsWith("--max-search-results="))
|
|
91
|
+
options.max_search_results = parseMaximum(inlineValue(argument, "--max-search-results"));
|
|
92
|
+
else
|
|
93
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, `unknown route argument: ${argument}`);
|
|
94
|
+
}
|
|
95
|
+
return options;
|
|
96
|
+
}
|
|
97
|
+
export function routeHelp() {
|
|
98
|
+
return `ty-context route (experimental, read-only):
|
|
99
|
+
route --task <text> [--path <repo-path>] [--term <literal>]
|
|
100
|
+
[--include <project_context/file.md>] [--case-sensitive]
|
|
101
|
+
[--max-search-results <1-${CONTEXT_ROUTE_BUDGETS.output_matches}>]
|
|
102
|
+
[--explain] [--format text|json]
|
|
103
|
+
|
|
104
|
+
The Router scans registered and unregistered Context Markdown with literal,
|
|
105
|
+
versioned budgets. It does not establish Authority, participate in the default
|
|
106
|
+
footprint, or replace the Workflow-required bounded Context search.
|
|
107
|
+
|
|
108
|
+
JSON schema v1 budgets: task=8192 UTF-8 bytes; automatic terms=32; explicit
|
|
109
|
+
terms=32; term length=2-128 automatic/1-128 explicit Unicode code points;
|
|
110
|
+
files=4096; per-file scan=1048576 bytes; aggregate scan=33554432 bytes;
|
|
111
|
+
output matches=200 total/20 per file.
|
|
112
|
+
|
|
113
|
+
Exit codes: 0 complete (warnings/ambiguity/unresolved allowed), 2 arguments,
|
|
114
|
+
3 blocking Catalog, 4 incomplete budget, 5 I/O or path safety, 6 internal.`;
|
|
115
|
+
}
|
|
116
|
+
function readValue(args, index, flag, apply) {
|
|
117
|
+
const value = args[index + 1];
|
|
118
|
+
if (value === undefined || value.startsWith("--") || value.length === 0)
|
|
119
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, `route ${flag} requires a value`);
|
|
120
|
+
apply(value);
|
|
121
|
+
return index + 1;
|
|
122
|
+
}
|
|
123
|
+
function inlineValue(argument, flag) {
|
|
124
|
+
const value = argument.slice(`${flag}=`.length);
|
|
125
|
+
if (!value)
|
|
126
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, `route ${flag} requires a value`);
|
|
127
|
+
return value;
|
|
128
|
+
}
|
|
129
|
+
function parseFormat(value) {
|
|
130
|
+
if (value === "text" || value === "json")
|
|
131
|
+
return value;
|
|
132
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, "route --format must be text or json");
|
|
133
|
+
}
|
|
134
|
+
function parseMaximum(value) {
|
|
135
|
+
const parsed = Number(value);
|
|
136
|
+
if (!Number.isInteger(parsed) ||
|
|
137
|
+
parsed < 1 ||
|
|
138
|
+
parsed > CONTEXT_ROUTE_BUDGETS.output_matches ||
|
|
139
|
+
String(parsed) !== value.trim())
|
|
140
|
+
throw new CliCommandError(CLI_EXIT_CODES.arguments, `route --max-search-results must be an integer from 1 to ${CONTEXT_ROUTE_BUDGETS.output_matches}`);
|
|
141
|
+
return parsed;
|
|
142
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { evaluateContractBoundary } from "./lib/long-task-boundary-check.js";
|
|
5
|
-
export { publishDesignResourceHandoffBundle } from "./lib/design-resource-handoff-bundle.js";
|
|
6
|
-
export { preflightDesignResourceHandoff } from "./lib/design-resource-handoff-validation.js";
|
|
7
|
-
export { symbolicDenotation } from "./lib/symbolic-denotation-public.js";
|
|
8
|
-
export { classifyLongTaskRisk, validateRiskProof, } from "./lib/long-task-risk.js";
|
|
9
|
-
export { verifyDeliveryContract } from "./lib/long-task-verifier-v2.js";
|
|
10
|
-
export { runDeliveryFinalGate } from "./lib/long-task-final-v2.js";
|
|
11
|
-
export { closeDeliveryTask, type DeliveryStatusV2, doctorDeliveryTask, readDeliveryStatus, resumeDeliveryTask, stopCheckDeliveryTask, } from "./lib/long-task-status-v2.js";
|
|
12
|
-
export { readActiveLongTaskBinding, readCompiledDeliveryContract, readFinalReceipt, } from "./lib/long-task-state.js";
|
|
13
|
-
export type { BoundaryCheckDecisionV2, BoundaryCheckInputV2, CheckExecutionResultV2, CompiledDeliveryContractV2, DesignResourceHandoffBundleOptions, DesignResourceHandoffBundleResult, DesignResourceHandoffPreflightV1, DesignResourceHandoffPreflightV2, DesignResourceHandoffV1, DesignResourceHandoffV2, DesignResourceImplementationFeasibilityIdentityV1, DesignResourceImplementationFeasibilityV1, DesignResourceTechnicalFeasibilityInputV1, DesignResourceObservableRuleManifestV2, DesignResourceSymbolicFactRuleV2, DesignResourceSymbolicNoninterferenceArtifactV2, DesignResourceSymbolicNoninterferenceCertificateV2, DesignResourceSymbolicNoninterferenceDerivedResultV2, DesignResourceSymbolicNoninterferenceFailureWitnessV1, DesignResourceSymbolicNoninterferenceInputBindingV2, DesignResourceSymbolicNoninterferenceProofV2, DesignResourceSymbolicProofObligationV2, DesignResourceSymbolicSourceIrCertificateScopeV1, DesignResourceSymbolicSourceIrRegionV1, DesignResourceSymbolicSourceIrV1, CompiledSymbolicDenotationV1, SymbolicDenotationAxisDomain, SymbolicDenotationComplexityLimits, SymbolicDenotationPredicate, SymbolicExtensionalPointV1, SymbolicPointDenotationV1, DeliveryAssertionV2, DeliveryCheckV2, DeliveryContractV2, DeliveryOutcomeV2, EffectiveRiskLevel, ExternalConfirmationV2, FinalReceiptV2, LongTaskFindingV2, LongTaskRiskFacts, ProofSurface, ProgressRecordV2, RequestedRiskLevel, RunnerType, SourceClaimV2, TargetedVerificationResultV2, HarnessConfig, HarnessProfile, ManagedFile, SourceMapping, } from "./public-types.js";
|
|
1
|
+
export * from "./public-api-core.js";
|
|
2
|
+
export * from "./public-api-long-task.js";
|
|
3
|
+
export * from "./public-types.js";
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { evaluateContractBoundary } from "./lib/long-task-boundary-check.js";
|
|
5
|
-
export { publishDesignResourceHandoffBundle } from "./lib/design-resource-handoff-bundle.js";
|
|
6
|
-
export { preflightDesignResourceHandoff } from "./lib/design-resource-handoff-validation.js";
|
|
7
|
-
export { symbolicDenotation } from "./lib/symbolic-denotation-public.js";
|
|
8
|
-
export { classifyLongTaskRisk, validateRiskProof, } from "./lib/long-task-risk.js";
|
|
9
|
-
export { verifyDeliveryContract } from "./lib/long-task-verifier-v2.js";
|
|
10
|
-
export { runDeliveryFinalGate } from "./lib/long-task-final-v2.js";
|
|
11
|
-
export { closeDeliveryTask, doctorDeliveryTask, readDeliveryStatus, resumeDeliveryTask, stopCheckDeliveryTask, } from "./lib/long-task-status-v2.js";
|
|
12
|
-
export { readActiveLongTaskBinding, readCompiledDeliveryContract, readFinalReceipt, } from "./lib/long-task-state.js";
|
|
1
|
+
export * from "./public-api-core.js";
|
|
2
|
+
export * from "./public-api-long-task.js";
|
|
3
|
+
export * from "./public-types.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CLI_EXIT_CODES: {
|
|
2
|
+
readonly success: 0;
|
|
3
|
+
readonly arguments: 2;
|
|
4
|
+
readonly catalog: 3;
|
|
5
|
+
readonly incomplete: 4;
|
|
6
|
+
readonly io: 5;
|
|
7
|
+
readonly internal: 6;
|
|
8
|
+
};
|
|
9
|
+
export type CliExitCode = (typeof CLI_EXIT_CODES)[keyof typeof CLI_EXIT_CODES];
|
|
10
|
+
export declare class CliCommandError extends Error {
|
|
11
|
+
readonly exit_code: CliExitCode;
|
|
12
|
+
constructor(exitCode: CliExitCode, message: string, options?: ErrorOptions);
|
|
13
|
+
}
|
|
14
|
+
export declare function cliExitCode(error: unknown): CliExitCode | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const CLI_EXIT_CODES = {
|
|
2
|
+
success: 0,
|
|
3
|
+
arguments: 2,
|
|
4
|
+
catalog: 3,
|
|
5
|
+
incomplete: 4,
|
|
6
|
+
io: 5,
|
|
7
|
+
internal: 6,
|
|
8
|
+
};
|
|
9
|
+
export class CliCommandError extends Error {
|
|
10
|
+
exit_code;
|
|
11
|
+
constructor(exitCode, message, options) {
|
|
12
|
+
super(message, options);
|
|
13
|
+
this.name = "CliCommandError";
|
|
14
|
+
this.exit_code = exitCode;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function cliExitCode(error) {
|
|
18
|
+
return error instanceof CliCommandError ? error.exit_code : null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ContextManifest } from "../context-manifest-schema.js";
|
|
2
|
+
export type DefaultContextSelectionReason = "core" | "default_area" | "default_role" | "default_child";
|
|
3
|
+
export declare function selectDefaultContextPaths(manifest: ContextManifest): Map<string, Set<DefaultContextSelectionReason>>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { compareUtf8Paths, normalizeContextPath, sortedContextMap, } from "./catalog-paths.js";
|
|
2
|
+
// This is the advisory startup set only. It does not restrict later reads or
|
|
3
|
+
// turn default Area/read-policy selection into a Context or edit permission.
|
|
4
|
+
export function selectDefaultContextPaths(manifest) {
|
|
5
|
+
const selected = new Map();
|
|
6
|
+
const add = (value, reason) => {
|
|
7
|
+
const normalized = normalizeContextPath(value);
|
|
8
|
+
const reasons = selected.get(normalized) ?? new Set();
|
|
9
|
+
reasons.add(reason);
|
|
10
|
+
selected.set(normalized, reasons);
|
|
11
|
+
};
|
|
12
|
+
for (const core of [
|
|
13
|
+
"project_context/context.toml",
|
|
14
|
+
"project_context/global.md",
|
|
15
|
+
"project_context/architecture.md",
|
|
16
|
+
]) {
|
|
17
|
+
add(core, "core");
|
|
18
|
+
}
|
|
19
|
+
for (const area of manifest.areas) {
|
|
20
|
+
if (area.default)
|
|
21
|
+
add(area.context, "default_area");
|
|
22
|
+
}
|
|
23
|
+
const children = new Map(manifest.contexts.map((context) => [
|
|
24
|
+
normalizeContextPath(context.path),
|
|
25
|
+
context.default_children.map(normalizeContextPath),
|
|
26
|
+
]));
|
|
27
|
+
const queue = [];
|
|
28
|
+
const queued = new Set();
|
|
29
|
+
const enqueue = (contextPath) => {
|
|
30
|
+
if (queued.has(contextPath))
|
|
31
|
+
return;
|
|
32
|
+
queued.add(contextPath);
|
|
33
|
+
queue.push(contextPath);
|
|
34
|
+
};
|
|
35
|
+
for (const context of manifest.contexts) {
|
|
36
|
+
if (context.read_policy !== "default")
|
|
37
|
+
continue;
|
|
38
|
+
const normalized = normalizeContextPath(context.path);
|
|
39
|
+
add(normalized, "default_role");
|
|
40
|
+
enqueue(normalized);
|
|
41
|
+
}
|
|
42
|
+
while (queue.length > 0) {
|
|
43
|
+
const parent = queue.shift();
|
|
44
|
+
for (const child of children.get(parent) ?? []) {
|
|
45
|
+
add(child, "default_child");
|
|
46
|
+
enqueue(child);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return sortedContextMap([...selected].map(([contextPath, reasons]) => [
|
|
50
|
+
contextPath,
|
|
51
|
+
new Set([...reasons].sort(compareUtf8Paths)),
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CatalogDiagnostic, CatalogDiagnosticSeverity } from "./catalog-types.js";
|
|
2
|
+
export declare function catalogDiagnostic(code: string, severity: CatalogDiagnosticSeverity, message: string, location?: {
|
|
3
|
+
path?: string;
|
|
4
|
+
line?: number;
|
|
5
|
+
}): CatalogDiagnostic;
|
|
6
|
+
export declare function catalogErrors(diagnostics: CatalogDiagnostic[]): string[];
|
|
7
|
+
export declare function catalogWarnings(diagnostics: CatalogDiagnostic[]): string[];
|
|
8
|
+
export declare function compareCatalogDiagnostics(left: CatalogDiagnostic, right: CatalogDiagnostic): number;
|
|
9
|
+
export declare function sortCatalogDiagnostics(diagnostics: readonly CatalogDiagnostic[]): CatalogDiagnostic[];
|