Combine interview scorecards into one hiring summary.
Done by an agent. Checked twice.
One page per candidate with the combined scores, the votes and every place the interviewers disagreed, built only from scorecards that count.
Real files in
- interview_plan.csv
Who was due to interview each of five candidates, 20 planned interviews. 21 lines, 1 KB. - scorecards.csv
The 21 scorecards that came in, with a resent card, an observer's card, a blank score, a score off the scale and one card never sent. 22 lines, 3 KB. - scoring_guide.md
The company's scoring scale, competencies and the gap that counts as disagreement. 20 lines, 697 bytes.
Sample data written by Atris. Not a real company.
Three steps
- 1.Decide which scorecards and scores count
- 2.Combine the scores and find the disagreements
- 3.Write the summary
Claude Sonnet 5.5, 55 seconds. No web. It never saw the check.
Checked twice
- Passed: 20 of 20 candidate and competency rows appear once in competency_scores.csv
- Passed: 20 of 20 averages equal the average rebuilt from the scorecards that count
- Passed: 20 of 20 spreads and disagreement marks are right, with 5 disagreements to find
- Passed: 5 of 5 disagreements name the right lowest and highest scorers and 20 of 20 rows carry the right lowest and highest scores with who gave them
- Passed: 5 of 5 candidates have the name on the plan and the right overall average, votes and disagreement count
- Passed: 5 of 5 candidates show the right number of scorecards counted and name any missing interviewer
- Passed: 4 of 4 left out scorecards and scores are listed under Not counted in hiring_summary.md
- Passed: 71 of 71 figures in hiring_summary.md equal the scorecard score or the rebuilt figure they restate
- Passed: 21 of 21 quoted passages in hiring_summary.md are word for word from a scorecard named on the same line
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 9 ways on purpose. The check caught 9.
## C-104 Rosalind Tembo
- Overall average: 3.25 (16 counted scores on 4 of 4 expected scorecards)
- Votes: 3 hire/strong_hire, 1 no_hire/strong_no_hire; split recommendation: yes (Ines Babatunde: hire, Priyanka Vandermeer: strong_hire, Gregor Solheim: hire, Tomasz Achebe-Lowe: strong_no_hire)
- Disagreements (2):
- **problem_solving**: spread 3 (lowest 1, highest 4)
- Ines Babatunde gave 3 (SC-313): "Calm and clear. Her last team's numbers back up what she says."
- Priyanka Vandermeer gave 4 (SC-315): "Best team interview I have sat in this year."
- Gregor Solheim gave 3 (SC-316): "Sending again. I reread my notes and she did cover warranty terms in full. Role knowledge corrected."
- Tomasz Achebe-Lowe gave 1 (SC-317): "In the role play she blamed the agent and never asked what went wrong. I would not put her in charge of people."
- **teamwork**: spread 2 (lowest 2, highest 4)How this was run
An AI agent on Claude Sonnet 5.5 was given a folder with the files below and a three-step flow, and nothing else. It had no web access and never saw the check. The check was written before the run and made stricter after it. It works the answer out again from the input files. Then Claude Opus 5.5 reviewed the result against the inputs. The input files are sample data written by Atris, with the problems a real week has planted in them.
Run 1 of 1 on 1 December 2026. The agent took 55 seconds.
What the second review verified
- I rebuilt every average from the counted scorecards. For example, C-105 overall is 44/15 = 2.93 once SC-320's off-scale role_knowledge score of 5 is dropped, C-103 overall is 29/12 = 2.42, and C-102 teamwork is 3.00 from 3 scores because SC-310 left that score blank.
- C-104 is handled correctly. SC-311 is replaced by Gregor Solheim's later card SC-316, so role_knowledge averages 3.50. SC-315 spells the name 'Rosalyn' but was still matched on C-104. The problem_solving spread of 4−1 = 3 is flagged as a disagreement.
- SC-305 is correctly left out because Dmitri Okafor-Reyes was observing and is not on the C-101 panel. C-101 therefore stays at 4 hire votes, 0 no-hire votes and an overall average of 3.50 (56/16).
- Tomasz Achebe-Lowe is listed as the missing interviewer for C-103 and his scores were not filled in. All 5 disagreements are correct (C-102: problem_solving, communication and role_knowledge; C-104: problem_solving and teamwork). Each one shows every interviewer's score and their exact comment. The included check.py passes all 7 of its checks.
What this run does not show
- The check rebuilds every number and matches every quoted comment, yet it cannot tell whether the summary reads fairly to a hiring manager.
- The scorecards were written for this run with one planted problem of each kind, where a real panel leaves messier gaps.
Would the check catch a wrong answer?
A check that cannot fail proves nothing. After the run we took a copy of the output, broke it one small way at a time and ran the check again. It caught 9 of 9. The check was made stricter after the first try at this, and the same untouched output was graded again.
Open every file
flow.md · the three steps the agent followed
# Combine interview scorecards into one hiring summary function: people for: the hiring manager who has to make the hiring decision goal: One summary per candidate shows the combined scores, the votes and every place the interviewers disagree, built only from the scorecards that count. ## 1. Decide which scorecards and scores count Read input/scoring_guide.md, input/interview_plan.csv and input/scorecards.csv. Match on candidate_id, never on how a name is spelled. Use the candidate name from the plan. - A scorecard counts only when the plan lists that interviewer for that candidate. - When one interviewer sent more than one scorecard for the same candidate, only the latest by submitted_at counts. - On a scorecard that counts, a score counts only when it is a whole number inside the scale in the scoring guide. Leave out a blank or off the scale score. The other scores on that card and its recommendation still count. - A planned interview with no scorecard is missing. Do not fill it in. ## 2. Combine the scores and find the disagreements For each candidate and each competency work out: scores_counted, average (two decimals), lowest, highest and spread (highest minus lowest). disagreement is `yes` when the spread is at least the disagreement gap in the scoring guide, otherwise `no`. lowest_by and highest_by name every interviewer who gave the lowest and the highest counted score. For each candidate work out: overall_average, the average of every counted score across all competencies (two decimals, not an average of averages). hire_votes counts scorecards recommending hire or strong_hire. no_hire_votes counts no_hire or strong_no_hire. split_recommendation is `yes` when there is at least one vote each way. ## 3. Write the summary Write output/competency_scores.csv with columns candidate_id,competency,scores_counted,average,lowest,lowest_by,highest,highest_by,spread,disagreement. One row per candidate per competency. Separate names with a semicolon. Write output/candidates.csv with columns candidate_id,candidate,scorecards_expected,scorecards_counted,missing_interviewers,overall_average,hire_votes,no_hire_votes,split_recommendation,disagreements. disagreements is the number of competencies marked `yes`. Write output/hiring_summary.md for the hiring manager. One short section per candidate: the overall average, the votes, each disagreement with who scored what and the comment each gave, then any missing scorecard. End with a section headed "Not counted" that lists by scorecard_id every scorecard and every single score you left out and why. Report what the panel said. Do not recommend a decision of your own. ## Done looks like - Every candidate has one row per competency and one row in candidates.csv. - Every average can be rebuilt from the scorecards that count. - Every left out scorecard or score is listed with its reason.
input/interview_plan.csv · 21 lines, 1 KB
candidate_id,candidate,interviewer,interview C-101,Anneliese Hartigan,Ines Babatunde,Hiring manager interview C-101,Anneliese Hartigan,Gregor Solheim,Live ticket exercise C-101,Anneliese Hartigan,Priyanka Vandermeer,Team interview C-101,Anneliese Hartigan,Tomasz Achebe-Lowe,Coaching role play C-102,Kwabena Ostrander,Ines Babatunde,Hiring manager interview C-102,Kwabena Ostrander,Gregor Solheim,Live ticket exercise C-102,Kwabena Ostrander,Priyanka Vandermeer,Team interview C-102,Kwabena Ostrander,Tomasz Achebe-Lowe,Coaching role play C-103,Yusuf Delacroix-Lim,Ines Babatunde,Hiring manager interview C-103,Yusuf Delacroix-Lim,Gregor Solheim,Live ticket exercise C-103,Yusuf Delacroix-Lim,Priyanka Vandermeer,Team interview C-103,Yusuf Delacroix-Lim,Tomasz Achebe-Lowe,Coaching role play C-104,Rosalind Tembo,Ines Babatunde,Hiring manager interview C-104,Rosalind Tembo,Gregor Solheim,Live ticket exercise C-104,Rosalind Tembo,Priyanka Vandermeer,Team interview C-104,Rosalind Tembo,Tomasz Achebe-Lowe,Coaching role play C-105,Mateus Hollingworth,Ines Babatunde,Hiring manager interview C-105,Mateus Hollingworth,Gregor Solheim,Live ticket exercise C-105,Mateus Hollingworth,Priyanka Vandermeer,Team interview C-105,Mateus Hollingworth,Tomasz Achebe-Lowe,Coaching role play
input/scorecards.csv · 22 lines, 3 KB
scorecard_id,submitted_at,candidate_id,candidate_name,interviewer,problem_solving,communication,role_knowledge,teamwork,recommendation,comment SC-301,2026-11-16T11:20,C-101,Anneliese Hartigan,Ines Babatunde,4,3,4,3,hire,"Ran a team of nine before. Clear on how she would handle a backlog spike." SC-302,2026-11-16T14:05,C-101,Anneliese Hartigan,Gregor Solheim,3,3,4,4,strong_hire,"Solved the refund ticket fast and explained the policy without looking it up." SC-303,2026-11-16T16:45,C-102,Kwabena Ostrander,Ines Babatunde,4,2,3,3,hire,"Sharp thinker. Answers ran long and he lost the thread twice." SC-304,2026-11-17T09:10,C-101,Anneliese Hartigan,Priyanka Vandermeer,4,4,3,3,hire,"The team liked her. Less sure on our returns system than she thinks." SC-305,2026-11-17T09:30,C-101,Anneliese Hartigan,Dmitri Okafor-Reyes,2,2,2,2,no_hire,"I sat in on the team interview to learn the format. Did not find her answers convincing." SC-306,2026-11-17T10:15,C-102,Kwabena Ostrander,Gregor Solheim,2,4,3,3,hire,"Lovely manner with the customer. Got stuck on the double charge ticket and needed two hints." SC-307,2026-11-17T13:40,C-101,Anneliese Hartigan,Tomasz Achebe-Lowe,3,4,4,3,hire,"Gave direct feedback in the role play and stayed kind." SC-308,2026-11-17T15:00,C-102,Kwabena Ostrander,Priyanka Vandermeer,4,4,1,3,no_hire,"Bright and clear but has never worked a support queue. Could not name one metric a lead would watch." SC-309,2026-11-17T16:20,C-103,Yusuf Delacroix-Lim,Ines Babatunde,2,3,2,3,no_hire,"Pleasant. Has not led people and it showed." SC-310,2026-11-18T09:05,C-102,Kwabena Ostrander,Tomasz Achebe-Lowe,3,3,3,,hire,"Ran out of time before the teamwork part of the role play so I have left it blank." SC-311,2026-11-18T10:05,C-104,Rosalind Tembo,Gregor Solheim,3,3,2,3,hire,"Steady on the ticket. Marked role knowledge down for not knowing warranty terms." SC-312,2026-11-18T10:50,C-103,Yusuf Delacroix-Lim,Gregor Solheim,2,2,2,3,no_hire,"Needed a lot of help on the exercise." SC-313,2026-11-18T11:30,C-104,Rosalind Tembo,Ines Babatunde,3,4,3,4,hire,"Calm and clear. Her last team's numbers back up what she says." SC-314,2026-11-18T14:15,C-103,Yusuf Delacroix-Lim,Priyanka Vandermeer,3,3,2,2,no_hire,"Talked over two of the team." SC-315,2026-11-18T15:45,C-104,Rosalyn Tembo,Priyanka Vandermeer,4,4,4,4,strong_hire,"Best team interview I have sat in this year." SC-316,2026-11-19T09:40,C-104,Rosalind Tembo,Gregor Solheim,3,3,4,3,hire,"Sending again. I reread my notes and she did cover warranty terms in full. Role knowledge corrected." SC-317,2026-11-19T10:25,C-104,Rosalind Tembo,Tomasz Achebe-Lowe,1,3,3,2,strong_no_hire,"In the role play she blamed the agent and never asked what went wrong. I would not put her in charge of people." SC-318,2026-11-19T11:10,C-105,Mateus Hollingworth,Ines Babatunde,3,3,3,3,hire,"Solid all round. Nothing stood out either way." SC-319,2026-11-19T13:35,C-105,Mateus Hollingworth,Gregor Solheim,3,2,3,3,hire,"Got the ticket right. Reply to the customer was a bit curt." SC-320,2026-11-19T15:20,C-105,Mateus Hollingworth,Priyanka Vandermeer,3,3,5,3,hire,"Knows our product range better than I do." SC-321,2026-11-20T09:15,C-105,Mateus Hollingworth,Tomasz Achebe-Lowe,2,3,3,4,no_hire,"Great with the team side. Froze when the role play went off script."
input/scoring_guide.md · 20 lines, 697 bytes
# Interview scoring guide: Customer Support Team Lead Company: Pellham & Rook Outdoor Supply Scale: whole numbers from 1 to 4 - 1 = clear concern - 2 = below the bar - 3 = meets the bar - 4 = well above the bar Competencies: problem_solving, communication, role_knowledge, teamwork Recommendation words: strong_hire, hire, no_hire, strong_no_hire Disagreement gap: 2 When the highest and the lowest score on one competency are this far apart or more, the panel must talk it through before anyone decides. Each interviewer on the plan sends one scorecard per candidate. People who sit in to observe sometimes send one too. Those are welcome as notes. They are not part of the panel's scores.
output/candidates.csv · written by the agent, 6 lines
candidate_id,candidate,scorecards_expected,scorecards_counted,missing_interviewers,overall_average,hire_votes,no_hire_votes,split_recommendation,disagreements C-101,Anneliese Hartigan,4,4,,3.50,4,0,no,0 C-102,Kwabena Ostrander,4,4,,3.00,3,1,yes,3 C-103,Yusuf Delacroix-Lim,4,3,Tomasz Achebe-Lowe,2.42,0,3,no,0 C-104,Rosalind Tembo,4,4,,3.25,3,1,yes,2 C-105,Mateus Hollingworth,4,4,,2.93,3,1,yes,0
output/competency_scores.csv · written by the agent, 21 lines
candidate_id,competency,scores_counted,average,lowest,lowest_by,highest,highest_by,spread,disagreement C-101,problem_solving,4,3.50,3,Gregor Solheim;Tomasz Achebe-Lowe,4,Ines Babatunde;Priyanka Vandermeer,1,no C-101,communication,4,3.50,3,Ines Babatunde;Gregor Solheim,4,Priyanka Vandermeer;Tomasz Achebe-Lowe,1,no C-101,role_knowledge,4,3.75,3,Priyanka Vandermeer,4,Ines Babatunde;Gregor Solheim;Tomasz Achebe-Lowe,1,no C-101,teamwork,4,3.25,3,Ines Babatunde;Priyanka Vandermeer;Tomasz Achebe-Lowe,4,Gregor Solheim,1,no C-102,problem_solving,4,3.25,2,Gregor Solheim,4,Ines Babatunde;Priyanka Vandermeer,2,yes C-102,communication,4,3.25,2,Ines Babatunde,4,Gregor Solheim;Priyanka Vandermeer,2,yes C-102,role_knowledge,4,2.50,1,Priyanka Vandermeer,3,Ines Babatunde;Gregor Solheim;Tomasz Achebe-Lowe,2,yes C-102,teamwork,3,3.00,3,Ines Babatunde;Gregor Solheim;Priyanka Vandermeer,3,Ines Babatunde;Gregor Solheim;Priyanka Vandermeer,0,no C-103,problem_solving,3,2.33,2,Ines Babatunde;Gregor Solheim,3,Priyanka Vandermeer,1,no C-103,communication,3,2.67,2,Gregor Solheim,3,Ines Babatunde;Priyanka Vandermeer,1,no C-103,role_knowledge,3,2.00,2,Ines Babatunde;Gregor Solheim;Priyanka Vandermeer,2,Ines Babatunde;Gregor Solheim;Priyanka Vandermeer,0,no C-103,teamwork,3,2.67,2,Priyanka Vandermeer,3,Ines Babatunde;Gregor Solheim,1,no C-104,problem_solving,4,2.75,1,Tomasz Achebe-Lowe,4,Priyanka Vandermeer,3,yes C-104,communication,4,3.50,3,Gregor Solheim;Tomasz Achebe-Lowe,4,Ines Babatunde;Priyanka Vandermeer,1,no C-104,role_knowledge,4,3.50,3,Ines Babatunde;Tomasz Achebe-Lowe,4,Priyanka Vandermeer;Gregor Solheim,1,no C-104,teamwork,4,3.25,2,Tomasz Achebe-Lowe,4,Ines Babatunde;Priyanka Vandermeer,2,yes C-105,problem_solving,4,2.75,2,Tomasz Achebe-Lowe,3,Ines Babatunde;Gregor Solheim;Priyanka Vandermeer,1,no C-105,communication,4,2.75,2,Gregor Solheim,3,Ines Babatunde;Priyanka Vandermeer;Tomasz Achebe-Lowe,1,no C-105,role_knowledge,3,3.00,3,Ines Babatunde;Gregor Solheim;Tomasz Achebe-Lowe,3,Ines Babatunde;Gregor Solheim;Tomasz Achebe-Lowe,0,no C-105,teamwork,4,3.25,3,Ines Babatunde;Gregor Solheim;Priyanka Vandermeer,4,Tomasz Achebe-Lowe,1,no
output/hiring_summary.md · written by the agent, 72 lines
# Hiring summary: Customer Support Team Lead
Built only from scorecards that count (interviewer on the plan, latest card per interviewer, whole-number scores 1-4). A disagreement is a spread of 2 or more on a competency. This reports what the panel said and makes no recommendation.
## C-101 Anneliese Hartigan
- Overall average: 3.50 (16 counted scores on 4 of 4 expected scorecards)
- Votes: 4 hire/strong_hire, 0 no_hire/strong_no_hire; split recommendation: no (Ines Babatunde: hire, Gregor Solheim: strong_hire, Priyanka Vandermeer: hire, Tomasz Achebe-Lowe: hire)
- Disagreements: none
- Missing scorecards: none
## C-102 Kwabena Ostrander
- Overall average: 3.00 (15 counted scores on 4 of 4 expected scorecards)
- Votes: 3 hire/strong_hire, 1 no_hire/strong_no_hire; split recommendation: yes (Ines Babatunde: hire, Gregor Solheim: hire, Priyanka Vandermeer: no_hire, Tomasz Achebe-Lowe: hire)
- Disagreements (3):
- **problem_solving**: spread 2 (lowest 2, highest 4)
- Ines Babatunde gave 4 (SC-303): "Sharp thinker. Answers ran long and he lost the thread twice."
- Gregor Solheim gave 2 (SC-306): "Lovely manner with the customer. Got stuck on the double charge ticket and needed two hints."
- Priyanka Vandermeer gave 4 (SC-308): "Bright and clear but has never worked a support queue. Could not name one metric a lead would watch."
- Tomasz Achebe-Lowe gave 3 (SC-310): "Ran out of time before the teamwork part of the role play so I have left it blank."
- **communication**: spread 2 (lowest 2, highest 4)
- Ines Babatunde gave 2 (SC-303): "Sharp thinker. Answers ran long and he lost the thread twice."
- Gregor Solheim gave 4 (SC-306): "Lovely manner with the customer. Got stuck on the double charge ticket and needed two hints."
- Priyanka Vandermeer gave 4 (SC-308): "Bright and clear but has never worked a support queue. Could not name one metric a lead would watch."
- Tomasz Achebe-Lowe gave 3 (SC-310): "Ran out of time before the teamwork part of the role play so I have left it blank."
- **role_knowledge**: spread 2 (lowest 1, highest 3)
- Ines Babatunde gave 3 (SC-303): "Sharp thinker. Answers ran long and he lost the thread twice."
- Gregor Solheim gave 3 (SC-306): "Lovely manner with the customer. Got stuck on the double charge ticket and needed two hints."
- Priyanka Vandermeer gave 1 (SC-308): "Bright and clear but has never worked a support queue. Could not name one metric a lead would watch."
- Tomasz Achebe-Lowe gave 3 (SC-310): "Ran out of time before the teamwork part of the role play so I have left it blank."
- Missing scorecards: none
## C-103 Yusuf Delacroix-Lim
- Overall average: 2.42 (12 counted scores on 3 of 4 expected scorecards)
- Votes: 0 hire/strong_hire, 3 no_hire/strong_no_hire; split recommendation: no (Ines Babatunde: no_hire, Gregor Solheim: no_hire, Priyanka Vandermeer: no_hire)
- Disagreements: none
- Missing scorecards: Tomasz Achebe-Lowe (planned, no scorecard received; not filled in)
## C-104 Rosalind Tembo
- Overall average: 3.25 (16 counted scores on 4 of 4 expected scorecards)
- Votes: 3 hire/strong_hire, 1 no_hire/strong_no_hire; split recommendation: yes (Ines Babatunde: hire, Priyanka Vandermeer: strong_hire, Gregor Solheim: hire, Tomasz Achebe-Lowe: strong_no_hire)
- Disagreements (2):
- **problem_solving**: spread 3 (lowest 1, highest 4)
- Ines Babatunde gave 3 (SC-313): "Calm and clear. Her last team's numbers back up what she says."
- Priyanka Vandermeer gave 4 (SC-315): "Best team interview I have sat in this year."
- Gregor Solheim gave 3 (SC-316): "Sending again. I reread my notes and she did cover warranty terms in full. Role knowledge corrected."
- Tomasz Achebe-Lowe gave 1 (SC-317): "In the role play she blamed the agent and never asked what went wrong. I would not put her in charge of people."
- **teamwork**: spread 2 (lowest 2, highest 4)
- Ines Babatunde gave 4 (SC-313): "Calm and clear. Her last team's numbers back up what she says."
- Priyanka Vandermeer gave 4 (SC-315): "Best team interview I have sat in this year."
- Gregor Solheim gave 3 (SC-316): "Sending again. I reread my notes and she did cover warranty terms in full. Role knowledge corrected."
- Tomasz Achebe-Lowe gave 2 (SC-317): "In the role play she blamed the agent and never asked what went wrong. I would not put her in charge of people."
- Missing scorecards: none
## C-105 Mateus Hollingworth
- Overall average: 2.93 (15 counted scores on 4 of 4 expected scorecards)
- Votes: 3 hire/strong_hire, 1 no_hire/strong_no_hire; split recommendation: yes (Ines Babatunde: hire, Gregor Solheim: hire, Priyanka Vandermeer: hire, Tomasz Achebe-Lowe: no_hire)
- Disagreements: none
- Missing scorecards: none
## Not counted
- SC-305 (whole scorecard): Dmitri Okafor-Reyes is not on the plan for C-101 (observer); notes only, not part of panel scores
- SC-310 (score teamwork): blank; rest of the card and its recommendation still count
- SC-311 (whole scorecard): superseded by later scorecard SC-316 from Gregor Solheim for C-104
- SC-320 (score role_knowledge): value 5 is off the 1-4 scale; rest of the card and its recommendation still count
Note: SC-315 spells the candidate "Rosalyn Tembo". It was matched on candidate_id C-104 and the plan listed Priyanka Vandermeer, so it counts in full.
check.py · the check, written before the run
"""Rebuilds every average, spread and vote count from the scorecards that count and compares."""
import csv, re, sys
from pathlib import Path
root = Path(sys.argv[1]); ok = True
def say(passed, text):
global ok; ok = ok and passed; print(("PASS " if passed else "FAIL ") + text)
def norm(s): return " ".join((s or "").split())
def names(s): return {norm(x).lower() for x in re.split(r"[;|]", s or "") if norm(x)}
def num(s):
try: return float(norm(s))
except ValueError: return None
guide = (root/"input/scoring_guide.md").read_text()
lo, hi = map(int, re.search(r"from (\d+) to (\d+)", guide).groups()); gap = int(re.search(r"Disagreement gap: (\d+)", guide).group(1))
comps = [c.strip() for c in re.search(r"Competencies: (.+)", guide).group(1).split(",")]
plan = list(csv.DictReader((root/"input/interview_plan.csv").open()))
cards = list(csv.DictReader((root/"input/scorecards.csv").open()))
cands = {}
for r in plan: cands.setdefault(r["candidate_id"], {"name": r["candidate"], "panel": []})["panel"].append(r["interviewer"])
latest, dropped = {}, set()
for c in sorted(cards, key=lambda r: (r["submitted_at"], r["scorecard_id"])):
key = (c["candidate_id"], c["interviewer"])
if c["candidate_id"] not in cands or c["interviewer"] not in cands[c["candidate_id"]]["panel"]:
dropped.add(c["scorecard_id"]); continue
if key in latest: dropped.add(latest[key]["scorecard_id"])
latest[key] = c
want_c, want_k = {}, {}
for cid, info in cands.items():
mine = [c for (k, _), c in latest.items() if k == cid]; allscores = []
for comp in comps:
got_scores = []
for c in mine:
v = c[comp].strip()
if re.fullmatch(r"\d+", v) and lo <= int(v) <= hi: got_scores.append((int(v), c["interviewer"]))
else: dropped.add(c["scorecard_id"])
vals = [s for s, _ in got_scores]; allscores += vals
want_c[(cid, comp)] = {"n": len(vals), "avg": sum(vals) / len(vals), "lo": min(vals), "hi": max(vals),
"lo_by": {n.lower() for s, n in got_scores if s == min(vals)}, "hi_by": {n.lower() for s, n in got_scores if s == max(vals)},
"dis": "yes" if max(vals) - min(vals) >= gap else "no"}
hire = sum(1 for c in mine if c["recommendation"] in ("hire", "strong_hire")); no = sum(1 for c in mine if c["recommendation"] in ("no_hire", "strong_no_hire"))
want_k[cid] = {"expected": len(info["panel"]), "counted": len(mine), "missing": {p.lower() for p in info["panel"] if (cid, p) not in latest},
"avg": sum(allscores) / len(allscores), "hire": hire, "no": no, "split": "yes" if hire and no else "no",
"dis": sum(1 for comp in comps if want_c[(cid, comp)]["dis"] == "yes")}
path = root/"output/competency_scores.csv"
if not path.exists():
say(False, "output/competency_scores.csv was not written"); sys.exit(1)
rows = list(csv.DictReader(path.open())); got = {}
for r in rows: got.setdefault((norm(r.get("candidate_id")), norm(r.get("competency"))), []).append(r)
one = {k: got[k][0] for k in want_c if len(got.get(k, [])) == 1}
say(len(one) == len(want_c) and len(rows) == len(want_c), f"{len(one)} of {len(want_c)} candidate and competency rows appear once in competency_scores.csv")
def close(a, b): return a is not None and abs(a - b) <= 0.0051
avg = sum(1 for k, w in want_c.items() if k in one and num(one[k].get("scores_counted")) == w["n"] and close(num(one[k].get("average")), w["avg"]))
say(avg == len(want_c), f"{avg} of {len(want_c)} averages equal the average rebuilt from the scorecards that count")
flagged = [k for k, w in want_c.items() if w["dis"] == "yes"]
sp = sum(1 for k, w in want_c.items() if k in one and num(one[k].get("spread")) == w["hi"] - w["lo"] and norm(one[k].get("disagreement")).lower() == w["dis"])
say(sp == len(want_c), f"{sp} of {len(want_c)} spreads and disagreement marks are right, with {len(flagged)} disagreements to find")
who = sum(1 for k in flagged if k in one and names(one[k].get("lowest_by")) == want_c[k]["lo_by"] and names(one[k].get("highest_by")) == want_c[k]["hi_by"])
ends = sum(1 for k, w in want_c.items() if k in one and num(one[k].get("lowest")) == w["lo"] and num(one[k].get("highest")) == w["hi"]
and names(one[k].get("lowest_by")) == w["lo_by"] and names(one[k].get("highest_by")) == w["hi_by"])
say(who == len(flagged) and ends == len(want_c), f"{who} of {len(flagged)} disagreements name the right lowest and highest scorers and {ends} of {len(want_c)} rows carry the right lowest and highest scores with who gave them")
kpath = root/"output/candidates.csv"
krows = {norm(r.get("candidate_id")): r for r in csv.DictReader(kpath.open())} if kpath.exists() else {}
tot = sum(1 for cid, w in want_k.items() if cid in krows and norm(krows[cid].get("candidate")) == norm(cands[cid]["name"]) and close(num(krows[cid].get("overall_average")), w["avg"]) and num(krows[cid].get("hire_votes")) == w["hire"]
and num(krows[cid].get("no_hire_votes")) == w["no"] and norm(krows[cid].get("split_recommendation")).lower() == w["split"] and num(krows[cid].get("disagreements")) == w["dis"])
say(tot == len(want_k) and len(krows) == len(want_k), f"{tot} of {len(want_k)} candidates have the name on the plan and the right overall average, votes and disagreement count")
cnt = sum(1 for cid, w in want_k.items() if cid in krows and num(krows[cid].get("scorecards_expected")) == w["expected"] and num(krows[cid].get("scorecards_counted")) == w["counted"]
and names(krows[cid].get("missing_interviewers")) == w["missing"])
say(cnt == len(want_k), f"{cnt} of {len(want_k)} candidates show the right number of scorecards counted and name any missing interviewer")
summary = (root/"output/hiring_summary.md").read_text() if (root/"output/hiring_summary.md").exists() else ""
tail = summary[summary.lower().rfind("not counted"):] if "not counted" in summary.lower() else ""
listed = sum(1 for s in dropped if s in tail)
say(listed == len(dropped) and len(dropped) > 0, f"{listed} of {len(dropped)} left out scorecards and scores are listed under Not counted in hiring_summary.md")
# every figure and quoted comment in the summary, traced to the scorecards or the rebuilt tables
by_card = {c["scorecard_id"]: c for c in cards}
def ints(text): return [int(x) for x in re.findall(r"(?<![A-Za-z0-9.-])\d+(?![\d.]*\d|[A-Za-z])", text)]
def decs(text): return [float(x) for x in re.findall(r"(?<![A-Za-z0-9.-])\d+\.\d+", text)]
def valid(card, comp):
v = (card.get(comp) or "").strip(); return {int(v)} if re.fullmatch(r"\d+", v) and lo <= int(v) <= hi else set()
guide_nums = set(ints(guide)) | {len(cands), len(comps), len(cards), len(dropped), len(latest)}
fa = fo = qa = qo = 0; cur_c = cur_k = None
for ln in summary.split("\n"):
if ln.startswith("#"):
hit = [cid for cid in cands if re.search(r"\b" + cid + r"\b", ln)]; cur_c = hit[0] if hit else None; cur_k = None
named = [k for k in comps if re.search(r"\b" + k + r"\b", ln)]
if named: cur_k = named[0]
ids = [s for s in by_card if re.search(r"\b" + s + r"\b", ln)]
for q in re.findall(r"\"([^\"]{12,})\"", ln):
qa += 1; qo += any(norm(q) in norm(by_card[s]["comment"]) or norm(q) == norm(by_card[s]["candidate_name"]) for s in ids)
allowed, means = set(guide_nums), []
for s in ids: allowed |= set(ints(by_card[s]["comment"]))
if cur_c is None:
for s in ids: allowed |= set(ints(" ".join(by_card[s][k] for k in comps)))
elif ids and cur_k and not named:
allowed = set().union(*(valid(by_card[s], cur_k) for s in ids)) | set().union(*(set(ints(by_card[s]["comment"])) for s in ids))
elif named or ids:
for k in named or [cur_k]:
if k: w = want_c[(cur_c, k)]; allowed = {w["n"], w["lo"], w["hi"], w["hi"] - w["lo"]}; means.append(w["avg"])
for s in ids: allowed |= valid(by_card[s], cur_k) if cur_k else set()
else:
w = want_k[cur_c]; means.append(w["avg"])
allowed = {w["expected"], w["counted"], w["hire"], w["no"], w["dis"], len(w["missing"]), sum(want_c[(cur_c, k)]["n"] for k in comps), w["hire"] + w["no"]}
for x in ints(ln): fa += 1; fo += x in allowed
for x in decs(ln): fa += 1; fo += any(close(x, m) for m in means)
say(fo == fa and fa > 0, f"{fo} of {fa} figures in hiring_summary.md equal the scorecard score or the rebuilt figure they restate")
say(qo == qa and qa > 0, f"{qo} of {qa} quoted passages in hiring_summary.md are word for word from a scorecard named on the same line")
sys.exit(0 if ok else 1)
interview_plan.csv: sample data written by Atris. Fingerprint 4155e0e80659.
scorecards.csv: sample data written by Atris. Fingerprint ea062d1126d1.
scoring_guide.md: sample data written by Atris. Fingerprint 1a03d77fe8cc.
candidates.csv: written by the agent. Fingerprint f9ac54fd8300.
competency_scores.csv: written by the agent. Fingerprint e7a0a9291cdf.
hiring_summary.md: written by the agent. Fingerprint a298690ad23c.