diff --git a/packages/context/src/ingest/isolated-diff/source-routing.test.ts b/packages/context/src/ingest/isolated-diff/source-routing.test.ts index 75e52a1c..0519a4a2 100644 --- a/packages/context/src/ingest/isolated-diff/source-routing.test.ts +++ b/packages/context/src/ingest/isolated-diff/source-routing.test.ts @@ -1,40 +1,22 @@ import { describe, expect, it } from 'vitest'; -import { - defaultIsolatedDiffSourceKeys, - isIsolatedDiffDirectWriteSourceKey, - ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEYS, -} from './source-routing.js'; +import { defaultSharedWorktreeSourceKeys, isSharedWorktreeFallbackSourceKey } from './source-routing.js'; describe('isolated-diff source routing', () => { - it('keeps the runner-owned direct-write connector list explicit', () => { - expect(ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEYS).toEqual([ - 'metabase', - 'notion', - 'lookml', - 'looker', - 'dbt', - 'metricflow', - ]); + it('defaults every non-override source to isolated diffs', () => { + expect(defaultSharedWorktreeSourceKeys()).toEqual([]); }); it('returns a mutable copy for runtime settings', () => { - const keys = defaultIsolatedDiffSourceKeys(); - keys.push('fake'); + const keys = defaultSharedWorktreeSourceKeys(); + keys.push('legacy-source'); - expect(defaultIsolatedDiffSourceKeys()).toEqual([ - 'metabase', - 'notion', - 'lookml', - 'looker', - 'dbt', - 'metricflow', - ]); + expect(defaultSharedWorktreeSourceKeys()).toEqual([]); }); - it('recognizes migrated connector source keys only', () => { - expect(isIsolatedDiffDirectWriteSourceKey('notion')).toBe(true); - expect(isIsolatedDiffDirectWriteSourceKey('metricflow')).toBe(true); - expect(isIsolatedDiffDirectWriteSourceKey('historic-sql')).toBe(false); - expect(isIsolatedDiffDirectWriteSourceKey('live-database')).toBe(false); + it('recognizes only explicitly configured shared-worktree fallback sources', () => { + expect(isSharedWorktreeFallbackSourceKey('notion', [])).toBe(false); + expect(isSharedWorktreeFallbackSourceKey('metricflow', [])).toBe(false); + expect(isSharedWorktreeFallbackSourceKey('legacy-source', ['legacy-source'])).toBe(true); + expect(isSharedWorktreeFallbackSourceKey('other-source', ['legacy-source'])).toBe(false); }); }); diff --git a/packages/context/src/ingest/isolated-diff/source-routing.ts b/packages/context/src/ingest/isolated-diff/source-routing.ts index 20d63b89..52694304 100644 --- a/packages/context/src/ingest/isolated-diff/source-routing.ts +++ b/packages/context/src/ingest/isolated-diff/source-routing.ts @@ -1,22 +1,12 @@ -export const ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEYS = [ - 'metabase', - 'notion', - 'lookml', - 'looker', - 'dbt', - 'metricflow', -] as const; +const DEFAULT_SHARED_WORKTREE_SOURCE_KEYS: readonly string[] = []; -export type IsolatedDiffDirectWriteSourceKey = (typeof ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEYS)[number]; - -const ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEY_SET = new Set(ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEYS); - -export function defaultIsolatedDiffSourceKeys(): string[] { - return [...ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEYS]; +export function defaultSharedWorktreeSourceKeys(): string[] { + return [...DEFAULT_SHARED_WORKTREE_SOURCE_KEYS]; } -export function isIsolatedDiffDirectWriteSourceKey( +export function isSharedWorktreeFallbackSourceKey( sourceKey: string, -): sourceKey is IsolatedDiffDirectWriteSourceKey { - return ISOLATED_DIFF_DIRECT_WRITE_SOURCE_KEY_SET.has(sourceKey); + sharedWorktreeSourceKeys: readonly string[] = DEFAULT_SHARED_WORKTREE_SOURCE_KEYS, +): boolean { + return sharedWorktreeSourceKeys.includes(sourceKey); } diff --git a/packages/context/src/ingest/ports.ts b/packages/context/src/ingest/ports.ts index 3527d29c..1131a672 100644 --- a/packages/context/src/ingest/ports.ts +++ b/packages/context/src/ingest/ports.ts @@ -143,7 +143,7 @@ export interface IngestSettingsPort { workUnitMaxConcurrency?: number; workUnitStepBudget?: number; workUnitFailureMode?: 'abort' | 'continue'; - isolatedDiffSourceKeys?: string[]; + sharedWorktreeSourceKeys?: string[]; ingestTraceLevel?: IngestTraceLevel; }