Combine expert interviews into findings.
Done by an agent. Checked twice.
Findings from six expert interviews that show who said what, where they split and what to confirm.
Real files in
- brief.md
The research brief for an invented client: the site's size and the five questions the interviews must answer.. 15 lines, 670 bytes. - interview_01.md
Notes from an interview with an invented expert (Marisol Etxeberria): 12 numbered note lines.. 19 lines, 1 KB. - interview_02.md
Notes from an interview with an invented expert (Dev Ramasubban): 11 numbered note lines.. 18 lines, 1 KB. - interview_03.md
Notes from an interview with an invented expert (Imke Vasquez-Tran): 10 numbered note lines.. 17 lines, 1 KB. - interview_04.md
Notes from an interview with an invented expert (Halvard Nygaard-Osei): 11 numbered note lines.. 18 lines, 1 KB. - interview_05.md
Notes from an interview with an invented expert (Priyanka Dlamini-Koh): 10 numbered note lines.. 17 lines, 984 bytes. - interview_06.md
Notes from an interview with an invented expert (Caspian Wroblewski): 10 numbered note lines.. 17 lines, 1004 bytes. - interview_07.md
Notes from an interview with an invented expert (Imke Vazquez Tran): 10 numbered note lines.. 17 lines, 1010 bytes.
Sample data written by Atris. Not a real company.
Three steps
- 1.Work out who was interviewed
- 2.Record who said what
- 3.Write the findings
Claude Sonnet 5.5, 1 min 27 s. No web. It never saw the check.
Checked twice
- Passed: 20 of 20 quotes sit word for word on the note line they cite, in the named expert's own interview
- Passed: 6 of 6 experts have views on record and are named in the findings and the second spelling of a name is used for an expert 0 times
- Passed: 18 of 18 views the notes hold are in positions.csv under the right question and expert
- Passed: the expert who corrected himself is on record with the corrected figure and 0 second-hand remarks are passed off as a view
- Passed: 5 of 5 questions are typed correctly, 4 as a split with the experts on the right sides and 1 as agreed
- Passed: To confirm lists 2 of 2 planted problems: a count that does not add up and a second-hand claim
- Passed: 37 of 37 note lines cited in findings.md exist and the findings run 361 words against a limit of 400
- Passed: 20 of 20 numbers in findings.md and findings.csv are found on a note line cited beside them or in the named experts' own notes
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 8 ways on purpose. The check caught 8.
## Where they disagree - **Payback (Q1).** Etxeberria: about 18 months [01-03], assuming robots do the walking and pickers stay in zones [01-04]. Ramasubban: 26 months at his first site, vendor said 14 [02-02]. Nygaard-Osei corrected himself to about 3.5 years at this volume [04-07], over his earlier "under two years" [04-02]. A third shift or about 14,000 lines a day would bring it under two years [04-08]. Wroblewski has no figure yet [06-07]. Vasquez-Tran [03-07] and Dlamini-Koh [05-08] declined. - **Lease or buy (Q2).** Lease: Ramasubban [02-04] and Wroblewski [06-02], if hardware dates quickly and the return terms are fair [02-06]. Buy: Dlamini-Koh [05-02], because lease quotes assumed handing back half the fleet with penalties. Etxeberria says either works [01-05]. - **Staffing (Q3).** No cuts: Vasquez-Tran, through 40% yearly picker turnover [03-02], and Dlamini-Koh, by moving pickers to returns and replenishment [05-05]. Wroblewski: savings came only from closing the night shift, 19 redundancies [06-03, 06-04]. No cuts needs turnover or other work to absorb people. The notes don't give Brackenmoor's turnover. - **How to start (Q4).** Pilot one zone: Etxeberria [01-08], Ramasubban [02-07], Vasquez-Tran [03-06], Dlamini-Koh [05-07], Wroblewski [06-06]. Nygaard-Osei would not pilot. He would simulate on a year of order data [04-04], saying vendor engineers flatter pilots [04-05]. Wroblewski's fix is keeping vendor engineers out for the last month [06-06]. ## To confirm - **[05-04]** 34 robots, but 20 + 12 = 32. Ask Dlamini-Koh for the real fleet size. - **[02-03]** Ramasubban says Etxeberria told him her clients see 12 months. This is second-hand and unverified, and her own figure is 18 months [01-03]. Ask Etxeberria what she said and what her four sites show. - **[06-07]** No payback after 18 months live [06-01]. Ask Wroblewski for his expected figure. - Brackenmoor's picker turnover isn't in the notes. Ask the client.
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 2 of 2 on 1 December 2026. The agent took 1 min 27 s. Run 1 did not pass the check. Each run starts clean. Between runs the written flow was made clearer, or a check was corrected or made stricter. Nobody edits the output.
What the second review verified
- Files 03 and 07 record the same call (2026-10-06, same role, Vasquez-Tran vs Vazquez Tran). The output counts this as one expert and uses the file 03 spelling 'Imke Vasquez-Tran' throughout, which gives six experts.
- Nygaard-Osei's Q1 row cites his correction in 04-07 ('nearer three and a half years, not two') and not 04-02. Q1 is a 2-vs-1 split (Ramasubban 26 months and Nygaard-Osei 3.5 years against Etxeberria 18 months). Wroblewski, Vasquez-Tran and Dlamini-Koh gave no payback figure and correctly have no Q1 row.
- Line 05-04 says 34 robots, but 20 + 12 = 32. This is flagged under To confirm. Ramasubban's second-hand claim in 02-03 about Etxeberria's 12 months is flagged too and is not used as her view. Her own row cites 18 months from 01-03.
- All 20 quotes in positions.csv appear word for word on the cited line in the expert's own file. Etxeberria's 'Either works' (01-05) is kept off both Q2 sides. Experts with no view get no row (02-08, 02-09, 03-07, 03-08, 04-09, 04-10, 05-08). findings.md is 361 words and has the three required headings.
What this run does not show
- The check holds a list of who said what, marked by hand, with each view proven by words in the note line it cites.
- One view was made optional in the check after the first run left it out, because its note line can fairly be read either way.
- The interview notes were written for this run so that most views are clear, which real notes are not.
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 8 of 8. 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 expert interviews into findings function: research for: the research lead who has to tell a client what the experts really said goal: Each question in the brief has an answer that shows who said what, where the experts agree and where they split, with every view traced to a line of the notes. ## 1. Work out who was interviewed Read input/brief.md for the client's questions, then every interview file. Each numbered line such as `03-04 | text` is one note line. The header of each file names the expert. Two files that record the same call (same date, same role, a name that differs only in spelling) are one expert, counted once. Use the name as spelled in the lower numbered file everywhere. You may cite lines from either file. ## 2. Record who said what Write output/positions.csv with columns question,expert,stance,line,quote. One row for each expert on each brief question they gave a view on. question is the id from the brief. - stance is the expert's view in a few plain words. quote is copied word for word from the one note line named in line. That line must come from the expert's own interview. - Only first-hand views count. When one expert reports what another person thinks, that is not the other person's view and gets no row. - When an expert corrects themselves later in the call, the correction is their view. Cite it. - An expert who declines to answer or says they have no view on a question gets no row for it. ## 3. Write the findings Write output/findings.csv with columns question,type,side_a,side_a_experts,side_b,side_b_experts, one row per brief question. type is `agree` when every expert with a row for that question takes the same side and `split` when they do not. side_a is the side with more experts. Name the experts in full, joined with semicolons. Leave side_b and side_b_experts empty for `agree`. An expert who says either side works goes on neither list. Write output/findings.md, under 400 words, with three headings: `## What they agree on`, `## Where they disagree` and `## To confirm`. Name the experts and cite the note lines in square brackets like [03-04]. For a split, say what each side would need to be true, if the notes say. Under To confirm, list with its line number every note line whose own numbers do not add up and every second-hand claim about what someone else thinks. Say what to ask. ## Done looks like - Every quote sits on the note line it cites, in that expert's own interview. - Each expert is counted once, under one spelling of their name. - No split is smoothed over and no second-hand remark is passed off as an expert's view.
input/brief.md · 15 lines, 670 bytes
# Research brief: mobile robots for the Brackenmoor Supply warehouse Client question: should Brackenmoor Supply put autonomous mobile robots into its main warehouse? The site handles about 9,000 order lines a day over two shifts with 46 pickers. We interviewed outside experts between October 5 and October 12, 2026. The notes are in this folder, one file per write-up. Every note line has a number such as 03-04. Questions the client wants answered from the interviews: Q1 | How long until the robots pay for themselves at our volume? Q2 | Should we lease the robots or buy them? Q3 | What happens to staffing? Q4 | How should we start? Q5 | Why do rollouts stall?
input/interview_01.md · 19 lines, 1 KB
# Interview notes Expert: Marisol Etxeberria Role: Independent warehouse automation consultant, formerly with a robot integrator Date: 2026-10-05 Notes by: R. Albrecht 01-01 | Intro. She has scoped or rescued about 30 mobile robot rollouts, most at sites between 5,000 and 15,000 order lines a day. 01-02 | She asked for our volume. We said about 9,000 order lines a day over two shifts. 01-03 | "At that volume on two shifts, payback lands around 18 months. I have seen it on four sites your size." 01-04 | The 18 months assumes the robots do the walking and people stay in their zones. If pickers still walk, the saving goes. 01-05 | Lease or buy: "Either works. I would not let that question hold the project up." 01-06 | "Most rollouts I get called in to rescue stalled on wireless coverage, not on the robots." 01-07 | She would run a pilot first: one zone, eight to twelve weeks, real orders. 01-08 | "Never sign for the full fleet before a pilot. The pilot is where you find out what your building is really like." 01-09 | Floors: joints wider than about 10 mm need filling or the robots slow down and wear out their wheels. 01-10 | She does not take commission from vendors. Offered to share a pilot scorecard template. 01-11 | Side note: she is speaking at a trade show in March and may not be reachable that week. 01-12 | Follow up: send her our building drawings.
input/interview_02.md · 18 lines, 1 KB
# Interview notes Expert: Dev Ramasubban Role: Finance director, third-party logistics firm with three automated sites Date: 2026-10-07 Notes by: K. Ndiaye 02-01 | Intro. He signs off the business cases for automation at his firm. Three sites done so far. 02-02 | "Our first site paid back in 26 months. The vendor's deck said 14." 02-03 | "Marisol Etxeberria told me at a conference that her clients see payback in 12 months. I have not seen her numbers." 02-04 | "Lease. The hardware is out of date in four years and a lease lets you hand it back." 02-05 | A lease also kept it off the capital budget, which made approval faster for him. 02-06 | Watch the minimum term and the return conditions. He has seen damage charges argued over for months. 02-07 | On starting: "Pilot one zone first. We skipped that on site one and paid for it." 02-08 | He had no view on staffing. "Not my area, ask an operator." 02-09 | He did not want to say why rollouts stall. "The ones I see are late. I do not know why." 02-10 | He will send a blank copy of his business case model. 02-11 | Call started ten minutes late because of a clash in his diary.
input/interview_03.md · 17 lines, 1 KB
# Interview notes Expert: Imke Vasquez-Tran Role: Operations director, cold storage distributor Date: 2026-10-06 Notes by: R. Albrecht 03-01 | Intro. She runs two cold storage sites. Robots went into the larger one two years ago. 03-02 | Staffing: "We cut nobody. Picker turnover was 40 percent a year, so attrition did the work in nine months." 03-03 | She told staff on day one that nobody would lose a job to the robots. She says that is why the rollout was calm. 03-04 | "Dead spots in the wireless coverage in the freezer aisles stopped our robots every day for the first month." 03-05 | The fix was more access points and a second wireless survey done with the freezer doors shut. 03-06 | Starting: "Pilot in one zone. Ours was the chilled pick zone for ten weeks." 03-07 | She would not give a payback figure. "Finance owns that number and I do not trust my memory of it." 03-08 | No view on lease or buy. The group treasury decided. 03-09 | Batteries lose range in the cold. Plan for more charging points than the vendor draws. 03-10 | Happy to host a site visit in November.
input/interview_04.md · 18 lines, 1 KB
# Interview notes Expert: Halvard Nygaard-Osei Role: Industrial engineering researcher who studies mid-size warehouses Date: 2026-10-08 Notes by: K. Ndiaye 04-01 | Intro. He has modelled about 60 mid-size sites for a research programme. Not paid by any vendor. 04-02 | "Vendors quote payback under two years and for a site like yours that is roughly right." 04-03 | He asked for our numbers. We gave 9,000 order lines a day, two shifts, 46 pickers. 04-04 | Starting: "I would not pilot. A one-zone pilot tells you about one zone. Simulate with a year of your own order data, then commit or walk away." 04-05 | He says pilots flatter the result because the vendor's best engineers camp on site while the pilot runs. 04-06 | Two shifts matters. The robots sit idle a third of the day, which stretches payback. 04-07 | "Correction to what I said earlier. I ran your volume while we talked. At 9,000 lines on two shifts it is nearer three and a half years, not two. Use that figure." 04-08 | A third shift, or volume above roughly 14,000 lines a day, would bring it back under two years. 04-09 | No view on lease or buy. 04-10 | He did not speak to staffing or to why rollouts stall. "I model. I do not run sites." 04-11 | He can run the simulation for us if we share twelve months of order lines.
input/interview_05.md · 17 lines, 984 bytes
# Interview notes Expert: Priyanka Dlamini-Koh Role: Vice president of supply chain, regional retailer Date: 2026-10-09 Notes by: R. Albrecht 05-01 | Intro. Her company put robots into its main distribution centre three years ago. 05-02 | "Buy. We bought ours outright. The lease quotes assumed we would hand back half the fleet and the penalties were ugly." 05-03 | Owning also let them move robots between buildings without asking anyone. 05-04 | Fleet today: "We run 34 robots, 20 in ambient and 12 in chilled." 05-05 | Staffing: "Nobody was let go. We moved pickers into returns and replenishment." 05-06 | "We spent more fixing the wireless network than we had budgeted for the whole install." 05-07 | Starting: they ran a twelve week pilot in one zone and she would do it again. 05-08 | She would not share payback. Commercially sensitive. 05-09 | Peak season: do not go live between October and January. 05-10 | She asked that we not name her company in anything we publish.
input/interview_06.md · 17 lines, 1004 bytes
# Interview notes Expert: Caspian Wroblewski Role: Site general manager, parts distributor Date: 2026-10-12 Notes by: K. Ndiaye 06-01 | Intro. He runs one site, about 11,000 order lines a day. Robots have been live for 18 months. 06-02 | "We lease. I would not want to own them when the next model comes out." 06-03 | Staffing: "The numbers only worked when we closed the night shift. Without taking out a shift there is no saving." 06-04 | Closing the shift meant 19 redundancies. He says it was the hardest part of the project. 06-05 | "Survey the wireless network before you sign anything. Ours stalled for six weeks on coverage." 06-06 | Starting: "Pilot first, one zone, and keep the vendor's engineers out of it for the last month so you see the real thing." 06-07 | Payback: "Not there yet. Ask me in a year." 06-08 | Floors: they resurfaced two aisles, which was not in the budget. 06-09 | He rates his vendor's training as poor and wrote his own. 06-10 | Can talk again after his quarter end.
input/interview_07.md · 17 lines, 1010 bytes
# Interview notes Expert: Imke Vazquez Tran Role: Operations director, cold storage distributor Date: 2026-10-06 Notes by: J. Oyelaran-Smith 07-01 | I joined the call with R. Albrecht. These are my own notes from the same conversation. 07-02 | No layoffs. Turnover among pickers ran about 40 percent a year and headcount came down through attrition within nine months. 07-03 | Staff were told at the start that no one would lose a job to the robots. 07-04 | First month: robots stopped daily in the freezer aisles because of wireless dead spots. 07-05 | Fixed with extra access points after a second survey done with the freezer doors closed. 07-06 | Recommends a pilot in a single zone. Theirs ran ten weeks in chilled picking. 07-07 | Declined to give payback. Says finance owns it. 07-08 | "The vendor's support desk took two days to answer us in the first quarter. Put response times in the contract." 07-09 | Cold shortens battery range, so add charging points. 07-10 | Site visit offered for November.
output/findings.csv · written by the agent, 6 lines
question,type,side_a,side_a_experts,side_b,side_b_experts Q1,split,"Two years or longer: 26 months at first site, about 3.5 years",Dev Ramasubban;Halvard Nygaard-Osei,About 18 months (under two years),Marisol Etxeberria Q2,split,Lease,Dev Ramasubban;Caspian Wroblewski,Buy,Priyanka Dlamini-Koh Q3,split,No job cuts,Imke Vasquez-Tran;Priyanka Dlamini-Koh,"Cut jobs (closed a shift, 19 redundancies)",Caspian Wroblewski Q4,split,Pilot one zone first,Marisol Etxeberria;Dev Ramasubban;Imke Vasquez-Tran;Priyanka Dlamini-Koh;Caspian Wroblewski,No pilot; simulate with a year of order data,Halvard Nygaard-Osei Q5,agree,Wireless coverage,Marisol Etxeberria;Imke Vasquez-Tran;Priyanka Dlamini-Koh;Caspian Wroblewski,,
output/findings.md · written by the agent, 21 lines
# Findings: mobile robots for Brackenmoor Supply Six experts. Imke Vasquez-Tran appears in files 03 and 07 (same call) and is counted once. ## What they agree on - **Why rollouts stall (Q5): wireless coverage.** Marisol Etxeberria [01-06], Imke Vasquez-Tran [03-04], Priyanka Dlamini-Koh [05-06], Caspian Wroblewski [06-05]. Dev Ramasubban [02-09] and Halvard Nygaard-Osei [04-10] gave no view. ## Where they disagree - **Payback (Q1).** Etxeberria: about 18 months [01-03], assuming robots do the walking and pickers stay in zones [01-04]. Ramasubban: 26 months at his first site, vendor said 14 [02-02]. Nygaard-Osei corrected himself to about 3.5 years at this volume [04-07], over his earlier "under two years" [04-02]. A third shift or about 14,000 lines a day would bring it under two years [04-08]. Wroblewski has no figure yet [06-07]. Vasquez-Tran [03-07] and Dlamini-Koh [05-08] declined. - **Lease or buy (Q2).** Lease: Ramasubban [02-04] and Wroblewski [06-02], if hardware dates quickly and the return terms are fair [02-06]. Buy: Dlamini-Koh [05-02], because lease quotes assumed handing back half the fleet with penalties. Etxeberria says either works [01-05]. - **Staffing (Q3).** No cuts: Vasquez-Tran, through 40% yearly picker turnover [03-02], and Dlamini-Koh, by moving pickers to returns and replenishment [05-05]. Wroblewski: savings came only from closing the night shift, 19 redundancies [06-03, 06-04]. No cuts needs turnover or other work to absorb people. The notes don't give Brackenmoor's turnover. - **How to start (Q4).** Pilot one zone: Etxeberria [01-08], Ramasubban [02-07], Vasquez-Tran [03-06], Dlamini-Koh [05-07], Wroblewski [06-06]. Nygaard-Osei would not pilot. He would simulate on a year of order data [04-04], saying vendor engineers flatter pilots [04-05]. Wroblewski's fix is keeping vendor engineers out for the last month [06-06]. ## To confirm - **[05-04]** 34 robots, but 20 + 12 = 32. Ask Dlamini-Koh for the real fleet size. - **[02-03]** Ramasubban says Etxeberria told him her clients see 12 months. This is second-hand and unverified, and her own figure is 18 months [01-03]. Ask Etxeberria what she said and what her four sites show. - **[06-07]** No payback after 18 months live [06-01]. Ask Wroblewski for his expected figure. - Brackenmoor's picker turnover isn't in the notes. Ask the client.
output/positions.csv · written by the agent, 21 lines
question,expert,stance,line,quote Q1,Marisol Etxeberria,about 18 months,01-03,"At that volume on two shifts, payback lands around 18 months." Q1,Dev Ramasubban,26 months at his first site; vendor said 14,02-02,Our first site paid back in 26 months. The vendor's deck said 14. Q1,Halvard Nygaard-Osei,about 3.5 years (corrected from under two),04-07,"At 9,000 lines on two shifts it is nearer three and a half years, not two." Q2,Marisol Etxeberria,either works,01-05,Either works. Q2,Dev Ramasubban,lease,02-04,Lease. The hardware is out of date in four years and a lease lets you hand it back. Q2,Priyanka Dlamini-Koh,buy,05-02,Buy. We bought ours outright. Q2,Caspian Wroblewski,lease,06-02,We lease. I would not want to own them when the next model comes out. Q3,Imke Vasquez-Tran,no job cuts; attrition,03-02,We cut nobody. Q3,Priyanka Dlamini-Koh,no job cuts; moved pickers to other work,05-05,Nobody was let go. We moved pickers into returns and replenishment. Q3,Caspian Wroblewski,savings needed a shift closed (19 redundancies),06-03,Without taking out a shift there is no saving. Q4,Marisol Etxeberria,pilot first,01-08,Never sign for the full fleet before a pilot. Q4,Dev Ramasubban,pilot one zone,02-07,Pilot one zone first. Q4,Imke Vasquez-Tran,pilot one zone,03-06,Pilot in one zone. Q4,Halvard Nygaard-Osei,no pilot; simulate with a year of order data,04-04,I would not pilot. Q4,Priyanka Dlamini-Koh,"pilot one zone, twelve weeks",05-07,they ran a twelve week pilot in one zone and she would do it again Q4,Caspian Wroblewski,pilot one zone,06-06,"Pilot first, one zone" Q5,Marisol Etxeberria,wireless coverage,01-06,"Most rollouts I get called in to rescue stalled on wireless coverage, not on the robots." Q5,Imke Vasquez-Tran,wireless dead spots,03-04,Dead spots in the wireless coverage in the freezer aisles stopped our robots every day for the first month. Q5,Priyanka Dlamini-Koh,wireless fixing cost more than budgeted,05-06,We spent more fixing the wireless network than we had budgeted for the whole install. Q5,Caspian Wroblewski,wireless coverage,06-05,Ours stalled for six weeks on coverage.
check.py · the check, written before the run
"""Verifies who said what against the interview notes, then compares the splits with a key proven from the notes."""
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):
for a, b in (("“", '"'), ("”", '"'), ("‘", "'"), ("’", "'"), ("–", "-"), ("—", "-"), (" ", " ")):
s = s.replace(a, b)
return re.sub(r"\s+", " ", s).strip().strip('"').strip().lower()
letters = lambda s: re.sub(r"[^a-z]", "", norm(s).replace("z", "s")) # one person, however the name is typed
lines, owner, heads = {}, {}, {}
for f in sorted((root/"input").glob("interview_*.md")):
t = f.read_text(); name = re.search(r"^Expert: (.+)$", t, re.M).group(1).strip()
date = re.search(r"^Date: (.+)$", t, re.M).group(1).strip(); num = re.search(r"(\d+)", f.name).group(1)
heads[num] = (name, date)
for i, text in re.findall(r"^(\d\d-\d\d) \| (.+)$", t, re.M): lines[i] = norm(text); owner[i] = num
person = {} # file number -> the lower numbered file that records the same person on the same date
for n, (name, date) in heads.items():
person[n] = min(m for m, (nm, d) in heads.items() if d == date and letters(nm) == letters(name))
experts = {n: heads[n][0] for n in sorted(set(person.values()))}
second = [w for n in heads if person[n] != n for w in re.findall(r"[a-z]+", norm(heads[n][0])) if w not in norm(heads[person[n]][0])]
who = lambda cell: {n for n, nm in experts.items() if letters(nm) in letters(cell)}
def read(name):
p = root/"output"/name
return [{k: (v or "").strip() for k, v in r.items() if k} for r in csv.DictReader(p.open(newline=""))] if p.exists() else []
pos, fnd = read("positions.csv"), read("findings.csv")
md = (root/"output/findings.md").read_text() if (root/"output/findings.md").exists() else ""
if not (pos and fnd and md):
say(False, "positions.csv, findings.csv and findings.md must all be written"); sys.exit(1)
lid = lambda r: (re.search(r"\d\d-\d\d", r.get("line", "")) or [""])[0]
qid = lambda r: (re.search(r"Q\d", r.get("question", "").upper()) or [""])[0]
good = sum(1 for r in pos if len(norm(r.get("quote", ""))) >= 8 and norm(r["quote"]).rstrip(".") in lines.get(lid(r), "") and who(r.get("expert", "")) == {person.get(owner.get(lid(r)))})
say(good == len(pos), f"{good} of {len(pos)} quotes sit word for word on the note line they cite, in the named expert's own interview")
everything = " ".join(norm(r.get(k, "")) for r in pos + fnd for k in ("expert", "side_a_experts", "side_b_experts"))
named = sum(1 for n, nm in experts.items() if any(who(r.get("expert", "")) == {n} for r in pos) and norm(nm).split()[-1] in norm(md))
stray = sum(len(re.findall(r"\b" + w + r"\b", everything)) for w in second)
say(named == len(experts) and stray == 0, f"{named} of {len(experts)} experts have views on record and are named in the findings and the second spelling of a name is used for an expert {stray} times")
# the key: each view below is first proven from the words of the notes, then looked for in the output
KEY = {"Q1": {"a": {"01": ("01-03", "18 months")}, "b": {"04": ("04-07", "three and a half years")}, "also": {"02": ("02-02", "26 months")}},
"Q2": {"a": {"02": ("02-04", "lease"), "06": ("06-02", "we lease")}, "b": {"05": ("05-02", "buy")}, "also": {}},
"Q3": {"a": {"03": ("03-02", "we cut nobody"), "05": ("05-05", "nobody was let go")}, "b": {"06": ("06-03", "closed the night shift")}, "also": {}},
"Q4": {"a": {"01": ("01-07", "pilot first"), "02": ("02-07", "pilot one zone first"), "03": ("03-06", "pilot in one zone"), "05": ("05-07", "pilot in one zone"), "06": ("06-06", "pilot first")}, "b": {"04": ("04-04", "i would not pilot")}, "also": {}},
"Q5": {"a": {"01": ("01-06", "wireless coverage"), "03": ("03-04", "wireless coverage"), "06": ("06-05", "wireless network")}, "b": {}, "also": {}}} # 05-06 is about cost, not a stalled rollout, so it is not required
proven = all(words in lines.get(l, "") for q in KEY.values() for side in q.values() for l, words in side.values())
views = [(q, n) for q, sides in KEY.items() for side in sides.values() for n in side]
have = sum(1 for q, n in views if any(qid(r) == q and who(r.get("expert", "")) == {n} for r in pos))
say(proven and have == len(views), f"{have} of {len(views)} views the notes hold are in positions.csv under the right question and expert")
fixed = any(qid(r) == "Q1" and lid(r) == "04-07" for r in pos) and not any(qid(r) == "Q1" and lid(r) == "04-02" for r in pos)
hearsay = [l for l, t in lines.items() if "told me" in t and any(letters(nm) in letters(t) for nm in experts.values())]
passed_off = sum(1 for r in pos if lid(r) in hearsay)
say(fixed and passed_off == 0 and len(hearsay) == 1, f"the expert who corrected himself is on record with the corrected figure{'' if fixed else ' (not so)'} and {passed_off} second-hand remarks are passed off as a view")
right = 0
for q, sides in KEY.items():
row = next((r for r in fnd if qid(r) == q), {})
a, b = who(row.get("side_a_experts", "")), who(row.get("side_b_experts", "")); ka, kb = set(sides["a"]), set(sides["b"])
if kb: right += row.get("type", "").lower() == "split" and ((ka <= a and kb <= b) or (ka <= b and kb <= a)) and not (a & b)
else: right += row.get("type", "").lower() == "agree" and ka <= a and not b
splits = sum(1 for s in KEY.values() if s["b"])
say(right == len(KEY) and len(fnd) == len(KEY), f"{right} of {len(KEY)} questions are typed correctly, {splits} as a split with the experts on the right sides and {len(KEY) - splits} as agreed")
confirm = norm(md.split("## To confirm")[-1]) if "## To confirm" in md else ""
odd = [l for l, t in lines.items() for m in [re.search(r"(\d+) robots, (\d+) in \w+ and (\d+) in", t)] if m and int(m.group(1)) != int(m.group(2)) + int(m.group(3))]
flagged = sum(1 for l in set(odd + hearsay) if l in confirm)
say(len(odd) == 1 and flagged == len(set(odd + hearsay)), f"To confirm lists {flagged} of {len(set(odd + hearsay))} planted problems: a count that does not add up and a second-hand claim")
cites = re.findall(r"\b\d\d-\d\d\b", md); real = sum(1 for c in cites if c in lines); n_words = len(re.findall(r"\S+", md))
say(real == len(cites) and len(cites) >= 10 and n_words <= 400, f"{real} of {len(cites)} note lines cited in findings.md exist and the findings run {n_words} words against a limit of 400")
# every number in the findings is looked up on the note lines cited beside it, digits or spelled out
WORDS = "one two three four five six seven eight nine ten eleven twelve".split()
def figures(t):
out = {x.replace(",", "") for x in re.findall(r"(?<![\w.-])\d[\d,]*(?:\.\d+)?(?![\w-])", t)}
for w, half in re.findall(r"\b(%s)\b( and a half)?" % "|".join(WORDS), t): out.add(f"{WORDS.index(w) + 1 + (0.5 if half else 0):g}")
return out
count = lambda v: v.isdigit() and (int(v) <= len(heads) or v in heads) # a head count or a file number
tot = good = 0
for ln in md.splitlines():
allowed = set().union(*[figures(lines[c]) for c in re.findall(r"\d\d-\d\d", ln) if c in lines])
here = [x.replace(",", "") for x in re.findall(r"(?<![\w.-])\d[\d,]*(?:\.\d+)?(?![\w-])", re.sub(r"\d\d-\d\d", " ", ln))]
for v in here:
tot += 1; good += v in allowed or count(v) or any(float(a) + float(b) == float(v) for a in here for b in here if a != v and b != v)
for r in fnd:
for side in ("side_a", "side_b"):
mine = set().union(*[figures(t) for l, t in lines.items() if person[owner[l]] in who(r.get(side + "_experts", ""))])
for v in re.findall(r"(?<![\w.-])\d[\d,]*(?:\.\d+)?(?![\w-])", r.get(side, "")):
tot += 1; good += v.replace(",", "") in mine or count(v)
say(tot > 0 and good == tot, f"{good} of {tot} numbers in findings.md and findings.csv are found on a note line cited beside them or in the named experts' own notes")
sys.exit(0 if ok else 1)
brief.md: sample data written by Atris. Fingerprint cb9156a1263d.
interview_01.md: sample data written by Atris. Fingerprint ac466b54d5bd.
interview_02.md: sample data written by Atris. Fingerprint 018feff0d2dd.
interview_03.md: sample data written by Atris. Fingerprint b0cddce0ce36.
interview_04.md: sample data written by Atris. Fingerprint b7847f3fa246.
interview_05.md: sample data written by Atris. Fingerprint 7392006cb34e.
interview_06.md: sample data written by Atris. Fingerprint 3aa679fc469e.
interview_07.md: sample data written by Atris. Fingerprint 02d3cc44e0e5.
findings.csv: written by the agent. Fingerprint 332ec1c92120.
findings.md: written by the agent. Fingerprint 226b31f99041.
positions.csv: written by the agent. Fingerprint 5c8bfaabafbe.