Repository navigation
feat: a live send uses the CV and letter the practice run showed - #66
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)autopilot_runs.documents(the CV, template, letter and company research), with a migration for existing databases.start_autopilot_runreplaces that run;tracker.autopilot_documentsreads them.Letter (
agent.py)Tests
After deploy
docker compose up -d --build api. The migration already ran when Catapult's practice re-run used this code.