diff --git a/src/cli.ts b/src/cli.ts index 9158e5f5..99b1250a 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -57,20 +57,6 @@ program .option('--enrich', 'Enable LLM enrichment (requires ANTHROPIC_API_KEY)') .action((options) => extractCommand(options, logger)); -// Deprecated alias — will be removed in a future version -program - .command('liberate') - .description('Deprecated: use "extract" instead') - .option('--since ', 'Start date (default: 90 days ago)') - .option('--commit-count ', 'Max commits to process') - .option('--dry-run', 'Preview without writing') - .option('--threshold ', 'Interest score threshold', '3') - .option('--enrich', 'Enable LLM enrichment (requires ANTHROPIC_API_KEY)') - .action((options) => { - console.warn('Warning: "liberate" is deprecated, use "extract" instead.'); - return extractCommand(options, logger); - }); - program .command('context') .description('Show memories relevant to staged changes') diff --git a/src/commands/init-hooks.ts b/src/commands/init-hooks.ts index 8715cff3..3dd0f708 100644 --- a/src/commands/init-hooks.ts +++ b/src/commands/init-hooks.ts @@ -109,16 +109,6 @@ export function deepMergeGitMemConfig( const existingHooks = (existing.hooks ?? {}) as Record; const defaultHooks = (defaults.hooks ?? {}) as Record; - // Backward compat: migrate autoLiberate → autoExtract in sessionStop - const existingStop = existingHooks.sessionStop; - if (typeof existingStop === 'object' && existingStop !== null && !Array.isArray(existingStop)) { - const stop = existingStop as Record; - if (stop.autoExtract === undefined && stop.autoLiberate !== undefined) { - stop.autoExtract = stop.autoLiberate; - delete stop.autoLiberate; - } - } - const mergedHooks: Record = {}; // Merge each default key diff --git a/src/domain/types/IMemoryQuality.ts b/src/domain/types/IMemoryQuality.ts index 94a7dc28..a8d18a52 100644 --- a/src/domain/types/IMemoryQuality.ts +++ b/src/domain/types/IMemoryQuality.ts @@ -16,7 +16,6 @@ * - commit-trailer: Extracted from AI-* commit trailers * - git-note: Stored in refs/notes/mem * - extract: Generated by extracting knowledge from existing history - * - liberate: @deprecated Alias for 'extract' (backward compat) * - heuristic-extraction: Pattern-matched from commit messages */ @@ -55,7 +54,6 @@ export type SourceType = | 'commit-trailer' | 'git-note' | 'extract' - | 'liberate' // @deprecated — kept for backward compat with existing memories | 'heuristic-extraction' | 'llm-enrichment'; @@ -67,7 +65,6 @@ export const SOURCE_VALUES: readonly SourceType[] = [ 'commit-trailer', 'git-note', 'extract', - 'liberate', // @deprecated — kept for backward compat 'heuristic-extraction', 'llm-enrichment', ] as const; @@ -80,7 +77,6 @@ export const DEFAULT_CONFIDENCE: Readonly> = 'commit-trailer': 'high', 'git-note': 'high', 'extract': 'medium', - 'liberate': 'medium', // @deprecated — kept for backward compat 'heuristic-extraction': 'low', 'llm-enrichment': 'medium', }; diff --git a/src/hooks/utils/config.ts b/src/hooks/utils/config.ts index 512e2569..b912b947 100644 --- a/src/hooks/utils/config.ts +++ b/src/hooks/utils/config.ts @@ -31,12 +31,7 @@ export function loadHookConfig(cwd?: string): IHookConfig { const raw = JSON.parse(readFileSync(configPath, 'utf8')) as Record; const rawHooks = (raw.hooks ?? {}) as Partial; - // Backward compat: migrate autoLiberate → autoExtract const rawStop = (rawHooks.sessionStop ?? {}) as Record; - if (rawStop.autoExtract === undefined && rawStop.autoLiberate !== undefined) { - rawStop.autoExtract = rawStop.autoLiberate; - delete rawStop.autoLiberate; - } return { hooks: { diff --git a/tests/unit/commands/init-hooks.test.ts b/tests/unit/commands/init-hooks.test.ts index cf3fbaf1..c9cb1d49 100644 --- a/tests/unit/commands/init-hooks.test.ts +++ b/tests/unit/commands/init-hooks.test.ts @@ -342,36 +342,6 @@ describe('deepMergeGitMemConfig', () => { assert.equal(sessionStart.memoryLimit, 20); // Default fills in }); - it('should migrate autoLiberate to autoExtract in existing config', () => { - const existing = { - hooks: { - sessionStop: { enabled: true, autoLiberate: true, threshold: 5 }, - }, - }; - - const result = deepMergeGitMemConfig(existing, defaults); - const hooks = result.hooks as Record; - const sessionStop = hooks.sessionStop as Record; - - assert.equal(sessionStop.autoExtract, true); - assert.equal(sessionStop.autoLiberate, undefined); // Migrated away - assert.equal(sessionStop.threshold, 5); - }); - - it('should not override explicit autoExtract with autoLiberate', () => { - const existing = { - hooks: { - sessionStop: { enabled: true, autoExtract: false, autoLiberate: true }, - }, - }; - - const result = deepMergeGitMemConfig(existing, defaults); - const hooks = result.hooks as Record; - const sessionStop = hooks.sessionStop as Record; - - assert.equal(sessionStop.autoExtract, false); // Explicit autoExtract wins - }); - it('should deep-merge sub-objects keeping user values over defaults', () => { const existing = { hooks: { diff --git a/tests/unit/hooks/utils/config.test.ts b/tests/unit/hooks/utils/config.test.ts index 77c1bba6..84b02379 100644 --- a/tests/unit/hooks/utils/config.test.ts +++ b/tests/unit/hooks/utils/config.test.ts @@ -89,34 +89,6 @@ describe('loadHookConfig', () => { assert.equal(config.hooks.enabled, false); }); - it('should migrate autoLiberate to autoExtract for backward compat', () => { - const testDir = createTestDir(); - writeFileSync(join(testDir, '.git-mem.json'), JSON.stringify({ - hooks: { - sessionStop: { enabled: true, autoLiberate: true, threshold: 5 }, - }, - })); - - const config = loadHookConfig(testDir); - - assert.equal(config.hooks.sessionStop.autoExtract, true); - assert.equal(config.hooks.sessionStop.threshold, 5); - }); - - it('should prefer autoExtract over autoLiberate when both present', () => { - const testDir = createTestDir(); - writeFileSync(join(testDir, '.git-mem.json'), JSON.stringify({ - hooks: { - sessionStop: { enabled: true, autoExtract: false, autoLiberate: true }, - }, - })); - - const config = loadHookConfig(testDir); - - // autoExtract is explicit — should not be overridden by autoLiberate - assert.equal(config.hooks.sessionStop.autoExtract, false); - }); - it('should use process.cwd() when no cwd provided', () => { // This should not throw — just returns defaults if no .git-mem.json const config = loadHookConfig();