Atris

Write the board pre-read from reports.
Done by an agent. Checked twice.

A short board pre-read that sums up each department report and shows every figure two reports disagree on.

Have Atris do this for you›

1

Real files in

  • customer_success.md
    The customer success team's quarterly report to the board, with a key figures table. 39 lines, 2 KB.
  • finance.md
    The finance department's quarterly report to the board, with a key figures table. 41 lines, 2 KB.
  • operations.md
    The operations department's quarterly report to the board, with a key figures table. 41 lines, 2 KB.
  • people.md
    The people team's quarterly report to the board, with a key figures table that has one blank value. 37 lines, 1 KB.
  • sales.md
    The sales department's quarterly report to the board, with a key figures table. 39 lines, 2 KB.

Sample data written by Atris. Not a real company.

2

Three steps

  1. 1.Read every department report
  2. 2.Compare the key figures across reports
  3. 3.Write the pre-read

Claude Sonnet 5.5, 55 seconds. No web. It never saw the check.

3

Checked twice

  • ✓Passed: 7 of 7 disagreements between reports, found again from the key figures tables, are in disagreements.csv
  • ✓Passed: 0 of 7 rows in disagreements.csv name a pair of reports that agree or do not share the measure
  • ✓Passed: 7 of 7 gaps equal the difference between the two values
  • ✓Passed: 5 of 5 reports are summed up and 32 of 32 lines that name a report use only figures printed in it
  • ✓Passed: 123 of 123 figures in pre_read.md are printed in a report named on the same line, or in any report when the line names none
  • ✓Passed: 7 of 7 disagreements are stated in pre_read.md with both values and both reports
  • ✓Passed: 1 of 1 blank figures are named in pre_read.md with the report that left them blank
  • ✓Passed: pre_read.md asks 7 questions for the board, at least one for each of the 6 measures in dispute

Second review by Claude Opus 5.5: pass.

Then we broke a copy of the output 6 ways on purpose. The check caught 5.

