Skip to content

fix: every skill reaches the CV, and a graduate CV fits on one page - #19

Merged
coderback merged 1 commit into
mainfrom
fix/cv-skills-and-page-fit
Oct 15, 2026
Merged

coderback merged 1 commit into
mainfrom
fix/cv-skills-and-page-fit

Conversation

@coderback

Copy link
Copy Markdown
Owner

Summary

This fixes the two CV problems the rendering tests in #18 recorded as strict xfails.

Every skill reaches the CV

Before, skill groups past the sixth were dropped and rows were cut at 14 items. A profile with ten overlapping groups (left by a CV re-import) lost Git, AWS and CI/CD.

  • The tailored-CV prompt now asks the model to sort every skill into at most 6 categories, without adding, dropping, renaming or combining any.
  • agent._regrouped_skills accepts that grouping only if it holds exactly the profile's skills: none dropped, added or repeated, and no unnamed group. Skills keep the profile's spelling.
  • Otherwise the profile's own groups are used, and doc_render._skill_rows folds any groups past the fifth into one "Other" row. An existing "Other"-like group absorbs them and moves last.
  • No skill is cut any more.

A graduate CV fits on one page

doc_render._fitted_cv_html measures the CV in WeasyPrint. When it runs past its target (one page for a graduate, two otherwise), it tries these steps in order and uses the first that fits:

  1. tighter spacing;
  2. 10pt type;
  3. no project technology lists;
  4. at most 3 bullets per role;
  5. project descriptions cut to their first sentence.

The steps are listed in _FIT_STEPS. The layout steps are CSS classes on the body element (base.css), and the trims are applied to the data. The preview and the PDF use the same result. The preview endpoint now renders in a worker thread, since it lays the CV out. Where WeasyPrint can't load, the CV renders as written.

Testing

  • The two strict xfails pass. The full API suite passes (647), and all 41 document tests pass in the API image.
  • New tests cover:
    • the model's regrouping being accepted, and rejected when it drops, adds or repeats a skill, uses 7 groups or leaves a group unnamed;
    • folding into "Other";
    • the fit steps' order: as written, tighter, smaller, then trims in the agreed order, with a warning when nothing fits;
    • an experienced CV allowed two pages;
    • the preview being fitted like the PDF.
  • On my real profile with Azure: the model's regrouping was accepted in 4 of 5 runs, with all 44 skills in 5–6 groups, and every CV fit one page with only tighter spacing. The one rejected run fell back to the folded rows, also all 44 skills.

Skills: groups past the sixth were dropped (and rows past 14 items cut),
so a profile with ten overlapping groups lost Git, AWS and CI/CD. The
tailored-CV prompt now asks the model to sort every skill into at most six
categories; its grouping is used only if it holds exactly the profile's
skills, none dropped, added or repeated. Otherwise, and for any CV not
written by the model, extra groups fold into one "Other" row. No skill is
cut any more.

Page fit: the renderer measures a CV in WeasyPrint and, when it runs past
its target (one page for a graduate, two otherwise), tries in order:
tighter spacing, 10pt type, then dropping project technology lists, each
role's 4th bullet, and project descriptions after their first sentence. The
first step that fits is used for both the preview and the PDF; the preview
endpoint now renders in a worker thread. Without WeasyPrint it renders as
written.

The two strict xfails from the rendering tests now pass.
@coderback
coderback merged commit 15fd95d into main Oct 15, 2026
4 checks passed
@coderback
coderback deleted the fix/cv-skills-and-page-fit branch October 15, 2026 18:48
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.

1 participant