Skip to content

feat: cover letters in the candidate's own style and structure - #63

Merged
coderback merged 1 commit into
mainfrom
feat/letter-in-users-style
Oct 20, 2026
Merged

coderback merged 1 commit into
mainfrom
feat/letter-in-users-style

Conversation

@coderback

Copy link
Copy Markdown
Owner

Why

Cover letters should look and read like the user's own Jump Trading letter. The old letter was a plain full-width page with a date, an address block, a "Re:" line and "Yours faithfully". Its body followed a generic intro / why them / why me / ending formula.

What changed

Layout (classic_letter.html, new letter.css, measured from the user's PDF)

  • The name in Gelasio, with the surname in sage (#648276). Gelasio is bundled under OFL and has the same letter widths as Georgia.
  • "Computer Science Graduate" beneath the name, then a sage rule.
  • A right-aligned left column: Contact (town and postcode, phone, email; no street address), then "Recruitment Team, / Company, / Town."
  • A sage line between the columns and a sage band on the page's foot. The band is position: fixed in print, because WeasyPrint places an absolute box under a min-height body right after the text.
  • "Dear Hiring Manager" as a heading; "Kind Regards," and the name in sage. No date or "Re:" line.
  • The letter's old rules are removed from base.css.

Writing (agent.generate_cover_letter)

  • The prompt follows the user's four parts:
    1. a hook from the hardest challenge in one of their projects, tied to a concrete employer fact;
    2. "Two projects demonstrate…", with a "Separately," judgement call;
    3. an honest gap taken from a real requirement in the ad (or a third piece of evidence if nothing is missing);
    4. the close.
  • The sign-off "Kind Regards," and the closing line "Thank you for your time and consideration and I hope to hear from you soon." are set after the critique and revision passes, so they always hold.
  • _LETTER_RUBRIC judges against that structure.

Smaller

  • "C++" no longer breaks across lines: a word joiner goes in through a template filter. It's a filter because the latin-1 fallback PDF can't carry one.
  • The editor's "Date & recipient" card becomes "Recipient" (Company, Company location); the letter no longer shows a date or role.

Tests

  • Updated and added letter tests in tests/test_documents.py:
    • sign-off and salutation;
    • closing line;
    • column order with no date or Re: line;
    • street address left out;
    • recipient lines;
    • "C++".
  • Measured PDF test: Gelasio embedded, name 45pt sage, headings 14pt sage, band on the foot.
  • The fit tests now use prose at the user's letter's density (5.2 characters a word); the old test words run to 8. 420 words fit one page without tightening.
  • Fast suite: 1068 passed. The WeasyPrint tests, run in the API container: 63 passed.
  • Generated a real Catapult letter with the new code: four parts as specified, and the fact checks found nothing.

After deploy

Rebuild with docker compose up -d --build api frontend. Autopilot writes new documents on every run, so the next letters use this style.

The letter now follows the candidate's Jump Trading letter, measured from the PDF:
a Gelasio name with the surname in sage, a sage rule, a right-aligned left column
(contact without the street address, then "Recruitment Team, / Company, / Town.")
beside the letter, a sage line between them and a sage band on the page's foot.
No date or "Re:" line; "Dear Hiring Manager" as a heading; "Kind Regards,".

The generator writes the same four parts: a hook from the hardest challenge in one
of the candidate's projects tied to a concrete fact about the employer, two projects
as evidence ("Separately, ..."), an honest gap taken from a real requirement in the
ad, and the candidate's closing line, which is now enforced along with the sign-off.
The critique rubric judges against that structure. "C++" no longer breaks across
lines, and the editor drops the Date and Re: fields the letter no longer shows.
@coderback
coderback merged commit 29dda64 into main Oct 20, 2026
3 of 4 checks passed
@coderback
coderback deleted the feat/letter-in-users-style branch October 20, 2026 11:54
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