@cleocode/core 2026.8.1 → 2026.8.3
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/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +57 -27
- package/dist/bootstrap.js.map +1 -1
- package/dist/check/pr-gate.d.ts.map +1 -1
- package/dist/check/pr-gate.js +9 -0
- package/dist/check/pr-gate.js.map +1 -1
- package/dist/db/index.d.ts +13 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +13 -0
- package/dist/db/index.js.map +1 -1
- package/dist/docs/display-alias.js +1 -1
- package/dist/docs/display-alias.js.map +1 -1
- package/dist/docs/export-document.js +499 -380
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/numbering.js +1 -1
- package/dist/docs/numbering.js.map +1 -1
- package/dist/docs/supersede.js +1 -1
- package/dist/docs/supersede.js.map +1 -1
- package/dist/hooks/registry.d.ts +2 -2
- package/dist/hooks/registry.d.ts.map +1 -1
- package/dist/hooks/registry.js +5 -0
- package/dist/hooks/registry.js.map +1 -1
- package/dist/hooks/types.d.ts +59 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/init/scaffold-workflows.d.ts +12 -0
- package/dist/init/scaffold-workflows.d.ts.map +1 -1
- package/dist/init/scaffold-workflows.js +16 -0
- 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 +16 -0
- package/dist/init/upgrade-workflows.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +16 -1
- package/dist/init.js.map +1 -1
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +44 -3
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/lifecycle/index.js +1 -1
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/llm/credentials.d.ts +16 -1
- package/dist/llm/credentials.d.ts.map +1 -1
- package/dist/llm/credentials.js.map +1 -1
- package/dist/llm/cross-provider-selector.d.ts +25 -0
- package/dist/llm/cross-provider-selector.d.ts.map +1 -1
- package/dist/llm/cross-provider-selector.js +76 -3
- package/dist/llm/cross-provider-selector.js.map +1 -1
- package/dist/llm/local-inference-probe.d.ts +101 -0
- package/dist/llm/local-inference-probe.d.ts.map +1 -0
- package/dist/llm/local-inference-probe.js +174 -0
- package/dist/llm/local-inference-probe.js.map +1 -0
- package/dist/llm/plugin-facade.js +429 -115
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/role-executor.d.ts.map +1 -1
- package/dist/llm/role-executor.js +95 -9
- package/dist/llm/role-executor.js.map +1 -1
- package/dist/llm/role-resolver.d.ts +10 -0
- package/dist/llm/role-resolver.d.ts.map +1 -1
- package/dist/llm/role-resolver.js +92 -1
- package/dist/llm/role-resolver.js.map +1 -1
- package/dist/llm/system-resolver.d.ts.map +1 -1
- package/dist/llm/system-resolver.js +2 -0
- package/dist/llm/system-resolver.js.map +1 -1
- package/dist/memory/brain-backfill.js +3 -3
- package/dist/memory/brain-backfill.js.map +1 -1
- package/dist/memory/brain-consolidator.js +2 -2
- package/dist/memory/brain-consolidator.js.map +1 -1
- package/dist/memory/brain-doctor.js +1 -1
- package/dist/memory/brain-doctor.js.map +1 -1
- package/dist/memory/brain-health-dashboard.js +1 -1
- package/dist/memory/brain-health-dashboard.js.map +1 -1
- package/dist/memory/brain-lifecycle.js +10 -10
- package/dist/memory/brain-lifecycle.js.map +1 -1
- package/dist/memory/brain-maintenance.js +1 -1
- package/dist/memory/brain-maintenance.js.map +1 -1
- package/dist/memory/brain-page-nodes.js +4 -4
- package/dist/memory/brain-page-nodes.js.map +1 -1
- package/dist/memory/brain-reasoning.js +1 -1
- package/dist/memory/brain-reasoning.js.map +1 -1
- package/dist/memory/brain-search.d.ts +109 -0
- package/dist/memory/brain-search.d.ts.map +1 -1
- package/dist/memory/brain-search.js +150 -38
- package/dist/memory/brain-search.js.map +1 -1
- package/dist/memory/brain-similarity.js +1 -1
- package/dist/memory/brain-similarity.js.map +1 -1
- package/dist/memory/brain-stdp.js +6 -6
- package/dist/memory/brain-stdp.js.map +1 -1
- package/dist/memory/brain-stub-prune.d.ts +109 -0
- package/dist/memory/brain-stub-prune.d.ts.map +1 -0
- package/dist/memory/brain-stub-prune.js +155 -0
- package/dist/memory/brain-stub-prune.js.map +1 -0
- package/dist/memory/brain-sweep-executor.js +1 -1
- package/dist/memory/brain-sweep-executor.js.map +1 -1
- package/dist/memory/brain-writer-handlers.js +2 -2
- package/dist/memory/brain-writer-handlers.js.map +1 -1
- package/dist/memory/claude-mem-migration.d.ts.map +1 -1
- package/dist/memory/claude-mem-migration.js +2 -2
- package/dist/memory/claude-mem-migration.js.map +1 -1
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/engine-compat.js +65 -7
- package/dist/memory/engine-compat.js.map +1 -1
- package/dist/memory/extraction-gate.js +3 -3
- package/dist/memory/extraction-gate.js.map +1 -1
- package/dist/memory/graph-memory-bridge.js +9 -9
- package/dist/memory/graph-memory-bridge.js.map +1 -1
- package/dist/memory/graph-queries.js +4 -4
- package/dist/memory/graph-queries.js.map +1 -1
- package/dist/memory/llm-extraction.js +1 -1
- package/dist/memory/llm-extraction.js.map +1 -1
- package/dist/memory/memory-bridge.js +1 -1
- package/dist/memory/memory-bridge.js.map +1 -1
- package/dist/memory/nexus-plasticity.js +1 -1
- package/dist/memory/nexus-plasticity.js.map +1 -1
- package/dist/memory/observer-reflector.js +1 -1
- package/dist/memory/observer-reflector.js.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.js +13 -3
- package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
- package/dist/memory/quality-feedback.js +4 -4
- package/dist/memory/quality-feedback.js.map +1 -1
- package/dist/memory/retrieval/increment-citation-counts.js +1 -1
- package/dist/memory/retrieval/increment-citation-counts.js.map +1 -1
- package/dist/memory/retrieval/log-retrieval.js +1 -1
- package/dist/memory/retrieval/log-retrieval.js.map +1 -1
- package/dist/memory/retrieval/observe.js +1 -1
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/memory/retrieval/search.js +1 -1
- package/dist/memory/retrieval/search.js.map +1 -1
- package/dist/memory/retrieval/timeline.js +1 -1
- package/dist/memory/retrieval/timeline.js.map +1 -1
- package/dist/memory/sleep-consolidation.js +4 -4
- package/dist/memory/sleep-consolidation.js.map +1 -1
- package/dist/memory/temporal-supersession.js +5 -5
- package/dist/memory/temporal-supersession.js.map +1 -1
- package/dist/memory/transcript-extractor.js +1 -1
- package/dist/memory/transcript-extractor.js.map +1 -1
- package/dist/memory/transcript-ingestor.js +1 -1
- package/dist/memory/transcript-ingestor.js.map +1 -1
- package/dist/memory/transcript-scanner.js +1 -1
- package/dist/memory/transcript-scanner.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +28 -0
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/context.d.ts.map +1 -1
- package/dist/nexus/context.js +3 -3
- package/dist/nexus/context.js.map +1 -1
- package/dist/nexus/impact.d.ts.map +1 -1
- package/dist/nexus/impact.js +3 -3
- package/dist/nexus/impact.js.map +1 -1
- package/dist/nexus/living-brain.js +7 -7
- package/dist/nexus/living-brain.js.map +1 -1
- package/dist/nexus/symbol-miss.d.ts +132 -0
- package/dist/nexus/symbol-miss.d.ts.map +1 -0
- package/dist/nexus/symbol-miss.js +168 -0
- package/dist/nexus/symbol-miss.js.map +1 -0
- package/dist/nexus/tasks-bridge.js +4 -4
- package/dist/nexus/tasks-bridge.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts +21 -1
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +39 -2
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestrate/worker-verify.d.ts.map +1 -1
- package/dist/orchestrate/worker-verify.js +22 -0
- package/dist/orchestrate/worker-verify.js.map +1 -1
- package/dist/release/changesets-aggregator.d.ts.map +1 -1
- package/dist/release/changesets-aggregator.js +15 -1
- package/dist/release/changesets-aggregator.js.map +1 -1
- package/dist/release/open.d.ts +29 -2
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +48 -11
- package/dist/release/open.js.map +1 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +5 -1
- package/dist/release/reconcile.js.map +1 -1
- package/dist/resources/governor.d.ts +12 -2
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +12 -3
- package/dist/resources/governor.js.map +1 -1
- package/dist/sagas/migrate-containment.d.ts.map +1 -1
- package/dist/sagas/migrate-containment.js +4 -2
- package/dist/sagas/migrate-containment.js.map +1 -1
- package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
- package/dist/scaffold/ensure-dirs.js +15 -3
- package/dist/scaffold/ensure-dirs.js.map +1 -1
- package/dist/scaffold/project-detection.d.ts.map +1 -1
- package/dist/scaffold/project-detection.js +2 -1
- package/dist/scaffold/project-detection.js.map +1 -1
- package/dist/selfimprove/draft-pr.d.ts +14 -1
- package/dist/selfimprove/draft-pr.d.ts.map +1 -1
- package/dist/selfimprove/draft-pr.js.map +1 -1
- package/dist/selfimprove/fix-gen.d.ts +0 -21
- package/dist/selfimprove/fix-gen.d.ts.map +1 -1
- package/dist/selfimprove/fix-gen.js +509 -173
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/selfimprove/run-loop.d.ts.map +1 -1
- package/dist/selfimprove/run-loop.js +50 -19
- package/dist/selfimprove/run-loop.js.map +1 -1
- package/dist/selfimprove/scenarios/dhq-replay-find/golden.json +114 -4
- package/dist/selfimprove/scenarios/dhq-replay-find/scenario.json +3 -3
- package/dist/sentient/dream-cycle.d.ts +20 -19
- package/dist/sentient/dream-cycle.d.ts.map +1 -1
- package/dist/sentient/dream-cycle.js +323 -12
- package/dist/sentient/dream-cycle.js.map +1 -1
- package/dist/sentient/dream-watermark.d.ts +134 -0
- package/dist/sentient/dream-watermark.d.ts.map +1 -0
- package/dist/sentient/dream-watermark.js +156 -0
- package/dist/sentient/dream-watermark.js.map +1 -0
- package/dist/sentient/hygiene-scan.js +1 -1
- package/dist/sentient/hygiene-scan.js.map +1 -1
- package/dist/sentient/propose-tick.js +3 -3
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sentient/stage-drift-tick.js +1 -1
- package/dist/sentient/stage-drift-tick.js.map +1 -1
- package/dist/sentient/state.d.ts +17 -0
- package/dist/sentient/state.d.ts.map +1 -1
- package/dist/sentient/state.js +22 -3
- package/dist/sentient/state.js.map +1 -1
- package/dist/sentient/tick.d.ts.map +1 -1
- package/dist/sentient/tick.js +79 -2
- package/dist/sentient/tick.js.map +1 -1
- package/dist/sequence/index.js +1 -1
- package/dist/sequence/index.js.map +1 -1
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +5 -1
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/snapshot.d.ts.map +1 -1
- package/dist/sessions/snapshot.js +6 -3
- package/dist/sessions/snapshot.js.map +1 -1
- package/dist/store/agent-registry-store.d.ts.map +1 -1
- package/dist/store/agent-registry-store.js +71 -28
- package/dist/store/agent-registry-store.js.map +1 -1
- package/dist/store/attachment-store.js +3 -3
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/checkpoint-git-dir.d.ts +95 -0
- package/dist/store/checkpoint-git-dir.d.ts.map +1 -0
- package/dist/store/checkpoint-git-dir.js +111 -0
- package/dist/store/checkpoint-git-dir.js.map +1 -0
- package/dist/store/conduit-sqlite.d.ts +21 -1
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +42 -56
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts +39 -0
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +26 -8
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/git-checkpoint.d.ts.map +1 -1
- package/dist/store/git-checkpoint.js +6 -5
- package/dist/store/git-checkpoint.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts +57 -3
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +70 -89
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/nexus-sqlite.d.ts +42 -0
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.js +79 -115
- package/dist/store/nexus-sqlite.js.map +1 -1
- package/dist/store/ports/domain-binding.d.ts +233 -0
- package/dist/store/ports/domain-binding.d.ts.map +1 -0
- package/dist/store/ports/domain-binding.js +500 -0
- package/dist/store/ports/domain-binding.js.map +1 -0
- package/dist/store/ports/fk-integrity.d.ts +155 -0
- package/dist/store/ports/fk-integrity.d.ts.map +1 -0
- package/dist/store/ports/fk-integrity.js +182 -0
- package/dist/store/ports/fk-integrity.js.map +1 -0
- package/dist/store/role-accessors-impl.js +2 -2
- package/dist/store/role-accessors-impl.js.map +1 -1
- package/dist/store/skills-db.d.ts +19 -0
- package/dist/store/skills-db.d.ts.map +1 -1
- package/dist/store/skills-db.js +80 -72
- package/dist/store/skills-db.js.map +1 -1
- package/dist/store/sqlite-backup.js +2 -2
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.js +1 -1
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +72 -10
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +173 -160
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/tasks-sqlite.js +2 -2
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/system/health.d.ts +0 -4
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +60 -3
- package/dist/system/health.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +40 -4
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/collection.d.ts +51 -0
- package/dist/tasks/collection.d.ts.map +1 -0
- package/dist/tasks/collection.js +81 -0
- package/dist/tasks/collection.js.map +1 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +8 -3
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +17 -0
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/find.d.ts +50 -0
- package/dist/tasks/find.d.ts.map +1 -1
- package/dist/tasks/find.js +63 -2
- package/dist/tasks/find.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +1 -1
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +83 -0
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-semaphore.d.ts +82 -12
- package/dist/tasks/tool-semaphore.d.ts.map +1 -1
- package/dist/tasks/tool-semaphore.js +79 -17
- package/dist/tasks/tool-semaphore.js.map +1 -1
- package/dist/upgrade.js +2 -2
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +23 -1
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +79 -19
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/worktree/list.js +1 -1
- package/dist/worktree/list.js.map +1 -1
- package/package.json +23 -13
- package/templates/CLEO-INJECTION.md +40 -25
- package/templates/workflows/release-prepare.yml.tmpl +73 -16
|
@@ -79,6 +79,10 @@ import { getCleoHome } from '../paths.js';
|
|
|
79
79
|
// existing callers (nexusSchema.* queries) compile and run without change.
|
|
80
80
|
import { openDualScopeDb, resolveDualScopeDbPath } from './dual-scope-db.js';
|
|
81
81
|
import { ensureColumns, migrateWithRetry, reconcileJournal } from './migration-manager.js';
|
|
82
|
+
// T12039: the nexus domain no longer owns a singleton — the path-keyed binding
|
|
83
|
+
// registry does. This module contributes only its schema reconciliation + the
|
|
84
|
+
// GLOBAL registry ATTACH.
|
|
85
|
+
import { bindProjectDomain, boundProjectNative, peekProjectDomain, releaseDomainBindings, } from './ports/domain-binding.js';
|
|
82
86
|
import { resolveConsolidatedJournalSiblings, resolveCorePackageMigrationsFolder, } from './resolve-migrations-folder.js';
|
|
83
87
|
import * as nexusSchema from './schema/nexus-schema.js';
|
|
84
88
|
// isSqliteBusy is a pure predicate with no node:sqlite dependency — import it
|
|
@@ -87,20 +91,6 @@ import * as nexusSchema from './schema/nexus-schema.js';
|
|
|
87
91
|
import { isSqliteBusy } from './with-retry.js';
|
|
88
92
|
/** Schema version for newly created nexus databases. Single source of truth. */
|
|
89
93
|
export const NEXUS_SCHEMA_VERSION = '1.0.0';
|
|
90
|
-
/** Singleton state for lazy initialization. */
|
|
91
|
-
let _nexusDb = null;
|
|
92
|
-
let _nexusNativeDb = null;
|
|
93
|
-
let _nexusDbPath = null;
|
|
94
|
-
/**
|
|
95
|
-
* The GLOBAL registry path the current singleton's ATTACH targets (ADR-090 ·
|
|
96
|
-
* T11648). When `getCleoHome()` changes (e.g. tests mutating `CLEO_HOME`), the
|
|
97
|
-
* attached global differs AND must be migrated via `openDualScopeDb('global')` —
|
|
98
|
-
* which only runs on the init path. So a registry-path change forces a full
|
|
99
|
-
* singleton reset rather than a cheap re-attach to an unmigrated file.
|
|
100
|
-
*/
|
|
101
|
-
let _nexusRegistryPath = null;
|
|
102
|
-
/** Guard against concurrent initialization (async migration). */
|
|
103
|
-
let _nexusInitPromise = null;
|
|
104
94
|
/**
|
|
105
95
|
* SQLite ATTACH alias under which the GLOBAL consolidated `cleo.db` is mounted
|
|
106
96
|
* into the PROJECT-scope nexus handle so the cross-project registry/identity
|
|
@@ -554,17 +544,19 @@ function ensureNexusRelationWeights(nativeDb) {
|
|
|
554
544
|
* @task T11578
|
|
555
545
|
* @task T11648
|
|
556
546
|
*/
|
|
557
|
-
function runNexusMigrations(nativeDb, db) {
|
|
547
|
+
function runNexusMigrations(nativeDb, db, dbPath) {
|
|
558
548
|
const migrationsFolder = resolveNexusMigrationsFolder();
|
|
559
549
|
// If existing DB with populated graph, create a safety backup (cleo compat).
|
|
560
550
|
// Sentinel is `nexus_nodes` — the canonical project-scope graph table in
|
|
561
551
|
// `main` (ADR-090 · T11648); the former `nexus_project_registry` sentinel now
|
|
562
552
|
// lives in the attached GLOBAL db, not this project handle.
|
|
563
|
-
|
|
564
|
-
|
|
553
|
+
// `dbPath` is passed explicitly (T12039) — it used to be read from the
|
|
554
|
+
// module-global `_nexusDbPath`.
|
|
555
|
+
if (tableExists(nativeDb, 'nexus_nodes')) {
|
|
556
|
+
const backupPath = dbPath.replace(/\.db$/, '-pre-cleo.db.bak');
|
|
565
557
|
if (!existsSync(backupPath)) {
|
|
566
558
|
try {
|
|
567
|
-
copyFileSync(
|
|
559
|
+
copyFileSync(dbPath, backupPath);
|
|
568
560
|
}
|
|
569
561
|
catch {
|
|
570
562
|
/* non-fatal */
|
|
@@ -644,84 +636,58 @@ function runNexusMigrations(nativeDb, db) {
|
|
|
644
636
|
* @task T11648 (ADR-090 runtime read half — project-scope graph + global attach)
|
|
645
637
|
*/
|
|
646
638
|
export async function getNexusDb() {
|
|
647
|
-
|
|
639
|
+
return (await bindNexusDomain()).db.drizzle;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Bind the nexus schema to the {@link ProjectStore} holding the code graph,
|
|
643
|
+
* with the GLOBAL `cleo.db` ATTACHed for registry/identity reads.
|
|
644
|
+
*
|
|
645
|
+
* ## E6-L15 cutover (T12039)
|
|
646
|
+
*
|
|
647
|
+
* Replaces this module's singleton quintet (`_nexusDb` / `_nexusNativeDb` /
|
|
648
|
+
* `_nexusDbPath` / `_nexusRegistryPath` / `_nexusInitPromise`). Path keying,
|
|
649
|
+
* single-flight, and handle liveness move to the binding registry; this
|
|
650
|
+
* function keeps only what is genuinely nexus-specific — the two-scope open
|
|
651
|
+
* order and the registry ATTACH.
|
|
652
|
+
*
|
|
653
|
+
* The GLOBAL registry path is captured in the bound value rather than a
|
|
654
|
+
* separate module-global, so a `CLEO_HOME` change invalidates exactly this
|
|
655
|
+
* binding (and re-runs the global migration before re-attaching) instead of
|
|
656
|
+
* resetting a process-wide singleton that other projects also depended on.
|
|
657
|
+
*
|
|
658
|
+
* @returns The live nexus-domain binding.
|
|
659
|
+
*
|
|
660
|
+
* @task T12039 (E6-L15)
|
|
661
|
+
*/
|
|
662
|
+
export async function bindNexusDomain() {
|
|
648
663
|
const requestedRegistryPath = getNexusRegistryDbPath();
|
|
649
|
-
//
|
|
650
|
-
//
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
// global (→ "no such table: nexus_project_registry"). (ADR-090 · T11648)
|
|
658
|
-
if (_nexusDb && _nexusRegistryPath !== requestedRegistryPath) {
|
|
659
|
-
resetNexusDbState();
|
|
664
|
+
// The registry home (`getCleoHome()`) can change between calls — tests that
|
|
665
|
+
// mutate `CLEO_HOME`, or a re-homed install. A stale binding would keep the
|
|
666
|
+
// OLD global ATTACHed, so drop it and re-establish (which re-runs the global
|
|
667
|
+
// consolidated migration before re-attaching; a bare re-attach would bind an
|
|
668
|
+
// unmigrated global → "no such table: nexus_project_registry"). ADR-090 · T11648.
|
|
669
|
+
const bound = peekProjectDomain('nexus');
|
|
670
|
+
if (bound && bound.db.registryPath !== requestedRegistryPath) {
|
|
671
|
+
releaseDomainBindings({ scope: 'project', domain: 'nexus' });
|
|
660
672
|
}
|
|
661
|
-
//
|
|
662
|
-
//
|
|
663
|
-
|
|
664
|
-
//
|
|
665
|
-
//
|
|
666
|
-
//
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
ensureGlobalRegistryAttached(_nexusNativeDb);
|
|
680
|
-
}
|
|
681
|
-
catch {
|
|
682
|
-
// A failed re-attach means the shared handle is unusable — drop the
|
|
683
|
-
// singleton so the next call re-derives a fresh handle + attach.
|
|
684
|
-
resetNexusDbState();
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
if (_nexusDb)
|
|
688
|
-
return _nexusDb;
|
|
689
|
-
}
|
|
690
|
-
// If already initializing, wait for the in-flight init
|
|
691
|
-
if (_nexusInitPromise)
|
|
692
|
-
return _nexusInitPromise;
|
|
693
|
-
_nexusInitPromise = (async () => {
|
|
694
|
-
const dbPath = requestedPath;
|
|
695
|
-
_nexusDbPath = dbPath;
|
|
696
|
-
_nexusRegistryPath = requestedRegistryPath;
|
|
697
|
-
// ADR-086 / T10321 — warn (one-shot, non-blocking) if the install still
|
|
698
|
-
// carries the nested-nexus migration debris. Does not alter the open.
|
|
699
|
-
detectAndWarnOnNestedNexus();
|
|
700
|
-
// ── Registry home: open GLOBAL first (T11648) ──────────────────────────
|
|
701
|
-
// The registry/identity tables are global (ADR-090 §2.2). Opening the GLOBAL
|
|
702
|
-
// scope through the dual-scope chokepoint runs its consolidated migration,
|
|
703
|
-
// guaranteeing those tables (and their schema) physically exist before we
|
|
704
|
-
// ATTACH the global file into the project handle below. This is the same
|
|
705
|
-
// shared handle the global-tier siblings (skills/agent-registry) hold; we do
|
|
706
|
-
// NOT keep a reference to it — we only need its schema materialised on disk.
|
|
707
|
-
await openDualScopeDb('global');
|
|
708
|
-
// ── Graph home: open PROJECT scope as `main` (T11648 · ADR-090 §2.1/§2.4) ─
|
|
709
|
-
// openDualScopeDb('project') applies the pragma SSoT, creates the directory,
|
|
710
|
-
// runs the consolidated cleo-project migrations (which OWN the five PREFIXED
|
|
711
|
-
// graph tables), and manages the singleton cache. We pass NO cwd: the
|
|
712
|
-
// dual-scope resolver resolves the canonical project root via the
|
|
713
|
-
// `resolveCleoDir()` SSoT (CWD-walk / CLEO_DIR / worktree scope) — never a
|
|
714
|
-
// bare `process.cwd()` (T9584). Omitting the cwd also keeps the exodus-on-open
|
|
715
|
-
// hook un-armed, which is correct for the runtime READ path (exodus is a
|
|
716
|
-
// separate explicit step).
|
|
717
|
-
const dualHandle = await openDualScopeDb('project');
|
|
718
|
-
// Extract the underlying DatabaseSync. Drizzle exposes it via `$client`.
|
|
719
|
-
const nativeDb = dualHandle.db.$client ?? null;
|
|
720
|
-
if (!nativeDb) {
|
|
721
|
-
throw new Error('T11648: openDualScopeDb returned a handle without $client — ' +
|
|
722
|
-
'cannot extract DatabaseSync for the nexus-schema drizzle wrapping.');
|
|
723
|
-
}
|
|
724
|
-
_nexusNativeDb = nativeDb;
|
|
673
|
+
// ADR-086 / T10321 — warn (one-shot, non-blocking) if the install still
|
|
674
|
+
// carries the nested-nexus migration debris. Does not alter the open.
|
|
675
|
+
detectAndWarnOnNestedNexus();
|
|
676
|
+
// ── Registry home: open GLOBAL first (T11648) ────────────────────────────
|
|
677
|
+
// The registry/identity tables are global (ADR-090 §2.2). Opening the GLOBAL
|
|
678
|
+
// scope through the dual-scope chokepoint runs its consolidated migration,
|
|
679
|
+
// guaranteeing those tables (and their schema) physically exist before we
|
|
680
|
+
// ATTACH the global file into the project handle below. This is the same
|
|
681
|
+
// shared handle the global-tier siblings (skills/agent-registry) hold; we do
|
|
682
|
+
// NOT keep a reference to it — we only need its schema materialised on disk.
|
|
683
|
+
await openDualScopeDb('global');
|
|
684
|
+
// ── Graph home: open PROJECT scope as `main` (T11648 · ADR-090 §2.1/§2.4) ──
|
|
685
|
+
// We pass NO cwd: the dual-scope resolver resolves the canonical project root
|
|
686
|
+
// via the `resolveCleoDir()` SSoT (CWD-walk / CLEO_DIR / worktree scope) —
|
|
687
|
+
// never a bare `process.cwd()` (T9584). Omitting the cwd also keeps the
|
|
688
|
+
// exodus-on-open hook un-armed, which is correct for the runtime READ path
|
|
689
|
+
// (exodus is a separate explicit step).
|
|
690
|
+
const binding = await bindProjectDomain('nexus', undefined, (nativeDb, store) => {
|
|
725
691
|
// ATTACH the GLOBAL `cleo.db` so the registry/identity tables resolve by
|
|
726
692
|
// their bare names via SQLite's fall-through (ADR-090 · T11648). Idempotent.
|
|
727
693
|
ensureGlobalRegistryAttached(nativeDb);
|
|
@@ -735,21 +701,27 @@ export async function getNexusDb() {
|
|
|
735
701
|
// inline-column DROP), and the `_nexus_meta` health-probe sentinel. The
|
|
736
702
|
// legacy drop/rebuild (`establishLegacyNexusSchema`) is GONE — the
|
|
737
703
|
// consolidated migration is the single SSoT for the base tables (T11578 · AC3).
|
|
738
|
-
runNexusMigrations(nativeDb, db);
|
|
704
|
+
runNexusMigrations(nativeDb, db, store.dbPath);
|
|
739
705
|
// Seed schema version for new databases (no-op if already set)
|
|
740
706
|
nativeDb
|
|
741
707
|
.prepare(`INSERT OR IGNORE INTO nexus_schema_meta (key, value) VALUES ('schemaVersion', '${NEXUS_SCHEMA_VERSION}')`)
|
|
742
708
|
.run();
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
709
|
+
return { drizzle: db, registryPath: requestedRegistryPath };
|
|
710
|
+
});
|
|
711
|
+
// Re-validate the GLOBAL registry ATTACH on every bind, including cache hits.
|
|
712
|
+
// A sibling domain that re-opened the shared project handle drops the attach
|
|
713
|
+
// without invalidating our binding. `ensureGlobalRegistryAttached` early-returns
|
|
714
|
+
// when the current attach already points at the right file, so this is cheap.
|
|
747
715
|
try {
|
|
748
|
-
|
|
716
|
+
ensureGlobalRegistryAttached(binding.native);
|
|
749
717
|
}
|
|
750
|
-
|
|
751
|
-
|
|
718
|
+
catch {
|
|
719
|
+
// A failed re-attach means this handle is unusable — drop the binding so the
|
|
720
|
+
// next call re-derives a fresh handle + attach.
|
|
721
|
+
releaseDomainBindings({ scope: 'project', domain: 'nexus' });
|
|
722
|
+
throw new Error('T12039: nexus binding lost its GLOBAL registry ATTACH and could not re-attach.');
|
|
752
723
|
}
|
|
724
|
+
return binding;
|
|
753
725
|
}
|
|
754
726
|
/**
|
|
755
727
|
* Close the nexus-domain database connection and release resources.
|
|
@@ -767,13 +739,9 @@ export async function getNexusDb() {
|
|
|
767
739
|
* coordinated reset (`closeAllDatabases` → `_resetDualScopeDbCache`).
|
|
768
740
|
*/
|
|
769
741
|
export function closeNexusDb() {
|
|
770
|
-
// Drop only the nexus
|
|
771
|
-
//
|
|
772
|
-
|
|
773
|
-
_nexusDb = null;
|
|
774
|
-
_nexusDbPath = null;
|
|
775
|
-
_nexusRegistryPath = null;
|
|
776
|
-
_nexusInitPromise = null;
|
|
742
|
+
// Drop only the nexus-domain binding. Do NOT close the connection — it is the
|
|
743
|
+
// shared dual-scope project handle, possibly still in use by siblings.
|
|
744
|
+
releaseDomainBindings({ scope: 'project', domain: 'nexus' });
|
|
777
745
|
}
|
|
778
746
|
/**
|
|
779
747
|
* Reset nexus singleton state without saving.
|
|
@@ -787,11 +755,7 @@ export function closeNexusDb() {
|
|
|
787
755
|
* is shared with the other project-tier domains). Mirrors {@link closeNexusDb}.
|
|
788
756
|
*/
|
|
789
757
|
export function resetNexusDbState() {
|
|
790
|
-
|
|
791
|
-
_nexusDb = null;
|
|
792
|
-
_nexusDbPath = null;
|
|
793
|
-
_nexusRegistryPath = null;
|
|
794
|
-
_nexusInitPromise = null;
|
|
758
|
+
releaseDomainBindings({ scope: 'project', domain: 'nexus' });
|
|
795
759
|
}
|
|
796
760
|
/**
|
|
797
761
|
* Get the underlying node:sqlite DatabaseSync instance for the nexus domain.
|
|
@@ -799,7 +763,7 @@ export function resetNexusDbState() {
|
|
|
799
763
|
* Returns null if the database hasn't been initialized.
|
|
800
764
|
*/
|
|
801
765
|
export function getNexusNativeDb() {
|
|
802
|
-
return
|
|
766
|
+
return boundProjectNative('nexus');
|
|
803
767
|
}
|
|
804
768
|
/**
|
|
805
769
|
* Re-export nexus schema for external use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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AC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,6EAA6E;QAC7E,gDAAgD;QAChD,qBAAqB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,YAAY;IAC1B,8EAA8E;IAC9E,uEAAuE;IACvE,qBAAqB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB;IAC/B,qBAAqB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAGD;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path-keyed domain binding registry — the single owner of every per-domain
|
|
3
|
+
* Drizzle wrapper in the CLEO runtime.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this module exists (E6-L13 · T12037)
|
|
6
|
+
*
|
|
7
|
+
* Before this leaf, each store facade (`sqlite.ts`, `memory-sqlite.ts`,
|
|
8
|
+
* `conduit-sqlite.ts`, `nexus-sqlite.ts`, `skills-db.ts`) owned its OWN
|
|
9
|
+
* process-global singleton quartet:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* let _db: NodeSQLiteDatabase | null = null;
|
|
13
|
+
* let _nativeDb: DatabaseSync | null = null;
|
|
14
|
+
* let _dbPath: string | null = null;
|
|
15
|
+
* let _initPromise: Promise<NodeSQLiteDatabase> | null = null;
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Five independent caches over ONE shared `DatabaseSync` produced a documented
|
|
19
|
+
* class of defects:
|
|
20
|
+
*
|
|
21
|
+
* - **Last-project-wins** — `_dbPath` held a single project. Touching project B
|
|
22
|
+
* reset the singleton, so an interleaved project-A query re-opened and
|
|
23
|
+
* re-migrated on every alternation (thrash, not just slowness).
|
|
24
|
+
* - **Cross-domain staleness** — the tasks singleton could reference a
|
|
25
|
+
* `DatabaseSync` that the brain domain had already closed (T12019/T12020),
|
|
26
|
+
* surfacing as `database is not open` or, worse, a silently-nulled
|
|
27
|
+
* `sourceSessionId`.
|
|
28
|
+
* - **Band-aid retry loops** — both `getDb` and `getBrainDb` grew bounded
|
|
29
|
+
* re-acquisition loops (T12035) purely to paper over the above.
|
|
30
|
+
*
|
|
31
|
+
* This module replaces all five with ONE registry keyed by
|
|
32
|
+
* `${scope}::${canonical dbPath}::${domain}`, layered on the
|
|
33
|
+
* {@link CleoRuntime} store registry (T12036). A binding is valid only while
|
|
34
|
+
* the {@link ProjectStore} / {@link GlobalStore} instance it was established
|
|
35
|
+
* against is still the one the runtime hands out AND its native handle is
|
|
36
|
+
* open. Any eviction — a `close()`, a `_resetDualScopeDbCache`, an external
|
|
37
|
+
* teardown — yields a fresh store object, which invalidates every binding
|
|
38
|
+
* derived from it by identity comparison. No liveness polling, no retry loop,
|
|
39
|
+
* no "last opened project".
|
|
40
|
+
*
|
|
41
|
+
* ## What a domain owns after this leaf
|
|
42
|
+
*
|
|
43
|
+
* A domain owns its `establish` function — the schema reconciliation it must
|
|
44
|
+
* run against a native handle (legacy Drizzle wrapping, `runMigrations`,
|
|
45
|
+
* vec0 extension loading, seed rows). It no longer owns caching, path
|
|
46
|
+
* resolution, single-flight, or liveness. Those are this module's job.
|
|
47
|
+
*
|
|
48
|
+
* @packageDocumentation
|
|
49
|
+
* @task T12037 (E6-L13)
|
|
50
|
+
* @epic T11249 (E6)
|
|
51
|
+
* @saga T11242 (SG-DB-SUBSTRATE-V2)
|
|
52
|
+
*/
|
|
53
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
54
|
+
import { type CleoRuntime, type GlobalStore, type ProjectStore } from '../dual-scope-db.js';
|
|
55
|
+
/**
|
|
56
|
+
* Get (or lazily create) the process-wide {@link CleoRuntime}.
|
|
57
|
+
*
|
|
58
|
+
* @returns The shared runtime store registry.
|
|
59
|
+
*/
|
|
60
|
+
export declare function getCleoRuntime(): CleoRuntime;
|
|
61
|
+
/**
|
|
62
|
+
* Tear down the process-wide runtime: close every registry entry and drop
|
|
63
|
+
* every domain binding. The next {@link getCleoRuntime} call builds a fresh
|
|
64
|
+
* registry.
|
|
65
|
+
*
|
|
66
|
+
* Used by full-teardown paths (`closeAllDatabases`) and by tests that need a
|
|
67
|
+
* pristine process state between cases.
|
|
68
|
+
*/
|
|
69
|
+
export declare function resetCleoRuntime(): void;
|
|
70
|
+
/**
|
|
71
|
+
* A domain's live binding to one store.
|
|
72
|
+
*
|
|
73
|
+
* @typeParam TDb - The domain's Drizzle handle type (its legacy schema shape).
|
|
74
|
+
*/
|
|
75
|
+
export interface DomainBinding<TDb, TStore extends ProjectStore | GlobalStore> {
|
|
76
|
+
/** The store this binding was established against. */
|
|
77
|
+
readonly store: TStore;
|
|
78
|
+
/** The native `DatabaseSync` extracted from {@link store}. */
|
|
79
|
+
readonly native: DatabaseSync;
|
|
80
|
+
/** The domain-typed Drizzle handle produced by the domain's `establish`. */
|
|
81
|
+
readonly db: TDb;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Bind a project-scope domain schema to the {@link ProjectStore} for `cwd`.
|
|
85
|
+
*
|
|
86
|
+
* This is the replacement for every `getXxxDb(cwd)` project-domain facade.
|
|
87
|
+
* The returned binding carries the store itself, so callers that need a
|
|
88
|
+
* cross-domain transaction hold an explicit handle rather than reaching for a
|
|
89
|
+
* process global.
|
|
90
|
+
*
|
|
91
|
+
* @typeParam TDb - The domain's Drizzle handle type.
|
|
92
|
+
* @param domain - Stable domain id; part of the registry key.
|
|
93
|
+
* @param cwd - Project working directory. Resolved to the canonical
|
|
94
|
+
* `cleo.db` path and forwarded as `exodusCwd` so a port open arms the
|
|
95
|
+
* exodus-on-open auto-migration exactly like the facade it replaces.
|
|
96
|
+
* @param establish - Reconcile the domain's schema against the native handle
|
|
97
|
+
* and return the domain-typed Drizzle instance. Called once per
|
|
98
|
+
* (path, domain, store instance); MUST be idempotent because a store
|
|
99
|
+
* eviction re-runs it.
|
|
100
|
+
* @returns The live {@link DomainBinding}.
|
|
101
|
+
*/
|
|
102
|
+
export declare function bindProjectDomain<TDb>(domain: string, cwd: string | undefined, establish: (native: DatabaseSync, store: ProjectStore) => TDb | Promise<TDb>): Promise<DomainBinding<TDb, ProjectStore>>;
|
|
103
|
+
/**
|
|
104
|
+
* Bind a project-scope domain schema to an EXPLICIT database path.
|
|
105
|
+
*
|
|
106
|
+
* Used by domains whose legacy lifecycle API accepted an on-disk path (test
|
|
107
|
+
* fixtures, snapshot inspection). Never arms exodus-on-open — an explicit
|
|
108
|
+
* path must not auto-migrate a legacy fleet into a fixture.
|
|
109
|
+
*
|
|
110
|
+
* @typeParam TDb - The domain's Drizzle handle type.
|
|
111
|
+
* @param domain - Stable domain id.
|
|
112
|
+
* @param dbPath - Absolute path to a consolidated `cleo.db`.
|
|
113
|
+
* @param establish - See {@link bindProjectDomain}.
|
|
114
|
+
*/
|
|
115
|
+
export declare function bindProjectDomainAtPath<TDb>(domain: string, dbPath: string, establish: (native: DatabaseSync, store: ProjectStore) => TDb | Promise<TDb>): Promise<DomainBinding<TDb, ProjectStore>>;
|
|
116
|
+
/**
|
|
117
|
+
* Bind a global-scope domain schema to the {@link GlobalStore}.
|
|
118
|
+
*
|
|
119
|
+
* This is the replacement for every `getXxxDb()` global-domain facade
|
|
120
|
+
* (nexus, skills, agents, telemetry).
|
|
121
|
+
*
|
|
122
|
+
* @typeParam TDb - The domain's Drizzle handle type.
|
|
123
|
+
* @param domain - Stable domain id; part of the registry key.
|
|
124
|
+
* @param establish - See {@link bindProjectDomain}.
|
|
125
|
+
* @param cwd - Optional cwd forwarded as `exodusCwd` for the global scope's
|
|
126
|
+
* own legacy-fleet auto-migration.
|
|
127
|
+
*/
|
|
128
|
+
export declare function bindGlobalDomain<TDb>(domain: string, establish: (native: DatabaseSync, store: GlobalStore) => TDb | Promise<TDb>, cwd?: string): Promise<DomainBinding<TDb, GlobalStore>>;
|
|
129
|
+
/**
|
|
130
|
+
* Bind a global-scope domain schema to an EXPLICIT database path.
|
|
131
|
+
*
|
|
132
|
+
* The path-aware sibling of {@link bindGlobalDomain}, for domains whose
|
|
133
|
+
* lifecycle API accepts an on-disk path — notably the skills registry's
|
|
134
|
+
* test-sandbox `{ path }` override. Never arms exodus-on-open.
|
|
135
|
+
*
|
|
136
|
+
* @typeParam TDb - The domain's Drizzle handle type.
|
|
137
|
+
* @param domain - Stable domain id.
|
|
138
|
+
* @param dbPath - Absolute path to a global-scope `cleo.db`.
|
|
139
|
+
* @param establish - See {@link bindProjectDomain}.
|
|
140
|
+
*/
|
|
141
|
+
export declare function bindGlobalDomainAtPath<TDb>(domain: string, dbPath: string, establish: (native: DatabaseSync, store: GlobalStore) => TDb | Promise<TDb>): Promise<DomainBinding<TDb, GlobalStore>>;
|
|
142
|
+
/**
|
|
143
|
+
* Synchronously read an ALREADY-established binding at an EXPLICIT path.
|
|
144
|
+
*
|
|
145
|
+
* @typeParam TDb - The domain's Drizzle handle type.
|
|
146
|
+
* @param scope - Dual-scope discriminator.
|
|
147
|
+
* @param dbPath - Absolute database path.
|
|
148
|
+
* @param domain - Stable domain id.
|
|
149
|
+
*/
|
|
150
|
+
export declare function peekDomainAtPath<TDb>(scope: 'project' | 'global', dbPath: string, domain: string): DomainBinding<TDb, ProjectStore | GlobalStore> | null;
|
|
151
|
+
/**
|
|
152
|
+
* Drop cached bindings.
|
|
153
|
+
*
|
|
154
|
+
* Dropping a binding does NOT close any connection — the runtime registry and
|
|
155
|
+
* the dual-scope chokepoint own connection lifecycle. This only forces the
|
|
156
|
+
* next bind to re-run the domain's `establish`.
|
|
157
|
+
*
|
|
158
|
+
* @param filter - Restrict the drop. Omit any field to match all values of it.
|
|
159
|
+
* `{ scope: 'project' }` drops every project-domain binding;
|
|
160
|
+
* `{ domain: 'brain' }` drops the brain binding for every project.
|
|
161
|
+
*/
|
|
162
|
+
export declare function releaseDomainBindings(filter?: {
|
|
163
|
+
scope?: 'project' | 'global';
|
|
164
|
+
dbPath?: string;
|
|
165
|
+
domain?: string;
|
|
166
|
+
}): void;
|
|
167
|
+
/**
|
|
168
|
+
* Drop every cached binding in every scope. Equivalent to
|
|
169
|
+
* `releaseDomainBindings()` with no filter; named for call-site clarity in
|
|
170
|
+
* teardown paths.
|
|
171
|
+
*/
|
|
172
|
+
export declare function releaseAllDomainBindings(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Snapshot of currently-established binding keys.
|
|
175
|
+
*
|
|
176
|
+
* Read-only diagnostic surface for `cleo health` / architecture tests that
|
|
177
|
+
* assert a process holds exactly one binding per (path, domain).
|
|
178
|
+
*/
|
|
179
|
+
export declare function boundDomainKeys(): ReadonlySet<string>;
|
|
180
|
+
/**
|
|
181
|
+
* Synchronously look up the native `DatabaseSync` of an ALREADY-established
|
|
182
|
+
* project-domain binding.
|
|
183
|
+
*
|
|
184
|
+
* This exists solely to keep the legacy synchronous native getters
|
|
185
|
+
* (`getNativeDb`, `getNativeTasksDb`, `getBrainNativeDb`) working while their
|
|
186
|
+
* call sites migrate to the async binding. Unlike the module-global they
|
|
187
|
+
* replace, this lookup is **path-keyed** — passing the caller's `cwd` returns
|
|
188
|
+
* that project's handle rather than "whichever project was opened last".
|
|
189
|
+
*
|
|
190
|
+
* Returns `null` when nothing is bound yet or the connection has since
|
|
191
|
+
* closed; callers must have awaited the domain's async binder first.
|
|
192
|
+
*
|
|
193
|
+
* @param domain - Stable domain id.
|
|
194
|
+
* @param cwd - Project working directory; resolved to the canonical path.
|
|
195
|
+
* @returns The live native connection, or `null`.
|
|
196
|
+
*
|
|
197
|
+
* @deprecated Read `.native` from the {@link DomainBinding} instead. Removed
|
|
198
|
+
* when the last synchronous native getter is retired (T12040 · E6-L16).
|
|
199
|
+
*/
|
|
200
|
+
export declare function boundProjectNative(domain: string, cwd?: string): DatabaseSync | null;
|
|
201
|
+
/**
|
|
202
|
+
* Synchronously read an ALREADY-established project-domain binding without
|
|
203
|
+
* opening anything.
|
|
204
|
+
*
|
|
205
|
+
* Returns `null` when the domain is unbound for that project or its
|
|
206
|
+
* connection has closed. Unlike {@link bindProjectDomain} this never triggers
|
|
207
|
+
* an open, so it is safe on synchronous code paths (accessor predicates,
|
|
208
|
+
* health probes) that must not force a migration.
|
|
209
|
+
*
|
|
210
|
+
* @typeParam TDb - The domain's Drizzle handle type, as passed to
|
|
211
|
+
* {@link bindProjectDomain}. Unchecked at runtime — the caller is
|
|
212
|
+
* responsible for using the same type it bound with.
|
|
213
|
+
* @param domain - Stable domain id.
|
|
214
|
+
* @param cwd - Project working directory.
|
|
215
|
+
*/
|
|
216
|
+
export declare function peekProjectDomain<TDb>(domain: string, cwd?: string): DomainBinding<TDb, ProjectStore> | null;
|
|
217
|
+
/**
|
|
218
|
+
* Synchronous sibling of {@link peekProjectDomain} for the global scope.
|
|
219
|
+
*
|
|
220
|
+
* @typeParam TDb - The domain's Drizzle handle type.
|
|
221
|
+
* @param domain - Stable domain id.
|
|
222
|
+
*/
|
|
223
|
+
export declare function peekGlobalDomain<TDb>(domain: string): DomainBinding<TDb, GlobalStore> | null;
|
|
224
|
+
/**
|
|
225
|
+
* Synchronous sibling of {@link boundProjectNative} for the global scope.
|
|
226
|
+
*
|
|
227
|
+
* @param domain - Stable domain id.
|
|
228
|
+
* @returns The live native connection, or `null`.
|
|
229
|
+
*
|
|
230
|
+
* @deprecated See {@link boundProjectNative}.
|
|
231
|
+
*/
|
|
232
|
+
export declare function boundGlobalNative(domain: string): DatabaseSync | null;
|
|
233
|
+
//# sourceMappingURL=domain-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-binding.d.ts","sourceRoot":"","sources":["../../../src/store/ports/domain-binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,qBAAqB,CAAC;AAY7B;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAUvC;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,GAAG,EAAE,MAAM,SAAS,YAAY,GAAG,WAAW;IAC3E,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;CAClB;AA2MD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EACzC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAC3E,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAU3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,EAC/C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE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