fix: tighten role inference and allow cRoles editing#187
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds UI components for editing resume roles within the CRM discord bot and constrains designer role inference to explicit design-role signals rather than generic action verbs. It includes a new modal and button for role editing, role normalization utilities, and corresponding test coverage for both the UI additions and inference constraint. Changes
Possibly related PRs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Pull request overview
This PR tightens resume role inference around “designer” to reduce false positives from action-language “design” wording, and adds a Discord confirmation-flow UI to edit proposed CRM roles (cRoles) before applying updates.
Changes:
- Updated the shared resume-extractor prompt guidance to infer
designeronly from explicit design-role signals (not generic “design/designed” language). - Added regression tests ensuring action-language “design” wording does not infer the
designerrole. - Added Discord UI components (button + modal) to allow editing proposed
cRoles, plus unit tests covering visibility, prefill, submit, and clear behaviors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unit/test_resume_extractor.py | Adds regression test preventing “design” action-language from inferring designer. |
| tests/unit/test_crm.py | Adds unit coverage for cRoles edit button/modal behavior in the Discord confirmation view. |
| packages/shared/src/five08/resume_extractor.py | Tightens LLM prompt instructions for designer inference. |
| apps/discord_bot/src/five08/discord_bot/cogs/crm.py | Adds ResumeEditRolesModal, ResumeEditRolesButton, view wiring, and role normalization helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cleaned = [ | ||
| line.strip() for line in raw.replace(",", "\n").splitlines() if line.strip() | ||
| ] | ||
| normalized_roles = normalize_roles(cleaned) |
There was a problem hiding this comment.
normalize_roles already supports splitting a string on commas/newlines/semicolons. Here the modal pre-splits into a list (and only replaces commas), so inputs like developer;marketing (or marketing; designer) will be treated as a single role token and may normalize incorrectly. Consider passing the raw text string directly to normalize_roles(...) (or also splitting on ;) and letting it handle delimiter parsing/deduping.
| cleaned = [ | |
| line.strip() for line in raw.replace(",", "\n").splitlines() if line.strip() | |
| ] | |
| normalized_roles = normalize_roles(cleaned) | |
| normalized_roles = normalize_roles(raw) |
Description
Related Issue
How Has This Been Tested?
Summary by CodeRabbit
New Features
Bug Fixes