Repository navigation
Phase 3: answer application questions from an answer bank, never guessing a fact - #26
Merged
Merged
Conversation
…essing a fact Every screening question the apply agent meets now goes through an answer_questions action (answers.py) instead of facts listed in its task. Each answer says where it came from: - saved: the answer bank (new answer_bank table, /answers endpoints); - profile: a fact in the persona (right to work, notice, nationality, a degree); - drafted: a written answer drafted for the job, checked by doc_check and revised once if it carries an unsupported claim; - needs_you: nothing the user has given states it, so it is left blank. A model maps each question to the fact that answers it; the value comes from the fact, and code checks the reading: it must cite a known fact, be one of the form's options, keep a yes/no fact's direction, and not carry a UK fact to another country. Contact details, salary, equality answers and the date of birth reach that model only as "this fact exists". The review event carries every question with its answer and source, the notes lead with the questions left blank, and /apply stores them on the application. fill_answer pastes a written answer whole, as paste_cover_letter does for the letter. evals/test_answers_eval.py (opt-in) puts 40 real application questions to a test persona with an answer bank; three runs: every fact within its labelled answers, 2-3 of 27 answerable facts left for the candidate, no flagged claim in any draft.
… in your persona The review (in the job workspace and the Agent review queue) gets a "Questions on this form" panel: every question the agent met, its answer, where it came from (saved answer, your persona, drafted for this job, or only you can answer) and what it rests on. A question left blank gets a box with the form's own options; answering it saves it to your answer bank for the next form. A drafted answer can be edited and saved for next time. Persona gets a "Saved answers" section to read, edit, delete and add to the answer bank. The job description now goes to /apply for written answers. Two Playwright smoke tests cover both.
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.
Phase 3, part 1: application questions are answered from an answer bank and the persona, and a fact is never guessed.
What it does
Every screening question the apply agent meets goes through a new
answer_questionsaction (api/app/answers.py). The agent's task no longer lists facts, stories or screening answers for it to answer from. Each answer carries its source:answer_banktable,/answersendpoints);doc_checkchecks it, and it is revised once if it carries an unsupported claim;A model maps each question to the fact that answers it. The value always comes from the fact, and code checks the model's reading:
Contact details, salary, equality answers and the date of birth reach that model only as "this fact exists"; Windrush fills in the value.
In the app
/applystores the questions on the application.How well it does
api/evals/test_answers_eval.py(opt-in,WINDRUSH_LLM_EVAL=1) puts 40 real application questions to a test persona with an answer bank. The questions include right to work, US authorisation, sponsorship worded both ways, salary bands, equality monitoring, declarations, convictions and four written questions.The facts left for you were a salary band, a Kubernetes question your skills don't mention, and once a Skilled Worker visa question. The eval fails on any answer outside its labels, a flagged claim in a draft, or a private value in a prompt.
A live run of the real model on a local practice form went as intended:
answer_questionscall covered all 8 questions;That run also found the agent passing "(max 150 words)" as a 150-character box limit, which cut the draft to a sentence. That is fixed and tested.
Tests
test_answers.py.