-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
PR for FIX - ISSUE : #307 #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdates PR template content and overhauls a backend prompt constant for resume improvement. The new prompt enforces truth-grounding, anti-fabrication directives, a structured analysis-to-revision process, and stricter output formatting, while retaining legacy prompt context. No public APIs or exports were added or removed. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/backend/app/prompt/resume_improvement.py (1)
26-34
: Fix unbalanced Markdown code fences (Job Description block).The "JOB DESCRIPTION" code fence is opened but never closed, which may cause the model to treat subsequent sections as part of the same fence and degrade parsing.
Apply this diff to properly close the code fence and keep all four blocks consistently fenced:
JOB DESCRIPTION: -```md -{raw_job_description} - -Extracted Job Keywords: -```md +```md +{raw_job_description} +``` + +Extracted Job Keywords: +```md {extracted_job_keywords}</blockquote></details> </blockquote></details>
🧹 Nitpick comments (4)
apps/backend/app/prompt/resume_improvement.py (2)
1-2
: Update reference to correct issue number in header comment.Header references issue #374, while this PR is for #307. Avoid confusion by aligning the comment with the actual issue or keep it generic.
-# New optimised prompt which tackles the problems stated at (https://github.com/srbhr/Resume-Matcher/issues/374) +# Optimized prompt designed to mitigate hallucinations (see issue #307)
49-52
: Consider moving the legacy prompt out of this module or namespacing it.Keeping a large commented-out alternative in code can invite accidental reactivation and adds noise to diffs. Either remove it after review, move it to documentation/tests, or, if you want A/B capability, expose it as LEGACY_PROMPT and keep it unused by the factory.
.github/PULL_REQUEST_TEMPLATE.md (2)
38-38
: Provide actionable, generic testing steps.“Do a general tool run” is vague for a template. Offer a reproducible outline authors can adapt.
-- Do a general tool run and feed the data. You'll witness the effect of the modified prompt. +- 1. Steps to reproduce or verify (include sample data/IDs): +- 2. Commands to run (backend/frontend), e.g., make targets or scripts: +- 3. Expected result (logs, UI changes, API responses):
53-53
: Remove PR-specific “Additional Information” content.Keep this section generic so authors can add context relevant to their change.
-This change is critical for maintaining user trust and ensuring the resume improvement feature provides truthful, accurate enhancements rather than fabricated content. The new prompt structure can serve as a template for other AI-powered features that require similar constraints against hallucination. +<!-- Add any other context, screenshots, performance notes, migration steps, etc. -->📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/PULL_REQUEST_TEMPLATE.md
(1 hunks)apps/backend/app/prompt/resume_improvement.py
(2 hunks)🧰 Additional context used
🧬 Code Graph Analysis (2)
.github/PULL_REQUEST_TEMPLATE.md (1)
apps/backend/app/services/score_improvement_service.py (1)
get_resume_for_previewer
(179-198)apps/backend/app/prompt/resume_improvement.py (1)
apps/backend/app/services/score_improvement_service.py (2)
improve_score_with_llm
(141-177)run
(200-257)🪛 LanguageTool
.github/PULL_REQUEST_TEMPLATE.md
[grammar] ~16-~16: There might be a mistake here.
Context: ...n "x" in the brackets --> - [x] Bug Fix - [ ] Feature Enhancement - [ ] Documentat...(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... - [x] Bug Fix - [ ] Feature Enhancement - [ ] Documentation Update - [x] Code Refa...(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...e Enhancement - [ ] Documentation Update - [x] Code Refactoring - [ ] Other (please...(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ...umentation Update - [x] Code Refactoring - [ ] Other (please specify): ## Proposed...(QB_NEW_EN)
[grammar] ~25-~25: There might be a mistake here.
Context: ...-> - Completely revamped the prompt inapps/backend/app/prompt/resume_improvement.py
- Added explicit anti-hallucination direct...(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...rectives forbidding invention of details - Implemented structured "Analyze then Rev...(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ...evise" framework for better AI reasoning - Enhanced quantification handling with pl...(QB_NEW_EN)
[grammar] ~28-~28: There might be a mistake here.
Context: ...th placeholder usage for implied metrics - Strengthened output formatting rules for...(QB_NEW_EN)
🔇 Additional comments (1)
apps/backend/app/prompt/resume_improvement.py (1)
8-9
: Placeholders and formatting look correct for str.format usage.All named placeholders match the call site in score_improvement_service.py and use appropriate formatting for the cosine similarity.
@@ -1,49 +1,53 @@ | |||
## Pull Request Title | |||
<!-- Provide a concise and descriptive title for the pull request --> | |||
fix: Harden resume improvement prompt to prevent AI hallucination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the PR title field generic (don’t hardcode a specific fix).
Templates should not pre-fill a specific change; it will leak into unrelated PRs.
-fix: Harden resume improvement prompt to prevent AI hallucination
+<!-- e.g., fix: concise imperative summary (max 72 chars) -->
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
fix: Harden resume improvement prompt to prevent AI hallucination | |
<!-- e.g., fix: concise imperative summary (max 72 chars) --> |
🤖 Prompt for AI Agents
.github/PULL_REQUEST_TEMPLATE.md around line 3 contains a hardcoded PR title
("fix: Harden resume improvement prompt to prevent AI hallucination") which will
leak into unrelated PRs; replace that specific line with a generic placeholder
such as "Short, descriptive title of your change" or an empty line/instruction
like "PR title:" (do not prefill a concrete fix or prefix like "fix:") so
contributors must enter an appropriate, context-specific title.
|
||
## Related Issue | ||
<!-- If this pull request is related to an issue, please link it here using the "#" symbol followed by the issue number (e.g., #123) --> | ||
- Issue number : #307 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t hardcode an issue number in the template.
Defaulting to #307 will mislead authors opening unrelated PRs.
-- Issue number : #307
+- Issue number: #<issue_id>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- Issue number : #307 | |
- Issue number: #<issue_id> |
🤖 Prompt for AI Agents
.github/PULL_REQUEST_TEMPLATE.md around line 7 currently hardcodes "Issue number
: #307"; remove the hardcoded issue number and replace it with an empty
placeholder or instructive placeholder text (e.g., "Issue number:
#<issue-number>" or "Issue number: (if applicable)") so authors must fill the
correct issue when opening a PR; update the template line accordingly and ensure
it does not point to a specific issue by default.
|
||
## Description | ||
<!-- Describe the changes made in this pull request. What problem does it solve or what feature does it add/modify? --> | ||
This PR addresses a critical issue with AI hallucination in the resume improvement feature where the model would fabricate details not present in the user's original resume. The prompt in `resume_improvement.py` has been completely overhauled with explicit anti-fabrication directives and a structured reasoning framework to ensure all output is truthful and grounded solely in the provided user data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove PR-specific description from the template body.
Templates should guide authors; they shouldn’t contain content for a particular change.
-This PR addresses a critical issue with AI hallucination in the resume improvement feature where the model would fabricate details not present in the user's original resume. The prompt in `resume_improvement.py` has been completely overhauled with explicit anti-fabrication directives and a structured reasoning framework to ensure all output is truthful and grounded solely in the provided user data.
+<!-- Describe the changes made in this pull request. What problem does it solve or what feature does it add/modify? -->
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
This PR addresses a critical issue with AI hallucination in the resume improvement feature where the model would fabricate details not present in the user's original resume. The prompt in `resume_improvement.py` has been completely overhauled with explicit anti-fabrication directives and a structured reasoning framework to ensure all output is truthful and grounded solely in the provided user data. | |
<!-- Describe the changes made in this pull request. What problem does it solve or what feature does it add/modify? --> |
🤖 Prompt for AI Agents
In .github/PULL_REQUEST_TEMPLATE.md around line 11, the template contains a
PR-specific description about a resume_improvement.py change; remove that
specific paragraph so the template remains generic, and replace it with a
neutral placeholder or guidance such as a short prompt like "Describe the
purpose and scope of this PR" or checklist items for authors to fill in; ensure
no file- or change-specific text remains in the template.
- [x] Bug Fix | ||
- [ ] Feature Enhancement | ||
- [ ] Documentation Update | ||
- [ ] Code Refactoring | ||
- [ ] Other (please specify): | ||
- [x] Code Refactoring | ||
- [ ] Other (please specify): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave type checkboxes unchecked by default.
Pre-checking biases unrelated PRs and reduces signal quality in triage.
-- [x] Bug Fix
+- [ ] Bug Fix
- [ ] Feature Enhancement
- [ ] Documentation Update
-- [x] Code Refactoring
+- [ ] Code Refactoring
- [ ] Other (please specify):
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- [x] Bug Fix | |
- [ ] Feature Enhancement | |
- [ ] Documentation Update | |
- [ ] Code Refactoring | |
- [ ] Other (please specify): | |
- [x] Code Refactoring | |
- [ ] Other (please specify): | |
- [ ] Bug Fix | |
- [ ] Feature Enhancement | |
- [ ] Documentation Update | |
- [ ] Code Refactoring | |
- [ ] Other (please specify): |
🧰 Tools
🪛 LanguageTool
[grammar] ~16-~16: There might be a mistake here.
Context: ...n "x" in the brackets --> - [x] Bug Fix - [ ] Feature Enhancement - [ ] Documentat...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ... - [x] Bug Fix - [ ] Feature Enhancement - [ ] Documentation Update - [x] Code Refa...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...e Enhancement - [ ] Documentation Update - [x] Code Refactoring - [ ] Other (please...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ...umentation Update - [x] Code Refactoring - [ ] Other (please specify): ## Proposed...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In .github/PULL_REQUEST_TEMPLATE.md around lines 16 to 21, the template
currently pre-checks the Bug Fix and Code Refactoring boxes; update the template
so all checkbox items are unchecked by default. Remove the leading "x" from
those two lines (and ensure no other options are pre-checked) so contributors
must explicitly select the relevant type when opening a PR.
- Completely revamped the prompt in `apps/backend/app/prompt/resume_improvement.py` | ||
- Added explicit anti-hallucination directives forbidding invention of details | ||
- Implemented structured "Analyze then Revise" framework for better AI reasoning | ||
- Enhanced quantification handling with placeholder usage for implied metrics | ||
- Strengthened output formatting rules for consistent parsing | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace PR-specific change list with placeholders.
The template should prompt authors to enumerate their changes rather than prescribe this PR’s content.
-- Completely revamped the prompt in `apps/backend/app/prompt/resume_improvement.py`
-- Added explicit anti-hallucination directives forbidding invention of details
-- Implemented structured "Analyze then Revise" framework for better AI reasoning
-- Enhanced quantification handling with placeholder usage for implied metrics
-- Strengthened output formatting rules for consistent parsing
+- <List the specific changes made in this pull request>
+- <Be concrete: file paths, functions/modules touched, migrations, configs>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- Completely revamped the prompt in `apps/backend/app/prompt/resume_improvement.py` | |
- Added explicit anti-hallucination directives forbidding invention of details | |
- Implemented structured "Analyze then Revise" framework for better AI reasoning | |
- Enhanced quantification handling with placeholder usage for implied metrics | |
- Strengthened output formatting rules for consistent parsing | |
- <List the specific changes made in this pull request> | |
- <Be concrete: file paths, functions/modules touched, migrations, configs> |
🧰 Tools
🪛 LanguageTool
[grammar] ~25-~25: There might be a mistake here.
Context: ...-> - Completely revamped the prompt in apps/backend/app/prompt/resume_improvement.py
- Added explicit anti-hallucination direct...
(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...rectives forbidding invention of details - Implemented structured "Analyze then Rev...
(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ...evise" framework for better AI reasoning - Enhanced quantification handling with pl...
(QB_NEW_EN)
[grammar] ~28-~28: There might be a mistake here.
Context: ...th placeholder usage for implied metrics - Strengthened output formatting rules for...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In .github/PULL_REQUEST_TEMPLATE.md around lines 25 to 30, the template
currently contains a hard-coded PR changelist that prescribes this PR's content;
replace those specific bullet points with neutral placeholders prompting authors
to list their changes (e.g., a short instruction line and an empty bullet list
or checklist for changed files, features, and fixes). Ensure the wording guides
contributors to briefly describe what changed, why, and any migration or testing
notes, without including any PR-specific content.
- [x] The code compiles successfully without any errors or warnings | ||
- [x] The changes have been tested and verified | ||
- [ ] The documentation has been updated (if applicable) | ||
- [ ] The changes follow the project's coding guidelines and best practices | ||
- [ ] The commit messages are descriptive and follow the project's guidelines | ||
- [ ] All tests (if applicable) pass successfully | ||
- [ ] This pull request has been linked to the related issue (if applicable) | ||
- [x] The changes follow the project's coding guidelines and best practices | ||
- [x] The commit messages are descriptive and follow the project's guidelines | ||
- [x] All tests (if applicable) pass successfully | ||
- [x] This pull request has been linked to the related issue (if applicable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncheck all checklist items by default.
Checked boxes in the template undermine their purpose.
-- [x] The code compiles successfully without any errors or warnings
- - [x] The changes have been tested and verified
+ - [ ] The code compiles successfully without any errors or warnings
+ - [ ] The changes have been tested and verified
- [ ] The documentation has been updated (if applicable)
-- [x] The changes follow the project's coding guidelines and best practices
-- [x] The commit messages are descriptive and follow the project's guidelines
-- [x] All tests (if applicable) pass successfully
-- [x] This pull request has been linked to the related issue (if applicable)
+ - [ ] The changes follow the project's coding guidelines and best practices
+ - [ ] The commit messages are descriptive and follow the project's guidelines
+ - [ ] All tests (if applicable) pass successfully
+ - [ ] This pull request has been linked to the related issue (if applicable)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- [x] The code compiles successfully without any errors or warnings | |
- [x] The changes have been tested and verified | |
- [ ] The documentation has been updated (if applicable) | |
- [ ] The changes follow the project's coding guidelines and best practices | |
- [ ] The commit messages are descriptive and follow the project's guidelines | |
- [ ] All tests (if applicable) pass successfully | |
- [ ] This pull request has been linked to the related issue (if applicable) | |
- [x] The changes follow the project's coding guidelines and best practices | |
- [x] The commit messages are descriptive and follow the project's guidelines | |
- [x] All tests (if applicable) pass successfully | |
- [x] This pull request has been linked to the related issue (if applicable) | |
- [ ] The code compiles successfully without any errors or warnings | |
- [ ] The changes have been tested and verified | |
- [ ] The documentation has been updated (if applicable) | |
- [ ] The changes follow the project's coding guidelines and best practices | |
- [ ] The commit messages are descriptive and follow the project's guidelines | |
- [ ] All tests (if applicable) pass successfully | |
- [ ] This pull request has been linked to the related issue (if applicable) |
🤖 Prompt for AI Agents
.github/PULL_REQUEST_TEMPLATE.md lines 43-49: the checklist currently has
several items pre-checked which defeats the template's purpose; change all
checked boxes ([x]) to unchecked ([ ]) so every checklist item is blank by
default, ensuring contributors must consciously confirm each item when opening a
PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 2 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
@@ -1,49 +1,53 @@ | |||
## Pull Request Title | |||
<!-- Provide a concise and descriptive title for the pull request --> | |||
fix: Harden resume improvement prompt to prevent AI hallucination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR template incorrectly filled with specific PR content instead of remaining generic
Prompt for AI agents
Address the following comment on .github/PULL_REQUEST_TEMPLATE.md at line 3:
<comment>PR template incorrectly filled with specific PR content instead of remaining generic</comment>
<file context>
@@ -1,49 +1,53 @@
## Pull Request Title
<!-- Provide a concise and descriptive title for the pull request -->
+fix: Harden resume improvement prompt to prevent AI hallucination
## Related Issue
</file context>
- Do not add any new sections (like "Projects") unless they already exist in the original. | ||
- Do not include any explanations, commentary, or metadata outside of the resume itself. | ||
JOB DESCRIPTION: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing closing markdown delimiter for JOB DESCRIPTION section
Prompt for AI agents
Address the following comment on apps/backend/app/prompt/resume_improvement.py at line 26:
<comment>Missing closing markdown delimiter for JOB DESCRIPTION section</comment>
<file context>
@@ -1,21 +1,31 @@
+# New optimised prompt which tackles the problems stated at (https://github.com/srbhr/Resume-Matcher/issues/374)
+
PROMPT = """
-You are an expert resume editor and talent acquisition specialist. Your task is to revise the following resume so that it aligns as closely as possible with the provided job description and extracted job keywords, in order to maximize the cosine similarity between the resume and the job keywords.
-
-Instructions:
-- Carefully review the job description and the list of extracted job keywords.
-- Update the candidate's resume by:
- - Emphasizing and naturally incorporating relevant skills, experiences, and keywords from the job description and keyword list.
</file context>
Pull Request Title
Related Issue
Description
Type
Proposed Changes
Screenshots / Code Snippets (if applicable)
How to Test
Checklist
Additional Information
Summary by cubic
Hardened the resume-improvement prompt to prevent fabricated details and keep edits grounded in the original resume, addressing issue #307. Introduces a simple analyze → map → revise flow and stricter output rules for consistent, truthful results.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation