Skip to content

cleanup: remove dead extractKeywords() and STOPWORDS orphaned by ILIKE removal - #352

Open
sumitvairagar wants to merge 1 commit into
activeloopai:mainfrom
sumitvairagar:cleanup/remove-dead-extractkeywords-341
Open

sumitvairagar wants to merge 1 commit into
activeloopai:mainfrom
sumitvairagar:cleanup/remove-dead-extractkeywords-341

Conversation

@sumitvairagar

@sumitvairagar sumitvairagar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Closes #341.

What

extractKeywords() (src/hooks/shared/recall-gate.ts) was documented as the lexical fallback keyword extractor, but the lexical fallback was removed in bae7bbb1 (semantic-only proactive recall, drop ILIKE fallback). e98aa533 cleaned up the stale comments in recall.ts but left this helper and its STOPWORDS set behind.

Zero production callers remain. The only references outside the definition were the test file (tests/shared/recall.test.ts:495-511). STOPWORDS is private to this function and has no other consumers (SUMMARY_STOPWORDS in mine-local.ts is a separate, unrelated constant — verified by grep).

Changes

  • Delete STOPWORDS set and extractKeywords() from recall-gate.ts
  • Remove extractKeywords import and its describe block from recall.test.ts

Verification

npm test tests/shared/recall.test.ts
58 passed (was 61 — 3 extractKeywords tests removed)

npx tsc --noEmit
clean

Summary by CodeRabbit

  • Refactor
    • Removed the lexical fallback keyword extraction capability.
    • Removed related automated coverage for keyword extraction behavior.

…E removal (activeloopai#341)

extractKeywords() was documented as the lexical fallback keyword extractor,
but the lexical fallback was removed in bae7bbb (semantic-only proactive
recall, drop ILIKE fallback). e98aa53 cleaned up stale comments in recall.ts
but left this helper and its STOPWORDS set behind.

Zero production callers remain — the only references outside the definition
were the test file (tests/shared/recall.test.ts:495-511). STOPWORDS is private
to this function and unused elsewhere (SUMMARY_STOPWORDS in mine-local.ts is
a separate, unrelated constant).

Changes:
- Delete STOPWORDS set and extractKeywords() from recall-gate.ts
- Remove extractKeywords import and its describe block from recall.test.ts

Test count: 58/58 pass (was 61 — 3 extractKeywords tests removed).
TypeScript: tsc --noEmit clean.
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a2c1e777-256c-4fc2-9d16-6d822ae908ea

📥 Commits

Reviewing files that changed from the base of the PR and between 26bdf69 and f1dc079.

📒 Files selected for processing (2)
  • src/hooks/shared/recall-gate.ts
  • tests/shared/recall.test.ts
💤 Files with no reviewable changes (2)
  • src/hooks/shared/recall-gate.ts
  • tests/shared/recall.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the unused extractKeywords helper, its STOPWORDS set, and the associated tests. The recall-gate behavior outside this helper remains unchanged.

Changes

Recall helper cleanup

Layer / File(s) Summary
Remove keyword extraction helper and tests
src/hooks/shared/recall-gate.ts, tests/shared/recall.test.ts
Removes extractKeywords, its stopword data, the import, and tests for token extraction, filtering, deduplication, capping, and terse input.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to f1dc0

The change removes an identified unused helper and its associated tests; no unresolved merge risk is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: removal of the unused extractKeywords() helper and its STOPWORDS set after the ILIKE fallback removal.
Description check ✅ Passed The description explains the reason for the cleanup, lists the affected files, references the linked issue, and includes test and TypeScript verification. It does not use the template headings or expl…
Linked Issues check ✅ Passed Issue #341 permits deletion of the dead helper or documentation correction. The PR deletes STOPWORDS, extractKeywords(), and the related recall.test.ts test block. The diff matches the selected …
Out of Scope Changes check ✅ Passed The whole-PR diff contains only the dead helper and its associated test import and test block. These changes directly implement issue #341. No unrelated production or test changes appear.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

cleanup: extractKeywords() in recall-gate.ts is dead code (orphaned by the ILIKE removal)

1 participant