@cleocode/core 2026.9.20 → 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/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 +527 -42
- 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/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 +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/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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-paths.d.ts","sourceRoot":"","sources":["../../src/tasks/evidence-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAwCH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,MAAM,GAAG,IAAI,CA0Bf;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnF"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portable paths for `files:` and `test-run:` evidence atoms (T12476).
|
|
3
|
+
*
|
|
4
|
+
* A project is identified by its `project_id` (ADR-094); its path is only a
|
|
5
|
+
* per-device hint. Evidence that stores an absolute path therefore breaks the
|
|
6
|
+
* moment the checkout moves (another device, another OS, a rename): the
|
|
7
|
+
* re-validation at `cleo complete` looks for `/mnt/projects/x/src/a.ts` and
|
|
8
|
+
* reports "File removed since verify" for a file that is present, unchanged,
|
|
9
|
+
* under the new root.
|
|
10
|
+
*
|
|
11
|
+
* Atoms therefore record, next to the path as supplied, the ABSOLUTE file
|
|
12
|
+
* that was hashed (`resolvedPath`). Re-validation reads that file whatever
|
|
13
|
+
* directory `cleo complete` runs from; a relative form would be re-resolved
|
|
14
|
+
* against the completing process's tree and could hash a different copy. A
|
|
15
|
+
* move is handled only at re-validation, when that absolute path is gone:
|
|
16
|
+
* {@link rebaseLegacyEvidencePath} maps it through a vanished, recorded
|
|
17
|
+
* checkout root of this project onto the live root.
|
|
18
|
+
*
|
|
19
|
+
* Rebasing never decides validity. It only chooses WHICH bytes to hash;
|
|
20
|
+
* the caller still compares them against the sha256 captured at verify time,
|
|
21
|
+
* so a rebased path pointing at different content fails exactly as a modified
|
|
22
|
+
* file does.
|
|
23
|
+
*
|
|
24
|
+
* @task T12476
|
|
25
|
+
* @epic T12468
|
|
26
|
+
* @adr ADR-094
|
|
27
|
+
*/
|
|
28
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
29
|
+
import { isAbsolute, join, relative, sep } from 'node:path';
|
|
30
|
+
import { readPortableProjectId } from '@cleocode/paths';
|
|
31
|
+
/** Resolve symlinks when the path exists; otherwise return it unchanged. */
|
|
32
|
+
function realOrSelf(path) {
|
|
33
|
+
try {
|
|
34
|
+
return realpathSync(path);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return path;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The path of `target` relative to `root`, in POSIX form, or `null` when the
|
|
42
|
+
* target is not strictly inside the root.
|
|
43
|
+
*/
|
|
44
|
+
function relativeInside(root, target) {
|
|
45
|
+
const rel = relative(root, target);
|
|
46
|
+
if (rel === '' || rel === '..' || rel.startsWith(`..${sep}`) || isAbsolute(rel))
|
|
47
|
+
return null;
|
|
48
|
+
return rel.split(sep).join('/');
|
|
49
|
+
}
|
|
50
|
+
/** Whether `target` resolves (through symlinks) strictly inside `root`. */
|
|
51
|
+
function staysInside(root, target) {
|
|
52
|
+
return relativeInside(realOrSelf(root), realOrSelf(target)) !== null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Split a path into segments on this platform's separators only: `/` on
|
|
56
|
+
* POSIX (where `\` is an ordinary file-name character), `\` and `/` on
|
|
57
|
+
* Windows.
|
|
58
|
+
*/
|
|
59
|
+
function pathSegments(path) {
|
|
60
|
+
const parts = sep === '\\' ? path.split(/[\\/]/) : path.split('/');
|
|
61
|
+
return parts.filter((s) => s.length > 0);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Map a legacy absolute evidence path onto the live project root.
|
|
65
|
+
*
|
|
66
|
+
* Rebasing happens ONLY through a recorded former checkout root of THIS
|
|
67
|
+
* project that no longer exists. There is no tail-matching heuristic: a file
|
|
68
|
+
* that moved or vanished inside a project that did NOT move is reported
|
|
69
|
+
* removed, never re-pointed at some other file that happens to share a name
|
|
70
|
+
* or a suffix.
|
|
71
|
+
*
|
|
72
|
+
* Returns `null` unless all of these hold:
|
|
73
|
+
*
|
|
74
|
+
* - the path is absolute, does not exist, and has no `.` / `..` segments;
|
|
75
|
+
* - a recorded root that is gone, and neither is nor nests with a live root,
|
|
76
|
+
* contains the path;
|
|
77
|
+
* - the same relative position exists under a live root, and its realpath
|
|
78
|
+
* stays inside that live root.
|
|
79
|
+
*
|
|
80
|
+
* The result is a candidate, not a verdict: the caller must still compare
|
|
81
|
+
* the bytes it reads against the recorded sha256.
|
|
82
|
+
*
|
|
83
|
+
* @param path - Path as stored in the atom.
|
|
84
|
+
* @param liveRoots - Live project roots (execution root first, store root second).
|
|
85
|
+
* @param recordedRoots - Checkout roots recorded for this project in the registry.
|
|
86
|
+
* @returns The absolute rebased path under a live root, or `null`.
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* // Project moved from /mnt/projects/app to /home/me/app:
|
|
90
|
+
* rebaseLegacyEvidencePath('/mnt/projects/app/src/a.ts', ['/home/me/app'], ['/mnt/projects/app']);
|
|
91
|
+
* // → '/home/me/app/src/a.ts'
|
|
92
|
+
* ```
|
|
93
|
+
* @task T12476
|
|
94
|
+
*/
|
|
95
|
+
export function rebaseLegacyEvidencePath(path, liveRoots, recordedRoots) {
|
|
96
|
+
if (!isAbsolute(path) || existsSync(path))
|
|
97
|
+
return null;
|
|
98
|
+
if (pathSegments(path).some((s) => s === '.' || s === '..'))
|
|
99
|
+
return null;
|
|
100
|
+
for (const oldRoot of recordedRoots) {
|
|
101
|
+
if (existsSync(oldRoot))
|
|
102
|
+
continue;
|
|
103
|
+
// A former checkout is never nested inside (or around) the live one; a
|
|
104
|
+
// "root" that overlaps a live root describes a move WITHIN the project.
|
|
105
|
+
if (liveRoots.some((live) => live === oldRoot ||
|
|
106
|
+
relativeInside(live, oldRoot) !== null ||
|
|
107
|
+
relativeInside(oldRoot, live) !== null)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const rel = relativeInside(oldRoot, path);
|
|
111
|
+
if (rel === null)
|
|
112
|
+
continue;
|
|
113
|
+
for (const root of liveRoots) {
|
|
114
|
+
const candidate = join(root, rel);
|
|
115
|
+
if (existsSync(candidate) && staysInside(root, candidate))
|
|
116
|
+
return candidate;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Former checkout roots recorded for the project at `storeRoot`.
|
|
123
|
+
*
|
|
124
|
+
* Read from the device-local path map (`nexus_project_paths`) by the
|
|
125
|
+
* project's portable id. Best-effort: a project without a valid
|
|
126
|
+
* `.cleo/project-id`, or a registry that cannot be opened, yields `[]`, and
|
|
127
|
+
* no rebase happens (there is no tail-matching fallback).
|
|
128
|
+
*
|
|
129
|
+
* @param storeRoot - The CLEO project root.
|
|
130
|
+
* @returns Absolute checkout roots of this project other than `storeRoot`.
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* const oldRoots = await loadRecordedProjectRoots(projectRoot);
|
|
134
|
+
* ```
|
|
135
|
+
* @task T12476
|
|
136
|
+
*/
|
|
137
|
+
export async function loadRecordedProjectRoots(storeRoot) {
|
|
138
|
+
const identity = readPortableProjectId(storeRoot);
|
|
139
|
+
if (identity.status !== 'valid')
|
|
140
|
+
return [];
|
|
141
|
+
try {
|
|
142
|
+
const { listProjectCheckouts } = await import('../nexus/path-map.js');
|
|
143
|
+
const checkouts = await listProjectCheckouts(identity.projectId);
|
|
144
|
+
return checkouts.map((c) => c.projectPath).filter((p) => p !== storeRoot);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=evidence-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-paths.js","sourceRoot":"","sources":["../../src/tasks/evidence-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD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,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACjE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IAC5E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/tasks/evidence.d.ts
CHANGED
|
@@ -157,6 +157,16 @@ export type ParsedAtom = {
|
|
|
157
157
|
kind: 'pr';
|
|
158
158
|
/** PR number (positive integer). */
|
|
159
159
|
prNumber: number;
|
|
160
|
+
} | {
|
|
161
|
+
/**
|
|
162
|
+
* Merge-commit CI atom — required checks green on a merged PR's merge
|
|
163
|
+
* commit (D11149). Accepted only with `evidence.ciSatisfies`.
|
|
164
|
+
*
|
|
165
|
+
* @task T12634
|
|
166
|
+
*/
|
|
167
|
+
kind: 'ci';
|
|
168
|
+
/** PR number (positive integer). */
|
|
169
|
+
prNumber: number;
|
|
160
170
|
} | {
|
|
161
171
|
/**
|
|
162
172
|
* Cross-task AC-binding atom — references an acceptance criterion on
|
|
@@ -532,6 +542,51 @@ export declare function checkEngineMigrationLocDrop(atoms: EvidenceAtom[], minRe
|
|
|
532
542
|
* @task T1605
|
|
533
543
|
*/
|
|
534
544
|
export declare const CALLSITE_COVERAGE_LABEL = "callsite-coverage";
|
|
545
|
+
/**
|
|
546
|
+
* The task linkage `pr:` provenance requires, shared with `ci:<pr>` (T12634):
|
|
547
|
+
* the PR's changed-file inventory is complete, and the PR either cites the
|
|
548
|
+
* task in its title, body or head branch, or its diff intersects the task's
|
|
549
|
+
* declared files — and when files are declared, the diff MUST intersect them.
|
|
550
|
+
*
|
|
551
|
+
* @param prNumber - The PR being linked.
|
|
552
|
+
* @param pr - The verified PR (title, body, head branch, changed files).
|
|
553
|
+
* @param context - The task the evidence is being recorded for.
|
|
554
|
+
* @returns The refusal, or null when the PR is linked to the task.
|
|
555
|
+
* @task T12634
|
|
556
|
+
*/
|
|
557
|
+
export declare function checkPrTaskLinkage(prNumber: number, pr: {
|
|
558
|
+
title: string;
|
|
559
|
+
body: string;
|
|
560
|
+
headRefName: string;
|
|
561
|
+
changedPaths: string[];
|
|
562
|
+
changedFileCount: number;
|
|
563
|
+
changedFilesError?: string;
|
|
564
|
+
}, context: EvidenceValidationContext): {
|
|
565
|
+
ok: false;
|
|
566
|
+
reason: string;
|
|
567
|
+
codeName: string;
|
|
568
|
+
} | null;
|
|
569
|
+
/**
|
|
570
|
+
* Whether a path is a documentation artifact (`.md`/`.mdx`/`.rst`/`.adoc`/`.txt`,
|
|
571
|
+
* README, LICENSE, CHANGELOG) — the rule `pr:` uses to refuse a docs-only PR
|
|
572
|
+
* as implementation of a code task.
|
|
573
|
+
*
|
|
574
|
+
* @param path - Repo-relative path.
|
|
575
|
+
* @returns True for a documentation artifact.
|
|
576
|
+
*/
|
|
577
|
+
export declare function isDocumentArtifact(path: string): boolean;
|
|
578
|
+
/**
|
|
579
|
+
* Classify a task for evidence purposes: `research` (research/spike kind),
|
|
580
|
+
* `documentation` (docs-only declared files or a docs label) or `code`.
|
|
581
|
+
*
|
|
582
|
+
* Exported so the read-only `cleo done --plan` planner chooses the same
|
|
583
|
+
* documentary path the validators accept — one classification, not two.
|
|
584
|
+
*
|
|
585
|
+
* @param context - Task context; only `task` is read.
|
|
586
|
+
* @returns The evidence classification.
|
|
587
|
+
* @task T12624
|
|
588
|
+
*/
|
|
589
|
+
export declare function classifyEvidenceTask(context: Pick<EvidenceValidationContext, 'task'>): 'code' | 'documentation' | 'research';
|
|
535
590
|
/**
|
|
536
591
|
* Require explicit criterion linkage to inspected artifacts and real gate results.
|
|
537
592
|
* @param context - Current task classification, requested gates and criterion records.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../src/tasks/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,YAAY,EAEZ,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../src/tasks/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,YAAY,EAEZ,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AA6B7B,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAGnB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAAwC,CAAC;AAElF;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAqB,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAS7B,CAAC;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAMrD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAA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
29
29
|
import { describeUnusableEvidenceGitRoot, E_EVIDENCE_GIT_ROOT, findNestedGitWorkTrees, findWorkTreeContainingCommit, gitToplevel, isGitWorkTree, resolveDeclaredEvidenceGitRoot, } from '../git/work-tree.js';
|
|
30
30
|
import { pushWarning } from '../output.js';
|
|
31
31
|
import { getEffectiveHead } from '../worktree/effective-head.js';
|
|
32
|
+
import { loadRecordedProjectRoots, rebaseLegacyEvidencePath } from './evidence-paths.js';
|
|
32
33
|
import { DISABLE_ENV, describeMemoryLimit } from './heavy-tool-limit.js';
|
|
33
34
|
import { computeCommitRevalidationKey, readCommitRevalidationEntry, writeCommitRevalidationEntry, } from './revalidation-cache.js';
|
|
34
35
|
import { resolveSpawnTimeoutMs, runToolCached } from './tool-cache.js';
|
|
35
36
|
import { CANONICAL_TOOLS, listValidToolNames, resolveToolCommand, } from './tool-resolver.js';
|
|
37
|
+
import { detectStaticVacuity, probeTscFileCount, VACUOUS_TOOL_FIX } from './tool-vacuity.js';
|
|
36
38
|
/**
|
|
37
39
|
* Valid tool names recognised by the `tool:<name>` evidence atom.
|
|
38
40
|
*
|
|
@@ -218,6 +220,20 @@ siblingCommitSha, context) {
|
|
|
218
220
|
return validateDecision(parsed.decisionId, roots);
|
|
219
221
|
case 'pr':
|
|
220
222
|
return validatePrAtom(parsed.prNumber, roots, context);
|
|
223
|
+
case 'ci': {
|
|
224
|
+
// T12634 (D11149): `gh` runs in the repo (executionRoot); the opt-in,
|
|
225
|
+
// required-check list and PR cache are CLEO's own records (storeRoot).
|
|
226
|
+
const { resolveCiEvidenceAtom } = await import('../release/ci-evidence.js');
|
|
227
|
+
const { loadProjectContext } = await import('../agents/variable-substitution.js');
|
|
228
|
+
const ctx = loadProjectContext(roots.storeRoot);
|
|
229
|
+
const result = await resolveCiEvidenceAtom(parsed.prNumber, roots, {
|
|
230
|
+
projectContext: ctx.loaded ? ctx.context : null,
|
|
231
|
+
...(context ? { context } : {}),
|
|
232
|
+
});
|
|
233
|
+
return result.ok
|
|
234
|
+
? { ok: true, atom: result.atom }
|
|
235
|
+
: { ok: false, reason: result.reason, codeName: result.codeName };
|
|
236
|
+
}
|
|
221
237
|
case 'satisfies': {
|
|
222
238
|
// ADR-079-r2: 5-check validator pipeline shipped by T10507.
|
|
223
239
|
// Delegates to the dedicated validator module to keep the dispatch
|
|
@@ -1012,6 +1028,14 @@ async function gitShowFileContent(relPath, taskId, projectRoot) {
|
|
|
1012
1028
|
// Normalise the path: strip leading "./" so git:show works correctly.
|
|
1013
1029
|
const norm = relPath.replace(/^\.\//, '');
|
|
1014
1030
|
// Try task/<taskId> first, then main, then master, then HEAD.
|
|
1031
|
+
//
|
|
1032
|
+
// Ref order is unchanged since T11959 and is identical at verify and at
|
|
1033
|
+
// re-validation. This fallback runs only when the file is absent from disk,
|
|
1034
|
+
// so it answers "does the branch the work was verified on still carry these
|
|
1035
|
+
// bytes?". A tamper committed to main while task/<id> stays pristine is NOT
|
|
1036
|
+
// detected here: that is a change to a different ref, and it surfaces on
|
|
1037
|
+
// disk (checked first) wherever main is checked out. API callers passing a
|
|
1038
|
+
// taskId get this order; `cleo complete` passes none.
|
|
1015
1039
|
const refs = [`task/${taskId}`, 'main', 'master', 'HEAD'];
|
|
1016
1040
|
for (const ref of refs) {
|
|
1017
1041
|
const r = await runCommand('git', ['show', `${ref}:${norm}`], projectRoot);
|
|
@@ -1116,6 +1140,7 @@ async function validateFiles(paths, roots, taskId, commitSha, requireCommitArtif
|
|
|
1116
1140
|
reason: `Cannot inspect ${p} at PR merge ${commitSha}; fetch that commit before recording evidence. Current checkout bytes cannot substitute.`,
|
|
1117
1141
|
};
|
|
1118
1142
|
}
|
|
1143
|
+
let readFromDisk = false;
|
|
1119
1144
|
if (content === null && existsSync(abs)) {
|
|
1120
1145
|
// Happy path — file exists on disk.
|
|
1121
1146
|
const st = await stat(abs);
|
|
@@ -1127,6 +1152,7 @@ async function validateFiles(paths, roots, taskId, commitSha, requireCommitArtif
|
|
|
1127
1152
|
};
|
|
1128
1153
|
}
|
|
1129
1154
|
content = await readFile(abs);
|
|
1155
|
+
readFromDisk = true;
|
|
1130
1156
|
}
|
|
1131
1157
|
if (content === null && taskId) {
|
|
1132
1158
|
// T11959: Git-show fallback for branch-only files (worktree context).
|
|
@@ -1151,10 +1177,51 @@ async function validateFiles(paths, roots, taskId, commitSha, requireCommitArtif
|
|
|
1151
1177
|
};
|
|
1152
1178
|
}
|
|
1153
1179
|
const sha256 = createHash('sha256').update(content).digest('hex');
|
|
1154
|
-
|
|
1180
|
+
// T12476: `path` stays exactly as supplied (consumers match it against
|
|
1181
|
+
// repo-relative PR paths). When the bytes came from disk, the absolute
|
|
1182
|
+
// file that was hashed is recorded too, so re-validation reads THAT file
|
|
1183
|
+
// whatever directory `cleo complete` runs from. `resolvedPath` is a
|
|
1184
|
+
// DEVICE-LOCAL hint (an absolute path on this device) and is never
|
|
1185
|
+
// authoritative across devices; re-validation falls back when it is gone.
|
|
1186
|
+
files.push(readFromDisk ? { path: p, sha256, resolvedPath: abs } : { path: p, sha256 });
|
|
1155
1187
|
}
|
|
1156
1188
|
return { ok: true, atom: { kind: 'files', files } };
|
|
1157
1189
|
}
|
|
1190
|
+
/**
|
|
1191
|
+
* `tool:test-affected` (D11150, T12635): run `testing.affectedCommand` over the
|
|
1192
|
+
* packages the branch diff touches plus their dependents, through the same
|
|
1193
|
+
* ADR-061 cache and heavy-tool caps as `tool:test` (canonical `test`, so the
|
|
1194
|
+
* memory and timeout limits apply). The atom records `scope: 'affected'` and
|
|
1195
|
+
* the packages, so a receipt never passes for a full run.
|
|
1196
|
+
*/
|
|
1197
|
+
async function validateAffectedTests(roots) {
|
|
1198
|
+
const { storeRoot, executionRoot } = roots;
|
|
1199
|
+
const { planAffectedTestRun } = await import('./affected-packages.js');
|
|
1200
|
+
const run = await planAffectedTestRun(storeRoot, executionRoot);
|
|
1201
|
+
if (!run.ok)
|
|
1202
|
+
return { ok: false, codeName: run.codeName, reason: run.reason };
|
|
1203
|
+
const result = await runToolCached(run.command, storeRoot, { executionRoot });
|
|
1204
|
+
if (result.exitCode !== 0) {
|
|
1205
|
+
return {
|
|
1206
|
+
ok: false,
|
|
1207
|
+
codeName: result.timedOut ? 'E_EVIDENCE_TOOL_TIMEOUT' : 'E_EVIDENCE_TOOL_FAILED',
|
|
1208
|
+
reason: `tool:test-affected (${[run.command.cmd, ...run.command.args].join(' ')}) exited ${result.exitCode}: ${(result.stderrTail || result.stdoutTail).trim().slice(-300)}`,
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
return {
|
|
1212
|
+
ok: true,
|
|
1213
|
+
atom: {
|
|
1214
|
+
kind: 'tool',
|
|
1215
|
+
tool: 'test-affected',
|
|
1216
|
+
exitCode: 0,
|
|
1217
|
+
stdoutTail: result.stdoutTail,
|
|
1218
|
+
scope: 'affected',
|
|
1219
|
+
affectedPackages: run.packages,
|
|
1220
|
+
affectedProjects: run.projects,
|
|
1221
|
+
...(run.untested.length > 0 ? { untestedPackages: run.untested } : {}),
|
|
1222
|
+
},
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1158
1225
|
/**
|
|
1159
1226
|
* Resolve the tree that evidence tools should RUN in, given the CLEO store
|
|
1160
1227
|
* root.
|
|
@@ -1351,7 +1418,11 @@ async function validateTestRun(path, roots) {
|
|
|
1351
1418
|
ok: true,
|
|
1352
1419
|
atom: {
|
|
1353
1420
|
kind: 'test-run',
|
|
1421
|
+
// T12476: `path` exactly as supplied; `resolvedPath` is the report that
|
|
1422
|
+
// was hashed, which re-validation reads regardless of cwd. DEVICE-LOCAL:
|
|
1423
|
+
// an absolute path on this device, never authoritative cross-device.
|
|
1354
1424
|
path,
|
|
1425
|
+
resolvedPath: abs,
|
|
1355
1426
|
sha256,
|
|
1356
1427
|
passCount: passed,
|
|
1357
1428
|
failCount: failed,
|
|
@@ -1360,8 +1431,12 @@ async function validateTestRun(path, roots) {
|
|
|
1360
1431
|
};
|
|
1361
1432
|
}
|
|
1362
1433
|
async function validateTool(tool, roots) {
|
|
1434
|
+
if (tool === 'test-affected')
|
|
1435
|
+
return validateAffectedTests(roots);
|
|
1363
1436
|
const { storeRoot: projectRoot, executionRoot } = roots;
|
|
1364
|
-
|
|
1437
|
+
// T12633: project-context lives in the store; package.json scripts and
|
|
1438
|
+
// tsconfig describe the code under test, so they are read where it runs.
|
|
1439
|
+
const resolution = resolveToolCommand(tool, projectRoot, { executionRoot });
|
|
1365
1440
|
// T12083: the project has no such toolchain. This is a fact about the
|
|
1366
1441
|
// project, not a failure of the work — a plain JavaScript project cannot
|
|
1367
1442
|
// typecheck, and demanding it means no task in that project can ever be
|
|
@@ -1388,6 +1463,18 @@ async function validateTool(tool, roots) {
|
|
|
1388
1463
|
: 'E_EVIDENCE_TOOL_UNAVAILABLE',
|
|
1389
1464
|
};
|
|
1390
1465
|
}
|
|
1466
|
+
// T12633: a checker that provably checks nothing is not evidence. Decided
|
|
1467
|
+
// BEFORE the cache lookup, so a pass cached for the vacuous command (every
|
|
1468
|
+
// `npx tsc --noEmit` against a references-only tsconfig) is never served.
|
|
1469
|
+
const staticVacuity = detectStaticVacuity(resolution.command, executionRoot);
|
|
1470
|
+
if (staticVacuity !== null) {
|
|
1471
|
+
return {
|
|
1472
|
+
ok: false,
|
|
1473
|
+
reason: `Tool "${tool}" → ${resolution.command.cmd} ${resolution.command.args.join(' ')} ` +
|
|
1474
|
+
`(${resolution.command.source}) is VACUOUS: ${staticVacuity} Fix: ${VACUOUS_TOOL_FIX}`,
|
|
1475
|
+
codeName: 'E_EVIDENCE_TOOL_VACUOUS',
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1391
1478
|
// gh#1220/#1226/#1230: spawn in — and fingerprint against — the tree the
|
|
1392
1479
|
// operator actually invoked from, not the shared store root. gh#1365: the
|
|
1393
1480
|
// root arrives as a parameter now; it is NOT re-resolved here.
|
|
@@ -1489,6 +1576,17 @@ async function validateTool(tool, roots) {
|
|
|
1489
1576
|
codeName: 'E_EVIDENCE_TOOL_FAILED',
|
|
1490
1577
|
};
|
|
1491
1578
|
}
|
|
1579
|
+
// T12633: exit 0 from a direct `tsc` run is only a pass if it compiled
|
|
1580
|
+
// something. `--listFilesOnly` answers that without re-checking.
|
|
1581
|
+
if (probeTscFileCount(resolution.command, result.executionRoot) === 0) {
|
|
1582
|
+
return {
|
|
1583
|
+
ok: false,
|
|
1584
|
+
reason: `Tool "${tool}" → ${resolution.command.cmd} ${resolution.command.args.join(' ')} ` +
|
|
1585
|
+
`exited 0 but is VACUOUS: \`--listFilesOnly\` reports 0 project files in ` +
|
|
1586
|
+
`${result.executionRoot}, so it checked nothing. Fix: ${VACUOUS_TOOL_FIX}`,
|
|
1587
|
+
codeName: 'E_EVIDENCE_TOOL_VACUOUS',
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1492
1590
|
return {
|
|
1493
1591
|
ok: true,
|
|
1494
1592
|
atom: { kind: 'tool', tool, exitCode: 0, stdoutTail: result.stdoutTail },
|
|
@@ -1808,6 +1906,39 @@ async function validateDecision(decisionId, roots) {
|
|
|
1808
1906
|
// ---------------------------------------------------------------------------
|
|
1809
1907
|
// PR atom (T9764)
|
|
1810
1908
|
// ---------------------------------------------------------------------------
|
|
1909
|
+
/**
|
|
1910
|
+
* The task linkage `pr:` provenance requires, shared with `ci:<pr>` (T12634):
|
|
1911
|
+
* the PR's changed-file inventory is complete, and the PR either cites the
|
|
1912
|
+
* task in its title, body or head branch, or its diff intersects the task's
|
|
1913
|
+
* declared files — and when files are declared, the diff MUST intersect them.
|
|
1914
|
+
*
|
|
1915
|
+
* @param prNumber - The PR being linked.
|
|
1916
|
+
* @param pr - The verified PR (title, body, head branch, changed files).
|
|
1917
|
+
* @param context - The task the evidence is being recorded for.
|
|
1918
|
+
* @returns The refusal, or null when the PR is linked to the task.
|
|
1919
|
+
* @task T12634
|
|
1920
|
+
*/
|
|
1921
|
+
export function checkPrTaskLinkage(prNumber, pr, context) {
|
|
1922
|
+
if (pr.changedFileCount !== pr.changedPaths.length || pr.changedPaths.length === 0) {
|
|
1923
|
+
return {
|
|
1924
|
+
ok: false,
|
|
1925
|
+
codeName: 'E_EVIDENCE_INSUFFICIENT',
|
|
1926
|
+
reason: `PR #${prNumber} changed-file coverage is incomplete or empty (${pr.changedPaths.length}/${pr.changedFileCount})${pr.changedFilesError ? ` — ${pr.changedFilesError}` : ''}; inspect the full diff before recording evidence.`,
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
const declaredFiles = context.task.files ?? [];
|
|
1930
|
+
const taskMention = new RegExp(`(^|[^A-Za-z0-9])${context.task.id}([^A-Za-z0-9]|$)`);
|
|
1931
|
+
const explicitlyLinked = taskMention.test(`${pr.title}\n${pr.body}\n${pr.headRefName}`);
|
|
1932
|
+
const scopeIntersects = declaredFiles.length > 0 && diffIntersectsAc(pr.changedPaths, declaredFiles);
|
|
1933
|
+
if ((!explicitlyLinked && !scopeIntersects) || (declaredFiles.length > 0 && !scopeIntersects)) {
|
|
1934
|
+
return {
|
|
1935
|
+
ok: false,
|
|
1936
|
+
codeName: 'E_EVIDENCE_CONTENT_MISMATCH',
|
|
1937
|
+
reason: `PR #${prNumber} does not establish a relationship to task ${context.task.id}. Changed artifacts: ${pr.changedPaths.join(', ')}. Declare task files or cite the exact task in the PR; declared scope must intersect the diff.`,
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
return null;
|
|
1941
|
+
}
|
|
1811
1942
|
/**
|
|
1812
1943
|
* Validate a `pr:<number>` atom by resolving the PR via the `gh` CLI.
|
|
1813
1944
|
*
|
|
@@ -1852,24 +1983,9 @@ async function validatePrAtom(prNumber, roots, context) {
|
|
|
1852
1983
|
if (!result.ok) {
|
|
1853
1984
|
return { ok: false, reason: result.reason, codeName: result.codeName };
|
|
1854
1985
|
}
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
codeName: 'E_EVIDENCE_INSUFFICIENT',
|
|
1859
|
-
reason: `PR #${prNumber} changed-file coverage is incomplete or empty (${result.changedPaths.length}/${result.changedFileCount})${result.changedFilesError ? ` — ${result.changedFilesError}` : ''}; inspect the full diff before recording evidence.`,
|
|
1860
|
-
};
|
|
1861
|
-
}
|
|
1862
|
-
const declaredFiles = context.task.files ?? [];
|
|
1863
|
-
const taskMention = new RegExp(`(^|[^A-Za-z0-9])${context.task.id}([^A-Za-z0-9]|$)`);
|
|
1864
|
-
const explicitlyLinked = taskMention.test(`${result.title}\n${result.body}\n${result.headRefName}`);
|
|
1865
|
-
const scopeIntersects = declaredFiles.length > 0 && diffIntersectsAc(result.changedPaths, declaredFiles);
|
|
1866
|
-
if ((!explicitlyLinked && !scopeIntersects) || (declaredFiles.length > 0 && !scopeIntersects)) {
|
|
1867
|
-
return {
|
|
1868
|
-
ok: false,
|
|
1869
|
-
codeName: 'E_EVIDENCE_CONTENT_MISMATCH',
|
|
1870
|
-
reason: `PR #${prNumber} does not establish a relationship to task ${context.task.id}. Changed artifacts: ${result.changedPaths.join(', ')}. Declare task files or cite the exact task in the PR; declared scope must intersect the diff.`,
|
|
1871
|
-
};
|
|
1872
|
-
}
|
|
1986
|
+
const unlinked = checkPrTaskLinkage(prNumber, result, context);
|
|
1987
|
+
if (unlinked)
|
|
1988
|
+
return unlinked;
|
|
1873
1989
|
if (context.gates.includes('implemented') &&
|
|
1874
1990
|
classifyEvidenceTask(context) === 'code' &&
|
|
1875
1991
|
result.changedPaths.every(isDocumentArtifact)) {
|
|
@@ -1893,11 +2009,30 @@ async function validatePrAtom(prNumber, roots, context) {
|
|
|
1893
2009
|
},
|
|
1894
2010
|
};
|
|
1895
2011
|
}
|
|
1896
|
-
|
|
2012
|
+
/**
|
|
2013
|
+
* Whether a path is a documentation artifact (`.md`/`.mdx`/`.rst`/`.adoc`/`.txt`,
|
|
2014
|
+
* README, LICENSE, CHANGELOG) — the rule `pr:` uses to refuse a docs-only PR
|
|
2015
|
+
* as implementation of a code task.
|
|
2016
|
+
*
|
|
2017
|
+
* @param path - Repo-relative path.
|
|
2018
|
+
* @returns True for a documentation artifact.
|
|
2019
|
+
*/
|
|
2020
|
+
export function isDocumentArtifact(path) {
|
|
1897
2021
|
return (/\.(md|mdx|rst|adoc|txt)$/i.test(path) ||
|
|
1898
2022
|
/(?:^|\/)(README|LICENSE|CHANGELOG)(?:\.[^/]*)?$/i.test(path));
|
|
1899
2023
|
}
|
|
1900
|
-
|
|
2024
|
+
/**
|
|
2025
|
+
* Classify a task for evidence purposes: `research` (research/spike kind),
|
|
2026
|
+
* `documentation` (docs-only declared files or a docs label) or `code`.
|
|
2027
|
+
*
|
|
2028
|
+
* Exported so the read-only `cleo done --plan` planner chooses the same
|
|
2029
|
+
* documentary path the validators accept — one classification, not two.
|
|
2030
|
+
*
|
|
2031
|
+
* @param context - Task context; only `task` is read.
|
|
2032
|
+
* @returns The evidence classification.
|
|
2033
|
+
* @task T12624
|
|
2034
|
+
*/
|
|
2035
|
+
export function classifyEvidenceTask(context) {
|
|
1901
2036
|
if (context.task.kind === 'research' || context.task.kind === 'spike')
|
|
1902
2037
|
return 'research';
|
|
1903
2038
|
if (context.task.files?.length && context.task.files.every(isDocumentArtifact))
|
|
@@ -1922,6 +2057,9 @@ function classifyEvidenceTask(context) {
|
|
|
1922
2057
|
*/
|
|
1923
2058
|
export function checkTaskEvidenceContext(context, gate, atoms) {
|
|
1924
2059
|
const filePaths = atoms.flatMap((atom) => atom.kind === 'files' ? atom.files.map((file) => file.path) : []);
|
|
2060
|
+
// T12634: a `ci:` result is bound to the task it was validated for, like `pr:`.
|
|
2061
|
+
if (atoms.some((atom) => atom.kind === 'ci' && atom.taskId !== context.task.id))
|
|
2062
|
+
return 'CI evidence lacks verified task linkage; re-verify with current task context.';
|
|
1925
2063
|
const prAtoms = atoms.filter((atom) => atom.kind === 'pr');
|
|
1926
2064
|
if (prAtoms.length > 1)
|
|
1927
2065
|
return 'Record one PR and its merge-pinned artifacts per verification attempt; multiple merge identities are ambiguous.';
|
|
@@ -1939,7 +2077,9 @@ export function checkTaskEvidenceContext(context, gate, atoms) {
|
|
|
1939
2077
|
return null;
|
|
1940
2078
|
if (classifyEvidenceTask(context) === 'code' &&
|
|
1941
2079
|
(gate === 'testsPassed' || gate === 'qaPassed') &&
|
|
1942
|
-
!atoms.some((atom) => atom.kind === 'test-run' ||
|
|
2080
|
+
!atoms.some((atom) => atom.kind === 'test-run' ||
|
|
2081
|
+
atom.kind === 'ci' ||
|
|
2082
|
+
(atom.kind === 'tool' && !atom.notApplicable))) {
|
|
1943
2083
|
return `Code task ${context.task.id} requires an actual verification result for ${gate}; absence of a toolchain is not a passing result.`;
|
|
1944
2084
|
}
|
|
1945
2085
|
const linked = atoms.filter((atom) => atom.kind === 'satisfies' && atom.targetTaskId === context.task.id);
|
|
@@ -2130,7 +2270,7 @@ export function composeGateEvidence(atoms, capturedBy, override, overrideReason,
|
|
|
2130
2270
|
return atom.kind === 'commit' || atom.kind === 'pr' || atom.kind === 'decision'
|
|
2131
2271
|
? [index]
|
|
2132
2272
|
: [];
|
|
2133
|
-
return atom.kind === 'tool' || atom.kind === 'test-run' ? [index] : [];
|
|
2273
|
+
return atom.kind === 'tool' || atom.kind === 'test-run' || atom.kind === 'ci' ? [index] : [];
|
|
2134
2274
|
});
|
|
2135
2275
|
result.scope = {
|
|
2136
2276
|
taskId: context.task.id,
|
|
@@ -2187,6 +2327,46 @@ export const CRITICAL_GATES_NO_OVERRIDE = Object.freeze([
|
|
|
2187
2327
|
export function isHardAtom(atom) {
|
|
2188
2328
|
return atom.kind !== 'override' && atom.kind !== 'note' && atom.kind !== 'url';
|
|
2189
2329
|
}
|
|
2330
|
+
/**
|
|
2331
|
+
* The on-disk file re-validation should hash for a `files:` / `test-run:`
|
|
2332
|
+
* entry.
|
|
2333
|
+
*
|
|
2334
|
+
* 1. `resolvedPath`, when it still exists. It pins the file attested at verify
|
|
2335
|
+
* time, independent of the completing process's cwd.
|
|
2336
|
+
* 2. The first candidate that is gone (`resolvedPath`, else `mainResolution`),
|
|
2337
|
+
* rebased through a vanished, recorded checkout root of this project.
|
|
2338
|
+
* 3. `mainResolution`: how the atom resolved before T12476. It covers a
|
|
2339
|
+
* verified worktree that was removed after merge.
|
|
2340
|
+
*
|
|
2341
|
+
* This only chooses bytes; the caller's sha256 comparison is the verdict.
|
|
2342
|
+
*
|
|
2343
|
+
* @internal
|
|
2344
|
+
* @task T12476
|
|
2345
|
+
*/
|
|
2346
|
+
async function resolveAttestedPath(resolvedPath, mainResolution, executionRoot, storeRoot) {
|
|
2347
|
+
if (resolvedPath !== undefined && existsSync(resolvedPath))
|
|
2348
|
+
return resolvedPath;
|
|
2349
|
+
const pinned = resolvedPath ?? mainResolution;
|
|
2350
|
+
const rebased = await rebaseForRevalidation(pinned, executionRoot, storeRoot);
|
|
2351
|
+
if (rebased !== null)
|
|
2352
|
+
return rebased;
|
|
2353
|
+
return mainResolution;
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* Rebase a legacy absolute evidence path whose checkout moved onto the live
|
|
2357
|
+
* root. Returns the absolute rebased path, or `null` when the path is
|
|
2358
|
+
* relative, still exists, or cannot be mapped safely (see
|
|
2359
|
+
* {@link rebaseLegacyEvidencePath} for the guards).
|
|
2360
|
+
*
|
|
2361
|
+
* @internal
|
|
2362
|
+
* @task T12476
|
|
2363
|
+
*/
|
|
2364
|
+
async function rebaseForRevalidation(path, executionRoot, storeRoot) {
|
|
2365
|
+
if (!isAbsolute(path) || existsSync(path))
|
|
2366
|
+
return null;
|
|
2367
|
+
const recordedRoots = await loadRecordedProjectRoots(storeRoot);
|
|
2368
|
+
return rebaseLegacyEvidencePath(path, [executionRoot, storeRoot], recordedRoots);
|
|
2369
|
+
}
|
|
2190
2370
|
/**
|
|
2191
2371
|
* Re-validate stored evidence to detect tampering between verify and complete.
|
|
2192
2372
|
*
|
|
@@ -2318,7 +2498,17 @@ export async function revalidateEvidence(evidence, projectRoot, gate, taskId, op
|
|
|
2318
2498
|
const siblingCommitSha = siblingPr?.mergeCommitSha ?? siblingCommit?.sha;
|
|
2319
2499
|
const executionRoot = resolveEvidenceExecutionRoot(projectRoot, undefined, siblingCommitSha === undefined ? {} : { commitSha: siblingCommitSha });
|
|
2320
2500
|
for (const f of atom.files) {
|
|
2321
|
-
|
|
2501
|
+
// T12476: read the file hashed at verify time, in this order:
|
|
2502
|
+
// 1. `resolvedPath` — pins the attested file regardless of cwd;
|
|
2503
|
+
// 2. that path rebased through a vanished recorded project root;
|
|
2504
|
+
// 3. main's resolution of `path` (execution root). This covers the
|
|
2505
|
+
// ADR-055 lifecycle — verify in a worktree, remove it after
|
|
2506
|
+
// merge, complete from main — where the pinned file is gone but
|
|
2507
|
+
// the merged copy is present.
|
|
2508
|
+
// Every step only chooses which bytes to hash; the sha256 comparison
|
|
2509
|
+
// below decides, so none of them can pass a modified file.
|
|
2510
|
+
const mainResolution = isAbsolute(f.path) ? f.path : resolvePath(executionRoot, f.path);
|
|
2511
|
+
const abs = await resolveAttestedPath(f.resolvedPath, mainResolution, executionRoot, projectRoot);
|
|
2322
2512
|
let content = null;
|
|
2323
2513
|
if (siblingCommitSha) {
|
|
2324
2514
|
content = await gitShowFileContentAtCommit(f.path, siblingCommitSha, executionRoot);
|
|
@@ -2360,7 +2550,10 @@ export async function revalidateEvidence(evidence, projectRoot, gate, taskId, op
|
|
|
2360
2550
|
// Deliberately NOT cached (T12102): same reasoning as files: — the
|
|
2361
2551
|
// content hash comparison IS the staleness guarantee.
|
|
2362
2552
|
const startedAt = Date.now();
|
|
2363
|
-
|
|
2553
|
+
// T12476: same order as `files:` — pinned `resolvedPath`, then a
|
|
2554
|
+
// rebase through a vanished recorded root, then main's store-root
|
|
2555
|
+
// resolution of `path`. The sha256 comparison below decides.
|
|
2556
|
+
const abs = await resolveAttestedPath(atom.resolvedPath, isAbsolute(atom.path) ? atom.path : resolvePath(projectRoot, atom.path), resolveEvidenceExecutionRoot(projectRoot), projectRoot);
|
|
2364
2557
|
if (!existsSync(abs)) {
|
|
2365
2558
|
failed.push({ atom, reason: `test-run file removed since verify: ${atom.path}` });
|
|
2366
2559
|
options?.onProgress?.(`test-run:${atom.path} FAILED ${Date.now() - startedAt}ms`);
|
|
@@ -2394,6 +2587,10 @@ export async function revalidateEvidence(evidence, projectRoot, gate, taskId, op
|
|
|
2394
2587
|
// once accepted/proposed. Re-validation is not performed at complete
|
|
2395
2588
|
// time — the DB row is trusted as captured at verify time.
|
|
2396
2589
|
break;
|
|
2590
|
+
case 'ci':
|
|
2591
|
+
// T12634: check conclusions on a merge commit are immutable once
|
|
2592
|
+
// completed; the atom is trusted as captured, like `pr:`.
|
|
2593
|
+
break;
|
|
2397
2594
|
case 'pr':
|
|
2398
2595
|
// PR atoms capture (prNumber, mergedAt, mergeCommitSha) at verify
|
|
2399
2596
|
// time. A merged PR's mergedAt is immutable, so the atom is trusted
|