Skip to content

feat: a live send uses the CV and letter the practice run showed - #66

Merged
coderback merged 1 commit into
mainfrom
feat/send-the-reviewed-documents
Oct 20, 2026
Merged

coderback merged 1 commit into
mainfrom
feat/send-the-reviewed-documents

Conversation

@coderback

Copy link
Copy Markdown
Owner

Why

Every autopilot run wrote a fresh CV and cover letter. So "send" never uploaded the pair the user had just reviewed on the practice run; it uploaded a new, unseen one. For a supervised first send, what goes out has to be what was approved.

Separately, Catapult's letter used the World Cup model for both the hook and the first piece of evidence, so the same project and the same details were told twice.

What changed

Autopilot (autopilot.py, tracker.py)

  • Each run keeps the documents it wrote in a new column, autopilot_runs.documents (the CV, template, letter and company research), with a migration for existing databases.
  • A live run uses the last run's pair for that job when both PDFs are still on disk:
    • it reads them before start_autopilot_run replaces that run;
    • it keeps them on the new run at once, so a retry after a failure still has them;
    • it re-runs the fact checks on them;
    • it notes "Used the CV and cover letter from the practice run of ".
  • Otherwise it writes a new pair, as before. Practice runs always write a new pair.
  • Run listings leave the documents out, so the API's responses stay small. tracker.autopilot_documents reads them.

Letter (agent.py)

  • When the candidate has three or more projects, the hook uses a different project from the two in the evidence paragraph, so no project or detail is told twice. The project list in the prompt now says "one for the hook, a different two for the evidence", and the rubric agrees.

Tests

  • New autopilot tests:
    • a live send after a practice run writes nothing new and uploads the same PDFs, and the application's saved CV is the practice one;
    • a practice retry writes a new pair;
    • a live send writes a new pair when the earlier PDF is gone;
    • run listings leave the documents out.
  • The letter test checks the new hook instruction.
  • Fast suite: 1073 passed.
  • Catapult re-run with this code in the API container (practice):
    • outcome ready, all 8 questions from saved answers and profile;
    • the pair is stored, and a live send would reuse it;
    • the hook (World Cup model) differs from the evidence (Premier League system, Windrush);
    • the letter is 370 words.

After deploy

  1. Rebuild the API with docker compose up -d --build api. The migration already ran when Catapult's practice re-run used this code.
  2. A live send of Catapult will then use the stored pair. A practice re-run before that would replace it.

Every run wrote a fresh CV and cover letter, so "send" never uploaded the pair the
user had just reviewed on the practice run. Now each run keeps the documents it
wrote (autopilot_runs.documents: the CV, template, letter and company research),
and a live run uses the last run's pair for that job when both PDFs are still
there. It reads them before start_autopilot_run replaces that run, keeps them on
the new run at once (so a retry after a failure still has them), re-runs the fact
checks on them, and notes "Used the CV and cover letter from the practice run of
<date>". Practice runs always write a new pair. Run listings leave the documents
out, so the API's responses stay small.

The letter's hook now uses a different project from the two in the evidence
paragraph when the candidate has three or more, so no project or detail is told
twice (Catapult's hook and first evidence were both the World Cup model).
@coderback
coderback merged commit e1380f8 into main Oct 20, 2026
3 of 4 checks passed
@coderback
coderback deleted the feat/send-the-reviewed-documents branch October 20, 2026 13:21
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