@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,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-wide admission gate and retention policy for SQLite snapshots.
|
|
3
|
+
*
|
|
4
|
+
* `cleo session end` snapshots the project databases. When many agents end
|
|
5
|
+
* their sessions together, each process used to run its own snapshot, because
|
|
6
|
+
* the debounce lived in process memory and the session-end hook bypassed it
|
|
7
|
+
* with `force: true`. On 2026-09-27 that produced four 1.3 GB snapshots in ten
|
|
8
|
+
* seconds, and the newest-10 rotation then evicted the older recovery points.
|
|
9
|
+
*
|
|
10
|
+
* This module closes that path with three mechanisms:
|
|
11
|
+
*
|
|
12
|
+
* 1. **Lock** — a cross-process lock ({@link acquireLock}, proper-lockfile)
|
|
13
|
+
* on `<backupDir>/.snapshot-gate`. At most one snapshot runs per project.
|
|
14
|
+
* 2. **Admission** — gate state lives in the project `cleo.db`
|
|
15
|
+
* (`tasks_schema_meta`, key {@link SNAPSHOT_GATE_META_KEY}) and is re-read
|
|
16
|
+
* under the lock. It holds a monotonic snapshot GENERATION counter,
|
|
17
|
+
* claimed under the lock when a snapshot starts, and per prefix the
|
|
18
|
+
* generation and start time of its last satisfied snapshot. Two modes
|
|
19
|
+
* ({@link SnapshotGateMode}) use it:
|
|
20
|
+
* - `routine` (per-write checkpoints): debounced for
|
|
21
|
+
* {@link SNAPSHOT_DEBOUNCE_MS}, and the lock is tried once — a caller
|
|
22
|
+
* that finds a snapshot in flight skips.
|
|
23
|
+
* - `required` (session end, pre-destructive checkpoints): not
|
|
24
|
+
* debounced. The caller records the generation it saw when it made
|
|
25
|
+
* the request, WAITS for the lock (bounded), and is satisfied only
|
|
26
|
+
* by a snapshot of a LATER generation — one that started after the
|
|
27
|
+
* request, so it contains every write made before it. Requests queued
|
|
28
|
+
* behind one snapshot are all covered by it, so a burst produces one
|
|
29
|
+
* snapshot. Works without a state store. No wall clock is involved,
|
|
30
|
+
* so a stepped clock cannot fake coverage.
|
|
31
|
+
* A prefix whose database does not exist in this project (e.g. no
|
|
32
|
+
* `llmtxt.db`) is `absent`: it satisfies admission like a written
|
|
33
|
+
* snapshot and is never reported as failed. There is no mode that
|
|
34
|
+
* bypasses the lock.
|
|
35
|
+
* 3. **Retention** — {@link selectSnapshotsToKeep} keeps time-spread slots
|
|
36
|
+
* (latest, quarter-hourly, hourly, daily) instead of the newest N, so a
|
|
37
|
+
* burst cannot evict older recovery points. The file just written is
|
|
38
|
+
* always kept.
|
|
39
|
+
*
|
|
40
|
+
* @task T12508
|
|
41
|
+
*/
|
|
42
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
43
|
+
/** Minimum interval between two `routine` snapshot starts of a prefix, per project. */
|
|
44
|
+
export declare const SNAPSHOT_DEBOUNCE_MS: number;
|
|
45
|
+
/**
|
|
46
|
+
* Age after which a held gate lock is considered abandoned. `VACUUM INTO` is
|
|
47
|
+
* synchronous and blocks the event loop, so the lock's mtime cannot be
|
|
48
|
+
* refreshed while it runs; this value must exceed the longest snapshot.
|
|
49
|
+
*/
|
|
50
|
+
export declare const SNAPSHOT_LOCK_STALE_MS: number;
|
|
51
|
+
/**
|
|
52
|
+
* Default lock retries for a `required` request (pre-destructive
|
|
53
|
+
* checkpoints). proper-lockfile backs off from 100 ms to 1 s per attempt, so
|
|
54
|
+
* 90 retries bound the wait to about 90 s.
|
|
55
|
+
*/
|
|
56
|
+
export declare const SNAPSHOT_LOCK_WAIT_RETRIES = 90;
|
|
57
|
+
/**
|
|
58
|
+
* Lock retries for the session-end snapshot: about 6.5 s (100 + 200 + 400 +
|
|
59
|
+
* 800 ms, then 1 s each). Session end runs inside host shutdown hooks that
|
|
60
|
+
* may be killed, so it must not wait long; the session is already persisted
|
|
61
|
+
* when it runs.
|
|
62
|
+
*/
|
|
63
|
+
export declare const SESSION_END_LOCK_WAIT_RETRIES = 9;
|
|
64
|
+
/** `tasks_schema_meta` key holding the persisted snapshot gate state. */
|
|
65
|
+
export declare const SNAPSHOT_GATE_META_KEY = "sqlite_snapshot_gate";
|
|
66
|
+
/**
|
|
67
|
+
* How a snapshot request is admitted.
|
|
68
|
+
*
|
|
69
|
+
* - `routine` — debounced; skips when a snapshot is in flight; needs the state
|
|
70
|
+
* store (without it nothing is admitted, so a broken store cannot storm).
|
|
71
|
+
* - `required` — not debounced; waits for the lock; skipped only when a
|
|
72
|
+
* snapshot of a later generation than the one seen at request time
|
|
73
|
+
* satisfied the prefix.
|
|
74
|
+
*/
|
|
75
|
+
export type SnapshotGateMode = 'routine' | 'required';
|
|
76
|
+
/**
|
|
77
|
+
* What a snapshot function did for one prefix: wrote a file, hard-linked the
|
|
78
|
+
* file already written in this run for the same physical database, or found
|
|
79
|
+
* no database to snapshot.
|
|
80
|
+
*/
|
|
81
|
+
export type SnapshotOutcome = 'written' | 'linked' | 'absent';
|
|
82
|
+
/** Why a gated snapshot request did not snapshot anything. */
|
|
83
|
+
export type SnapshotGateSkipReason = 'debounced' | 'in-flight' | 'covered' | 'state-unavailable' | 'lock-timeout';
|
|
84
|
+
/** Outcome of {@link runGatedSnapshot}. */
|
|
85
|
+
export interface SnapshotGateResult {
|
|
86
|
+
/** Prefixes that have a snapshot file from this call (written or hard-linked). */
|
|
87
|
+
readonly snapshotted: readonly string[];
|
|
88
|
+
/**
|
|
89
|
+
* Subset of `snapshotted` that shares its file with an earlier prefix of the
|
|
90
|
+
* same run (same physical database — one VACUUM, hard-linked).
|
|
91
|
+
*/
|
|
92
|
+
readonly linked: readonly string[];
|
|
93
|
+
/** Prefixes whose database does not exist in this project (nothing to snapshot). */
|
|
94
|
+
readonly absent: readonly string[];
|
|
95
|
+
/** Prefixes whose snapshot was attempted and threw. */
|
|
96
|
+
readonly failed: readonly string[];
|
|
97
|
+
/** Set when no snapshot was attempted; `null` when at least one prefix was admitted. */
|
|
98
|
+
readonly skipped: SnapshotGateSkipReason | null;
|
|
99
|
+
/** Human-readable cause when `skipped` is `lock-timeout`. */
|
|
100
|
+
readonly error?: string;
|
|
101
|
+
}
|
|
102
|
+
/** Options for {@link runGatedSnapshot}. */
|
|
103
|
+
export interface SnapshotGateOptions {
|
|
104
|
+
/** Absolute snapshot directory; the lock lives here. Must exist. */
|
|
105
|
+
readonly backupDir: string;
|
|
106
|
+
/**
|
|
107
|
+
* Handle on the project `cleo.db` that stores the gate state, or `null` when
|
|
108
|
+
* it cannot be opened. `routine` requests admit nothing without it;
|
|
109
|
+
* `required` requests snapshot anyway.
|
|
110
|
+
*/
|
|
111
|
+
readonly stateDb: DatabaseSync | null;
|
|
112
|
+
/** Snapshot prefixes requested by the caller, in snapshot order. */
|
|
113
|
+
readonly prefixes: readonly string[];
|
|
114
|
+
/** Admission mode. Defaults to `routine`. */
|
|
115
|
+
readonly mode?: SnapshotGateMode;
|
|
116
|
+
/**
|
|
117
|
+
* `required` mode: the gate generation observed when the request was made
|
|
118
|
+
* (after the caller's last write). Only a later generation covers it.
|
|
119
|
+
* Defaults to the generation read at the start of this call.
|
|
120
|
+
*/
|
|
121
|
+
readonly seenGeneration?: number;
|
|
122
|
+
/**
|
|
123
|
+
* `required` mode: never treat a prefix as covered — snapshot every
|
|
124
|
+
* requested prefix once the lock is held. Used by the session-end worker:
|
|
125
|
+
* requests coalesce onto it while it is queued, so no generation it could
|
|
126
|
+
* observe proves those requests' writes are in an earlier snapshot.
|
|
127
|
+
*/
|
|
128
|
+
readonly alwaysSnapshot?: boolean;
|
|
129
|
+
/** Lock retries for `required` mode. Defaults to {@link SNAPSHOT_LOCK_WAIT_RETRIES}. */
|
|
130
|
+
readonly lockWaitRetries?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Called under the lock BEFORE the state is re-read and the generation is
|
|
133
|
+
* claimed. The session-end worker uses it to drop its "worker pending"
|
|
134
|
+
* marker: a request that saw the marker was made before this point, so the
|
|
135
|
+
* generation claimed next covers it. Errors are ignored.
|
|
136
|
+
*/
|
|
137
|
+
readonly onLockAcquired?: () => void;
|
|
138
|
+
/** Clock override for tests (debounce and timestamps only). Defaults to `Date.now`. */
|
|
139
|
+
readonly now?: () => number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Read the current snapshot generation — what a `required` request should
|
|
143
|
+
* pass as `seenGeneration` when it is made. Returns `null` without a usable
|
|
144
|
+
* state store (the request is then never considered covered).
|
|
145
|
+
*
|
|
146
|
+
* @param db - Handle on the project `cleo.db`, or `null`.
|
|
147
|
+
* @returns The highest claimed generation, or `null`.
|
|
148
|
+
* @task T12508
|
|
149
|
+
*/
|
|
150
|
+
export declare function readSnapshotGeneration(db: DatabaseSync | null): number | null;
|
|
151
|
+
/**
|
|
152
|
+
* Run `snapshot` for every requested prefix that needs one, while holding the
|
|
153
|
+
* project-wide snapshot lock. See the module comment for the two modes.
|
|
154
|
+
*
|
|
155
|
+
* `snapshot` resolves `'written'` when it wrote a snapshot file and
|
|
156
|
+
* `'absent'` when the database does not exist; a rejection counts as a
|
|
157
|
+
* failure. Written and absent prefixes are recorded (they satisfy admission);
|
|
158
|
+
* a failed one is not, so a failed attempt never uses up the debounce window
|
|
159
|
+
* or covers a later request.
|
|
160
|
+
*
|
|
161
|
+
* Never throws; every failure is reported in the result.
|
|
162
|
+
*
|
|
163
|
+
* @param opts - Backup directory, state store, prefixes, and mode.
|
|
164
|
+
* @param snapshot - Performs one prefix's snapshot. Runs under the lock.
|
|
165
|
+
* @returns Which prefixes were written, absent or failed, or why none ran.
|
|
166
|
+
* @task T12508
|
|
167
|
+
*/
|
|
168
|
+
export declare function runGatedSnapshot(opts: SnapshotGateOptions, snapshot: (prefix: string) => Promise<SnapshotOutcome>): Promise<SnapshotGateResult>;
|
|
169
|
+
/**
|
|
170
|
+
* Explain why a `required` snapshot request left no fresh snapshot behind, or
|
|
171
|
+
* return `null` when it succeeded (written, covered by a later snapshot, or
|
|
172
|
+
* every prefix absent). Used by callers that must tell the user.
|
|
173
|
+
*
|
|
174
|
+
* @param result - Gate outcome; `null` means nothing could be attempted.
|
|
175
|
+
* @returns A one-line reason, or `null` on success.
|
|
176
|
+
* @task T12508
|
|
177
|
+
*/
|
|
178
|
+
export declare function describeSnapshotMiss(result: SnapshotGateResult | null): string | null;
|
|
179
|
+
/**
|
|
180
|
+
* Time-spread retention policy. Each slot kind keeps the NEWEST snapshot in
|
|
181
|
+
* each of its most recent non-empty buckets; the kept set is the union. Slots
|
|
182
|
+
* overlap (the latest snapshot is usually also the newest of its quarter hour,
|
|
183
|
+
* hour and day), so the slotted file count is at most the sum of the counts.
|
|
184
|
+
*/
|
|
185
|
+
export interface SnapshotRetentionPolicy {
|
|
186
|
+
/** Number of most recent snapshots kept unconditionally. */
|
|
187
|
+
readonly latest: number;
|
|
188
|
+
/** Number of most recent distinct 15-minute buckets that keep one snapshot each. */
|
|
189
|
+
readonly quarterHourly: number;
|
|
190
|
+
/** Number of most recent distinct clock hours that keep one snapshot each. */
|
|
191
|
+
readonly hourly: number;
|
|
192
|
+
/** Number of most recent distinct calendar days that keep one snapshot each. */
|
|
193
|
+
readonly daily: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Default policy: at most 10 slotted files per prefix, the same ceiling as the
|
|
197
|
+
* former newest-10 rotation, spread across quarter hours, hours and days. The
|
|
198
|
+
* quarter-hour slots keep an active session's history from collapsing into
|
|
199
|
+
* the one hourly bucket it is in.
|
|
200
|
+
*/
|
|
201
|
+
export declare const DEFAULT_SNAPSHOT_RETENTION: SnapshotRetentionPolicy;
|
|
202
|
+
/** Inputs to {@link selectSnapshotsToKeep} besides the filenames. */
|
|
203
|
+
export interface SnapshotRetentionContext {
|
|
204
|
+
/** Slot counts; defaults to {@link DEFAULT_SNAPSHOT_RETENTION}. */
|
|
205
|
+
readonly policy?: SnapshotRetentionPolicy;
|
|
206
|
+
/** The snapshot just written; always kept, whatever its stamp. */
|
|
207
|
+
readonly pinned?: string;
|
|
208
|
+
/**
|
|
209
|
+
* The current local time as a `YYYYMMDD-HHmmss` stamp. Files stamped later
|
|
210
|
+
* than this are unslotted (kept, but they win no slot). Omit to skip the check.
|
|
211
|
+
*/
|
|
212
|
+
readonly nowStamp?: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Choose which snapshot files survive retention.
|
|
216
|
+
*
|
|
217
|
+
* Buckets come from the `YYYYMMDD-HHmmss` stamp in each filename (the local
|
|
218
|
+
* time the snapshot was taken), not from mtime, so copying or touching a file
|
|
219
|
+
* cannot move it between buckets. Buckets are the most recent ones that HOLD
|
|
220
|
+
* a snapshot, not the most recent hours on the clock: when no snapshots are
|
|
221
|
+
* taken for a week, last week's history is kept rather than aged out.
|
|
222
|
+
*
|
|
223
|
+
* Never deleted: the pinned file (the one just written), files without a
|
|
224
|
+
* stamp, files with an impossible stamp, and files stamped in the future.
|
|
225
|
+
* The last two are also unslotted — a skewed or bogus stamp cannot win a slot
|
|
226
|
+
* and push a real snapshot out.
|
|
227
|
+
*
|
|
228
|
+
* Local stamps repeat an hour at the DST fall-back (01:30 PDT, then 01:10
|
|
229
|
+
* PST). During the repeated hour the earlier PDT file carries a stamp later
|
|
230
|
+
* than the clock, so it is unslotted and kept; the PST file just written is
|
|
231
|
+
* pinned. Once the hour passes, both share one hourly bucket.
|
|
232
|
+
*
|
|
233
|
+
* @param names - Snapshot filenames for a single prefix.
|
|
234
|
+
* @param ctx - Policy, pinned file, and current stamp.
|
|
235
|
+
* @returns The filenames to keep.
|
|
236
|
+
* @task T12508
|
|
237
|
+
*/
|
|
238
|
+
export declare function selectSnapshotsToKeep(names: readonly string[], ctx?: SnapshotRetentionContext): Set<string>;
|
|
239
|
+
//# sourceMappingURL=snapshot-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-gate.d.ts","sourceRoot":"","sources":["../../src/store/snapshot-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,QAAa,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAc,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAuB7D;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9D,8DAA8D;A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
3
|
+
*
|
|
4
|
+
* `cleo session end` snapshots the project databases. When many agents end
|
|
5
|
+
* their sessions together, each process used to run its own snapshot, because
|
|
6
|
+
* the debounce lived in process memory and the session-end hook bypassed it
|
|
7
|
+
* with `force: true`. On 2026-09-27 that produced four 1.3 GB snapshots in ten
|
|
8
|
+
* seconds, and the newest-10 rotation then evicted the older recovery points.
|
|
9
|
+
*
|
|
10
|
+
* This module closes that path with three mechanisms:
|
|
11
|
+
*
|
|
12
|
+
* 1. **Lock** — a cross-process lock ({@link acquireLock}, proper-lockfile)
|
|
13
|
+
* on `<backupDir>/.snapshot-gate`. At most one snapshot runs per project.
|
|
14
|
+
* 2. **Admission** — gate state lives in the project `cleo.db`
|
|
15
|
+
* (`tasks_schema_meta`, key {@link SNAPSHOT_GATE_META_KEY}) and is re-read
|
|
16
|
+
* under the lock. It holds a monotonic snapshot GENERATION counter,
|
|
17
|
+
* claimed under the lock when a snapshot starts, and per prefix the
|
|
18
|
+
* generation and start time of its last satisfied snapshot. Two modes
|
|
19
|
+
* ({@link SnapshotGateMode}) use it:
|
|
20
|
+
* - `routine` (per-write checkpoints): debounced for
|
|
21
|
+
* {@link SNAPSHOT_DEBOUNCE_MS}, and the lock is tried once — a caller
|
|
22
|
+
* that finds a snapshot in flight skips.
|
|
23
|
+
* - `required` (session end, pre-destructive checkpoints): not
|
|
24
|
+
* debounced. The caller records the generation it saw when it made
|
|
25
|
+
* the request, WAITS for the lock (bounded), and is satisfied only
|
|
26
|
+
* by a snapshot of a LATER generation — one that started after the
|
|
27
|
+
* request, so it contains every write made before it. Requests queued
|
|
28
|
+
* behind one snapshot are all covered by it, so a burst produces one
|
|
29
|
+
* snapshot. Works without a state store. No wall clock is involved,
|
|
30
|
+
* so a stepped clock cannot fake coverage.
|
|
31
|
+
* A prefix whose database does not exist in this project (e.g. no
|
|
32
|
+
* `llmtxt.db`) is `absent`: it satisfies admission like a written
|
|
33
|
+
* snapshot and is never reported as failed. There is no mode that
|
|
34
|
+
* bypasses the lock.
|
|
35
|
+
* 3. **Retention** — {@link selectSnapshotsToKeep} keeps time-spread slots
|
|
36
|
+
* (latest, quarter-hourly, hourly, daily) instead of the newest N, so a
|
|
37
|
+
* burst cannot evict older recovery points. The file just written is
|
|
38
|
+
* always kept.
|
|
39
|
+
*
|
|
40
|
+
* @task T12508
|
|
41
|
+
*/
|
|
42
|
+
import { join } from 'node:path';
|
|
43
|
+
import { acquireLock } from './lock.js';
|
|
44
|
+
/** Minimum interval between two `routine` snapshot starts of a prefix, per project. */
|
|
45
|
+
export const SNAPSHOT_DEBOUNCE_MS = 5 * 60_000;
|
|
46
|
+
/**
|
|
47
|
+
* Age after which a held gate lock is considered abandoned. `VACUUM INTO` is
|
|
48
|
+
* synchronous and blocks the event loop, so the lock's mtime cannot be
|
|
49
|
+
* refreshed while it runs; this value must exceed the longest snapshot.
|
|
50
|
+
*/
|
|
51
|
+
export const SNAPSHOT_LOCK_STALE_MS = 10 * 60_000;
|
|
52
|
+
/**
|
|
53
|
+
* Default lock retries for a `required` request (pre-destructive
|
|
54
|
+
* checkpoints). proper-lockfile backs off from 100 ms to 1 s per attempt, so
|
|
55
|
+
* 90 retries bound the wait to about 90 s.
|
|
56
|
+
*/
|
|
57
|
+
export const SNAPSHOT_LOCK_WAIT_RETRIES = 90;
|
|
58
|
+
/**
|
|
59
|
+
* Lock retries for the session-end snapshot: about 6.5 s (100 + 200 + 400 +
|
|
60
|
+
* 800 ms, then 1 s each). Session end runs inside host shutdown hooks that
|
|
61
|
+
* may be killed, so it must not wait long; the session is already persisted
|
|
62
|
+
* when it runs.
|
|
63
|
+
*/
|
|
64
|
+
export const SESSION_END_LOCK_WAIT_RETRIES = 9;
|
|
65
|
+
/** `tasks_schema_meta` key holding the persisted snapshot gate state. */
|
|
66
|
+
export const SNAPSHOT_GATE_META_KEY = 'sqlite_snapshot_gate';
|
|
67
|
+
/** Basename of the lock target inside the backup directory. */
|
|
68
|
+
const GATE_LOCK_BASENAME = '.snapshot-gate';
|
|
69
|
+
/**
|
|
70
|
+
* Read the persisted gate state. Throws when the store cannot be read, so the
|
|
71
|
+
* caller can distinguish "no state yet" (empty state) from "no state store".
|
|
72
|
+
*/
|
|
73
|
+
function readGateState(db) {
|
|
74
|
+
const row = db
|
|
75
|
+
.prepare('SELECT value FROM tasks_schema_meta WHERE key = ?')
|
|
76
|
+
.get(SNAPSHOT_GATE_META_KEY);
|
|
77
|
+
const state = { generation: 0, prefixes: {} };
|
|
78
|
+
if (!row)
|
|
79
|
+
return state;
|
|
80
|
+
try {
|
|
81
|
+
const parsed = JSON.parse(row.value);
|
|
82
|
+
if (parsed === null || typeof parsed !== 'object')
|
|
83
|
+
return state;
|
|
84
|
+
if (typeof parsed.generation === 'number' && Number.isSafeInteger(parsed.generation)) {
|
|
85
|
+
state.generation = parsed.generation;
|
|
86
|
+
}
|
|
87
|
+
for (const [prefix, e] of Object.entries(parsed.prefixes ?? {})) {
|
|
88
|
+
if (e &&
|
|
89
|
+
typeof e.generation === 'number' &&
|
|
90
|
+
typeof e.startedAt === 'number' &&
|
|
91
|
+
typeof e.completedAt === 'number') {
|
|
92
|
+
state.prefixes[prefix] = {
|
|
93
|
+
generation: e.generation,
|
|
94
|
+
startedAt: e.startedAt,
|
|
95
|
+
completedAt: e.completedAt,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// A corrupt value (or the pre-generation layout) is treated as "no
|
|
102
|
+
// history"; the next write replaces it.
|
|
103
|
+
}
|
|
104
|
+
return state;
|
|
105
|
+
}
|
|
106
|
+
/** Persist the gate state (upsert). */
|
|
107
|
+
function writeGateState(db, state) {
|
|
108
|
+
db.prepare('INSERT INTO tasks_schema_meta (key, value) VALUES (?, ?) ' +
|
|
109
|
+
'ON CONFLICT(key) DO UPDATE SET value = excluded.value').run(SNAPSHOT_GATE_META_KEY, JSON.stringify(state));
|
|
110
|
+
}
|
|
111
|
+
/** Read the state, or `null` when there is no usable state store. */
|
|
112
|
+
function tryReadGateState(db) {
|
|
113
|
+
if (!db)
|
|
114
|
+
return null;
|
|
115
|
+
try {
|
|
116
|
+
return readGateState(db);
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Read the current snapshot generation — what a `required` request should
|
|
124
|
+
* pass as `seenGeneration` when it is made. Returns `null` without a usable
|
|
125
|
+
* state store (the request is then never considered covered).
|
|
126
|
+
*
|
|
127
|
+
* @param db - Handle on the project `cleo.db`, or `null`.
|
|
128
|
+
* @returns The highest claimed generation, or `null`.
|
|
129
|
+
* @task T12508
|
|
130
|
+
*/
|
|
131
|
+
export function readSnapshotGeneration(db) {
|
|
132
|
+
return tryReadGateState(db)?.generation ?? null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Whether a prefix needs a snapshot.
|
|
136
|
+
*
|
|
137
|
+
* `routine`: the last satisfied start is outside the debounce window. A start
|
|
138
|
+
* in the future (the clock moved backwards) does not block.
|
|
139
|
+
* `required`: no snapshot of a generation later than `seenGeneration`
|
|
140
|
+
* satisfied it (`seenGeneration === null` means never covered).
|
|
141
|
+
*/
|
|
142
|
+
function needsSnapshot(entry, mode, nowMs, seenGeneration) {
|
|
143
|
+
if (!entry)
|
|
144
|
+
return true;
|
|
145
|
+
if (mode === 'required')
|
|
146
|
+
return seenGeneration === null || entry.generation <= seenGeneration;
|
|
147
|
+
const elapsed = nowMs - entry.startedAt;
|
|
148
|
+
return elapsed < 0 || elapsed >= SNAPSHOT_DEBOUNCE_MS;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Run `snapshot` for every requested prefix that needs one, while holding the
|
|
152
|
+
* project-wide snapshot lock. See the module comment for the two modes.
|
|
153
|
+
*
|
|
154
|
+
* `snapshot` resolves `'written'` when it wrote a snapshot file and
|
|
155
|
+
* `'absent'` when the database does not exist; a rejection counts as a
|
|
156
|
+
* failure. Written and absent prefixes are recorded (they satisfy admission);
|
|
157
|
+
* a failed one is not, so a failed attempt never uses up the debounce window
|
|
158
|
+
* or covers a later request.
|
|
159
|
+
*
|
|
160
|
+
* Never throws; every failure is reported in the result.
|
|
161
|
+
*
|
|
162
|
+
* @param opts - Backup directory, state store, prefixes, and mode.
|
|
163
|
+
* @param snapshot - Performs one prefix's snapshot. Runs under the lock.
|
|
164
|
+
* @returns Which prefixes were written, absent or failed, or why none ran.
|
|
165
|
+
* @task T12508
|
|
166
|
+
*/
|
|
167
|
+
export async function runGatedSnapshot(opts, snapshot) {
|
|
168
|
+
const now = opts.now ?? Date.now;
|
|
169
|
+
const mode = opts.mode ?? 'routine';
|
|
170
|
+
const db = opts.stateDb;
|
|
171
|
+
const none = (skipped, error) => ({
|
|
172
|
+
snapshotted: [],
|
|
173
|
+
linked: [],
|
|
174
|
+
absent: [],
|
|
175
|
+
failed: [],
|
|
176
|
+
skipped,
|
|
177
|
+
...(error !== undefined && { error }),
|
|
178
|
+
});
|
|
179
|
+
// Read once without the lock: the routine fast path, and the generation a
|
|
180
|
+
// `required` request was made at (when the caller did not record it).
|
|
181
|
+
const entryState = tryReadGateState(db);
|
|
182
|
+
const seenGeneration = mode === 'required' ? (opts.seenGeneration ?? entryState?.generation ?? null) : null;
|
|
183
|
+
if (mode === 'routine') {
|
|
184
|
+
if (!entryState)
|
|
185
|
+
return none('state-unavailable');
|
|
186
|
+
const nowMs = now();
|
|
187
|
+
if (!opts.prefixes.some((p) => needsSnapshot(entryState.prefixes[p], mode, nowMs, null))) {
|
|
188
|
+
return none('debounced');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const lockPath = join(opts.backupDir, GATE_LOCK_BASENAME);
|
|
192
|
+
let release;
|
|
193
|
+
try {
|
|
194
|
+
release = await acquireLock(lockPath, {
|
|
195
|
+
retries: mode === 'required' ? (opts.lockWaitRetries ?? SNAPSHOT_LOCK_WAIT_RETRIES) : 0,
|
|
196
|
+
stale: SNAPSHOT_LOCK_STALE_MS,
|
|
197
|
+
// A compromised lock (e.g. the backup dir was removed) must not throw
|
|
198
|
+
// from a timer and crash the host process.
|
|
199
|
+
onCompromised: () => { },
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
if (mode === 'routine')
|
|
204
|
+
return none('in-flight');
|
|
205
|
+
return none('lock-timeout', `Snapshot lock ${lockPath}.lock is still held after waiting. Another snapshot is ` +
|
|
206
|
+
`running, or a crashed process left the lock (it expires after ` +
|
|
207
|
+
`${SNAPSHOT_LOCK_STALE_MS / 60_000} minutes). Remove it if no snapshot is running.`);
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
try {
|
|
211
|
+
opts.onLockAcquired?.();
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
// A failing hook must not cost the snapshot.
|
|
215
|
+
}
|
|
216
|
+
// Re-read under the lock: another process may have snapshotted meanwhile.
|
|
217
|
+
const state = tryReadGateState(db);
|
|
218
|
+
if (!state && mode === 'routine')
|
|
219
|
+
return none('state-unavailable');
|
|
220
|
+
const startMs = now();
|
|
221
|
+
const admitted = mode === 'required' && opts.alwaysSnapshot === true
|
|
222
|
+
? [...opts.prefixes]
|
|
223
|
+
: opts.prefixes.filter((p) => needsSnapshot(state?.prefixes[p], mode, startMs, seenGeneration));
|
|
224
|
+
if (admitted.length === 0)
|
|
225
|
+
return none(mode === 'routine' ? 'debounced' : 'covered');
|
|
226
|
+
// Claim the next generation BEFORE snapshotting, so a request made while
|
|
227
|
+
// this run is in flight sees it and is not covered by it.
|
|
228
|
+
// If the claim cannot be persisted, this run records nothing: recording
|
|
229
|
+
// under an unclaimed generation could cover a request made while the run
|
|
230
|
+
// was in flight (it would have seen the old generation).
|
|
231
|
+
const generation = (state?.generation ?? 0) + 1;
|
|
232
|
+
let claimed = false;
|
|
233
|
+
if (db && state) {
|
|
234
|
+
try {
|
|
235
|
+
writeGateState(db, { ...state, generation });
|
|
236
|
+
claimed = true;
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
// Unclaimed: later requests are simply not covered by this run.
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const snapshotted = [];
|
|
243
|
+
const linked = [];
|
|
244
|
+
const absent = [];
|
|
245
|
+
const failed = [];
|
|
246
|
+
for (const prefix of admitted) {
|
|
247
|
+
try {
|
|
248
|
+
const outcome = await snapshot(prefix);
|
|
249
|
+
if (outcome === 'absent')
|
|
250
|
+
absent.push(prefix);
|
|
251
|
+
else {
|
|
252
|
+
snapshotted.push(prefix);
|
|
253
|
+
if (outcome === 'linked')
|
|
254
|
+
linked.push(prefix);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
failed.push(prefix);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
const satisfied = [...snapshotted, ...absent];
|
|
262
|
+
if (db && claimed && satisfied.length > 0) {
|
|
263
|
+
try {
|
|
264
|
+
const latest = readGateState(db);
|
|
265
|
+
const completedAt = now();
|
|
266
|
+
latest.generation = Math.max(latest.generation, generation);
|
|
267
|
+
for (const p of satisfied) {
|
|
268
|
+
latest.prefixes[p] = { generation, startedAt: startMs, completedAt };
|
|
269
|
+
}
|
|
270
|
+
writeGateState(db, latest);
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
// The snapshot exists; losing its record only makes the next request run.
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return { snapshotted, linked, absent, failed, skipped: null };
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
await release().catch(() => { });
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Explain why a `required` snapshot request left no fresh snapshot behind, or
|
|
284
|
+
* return `null` when it succeeded (written, covered by a later snapshot, or
|
|
285
|
+
* every prefix absent). Used by callers that must tell the user.
|
|
286
|
+
*
|
|
287
|
+
* @param result - Gate outcome; `null` means nothing could be attempted.
|
|
288
|
+
* @returns A one-line reason, or `null` on success.
|
|
289
|
+
* @task T12508
|
|
290
|
+
*/
|
|
291
|
+
export function describeSnapshotMiss(result) {
|
|
292
|
+
if (!result)
|
|
293
|
+
return 'the backup directory could not be resolved';
|
|
294
|
+
if (result.skipped === 'lock-timeout')
|
|
295
|
+
return result.error ?? 'the snapshot lock stayed held';
|
|
296
|
+
if (result.skipped !== null && result.skipped !== 'covered') {
|
|
297
|
+
return `the snapshot was skipped (${result.skipped})`;
|
|
298
|
+
}
|
|
299
|
+
if (result.failed.length > 0)
|
|
300
|
+
return `the snapshot failed for: ${result.failed.join(', ')}`;
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Default policy: at most 10 slotted files per prefix, the same ceiling as the
|
|
305
|
+
* former newest-10 rotation, spread across quarter hours, hours and days. The
|
|
306
|
+
* quarter-hour slots keep an active session's history from collapsing into
|
|
307
|
+
* the one hourly bucket it is in.
|
|
308
|
+
*/
|
|
309
|
+
export const DEFAULT_SNAPSHOT_RETENTION = {
|
|
310
|
+
latest: 1,
|
|
311
|
+
quarterHourly: 3,
|
|
312
|
+
hourly: 3,
|
|
313
|
+
daily: 3,
|
|
314
|
+
};
|
|
315
|
+
/** `YYYYMMDD-HHmmss` stamp embedded in a snapshot filename. */
|
|
316
|
+
const STAMP_PATTERN = /-(\d{8})-(\d{6})\.db$/;
|
|
317
|
+
/** Whether `YYYYMMDD` + `HHmmss` name a real calendar date and time. */
|
|
318
|
+
function isValidStamp(ymd, hms) {
|
|
319
|
+
const y = Number(ymd.slice(0, 4));
|
|
320
|
+
const mo = Number(ymd.slice(4, 6));
|
|
321
|
+
const d = Number(ymd.slice(6, 8));
|
|
322
|
+
const h = Number(hms.slice(0, 2));
|
|
323
|
+
const mi = Number(hms.slice(2, 4));
|
|
324
|
+
const se = Number(hms.slice(4, 6));
|
|
325
|
+
if (mo < 1 || mo > 12 || d < 1 || h > 23 || mi > 59 || se > 59)
|
|
326
|
+
return false;
|
|
327
|
+
// Day-of-month check via UTC so no time zone can shift the date.
|
|
328
|
+
const probe = new Date(Date.UTC(y, mo - 1, d));
|
|
329
|
+
return probe.getUTCFullYear() === y && probe.getUTCMonth() === mo - 1 && probe.getUTCDate() === d;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Choose which snapshot files survive retention.
|
|
333
|
+
*
|
|
334
|
+
* Buckets come from the `YYYYMMDD-HHmmss` stamp in each filename (the local
|
|
335
|
+
* time the snapshot was taken), not from mtime, so copying or touching a file
|
|
336
|
+
* cannot move it between buckets. Buckets are the most recent ones that HOLD
|
|
337
|
+
* a snapshot, not the most recent hours on the clock: when no snapshots are
|
|
338
|
+
* taken for a week, last week's history is kept rather than aged out.
|
|
339
|
+
*
|
|
340
|
+
* Never deleted: the pinned file (the one just written), files without a
|
|
341
|
+
* stamp, files with an impossible stamp, and files stamped in the future.
|
|
342
|
+
* The last two are also unslotted — a skewed or bogus stamp cannot win a slot
|
|
343
|
+
* and push a real snapshot out.
|
|
344
|
+
*
|
|
345
|
+
* Local stamps repeat an hour at the DST fall-back (01:30 PDT, then 01:10
|
|
346
|
+
* PST). During the repeated hour the earlier PDT file carries a stamp later
|
|
347
|
+
* than the clock, so it is unslotted and kept; the PST file just written is
|
|
348
|
+
* pinned. Once the hour passes, both share one hourly bucket.
|
|
349
|
+
*
|
|
350
|
+
* @param names - Snapshot filenames for a single prefix.
|
|
351
|
+
* @param ctx - Policy, pinned file, and current stamp.
|
|
352
|
+
* @returns The filenames to keep.
|
|
353
|
+
* @task T12508
|
|
354
|
+
*/
|
|
355
|
+
export function selectSnapshotsToKeep(names, ctx = {}) {
|
|
356
|
+
const policy = ctx.policy ?? DEFAULT_SNAPSHOT_RETENTION;
|
|
357
|
+
const keep = new Set();
|
|
358
|
+
const stamped = [];
|
|
359
|
+
for (const name of names) {
|
|
360
|
+
const m = STAMP_PATTERN.exec(name);
|
|
361
|
+
const ymd = m?.[1];
|
|
362
|
+
const hms = m?.[2];
|
|
363
|
+
if (!ymd || !hms || !isValidStamp(ymd, hms)) {
|
|
364
|
+
keep.add(name);
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
const stamp = `${ymd}-${hms}`;
|
|
368
|
+
if (ctx.nowStamp !== undefined && stamp > ctx.nowStamp) {
|
|
369
|
+
keep.add(name);
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
stamped.push({ name, stamp });
|
|
373
|
+
}
|
|
374
|
+
if (ctx.pinned !== undefined && names.includes(ctx.pinned))
|
|
375
|
+
keep.add(ctx.pinned);
|
|
376
|
+
// Newest first; the stamp sorts lexicographically in time order.
|
|
377
|
+
stamped.sort((a, b) => (a.stamp < b.stamp ? 1 : a.stamp > b.stamp ? -1 : 0));
|
|
378
|
+
for (const s of stamped.slice(0, policy.latest))
|
|
379
|
+
keep.add(s.name);
|
|
380
|
+
const keepNewestPerBucket = (bucketOf, slots) => {
|
|
381
|
+
const seen = new Set();
|
|
382
|
+
for (const s of stamped) {
|
|
383
|
+
const bucket = bucketOf(s.stamp);
|
|
384
|
+
if (seen.has(bucket))
|
|
385
|
+
continue;
|
|
386
|
+
if (seen.size >= slots)
|
|
387
|
+
break;
|
|
388
|
+
seen.add(bucket);
|
|
389
|
+
keep.add(s.name);
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
// YYYYMMDD-HH + quarter index (minutes 00-14 → 0, 15-29 → 1, …)
|
|
393
|
+
keepNewestPerBucket((stamp) => `${stamp.slice(0, 11)}q${Math.floor(Number(stamp.slice(11, 13)) / 15)}`, policy.quarterHourly);
|
|
394
|
+
keepNewestPerBucket((stamp) => stamp.slice(0, 11), policy.hourly); // YYYYMMDD-HH
|
|
395
|
+
keepNewestPerBucket((stamp) => stamp.slice(0, 8), policy.daily); // YYYYMMDD
|
|
396
|
+
return keep;
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=snapshot-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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