@cleocode/core 2026.9.22 → 2026.9.23
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/build-provenance.json +6 -0
- package/dist/decide/audit.d.ts +7 -1
- package/dist/decide/audit.d.ts.map +1 -1
- package/dist/decide/audit.js.map +1 -1
- package/dist/decide/client.d.ts +46 -4
- package/dist/decide/client.d.ts.map +1 -1
- package/dist/decide/client.js +328 -33
- package/dist/decide/client.js.map +1 -1
- package/dist/decide/credentials.d.ts +28 -4
- package/dist/decide/credentials.d.ts.map +1 -1
- package/dist/decide/credentials.js +50 -12
- package/dist/decide/credentials.js.map +1 -1
- package/dist/decide/index.d.ts +10 -4
- package/dist/decide/index.d.ts.map +1 -1
- package/dist/decide/index.js +10 -4
- package/dist/decide/index.js.map +1 -1
- package/dist/decide/jev-wire.d.ts +100 -8
- package/dist/decide/jev-wire.d.ts.map +1 -1
- package/dist/decide/jev-wire.js +402 -55
- package/dist/decide/jev-wire.js.map +1 -1
- package/dist/decide/operations.d.ts +97 -20
- package/dist/decide/operations.d.ts.map +1 -1
- package/dist/decide/operations.js +180 -28
- package/dist/decide/operations.js.map +1 -1
- package/dist/decide/provider-state.d.ts +89 -0
- package/dist/decide/provider-state.d.ts.map +1 -0
- package/dist/decide/provider-state.js +134 -0
- package/dist/decide/provider-state.js.map +1 -0
- package/dist/decide/provider.d.ts +26 -5
- package/dist/decide/provider.d.ts.map +1 -1
- package/dist/decide/provider.js.map +1 -1
- package/dist/decide/providers.d.ts +58 -0
- package/dist/decide/providers.d.ts.map +1 -0
- package/dist/decide/providers.js +69 -0
- package/dist/decide/providers.js.map +1 -0
- package/dist/decide/site.d.ts +2 -2
- package/dist/decide/site.d.ts.map +1 -1
- package/dist/decide/site.js +2 -0
- package/dist/decide/site.js.map +1 -1
- package/dist/decide/sites/list.d.ts +46 -0
- package/dist/decide/sites/list.d.ts.map +1 -0
- package/dist/decide/sites/list.js +206 -0
- package/dist/decide/sites/list.js.map +1 -0
- package/dist/decide/sites/registry.d.ts +130 -0
- package/dist/decide/sites/registry.d.ts.map +1 -0
- package/dist/decide/sites/registry.js +375 -0
- package/dist/decide/sites/registry.js.map +1 -0
- package/dist/decide/spend.d.ts +196 -0
- package/dist/decide/spend.d.ts.map +1 -0
- package/dist/decide/spend.js +387 -0
- package/dist/decide/spend.js.map +1 -0
- package/dist/decide/wizard.d.ts +53 -0
- package/dist/decide/wizard.d.ts.map +1 -0
- package/dist/decide/wizard.js +144 -0
- package/dist/decide/wizard.js.map +1 -0
- package/dist/docs/docs-audit.d.ts.map +1 -1
- package/dist/docs/docs-audit.js +1 -2
- package/dist/docs/docs-audit.js.map +1 -1
- package/dist/docs/export-document.js +775 -415
- package/dist/docs/export-document.js.map +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init/scaffold-workflows.d.ts.map +1 -1
- package/dist/init/scaffold-workflows.js +6 -3
- package/dist/init/scaffold-workflows.js.map +1 -1
- package/dist/init/upgrade-workflows.d.ts.map +1 -1
- package/dist/init/upgrade-workflows.js +6 -3
- package/dist/init/upgrade-workflows.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/llm/plugin-facade.js +886 -526
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/memory/decision-contradiction.d.ts +3 -3
- package/dist/memory/decision-contradiction.d.ts.map +1 -1
- package/dist/memory/decision-contradiction.js +4 -3
- package/dist/memory/decision-contradiction.js.map +1 -1
- package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
- package/dist/memory/graph-memory-bridge.js +2 -0
- package/dist/memory/graph-memory-bridge.js.map +1 -1
- package/dist/memory/observation-type-decision.d.ts +2 -2
- package/dist/memory/observation-type-decision.d.ts.map +1 -1
- package/dist/memory/observation-type-decision.js +3 -2
- package/dist/memory/observation-type-decision.js.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.d.ts +111 -0
- package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.js +230 -2
- package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
- package/dist/nexus/migrations/M-split-graph.d.ts.map +1 -1
- package/dist/nexus/migrations/M-split-graph.js +4 -0
- package/dist/nexus/migrations/M-split-graph.js.map +1 -1
- package/dist/nexus/store.d.ts.map +1 -1
- package/dist/nexus/store.js +2 -0
- package/dist/nexus/store.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +13 -8
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/plan.d.ts.map +1 -1
- package/dist/orchestrate/plan.js +3 -0
- package/dist/orchestrate/plan.js.map +1 -1
- package/dist/orchestration/lead-rollup.js +14 -2
- package/dist/orchestration/lead-rollup.js.map +1 -1
- package/dist/orchestration/owner-decision-readiness.d.ts +2 -2
- package/dist/orchestration/owner-decision-readiness.d.ts.map +1 -1
- package/dist/orchestration/owner-decision-readiness.js +3 -2
- package/dist/orchestration/owner-decision-readiness.js.map +1 -1
- package/dist/orchestration/validate-spawn.d.ts.map +1 -1
- package/dist/orchestration/validate-spawn.js +2 -0
- package/dist/orchestration/validate-spawn.js.map +1 -1
- package/dist/project-scope.d.ts +16 -0
- package/dist/project-scope.d.ts.map +1 -1
- package/dist/project-scope.js +38 -2
- package/dist/project-scope.js.map +1 -1
- package/dist/release/github-pr.d.ts.map +1 -1
- package/dist/release/github-pr.js +2 -1
- package/dist/release/github-pr.js.map +1 -1
- package/dist/routing/capability-matrix.d.ts.map +1 -1
- package/dist/routing/capability-matrix.js +7 -0
- package/dist/routing/capability-matrix.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +895 -535
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +23 -62
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/focus-state-store.d.ts +6 -1
- package/dist/sessions/focus-state-store.d.ts.map +1 -1
- package/dist/sessions/focus-state-store.js +5 -2
- package/dist/sessions/focus-state-store.js.map +1 -1
- package/dist/setup/config-json-merge.d.ts +28 -0
- package/dist/setup/config-json-merge.d.ts.map +1 -1
- package/dist/setup/config-json-merge.js +51 -0
- package/dist/setup/config-json-merge.js.map +1 -1
- package/dist/setup/index.d.ts +13 -10
- package/dist/setup/index.d.ts.map +1 -1
- package/dist/setup/index.js +15 -10
- package/dist/setup/index.js.map +1 -1
- package/dist/setup/sections/llm.js +1 -1
- package/dist/setup/sections/llm.js.map +1 -1
- package/dist/setup/sections/system-one.d.ts +28 -0
- package/dist/setup/sections/system-one.d.ts.map +1 -0
- package/dist/setup/sections/system-one.js +53 -0
- package/dist/setup/sections/system-one.js.map +1 -0
- package/dist/setup/wizard.d.ts +15 -1
- package/dist/setup/wizard.d.ts.map +1 -1
- package/dist/setup/wizard.js +15 -0
- package/dist/setup/wizard.js.map +1 -1
- package/dist/skills/prune-bundled.d.ts +40 -1
- package/dist/skills/prune-bundled.d.ts.map +1 -1
- package/dist/skills/prune-bundled.js +117 -1
- package/dist/skills/prune-bundled.js.map +1 -1
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.js +2 -0
- package/dist/store/agent-registry-accessor.js.map +1 -1
- package/dist/store/backup-pack.js +1 -1
- package/dist/store/backup-pack.js.map +1 -1
- package/dist/store/backup.d.ts +15 -1
- package/dist/store/backup.d.ts.map +1 -1
- package/dist/store/backup.js +18 -2
- package/dist/store/backup.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +3 -0
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/credential-transfer.d.ts.map +1 -1
- package/dist/store/credential-transfer.js +2 -0
- package/dist/store/credential-transfer.js.map +1 -1
- package/dist/store/cross-db-cleanup.d.ts.map +1 -1
- package/dist/store/cross-db-cleanup.js +2 -0
- package/dist/store/cross-db-cleanup.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +13 -2
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/migrate-signaldock-to-conduit.d.ts.map +1 -1
- package/dist/store/migrate-signaldock-to-conduit.js +3 -0
- package/dist/store/migrate-signaldock-to-conduit.js.map +1 -1
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +37 -3
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/migration-sqlite.d.ts.map +1 -1
- package/dist/store/migration-sqlite.js +2 -0
- package/dist/store/migration-sqlite.js.map +1 -1
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.js +3 -0
- package/dist/store/nexus-sqlite.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +3 -0
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/portable-bundle-import.d.ts.map +1 -1
- package/dist/store/portable-bundle-import.js +2 -0
- package/dist/store/portable-bundle-import.js.map +1 -1
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
- package/dist/store/portable-bundle-relocate.js +2 -0
- package/dist/store/portable-bundle-relocate.js.map +1 -1
- package/dist/store/portable-bundle-scan.js +1 -1
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/ports/domain-binding.d.ts.map +1 -1
- package/dist/store/ports/domain-binding.js +5 -0
- package/dist/store/ports/domain-binding.js.map +1 -1
- package/dist/store/split-brain-import.d.ts.map +1 -1
- package/dist/store/split-brain-import.js +2 -0
- package/dist/store/split-brain-import.js.map +1 -1
- package/dist/store/sqlite-data-accessor.js +7 -0
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite-native.d.ts.map +1 -1
- package/dist/store/sqlite-native.js +1 -0
- package/dist/store/sqlite-native.js.map +1 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +5 -0
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/worktree-build-guard.d.ts +191 -0
- package/dist/store/worktree-build-guard.d.ts.map +1 -0
- package/dist/store/worktree-build-guard.js +486 -0
- package/dist/store/worktree-build-guard.js.map +1 -0
- package/dist/store/worktree-isolation-guard.d.ts +27 -0
- package/dist/store/worktree-isolation-guard.d.ts.map +1 -1
- package/dist/store/worktree-isolation-guard.js +67 -1
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/store/writer-lease.d.ts.map +1 -1
- package/dist/store/writer-lease.js +2 -0
- package/dist/store/writer-lease.js.map +1 -1
- package/dist/system/backup.d.ts +6 -2
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +6 -3
- package/dist/system/backup.js.map +1 -1
- package/dist/task-tools/index.d.ts +4 -2
- package/dist/task-tools/index.d.ts.map +1 -1
- package/dist/task-tools/index.js +3 -2
- package/dist/task-tools/index.js.map +1 -1
- package/dist/task-tools/score-task-priority.d.ts +93 -18
- package/dist/task-tools/score-task-priority.d.ts.map +1 -1
- package/dist/task-tools/score-task-priority.js +193 -81
- package/dist/task-tools/score-task-priority.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +5 -1
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +21 -3
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/analyze.d.ts +29 -1
- package/dist/tasks/analyze.d.ts.map +1 -1
- package/dist/tasks/analyze.js +45 -34
- package/dist/tasks/analyze.js.map +1 -1
- package/dist/tasks/backfill-child-projections.d.ts.map +1 -1
- package/dist/tasks/backfill-child-projections.js +4 -1
- package/dist/tasks/backfill-child-projections.js.map +1 -1
- package/dist/tasks/change-set.d.ts.map +1 -1
- package/dist/tasks/change-set.js +16 -3
- package/dist/tasks/change-set.js.map +1 -1
- package/dist/tasks/command-line.d.ts +54 -0
- package/dist/tasks/command-line.d.ts.map +1 -0
- package/dist/tasks/command-line.js +151 -0
- package/dist/tasks/command-line.js.map +1 -0
- package/dist/tasks/component-pr.d.ts.map +1 -1
- package/dist/tasks/component-pr.js +97 -12
- package/dist/tasks/component-pr.js.map +1 -1
- package/dist/tasks/delete.d.ts.map +1 -1
- package/dist/tasks/delete.js +20 -0
- package/dist/tasks/delete.js.map +1 -1
- package/dist/tasks/duplicate-detector.d.ts +3 -3
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +4 -3
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/engine-wrap-ops.d.ts +29 -0
- package/dist/tasks/engine-wrap-ops.d.ts.map +1 -1
- package/dist/tasks/engine-wrap-ops.js +40 -0
- package/dist/tasks/engine-wrap-ops.js.map +1 -1
- package/dist/tasks/engine-wrap.d.ts +1 -1
- package/dist/tasks/engine-wrap.d.ts.map +1 -1
- package/dist/tasks/engine-wrap.js +1 -1
- package/dist/tasks/engine-wrap.js.map +1 -1
- package/dist/tasks/evidence.d.ts +2 -0
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +30 -4
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +48 -12
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +1 -1
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/ops.d.ts +1 -0
- package/dist/tasks/ops.d.ts.map +1 -1
- package/dist/tasks/ranking-audit.d.ts +122 -0
- package/dist/tasks/ranking-audit.d.ts.map +1 -0
- package/dist/tasks/ranking-audit.js +193 -0
- package/dist/tasks/ranking-audit.js.map +1 -0
- package/dist/tasks/task-analyze.d.ts.map +1 -1
- package/dist/tasks/task-analyze.js +19 -32
- package/dist/tasks/task-analyze.js.map +1 -1
- package/dist/tasks/task-next.d.ts +44 -2
- package/dist/tasks/task-next.d.ts.map +1 -1
- package/dist/tasks/task-next.js +80 -102
- package/dist/tasks/task-next.js.map +1 -1
- package/dist/tasks/task-ops.d.ts +1 -1
- package/dist/tasks/task-ops.d.ts.map +1 -1
- package/dist/tasks/task-ops.js +1 -1
- package/dist/tasks/task-ops.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +7 -1
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +24 -10
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/update.d.ts +8 -2
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +28 -1
- package/dist/tasks/update.js.map +1 -1
- package/dist/telemetry/sqlite.d.ts.map +1 -1
- package/dist/telemetry/sqlite.js +2 -0
- package/dist/telemetry/sqlite.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +2 -2
- package/dist/validation/doctor/checks.js.map +1 -1
- package/package.json +14 -14
- package/schemas/config.schema.json +13 -0
- package/templates/CLEO-INJECTION.md +1 -1
- package/templates/CLEO-REFERENCE.md +5 -1
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worktree-build schema-write guard (T12687).
|
|
3
|
+
*
|
|
4
|
+
* A CLI built inside a linked git worktree carries that branch's UNRELEASED
|
|
5
|
+
* migrations and schema code. Path resolution maps a worktree to its parent
|
|
6
|
+
* project's store (T12460), so running that build — `cleo check arch`, an
|
|
7
|
+
* unsandboxed CLI test, a reviewer trying a PR build — changed the schema of
|
|
8
|
+
* the LIVE main-checkout store. Incident 2026-09-29: cleo-nexus's slice-2
|
|
9
|
+
* build wrote `__drizzle_migrations` row 114 into the live cleocode store; the
|
|
10
|
+
* released CLI then deleted the unknown row as an orphan and the next slice-2
|
|
11
|
+
* open re-ran `ADD COLUMN` and failed.
|
|
12
|
+
*
|
|
13
|
+
* ## One decision per store, enforced on the handle
|
|
14
|
+
*
|
|
15
|
+
* {@link schemaWriteRefusal} decides, once per store path, whether this build
|
|
16
|
+
* may change that store's schema. When it may not,
|
|
17
|
+
* {@link installSchemaWriteGuard} installs a SQLite authorizer on the handle
|
|
18
|
+
* that DENIES every schema change — `ALTER`, `DROP`, and any `CREATE` of an
|
|
19
|
+
* object that does not already exist (a `CREATE … IF NOT EXISTS` of an
|
|
20
|
+
* existing object is a no-op and stays allowed). That covers every DDL site
|
|
21
|
+
* at once — drizzle migrations, `ensureColumns`, raw `ALTER`s, table
|
|
22
|
+
* rebuilds, twin collapse, exodus — including sites added later. Migration
|
|
23
|
+
* sites additionally fail fast with {@link WorktreeBuildSchemaError} when the
|
|
24
|
+
* build has pending migrations: the store would not match what this build
|
|
25
|
+
* reads, so it refuses rather than failing later with `no such column`.
|
|
26
|
+
*
|
|
27
|
+
* ## Who is a dev build
|
|
28
|
+
*
|
|
29
|
+
* The build stamp `dist/build-provenance.json` (written at build time) names
|
|
30
|
+
* the linked worktree the build was made in, or null for a main checkout / CI
|
|
31
|
+
* clone — how released packages are built. The stamp travels with the build,
|
|
32
|
+
* so an `npm pack`ed worktree build installed globally, or a `dist` copied
|
|
33
|
+
* outside any checkout, is still recognised. Without a stamp (running from
|
|
34
|
+
* source), the running file's own location decides, and a path under
|
|
35
|
+
* `node_modules` counts as installed.
|
|
36
|
+
*
|
|
37
|
+
* Allowed without an opt-in: stores inside the build's own worktree, and the
|
|
38
|
+
* test harness (`VITEST`, or a store below a {@link TEST_SANDBOX_MARKER} for CLI
|
|
39
|
+
* children a test spawns). A temp directory alone is NOT an exemption — a
|
|
40
|
+
* project cloned under `/tmp` is a real store. Everything else needs
|
|
41
|
+
* `CLEO_ALLOW_WORKTREE_BUILD_MIGRATIONS=1`.
|
|
42
|
+
*
|
|
43
|
+
* @task T12687
|
|
44
|
+
*/
|
|
45
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
46
|
+
import { createRequire } from 'node:module';
|
|
47
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
48
|
+
import { fileURLToPath } from 'node:url';
|
|
49
|
+
import { ExitCode } from '@cleocode/contracts';
|
|
50
|
+
import { CleoError } from '../errors.js';
|
|
51
|
+
import { isGitLinkedCheckout } from '../project-scope.js';
|
|
52
|
+
/** Opt-in that lets a worktree build change the schema of a store outside its worktree. */
|
|
53
|
+
export const ALLOW_WORKTREE_BUILD_MIGRATIONS_ENV = 'CLEO_ALLOW_WORKTREE_BUILD_MIGRATIONS';
|
|
54
|
+
/**
|
|
55
|
+
* File the test harness (`vitest.setup.ts`) writes at the root of each fork's
|
|
56
|
+
* sandbox. A store below it is a fixture — including one opened by a CLI child
|
|
57
|
+
* process the test spawned: such a child carries `VITEST` only when the test
|
|
58
|
+
* passes its own environment through, and many build an explicit `env`.
|
|
59
|
+
* A marker inside a git checkout is ignored: the sandbox is never in one, so a
|
|
60
|
+
* marker there was committed or planted in a real project.
|
|
61
|
+
*/
|
|
62
|
+
export const TEST_SANDBOX_MARKER = '.cleo-test-sandbox';
|
|
63
|
+
/** Error code of {@link WorktreeBuildSchemaError}. */
|
|
64
|
+
export const E_WORKTREE_BUILD_SCHEMA = 'E_WORKTREE_BUILD_SCHEMA';
|
|
65
|
+
let overrides = null;
|
|
66
|
+
const decisions = new Map();
|
|
67
|
+
/**
|
|
68
|
+
* Replace the guard's view of the running build (tests only: a test process
|
|
69
|
+
* runs from source inside the harness, so it cannot be a dev build itself).
|
|
70
|
+
*
|
|
71
|
+
* @param next - Partial options, or null to restore the defaults.
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
export function setWorktreeBuildGuardForTests(next) {
|
|
75
|
+
overrides = next;
|
|
76
|
+
decisions.clear();
|
|
77
|
+
}
|
|
78
|
+
function realOrResolved(path) {
|
|
79
|
+
try {
|
|
80
|
+
return realpathSync(path);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return resolve(path);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function isWithin(root, path) {
|
|
87
|
+
const local = relative(root, path);
|
|
88
|
+
return local === '' || (!isAbsolute(local) && local !== '..' && !local.startsWith(`..${sep}`));
|
|
89
|
+
}
|
|
90
|
+
/** Whether `dir` or an ancestor is a git checkout (has `.git`). */
|
|
91
|
+
function insideGitCheckout(dir) {
|
|
92
|
+
let current = dir;
|
|
93
|
+
for (;;) {
|
|
94
|
+
if (existsSync(join(current, '.git')))
|
|
95
|
+
return true;
|
|
96
|
+
const parent = dirname(current);
|
|
97
|
+
if (parent === current)
|
|
98
|
+
return false;
|
|
99
|
+
current = parent;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Whether a {@link TEST_SANDBOX_MARKER} sits in `path` or an ancestor, outside
|
|
104
|
+
* any git checkout (a marker inside a checkout is refused).
|
|
105
|
+
*/
|
|
106
|
+
function insideTestSandbox(path) {
|
|
107
|
+
let dir = dirname(path);
|
|
108
|
+
for (;;) {
|
|
109
|
+
if (existsSync(join(dir, TEST_SANDBOX_MARKER)))
|
|
110
|
+
return !insideGitCheckout(dir);
|
|
111
|
+
const parent = dirname(dir);
|
|
112
|
+
if (parent === dir)
|
|
113
|
+
return false;
|
|
114
|
+
dir = parent;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Root of the linked git worktree containing `path`, or null when the nearest
|
|
119
|
+
* enclosing checkout is a main checkout (or there is none).
|
|
120
|
+
*
|
|
121
|
+
* @param path - Any path.
|
|
122
|
+
* @returns The linked worktree root, or null.
|
|
123
|
+
*/
|
|
124
|
+
export function linkedWorktreeRootOf(path) {
|
|
125
|
+
let dir = realOrResolved(path);
|
|
126
|
+
for (;;) {
|
|
127
|
+
if (isGitLinkedCheckout(dir))
|
|
128
|
+
return dir;
|
|
129
|
+
if (existsSync(join(dir, '.git')))
|
|
130
|
+
return null; // a main checkout
|
|
131
|
+
const parent = dirname(dir);
|
|
132
|
+
if (parent === dir)
|
|
133
|
+
return null;
|
|
134
|
+
dir = parent;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The build stamp beside the running build: the nearest `build-provenance.json`
|
|
139
|
+
* walking up from `codePath`, stopping at the package root.
|
|
140
|
+
*
|
|
141
|
+
* @param codePath - A file of the running build.
|
|
142
|
+
* @returns The stamp, or null when there is none (running from source).
|
|
143
|
+
*/
|
|
144
|
+
export function readBuildProvenance(codePath) {
|
|
145
|
+
let dir = dirname(codePath);
|
|
146
|
+
for (;;) {
|
|
147
|
+
const stamp = join(dir, 'build-provenance.json');
|
|
148
|
+
if (existsSync(stamp)) {
|
|
149
|
+
try {
|
|
150
|
+
const parsed = JSON.parse(readFileSync(stamp, 'utf8'));
|
|
151
|
+
if (typeof parsed === 'object' && parsed !== null && 'linkedWorktree' in parsed) {
|
|
152
|
+
const value = parsed.linkedWorktree;
|
|
153
|
+
// Only an explicit null or a path is trusted; anything else falls back.
|
|
154
|
+
if (value === null || typeof value === 'string')
|
|
155
|
+
return { linkedWorktree: value };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
// An unreadable stamp decides nothing; fall back to the path.
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
if (existsSync(join(dir, 'package.json')))
|
|
164
|
+
return null;
|
|
165
|
+
const parent = dirname(dir);
|
|
166
|
+
if (parent === dir)
|
|
167
|
+
return null;
|
|
168
|
+
dir = parent;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The linked worktree this build came from, or null for a released build.
|
|
173
|
+
*
|
|
174
|
+
* @param options - Injection points; defaults describe this process.
|
|
175
|
+
* @returns The worktree root, or null.
|
|
176
|
+
*/
|
|
177
|
+
export function devBuildWorktree(options = {}) {
|
|
178
|
+
const codePath = options.codePath ?? overrides?.codePath ?? fileURLToPath(import.meta.url);
|
|
179
|
+
const provenance = options.provenance !== undefined
|
|
180
|
+
? options.provenance
|
|
181
|
+
: overrides?.provenance !== undefined
|
|
182
|
+
? overrides.provenance
|
|
183
|
+
: readBuildProvenance(codePath);
|
|
184
|
+
if (provenance)
|
|
185
|
+
return provenance.linkedWorktree;
|
|
186
|
+
if (codePath.split(/[\\/]/).includes('node_modules'))
|
|
187
|
+
return null;
|
|
188
|
+
return linkedWorktreeRootOf(codePath);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Why this build must not change the schema of `dbPath`, or null when it may.
|
|
192
|
+
*
|
|
193
|
+
* @param dbPath - Store path.
|
|
194
|
+
* @param options - Injection points; defaults describe this process.
|
|
195
|
+
* @returns The refusal naming the build's worktree, the store and the opt-in.
|
|
196
|
+
* @task T12687
|
|
197
|
+
*/
|
|
198
|
+
export function schemaWriteRefusal(dbPath, options = {}) {
|
|
199
|
+
const env = options.env ?? overrides?.env ?? process.env;
|
|
200
|
+
const buildWorktree = devBuildWorktree(options);
|
|
201
|
+
if (buildWorktree === null)
|
|
202
|
+
return null;
|
|
203
|
+
const store = realOrResolved(dbPath);
|
|
204
|
+
if (isWithin(realOrResolved(buildWorktree), store))
|
|
205
|
+
return null;
|
|
206
|
+
if (env['VITEST'])
|
|
207
|
+
return null; // the test harness owns its fixture stores
|
|
208
|
+
const honourTestSandbox = options.honourTestSandbox ?? overrides?.honourTestSandbox ?? true;
|
|
209
|
+
if (honourTestSandbox && insideTestSandbox(store))
|
|
210
|
+
return null;
|
|
211
|
+
if (env[ALLOW_WORKTREE_BUILD_MIGRATIONS_ENV] === '1')
|
|
212
|
+
return null;
|
|
213
|
+
return (`Refusing to change the schema of ${store}: this CLI was built inside the git worktree ` +
|
|
214
|
+
`${buildWorktree}, and its schema may be unreleased. Run the released \`cleo\` against this ` +
|
|
215
|
+
`store, or opt in with ${ALLOW_WORKTREE_BUILD_MIGRATIONS_ENV}=1 (T12687).`);
|
|
216
|
+
}
|
|
217
|
+
/** Backwards-compatible alias of {@link schemaWriteRefusal}. */
|
|
218
|
+
export const worktreeBuildMigrationRefusal = schemaWriteRefusal;
|
|
219
|
+
/**
|
|
220
|
+
* The per-store decision, memoised for the process (one decision per store).
|
|
221
|
+
*
|
|
222
|
+
* @param dbPath - Store path.
|
|
223
|
+
* @returns The refusal, or null when schema writes are allowed.
|
|
224
|
+
*/
|
|
225
|
+
function decisionFor(dbPath) {
|
|
226
|
+
const key = realOrResolved(dbPath);
|
|
227
|
+
if (!decisions.has(key))
|
|
228
|
+
decisions.set(key, schemaWriteRefusal(key));
|
|
229
|
+
return decisions.get(key) ?? null;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Whether this build may change the schema of the store behind `nativeDb`.
|
|
233
|
+
*
|
|
234
|
+
* @param nativeDb - Store handle (`location()` is its path; in-memory is always allowed).
|
|
235
|
+
* @returns `true` when schema writes are allowed.
|
|
236
|
+
*/
|
|
237
|
+
export function schemaWritesAllowed(nativeDb) {
|
|
238
|
+
const dbPath = nativeDb.location();
|
|
239
|
+
return !dbPath || decisionFor(dbPath) === null;
|
|
240
|
+
}
|
|
241
|
+
/** Refusal raised when a dev build would change a foreign store's schema (T12687). */
|
|
242
|
+
export class WorktreeBuildSchemaError extends CleoError {
|
|
243
|
+
constructor(message) {
|
|
244
|
+
super(ExitCode.CONFIG_ERROR, `${E_WORKTREE_BUILD_SCHEMA}: ${message}`, {
|
|
245
|
+
fix: 'Use the released `cleo` for this store, run the build against a store inside its own ' +
|
|
246
|
+
`worktree, or set ${ALLOW_WORKTREE_BUILD_MIGRATIONS_ENV}=1 to accept the schema change.`,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/** Whether `error` is (or wraps) a {@link WorktreeBuildSchemaError}. */
|
|
251
|
+
export function isWorktreeBuildSchemaError(error) {
|
|
252
|
+
return error instanceof Error && error.message.includes(E_WORKTREE_BUILD_SCHEMA);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* SQLite action codes, loaded on first use: `node:sqlite` must not load at
|
|
256
|
+
* module-init time (sqlite.ts imports this module; T1331 lazy-init contract).
|
|
257
|
+
*/
|
|
258
|
+
let authorizerCodes;
|
|
259
|
+
function codes() {
|
|
260
|
+
if (authorizerCodes)
|
|
261
|
+
return authorizerCodes;
|
|
262
|
+
const sqlite = createRequire(import.meta.url)('node:sqlite')
|
|
263
|
+
.constants;
|
|
264
|
+
authorizerCodes = {
|
|
265
|
+
sqlite,
|
|
266
|
+
creates: new Map([
|
|
267
|
+
[sqlite.SQLITE_CREATE_TABLE, 'table'],
|
|
268
|
+
[sqlite.SQLITE_CREATE_VTABLE, 'table'],
|
|
269
|
+
[sqlite.SQLITE_CREATE_INDEX, 'index'],
|
|
270
|
+
[sqlite.SQLITE_CREATE_TRIGGER, 'trigger'],
|
|
271
|
+
[sqlite.SQLITE_CREATE_VIEW, 'view'],
|
|
272
|
+
]),
|
|
273
|
+
changes: new Set([
|
|
274
|
+
sqlite.SQLITE_ALTER_TABLE,
|
|
275
|
+
sqlite.SQLITE_DROP_TABLE,
|
|
276
|
+
sqlite.SQLITE_DROP_INDEX,
|
|
277
|
+
sqlite.SQLITE_DROP_TRIGGER,
|
|
278
|
+
sqlite.SQLITE_DROP_VIEW,
|
|
279
|
+
sqlite.SQLITE_DROP_VTABLE,
|
|
280
|
+
]),
|
|
281
|
+
};
|
|
282
|
+
return authorizerCodes;
|
|
283
|
+
}
|
|
284
|
+
const guards = new WeakMap();
|
|
285
|
+
/** Refusal for an ATTACH whose store this build cannot identify from its name. */
|
|
286
|
+
const UNKNOWN_ATTACH_REFUSAL = 'a store was ATTACHed by a bound, computed or URI filename, so this build cannot tell whose ' +
|
|
287
|
+
'store it is; schema changes on unmapped schemas are refused until the guard is refreshed';
|
|
288
|
+
/**
|
|
289
|
+
* The refusal for an ATTACH, judged from the name SQLite's callback reports.
|
|
290
|
+
*
|
|
291
|
+
* Only a plain path is judged directly. The callback reports the filename only
|
|
292
|
+
* when it is a string literal (null otherwise), and a `file:` URI or a name
|
|
293
|
+
* with a `?` query is not a path: resolved against cwd it lands inside the
|
|
294
|
+
* worktree and would pass. Those fail closed until a refresh maps the real
|
|
295
|
+
* path from `PRAGMA database_list`. `''` and `:memory:` open private stores.
|
|
296
|
+
*
|
|
297
|
+
* @param name - The ATTACH callback's filename argument.
|
|
298
|
+
* @returns The refusal, or `null` when the attach is allowed.
|
|
299
|
+
*/
|
|
300
|
+
function attachRefusal(name) {
|
|
301
|
+
if (name === '' || name === ':memory:')
|
|
302
|
+
return null;
|
|
303
|
+
if (typeof name !== 'string' || /^file:/i.test(name) || name.includes('?')) {
|
|
304
|
+
return UNKNOWN_ATTACH_REFUSAL;
|
|
305
|
+
}
|
|
306
|
+
return decisionFor(name);
|
|
307
|
+
}
|
|
308
|
+
function readSchemas(nativeDb) {
|
|
309
|
+
const schemas = new Map();
|
|
310
|
+
const list = nativeDb.prepare('PRAGMA database_list').all();
|
|
311
|
+
for (const { name, file } of list) {
|
|
312
|
+
if (name === 'temp')
|
|
313
|
+
continue;
|
|
314
|
+
const rows = nativeDb
|
|
315
|
+
.prepare(`SELECT type, name FROM "${name.replaceAll('"', '""')}".sqlite_master`)
|
|
316
|
+
.all();
|
|
317
|
+
schemas.set(name.toLowerCase(), {
|
|
318
|
+
refusal: file ? decisionFor(file) : null, // '' = in-memory
|
|
319
|
+
objects: new Set(rows.map((r) => `${r.type}:${r.name}`)),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
return schemas;
|
|
323
|
+
}
|
|
324
|
+
let processBuildWorktree;
|
|
325
|
+
/** Whether this process is a dev build outside the test harness (the guard's precondition). */
|
|
326
|
+
function guardActive() {
|
|
327
|
+
const env = overrides?.env ?? process.env;
|
|
328
|
+
if (env['VITEST'])
|
|
329
|
+
return false;
|
|
330
|
+
if (overrides)
|
|
331
|
+
return devBuildWorktree() !== null;
|
|
332
|
+
if (processBuildWorktree === undefined)
|
|
333
|
+
processBuildWorktree = devBuildWorktree();
|
|
334
|
+
return processBuildWorktree !== null;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Install the schema-write guard on a freshly opened writable handle. Call it
|
|
338
|
+
* right after opening, before any schema code runs.
|
|
339
|
+
*
|
|
340
|
+
* Only a dev build (outside the test harness) installs anything; released
|
|
341
|
+
* builds pay nothing. The authorizer then applies, PER SCHEMA, the decision
|
|
342
|
+
* for that schema's file: on a refused schema it denies `ALTER`, `DROP` and
|
|
343
|
+
* any `CREATE` of an object that does not already exist. That covers the main
|
|
344
|
+
* schema and any store ATTACHed later — an exempt handle (in-memory or inside
|
|
345
|
+
* the build's own worktree) that attaches a foreign store is guarded on the
|
|
346
|
+
* attached schema too.
|
|
347
|
+
*
|
|
348
|
+
* @param nativeDb - Freshly opened writable handle.
|
|
349
|
+
* @returns `true` when the main schema itself is refused.
|
|
350
|
+
* @task T12687
|
|
351
|
+
*/
|
|
352
|
+
export function installSchemaWriteGuard(nativeDb) {
|
|
353
|
+
if (!guardActive())
|
|
354
|
+
return false;
|
|
355
|
+
const location = nativeDb.location();
|
|
356
|
+
const mainRefusal = location ? decisionFor(location) : null; // in-memory is always allowed
|
|
357
|
+
if (typeof nativeDb.setAuthorizer !== 'function') {
|
|
358
|
+
// No authorizer in this Node: refuse a refused store outright rather than
|
|
359
|
+
// leave schema code unguarded.
|
|
360
|
+
if (mainRefusal)
|
|
361
|
+
throw new WorktreeBuildSchemaError(mainRefusal);
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
const state = {
|
|
365
|
+
schemas: readSchemas(nativeDb),
|
|
366
|
+
unmappedAttachRefusal: null,
|
|
367
|
+
stale: false,
|
|
368
|
+
lastDenied: null,
|
|
369
|
+
};
|
|
370
|
+
guards.set(nativeDb, state);
|
|
371
|
+
const { sqlite, creates, changes } = codes();
|
|
372
|
+
nativeDb.setAuthorizer((action, arg1, arg2, dbName) => {
|
|
373
|
+
if (action === sqlite.SQLITE_ATTACH) {
|
|
374
|
+
const refusal = attachRefusal(arg1);
|
|
375
|
+
if (refusal && !state.unmappedAttachRefusal)
|
|
376
|
+
state.unmappedAttachRefusal = refusal;
|
|
377
|
+
return sqlite.SQLITE_OK;
|
|
378
|
+
}
|
|
379
|
+
if (action === sqlite.SQLITE_DETACH) {
|
|
380
|
+
state.stale = true;
|
|
381
|
+
return sqlite.SQLITE_OK;
|
|
382
|
+
}
|
|
383
|
+
const createType = creates.get(action);
|
|
384
|
+
if (createType === undefined && !changes.has(action))
|
|
385
|
+
return sqlite.SQLITE_OK;
|
|
386
|
+
// SQLITE_ALTER_TABLE passes (schema, table) in arg1/arg2 and no dbName;
|
|
387
|
+
// every other action passes the schema as dbName.
|
|
388
|
+
// Schema names are case-insensitive in SQLite; the map is keyed lower-case.
|
|
389
|
+
const schema = ((action === sqlite.SQLITE_ALTER_TABLE ? arg1 : dbName) ?? 'main').toLowerCase();
|
|
390
|
+
if (schema === 'temp')
|
|
391
|
+
return sqlite.SQLITE_OK;
|
|
392
|
+
// After a DETACH every schema is unmapped until refresh. Its old refusal
|
|
393
|
+
// still applies, because the DETACH may have failed after authorization.
|
|
394
|
+
const mapped = state.schemas.get(schema);
|
|
395
|
+
const policy = state.stale ? undefined : mapped;
|
|
396
|
+
const refusal = policy
|
|
397
|
+
? policy.refusal
|
|
398
|
+
: (mapped?.refusal ?? null) || state.unmappedAttachRefusal;
|
|
399
|
+
if (refusal === null)
|
|
400
|
+
return sqlite.SQLITE_OK;
|
|
401
|
+
// CREATE … IF NOT EXISTS of an existing object is a no-op.
|
|
402
|
+
if (createType !== undefined && policy?.objects.has(`${createType}:${arg1}`)) {
|
|
403
|
+
return sqlite.SQLITE_OK;
|
|
404
|
+
}
|
|
405
|
+
state.lastDenied = {
|
|
406
|
+
what: createType !== undefined
|
|
407
|
+
? `CREATE ${createType} ${schema}.${arg1}`
|
|
408
|
+
: `schema change on ${schema}.${(action === sqlite.SQLITE_ALTER_TABLE ? arg2 : arg1) ?? ''}`,
|
|
409
|
+
refusal,
|
|
410
|
+
};
|
|
411
|
+
return sqlite.SQLITE_DENY;
|
|
412
|
+
});
|
|
413
|
+
return mainRefusal !== null;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Re-read the schema map after an `ATTACH`, so the attached schema gets its own
|
|
417
|
+
* decision and no-op `CREATE … IF NOT EXISTS` statements on it stay allowed.
|
|
418
|
+
*
|
|
419
|
+
* @param nativeDb - A handle passed to {@link installSchemaWriteGuard}.
|
|
420
|
+
*/
|
|
421
|
+
export function refreshSchemaWriteGuard(nativeDb) {
|
|
422
|
+
const state = guards.get(nativeDb);
|
|
423
|
+
if (!state)
|
|
424
|
+
return;
|
|
425
|
+
state.schemas = readSchemas(nativeDb);
|
|
426
|
+
state.unmappedAttachRefusal = null;
|
|
427
|
+
state.stale = false;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Turn SQLite's bare `not authorized` from a guarded handle into the refusal
|
|
431
|
+
* that says why and what to do. Other errors are returned unchanged.
|
|
432
|
+
*
|
|
433
|
+
* @param nativeDb - The handle the error came from.
|
|
434
|
+
* @param error - The caught error.
|
|
435
|
+
* @returns The error to rethrow.
|
|
436
|
+
*/
|
|
437
|
+
export function explainSchemaWriteDenial(nativeDb, error) {
|
|
438
|
+
if (!(error instanceof Error) || !/not authorized/i.test(error.message))
|
|
439
|
+
return error;
|
|
440
|
+
const denied = guards.get(nativeDb)?.lastDenied;
|
|
441
|
+
if (!denied)
|
|
442
|
+
return error;
|
|
443
|
+
return new WorktreeBuildSchemaError(`${denied.refusal} Denied: ${denied.what}.`);
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Migrations of one lineage that `nativeDb`'s journal does not yet record.
|
|
447
|
+
*
|
|
448
|
+
* @param nativeDb - Store handle.
|
|
449
|
+
* @param migrations - The lineage's local migrations.
|
|
450
|
+
* @returns Names (or hashes) of the pending migrations; all of them when the
|
|
451
|
+
* journal table does not exist yet.
|
|
452
|
+
*/
|
|
453
|
+
export function pendingMigrations(nativeDb, migrations) {
|
|
454
|
+
const hasJournal = nativeDb
|
|
455
|
+
.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = '__drizzle_migrations'")
|
|
456
|
+
.get();
|
|
457
|
+
const applied = hasJournal
|
|
458
|
+
? new Set(nativeDb.prepare('SELECT hash FROM main."__drizzle_migrations"').all().map((row) => row.hash))
|
|
459
|
+
: new Set();
|
|
460
|
+
return migrations.filter((m) => !applied.has(m.hash)).map((m) => m.name ?? m.hash);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* The guard at a migration site: when this build may not change the store's
|
|
464
|
+
* schema and the lineage has pending migrations, FAIL FAST — the store does
|
|
465
|
+
* not match what this build reads, so continuing would only fail later with
|
|
466
|
+
* `no such column`.
|
|
467
|
+
*
|
|
468
|
+
* @param nativeDb - Store handle.
|
|
469
|
+
* @param migrations - The lineage's local migrations.
|
|
470
|
+
* @throws {WorktreeBuildSchemaError} naming the build worktree, the store,
|
|
471
|
+
* the pending migrations and the opt-in.
|
|
472
|
+
* @task T12687
|
|
473
|
+
*/
|
|
474
|
+
export function assertNoPendingMigrationsForWorktreeBuild(nativeDb, migrations) {
|
|
475
|
+
const dbPath = nativeDb.location();
|
|
476
|
+
if (!dbPath)
|
|
477
|
+
return;
|
|
478
|
+
const refusal = decisionFor(dbPath);
|
|
479
|
+
if (refusal === null)
|
|
480
|
+
return;
|
|
481
|
+
const pending = pendingMigrations(nativeDb, migrations);
|
|
482
|
+
if (pending.length === 0)
|
|
483
|
+
return;
|
|
484
|
+
throw new WorktreeBuildSchemaError(`${refusal} Pending migrations: ${pending.join(', ')}.`);
|
|
485
|
+
}
|
|
486
|
+
//# sourceMappingURL=worktree-build-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-build-guard.js","sourceRoot":"","sources":["../../src/store/worktree-build-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;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,CAAC,CAAC,GAAG,EAGrE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CACzB;QACH,CAAC,CAAC,IAAI,GAAG,EAAU,CAAC;IACtB,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACrF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,yCAAyC,CACvD,QAAsB,EACtB,UAAoC;IAEpC,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACnC,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO;IAC7B,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACjC,MAAM,IAAI,wBAAwB,CAAC,GAAG,OAAO,wBAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -61,4 +61,31 @@ export declare function assertStorePathIsNotWorktreeResident(role: string, dbPat
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
export declare function assertDbPathIsNotWorktreeResident(role: string, cwd?: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Guard a manual restore (`cleo restore backup`, `admin.backup` restore) that
|
|
66
|
+
* is run from inside a linked git worktree (T12680).
|
|
67
|
+
*
|
|
68
|
+
* Path resolution maps a worktree to its owning project, so a restore run in a
|
|
69
|
+
* worktree overwrites the owning project's LIVE store. That is allowed only
|
|
70
|
+
* with an explicit confirmation naming it. When the owner cannot hold a
|
|
71
|
+
* store (not an initialised CLEO project, or a bare repository) the restore
|
|
72
|
+
* would land in the worktree's own `.cleo/`, which CLEO never reads; that is
|
|
73
|
+
* refused outright.
|
|
74
|
+
*
|
|
75
|
+
* @param storeRoot - Project root whose `.cleo/` the restore writes.
|
|
76
|
+
* @param opts - `cwd` the restore was invoked from (required: core never
|
|
77
|
+
* falls back to `process.cwd()`; the CLI layer supplies it), and
|
|
78
|
+
* `confirmOwnerStore` to allow overwriting the owner's live store.
|
|
79
|
+
* @throws `CleoError` `E_WT_RESTORE_REFUSED` when the owner cannot hold the
|
|
80
|
+
* store, or `E_WT_RESTORE_CONFIRM_REQUIRED` when confirmation is missing.
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* assertRestoreTargetConfirmed('/home/u/project', { cwd: '/data/cleo/worktrees/abc/T1' }); // throws
|
|
84
|
+
* ```
|
|
85
|
+
* @task T12680
|
|
86
|
+
*/
|
|
87
|
+
export declare function assertRestoreTargetConfirmed(storeRoot: string, opts: {
|
|
88
|
+
cwd: string;
|
|
89
|
+
confirmOwnerStore?: boolean | undefined;
|
|
90
|
+
}): void;
|
|
64
91
|
//# sourceMappingURL=worktree-isolation-guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-isolation-guard.d.ts","sourceRoot":"","sources":["../../src/store/worktree-isolation-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"worktree-isolation-guard.d.ts","sourceRoot":"","sources":["../../src/store/worktree-isolation-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oCAAoC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAoBvF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAUlF;AAmBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GAC7D,IAAI,CA6BN"}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* @saga T9800
|
|
16
16
|
* @decision D009
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { existsSync } from 'node:fs';
|
|
19
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
19
20
|
import { ExitCode } from '@cleocode/contracts';
|
|
20
21
|
import { CleoError } from '../errors.js';
|
|
21
22
|
import { resolveCleoDir } from '../paths.js';
|
|
@@ -95,4 +96,69 @@ export function assertDbPathIsNotWorktreeResident(role, cwd) {
|
|
|
95
96
|
}
|
|
96
97
|
assertStorePathIsNotWorktreeResident(role, join(cleoDir, PROJECT_STORE_FILENAME));
|
|
97
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* The root of the git checkout enclosing `dir`: the nearest ancestor (or `dir`
|
|
101
|
+
* itself) holding a `.git` entry.
|
|
102
|
+
*
|
|
103
|
+
* @param dir - Starting directory.
|
|
104
|
+
* @returns The checkout root, or `null` outside any checkout.
|
|
105
|
+
*/
|
|
106
|
+
function enclosingCheckout(dir) {
|
|
107
|
+
let current = resolve(dir);
|
|
108
|
+
for (;;) {
|
|
109
|
+
if (existsSync(join(current, '.git')))
|
|
110
|
+
return current;
|
|
111
|
+
const parent = dirname(current);
|
|
112
|
+
if (parent === current)
|
|
113
|
+
return null;
|
|
114
|
+
current = parent;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Guard a manual restore (`cleo restore backup`, `admin.backup` restore) that
|
|
119
|
+
* is run from inside a linked git worktree (T12680).
|
|
120
|
+
*
|
|
121
|
+
* Path resolution maps a worktree to its owning project, so a restore run in a
|
|
122
|
+
* worktree overwrites the owning project's LIVE store. That is allowed only
|
|
123
|
+
* with an explicit confirmation naming it. When the owner cannot hold a
|
|
124
|
+
* store (not an initialised CLEO project, or a bare repository) the restore
|
|
125
|
+
* would land in the worktree's own `.cleo/`, which CLEO never reads; that is
|
|
126
|
+
* refused outright.
|
|
127
|
+
*
|
|
128
|
+
* @param storeRoot - Project root whose `.cleo/` the restore writes.
|
|
129
|
+
* @param opts - `cwd` the restore was invoked from (required: core never
|
|
130
|
+
* falls back to `process.cwd()`; the CLI layer supplies it), and
|
|
131
|
+
* `confirmOwnerStore` to allow overwriting the owner's live store.
|
|
132
|
+
* @throws `CleoError` `E_WT_RESTORE_REFUSED` when the owner cannot hold the
|
|
133
|
+
* store, or `E_WT_RESTORE_CONFIRM_REQUIRED` when confirmation is missing.
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* assertRestoreTargetConfirmed('/home/u/project', { cwd: '/data/cleo/worktrees/abc/T1' }); // throws
|
|
137
|
+
* ```
|
|
138
|
+
* @task T12680
|
|
139
|
+
*/
|
|
140
|
+
export function assertRestoreTargetConfirmed(storeRoot, opts) {
|
|
141
|
+
const checkout = enclosingCheckout(opts.cwd);
|
|
142
|
+
const worktree = isGitLinkedCheckout(storeRoot)
|
|
143
|
+
? storeRoot
|
|
144
|
+
: checkout !== null && isGitLinkedCheckout(checkout)
|
|
145
|
+
? checkout
|
|
146
|
+
: null;
|
|
147
|
+
if (worktree === null)
|
|
148
|
+
return;
|
|
149
|
+
const owner = describeWorktreeOwner(worktree);
|
|
150
|
+
const target = join(storeRoot, '.cleo');
|
|
151
|
+
// The store resolved to the worktree itself: its owner is not an
|
|
152
|
+
// initialised project or is a bare repository (named in `owner`).
|
|
153
|
+
if (isGitLinkedCheckout(storeRoot)) {
|
|
154
|
+
throw new CleoError(ExitCode.CONFIG_ERROR, `E_WT_RESTORE_REFUSED: restore run from git worktree ${worktree} would write ${target}, a store CLEO never reads — ${owner}.`, {
|
|
155
|
+
fix: 'Run the restore from an initialised CLEO project (see the owning repository above); nothing was written.',
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (opts.confirmOwnerStore)
|
|
159
|
+
return;
|
|
160
|
+
throw new CleoError(ExitCode.CONFIG_ERROR, `E_WT_RESTORE_CONFIRM_REQUIRED: restore run from git worktree ${worktree} would overwrite the LIVE store ${target}; this worktree's ${owner}.`, {
|
|
161
|
+
fix: `Re-run with --confirm-owner-store to overwrite ${target}, or run the restore from ${storeRoot}. Nothing was written.`,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
98
164
|
//# sourceMappingURL=worktree-isolation-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-isolation-guard.js","sourceRoot":"","sources":["../../src/store/worktree-isolation-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"worktree-isolation-guard.js","sourceRoot":"","sources":["../../src/store/worktree-isolation-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAA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9I;QACE,GAAG,EAAE,kDAAkD,MAAM,6BAA6B,SAAS,wBAAwB;KAC5H,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer-lease.d.ts","sourceRoot":"","sources":["../../src/store/writer-lease.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"writer-lease.d.ts","sourceRoot":"","sources":["../../src/store/writer-lease.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAoB1E,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,oGAAoG;IACpG,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CA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