feat(core): add buzzword overuse evaluation rule - #93
Conversation
📝 WalkthroughWalkthroughAdds a critical “Buzzword overuse” issue when at least five anti-patterns match during evaluation, with a test verifying the issue’s severity and message content. ChangesBuzzword overuse rule
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/evaluator/index.ts (1)
185-194: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winDecouple buzzword count from
issuesarray ordering.
issues.length >= 5only reflects anti-pattern matches because this block sits immediately after the anti-pattern loop and before any otherissues.pushcalls. That's an implicit ordering dependency — if a future rule is inserted earlier infindIssues(e.g., before line 185), the buzzword threshold will silently count unrelated issues instead of anti-pattern matches, contrary to the stated objective of countingUNIVERSAL_RULES.antiPatternsmatches specifically.♻️ Suggested refactor: use a dedicated counter
function findIssues(cv: string, _archetype: RoleArchetype) { const issues: EvaluationResult["issues"] = []; + let antiPatternMatches = 0; for (const pattern of UNIVERSAL_RULES.antiPatterns) { if (new RegExp(pattern.match, "i").test(cv)) { + antiPatternMatches++; issues.push({ element: pattern.name, why: pattern.why, fix: pattern.fix, severity: pattern.severity as "critical" | "major" | "minor", }); } } // Buzzword overuse: if 5+ anti-patterns matched, surface a critical issue - if (issues.length >= 5) { + if (antiPatternMatches >= 5) { issues.push({ element: "Buzzword overuse", - why: `Your CV triggered ${issues.length} cliche patterns. This signals AI-generated or template-copied content to screeners.`, + why: `Your CV triggered ${antiPatternMatches} cliche patterns. This signals AI-generated or template-copied content to screeners.`, fix: "Replace each flagged phrase with a specific achievement. One real number beats ten adjectives.", severity: "critical", }); }As per path instructions, "Prioritize correctness of rules, evaluator scoring, and types" — this reduces the risk of silently incorrect scoring if the function is later reordered.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/evaluator/index.ts` around lines 185 - 194, The buzzword threshold in findIssues is implicitly tied to issues.length, so it can drift if new rules add issues earlier in the function. Introduce a dedicated counter for UNIVERSAL_RULES.antiPatterns matches in packages/core/src/evaluator/index.ts, increment it inside the anti-pattern loop, and use that counter in the Buzzword overuse check instead of issues.length. Keep the critical issue push for “Buzzword overuse” unchanged, but make its condition depend only on the anti-pattern match count so ordering of other issues cannot affect it.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/core/src/evaluator/index.ts`:
- Around line 185-194: The buzzword threshold in findIssues is implicitly tied
to issues.length, so it can drift if new rules add issues earlier in the
function. Introduce a dedicated counter for UNIVERSAL_RULES.antiPatterns matches
in packages/core/src/evaluator/index.ts, increment it inside the anti-pattern
loop, and use that counter in the Buzzword overuse check instead of
issues.length. Keep the critical issue push for “Buzzword overuse” unchanged,
but make its condition depend only on the anti-pattern match count so ordering
of other issues cannot affect it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f5521b8b-0ee4-4c0a-b0c0-4eac39f15caa
📒 Files selected for processing (2)
packages/core/src/__tests__/evaluator.test.tspackages/core/src/evaluator/index.ts
9a80261 to
d56eccc
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/__tests__/evaluator.test.ts (1)
52-61: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the complete issue contract.
This test does not verify the required
fixtext or thatwhyincludes the actual matched count. Add assertions for both so future changes cannot silently break the PR’s specified output contract.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/__tests__/evaluator.test.ts` around lines 52 - 61, Extend the “flags buzzword overuse when 5+ anti-patterns match” test to assert the complete Buzzword overuse issue contract: verify buzzwordIssue.fix matches the required fix text and buzzwordIssue.why includes the actual matched anti-pattern count, while preserving the existing element and severity assertions.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/core/src/__tests__/evaluator.test.ts`:
- Around line 52-61: Extend the “flags buzzword overuse when 5+ anti-patterns
match” test to assert the complete Buzzword overuse issue contract: verify
buzzwordIssue.fix matches the required fix text and buzzwordIssue.why includes
the actual matched anti-pattern count, while preserving the existing element and
severity assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 079b5267-1ac9-4aad-9c3b-24c4b666044b
📒 Files selected for processing (2)
packages/core/src/__tests__/evaluator.test.tspackages/core/src/evaluator/index.ts
What does this PR do?
Adds a new CV evaluation rule that detects excessive buzzword usage.
The evaluator now counts how many entries from
UNIVERSAL_RULES.antiPatternsmatch a CV. When 5 or more cliché patterns are detected, it surfaces a critical issue named "Buzzword overuse", encouraging candidates to replace generic buzzwords with measurable achievements.This PR also adds a test case to verify the new behavior.
Related issue
Closes #43
Type of change
Checklist
Screenshots (if UI change)
Summary by CodeRabbit
New Features
Tests