What it wrote. Lines 40 to 48 of pre_read.md, copied from the file.
## Where reports disagree
All reports cover July 1 to September 30, 2026. No winner is picked.
- Customers lost, Q3: 6 in customer_success.md, 7 in finance.md. Neither report explains the difference. (finance.md separately says 7 customers stopped buying, three with open late delivery disputes.)
- On time delivery rate, Q3: 93% in customer_success.md, 91.4% in operations.md. customer_success.md says its figure is "by our records"; neither report explains the difference.
- New bookings, Q3: 2,268,500 in finance.md, 2,412,000 in sales.md. finance.md says its policy counts an order only when the signed paperwork is dated inside the quarter, and asks the board to agree one definition of a booking. sales.md does not state its counting rule, and prints that the Old Quarry order, 143,500, was signed on October 2. Neither report says that this order is the cause of the difference.
- Inventory on hand, end of Q3: 3,904,000 in finance.md, 3,940,000 in operations.md. Neither report explains the difference.
- Headcount, end of Q3: 89 in finance.md, 87 in operations.md. Neither report explains the difference. (finance.md's text says payroll is running for 89 people against a budget of 86.)
- Headcount, end of Q3: 89 in finance.md, 87 in people.md. Neither report explains the difference. operations.md and people.md agree at 87.
- Warehouse injuries, Q3: 1 in operations.md, 2 in people.md. people.md's text lists two injuries, at Dorley on September 9 and at Hartsmere on August 21; operations.md's text names only the Dorley injury and calls it recordable. Neither report says why its count differs from the other.

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

  • Went through every Key figures table myself. I found exactly 7 pairs of reports that disagree, and all 7 rows are in disagreements.csv: customers lost (6 vs 7), on time delivery (93% vs 91.4%), new bookings (2,268,500 vs 2,412,000), inventory (3,904,000 vs 3,940,000), headcount finance vs operations (89 vs 87), headcount finance vs people (89 vs 87), and injuries (1 vs 2). Pairs that agree are correctly left out: gross margin 31.2%, revenue 6,184,000, net revenue retention 104%, satisfaction score 4.4, and headcount operations vs people (87).
  • Recomputed every gap and all are correct: 1, 1.6, 143500, 36000, 2, 2, 1. 'Open roles' and 'Open roles, sales' are correctly treated as different measures.
  • Voluntary departures, Q3 is blank in people.md and the pre-read lists it under Missing figures, not as a disagreement with the 4 in operations.md.
  • Compared each department line with its report. Figures are printed as the report prints them, for example 'down from 52 days', 'about 400,000 more stock' and '28,400 in total', and nothing worked out by the worker appears. The bookings line says the Old Quarry order (143,500, signed October 2) is printed in sales.md, but does not claim it causes the gap. The worker's check.py also passed all 7 of its checks.

What this run does not show

  • Disagreements are found only where two reports use the same label in their key figures tables. A clash buried in the text of a report is not found.
  • The check confirms each figure is printed in the report named on its line. A figure swapped for another figure from the same report gets through.
  • Whether the lines chosen for each department are the ones that matter most is read only by the second review.

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 5 of 6. The check was made stricter after the first try at this, and the same untouched output was graded again. It let these through, so on this job they rest on the second review alone:

  • Changed the number 95 to 97 in pre_read.md

Open every file

flow.md · the three steps the agent followed
# Write the board pre-read from reports

function: leadership
for: the chief of staff who assembles the board pack
goal: Directors get one short pre-read that sums up each department report and shows every place two reports give different figures for the same measure.

## 1. Read every department report
Read every report in input/. Each one has text sections and ends with a Key figures table of measures
and values. Note the period each report covers.

## 2. Compare the key figures across reports
Two figures are the same measure when their labels are equal after ignoring capital letters and
punctuation. "New bookings, Q3" and "new bookings Q3" are the same measure. "New bookings, Q3" and
"New bookings, September" are not, and neither are "Open roles" and "Open roles, sales".
- When two reports give different values for the same measure, that is a disagreement, however small.
- When three reports give the same measure, compare each pair.
- A measure with a blank value is a missing figure, not a disagreement.
Write output/disagreements.csv with columns measure,report_a,value_a,report_b,value_b,gap. One row for
each pair of reports that disagree. report_a and report_b are the file names, such as sales.md. The
values are as printed in each report. gap is the difference between the two values as a plain positive
number. Leave out measures that agree and measures that only one report gives.

## 3. Write the pre-read
Write output/pre_read.md with these sections in this order:
- One section for each report, headed with the department name. Three to five lines on what matters
  most for a director: results, problems, risks and what the department asks the board for. End every
  line with the file it came from in square brackets, such as [sales.md]. Print figures exactly as the
  report prints them. Do not round them or shorten them. A sum, a percent or a gap you work out
  yourself must not appear in these lines. Before you finish, read each line again and confirm every
  figure in it is printed in the report it names.
- "Where reports disagree": one line for each row of disagreements.csv, with the measure, both values
  and both file names. If a report's own text explains the difference, say so and name the report.
  Do not guess at a cause the reports do not give.
- "Missing figures": each measure a report lists with a blank value, and which report left it blank.
- "Questions for the board": at least one question for each measure in dispute.
Use only what the reports say. Do not pick a winner between two figures.

## Done looks like
- Every pair of reports that disagree on a measure has a row in disagreements.csv, and no pair that agrees does.
- Every line in a department section names its report and uses only figures printed in that report.
- A director can see each disputed measure with both values before the meeting.
input/customer_success.md · 39 lines, 2 KB
# Customer success report to the board, Q3 2026

Marrowstone Kitchen Supply. Prepared by Lucan Adeyemi, Head of Customer Success. Period: July 1 to
September 30, 2026.

## Summary
Customers bought more from us this quarter than last. Net revenue retention was 104 percent. We lost 6
customers, all small accounts. The customer satisfaction score held at 4.4 out of 5. Late deliveries were
the top complaint by a wide margin.

## What went well
- 212 customers answered the quarterly survey, our highest response count.
- The install scheduling line now answers in under 2 minutes on average, down from 6 minutes.
- 31 customers added a service contract in the quarter. 190 customers now have one.

## What did not go well
- 164 complaints were logged. 97 of them were about late or split deliveries.
- By our records 93 percent of deliveries arrived on the date first promised. Customers on refrigeration
  orders felt it most.
- Three accounts are in dispute over late delivery credits worth 28,400 in total.

## Risks
- Tessaly Restaurant Group has asked for a named contact and weekly delivery reports. Missing their
  December 15 date would put the 14 site order at risk.
- Two of the 5 people on the team are covering the phones and cannot do account reviews.

## Asks for the board
- Approve one support hire so account reviews restart in Q1.
- Agree a standard late delivery credit so disputes close faster.

## Key figures
| Measure | Value |
|---|---|
| Net revenue retention, Q3 | 104% |
| Customers lost, Q3 | 6 |
| Customer satisfaction score, Q3 | 4.4 |
| On time delivery rate, Q3 | 93% |
| Complaints logged, Q3 | 164 |
| Customers with a service contract | 190 |
input/finance.md · 41 lines, 2 KB
# Finance report to the board, Q3 2026

Marrowstone Kitchen Supply. Prepared by Teodor Vance, CFO. Period: July 1 to September 30, 2026.

## Summary
Revenue for the quarter was 6,184,000, which is 4 percent above plan. Gross margin held at 31.2 percent.
New bookings counted under our policy were 2,268,500. Our policy counts an order only when the signed
paperwork is dated inside the quarter. Cash at the end of the quarter was 1,912,000.

## What went well
- Operating costs were 1,402,000 against a plan of 1,455,000.
- Customers paid in 47 days on average, down from 52 days in Q2, after we began calling at day 30.
- The bank renewed the 2,500,000 credit line on the same terms. Nothing is drawn on it.

## What did not go well
- Inventory on hand rose to 3,904,000. That is 11 weeks of sales against a target of 8 weeks.
- We wrote off 46,300 of slow stock, mostly a discontinued line of ice machines.
- 7 customers stopped buying in the quarter. Three of them had open disputes over late deliveries.

## Risks
- If the refrigeration supplier's lead time stays at 14 weeks we will carry about 400,000 more stock
  through Q4 than planned.
- Payroll is running for 89 people at the end of the quarter against a budget of 86.

## Asks for the board
- Approve a stock reduction target of 3,400,000 by the end of Q1.
- Agree one definition of a booking for board reporting.

## Key figures
| Measure | Value |
|---|---|
| Revenue, Q3 | 6,184,000 |
| New bookings, Q3 | 2,268,500 |
| Gross margin, Q3 | 31.2% |
| Operating costs, Q3 | 1,402,000 |
| Cash, end of Q3 | 1,912,000 |
| Inventory on hand, end of Q3 | 3,904,000 |
| Average days to pay, Q3 | 47 |
| Customers lost, Q3 | 7 |
| Net revenue retention, Q3 | 104% |
| Headcount, end of Q3 | 89 |
input/operations.md · 41 lines, 2 KB
# Operations report to the board, Q3 2026

Marrowstone Kitchen Supply. Prepared by Ines Kowalczyk, VP Operations. Period: July 1 to September 30, 2026.

## Summary
We shipped 5,230 orders in the quarter from the two warehouses. The on time delivery rate was 91.4
percent against a target of 95 percent. The shortfall came almost entirely from refrigeration units,
where our main supplier's lead time went from 7 weeks to 14 weeks in August. Gross margin was 31.2 percent.

## What went well
- The second shift at the Dorley warehouse started on August 3 and cut pick time per order from 22
  minutes to 17 minutes.
- Freight cost per order fell to 86 from 94 after we moved regional loads to a second carrier.
- Stock accuracy at the September count was 99.1 percent.

## What did not go well
- 448 orders shipped late. 301 of them were waiting on refrigeration units.
- One recordable injury in the quarter, a hand laceration at Dorley on September 9. The guard on the
  strapping machine has been replaced.
- Inventory on hand at the end of the quarter was 3,940,000, above the target of 3,000,000.

## Risks
- We can promise 9 of the 14 Tessaly sites before December 15. The other 5 depend on 60 refrigeration
  units that are not yet confirmed by the supplier.
- The lease on the Hartsmere warehouse ends on March 31, 2027. The landlord has asked for 12 percent more.

## Asks for the board
- Approve a second refrigeration supplier. Unit cost is about 4 percent higher.
- Decide by the January meeting whether to renew Hartsmere or move its stock into Dorley.

## Key figures
| Measure | Value |
|---|---|
| Orders shipped, Q3 | 5,230 |
| On time delivery rate, Q3 | 91.4% |
| Gross margin, Q3 | 31.2% |
| Inventory on hand, end of Q3 | 3,940,000 |
| Warehouse injuries, Q3 | 1 |
| Stock accuracy, September count | 99.1% |
| headcount end of Q3 | 87 |
| Voluntary departures, Q3 | 4 |
input/people.md · 37 lines, 1 KB
# People report to the board, Q3 2026

Marrowstone Kitchen Supply. Prepared by Signe Aldana, Head of People. Period: July 1 to September 30, 2026.

## Summary
We ended the quarter with 87 people. We hired 9 and 5 left. The second shift at Dorley accounts for 6
of the 9 hires. There are 6 open roles. Two warehouse injuries were reported to our insurer in the quarter.

## What went well
- Time to fill a warehouse role fell to 19 days from 33 days.
- All 14 managers finished the new review training.
- The staff survey had 81 percent taking part. The top score was for "my manager is fair".

## What did not go well
- Two injuries were reported: the hand laceration at Dorley on September 9 and a back strain at
  Hartsmere on August 21 that needed 3 days off.
- Field sales pay is now 8 percent under the regional median by our survey data.
- The exit count by reason is not finished. Voluntary departures will be confirmed before the meeting.

## Risks
- Hartsmere staff know the lease is in question. 3 of the 11 people there have asked about transfers.
- One person covers payroll with no backup.

## Asks for the board
- Approve a pay review for field sales in Q1. Estimated cost is 96,000 a year.
- Approve a part time payroll backup.

## Key figures
| Measure | Value |
|---|---|
| Headcount, end of Q3 | 87 |
| Hires, Q3 | 9 |
| Leavers, Q3 | 5 |
| Voluntary departures, Q3 | |
| Open roles | 6 |
| Warehouse injuries, Q3 | 2 |
| Staff survey taking part | 81% |
input/sales.md · 39 lines, 2 KB
# Sales report to the board, Q3 2026

Marrowstone Kitchen Supply. Prepared by Odalys Brandt, VP Sales. Period: July 1 to September 30, 2026.

## Summary
Q3 was our strongest bookings quarter of the year. New bookings came to 2,412,000, helped by two large
restaurant group orders that closed in the last week of September. Revenue shipped in the quarter was
6,184,000. September alone brought 910,000 in new bookings.

## What went well
- Won Tessaly Restaurant Group, a 14 site rollout of combi ovens and refrigeration. Order value 388,000.
- Won Old Quarry Hospitality, 9 sites. Order value 143,500. Paperwork was signed on October 2.
- The inside sales team of 4 handled 61 percent of orders under 10,000, up from 48 percent in Q2.
- Average discount fell from 11.8 percent to 9.6 percent after the price floor was introduced in July.

## What did not go well
- We lost the Fairmead Schools tender on price. The winning bid was about 7 percent under ours.
- Two of the 12 field reps missed quota for the second quarter running.
- Quotes took a median of 3 days to turn around. Customers tell us two competitors quote the same day.

## Risks
- Tessaly wants delivery to all 14 sites before December 15. Operations has told us that 9 sites is what
  they can promise.
- 38 percent of open quotes by value depend on one refrigeration supplier whose lead time doubled in August.

## Asks for the board
- Approve 2 more inside sales hires for Q1 so field reps can drop orders under 10,000.
- Support a same day quote tool. Estimated cost is 60,000 one time.

## Key figures
| Measure | Value |
|---|---|
| New bookings, Q3 | 2,412,000 |
| New bookings, September | 910,000 |
| Revenue, Q3 | 6,184,000 |
| Orders won, Q3 | 418 |
| Average discount, Q3 | 9.6% |
| Customer satisfaction score, Q3 | 4.4 |
| Open roles, sales | 2 |
output/disagreements.csv · written by the agent, 8 lines
measure,report_a,value_a,report_b,value_b,gap
"Customers lost, Q3",customer_success.md,6,finance.md,7,1
"On time delivery rate, Q3",customer_success.md,93%,operations.md,91.4%,1.6
"New bookings, Q3",finance.md,"2,268,500",sales.md,"2,412,000",143500
"Inventory on hand, end of Q3",finance.md,"3,904,000",operations.md,"3,940,000",36000
"Headcount, end of Q3",finance.md,89,operations.md,87,2
"Headcount, end of Q3",finance.md,89,people.md,87,2
"Warehouse injuries, Q3",operations.md,1,people.md,2,1
output/pre_read.md · written by the agent, 60 lines
# Board pre-read, Q3 2026 (July 1 to September 30, 2026)

Marrowstone Kitchen Supply. Built only from the five department reports. Gaps between figures are in disagreements.csv.

## Sales
- New bookings came to 2,412,000, called the strongest bookings quarter of the year; revenue shipped was 6,184,000. [sales.md]
- Won Tessaly Restaurant Group, a 14 site rollout, order value 388,000, and Old Quarry Hospitality, 9 sites, order value 143,500, with paperwork signed on October 2. [sales.md]
- Lost the Fairmead Schools tender on price; 2 of the 12 field reps missed quota for the second quarter running. [sales.md]
- Risk: Tessaly wants all 14 sites before December 15 and operations says 9 sites is what they can promise; 38 percent of open quotes by value depend on one refrigeration supplier. [sales.md]
- Asks the board to approve 2 more inside sales hires for Q1 and to support a same day quote tool at 60,000 one time. [sales.md]

## Finance
- Revenue was 6,184,000, 4 percent above plan; gross margin held at 31.2 percent; operating costs were 1,402,000 against a plan of 1,455,000. [finance.md]
- Cash at quarter end was 1,912,000; the 2,500,000 credit line was renewed on the same terms with nothing drawn; customers paid in 47 days on average, down from 52 days. [finance.md]
- Inventory on hand rose to 3,904,000, which is 11 weeks of sales against a target of 8 weeks; 46,300 of slow stock was written off. [finance.md]
- Risk: if the refrigeration supplier's lead time stays at 14 weeks, about 400,000 more stock through Q4 than planned; payroll is running for 89 people against a budget of 86. [finance.md]
- Asks the board to approve a stock reduction target of 3,400,000 by the end of Q1 and to agree one definition of a booking for board reporting. [finance.md]

## Operations
- Shipped 5,230 orders; on time delivery rate was 91.4% against a target of 95 percent, with the shortfall almost entirely from refrigeration units after the main supplier's lead time went from 7 weeks to 14 weeks in August. [operations.md]
- 448 orders shipped late, 301 of them waiting on refrigeration units; one recordable injury, a hand laceration at Dorley on September 9. [operations.md]
- Inventory on hand at quarter end was 3,940,000, above the target of 3,000,000. [operations.md]
- Risk: 9 of the 14 Tessaly sites can be promised before December 15, and the other 5 depend on 60 refrigeration units not yet confirmed by the supplier; the Hartsmere lease ends on March 31, 2027 and the landlord has asked for 12 percent more. [operations.md]
- Asks the board to approve a second refrigeration supplier (unit cost about 4 percent higher) and to decide by the January meeting whether to renew Hartsmere or move its stock into Dorley. [operations.md]

## People
- Ended the quarter with 87 people; hired 9 and 5 left; there are 6 open roles. [people.md]
- Two injuries were reported to the insurer: the hand laceration at Dorley on September 9 and a back strain at Hartsmere on August 21 that needed 3 days off. [people.md]
- Field sales pay is 8 percent under the regional median by the department's survey data; the exit count by reason is not finished and voluntary departures will be confirmed before the meeting. [people.md]
- Risk: 3 of the 11 people at Hartsmere have asked about transfers; one person covers payroll with no backup. [people.md]
- Asks the board to approve a pay review for field sales in Q1 (estimated 96,000 a year) and a part time payroll backup. [people.md]

## Customer success
- Net revenue retention was 104 percent; 6 customers were lost, all small accounts; the customer satisfaction score held at 4.4 out of 5. [customer_success.md]
- 164 complaints were logged and 97 were about late or split deliveries; by the department's records 93 percent of deliveries arrived on the date first promised. [customer_success.md]
- Three accounts are in dispute over late delivery credits worth 28,400 in total. [customer_success.md]
- Risk: Tessaly has asked for a named contact and weekly delivery reports, and missing December 15 would put the 14 site order at risk; 2 of the 5 people on the team are covering the phones. [customer_success.md]
- Asks the board to approve one support hire so account reviews restart in Q1 and to agree a standard late delivery credit. [customer_success.md]

## Where reports disagree
All reports cover July 1 to September 30, 2026. No winner is picked.
- Customers lost, Q3: 6 in customer_success.md, 7 in finance.md. Neither report explains the difference. (finance.md separately says 7 customers stopped buying, three with open late delivery disputes.)
- On time delivery rate, Q3: 93% in customer_success.md, 91.4% in operations.md. customer_success.md says its figure is "by our records"; neither report explains the difference.
- New bookings, Q3: 2,268,500 in finance.md, 2,412,000 in sales.md. finance.md says its policy counts an order only when the signed paperwork is dated inside the quarter, and asks the board to agree one definition of a booking. sales.md does not state its counting rule, and prints that the Old Quarry order, 143,500, was signed on October 2. Neither report says that this order is the cause of the difference.
- Inventory on hand, end of Q3: 3,904,000 in finance.md, 3,940,000 in operations.md. Neither report explains the difference.
- Headcount, end of Q3: 89 in finance.md, 87 in operations.md. Neither report explains the difference. (finance.md's text says payroll is running for 89 people against a budget of 86.)
- Headcount, end of Q3: 89 in finance.md, 87 in people.md. Neither report explains the difference. operations.md and people.md agree at 87.
- Warehouse injuries, Q3: 1 in operations.md, 2 in people.md. people.md's text lists two injuries, at Dorley on September 9 and at Hartsmere on August 21; operations.md's text names only the Dorley injury and calls it recordable. Neither report says why its count differs from the other.

## Missing figures
- Voluntary departures, Q3: left blank by people.md, whose text says the exit count by reason is not finished and will be confirmed before the meeting. operations.md prints 4 for the same measure; as people.md has no value, this is not counted as a disagreement.

## Questions for the board
- Customers lost, Q3 (6 vs 7): Which count of lost customers should the board use, and what definition of "lost" does each report apply? [customer_success.md, finance.md]
- On time delivery rate, Q3 (93% vs 91.4%): Is the 93% measured against the date first promised and the 91.4% against another date? Which measure should be tracked against the 95 percent target? [customer_success.md, operations.md]
- New bookings, Q3 (2,268,500 vs 2,412,000): Will the board agree one booking definition, as finance.md asks, and which figure stands for Q3 until then? [finance.md, sales.md]
- Inventory on hand, end of Q3 (3,904,000 vs 3,940,000): Which figure is the baseline for the stock reduction target of 3,400,000? [finance.md, operations.md]
- Headcount, end of Q3 (89 vs 87 vs 87): Which headcount is right, and does payroll count people the People count leaves out? [finance.md, operations.md, people.md]
- Warehouse injuries, Q3 (1 vs 2): How many injuries should the board record for the quarter, and is the Hartsmere back strain counted as recordable? [operations.md, people.md]
- Voluntary departures, Q3 (blank in people.md, 4 in operations.md): Can people.md confirm the figure before the meeting? [people.md, operations.md]
check.py · the check, written before the run
"""Finds every disagreement between the reports' key figures tables again and compares with the pre-read."""
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 num(s):
    m = re.search(r"\d[\d,]*(?:\.\d+)?", s or "")
    return round(float(m.group(0).replace(",", "")), 4) if m else None
def nums(text):
    return {round(float(n.replace(",", "")), 4) for n in re.findall(r"\d[\d,]*(?:\.\d+)?", text)}
def norm(label):
    return re.sub(r"[^a-z0-9]+", " ", label.lower()).strip()

# read each report's key figures table
reports, text_of = {}, {}
for p in sorted((root/"input").glob("*.md")):
    text_of[p.name] = p.read_text(); table = {}
    for ln in text_of[p.name].split("## Key figures")[-1].splitlines():
        cells = [c.strip() for c in ln.strip().strip("|").split("|")]
        if ln.strip().startswith("|") and len(cells) == 2 and cells[0] not in ("Measure", "") and not set(cells[0]) <= set("-: "):
            table[norm(cells[0])] = (cells[0], cells[1])
    reports[p.name] = table
names = sorted(reports)
want, missing = [], []
for i, a in enumerate(names):
    for label, (shown, value) in reports[a].items():
        if num(value) is None: missing.append((shown, a))
    for b in names[i+1:]:
        for label in reports[a]:
            if label in reports[b]:
                va, vb = num(reports[a][label][1]), num(reports[b][label][1])
                if va is not None and vb is not None and va != vb:
                    want.append((label, a, va, b, vb))

path = root/"output/disagreements.csv"
rows = list(csv.DictReader(path.open())) if path.exists() else []
def same(row, w):
    label, a, va, b, vb = w
    if norm(row.get("measure") or "") != label: return False
    ra, rb = (row.get("report_a") or "").strip(), (row.get("report_b") or "").strip()
    xa, xb = num(row.get("value_a")), num(row.get("value_b"))
    return (ra, xa, rb, xb) == (a, va, b, vb) or (ra, xa, rb, xb) == (b, vb, a, va)
hit = sum(1 for w in want if any(same(r, w) for r in rows))
say(hit == len(want) and want, f"{hit} of {len(want)} disagreements between reports, found again from the key figures tables, are in disagreements.csv")
extra = sum(1 for r in rows if not any(same(r, w) for w in want))
say(bool(rows) and extra == 0, f"{extra} of {len(rows)} rows in disagreements.csv name a pair of reports that agree or do not share the measure")
gaps = sum(1 for r in rows if num(r.get("gap")) is not None and num(r.get("value_a")) is not None and num(r.get("value_b")) is not None
           and abs(num(r["gap"]) - abs(num(r["value_a"]) - num(r["value_b"]))) < 0.0051)
say(bool(rows) and gaps == len(rows), f"{gaps} of {len(rows)} gaps equal the difference between the two values")

pre = (root/"output/pre_read.md").read_text() if (root/"output/pre_read.md").exists() else ""
all_gaps = {round(abs(va - vb), 4) for _, _, va, _, vb in want}
tagged, clean, per = 0, 0, {n: 0 for n in names}
for ln in pre.splitlines():
    tags = [t for t in re.findall(r"\[([^\]]+)\]", ln) for t in re.findall(r"[\w-]+\.md", t) if t in reports]
    if not tags: continue
    tagged += 1
    body = re.sub(r"\[[^\]]*\]", " ", ln); body = re.sub(r"\bQ[1-4]\b", " ", body); body = re.sub(r"^\s*\d+[.)]\s", " ", body)
    allowed = set(all_gaps)
    for t in tags: allowed |= nums(re.sub(r"\bQ[1-4]\b", " ", text_of[t]))
    if nums(body) <= allowed: clean += 1
    if len(set(tags)) == 1: per[tags[0]] += 1
covered = sum(1 for n in names if per[n] >= 3)
say(covered == len(names) and tagged == clean and tagged > 0,
    f"{covered} of {len(names)} reports are summed up and {clean} of {tagged} lines that name a report use only figures printed in it")
FIG = r"(?<![\w.-])\d(?:[\d,]*\d)?(?:\.\d+)?(?![\w-])"
printed_in = {n: nums(re.sub(r"\bQ[1-4]\b", " ", text_of[n])) for n in names}
used = held = 0
for ln in pre.splitlines():
    here = [t for t in re.findall(r"[\w-]+\.md", ln) if t in reports]
    ok_set = set(all_gaps).union(*(printed_in[t] for t in (here or names)))
    for x in re.findall(FIG, re.sub(r"^\s*\d+[.)]\s", " ", ln)):
        used += 1; held += round(float(x.replace(",", "")), 4) in ok_set
say(used >= 20 and held == used, f"{held} of {used} figures in pre_read.md are printed in a report named on the same line, or in any report when the line names none")
stated = 0
for label, a, va, b, vb in want:
    if any(a in ln and b in ln and {va, vb} <= nums(ln) for ln in pre.splitlines()): stated += 1
say(stated == len(want) and want, f"{stated} of {len(want)} disagreements are stated in pre_read.md with both values and both reports")
named = sum(1 for shown, rep in missing if any(set(norm(shown).split()) <= set(norm(ln).split()) and rep in ln for ln in pre.splitlines()))
say(named == len(missing), f"{named} of {len(missing)} blank figures are named in pre_read.md with the report that left them blank")
tail = re.split(r"(?im)^.*questions for the board.*$", pre)
questions = sum(1 for ln in tail[-1].splitlines() if "?" in ln) if len(tail) > 1 else 0
measures = len({w[0] for w in want})
say(questions >= measures > 0, f"pre_read.md asks {questions} questions for the board, at least one for each of the {measures} measures in dispute")
sys.exit(0 if ok else 1)

customer_success.md: sample data written by Atris. Fingerprint f120856b26b0.

finance.md: sample data written by Atris. Fingerprint ccfd78b49718.

operations.md: sample data written by Atris. Fingerprint aa0ab28a45fc.

people.md: sample data written by Atris. Fingerprint a0994682c863.

sales.md: sample data written by Atris. Fingerprint f14c0aa4816a.

disagreements.csv: written by the agent. Fingerprint 1cb7bf9d7208.

pre_read.md: written by the agent. Fingerprint a481ae221bc2.


More the founder's office work, and every other desk job

For agentsGitHub
What is AtrisBlogApp StorePricingPrivacyTerms