@cleocode/core 2026.9.20 → 2026.9.22
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/dist/adapters/discovery.d.ts.map +1 -1
- package/dist/adapters/discovery.js +3 -10
- package/dist/adapters/discovery.js.map +1 -1
- package/dist/adrs/link-pipeline.js +2 -2
- package/dist/adrs/link-pipeline.js.map +1 -1
- package/dist/adrs/parse.js +3 -3
- package/dist/adrs/parse.js.map +1 -1
- package/dist/agents/invoke-meta-agent.d.ts.map +1 -1
- package/dist/agents/invoke-meta-agent.js +8 -4
- package/dist/agents/invoke-meta-agent.js.map +1 -1
- package/dist/agents/scaffold.d.ts.map +1 -1
- package/dist/agents/scaffold.js +0 -1
- package/dist/agents/scaffold.js.map +1 -1
- package/dist/bootstrap.d.ts +5 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +45 -21
- package/dist/bootstrap.js.map +1 -1
- package/dist/cloud/crypto.d.ts +47 -0
- package/dist/cloud/crypto.d.ts.map +1 -0
- package/dist/cloud/crypto.js +223 -0
- package/dist/cloud/crypto.js.map +1 -0
- package/dist/cloud/http.d.ts +52 -0
- package/dist/cloud/http.d.ts.map +1 -0
- package/dist/cloud/http.js +98 -0
- package/dist/cloud/http.js.map +1 -0
- package/dist/cloud/index.d.ts +19 -0
- package/dist/cloud/index.d.ts.map +1 -0
- package/dist/cloud/index.js +19 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/journal.d.ts +169 -0
- package/dist/cloud/journal.d.ts.map +1 -0
- package/dist/cloud/journal.js +428 -0
- package/dist/cloud/journal.js.map +1 -0
- package/dist/cloud/keys.d.ts +213 -0
- package/dist/cloud/keys.d.ts.map +1 -0
- package/dist/cloud/keys.js +362 -0
- package/dist/cloud/keys.js.map +1 -0
- package/dist/cloud/manifest-check.d.ts +36 -0
- package/dist/cloud/manifest-check.d.ts.map +1 -0
- package/dist/cloud/manifest-check.js +70 -0
- package/dist/cloud/manifest-check.js.map +1 -0
- package/dist/cloud/projects.d.ts +13 -0
- package/dist/cloud/projects.d.ts.map +1 -0
- package/dist/cloud/projects.js +11 -0
- package/dist/cloud/projects.js.map +1 -0
- package/dist/cloud/signing.d.ts +105 -0
- package/dist/cloud/signing.d.ts.map +1 -0
- package/dist/cloud/signing.js +117 -0
- package/dist/cloud/signing.js.map +1 -0
- package/dist/cloud/streams.d.ts +6 -0
- package/dist/cloud/streams.d.ts.map +1 -0
- package/dist/cloud/streams.js +5 -0
- package/dist/cloud/streams.js.map +1 -0
- package/dist/decide/audit.d.ts +131 -0
- package/dist/decide/audit.d.ts.map +1 -0
- package/dist/decide/audit.js +98 -0
- package/dist/decide/audit.js.map +1 -0
- package/dist/decide/budget.d.ts +91 -0
- package/dist/decide/budget.d.ts.map +1 -0
- package/dist/decide/budget.js +194 -0
- package/dist/decide/budget.js.map +1 -0
- package/dist/decide/cache.d.ts +49 -0
- package/dist/decide/cache.d.ts.map +1 -0
- package/dist/decide/cache.js +87 -0
- package/dist/decide/cache.js.map +1 -0
- package/dist/decide/client.d.ts +103 -0
- package/dist/decide/client.d.ts.map +1 -0
- package/dist/decide/client.js +262 -0
- package/dist/decide/client.js.map +1 -0
- package/dist/decide/credentials.d.ts +159 -0
- package/dist/decide/credentials.d.ts.map +1 -0
- package/dist/decide/credentials.js +383 -0
- package/dist/decide/credentials.js.map +1 -0
- package/dist/decide/index.d.ts +18 -0
- package/dist/decide/index.d.ts.map +1 -0
- package/dist/decide/index.js +18 -0
- package/dist/decide/index.js.map +1 -0
- package/dist/decide/jev-wire.d.ts +155 -0
- package/dist/decide/jev-wire.d.ts.map +1 -0
- package/dist/decide/jev-wire.js +420 -0
- package/dist/decide/jev-wire.js.map +1 -0
- package/dist/decide/operations.d.ts +152 -0
- package/dist/decide/operations.d.ts.map +1 -0
- package/dist/decide/operations.js +199 -0
- package/dist/decide/operations.js.map +1 -0
- package/dist/decide/provider.d.ts +90 -0
- package/dist/decide/provider.d.ts.map +1 -0
- package/dist/decide/provider.js +43 -0
- package/dist/decide/provider.js.map +1 -0
- package/dist/decide/site.d.ts +148 -0
- package/dist/decide/site.d.ts.map +1 -0
- package/dist/decide/site.js +181 -0
- package/dist/decide/site.js.map +1 -0
- package/dist/decide/transport.d.ts +67 -0
- package/dist/decide/transport.d.ts.map +1 -0
- package/dist/decide/transport.js +350 -0
- package/dist/decide/transport.js.map +1 -0
- package/dist/dispatch/mutate-projection.d.ts.map +1 -1
- package/dist/dispatch/mutate-projection.js +5 -0
- package/dist/dispatch/mutate-projection.js.map +1 -1
- package/dist/docs/docs-update.d.ts.map +1 -1
- package/dist/docs/docs-update.js +25 -9
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/export-document.js +5963 -2406
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/index.d.ts +2 -2
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/index.js.map +1 -1
- package/dist/docs/projection.d.ts.map +1 -1
- package/dist/docs/projection.js +2 -3
- package/dist/docs/projection.js.map +1 -1
- package/dist/docs/publish-pr.d.ts +69 -1
- package/dist/docs/publish-pr.d.ts.map +1 -1
- package/dist/docs/publish-pr.js +112 -10
- package/dist/docs/publish-pr.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts +13 -8
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +39 -26
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/index.d.ts +2 -0
- package/dist/doctor/index.d.ts.map +1 -1
- package/dist/doctor/index.js +1 -0
- package/dist/doctor/index.js.map +1 -1
- package/dist/doctor/knowledge.d.ts +16 -1
- package/dist/doctor/knowledge.d.ts.map +1 -1
- package/dist/doctor/knowledge.js +58 -32
- package/dist/doctor/knowledge.js.map +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts.map +1 -1
- package/dist/doctor/nexus-schema-residency.js +3 -0
- package/dist/doctor/nexus-schema-residency.js.map +1 -1
- package/dist/doctor/project-identity.d.ts +44 -1
- package/dist/doctor/project-identity.d.ts.map +1 -1
- package/dist/doctor/project-identity.js +237 -10
- package/dist/doctor/project-identity.js.map +1 -1
- package/dist/doctor/projects.d.ts +170 -0
- package/dist/doctor/projects.d.ts.map +1 -0
- package/dist/doctor/projects.js +1075 -0
- package/dist/doctor/projects.js.map +1 -0
- package/dist/doctor/twin-collapse.d.ts +97 -0
- package/dist/doctor/twin-collapse.d.ts.map +1 -0
- package/dist/doctor/twin-collapse.js +168 -0
- package/dist/doctor/twin-collapse.js.map +1 -0
- package/dist/doctor/worktree-orphans.d.ts.map +1 -1
- package/dist/doctor/worktree-orphans.js +13 -29
- package/dist/doctor/worktree-orphans.js.map +1 -1
- package/dist/doctor/worktree-stores.d.ts +128 -0
- package/dist/doctor/worktree-stores.d.ts.map +1 -0
- package/dist/doctor/worktree-stores.js +374 -0
- package/dist/doctor/worktree-stores.js.map +1 -0
- package/dist/engine/engine-ops.d.ts +36 -6
- package/dist/engine/engine-ops.d.ts.map +1 -1
- package/dist/engine/engine-ops.js +115 -14
- package/dist/engine/engine-ops.js.map +1 -1
- package/dist/error-catalog.d.ts.map +1 -1
- package/dist/error-catalog.js +21 -0
- package/dist/error-catalog.js.map +1 -1
- package/dist/error-registry.d.ts.map +1 -1
- package/dist/error-registry.js +40 -0
- package/dist/error-registry.js.map +1 -1
- package/dist/gateway-client/generated/types.gen.d.ts +1 -1
- package/dist/gc/cleanup.d.ts.map +1 -1
- package/dist/gc/cleanup.js +32 -19
- package/dist/gc/cleanup.js.map +1 -1
- package/dist/git/bounded-git.d.ts +170 -0
- package/dist/git/bounded-git.d.ts.map +1 -0
- package/dist/git/bounded-git.js +371 -0
- package/dist/git/bounded-git.js.map +1 -0
- package/dist/git/work-tree.d.ts +20 -0
- package/dist/git/work-tree.d.ts.map +1 -1
- package/dist/git/work-tree.js +20 -2
- package/dist/git/work-tree.js.map +1 -1
- package/dist/hooks/handlers/session-hooks.d.ts +11 -26
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/session-hooks.js +18 -47
- package/dist/hooks/handlers/session-hooks.js.map +1 -1
- package/dist/hooks/payload-schemas.d.ts +2 -2
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/init/engine-ops.d.ts.map +1 -1
- package/dist/init/engine-ops.js +23 -1
- package/dist/init/engine-ops.js.map +1 -1
- package/dist/init.d.ts +158 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +578 -53
- package/dist/init.js.map +1 -1
- package/dist/inject/index.d.ts.map +1 -1
- package/dist/inject/index.js +8 -3
- package/dist/inject/index.js.map +1 -1
- package/dist/injection.d.ts +55 -0
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +102 -6
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +11 -7
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +9 -5
- package/dist/internal.js.map +1 -1
- package/dist/issue/diagnostics.d.ts.map +1 -1
- package/dist/issue/diagnostics.js +2 -1
- package/dist/issue/diagnostics.js.map +1 -1
- package/dist/lib/concurrency.d.ts +25 -0
- package/dist/lib/concurrency.d.ts.map +1 -0
- package/dist/lib/concurrency.js +43 -0
- package/dist/lib/concurrency.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lifecycle/engine-ops.d.ts.map +1 -1
- package/dist/lifecycle/engine-ops.js +4 -2
- package/dist/lifecycle/engine-ops.js.map +1 -1
- package/dist/lifecycle/stage-guidance.d.ts +5 -0
- package/dist/lifecycle/stage-guidance.d.ts.map +1 -1
- package/dist/lifecycle/stage-guidance.js +14 -4
- package/dist/lifecycle/stage-guidance.js.map +1 -1
- package/dist/llm/catalog-cache.d.ts +3 -2
- package/dist/llm/catalog-cache.d.ts.map +1 -1
- package/dist/llm/catalog-cache.js +5 -5
- package/dist/llm/catalog-cache.js.map +1 -1
- package/dist/llm/credentials.d.ts +4 -4
- package/dist/llm/credentials.js +6 -6
- package/dist/llm/credentials.js.map +1 -1
- package/dist/llm/plugin-facade.js +4400 -1801
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/stable-device-id.d.ts.map +1 -1
- package/dist/llm/stable-device-id.js +3 -5
- package/dist/llm/stable-device-id.js.map +1 -1
- package/dist/memory/attention.js +31 -31
- package/dist/memory/attention.js.map +1 -1
- package/dist/memory/decision-contradiction.d.ts +152 -0
- package/dist/memory/decision-contradiction.d.ts.map +1 -0
- package/dist/memory/decision-contradiction.js +273 -0
- package/dist/memory/decision-contradiction.js.map +1 -0
- package/dist/memory/decisions.d.ts +42 -11
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +153 -56
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/dialectic-evaluator.d.ts +7 -0
- package/dist/memory/dialectic-evaluator.d.ts.map +1 -1
- package/dist/memory/dialectic-evaluator.js +23 -8
- package/dist/memory/dialectic-evaluator.js.map +1 -1
- package/dist/memory/dispatch-trace-format.d.ts +39 -0
- package/dist/memory/dispatch-trace-format.d.ts.map +1 -0
- package/dist/memory/dispatch-trace-format.js +54 -0
- package/dist/memory/dispatch-trace-format.js.map +1 -0
- package/dist/memory/dispatch-trace.d.ts.map +1 -1
- package/dist/memory/dispatch-trace.js +1 -27
- package/dist/memory/dispatch-trace.js.map +1 -1
- package/dist/memory/engine-compat.d.ts +2 -0
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/engine-compat.js +1 -0
- package/dist/memory/engine-compat.js.map +1 -1
- package/dist/memory/import-from-provider.js +3 -3
- package/dist/memory/import-from-provider.js.map +1 -1
- package/dist/memory/learnings.d.ts +2 -2
- package/dist/memory/observation-type-decision.d.ts +96 -0
- package/dist/memory/observation-type-decision.d.ts.map +1 -0
- package/dist/memory/observation-type-decision.js +218 -0
- package/dist/memory/observation-type-decision.js.map +1 -0
- package/dist/memory/redaction.js +2 -0
- package/dist/memory/redaction.js.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts +9 -2
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.js +42 -11
- package/dist/memory/retrieval/build-retrieval-bundle.js.map +1 -1
- package/dist/memory/retrieval/get-current-session-id.d.ts +5 -0
- package/dist/memory/retrieval/get-current-session-id.d.ts.map +1 -1
- package/dist/memory/retrieval/get-current-session-id.js +7 -2
- package/dist/memory/retrieval/get-current-session-id.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +30 -29
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts +38 -0
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +136 -48
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/assessment-projection.d.ts +76 -0
- package/dist/nexus/assessment-projection.d.ts.map +1 -0
- package/dist/nexus/assessment-projection.js +143 -0
- package/dist/nexus/assessment-projection.js.map +1 -0
- package/dist/nexus/assessment-store.d.ts +14 -2
- package/dist/nexus/assessment-store.d.ts.map +1 -1
- package/dist/nexus/assessment-store.js +21 -3
- package/dist/nexus/assessment-store.js.map +1 -1
- package/dist/nexus/checkout-nonce.d.ts +48 -0
- package/dist/nexus/checkout-nonce.d.ts.map +1 -0
- package/dist/nexus/checkout-nonce.js +84 -0
- package/dist/nexus/checkout-nonce.js.map +1 -0
- package/dist/nexus/devices.d.ts +93 -0
- package/dist/nexus/devices.d.ts.map +1 -0
- package/dist/nexus/devices.js +141 -0
- package/dist/nexus/devices.js.map +1 -0
- package/dist/nexus/freshness.d.ts.map +1 -1
- package/dist/nexus/freshness.js +25 -6
- package/dist/nexus/freshness.js.map +1 -1
- package/dist/nexus/git-state.d.ts +225 -0
- package/dist/nexus/git-state.d.ts.map +1 -0
- package/dist/nexus/git-state.js +677 -0
- package/dist/nexus/git-state.js.map +1 -0
- package/dist/nexus/graph-manifest.d.ts +20 -4
- package/dist/nexus/graph-manifest.d.ts.map +1 -1
- package/dist/nexus/graph-manifest.js +40 -5
- package/dist/nexus/graph-manifest.js.map +1 -1
- package/dist/nexus/identity.d.ts +68 -23
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +99 -22
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/index.d.ts +5 -2
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +10 -4
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/knowledge.d.ts +5 -0
- package/dist/nexus/knowledge.d.ts.map +1 -1
- package/dist/nexus/knowledge.js +40 -5
- package/dist/nexus/knowledge.js.map +1 -1
- package/dist/nexus/legacy-alias.d.ts +60 -0
- package/dist/nexus/legacy-alias.d.ts.map +1 -0
- package/dist/nexus/legacy-alias.js +68 -0
- package/dist/nexus/legacy-alias.js.map +1 -0
- package/dist/nexus/migrate-json-to-sqlite.js +2 -2
- package/dist/nexus/migrate-json-to-sqlite.js.map +1 -1
- package/dist/nexus/ops.d.ts +1 -0
- package/dist/nexus/ops.d.ts.map +1 -1
- package/dist/nexus/path-map.d.ts +264 -20
- package/dist/nexus/path-map.d.ts.map +1 -1
- package/dist/nexus/path-map.js +580 -44
- package/dist/nexus/path-map.js.map +1 -1
- package/dist/nexus/projects-clean.d.ts +9 -1
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +126 -14
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/projects-scan.d.ts +56 -1
- package/dist/nexus/projects-scan.d.ts.map +1 -1
- package/dist/nexus/projects-scan.js +144 -3
- package/dist/nexus/projects-scan.js.map +1 -1
- package/dist/nexus/registry-hygiene.d.ts +18 -2
- package/dist/nexus/registry-hygiene.d.ts.map +1 -1
- package/dist/nexus/registry-hygiene.js +37 -11
- package/dist/nexus/registry-hygiene.js.map +1 -1
- package/dist/nexus/registry-roots.d.ts +47 -0
- package/dist/nexus/registry-roots.d.ts.map +1 -0
- package/dist/nexus/registry-roots.js +79 -0
- package/dist/nexus/registry-roots.js.map +1 -0
- package/dist/nexus/registry.d.ts +50 -9
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +311 -156
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/stored-roots.d.ts +171 -0
- package/dist/nexus/stored-roots.d.ts.map +1 -0
- package/dist/nexus/stored-roots.js +253 -0
- package/dist/nexus/stored-roots.js.map +1 -0
- package/dist/nexus/transfer.d.ts.map +1 -1
- package/dist/nexus/transfer.js +3 -0
- package/dist/nexus/transfer.js.map +1 -1
- package/dist/nexus/user-profile-hygiene.d.ts +168 -0
- package/dist/nexus/user-profile-hygiene.d.ts.map +1 -0
- package/dist/nexus/user-profile-hygiene.js +305 -0
- package/dist/nexus/user-profile-hygiene.js.map +1 -0
- package/dist/nexus/user-profile.d.ts +53 -2
- package/dist/nexus/user-profile.d.ts.map +1 -1
- package/dist/nexus/user-profile.js +106 -4
- package/dist/nexus/user-profile.js.map +1 -1
- package/dist/orchestrate/lifecycle-ops.d.ts.map +1 -1
- package/dist/orchestrate/lifecycle-ops.js +4 -1
- package/dist/orchestrate/lifecycle-ops.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +5 -1
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/plan.d.ts.map +1 -1
- package/dist/orchestrate/plan.js +5 -2
- package/dist/orchestrate/plan.js.map +1 -1
- package/dist/orchestrate/query-ops.d.ts +7 -2
- package/dist/orchestrate/query-ops.d.ts.map +1 -1
- package/dist/orchestrate/query-ops.js +17 -6
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts +12 -0
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +157 -71
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/bootstrap.d.ts.map +1 -1
- package/dist/orchestration/bootstrap.js +4 -2
- package/dist/orchestration/bootstrap.js.map +1 -1
- package/dist/orchestration/classify-readiness.d.ts +37 -1
- package/dist/orchestration/classify-readiness.d.ts.map +1 -1
- package/dist/orchestration/classify-readiness.js +48 -19
- package/dist/orchestration/classify-readiness.js.map +1 -1
- package/dist/orchestration/index.d.ts +4 -2
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +6 -4
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/lead-rollup.d.ts +8 -5
- package/dist/orchestration/lead-rollup.d.ts.map +1 -1
- package/dist/orchestration/lead-rollup.js +32 -15
- package/dist/orchestration/lead-rollup.js.map +1 -1
- package/dist/orchestration/owner-decision-readiness.d.ts +88 -0
- package/dist/orchestration/owner-decision-readiness.d.ts.map +1 -0
- package/dist/orchestration/owner-decision-readiness.js +152 -0
- package/dist/orchestration/owner-decision-readiness.js.map +1 -0
- package/dist/orchestration/parallel.d.ts.map +1 -1
- package/dist/orchestration/parallel.js +10 -17
- package/dist/orchestration/parallel.js.map +1 -1
- package/dist/orchestration/psyche-memory-budget.d.ts +105 -0
- package/dist/orchestration/psyche-memory-budget.d.ts.map +1 -0
- package/dist/orchestration/psyche-memory-budget.js +383 -0
- package/dist/orchestration/psyche-memory-budget.js.map +1 -0
- package/dist/orchestration/spawn-prompt.d.ts +16 -2
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +144 -181
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/spawn.d.ts +7 -0
- package/dist/orchestration/spawn.d.ts.map +1 -1
- package/dist/orchestration/spawn.js +1 -0
- package/dist/orchestration/spawn.js.map +1 -1
- package/dist/orchestration/status.d.ts +8 -3
- package/dist/orchestration/status.d.ts.map +1 -1
- package/dist/orchestration/status.js +9 -6
- package/dist/orchestration/status.js.map +1 -1
- package/dist/orchestration/wave-topic.d.ts +54 -0
- package/dist/orchestration/wave-topic.d.ts.map +1 -0
- package/dist/orchestration/wave-topic.js +68 -0
- package/dist/orchestration/wave-topic.js.map +1 -0
- package/dist/orchestration/waves.d.ts +47 -8
- package/dist/orchestration/waves.d.ts.map +1 -1
- package/dist/orchestration/waves.js +152 -43
- package/dist/orchestration/waves.js.map +1 -1
- package/dist/paths.d.ts +24 -8
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +135 -71
- package/dist/paths.js.map +1 -1
- package/dist/phases/index.d.ts.map +1 -1
- package/dist/phases/index.js +6 -2
- package/dist/phases/index.js.map +1 -1
- package/dist/platform.d.ts +6 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +8 -19
- package/dist/platform.js.map +1 -1
- package/dist/project-info.d.ts +18 -0
- package/dist/project-info.d.ts.map +1 -1
- package/dist/project-info.js +29 -1
- package/dist/project-info.js.map +1 -1
- package/dist/project-lifecycle.d.ts +91 -32
- package/dist/project-lifecycle.d.ts.map +1 -1
- package/dist/project-lifecycle.js +639 -75
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/project-scope.d.ts +104 -4
- package/dist/project-scope.d.ts.map +1 -1
- package/dist/project-scope.js +263 -13
- package/dist/project-scope.js.map +1 -1
- package/dist/project-tombstone.d.ts +111 -0
- package/dist/project-tombstone.d.ts.map +1 -0
- package/dist/project-tombstone.js +220 -0
- package/dist/project-tombstone.js.map +1 -0
- package/dist/release/artifacts.d.ts.map +1 -1
- package/dist/release/artifacts.js +14 -9
- package/dist/release/artifacts.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +233 -0
- package/dist/release/ci-evidence.d.ts.map +1 -0
- package/dist/release/ci-evidence.js +668 -0
- package/dist/release/ci-evidence.js.map +1 -0
- package/dist/release/engine-ops.d.ts.map +1 -1
- package/dist/release/engine-ops.js +3 -3
- package/dist/release/engine-ops.js.map +1 -1
- package/dist/release/github-pr.d.ts +30 -0
- package/dist/release/github-pr.d.ts.map +1 -1
- package/dist/release/github-pr.js +40 -0
- package/dist/release/github-pr.js.map +1 -1
- package/dist/release/plan.d.ts.map +1 -1
- package/dist/release/plan.js +11 -7
- package/dist/release/plan.js.map +1 -1
- package/dist/release/pr-evidence.d.ts +38 -0
- package/dist/release/pr-evidence.d.ts.map +1 -1
- package/dist/release/pr-evidence.js +79 -15
- package/dist/release/pr-evidence.js.map +1 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +3 -2
- package/dist/release/reconcile.js.map +1 -1
- package/dist/release/release-manifest.d.ts +2 -1
- package/dist/release/release-manifest.d.ts.map +1 -1
- package/dist/release/release-manifest.js +6 -5
- package/dist/release/release-manifest.js.map +1 -1
- package/dist/render/nexus/graph/index.d.ts +4 -0
- package/dist/render/nexus/graph/index.d.ts.map +1 -1
- package/dist/render/nexus/graph/index.js +57 -0
- package/dist/render/nexus/graph/index.js.map +1 -1
- package/dist/resources/spawn-wrapper.d.ts +8 -1
- package/dist/resources/spawn-wrapper.d.ts.map +1 -1
- package/dist/resources/spawn-wrapper.js +42 -5
- package/dist/resources/spawn-wrapper.js.map +1 -1
- package/dist/routing/build-command-groups.d.ts.map +1 -1
- package/dist/routing/build-command-groups.js +1 -0
- package/dist/routing/build-command-groups.js.map +1 -1
- package/dist/sagas/index.d.ts +1 -1
- package/dist/sagas/index.d.ts.map +1 -1
- package/dist/sagas/index.js +1 -1
- package/dist/sagas/index.js.map +1 -1
- package/dist/sagas/reconcile.d.ts +24 -4
- package/dist/sagas/reconcile.d.ts.map +1 -1
- package/dist/sagas/reconcile.js +226 -100
- package/dist/sagas/reconcile.js.map +1 -1
- package/dist/scaffold/ensure-config.d.ts.map +1 -1
- package/dist/scaffold/ensure-config.js +31 -1
- package/dist/scaffold/ensure-config.js.map +1 -1
- package/dist/scaffold/project-identity.d.ts +2 -8
- package/dist/scaffold/project-identity.d.ts.map +1 -1
- package/dist/scaffold/project-identity.js +5 -21
- package/dist/scaffold/project-identity.js.map +1 -1
- package/dist/security/input-sanitization.d.ts +9 -1
- package/dist/security/input-sanitization.d.ts.map +1 -1
- package/dist/security/input-sanitization.js +20 -3
- package/dist/security/input-sanitization.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +4409 -1810
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/propose-tick.d.ts.map +1 -1
- package/dist/sentient/propose-tick.js +4 -2
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sequence/index.d.ts.map +1 -1
- package/dist/sequence/index.js +6 -23
- package/dist/sequence/index.js.map +1 -1
- package/dist/session/engine-ops.d.ts +15 -0
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +146 -22
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/sessions/assumptions.d.ts.map +1 -1
- package/dist/sessions/assumptions.js +7 -4
- package/dist/sessions/assumptions.js.map +1 -1
- package/dist/sessions/briefing.d.ts +23 -0
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +59 -9
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/decisions.d.ts +38 -3
- package/dist/sessions/decisions.d.ts.map +1 -1
- package/dist/sessions/decisions.js +235 -21
- package/dist/sessions/decisions.js.map +1 -1
- package/dist/sessions/drift-watchdog.d.ts.map +1 -1
- package/dist/sessions/drift-watchdog.js +8 -5
- package/dist/sessions/drift-watchdog.js.map +1 -1
- package/dist/sessions/focus-state-store.d.ts +89 -1
- package/dist/sessions/focus-state-store.d.ts.map +1 -1
- package/dist/sessions/focus-state-store.js +97 -1
- package/dist/sessions/focus-state-store.js.map +1 -1
- package/dist/sessions/index.d.ts +2 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +34 -5
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/session-drift.d.ts.map +1 -1
- package/dist/sessions/session-drift.js +4 -3
- package/dist/sessions/session-drift.js.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.d.ts +26 -0
- package/dist/sessions/session-end-snapshot-entry.d.ts.map +1 -0
- package/dist/sessions/session-end-snapshot-entry.js +59 -0
- package/dist/sessions/session-end-snapshot-entry.js.map +1 -0
- package/dist/sessions/session-end-snapshot.d.ts +114 -0
- package/dist/sessions/session-end-snapshot.d.ts.map +1 -0
- package/dist/sessions/session-end-snapshot.js +446 -0
- package/dist/sessions/session-end-snapshot.js.map +1 -0
- package/dist/sessions/session-manifest-mirror.d.ts.map +1 -1
- package/dist/sessions/session-manifest-mirror.js +10 -17
- package/dist/sessions/session-manifest-mirror.js.map +1 -1
- package/dist/sessions/session-switch.d.ts.map +1 -1
- package/dist/sessions/session-switch.js +5 -3
- package/dist/sessions/session-switch.js.map +1 -1
- package/dist/sessions/snapshot.d.ts.map +1 -1
- package/dist/sessions/snapshot.js +5 -4
- package/dist/sessions/snapshot.js.map +1 -1
- package/dist/sessions/terminal-identity.d.ts +169 -0
- package/dist/sessions/terminal-identity.d.ts.map +1 -0
- package/dist/sessions/terminal-identity.js +273 -0
- package/dist/sessions/terminal-identity.js.map +1 -0
- package/dist/setup/sections/verification.d.ts +1 -1
- package/dist/setup/sections/verification.d.ts.map +1 -1
- package/dist/setup/sections/verification.js +11 -15
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/skills/discovery.d.ts +20 -3
- package/dist/skills/discovery.d.ts.map +1 -1
- package/dist/skills/discovery.js +41 -4
- package/dist/skills/discovery.js.map +1 -1
- package/dist/skills/dispatch.d.ts +5 -2
- package/dist/skills/dispatch.d.ts.map +1 -1
- package/dist/skills/dispatch.js +5 -2
- package/dist/skills/dispatch.js.map +1 -1
- package/dist/skills/doctor.d.ts.map +1 -1
- package/dist/skills/doctor.js +5 -1
- package/dist/skills/doctor.js.map +1 -1
- package/dist/skills/federated-search.js +2 -2
- package/dist/skills/federated-search.js.map +1 -1
- package/dist/skills/index.d.ts +3 -3
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/migration.d.ts +5 -5
- package/dist/skills/migration.d.ts.map +1 -1
- package/dist/skills/migration.js +7 -9
- package/dist/skills/migration.js.map +1 -1
- package/dist/skills/orchestrator/startup.d.ts.map +1 -1
- package/dist/skills/orchestrator/startup.js +14 -7
- package/dist/skills/orchestrator/startup.js.map +1 -1
- package/dist/skills/prune-bundled.d.ts +267 -0
- package/dist/skills/prune-bundled.d.ts.map +1 -0
- package/dist/skills/prune-bundled.js +536 -0
- package/dist/skills/prune-bundled.js.map +1 -0
- package/dist/skills/skill-paths.d.ts +30 -3
- package/dist/skills/skill-paths.d.ts.map +1 -1
- package/dist/skills/skill-paths.js +28 -9
- package/dist/skills/skill-paths.js.map +1 -1
- package/dist/skills/skill-root.d.ts +60 -11
- package/dist/skills/skill-root.d.ts.map +1 -1
- package/dist/skills/skill-root.js +100 -14
- package/dist/skills/skill-root.js.map +1 -1
- package/dist/skills/skills-guard.js +5 -5
- package/dist/skills/skills-guard.js.map +1 -1
- package/dist/skills/types.d.ts +32 -1
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/skills/types.js +17 -34
- package/dist/skills/types.js.map +1 -1
- package/dist/spawn/agent-identity.d.ts +51 -2
- package/dist/spawn/agent-identity.d.ts.map +1 -1
- package/dist/spawn/agent-identity.js +89 -26
- package/dist/spawn/agent-identity.js.map +1 -1
- package/dist/spawn/branch-lock.d.ts.map +1 -1
- package/dist/spawn/branch-lock.js +80 -79
- package/dist/spawn/branch-lock.js.map +1 -1
- package/dist/spawn/index.d.ts +2 -2
- package/dist/spawn/index.d.ts.map +1 -1
- package/dist/spawn/index.js +1 -1
- package/dist/spawn/index.js.map +1 -1
- package/dist/spawn/worktree-lock-holder.d.ts +37 -0
- package/dist/spawn/worktree-lock-holder.d.ts.map +1 -0
- package/dist/spawn/worktree-lock-holder.js +41 -0
- package/dist/spawn/worktree-lock-holder.js.map +1 -0
- package/dist/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +4 -2
- package/dist/stats/index.js.map +1 -1
- package/dist/sticky/convert.d.ts.map +1 -1
- package/dist/sticky/convert.js +16 -4
- package/dist/sticky/convert.js.map +1 -1
- package/dist/store/attachment-store.d.ts +14 -0
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +11 -1
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/backup-inspect.d.ts +7 -3
- package/dist/store/backup-inspect.d.ts.map +1 -1
- package/dist/store/backup-inspect.js +18 -7
- package/dist/store/backup-inspect.js.map +1 -1
- package/dist/store/backup-sidecar.d.ts +60 -0
- package/dist/store/backup-sidecar.d.ts.map +1 -0
- package/dist/store/backup-sidecar.js +96 -0
- package/dist/store/backup-sidecar.js.map +1 -0
- package/dist/store/data-accessor.d.ts +1 -1
- package/dist/store/data-accessor.d.ts.map +1 -1
- package/dist/store/data-accessor.js +6 -6
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/data-safety-central.d.ts +13 -4
- package/dist/store/data-safety-central.d.ts.map +1 -1
- package/dist/store/data-safety-central.js +31 -4
- package/dist/store/data-safety-central.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +10 -0
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.js +4 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -1
- package/dist/store/exodus/migrate.js +1 -1
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/reconcile.js +1 -1
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +4 -3
- package/dist/store/exodus/runtime-targets.d.ts.map +1 -1
- package/dist/store/exodus/runtime-targets.js +4 -3
- package/dist/store/exodus/runtime-targets.js.map +1 -1
- package/dist/store/import-logging.d.ts.map +1 -1
- package/dist/store/import-logging.js +5 -4
- package/dist/store/import-logging.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +2 -7
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +1 -0
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +1 -0
- package/dist/store/lock.js.map +1 -1
- package/dist/store/memory-accessor.d.ts +8 -3
- package/dist/store/memory-accessor.d.ts.map +1 -1
- package/dist/store/memory-accessor.js +29 -13
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +5 -0
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +11 -6
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/portable-bundle-relocate.d.ts +13 -8
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
- package/dist/store/portable-bundle-relocate.js +75 -31
- package/dist/store/portable-bundle-relocate.js.map +1 -1
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +2 -1
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +7 -3
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/pre-repair-snapshot.d.ts +77 -0
- package/dist/store/pre-repair-snapshot.d.ts.map +1 -0
- package/dist/store/pre-repair-snapshot.js +122 -0
- package/dist/store/pre-repair-snapshot.js.map +1 -0
- package/dist/store/regenerators.d.ts +2 -1
- package/dist/store/regenerators.d.ts.map +1 -1
- package/dist/store/regenerators.js +17 -3
- package/dist/store/regenerators.js.map +1 -1
- package/dist/store/relocated-store-guard.d.ts +71 -0
- package/dist/store/relocated-store-guard.d.ts.map +1 -0
- package/dist/store/relocated-store-guard.js +138 -0
- package/dist/store/relocated-store-guard.js.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +2 -2
- package/dist/store/safety-data-accessor.d.ts.map +1 -1
- package/dist/store/safety-data-accessor.js +2 -2
- package/dist/store/safety-data-accessor.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +2 -2
- package/dist/store/schema/audit.d.ts +5 -5
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/models-catalog.d.ts +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +686 -0
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +175 -7
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +2 -2
- package/dist/store/schema/cleo-project/audit.d.ts +5 -5
- package/dist/store/schema/cleo-project/docs.d.ts +3 -3
- package/dist/store/schema/cleo-project/lifecycle.d.ts +3 -3
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +3 -3
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +6 -6
- package/dist/store/schema/cleo-shared/brain.d.ts +26 -26
- package/dist/store/schema/lifecycle.d.ts +3 -3
- package/dist/store/schema/manifest.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts +26 -26
- package/dist/store/schema/nexus-schema.d.ts +696 -2
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +175 -19
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/skills-schema.d.ts +2 -2
- package/dist/store/schema/tasks.d.ts +5 -5
- package/dist/store/session-binding-schema.d.ts +132 -0
- package/dist/store/session-binding-schema.d.ts.map +1 -0
- package/dist/store/session-binding-schema.js +53 -0
- package/dist/store/session-binding-schema.js.map +1 -0
- package/dist/store/session-store.d.ts +262 -4
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +486 -26
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/skills-db.d.ts +17 -0
- package/dist/store/skills-db.d.ts.map +1 -1
- package/dist/store/skills-db.js +30 -0
- package/dist/store/skills-db.js.map +1 -1
- package/dist/store/snapshot-gate.d.ts +239 -0
- package/dist/store/snapshot-gate.d.ts.map +1 -0
- package/dist/store/snapshot-gate.js +401 -0
- package/dist/store/snapshot-gate.js.map +1 -0
- package/dist/store/split-brain-import.js +2 -2
- package/dist/store/split-brain-import.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +55 -13
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +414 -106
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +15 -0
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +73 -4
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +15 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +75 -5
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/store-write-guard.d.ts +28 -0
- package/dist/store/store-write-guard.d.ts.map +1 -0
- package/dist/store/store-write-guard.js +50 -0
- package/dist/store/store-write-guard.js.map +1 -0
- package/dist/store/table-classification.d.ts +143 -0
- package/dist/store/table-classification.d.ts.map +1 -0
- package/dist/store/table-classification.js +1866 -0
- package/dist/store/table-classification.js.map +1 -0
- package/dist/store/task-version.d.ts +72 -0
- package/dist/store/task-version.d.ts.map +1 -0
- package/dist/store/task-version.js +93 -0
- package/dist/store/task-version.js.map +1 -0
- package/dist/store/tasks-schema.d.ts +1 -0
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +13 -0
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +10 -3
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +12 -3
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +320 -0
- package/dist/store/twin-collapse.d.ts.map +1 -0
- package/dist/store/twin-collapse.js +931 -0
- package/dist/store/twin-collapse.js.map +1 -0
- package/dist/store/umbrella-data-accessor.d.ts +2 -2
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +2 -2
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +63 -63
- package/dist/store/worktree-isolation-guard.d.ts +46 -24
- package/dist/store/worktree-isolation-guard.d.ts.map +1 -1
- package/dist/store/worktree-isolation-guard.js +71 -50
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +3 -67
- package/dist/system/backup.js.map +1 -1
- package/dist/system/cleo-link.d.ts +163 -0
- package/dist/system/cleo-link.d.ts.map +1 -0
- package/dist/system/cleo-link.js +246 -0
- package/dist/system/cleo-link.js.map +1 -0
- package/dist/system/dependencies.d.ts.map +1 -1
- package/dist/system/dependencies.js +3 -6
- package/dist/system/dependencies.js.map +1 -1
- package/dist/system/global-delivery.d.ts +205 -0
- package/dist/system/global-delivery.d.ts.map +1 -0
- package/dist/system/global-delivery.js +320 -0
- package/dist/system/global-delivery.js.map +1 -0
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +29 -6
- package/dist/system/health.js.map +1 -1
- package/dist/system/inject-generate.d.ts.map +1 -1
- package/dist/system/inject-generate.js +4 -4
- package/dist/system/inject-generate.js.map +1 -1
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +1 -20
- package/dist/system/project-health.js.map +1 -1
- package/dist/system/runtime.d.ts.map +1 -1
- package/dist/system/runtime.js +2 -12
- package/dist/system/runtime.js.map +1 -1
- package/dist/system/safestop.d.ts.map +1 -1
- package/dist/system/safestop.js +5 -2
- package/dist/system/safestop.js.map +1 -1
- package/dist/system/skill-fixtures.d.ts +200 -0
- package/dist/system/skill-fixtures.d.ts.map +1 -0
- package/dist/system/skill-fixtures.js +331 -0
- package/dist/system/skill-fixtures.js.map +1 -0
- package/dist/task-work/index.d.ts +6 -0
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +6 -3
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +4 -2
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +218 -0
- package/dist/tasks/affected-packages.d.ts.map +1 -0
- package/dist/tasks/affected-packages.js +496 -0
- package/dist/tasks/affected-packages.js.map +1 -0
- package/dist/tasks/affected-scope.d.ts +59 -0
- package/dist/tasks/affected-scope.d.ts.map +1 -0
- package/dist/tasks/affected-scope.js +81 -0
- package/dist/tasks/affected-scope.js.map +1 -0
- package/dist/tasks/analyze.d.ts.map +1 -1
- package/dist/tasks/analyze.js +7 -2
- package/dist/tasks/analyze.js.map +1 -1
- package/dist/tasks/change-set.d.ts +175 -0
- package/dist/tasks/change-set.d.ts.map +1 -0
- package/dist/tasks/change-set.js +753 -0
- package/dist/tasks/change-set.js.map +1 -0
- package/dist/tasks/complete.d.ts +10 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +59 -5
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/component-pr.d.ts +106 -0
- package/dist/tasks/component-pr.d.ts.map +1 -0
- package/dist/tasks/component-pr.js +190 -0
- package/dist/tasks/component-pr.js.map +1 -0
- package/dist/tasks/done-plan.d.ts +123 -0
- package/dist/tasks/done-plan.d.ts.map +1 -0
- package/dist/tasks/done-plan.js +696 -0
- package/dist/tasks/done-plan.js.map +1 -0
- package/dist/tasks/done-record.d.ts +127 -0
- package/dist/tasks/done-record.d.ts.map +1 -0
- package/dist/tasks/done-record.js +302 -0
- package/dist/tasks/done-record.js.map +1 -0
- package/dist/tasks/duplicate-detector.d.ts +68 -11
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +314 -58
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/evidence-paths.d.ts +78 -0
- package/dist/tasks/evidence-paths.d.ts.map +1 -0
- package/dist/tasks/evidence-paths.js +150 -0
- package/dist/tasks/evidence-paths.js.map +1 -0
- package/dist/tasks/evidence.d.ts +101 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +278 -31
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-preview.d.ts +5 -0
- package/dist/tasks/gate-preview.d.ts.map +1 -1
- package/dist/tasks/gate-preview.js +25 -21
- package/dist/tasks/gate-preview.js.map +1 -1
- package/dist/tasks/gate-result-cache.d.ts +205 -0
- package/dist/tasks/gate-result-cache.d.ts.map +1 -0
- package/dist/tasks/gate-result-cache.js +285 -0
- package/dist/tasks/gate-result-cache.js.map +1 -0
- package/dist/tasks/gate-runner.d.ts +126 -3
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +483 -28
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/session-scope.d.ts +3 -1
- package/dist/tasks/session-scope.d.ts.map +1 -1
- package/dist/tasks/session-scope.js +18 -3
- package/dist/tasks/session-scope.js.map +1 -1
- package/dist/tasks/task-next.d.ts +4 -0
- package/dist/tasks/task-next.d.ts.map +1 -1
- package/dist/tasks/task-next.js +32 -28
- package/dist/tasks/task-next.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +23 -6
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +146 -8
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-vacuity.d.ts +71 -0
- package/dist/tasks/tool-vacuity.d.ts.map +1 -0
- package/dist/tasks/tool-vacuity.js +334 -0
- package/dist/tasks/tool-vacuity.js.map +1 -0
- package/dist/tasks/update.d.ts +8 -0
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +159 -78
- package/dist/tasks/update.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +18 -2
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +20 -2
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +64 -4
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/doctor/index.d.ts +1 -1
- package/dist/validation/doctor/index.d.ts.map +1 -1
- package/dist/validation/doctor/index.js +1 -1
- package/dist/validation/doctor/index.js.map +1 -1
- package/dist/validation/doctor/utils.d.ts.map +1 -1
- package/dist/validation/doctor/utils.js +7 -2
- package/dist/validation/doctor/utils.js.map +1 -1
- package/dist/validation/engine-ops.d.ts +24 -1
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +272 -98
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/validation/validate-ops.d.ts.map +1 -1
- package/dist/validation/validate-ops.js +9 -3
- package/dist/validation/validate-ops.js.map +1 -1
- package/dist/worktree/worktree-adopt.d.ts.map +1 -1
- package/dist/worktree/worktree-adopt.js +5 -2
- package/dist/worktree/worktree-adopt.js.map +1 -1
- package/migrations/drizzle-cleo-global/20260927000000_t12469-project-locations/migration.sql +121 -0
- package/migrations/drizzle-cleo-global/20260927010000_t12543-user-profile-project-scope/migration.sql +23 -0
- package/migrations/drizzle-cleo-global/20260928010000_t12470-location-candidates/migration.sql +72 -0
- package/migrations/drizzle-cleo-global/20260928020000_t12510-nexus-devices/migration.sql +34 -0
- package/migrations/drizzle-cleo-global/20260928030000_t12511-project-git-state/migration.sql +62 -0
- package/migrations/drizzle-cleo-project/20260927000000_t12499-session-terminal-bindings/migration.sql +34 -0
- package/migrations/drizzle-cleo-project/20260928000000_t12500-binding-provider-flag/migration.sql +15 -0
- package/package.json +23 -13
- package/schemas/config.schema.json +54 -0
- package/schemas/project-context.schema.json +51 -3
- package/schemas/project-info.schema.json +28 -1
- package/templates/CLEO-INJECTION.md +40 -332
- package/templates/CLEO-REFERENCE.md +303 -0
- package/templates/workflows/README.md +36 -14
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo done <id> --plan` — the read-only evidence planner.
|
|
3
|
+
*
|
|
4
|
+
* {@link deriveTaskEvidence} answers, for one task, "what would `cleo done`
|
|
5
|
+
* record, and what stops it?" without executing a tool or a typed gate and
|
|
6
|
+
* without writing a row, an audit line or a cache entry:
|
|
7
|
+
*
|
|
8
|
+
* - the implemented change set and where it came from ({@link deriveTaskChangeSet});
|
|
9
|
+
* - the gates the verification policy requires and whether each has passed;
|
|
10
|
+
* - the tool runs those gates need, resolved through the ADR-061 resolver,
|
|
11
|
+
* and whether each already has a fresh cached result for the current tree;
|
|
12
|
+
* - which acceptance criteria map to evidence deterministically — a stored
|
|
13
|
+
* passing typed gate, or every repo path the criterion names being in the
|
|
14
|
+
* change set by exact repo-relative path — and which need `--satisfies`;
|
|
15
|
+
* - the ordered blockers, each with one runnable next step;
|
|
16
|
+
* - the exact commands, spelled as today's `cleo verify` / `cleo complete`
|
|
17
|
+
* verbs, so every one is runnable before `cleo done` records anything.
|
|
18
|
+
*
|
|
19
|
+
* The planned atom strings are the same strings the existing validators
|
|
20
|
+
* receive; the planner adds no validation path of its own.
|
|
21
|
+
*
|
|
22
|
+
* Spec: `verify-streamlined-design` §3.1, §3.2, §7 step 1.
|
|
23
|
+
*
|
|
24
|
+
* @task T12623
|
|
25
|
+
*/
|
|
26
|
+
import { execFileSync } from 'node:child_process';
|
|
27
|
+
import { readFileSync } from 'node:fs';
|
|
28
|
+
import { join } from 'node:path';
|
|
29
|
+
import { ExitCode } from '@cleocode/contracts';
|
|
30
|
+
import { engineSuccess } from '../engine-result.js';
|
|
31
|
+
import { CleoError } from '../errors.js';
|
|
32
|
+
import { cleoErrorToEngineResult } from '../errors-to-engine.js';
|
|
33
|
+
import { getProjectRoot } from '../paths.js';
|
|
34
|
+
import { isCiDocumentPath, readCiChecks, readCiSatisfies } from '../release/ci-evidence.js';
|
|
35
|
+
import { readRequiredCheckPins } from '../release/pr-evidence.js';
|
|
36
|
+
import { getTaskAccessor } from '../store/data-accessor.js';
|
|
37
|
+
import { planAffectedTestRun } from './affected-packages.js';
|
|
38
|
+
import { affectedScopeSupersededReason, mergeStateOfChangeSet } from './affected-scope.js';
|
|
39
|
+
import { deriveTaskChangeSet } from './change-set.js';
|
|
40
|
+
import { checkGateEvidenceMinimumDetailed, classifyEvidenceTask, extractTaskAcFilesWithProvenance, } from './evidence.js';
|
|
41
|
+
import { extractTypedGates } from './gate-runner.js';
|
|
42
|
+
import { captureDirtyFingerprint, captureHead, computeCacheKey, readCacheEntry, } from './tool-cache.js';
|
|
43
|
+
import { resolveToolCommand } from './tool-resolver.js';
|
|
44
|
+
import { loadVerificationGatePolicy } from './verification-policy.js';
|
|
45
|
+
/**
|
|
46
|
+
* Whether `ci:<pr>` can attest both tool gates for this change set (T12634):
|
|
47
|
+
* both `evidence.ciChecks` lists are declared, a change that is not purely
|
|
48
|
+
* documentation also declares its job globs, and the PR does not edit a pinned workflow (its own CI would
|
|
49
|
+
* vouch for itself). Otherwise the plan falls back to local tool runs.
|
|
50
|
+
*/
|
|
51
|
+
function ciPlannable(storeRoot, needsJobs, touched) {
|
|
52
|
+
const lists = readCiChecks(storeRoot);
|
|
53
|
+
if (!lists.tests?.length || !lists.qa?.length)
|
|
54
|
+
return false;
|
|
55
|
+
if (needsJobs && (!lists.jobs?.tests?.length || !lists.jobs?.qa?.length))
|
|
56
|
+
return false;
|
|
57
|
+
let context = null;
|
|
58
|
+
try {
|
|
59
|
+
context = JSON.parse(readFileSync(join(storeRoot, '.cleo', 'project-context.json'), 'utf-8'));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
context = null;
|
|
63
|
+
}
|
|
64
|
+
const pins = readRequiredCheckPins(context);
|
|
65
|
+
return !Object.values(pins).some((pin) => pin.workflow && touched.includes(pin.workflow));
|
|
66
|
+
}
|
|
67
|
+
/** Gates `cleo done` derives evidence for; every other required gate is manual. */
|
|
68
|
+
const EVIDENCE_GATES = ['implemented', 'testsPassed', 'qaPassed'];
|
|
69
|
+
/** Tools each tool-backed gate runs, in atom order. */
|
|
70
|
+
const GATE_TOOLS = {
|
|
71
|
+
testsPassed: ['test'],
|
|
72
|
+
qaPassed: ['lint', 'typecheck'],
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Report order for blockers: the first is the one to clear first (spec §3.3:
|
|
76
|
+
* dirty tree → no change set → PR ambiguity → tool failure → typed gate
|
|
77
|
+
* failure → AC mapping → lifecycle).
|
|
78
|
+
*/
|
|
79
|
+
const DONE_PLAN_BLOCKER_ORDER = [
|
|
80
|
+
'git-root',
|
|
81
|
+
'run-from-worktree',
|
|
82
|
+
'dirty-tree',
|
|
83
|
+
'checkout-required',
|
|
84
|
+
'no-change-set',
|
|
85
|
+
'pr-ambiguous',
|
|
86
|
+
'pr-unverified',
|
|
87
|
+
'merge-commit-missing',
|
|
88
|
+
'decision-missing',
|
|
89
|
+
'tool-unresolved',
|
|
90
|
+
'tool-failed',
|
|
91
|
+
'typed-gate-failed',
|
|
92
|
+
'ac-mapping-needed',
|
|
93
|
+
'manual-gate',
|
|
94
|
+
'epic-rollup',
|
|
95
|
+
'evidence-refused',
|
|
96
|
+
'completion-refused',
|
|
97
|
+
];
|
|
98
|
+
/** Default preview: `validateGateVerify` in preview mode (no tool runs, no write). */
|
|
99
|
+
const defaultPreviewEvidence = async (storeRoot, taskId, gateEvidence) => {
|
|
100
|
+
const { validateGateVerify } = await import('../validation/engine-ops.js');
|
|
101
|
+
const r = await validateGateVerify(storeRoot, { taskId, gateEvidence, preview: true });
|
|
102
|
+
return r.success
|
|
103
|
+
? { ok: true }
|
|
104
|
+
: {
|
|
105
|
+
ok: false,
|
|
106
|
+
code: r.error.code,
|
|
107
|
+
message: r.error.message,
|
|
108
|
+
...(r.error.fix ? { fix: r.error.fix } : {}),
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
/** `git` read in `cwd`, trimmed; `null` on failure (a non-zero exit included). */
|
|
112
|
+
function gitRead(cwd, args) {
|
|
113
|
+
try {
|
|
114
|
+
return execFileSync('git', args, {
|
|
115
|
+
cwd,
|
|
116
|
+
encoding: 'utf-8',
|
|
117
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
118
|
+
}).trim();
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The tools and typed gates run on whatever `executionRoot` has checked out.
|
|
126
|
+
* `implemented` cites the change set's commit; unless that tree CONTAINS the
|
|
127
|
+
* change, `testsPassed`/`qaPassed` would attest a different tree — the T12625
|
|
128
|
+
* review reproduced a failing test recording testsPassed from the main
|
|
129
|
+
* checkout while `implemented` cited the unchecked-out task branch.
|
|
130
|
+
*
|
|
131
|
+
* - branch: the change-set commit must be the checked-out HEAD (a dirty tree
|
|
132
|
+
* is already a plan blocker);
|
|
133
|
+
* - pr: the merge commit must be an ancestor of the checked-out HEAD.
|
|
134
|
+
*/
|
|
135
|
+
function checkoutBlocker(taskId, cs) {
|
|
136
|
+
const root = cs.executionRoot;
|
|
137
|
+
const head = gitRead(root, ['rev-parse', 'HEAD']);
|
|
138
|
+
const short = (sha) => (sha ?? 'nothing').slice(0, 12);
|
|
139
|
+
if (cs.source === 'branch') {
|
|
140
|
+
if (cs.headRef === 'HEAD' && head !== null && head === cs.commitSha)
|
|
141
|
+
return null;
|
|
142
|
+
const branch = cs.headRef && cs.headRef !== 'HEAD' ? cs.headRef : `task/${taskId}`;
|
|
143
|
+
return {
|
|
144
|
+
code: 'checkout-required',
|
|
145
|
+
message: `${taskId}'s change is ${short(cs.commitSha)} on ${branch}, but ${root} has ${short(head)} checked out; the tools would measure a different tree than implemented cites.`,
|
|
146
|
+
next: {
|
|
147
|
+
command: `git -C ${shellQuote(root)} switch ${branch} && cleo done ${taskId}`,
|
|
148
|
+
why: 'Tests, lint, typecheck and typed gates must run on the commit implemented records.',
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (cs.source === 'pr' && cs.mergeCommitSha) {
|
|
153
|
+
// D11151: every PR the task shipped in must be in the tested tree.
|
|
154
|
+
const merges = [
|
|
155
|
+
...(cs.additionalPrs ?? []).flatMap((p) => p.mergeCommitSha ? [{ pr: p.prNumber, sha: p.mergeCommitSha }] : []),
|
|
156
|
+
{ pr: cs.prNumber, sha: cs.mergeCommitSha },
|
|
157
|
+
];
|
|
158
|
+
const missing = merges.find((m) => head === null || gitRead(root, ['merge-base', '--is-ancestor', m.sha, 'HEAD']) === null);
|
|
159
|
+
if (!missing)
|
|
160
|
+
return null;
|
|
161
|
+
return {
|
|
162
|
+
code: 'checkout-required',
|
|
163
|
+
message: `${root} has ${short(head)} checked out, which does not contain PR #${missing.pr}'s merge commit ${short(missing.sha)}.`,
|
|
164
|
+
next: {
|
|
165
|
+
command: `git -C ${shellQuote(root)} switch --detach ${cs.mergeCommitSha} && cleo done ${taskId}`,
|
|
166
|
+
why: 'Tests, lint, typecheck and typed gates must run on a tree containing the merged change.',
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The refusals `cleo done` would raise from what the plan already knows —
|
|
174
|
+
* the ONE readiness check both `--plan` and `done` use (T12672), so
|
|
175
|
+
* `ready: true` never meets a plan-visible refusal:
|
|
176
|
+
*
|
|
177
|
+
* - tools or typed gates run on a tree: from the task worktree
|
|
178
|
+
* (`run-from-worktree`), with the change checked out (`checkout-required`).
|
|
179
|
+
* A close with no tool run needs no tree (T12671);
|
|
180
|
+
* - the derived evidence goes through the write's own validators in preview
|
|
181
|
+
* mode (`evidence-refused`), when nothing else blocks.
|
|
182
|
+
*/
|
|
183
|
+
async function readinessBlockers(input) {
|
|
184
|
+
const { taskId, changeSet: cs } = input;
|
|
185
|
+
if (input.needsTree) {
|
|
186
|
+
if (cs.rootSource === 'task-worktree') {
|
|
187
|
+
return [
|
|
188
|
+
{
|
|
189
|
+
code: 'run-from-worktree',
|
|
190
|
+
message: `${taskId}'s work is in its worktree ${cs.executionRoot}; tools must run in that tree.`,
|
|
191
|
+
next: {
|
|
192
|
+
command: `cd ${shellQuote(cs.executionRoot)} && cleo done ${taskId}`,
|
|
193
|
+
why: 'Evidence tools measure the invocation tree; run cleo done from the task worktree.',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
const checkout = checkoutBlocker(taskId, cs);
|
|
199
|
+
if (checkout)
|
|
200
|
+
return [checkout];
|
|
201
|
+
}
|
|
202
|
+
const pending = input.gates.filter((g) => !g.passed && g.evidence !== null);
|
|
203
|
+
if (input.blocked || pending.length === 0)
|
|
204
|
+
return [];
|
|
205
|
+
const gateEvidence = Object.fromEntries(pending.map((g) => [g.gate, g.evidence]));
|
|
206
|
+
if (input.additionalImplemented.length > 0 && gateEvidence.implemented) {
|
|
207
|
+
gateEvidence.implemented = [...input.additionalImplemented, gateEvidence.implemented];
|
|
208
|
+
}
|
|
209
|
+
const checked = await input.preview(input.storeRoot, taskId, gateEvidence);
|
|
210
|
+
if (checked.ok)
|
|
211
|
+
return [];
|
|
212
|
+
return [
|
|
213
|
+
{
|
|
214
|
+
code: 'evidence-refused',
|
|
215
|
+
message: checked.message,
|
|
216
|
+
next: {
|
|
217
|
+
command: checked.fix ?? `cleo show ${taskId} --full`,
|
|
218
|
+
why: 'The validators cleo done records through refuse this evidence.',
|
|
219
|
+
},
|
|
220
|
+
cause: checked.code,
|
|
221
|
+
},
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* POSIX single-quote a shell word (bare when it is already safe).
|
|
226
|
+
*
|
|
227
|
+
* @param word - Word to quote.
|
|
228
|
+
* @returns A string the shell reads back as exactly `word`.
|
|
229
|
+
*/
|
|
230
|
+
export function shellQuote(word) {
|
|
231
|
+
return /^[A-Za-z0-9_./:@%+=,-]+$/.test(word) ? word : `'${word.replace(/'/g, `'\\''`)}'`;
|
|
232
|
+
}
|
|
233
|
+
function step(command, why) {
|
|
234
|
+
return { command, why };
|
|
235
|
+
}
|
|
236
|
+
function orderBlockers(blockers) {
|
|
237
|
+
return blockers
|
|
238
|
+
.map((b, i) => ({ b, i }))
|
|
239
|
+
.sort((x, y) => DONE_PLAN_BLOCKER_ORDER.indexOf(x.b.code) - DONE_PLAN_BLOCKER_ORDER.indexOf(y.b.code) ||
|
|
240
|
+
x.i - y.i)
|
|
241
|
+
.map(({ b }) => b);
|
|
242
|
+
}
|
|
243
|
+
/** Resolve one tool and read — never write — its ADR-061 cache entry for `root`. */
|
|
244
|
+
async function planToolRun(tool, gate, storeRoot, root, override) {
|
|
245
|
+
const resolution = override
|
|
246
|
+
? { ok: true, command: override }
|
|
247
|
+
: resolveToolCommand(tool, storeRoot);
|
|
248
|
+
if (!resolution.ok) {
|
|
249
|
+
return {
|
|
250
|
+
tool,
|
|
251
|
+
gate,
|
|
252
|
+
command: null,
|
|
253
|
+
source: null,
|
|
254
|
+
cache: resolution.codeName === 'E_TOOL_NOT_APPLICABLE' ? 'not-applicable' : 'unresolved',
|
|
255
|
+
reason: resolution.reason,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const { command } = resolution;
|
|
259
|
+
const key = computeCacheKey(command, await captureHead(root), await captureDirtyFingerprint(root), root);
|
|
260
|
+
const entry = readCacheEntry(storeRoot, key);
|
|
261
|
+
const run = {
|
|
262
|
+
tool,
|
|
263
|
+
gate,
|
|
264
|
+
command: [command.cmd, ...command.args].join(' '),
|
|
265
|
+
source: command.source,
|
|
266
|
+
cache: entry === null ? 'miss' : entry.exitCode === 0 ? 'fresh-pass' : 'fresh-fail',
|
|
267
|
+
};
|
|
268
|
+
if (entry !== null && entry.exitCode !== null) {
|
|
269
|
+
run.exitCode = entry.exitCode;
|
|
270
|
+
run.capturedAt = entry.capturedAt;
|
|
271
|
+
}
|
|
272
|
+
return run;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Repo-relative path in the one spelling exact matching compares: no leading
|
|
276
|
+
* `./`, no trailing `/`. Deliberately NOT {@link diffIntersectsAc}, whose
|
|
277
|
+
* suffix rule would let `src/index.ts` match `packages/lafs/src/index.ts` —
|
|
278
|
+
* acceptable for an advisory intersect, not for claiming a criterion.
|
|
279
|
+
*/
|
|
280
|
+
function normaliseRepoPath(path) {
|
|
281
|
+
return path.replace(/^\.\//, '').replace(/\/+$/, '');
|
|
282
|
+
}
|
|
283
|
+
/** Stored typed-gate results, aligned with criteria by acceptance index. */
|
|
284
|
+
function planTypedGates(task, rows) {
|
|
285
|
+
const results = task.verification?.gateResults ?? [];
|
|
286
|
+
return extractTypedGates(task.acceptance ?? []).map(({ gate, originalIndex }) => {
|
|
287
|
+
const stored = results.find((r) => r.index === originalIndex);
|
|
288
|
+
const status = stored === undefined || stored.result === 'skipped'
|
|
289
|
+
? 'not-run'
|
|
290
|
+
: stored.result === 'pass'
|
|
291
|
+
? 'pass'
|
|
292
|
+
: 'fail';
|
|
293
|
+
const row = rows[originalIndex];
|
|
294
|
+
return {
|
|
295
|
+
alias: `AC${row?.ordinal ?? originalIndex + 1}`,
|
|
296
|
+
kind: gate.kind,
|
|
297
|
+
...(gate.req ? { req: gate.req } : {}),
|
|
298
|
+
status,
|
|
299
|
+
};
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
/** Criterion IDs already linked by recorded gate evidence. */
|
|
303
|
+
function recordedCriteria(task) {
|
|
304
|
+
const ids = new Set();
|
|
305
|
+
for (const evidence of Object.values(task.verification?.evidence ?? {})) {
|
|
306
|
+
for (const link of evidence?.scope?.criteria ?? [])
|
|
307
|
+
ids.add(link.criterionId);
|
|
308
|
+
}
|
|
309
|
+
return ids;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Map each criterion conservatively. Keyword matching is deliberately absent:
|
|
313
|
+
* a criterion is linked only by a stored passing typed gate, by every path it
|
|
314
|
+
* names being in the change set, by prior recorded evidence, or by the agent.
|
|
315
|
+
*/
|
|
316
|
+
function mapCriteria(task, rows, typedGates, changeSet, pending, satisfies) {
|
|
317
|
+
const recorded = recordedCriteria(task);
|
|
318
|
+
const changed = new Set(changeSet.files.map(normaliseRepoPath));
|
|
319
|
+
const writable = (gates) => gates.filter((g) => pending.includes(g));
|
|
320
|
+
return rows.map((row) => {
|
|
321
|
+
const alias = `AC${row.ordinal}`;
|
|
322
|
+
const base = { alias, id: row.id, text: row.text };
|
|
323
|
+
if (satisfies === 'all' || satisfies?.includes(alias)) {
|
|
324
|
+
const gates = writable([...EVIDENCE_GATES]);
|
|
325
|
+
return { ...base, mapped: true, gates, basis: 'agent' };
|
|
326
|
+
}
|
|
327
|
+
if (typedGates.some((g) => g.alias === alias && g.status === 'pass')) {
|
|
328
|
+
return { ...base, mapped: true, gates: writable(['testsPassed']), basis: 'typed-gate' };
|
|
329
|
+
}
|
|
330
|
+
const named = extractTaskAcFilesWithProvenance({ acceptance: [row.text] }).files ?? [];
|
|
331
|
+
if (named.length > 0 && named.every((path) => changed.has(normaliseRepoPath(path)))) {
|
|
332
|
+
return {
|
|
333
|
+
...base,
|
|
334
|
+
mapped: true,
|
|
335
|
+
gates: writable(['implemented']),
|
|
336
|
+
basis: 'files-in-diff',
|
|
337
|
+
files: named,
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
if (recorded.has(row.id))
|
|
341
|
+
return { ...base, mapped: true, gates: [], basis: 'recorded' };
|
|
342
|
+
return {
|
|
343
|
+
...base,
|
|
344
|
+
mapped: false,
|
|
345
|
+
gates: [],
|
|
346
|
+
basis: 'none',
|
|
347
|
+
...(named.length ? { files: named } : {}),
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
/** Planned atoms for a tool-backed gate, or a decision-only note. */
|
|
352
|
+
function toolGateEvidence(gate, runs, decisionOnly, ciPr) {
|
|
353
|
+
if (decisionOnly)
|
|
354
|
+
return 'note:decision-only implementation, no code changed';
|
|
355
|
+
if (ciPr !== null)
|
|
356
|
+
return `ci:${ciPr}`;
|
|
357
|
+
const atoms = runs
|
|
358
|
+
.filter((r) => r.gate === gate && r.cache !== 'unresolved')
|
|
359
|
+
.map((r) => `tool:${r.tool}`);
|
|
360
|
+
return atoms.length > 0 ? atoms.join(';') : null;
|
|
361
|
+
}
|
|
362
|
+
/** Blockers from tool runs and typed gates, before any AC question. */
|
|
363
|
+
function toolAndTypedGateBlockers(taskId, code, runs, typedGates, root) {
|
|
364
|
+
const out = [];
|
|
365
|
+
for (const run of runs) {
|
|
366
|
+
if (run.cache === 'unresolved') {
|
|
367
|
+
out.push({
|
|
368
|
+
code: 'tool-unresolved',
|
|
369
|
+
message: `No command resolves for tool:${run.tool} (${run.gate}): ${run.reason ?? 'unknown'}`,
|
|
370
|
+
next: step('cleo detect', `Re-detect the toolchain, or declare the ${run.tool} command in .cleo/project-context.json, so ${run.gate} has a real result.`),
|
|
371
|
+
cause: 'E_EVIDENCE_TOOL_UNAVAILABLE',
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
else if (run.cache === 'fresh-fail') {
|
|
375
|
+
out.push({
|
|
376
|
+
code: 'tool-failed',
|
|
377
|
+
message: `tool:${run.tool} failed (exit ${run.exitCode}) on the current tree; ${run.gate} cannot pass until it does.`,
|
|
378
|
+
next: step(`cd ${shellQuote(root)} && ${run.command}`, `Fix the failures ${run.tool} reports.`),
|
|
379
|
+
cause: 'E_EVIDENCE_TOOL_FAILED',
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
for (const gate of new Set(runs.map((r) => r.gate))) {
|
|
384
|
+
const gateRuns = runs.filter((r) => r.gate === gate);
|
|
385
|
+
if (code && gateRuns.every((r) => r.cache === 'not-applicable')) {
|
|
386
|
+
out.push({
|
|
387
|
+
code: 'tool-unresolved',
|
|
388
|
+
message: `Every tool for ${gate} is not applicable here; a code task needs an actual result.`,
|
|
389
|
+
next: step(`cleo verify ${taskId} --gate ${gate} --evidence 'test-run:<vitest-json-report>'`, 'A code task cannot pass on the absence of a toolchain.'),
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
for (const typed of typedGates) {
|
|
394
|
+
if (typed.status !== 'fail')
|
|
395
|
+
continue;
|
|
396
|
+
out.push({
|
|
397
|
+
code: 'typed-gate-failed',
|
|
398
|
+
message: `Typed gate ${typed.alias} (${typed.kind}${typed.req ? ` ${typed.req}` : ''}) last failed.`,
|
|
399
|
+
next: step(`cleo verify ${taskId} --run`, 'Re-run the typed gates and fix the failing one.'),
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
return out;
|
|
403
|
+
}
|
|
404
|
+
/** The AC blocker: criteria nobody linked, or a gate left with no linkage at all. */
|
|
405
|
+
function acMappingBlocker(taskId, mapping, pending) {
|
|
406
|
+
if (mapping.length === 0)
|
|
407
|
+
return null;
|
|
408
|
+
const unmapped = mapping.filter((m) => !m.mapped).map((m) => m.alias);
|
|
409
|
+
const bare = pending.filter((gate) => EVIDENCE_GATES.includes(gate) && !mapping.some((m) => m.gates.includes(gate)));
|
|
410
|
+
if (unmapped.length === 0 && bare.length === 0)
|
|
411
|
+
return null;
|
|
412
|
+
const ask = unmapped.length > 0 ? unmapped : mapping.map((m) => m.alias);
|
|
413
|
+
const parts = [
|
|
414
|
+
unmapped.length > 0 ? `${unmapped.join(', ')} have no deterministic evidence link` : '',
|
|
415
|
+
bare.length > 0 ? `${bare.join(', ')} would carry no criterion link` : '',
|
|
416
|
+
].filter(Boolean);
|
|
417
|
+
return {
|
|
418
|
+
code: 'ac-mapping-needed',
|
|
419
|
+
message: `${parts.join('; ')}. Name the criteria this work satisfies; the claim is still bound to the validated artifacts.`,
|
|
420
|
+
next: step(`cleo done ${taskId} --plan --satisfies ${ask.join(',')}`, 'Answer once; the criteria fan out to every gate whose evidence covers them.'),
|
|
421
|
+
cause: 'E_EVIDENCE_CONTENT_MISMATCH',
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
/** Required gates `cleo done` cannot derive (documented, securityPassed, …). */
|
|
425
|
+
function manualGateBlockers(taskId, gates) {
|
|
426
|
+
return gates
|
|
427
|
+
.filter((g) => g.required && !g.passed && !EVIDENCE_GATES.includes(g.gate))
|
|
428
|
+
.map((g) => ({
|
|
429
|
+
code: 'manual-gate',
|
|
430
|
+
message: `${g.gate} is required and is not derived by cleo done.`,
|
|
431
|
+
next: step(`cleo verify ${taskId} --gate ${g.gate} --evidence '<atoms>'`, checkGateEvidenceMinimumDetailed(g.gate, [])?.message ?? `Record ${g.gate} evidence.`),
|
|
432
|
+
}));
|
|
433
|
+
}
|
|
434
|
+
function withSatisfies(taskId, gate, evidence, mapping) {
|
|
435
|
+
if (evidence === null)
|
|
436
|
+
return null;
|
|
437
|
+
const links = mapping
|
|
438
|
+
.filter((m) => m.gates.includes(gate))
|
|
439
|
+
.map((m) => `satisfies:${taskId}#${m.alias}`);
|
|
440
|
+
return [evidence, ...links].join(';');
|
|
441
|
+
}
|
|
442
|
+
function epicPlan(task, storeRoot) {
|
|
443
|
+
const blocker = {
|
|
444
|
+
code: 'epic-rollup',
|
|
445
|
+
message: `${task.id} is an epic; it completes through its children, not through derived evidence.`,
|
|
446
|
+
next: step(`cleo complete ${task.id}`, 'Epic completion uses the existing child rollup.'),
|
|
447
|
+
};
|
|
448
|
+
return {
|
|
449
|
+
taskId: task.id,
|
|
450
|
+
runFrom: storeRoot,
|
|
451
|
+
changeSet: {
|
|
452
|
+
source: 'none',
|
|
453
|
+
executionRoot: storeRoot,
|
|
454
|
+
rootSource: 'store',
|
|
455
|
+
files: [],
|
|
456
|
+
deletedFiles: [],
|
|
457
|
+
docs: [],
|
|
458
|
+
decisions: [],
|
|
459
|
+
candidates: [],
|
|
460
|
+
implementedEvidence: null,
|
|
461
|
+
blockers: [],
|
|
462
|
+
warnings: [],
|
|
463
|
+
},
|
|
464
|
+
gates: [],
|
|
465
|
+
toolRuns: [],
|
|
466
|
+
typedGates: [],
|
|
467
|
+
acMapping: [],
|
|
468
|
+
needsSatisfies: [],
|
|
469
|
+
blockers: [blocker],
|
|
470
|
+
commands: [],
|
|
471
|
+
ready: false,
|
|
472
|
+
next: blocker.next,
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
/** Normalise `--satisfies` and reject aliases the task does not have. */
|
|
476
|
+
function normaliseSatisfies(taskId, satisfies, rows) {
|
|
477
|
+
if (satisfies === undefined || satisfies === 'all')
|
|
478
|
+
return satisfies;
|
|
479
|
+
const aliases = satisfies.map((s) => s.trim().toUpperCase()).filter(Boolean);
|
|
480
|
+
const known = new Set(rows.map((r) => `AC${r.ordinal}`));
|
|
481
|
+
const unknown = aliases.filter((a) => !known.has(a));
|
|
482
|
+
if (unknown.length > 0) {
|
|
483
|
+
throw new CleoError(ExitCode.VALIDATION_ERROR, `--satisfies names criteria ${taskId} does not have: ${unknown.join(', ')}`, { fix: `cleo show ${taskId} --full # criteria: ${[...known].join(', ') || 'none'}` });
|
|
484
|
+
}
|
|
485
|
+
return aliases;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Plan the evidence `cleo done` would record for a task. Read-only: executes
|
|
489
|
+
* no tool or typed gate and writes nothing.
|
|
490
|
+
*
|
|
491
|
+
* @param taskId - Task to plan.
|
|
492
|
+
* @param opts - Store root, invocation directory, `--satisfies`, `--pr`.
|
|
493
|
+
* @returns The plan: change set, gates, tool runs, AC mapping, ordered
|
|
494
|
+
* blockers and the runnable commands.
|
|
495
|
+
* @throws CleoError(NOT_FOUND) for an unknown task; CleoError(VALIDATION_ERROR)
|
|
496
|
+
* for a `--satisfies` alias the task does not have.
|
|
497
|
+
* @example
|
|
498
|
+
* ```ts
|
|
499
|
+
* const plan = await deriveTaskEvidence('T123', { satisfies: ['AC2'] });
|
|
500
|
+
* for (const cmd of plan.commands) console.log(cmd);
|
|
501
|
+
* ```
|
|
502
|
+
* @task T12623
|
|
503
|
+
*/
|
|
504
|
+
export async function deriveTaskEvidence(taskId, opts = {}) {
|
|
505
|
+
const storeRoot = opts.projectRoot ?? getProjectRoot();
|
|
506
|
+
const accessor = await getTaskAccessor(storeRoot);
|
|
507
|
+
const task = await accessor.loadSingleTask(taskId);
|
|
508
|
+
if (!task) {
|
|
509
|
+
throw new CleoError(ExitCode.NOT_FOUND, `Task ${taskId} not found`, {
|
|
510
|
+
fix: `cleo find "${taskId}"`,
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
if (task.type === 'epic')
|
|
514
|
+
return epicPlan(task, storeRoot);
|
|
515
|
+
const rows = [...(await accessor.getAcRows(taskId))].sort((a, b) => a.ordinal - b.ordinal);
|
|
516
|
+
const satisfies = normaliseSatisfies(taskId, opts.satisfies, rows);
|
|
517
|
+
const policy = await loadVerificationGatePolicy(storeRoot);
|
|
518
|
+
const changeSet = await deriveTaskChangeSet({ task, storeRoot, cwd: opts.cwd, prNumber: opts.prNumber }, opts.deps);
|
|
519
|
+
const root = changeSet.executionRoot;
|
|
520
|
+
// T12635 (D11150): a scope:affected testsPassed only stands before merge.
|
|
521
|
+
// Once the change set is a merged PR, merged CI or a full run supersedes it.
|
|
522
|
+
// T12656: the same rule `cleo complete` enforces (one shared function).
|
|
523
|
+
const supersededReason = affectedScopeSupersededReason(task.verification?.evidence?.testsPassed?.atoms ?? [], mergeStateOfChangeSet(changeSet));
|
|
524
|
+
const superseded = supersededReason !== null;
|
|
525
|
+
if (supersededReason)
|
|
526
|
+
changeSet.warnings.push(supersededReason);
|
|
527
|
+
const passed = (gate) => task.verification?.gates?.[gate] === true && !(gate === 'testsPassed' && superseded);
|
|
528
|
+
const pending = policy.requiredGates.filter((g) => !passed(g));
|
|
529
|
+
const decisionOnly = changeSet.source === 'docs' && (changeSet.implementedEvidence ?? '').startsWith('decision:');
|
|
530
|
+
// T12634 (D11149): a change set from a merged PR (not stacked) proves
|
|
531
|
+
// testsPassed/qaPassed by its merge-commit CI when the project opts in, so
|
|
532
|
+
// no local tool run is planned for them.
|
|
533
|
+
const ciPr = changeSet.source === 'pr' &&
|
|
534
|
+
changeSet.prNumber !== undefined &&
|
|
535
|
+
changeSet.stackedOn === undefined &&
|
|
536
|
+
readCiSatisfies(storeRoot) &&
|
|
537
|
+
ciPlannable(storeRoot, ![...changeSet.files, ...changeSet.deletedFiles].every(isCiDocumentPath), [...changeSet.files, ...changeSet.deletedFiles])
|
|
538
|
+
? // T12671: a component landed by an integration PR is judged on the
|
|
539
|
+
// integration PR's CI, linked through the component.
|
|
540
|
+
changeSet.componentPrNumber !== undefined
|
|
541
|
+
? `${changeSet.componentPrNumber}@${changeSet.prNumber}`
|
|
542
|
+
: String(changeSet.prNumber)
|
|
543
|
+
: null;
|
|
544
|
+
const toolRuns = [];
|
|
545
|
+
if (!decisionOnly && ciPr === null) {
|
|
546
|
+
for (const gate of pending) {
|
|
547
|
+
for (const tool of GATE_TOOLS[gate] ?? []) {
|
|
548
|
+
// T12635: before merge, test only the affected packages when declared.
|
|
549
|
+
// T12656 review: only when the change is KNOWN unmerged — an unknown
|
|
550
|
+
// merge state (gh unreachable) plans the full run complete accepts.
|
|
551
|
+
const affected = tool === 'test' &&
|
|
552
|
+
changeSet.source === 'branch' &&
|
|
553
|
+
mergeStateOfChangeSet(changeSet) === 'unmerged'
|
|
554
|
+
? await planAffectedTestRun(storeRoot, root, { wait: opts.waitForTestSlot === true })
|
|
555
|
+
: null;
|
|
556
|
+
toolRuns.push(affected?.ok
|
|
557
|
+
? await planToolRun('test-affected', gate, storeRoot, root, affected.command)
|
|
558
|
+
: affected?.pending
|
|
559
|
+
? {
|
|
560
|
+
tool: 'test-affected',
|
|
561
|
+
gate,
|
|
562
|
+
command: null,
|
|
563
|
+
source: 'project-context',
|
|
564
|
+
cache: 'miss',
|
|
565
|
+
reason: affected.reason,
|
|
566
|
+
}
|
|
567
|
+
: await planToolRun(tool, gate, storeRoot, root));
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const typedGates = planTypedGates(task, rows);
|
|
572
|
+
const acMapping = mapCriteria(task, rows, typedGates, changeSet, pending, satisfies);
|
|
573
|
+
const gates = policy.requiredGates.map((gate) => {
|
|
574
|
+
const raw = gate === 'implemented'
|
|
575
|
+
? changeSet.implementedEvidence
|
|
576
|
+
: GATE_TOOLS[gate]
|
|
577
|
+
? toolGateEvidence(gate, toolRuns, decisionOnly, ciPr)
|
|
578
|
+
: null;
|
|
579
|
+
return {
|
|
580
|
+
gate,
|
|
581
|
+
required: true,
|
|
582
|
+
passed: passed(gate),
|
|
583
|
+
evidence: passed(gate) ? null : withSatisfies(taskId, gate, raw, acMapping),
|
|
584
|
+
};
|
|
585
|
+
});
|
|
586
|
+
const isCode = classifyEvidenceTask({ task }) === 'code';
|
|
587
|
+
const acBlocker = acMappingBlocker(taskId, acMapping, pending);
|
|
588
|
+
const derivedBlockers = orderBlockers([
|
|
589
|
+
...changeSet.blockers,
|
|
590
|
+
...toolAndTypedGateBlockers(taskId, isCode, toolRuns, typedGates, root),
|
|
591
|
+
...(acBlocker ? [acBlocker] : []),
|
|
592
|
+
...manualGateBlockers(taskId, gates),
|
|
593
|
+
]);
|
|
594
|
+
const cd = changeSet.rootSource === 'task-worktree' ? `cd ${shellQuote(root)} && ` : '';
|
|
595
|
+
// D11151: each earlier own-branch PR is its own implemented attempt, recorded
|
|
596
|
+
// first so the stored implemented evidence ends on the primary (latest) PR.
|
|
597
|
+
const additionalImplemented = passed('implemented')
|
|
598
|
+
? []
|
|
599
|
+
: (changeSet.additionalPrs ?? []).flatMap((extra) => {
|
|
600
|
+
const ev = withSatisfies(taskId, 'implemented', extra.implementedEvidence, acMapping);
|
|
601
|
+
return ev === null ? [] : [ev];
|
|
602
|
+
});
|
|
603
|
+
const blockers = orderBlockers([
|
|
604
|
+
...derivedBlockers,
|
|
605
|
+
...(task.status === 'done'
|
|
606
|
+
? []
|
|
607
|
+
: await readinessBlockers({
|
|
608
|
+
taskId,
|
|
609
|
+
storeRoot,
|
|
610
|
+
changeSet,
|
|
611
|
+
needsTree: toolRuns.length > 0 || typedGates.length > 0,
|
|
612
|
+
gates,
|
|
613
|
+
additionalImplemented,
|
|
614
|
+
blocked: derivedBlockers.length > 0,
|
|
615
|
+
preview: opts.previewEvidence ?? defaultPreviewEvidence,
|
|
616
|
+
})),
|
|
617
|
+
]);
|
|
618
|
+
const commands = additionalImplemented.map((ev) => `${cd}cleo verify ${taskId} --gate implemented --evidence ${shellQuote(ev)}`);
|
|
619
|
+
commands.push(...gates
|
|
620
|
+
.filter((g) => !g.passed && g.evidence !== null)
|
|
621
|
+
.map((g) => `${cd}cleo verify ${taskId} --gate ${g.gate} --evidence ${shellQuote(g.evidence ?? '')}`));
|
|
622
|
+
if (task.status === 'done') {
|
|
623
|
+
changeSet.warnings.push(`${taskId} is already done; nothing is left to record.`);
|
|
624
|
+
}
|
|
625
|
+
else if (changeSet.implementedEvidence !== null || passed('implemented')) {
|
|
626
|
+
commands.push(`${cd}cleo complete ${taskId}`);
|
|
627
|
+
}
|
|
628
|
+
const next = blockers[0]?.next ??
|
|
629
|
+
(commands[0] ? step(commands[0], 'Every gate is derivable; record them in order.') : null);
|
|
630
|
+
return {
|
|
631
|
+
taskId,
|
|
632
|
+
runFrom: root,
|
|
633
|
+
changeSet,
|
|
634
|
+
gates,
|
|
635
|
+
...(additionalImplemented.length > 0 ? { additionalImplemented } : {}),
|
|
636
|
+
toolRuns,
|
|
637
|
+
typedGates,
|
|
638
|
+
acMapping,
|
|
639
|
+
needsSatisfies: acMapping.filter((m) => !m.mapped).map((m) => m.alias),
|
|
640
|
+
blockers,
|
|
641
|
+
commands,
|
|
642
|
+
ready: blockers.length === 0 && commands.length > 0,
|
|
643
|
+
next,
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* {@link deriveTaskEvidence} as an {@link EngineResult}, for the CLI handler:
|
|
648
|
+
* a `CleoError` (unknown task, bad `--satisfies`) becomes a typed failure
|
|
649
|
+
* instead of a throw, so the handler stays a thin renderer.
|
|
650
|
+
*
|
|
651
|
+
* @param taskId - Task to plan.
|
|
652
|
+
* @param opts - Same options as {@link deriveTaskEvidence}.
|
|
653
|
+
* @returns The plan, or the refusal with its exit code and fix.
|
|
654
|
+
* @example
|
|
655
|
+
* ```ts
|
|
656
|
+
* const result = await planTaskDone('T123', { satisfies: 'all' });
|
|
657
|
+
* if (result.success) console.log(result.data.commands);
|
|
658
|
+
* ```
|
|
659
|
+
* @task T12623
|
|
660
|
+
*/
|
|
661
|
+
export async function planTaskDone(taskId, opts = {}) {
|
|
662
|
+
try {
|
|
663
|
+
return engineSuccess(await deriveTaskEvidence(taskId, opts));
|
|
664
|
+
}
|
|
665
|
+
catch (err) {
|
|
666
|
+
return cleoErrorToEngineResult(err, 'E_DONE_PLAN_FAILED', 'cleo done --plan failed');
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Parse the `--satisfies` / `--pr` CLI flags shared by `cleo done` and
|
|
671
|
+
* `cleo verify --auto` into planner options.
|
|
672
|
+
*
|
|
673
|
+
* @param satisfies - Raw `--satisfies` value (`AC1,AC3` or `all`), if given.
|
|
674
|
+
* @param pr - Raw `--pr` value, if given.
|
|
675
|
+
* @returns The options, or the refusal text for an invalid PR number.
|
|
676
|
+
* @example
|
|
677
|
+
* ```ts
|
|
678
|
+
* parseDoneOptions('AC1,AC3', '42'); // { ok: true, options: { satisfies: ['AC1','AC3'], prNumber: 42 } }
|
|
679
|
+
* ```
|
|
680
|
+
* @task T12625
|
|
681
|
+
*/
|
|
682
|
+
export function parseDoneOptions(satisfies, pr) {
|
|
683
|
+
const raw = typeof satisfies === 'string' ? satisfies.trim() : '';
|
|
684
|
+
const prNumber = typeof pr === 'string' ? Number(pr) : undefined;
|
|
685
|
+
if (prNumber !== undefined && !(Number.isInteger(prNumber) && prNumber > 0)) {
|
|
686
|
+
return { ok: false, message: `--pr must be a positive PR number, got "${String(pr)}"` };
|
|
687
|
+
}
|
|
688
|
+
return {
|
|
689
|
+
ok: true,
|
|
690
|
+
options: {
|
|
691
|
+
...(raw === '' ? {} : { satisfies: raw.toLowerCase() === 'all' ? 'all' : raw.split(',') }),
|
|
692
|
+
...(prNumber !== undefined ? { prNumber } : {}),
|
|
693
|
+
},
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
//# sourceMappingURL=done-plan.js.map
|