refactor: remove liberate backward compat code#39
Conversation
Pre-release project — no need for migration shims: - Remove deprecated `liberate` CLI alias - Remove `liberate` from SourceType union, SOURCE_VALUES, DEFAULT_CONFIDENCE - Remove autoLiberate → autoExtract migration in loadHookConfig and deepMergeGitMemConfig - Remove 4 backward compat tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughThis PR removes deprecated "liberate" command alias, related configuration migration logic, and associated type definitions throughout the codebase. The changes consolidate functionality around the "extract" command by eliminating backward-compatibility code that previously migrated autoLiberate to autoExtract configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
Pull request overview
This PR removes all backward compatibility code for the deprecated "liberate" terminology, which has been replaced with "extract". As noted in the description, since this is a pre-release project, no migration shims are needed. The changes cleanly remove deprecated aliases, type definitions, and migration logic.
Changes:
- Removed deprecated
liberateCLI command alias - Removed
liberatefromSourceTypeunion type,SOURCE_VALUESarray, andDEFAULT_CONFIDENCEmapping - Removed
autoLiberate→autoExtractmigration logic from configuration loading functions - Removed 4 backward compatibility tests
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/cli.ts | Removed deprecated liberate CLI command that was an alias for extract |
| src/domain/types/IMemoryQuality.ts | Removed liberate from source type definitions and related constants |
| src/hooks/utils/config.ts | Removed autoLiberate → autoExtract migration logic from config loader |
| src/commands/init-hooks.ts | Removed autoLiberate → autoExtract migration logic from deep merge function |
| tests/unit/hooks/utils/config.test.ts | Removed 2 backward compatibility tests for autoLiberate migration |
| tests/unit/commands/init-hooks.test.ts | Removed 2 backward compatibility tests for autoLiberate migration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const rawHooks = (raw.hooks ?? {}) as Partial<IHooksConfig>; | ||
|
|
||
| // Backward compat: migrate autoLiberate → autoExtract | ||
| const rawStop = (rawHooks.sessionStop ?? {}) as Record<string, unknown>; |
There was a problem hiding this comment.
The rawStop variable is no longer needed after removing the migration code. For consistency with sessionStart and promptSubmit configuration handling (lines 39-42 and 47-50), consider using rawHooks.sessionStop directly in the spread on line 45 instead of this intermediate variable.
Summary
liberateCLI aliasliberatefromSourceTypeunion,SOURCE_VALUES,DEFAULT_CONFIDENCEautoLiberate→autoExtractmigration inloadHookConfiganddeepMergeGitMemConfigPre-release project — no migration shims needed.
Closes GIT-72 (cleanup follow-up)
Test plan
npm run type-checkpassesnpm run lintpasses🤖 Generated with Claude Code
Summary by CodeRabbit
liberateCLI command; useextractcommand instead.liberateconfiguration options.