@cleocode/core 2026.9.19 → 2026.9.21
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/bootstrap.d.ts +5 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +41 -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/docs/export-document.js +5908 -2436
- 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.map +1 -1
- package/dist/doctor/knowledge.js +5 -15
- 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.map +1 -1
- package/dist/engine/engine-ops.js +59 -23
- 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/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 +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -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 +535 -44
- package/dist/init.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 +9 -5
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +8 -4
- 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 +4312 -1798
- 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.d.ts.map +1 -1
- package/dist/memory/attention.js +30 -30
- 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.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +42 -29
- 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 +26 -2
- 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 +106 -0
- package/dist/nexus/stored-roots.d.ts.map +1 -0
- package/dist/nexus/stored-roots.js +180 -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/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +5 -1
- package/dist/orchestrate/pivot.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 +152 -57
- package/dist/orchestrate/spawn-ops.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 +3 -2
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +2 -1
- package/dist/orchestration/index.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/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 +12 -1
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +141 -179
- 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/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/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 +86 -4
- package/dist/project-scope.d.ts.map +1 -1
- package/dist/project-scope.js +226 -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 +223 -0
- package/dist/release/ci-evidence.d.ts.map +1 -0
- package/dist/release/ci-evidence.js +652 -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/plan.d.ts.map +1 -1
- package/dist/release/plan.js +7 -6
- 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 +67 -11
- 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 +12 -2
- package/dist/security/input-sanitization.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +4321 -1807
- 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 +9 -0
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +110 -18
- 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 +6 -0
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +12 -1
- 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 +4 -2
- package/dist/sessions/drift-watchdog.js.map +1 -1
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +33 -4
- package/dist/sessions/index.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 +8 -2
- package/dist/skills/discovery.d.ts.map +1 -1
- package/dist/skills/discovery.js +15 -3
- 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/install.d.ts +15 -2
- package/dist/skills/install.d.ts.map +1 -1
- package/dist/skills/install.js +21 -5
- package/dist/skills/install.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 +4 -2
- package/dist/skills/orchestrator/startup.js.map +1 -1
- 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 +23 -0
- package/dist/skills/types.d.ts.map +1 -1
- 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 +56 -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/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/snapshot-gate.d.ts +239 -0
- package/dist/store/snapshot-gate.d.ts.map +1 -0
- package/dist/store/snapshot-gate.js +398 -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 +63 -4
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +1 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +53 -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 +275 -0
- package/dist/store/twin-collapse.d.ts.map +1 -0
- package/dist/store/twin-collapse.js +805 -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 +69 -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 +26 -41
- 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/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/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 +173 -0
- package/dist/tasks/affected-packages.d.ts.map +1 -0
- package/dist/tasks/affected-packages.js +389 -0
- package/dist/tasks/affected-packages.js.map +1 -0
- package/dist/tasks/change-set.d.ts +151 -0
- package/dist/tasks/change-set.d.ts.map +1 -0
- package/dist/tasks/change-set.js +634 -0
- package/dist/tasks/change-set.js.map +1 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +10 -5
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/done-plan.d.ts +103 -0
- package/dist/tasks/done-plan.d.ts.map +1 -0
- package/dist/tasks/done-plan.js +541 -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 +373 -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 +55 -0
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +223 -26
- 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/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 +15 -0
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +249 -98
- package/dist/validation/engine-ops.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
- package/templates/workflows/release-prepare.yml.tmpl +7 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implemented change-set derivation for the streamlined verification flow.
|
|
3
|
+
*
|
|
4
|
+
* Given a task, find the work that implements it, first match wins:
|
|
5
|
+
*
|
|
6
|
+
* 1. a merged PR that cites the task — files read from its merge commit;
|
|
7
|
+
* 2. the unmerged task branch, diffed against its merge-base with origin's
|
|
8
|
+
* default branch;
|
|
9
|
+
* 3. for research, spike and documentation tasks, the attached docs and the
|
|
10
|
+
* decisions linked to the task.
|
|
11
|
+
*
|
|
12
|
+
* The result is an atom string for the EXISTING ADR-051 validators
|
|
13
|
+
* (`parseEvidence` → `validateAtom` → `checkGateEvidenceMinimum` →
|
|
14
|
+
* `checkTaskEvidenceContext`). Nothing here validates, records or writes:
|
|
15
|
+
* every git and gh call is a read, and the PR lookup runs with
|
|
16
|
+
* `readOnly: true` so not even the PR cache is written.
|
|
17
|
+
*
|
|
18
|
+
* Every git and gh call runs in one resolved execution root: a declared
|
|
19
|
+
* `evidence.gitRoot` first, then the caller's own worktree of this project,
|
|
20
|
+
* then — when invoked from the main checkout — the task's registered
|
|
21
|
+
* worktree, then the store root (or its single child checkout).
|
|
22
|
+
*
|
|
23
|
+
* Paths are repo-relative, which is the portable form the `files:` atom
|
|
24
|
+
* stores; deleted paths are reported separately and never enter `files:`,
|
|
25
|
+
* because a deleted file has no bytes to hash.
|
|
26
|
+
*
|
|
27
|
+
* Spec: `verify-streamlined-design` §3.2 step 2 and §6.
|
|
28
|
+
*
|
|
29
|
+
* @task T12624
|
|
30
|
+
*/
|
|
31
|
+
import { execFileSync } from 'node:child_process';
|
|
32
|
+
import { existsSync, readdirSync, realpathSync } from 'node:fs';
|
|
33
|
+
import { join, resolve as resolvePath } from 'node:path';
|
|
34
|
+
import { gitToplevel, resolveDeclaredEvidenceGitRoot } from '../git/work-tree.js';
|
|
35
|
+
import { enumerateWorktrees } from '../worktree/list.js';
|
|
36
|
+
import { classifyEvidenceTask, diffIntersectsAc, resolveEvidenceExecutionRoot, } from './evidence.js';
|
|
37
|
+
/** Run git read-only in `cwd`; `null` on any failure. */
|
|
38
|
+
function git(cwd, args) {
|
|
39
|
+
try {
|
|
40
|
+
return execFileSync('git', args, {
|
|
41
|
+
cwd,
|
|
42
|
+
encoding: 'utf-8',
|
|
43
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
44
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
45
|
+
}).trimEnd();
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function canonical(path) {
|
|
52
|
+
try {
|
|
53
|
+
return realpathSync(path);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return resolvePath(path);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** `(^|non-alnum)T123(non-alnum|$)` — T123 never matches inside T1234. */
|
|
60
|
+
function citesTask(text, taskId) {
|
|
61
|
+
return new RegExp(`(^|[^A-Za-z0-9])${taskId}([^A-Za-z0-9]|$)`).test(text);
|
|
62
|
+
}
|
|
63
|
+
function blocker(code, message, command, why, cause) {
|
|
64
|
+
return { code, message, next: { command, why }, ...(cause ? { cause } : {}) };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Resolve the repository a task's change set is read from.
|
|
68
|
+
*
|
|
69
|
+
* Order: declared git root → the invocation's own worktree of this project →
|
|
70
|
+
* the task's registered worktree (only when invoked from the main checkout)
|
|
71
|
+
* → the store root or its single child checkout, as
|
|
72
|
+
* {@link resolveEvidenceExecutionRoot} already decides.
|
|
73
|
+
*
|
|
74
|
+
* @param storeRoot - CLEO store root.
|
|
75
|
+
* @param taskId - Task whose registered worktree to look for.
|
|
76
|
+
* @param cwd - Invocation directory.
|
|
77
|
+
* @param env - Environment for the declared-root tier.
|
|
78
|
+
* @returns The execution root and why it was chosen.
|
|
79
|
+
* @task T12624
|
|
80
|
+
*/
|
|
81
|
+
export function resolveChangeSetRoot(storeRoot, taskId, cwd = process.cwd(), // CWD-OK: the invocation dir is the subject (gh#1220)
|
|
82
|
+
env = process.env) {
|
|
83
|
+
const declared = resolveDeclaredEvidenceGitRoot(storeRoot, env);
|
|
84
|
+
if (declared !== null) {
|
|
85
|
+
return { root: gitToplevel(declared.path) ?? declared.path, source: 'declared' };
|
|
86
|
+
}
|
|
87
|
+
const base = resolveEvidenceExecutionRoot(storeRoot, cwd);
|
|
88
|
+
const mainCheckout = git(base, ['rev-parse', '--path-format=absolute', '--git-common-dir']);
|
|
89
|
+
const isLinkedWorktree = mainCheckout !== null &&
|
|
90
|
+
canonical(join(base, '.git')) !== canonical(mainCheckout) &&
|
|
91
|
+
canonical(base) !== canonical(storeRoot);
|
|
92
|
+
if (isLinkedWorktree)
|
|
93
|
+
return { root: base, source: 'invocation-worktree' };
|
|
94
|
+
let worktrees = [];
|
|
95
|
+
try {
|
|
96
|
+
worktrees = enumerateWorktrees(base);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
worktrees = [];
|
|
100
|
+
}
|
|
101
|
+
const own = worktrees.find((entry) => (entry.branch === `task/${taskId}` || entry.branch.startsWith(`task/${taskId}-`)) &&
|
|
102
|
+
existsSync(entry.path) &&
|
|
103
|
+
canonical(entry.path) !== canonical(base));
|
|
104
|
+
if (own)
|
|
105
|
+
return { root: own.path, source: 'task-worktree' };
|
|
106
|
+
return { root: base, source: 'store' };
|
|
107
|
+
}
|
|
108
|
+
/** Split `git diff --name-status --no-renames` output into kept and deleted paths. */
|
|
109
|
+
function parseNameStatus(output) {
|
|
110
|
+
const files = [];
|
|
111
|
+
const deleted = [];
|
|
112
|
+
for (const line of output.split('\n')) {
|
|
113
|
+
const [status, ...rest] = line.split('\t');
|
|
114
|
+
const path = rest.join('\t');
|
|
115
|
+
if (!status || !path)
|
|
116
|
+
continue;
|
|
117
|
+
if (status.startsWith('D'))
|
|
118
|
+
deleted.push(path);
|
|
119
|
+
else
|
|
120
|
+
files.push(path);
|
|
121
|
+
}
|
|
122
|
+
return { files, deleted };
|
|
123
|
+
}
|
|
124
|
+
/** `origin/<default>` from `origin/HEAD`, never from a possibly stale local branch. */
|
|
125
|
+
function resolveOriginDefault(root) {
|
|
126
|
+
const symbolic = git(root, ['symbolic-ref', '--quiet', 'refs/remotes/origin/HEAD']);
|
|
127
|
+
if (symbolic)
|
|
128
|
+
return symbolic.replace(/^refs\/remotes\//, '');
|
|
129
|
+
for (const candidate of ['origin/main', 'origin/master']) {
|
|
130
|
+
if (git(root, ['rev-parse', '--verify', '--quiet', `refs/remotes/${candidate}`]) !== null)
|
|
131
|
+
return candidate;
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
/** Default merged-PR discovery: `gh pr list` by search text and by task branch. */
|
|
136
|
+
async function defaultListMergedPrs(taskId, executionRoot) {
|
|
137
|
+
const { isGhCliAvailable } = await import('../release/github-pr.js');
|
|
138
|
+
if (!isGhCliAvailable())
|
|
139
|
+
return { ok: false, reason: 'gh CLI is not available on PATH' };
|
|
140
|
+
const fields = 'number,title,body,headRefName,mergedAt';
|
|
141
|
+
const queries = [
|
|
142
|
+
['--search', taskId],
|
|
143
|
+
['--head', `task/${taskId}`],
|
|
144
|
+
];
|
|
145
|
+
const byNumber = new Map();
|
|
146
|
+
for (const query of queries) {
|
|
147
|
+
try {
|
|
148
|
+
const out = execFileSync('gh', ['pr', 'list', '--state', 'merged', ...query, '--json', fields, '--limit', '30'], { cwd: executionRoot, encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
149
|
+
const parsed = JSON.parse(out);
|
|
150
|
+
if (!Array.isArray(parsed))
|
|
151
|
+
continue;
|
|
152
|
+
for (const row of parsed) {
|
|
153
|
+
if (typeof row?.number === 'number')
|
|
154
|
+
byNumber.set(row.number, row);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
return {
|
|
159
|
+
ok: false,
|
|
160
|
+
reason: `gh pr list failed: ${err instanceof Error ? err.message.slice(0, 200) : String(err)}`,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { ok: true, prs: [...byNumber.values()] };
|
|
165
|
+
}
|
|
166
|
+
const PR_DETAIL_FIELDS = 'number,title,headRefName,baseRefName,state,mergedAt,headRefOid,mergeCommit';
|
|
167
|
+
/** Normalise one `gh pr view/list --json PR_DETAIL_FIELDS` row. */
|
|
168
|
+
function toPrDetails(row) {
|
|
169
|
+
if (row === null || typeof row !== 'object')
|
|
170
|
+
return null;
|
|
171
|
+
const r = row;
|
|
172
|
+
if (typeof r.number !== 'number')
|
|
173
|
+
return null;
|
|
174
|
+
const merge = r.mergeCommit;
|
|
175
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
176
|
+
return {
|
|
177
|
+
number: r.number,
|
|
178
|
+
title: str(r.title),
|
|
179
|
+
headRefName: str(r.headRefName),
|
|
180
|
+
baseRefName: str(r.baseRefName),
|
|
181
|
+
state: str(r.state),
|
|
182
|
+
mergedAt: typeof r.mergedAt === 'string' && r.mergedAt !== '' ? r.mergedAt : null,
|
|
183
|
+
headRefOid: typeof r.headRefOid === 'string' ? r.headRefOid : null,
|
|
184
|
+
mergeCommitSha: typeof merge?.oid === 'string' ? merge.oid : null,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** Run a read-only `gh` query; `null` on any failure. */
|
|
188
|
+
function ghJson(args, cwd) {
|
|
189
|
+
try {
|
|
190
|
+
return JSON.parse(execFileSync('gh', args, { cwd, encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] }));
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/** Default {@link ChangeSetDeps.viewPr}: `gh pr view <n>`. */
|
|
197
|
+
async function defaultViewPr(prNumber, executionRoot) {
|
|
198
|
+
return toPrDetails(ghJson(['pr', 'view', String(prNumber), '--json', PR_DETAIL_FIELDS], executionRoot));
|
|
199
|
+
}
|
|
200
|
+
/** Default {@link ChangeSetDeps.findPrByHead}: `gh pr list --head <branch> --state all`. */
|
|
201
|
+
async function defaultFindPrByHead(branch, executionRoot) {
|
|
202
|
+
const rows = ghJson(['pr', 'list', '--head', branch, '--state', 'all', '--json', PR_DETAIL_FIELDS, '--limit', '10'], executionRoot);
|
|
203
|
+
if (!Array.isArray(rows))
|
|
204
|
+
return null;
|
|
205
|
+
const prs = rows.map(toPrDetails).filter((p) => p !== null);
|
|
206
|
+
return prs.find((p) => p.state === 'MERGED') ?? prs[0] ?? null;
|
|
207
|
+
}
|
|
208
|
+
/** Default PR verification: the existing `pr:` provenance code, persisting nothing. */
|
|
209
|
+
async function defaultResolvePr(prNumber, roots) {
|
|
210
|
+
const { resolvePrEvidenceAtom } = await import('../release/pr-evidence.js');
|
|
211
|
+
const { loadProjectContext } = await import('../agents/variable-substitution.js');
|
|
212
|
+
const ctx = loadProjectContext(roots.storeRoot);
|
|
213
|
+
return resolvePrEvidenceAtom(prNumber, roots, {
|
|
214
|
+
projectContext: ctx.loaded ? ctx.context : null,
|
|
215
|
+
readOnly: true,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
/** Default attached-docs reader: the same read model `cleo docs list --task` uses. */
|
|
219
|
+
async function defaultListTaskDocs(storeRoot, taskId) {
|
|
220
|
+
const { createDocsReadModel } = await import('../docs/docs-read-model.js');
|
|
221
|
+
const model = createDocsReadModel(storeRoot);
|
|
222
|
+
try {
|
|
223
|
+
const docs = await model.resolveByOwner(taskId);
|
|
224
|
+
return docs.map((doc) => ({ id: doc.id, slug: doc.slug, sha256: doc.sha256 }));
|
|
225
|
+
}
|
|
226
|
+
finally {
|
|
227
|
+
model.close();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/** Default decision reader: decisions whose context task, or brain link, is this task. */
|
|
231
|
+
async function defaultListTaskDecisions(storeRoot, taskId) {
|
|
232
|
+
const { getBrainDb } = await import('../store/memory-sqlite.js');
|
|
233
|
+
const { eq } = await import('drizzle-orm');
|
|
234
|
+
const { brainDecisions } = await import('../store/schema/memory-schema.js');
|
|
235
|
+
const db = await getBrainDb(storeRoot);
|
|
236
|
+
const rows = await db
|
|
237
|
+
.select()
|
|
238
|
+
.from(brainDecisions)
|
|
239
|
+
.where(eq(brainDecisions.contextTaskId, taskId))
|
|
240
|
+
.all();
|
|
241
|
+
const { getLinkedDecisions } = await import('../memory/brain-links.js');
|
|
242
|
+
const linked = await getLinkedDecisions(storeRoot, taskId).catch(() => []);
|
|
243
|
+
const ids = new Set();
|
|
244
|
+
for (const row of [...rows, ...linked]) {
|
|
245
|
+
const state = row.confirmationState ?? '';
|
|
246
|
+
if (state === 'accepted' || state === 'proposed')
|
|
247
|
+
ids.add(row.id);
|
|
248
|
+
}
|
|
249
|
+
return [...ids].sort();
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Locate the stored bytes of an attached doc, as a store-relative path the
|
|
253
|
+
* `files:` validator can hash: the content-addressed blob, else the
|
|
254
|
+
* attachment store copy.
|
|
255
|
+
*/
|
|
256
|
+
function locateDocBytes(storeRoot, sha256) {
|
|
257
|
+
if (!/^[0-9a-f]{64}$/.test(sha256))
|
|
258
|
+
return null;
|
|
259
|
+
const blob = join('.cleo', 'blobs', 'blobs', sha256);
|
|
260
|
+
if (existsSync(join(storeRoot, blob)))
|
|
261
|
+
return blob;
|
|
262
|
+
const dir = join('.cleo', 'attachments', 'sha256', sha256.slice(0, 2));
|
|
263
|
+
try {
|
|
264
|
+
const hit = readdirSync(join(storeRoot, dir)).find((name) => name === sha256.slice(2) || name.startsWith(`${sha256.slice(2)}.`));
|
|
265
|
+
return hit ? join(dir, hit) : null;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function emptyChangeSet(root, rootSource) {
|
|
272
|
+
return {
|
|
273
|
+
source: 'none',
|
|
274
|
+
executionRoot: root,
|
|
275
|
+
rootSource,
|
|
276
|
+
files: [],
|
|
277
|
+
deletedFiles: [],
|
|
278
|
+
docs: [],
|
|
279
|
+
decisions: [],
|
|
280
|
+
candidates: [],
|
|
281
|
+
implementedEvidence: null,
|
|
282
|
+
blockers: [],
|
|
283
|
+
warnings: [],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
/** `a;b` separators and `,` inside a files list cannot be carried by the atom grammar. */
|
|
287
|
+
function atomSafe(text) {
|
|
288
|
+
return text.replace(/[;\n]/g, ',').trim();
|
|
289
|
+
}
|
|
290
|
+
/** First-parent name-status of a merge (or squash) commit. */
|
|
291
|
+
function mergeCommitChanges(root, sha) {
|
|
292
|
+
return parseNameStatus(git(root, [
|
|
293
|
+
'diff-tree',
|
|
294
|
+
'--root',
|
|
295
|
+
'--no-commit-id',
|
|
296
|
+
'-r',
|
|
297
|
+
'--name-status',
|
|
298
|
+
'--no-renames',
|
|
299
|
+
'-m',
|
|
300
|
+
'--first-parent',
|
|
301
|
+
sha,
|
|
302
|
+
]) ?? '');
|
|
303
|
+
}
|
|
304
|
+
function hasCommit(root, sha) {
|
|
305
|
+
return sha !== null && git(root, ['cat-file', '-e', `${sha}^{commit}`]) !== null;
|
|
306
|
+
}
|
|
307
|
+
/** A GitHub revert PR: `Revert "…"` by default, `revert:` by convention. */
|
|
308
|
+
function isRevertTitle(title) {
|
|
309
|
+
return /^revert\b/i.test(title.trim());
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* The task's PR merged into another branch — a stacked PR. Its merge commit
|
|
313
|
+
* is on that branch, not on the default branch, so `pr:` provenance cannot
|
|
314
|
+
* attribute it. Once the base branch's own PR has merged to the default
|
|
315
|
+
* branch AND its head contains the stacked merge, the task is attributed to
|
|
316
|
+
* that base merge commit via `commit:` + the stacked PR's surviving files;
|
|
317
|
+
* otherwise a `pr-stacked` blocker names the base branch and its PR.
|
|
318
|
+
*/
|
|
319
|
+
async function deriveStackedChangeSet(cs, taskId, root, pr, defaultBranch, findPrByHead) {
|
|
320
|
+
const baseRef = pr.baseRefName;
|
|
321
|
+
const basePr = await findPrByHead(baseRef, root);
|
|
322
|
+
cs.stackedOn = { baseRef, ...(basePr ? { basePrNumber: basePr.number } : {}) };
|
|
323
|
+
const baseLanded = basePr !== null && basePr.state === 'MERGED' && basePr.baseRefName === defaultBranch;
|
|
324
|
+
if (baseLanded && hasCommit(root, pr.mergeCommitSha) && hasCommit(root, basePr.headRefOid)) {
|
|
325
|
+
const contained = git(root, [
|
|
326
|
+
'merge-base',
|
|
327
|
+
'--is-ancestor',
|
|
328
|
+
pr.mergeCommitSha,
|
|
329
|
+
basePr.headRefOid,
|
|
330
|
+
]) !== null;
|
|
331
|
+
const baseMerge = basePr.mergeCommitSha;
|
|
332
|
+
if (contained && baseMerge !== null && hasCommit(root, baseMerge)) {
|
|
333
|
+
const { files, deleted } = mergeCommitChanges(root, pr.mergeCommitSha);
|
|
334
|
+
const surviving = files.filter((f) => git(root, ['cat-file', '-e', `${baseMerge}:${f}`]) !== null);
|
|
335
|
+
if (surviving.length > 0) {
|
|
336
|
+
cs.source = 'pr';
|
|
337
|
+
cs.mergeCommitSha = baseMerge;
|
|
338
|
+
cs.files = surviving;
|
|
339
|
+
cs.deletedFiles = deleted;
|
|
340
|
+
cs.implementedEvidence = `commit:${baseMerge};files:${surviving.join(',')}`;
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const baseState = basePr === null
|
|
346
|
+
? `no PR has ${baseRef} as its head`
|
|
347
|
+
: `its PR #${basePr.number} is ${basePr.state.toLowerCase()} into ${basePr.baseRefName || 'unknown'}`;
|
|
348
|
+
const settled = basePr !== null && basePr.state === 'MERGED';
|
|
349
|
+
cs.source = 'pr';
|
|
350
|
+
cs.blockers.push(blocker('pr-stacked', `PR #${pr.number} merged into ${baseRef}, not ${defaultBranch}; ${baseState}.`, settled ? `cleo done ${taskId} --plan --pr ${basePr.number}` : `cleo done ${taskId} --plan`, settled
|
|
351
|
+
? `PR #${basePr.number} is where ${baseRef} merged, but its head does not contain PR #${pr.number}'s merge; name the PR that carried the work to ${defaultBranch}.`
|
|
352
|
+
: basePr !== null
|
|
353
|
+
? `Re-plan after PR #${basePr.number} (${baseRef}) merges into ${defaultBranch}.`
|
|
354
|
+
: `Re-plan after ${baseRef} reaches ${defaultBranch} through its own PR.`));
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
/** Candidate numbers after the declared-files and own-branch narrowing rules. */
|
|
358
|
+
async function narrowCandidates(numbers, cs, task, roots, resolvePr, resolved) {
|
|
359
|
+
let out = numbers;
|
|
360
|
+
if (out.length > 1 && task.files?.length) {
|
|
361
|
+
for (const n of out)
|
|
362
|
+
resolved.set(n, await resolvePr(n, roots));
|
|
363
|
+
const intersecting = out.filter((n) => {
|
|
364
|
+
const r = resolved.get(n);
|
|
365
|
+
return r?.ok === true && diffIntersectsAc(r.changedPaths, task.files ?? []);
|
|
366
|
+
});
|
|
367
|
+
if (intersecting.length > 0)
|
|
368
|
+
out = intersecting;
|
|
369
|
+
}
|
|
370
|
+
if (out.length > 1) {
|
|
371
|
+
// A PR merged FROM the task's own branch (`task/<id>` or `task/<id>-…`)
|
|
372
|
+
// is the task's PR; an integration PR that merely lists the id in its body
|
|
373
|
+
// is not. Deterministic by branch convention, never by wording.
|
|
374
|
+
const own = cs.candidates.filter((c) => out.includes(c.prNumber) &&
|
|
375
|
+
(c.headRefName === `task/${task.id}` || c.headRefName.startsWith(`task/${task.id}-`)));
|
|
376
|
+
// D11151: several own-branch PRs are all the task's; the integration PRs
|
|
377
|
+
// that merely list the id drop out either way.
|
|
378
|
+
if (own.length >= 1)
|
|
379
|
+
out = own.map((c) => c.prNumber).sort((a, b) => a - b);
|
|
380
|
+
}
|
|
381
|
+
return out;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Step 1 — a merged PR that cites the task. Returns `true` when the PR path
|
|
385
|
+
* decided the outcome (a change set or a blocker), `false` to fall through.
|
|
386
|
+
* A PR the `pr:` validator refuses leaves a `pr-unverified` blocker and
|
|
387
|
+
* returns `false`, so the caller can still try the task branch.
|
|
388
|
+
*/
|
|
389
|
+
async function derivePrChangeSet(cs, input, roots, deps) {
|
|
390
|
+
const { task } = input;
|
|
391
|
+
const root = roots.executionRoot;
|
|
392
|
+
const listed = await deps.listMergedPrs(task.id, root);
|
|
393
|
+
if (!listed.ok)
|
|
394
|
+
cs.warnings.push(`Merged-PR discovery skipped: ${listed.reason}`);
|
|
395
|
+
const citing = (listed.ok ? listed.prs : []).filter((pr) => citesTask(`${pr.title}\n${pr.body}\n${pr.headRefName}`, task.id));
|
|
396
|
+
const reverts = citing.filter((pr) => isRevertTitle(pr.title));
|
|
397
|
+
const originals = citing.filter((pr) => !isRevertTitle(pr.title));
|
|
398
|
+
cs.candidates = originals.map((pr) => ({
|
|
399
|
+
prNumber: pr.number,
|
|
400
|
+
title: pr.title,
|
|
401
|
+
headRefName: pr.headRefName,
|
|
402
|
+
}));
|
|
403
|
+
let numbers = input.prNumber !== undefined
|
|
404
|
+
? [input.prNumber]
|
|
405
|
+
: originals.map((pr) => pr.number).sort((a, b) => a - b);
|
|
406
|
+
if (numbers.length === 0)
|
|
407
|
+
return false;
|
|
408
|
+
const resolved = new Map();
|
|
409
|
+
numbers = await narrowCandidates(numbers, cs, task, roots, deps.resolvePr, resolved);
|
|
410
|
+
const ownBranch = (n) => {
|
|
411
|
+
const head = cs.candidates.find((c) => c.prNumber === n)?.headRefName ?? '';
|
|
412
|
+
return head === `task/${task.id}` || head.startsWith(`task/${task.id}-`);
|
|
413
|
+
};
|
|
414
|
+
// D11151: a task shipped across several of its OWN PRs (every candidate
|
|
415
|
+
// merged from task/<id> or task/<id>-…) records one implemented attempt per
|
|
416
|
+
// PR. Candidates that merely mention the id stay ambiguous.
|
|
417
|
+
if (numbers.length > 1 && input.prNumber === undefined && numbers.every(ownBranch)) {
|
|
418
|
+
return deriveMultiPrChangeSet(cs, numbers, { originals, reverts, resolved }, input, roots, deps);
|
|
419
|
+
}
|
|
420
|
+
if (numbers.length > 1) {
|
|
421
|
+
const list = numbers.map((n) => `#${n}`).join(', ');
|
|
422
|
+
cs.blockers.push(blocker('pr-ambiguous', `${numbers.length} merged PRs cite ${task.id} (${list}) and declared task files do not narrow them to one.`, `cleo done ${task.id} --plan --pr ${numbers[0]}`, `Name the PR that implements ${task.id}; candidates: ${list}.`));
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
return deriveOnePr(cs, numbers[0], { originals, reverts, resolved }, input, roots, deps);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* D11151: derive every own-branch PR of the task in merge order. The latest is
|
|
429
|
+
* the primary change set; the others become {@link TaskChangeSet.additionalPrs},
|
|
430
|
+
* each recorded as its own `implemented` attempt. Any PR's blocker blocks.
|
|
431
|
+
*/
|
|
432
|
+
async function deriveMultiPrChangeSet(cs, numbers, discovery, input, roots, deps) {
|
|
433
|
+
const ordered = [...numbers].sort((a, b) => a - b);
|
|
434
|
+
const parts = [];
|
|
435
|
+
for (const n of ordered) {
|
|
436
|
+
const part = emptyChangeSet(cs.executionRoot, cs.rootSource);
|
|
437
|
+
part.candidates = cs.candidates;
|
|
438
|
+
await deriveOnePr(part, n, discovery, input, roots, deps);
|
|
439
|
+
parts.push(part);
|
|
440
|
+
}
|
|
441
|
+
const primary = parts[parts.length - 1];
|
|
442
|
+
Object.assign(cs, { ...primary, candidates: cs.candidates });
|
|
443
|
+
cs.blockers = parts.flatMap((p) => p.blockers);
|
|
444
|
+
cs.warnings = [...cs.warnings, ...parts.flatMap((p) => p.warnings)];
|
|
445
|
+
cs.additionalPrs = parts.slice(0, -1).map((p) => ({
|
|
446
|
+
prNumber: p.prNumber,
|
|
447
|
+
...(p.mergeCommitSha ? { mergeCommitSha: p.mergeCommitSha } : {}),
|
|
448
|
+
files: p.files,
|
|
449
|
+
deletedFiles: p.deletedFiles,
|
|
450
|
+
implementedEvidence: p.implementedEvidence,
|
|
451
|
+
}));
|
|
452
|
+
return true;
|
|
453
|
+
}
|
|
454
|
+
/** Derive the change set of one chosen PR (revert, stacked, provenance, merge files). */
|
|
455
|
+
async function deriveOnePr(cs, prNumber, discovery, input, roots, deps) {
|
|
456
|
+
const { task } = input;
|
|
457
|
+
const root = roots.executionRoot;
|
|
458
|
+
const { originals, reverts, resolved } = discovery;
|
|
459
|
+
cs.prNumber = prNumber;
|
|
460
|
+
const original = originals.find((pr) => pr.number === prNumber);
|
|
461
|
+
const revert = reverts.find((r) => r.number !== prNumber &&
|
|
462
|
+
(r.mergedAt && original?.mergedAt ? r.mergedAt > original.mergedAt : r.number > prNumber));
|
|
463
|
+
if (revert) {
|
|
464
|
+
cs.source = 'pr';
|
|
465
|
+
cs.blockers.push(blocker('pr-reverted', `PR #${prNumber} was reverted by PR #${revert.number} ("${revert.title}"); its change is not on the default branch.`, `cleo done ${task.id} --plan --pr <the PR that re-landed the work>`, 'A reverted PR cannot prove the task is implemented; name the PR that re-landed it.'));
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
const defaultRef = resolveOriginDefault(root);
|
|
469
|
+
const defaultBranch = defaultRef?.replace(/^origin\//, '') ?? null;
|
|
470
|
+
const detail = await deps.viewPr(prNumber, root);
|
|
471
|
+
if (detail && defaultBranch && detail.baseRefName && detail.baseRefName !== defaultBranch) {
|
|
472
|
+
return deriveStackedChangeSet(cs, task.id, root, detail, defaultBranch, deps.findPrByHead);
|
|
473
|
+
}
|
|
474
|
+
const pr = resolved.get(prNumber) ?? (await deps.resolvePr(prNumber, roots));
|
|
475
|
+
if (!pr.ok) {
|
|
476
|
+
cs.source = 'pr';
|
|
477
|
+
const gitRoot = pr.codeName === 'E_EVIDENCE_GIT_ROOT';
|
|
478
|
+
cs.blockers.push(blocker(gitRoot ? 'git-root' : 'pr-unverified', `PR #${prNumber} cannot serve as evidence: ${pr.reason}`, gitRoot
|
|
479
|
+
? `CLEO_EVIDENCE_GIT_ROOT=<path to the repository> cleo done ${task.id} --plan`
|
|
480
|
+
: pr.codeName === 'E_EVIDENCE_TESTS_FAILED'
|
|
481
|
+
? `gh pr checks ${prNumber}`
|
|
482
|
+
: `gh pr view ${prNumber} --json state,baseRefName,mergeCommit`, gitRoot
|
|
483
|
+
? 'Declare the repository the evidence is about.'
|
|
484
|
+
: 'The existing pr: provenance check refused this PR. The task branch diff is used instead when the branch still exists; otherwise resolve the reason it names.', pr.codeName));
|
|
485
|
+
return gitRoot;
|
|
486
|
+
}
|
|
487
|
+
cs.source = 'pr';
|
|
488
|
+
cs.mergeCommitSha = pr.mergeCommitSha;
|
|
489
|
+
if (!hasCommit(root, pr.mergeCommitSha)) {
|
|
490
|
+
cs.blockers.push(blocker('merge-commit-missing', `Merge commit ${pr.mergeCommitSha.slice(0, 12)} of PR #${prNumber} is not in the local object store, so its files cannot be read.`, `git -C '${root}' fetch origin`, 'Evidence bytes are read from the merge commit, never from the working tree.'));
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
const { files, deleted } = mergeCommitChanges(root, pr.mergeCommitSha);
|
|
494
|
+
const prPaths = new Set(pr.changedPaths);
|
|
495
|
+
cs.files = prPaths.size > 0 ? files.filter((p) => prPaths.has(p)) : files;
|
|
496
|
+
// A PR shared by several tasks (batch `--pr`): each task's files: evidence
|
|
497
|
+
// names only the files it declared, when any of them is in the PR.
|
|
498
|
+
const declared = task.files ?? [];
|
|
499
|
+
if (declared.length > 0) {
|
|
500
|
+
const own = cs.files.filter((f) => diffIntersectsAc([f], declared));
|
|
501
|
+
if (own.length > 0)
|
|
502
|
+
cs.files = own;
|
|
503
|
+
}
|
|
504
|
+
cs.deletedFiles = deleted;
|
|
505
|
+
if (cs.files.length === 0) {
|
|
506
|
+
cs.blockers.push(blocker('no-change-set', `PR #${prNumber}'s merge commit leaves no surviving changed file to hash (deleted: ${deleted.length}).`, `cleo verify ${task.id} --gate implemented --evidence "pr:${prNumber};files:<a file the PR changed>"`, 'The implemented gate needs files evidence for an artifact the PR changed.'));
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
cs.implementedEvidence = `pr:${prNumber};files:${cs.files.join(',')}`;
|
|
510
|
+
return true;
|
|
511
|
+
}
|
|
512
|
+
/** Step 2 — the unmerged task branch or worktree. */
|
|
513
|
+
function deriveBranchChangeSet(cs, taskId) {
|
|
514
|
+
const root = cs.executionRoot;
|
|
515
|
+
const current = git(root, ['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
516
|
+
let headRef = null;
|
|
517
|
+
if (current && current !== 'HEAD' && citesTask(current, taskId))
|
|
518
|
+
headRef = 'HEAD';
|
|
519
|
+
else if (git(root, ['rev-parse', '--verify', '--quiet', `refs/heads/task/${taskId}`]) !== null)
|
|
520
|
+
headRef = `task/${taskId}`;
|
|
521
|
+
if (headRef === null)
|
|
522
|
+
return false;
|
|
523
|
+
const baseRef = resolveOriginDefault(root);
|
|
524
|
+
if (baseRef === null) {
|
|
525
|
+
cs.warnings.push(`No origin default branch in ${root}; the branch diff has no base.`);
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
const commitSha = git(root, ['rev-parse', headRef]);
|
|
529
|
+
const mergeBase = git(root, ['merge-base', baseRef, headRef]);
|
|
530
|
+
if (!commitSha || !mergeBase || commitSha === mergeBase)
|
|
531
|
+
return false;
|
|
532
|
+
cs.source = 'branch';
|
|
533
|
+
cs.headRef = headRef;
|
|
534
|
+
cs.baseRef = baseRef;
|
|
535
|
+
cs.mergeBase = mergeBase;
|
|
536
|
+
cs.commitSha = commitSha;
|
|
537
|
+
const { files, deleted } = parseNameStatus(git(root, ['diff', '--name-status', '--no-renames', mergeBase, commitSha]) ?? '');
|
|
538
|
+
cs.files = files;
|
|
539
|
+
cs.deletedFiles = deleted;
|
|
540
|
+
if (headRef === 'HEAD') {
|
|
541
|
+
const dirty = git(root, ['status', '--porcelain', '--untracked-files=no']);
|
|
542
|
+
if (dirty) {
|
|
543
|
+
cs.blockers.push(blocker('dirty-tree', `${root} has uncommitted tracked changes; evidence must describe a commit.`, `git -C '${root}' commit -am "<message>"`, 'Commit (or stash) the changes so the recorded commit is the code under test.'));
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
cs.implementedEvidence =
|
|
547
|
+
files.length > 0
|
|
548
|
+
? `commit:${commitSha};files:${files.join(',')}`
|
|
549
|
+
: `commit:${commitSha};note:${atomSafe(`removes ${deleted.length} file(s): ${deleted.join(' ')}`)}`;
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
/** Step 3 — the documentary path for research, spike and documentation tasks. */
|
|
553
|
+
async function deriveDocsChangeSet(cs, input, deps) {
|
|
554
|
+
const { task, storeRoot } = input;
|
|
555
|
+
if (classifyEvidenceTask({ task }) === 'code')
|
|
556
|
+
return false;
|
|
557
|
+
const refs = await deps.listTaskDocs(storeRoot, task.id);
|
|
558
|
+
const docs = [];
|
|
559
|
+
for (const ref of refs) {
|
|
560
|
+
const path = locateDocBytes(storeRoot, ref.sha256);
|
|
561
|
+
if (path && !docs.some((d) => d.path === path))
|
|
562
|
+
docs.push({ id: ref.id, slug: ref.slug, path });
|
|
563
|
+
}
|
|
564
|
+
const decisions = await deps.listTaskDecisions(storeRoot, task.id);
|
|
565
|
+
if (docs.length === 0 && decisions.length === 0)
|
|
566
|
+
return false;
|
|
567
|
+
cs.source = 'docs';
|
|
568
|
+
cs.docs = docs;
|
|
569
|
+
cs.decisions = decisions;
|
|
570
|
+
cs.files = docs.map((d) => d.path);
|
|
571
|
+
const names = docs.map((d) => d.slug ?? d.id.slice(0, 12));
|
|
572
|
+
const note = `note:${atomSafe(`Deliverable: ${names.length > 0 ? names.join(', ') : decisions.join(', ')}`)}`;
|
|
573
|
+
const files = cs.files.length > 0 ? `;files:${cs.files.join(',')}` : '';
|
|
574
|
+
if (decisions.length > 0) {
|
|
575
|
+
cs.implementedEvidence = `decision:${decisions[0]}${files};${note}`;
|
|
576
|
+
return true;
|
|
577
|
+
}
|
|
578
|
+
// GATE_EVIDENCE_REQUIREMENTS.implemented has no files+note alternative: a
|
|
579
|
+
// task with no commit proves `implemented` through a decision. Say so rather
|
|
580
|
+
// than plan an atom set the validator will refuse.
|
|
581
|
+
cs.implementedEvidence = `${files.slice(1)};${note}`;
|
|
582
|
+
cs.blockers.push(blocker('decision-missing', `${task.id} has attached docs but no accepted or proposed decision; without a commit, implemented needs decision+files.`, `cleo memory decision-store --decision "<what ${task.id} concluded>" --rationale "<why>" --linked-task ${task.id}`, 'A no-commit task proves implemented with its decision and the doc that records it.'));
|
|
583
|
+
return true;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Derive the implemented change set for a task. Read-only.
|
|
587
|
+
*
|
|
588
|
+
* @param input - Task, store root, invocation directory and optional `--pr`.
|
|
589
|
+
* @param deps - Injectable I/O; defaults to git, gh and the CLEO stores.
|
|
590
|
+
* @returns The change set, its provenance, the planned `implemented` atoms and
|
|
591
|
+
* any blockers. `source: 'none'` carries one `no-change-set` blocker.
|
|
592
|
+
* @example
|
|
593
|
+
* ```ts
|
|
594
|
+
* const cs = await deriveTaskChangeSet({ task, storeRoot: getProjectRoot() });
|
|
595
|
+
* if (cs.implementedEvidence) console.log(cs.implementedEvidence);
|
|
596
|
+
* ```
|
|
597
|
+
* @task T12624
|
|
598
|
+
*/
|
|
599
|
+
export async function deriveTaskChangeSet(input, deps = {}) {
|
|
600
|
+
const cwd = input.cwd ?? process.cwd(); // CWD-OK: invocation dir locates the worktree (gh#1220)
|
|
601
|
+
const { root, source } = resolveChangeSetRoot(input.storeRoot, input.task.id, cwd, deps.env ?? process.env);
|
|
602
|
+
const cs = emptyChangeSet(root, source);
|
|
603
|
+
const roots = { storeRoot: input.storeRoot, executionRoot: root };
|
|
604
|
+
if (await derivePrChangeSet(cs, input, roots, {
|
|
605
|
+
listMergedPrs: deps.listMergedPrs ?? defaultListMergedPrs,
|
|
606
|
+
resolvePr: deps.resolvePr ?? defaultResolvePr,
|
|
607
|
+
viewPr: deps.viewPr ?? defaultViewPr,
|
|
608
|
+
findPrByHead: deps.findPrByHead ?? defaultFindPrByHead,
|
|
609
|
+
}))
|
|
610
|
+
return cs;
|
|
611
|
+
// A PR the pr: validator refused does not end the search: the task branch
|
|
612
|
+
// still describes the work. The refusal survives as a warning when the
|
|
613
|
+
// branch answers, and as the blocker when it does not.
|
|
614
|
+
const refused = cs.blockers.filter((b) => b.code === 'pr-unverified');
|
|
615
|
+
if (deriveBranchChangeSet(cs, input.task.id)) {
|
|
616
|
+
if (refused.length > 0) {
|
|
617
|
+
cs.blockers = cs.blockers.filter((b) => b.code !== 'pr-unverified');
|
|
618
|
+
cs.warnings.push(...refused.map((b) => `${b.message} — derived from the task branch instead.`));
|
|
619
|
+
delete cs.prNumber;
|
|
620
|
+
}
|
|
621
|
+
return cs;
|
|
622
|
+
}
|
|
623
|
+
if (refused.length > 0)
|
|
624
|
+
return cs;
|
|
625
|
+
if (await deriveDocsChangeSet(cs, input, {
|
|
626
|
+
listTaskDocs: deps.listTaskDocs ?? defaultListTaskDocs,
|
|
627
|
+
listTaskDecisions: deps.listTaskDecisions ?? defaultListTaskDecisions,
|
|
628
|
+
}))
|
|
629
|
+
return cs;
|
|
630
|
+
const id = input.task.id;
|
|
631
|
+
cs.blockers.push(blocker('no-change-set', `No merged PR, task branch or attached document references ${id}.`, `git switch -c task/${id}`, `Commit the work on task/${id}, or pass --pr <n> if a PR that does not cite ${id} implements it.`));
|
|
632
|
+
return cs;
|
|
633
|
+
}
|
|
634
|
+
//# sourceMappingURL=change-set.js.map
|