Skip to content

fix(tailor): expand diff scope and preserve casing (fixes #805)#809

Open
Frankli9986 wants to merge 8 commits into
srbhr:mainfrom
Frankli9986:fix-805-tailor-scope-casing
Open

fix(tailor): expand diff scope and preserve casing (fixes #805)#809
Frankli9986 wants to merge 8 commits into
srbhr:mainfrom
Frankli9986:fix-805-tailor-scope-casing

Conversation

@Frankli9986

@Frankli9986 Frankli9986 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes issue #805 where the AI Tailor had an overly narrow scope and was losing original capitalization.

Changes

  • Expand diff whitelist to cover:
    • education[i].description[j] — education experience descriptions
    • additional.languages — language list reordering
    • additional.certificationsTraining — certification list reordering
    • additional.awards — awards list reordering
  • Add capitalization preservation rule to diff prompt (rule Bump django from 3.2.11 to 3.2.12 #10): "Preserve original capitalization, especially for proper nouns, technical terms (e.g., REST, API, AWS), and acronyms."
  • Update frontend diff preview to display language and award changes
  • Add translations for new sections in all 5 language files
  • Add unit tests for newly allowed paths

Verification

  • Unit tests pass for new paths (education.description, languages, awards)
  • Blocked paths still rejected (education.degree, education.institution, education.years)
  • Case-insensitive original text matching preserved

Fixes #805


Summary by cubic

Expanded Tailor’s diff scope to include education descriptions, languages, certifications, and awards, and added casing preservation so proper nouns and acronyms keep their original capitalization. Fixes #805 and updates the diff preview to show language and award changes.

  • Bug Fixes
    • Allow diffs for education[i].description, additional.languages, additional.certificationsTraining, and additional.awards (reorder only).
    • Preserve original capitalization for proper nouns, technical terms, and acronyms in diff output.
    • Add unit tests covering new allowed paths; keep education.degree, education.institution, and education.years blocked.
    • Add i18n keys and UI support to render language and award changes in the diff modal.

Written for commit a2f5788. Summary will update on new commits.

Review in cubic

Frankli9986 and others added 8 commits May 5, 2026 12:08
- Filter whitespace-only items in section visibility checks (two-column & single-column)

- Restore deepseek 1.3x timeout multiplier in llm.py
Allow AI Tailor to modify more resume sections while preserving
original capitalization:

Backend:
- improver.py: extend _ALLOWED_PATH_PATTERNS with education.description,
  additional.languages, certificationsTraining, awards
- improver.py: refine _is_path_blocked to allow education[i].description
  while keeping degree/institution/years blocked
- improver.py: extend calculate_resume_diff to compare education
  descriptions, languages, and awards
- templates.py: add new PATHS to DIFF_IMPROVE_PROMPT + casing rule
- test_apply_diffs.py: add tests for new allowed/blocked paths

Frontend:
- resume_previewer_context.tsx: expand field_type union with
  'language' | 'award'
- diff-preview-modal.tsx: add ChangeSection rendering for languages
  and awards
- i18n: add translation keys for languageChanges and awardChanges
  (en/es/ja/pt-BR/zh)

Co-Authored-By: Claude <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 16 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/backend/app/services/improver.py">

<violation number="1" location="apps/backend/app/services/improver.py:1341">
P1: New `field_type` values (`language`, `award`) used in `ResumeFieldDiff` construction are not accepted by the schema's `Literal` type.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

for lang_key in new_lang_keys - orig_lang_keys:
changes.append(ResumeFieldDiff(
field_path="additional.languages",
field_type="language",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: New field_type values (language, award) used in ResumeFieldDiff construction are not accepted by the schema's Literal type.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/backend/app/services/improver.py, line 1341:

<comment>New `field_type` values (`language`, `award`) used in `ResumeFieldDiff` construction are not accepted by the schema's `Literal` type.</comment>

<file context>
@@ -1284,7 +1324,65 @@ def calculate_resume_diff(
+    for lang_key in new_lang_keys - orig_lang_keys:
+        changes.append(ResumeFieldDiff(
+            field_path="additional.languages",
+            field_type="language",
+            change_type="added",
+            new_value=new_langs[lang_key],
</file context>

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.

[Bug]: AI Tailor consistently lowercases descriptions and rewrites only specific sections across multiple models

1 participant