Skip to content

refactor: remove liberate backward compat code#39

Merged
TonyCasey merged 1 commit intomainfrom
git-72-cleanup
Feb 13, 2026
Merged

refactor: remove liberate backward compat code#39
TonyCasey merged 1 commit intomainfrom
git-72-cleanup

Conversation

@TonyCasey
Copy link
Copy Markdown
Owner

@TonyCasey TonyCasey commented Feb 13, 2026

Summary

  • Remove deprecated liberate CLI alias
  • Remove liberate from SourceType union, SOURCE_VALUES, DEFAULT_CONFIDENCE
  • Remove autoLiberateautoExtract migration in loadHookConfig and deepMergeGitMemConfig
  • Remove 4 backward compat tests

Pre-release project — no migration shims needed.

Closes GIT-72 (cleanup follow-up)

Test plan

  • npm run type-check passes
  • npm run lint passes
  • All 268 unit tests pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed the deprecated liberate CLI command; use extract command instead.
    • Removed backward-compatibility migrations for deprecated liberate configuration options.
    • Removed associated tests for deprecated functionality.

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>
Copilot AI review requested due to automatic review settings February 13, 2026 09:54
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
CLI Command
src/cli.ts
Removed deprecated liberate top-level command including all options (--since, --commit-count, --dry-run, --threshold, --enrich) and action handler that forwarded to extractCommand.
Configuration & Migration Logic
src/commands/init-hooks.ts, src/hooks/utils/config.ts
Removed backward-compatibility migration code that previously converted sessionStop.autoLiberate to sessionStop.autoExtract; migration no longer occurs.
Type Definitions
src/domain/types/IMemoryQuality.ts
Removed liberate from SourceType union, SOURCE_VALUES array, and DEFAULT_CONFIDENCE mapping; removed associated deprecation comments.
Unit Tests
tests/unit/commands/init-hooks.test.ts, tests/unit/hooks/utils/config.test.ts
Removed tests covering autoLiberate migration and precedence logic; remaining tests for defaults and merging behavior preserved.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: removing deprecated liberate backward compatibility code across multiple files and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch git-72-cleanup

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 liberate CLI command alias
  • Removed liberate from SourceType union type, SOURCE_VALUES array, and DEFAULT_CONFIDENCE mapping
  • Removed autoLiberateautoExtract migration 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 autoLiberateautoExtract migration logic from config loader
src/commands/init-hooks.ts Removed autoLiberateautoExtract 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.

Comment thread src/hooks/utils/config.ts
const rawHooks = (raw.hooks ?? {}) as Partial<IHooksConfig>;

// Backward compat: migrate autoLiberate → autoExtract
const rawStop = (rawHooks.sessionStop ?? {}) as Record<string, unknown>;
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@TonyCasey TonyCasey merged commit 4b7d738 into main Feb 13, 2026
9 checks passed
@TonyCasey TonyCasey deleted the git-72-cleanup branch February 13, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants