Turn messy notes into a standard procedure.
Done by an agent. Checked twice.
One numbered procedure where every step has an owner, the latest limits and a quote from the notes behind it.
Real files in
- receiving_notes.md
About 900 words of notes from two mornings on a chilled and frozen receiving dock, out of order, with two rules corrected later and one duty nobody owns. 68 lines, 5 KB. - roles.csv
The six roles on the dock, who holds each and the nicknames people use. 7 lines, 275 bytes.
Sample data written by Atris. Not a real company.
Three steps
- 1.Read the notes and the roles
- 2.Build the steps in working order
- 3.Write the procedure and its sources
Claude Sonnet 5.5, 1 min 40 s. No web. It never saw the check.
Checked twice
- Passed: 24 of 24 steps are numbered in order and appear in sop.md with the same owner and wording
- Passed: 24 of 24 steps have an owner that is a role in roles.csv or is marked unassigned
- Passed: 24 of 24 source quotes appear word for word in the notes
- Passed: 10 of 10 numbered rules from the notes are written into a step
- Passed: 24 of 24 steps are free of the 2 values the notes later replaced
- Passed: 7 of 7 key duties sit with the owner the notes name or are unassigned where nobody owns them
- Passed: 3 of 3 order rules hold (seal before probe, probe before putaway, count before keying) and the return pickup is raised as an open question
- Passed: 30 of 30 numbers in sop.md and the steps are numbers the notes hold and 2 of 2 replaced rules give the old value beside the new one
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 6 ways on purpose. The check caught 6.
7. Dock Lead: Time the door on the wall clock and keep it open no more than 20 minutes per truck. 8. Receiving Clerk: As pallets come off, probe 3 cases per pallet: one from the top, one from the middle and one from the bottom layer. 9. Receiving Clerk: Write each reading on the temp log sheet that hangs on the door post. 10. Receiving Clerk: Put a red hold tag on any pallet that reads out of limit: chilled must be 5 C or colder and frozen must be -18 C or colder. 11. Forklift Operator: Move the held pallet to cage Q, the quarantine cage by door 4. 12. Receiving Clerk: Call the Quality Tech about the held pallet. 13. Quality Tech: Decide to release or reject the held pallet within 2 hours of the call; the pallet does not leave cage Q until then. 14. unassigned: Send rejected pallets back on the supplier's next truck or a booked return pickup with the carrier; the notes do not say who books the pickup. 15. Receiving Clerk: If a pallet is damaged, take 4 photos: the label, the damage up close, the whole pallet and the inside of the trailer. 16. Receiving Clerk: Write the damage on the BOL before the driver leaves. 17. Receiving Clerk: Count the cases on every pallet against the PO line. 18. Receiving Clerk: If the difference is 2% or less of the ordered quantity on a PO line, write the difference on the BOL. 19. Dock Lead: If the difference is more than 2% of the ordered quantity on a PO line, ring the Purchasing Coordinator before the BOL is signed. 20. Dock Lead: Sign the BOL after the count.
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 40 s. Run 1 passed both checks and the job was run again later. 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
- Replaced values were handled correctly. The door limit is 20 minutes in step 7 ('It has been 20 minutes per truck since', which replaces Imre's 30), and the chilled limit is 5 C in step 10 (it replaced the old wall-sheet 8 C after the March audit). Both changes appear under Replaced rules.
- All 24 source quotes match the notes word for word and none spans a line break. For example, step 8 '3 cases per pallet: one from the top, one from the middle, one from' is notes line 13, and step 18 '2% or less, the receiver writes' is notes line 55.
- Every numbered rule is in a step with its latest value: -18 C frozen, 3 cases per pallet, 2 hours for the QA decision, 2% count threshold, 4 photos, 45 min putaway, 1 hour keying and 24 months retention. Unrelated items (canteen 06:30, radio channels 4/6, the ten minutes lost to the flat battery) were rightly left out.
- Owners match roles.csv. Marek's seal check is Receiving Clerk, Jonas moving the pallet to cage Q is Forklift Operator, and Bea's keying is Inventory Controller. The disputed return pickup (Imre says purchasing, Sunniva says the dock) is correctly 'unassigned' and listed under Open questions, along with the open question about frozen putaway time.
What this run does not show
- The check holds a list of ten limits and seven duties from the notes, marked by hand before the run.
- Owners of the other steps and the order of most steps are read only by the second review.
- The first run passed the check with a wrong roles list that only the second review caught, so the flow was made clearer.
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 6 of 6. 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
# Turn messy notes into a standard procedure function: operations for: the person who runs a warehouse or plant floor goal: The notes become one numbered procedure where every step has an owner and can be traced to a line in the notes. ## 1. Read the notes and the roles Read every notes file in input/ and input/roles.csv. The notes are in the order things were heard, not the order work is done. People are called by first name or by a nickname. Use roles.csv to turn each one into its role. Mark every rule with a number in it: a limit, a time, a count or a percent. When the notes correct an earlier statement, the latest correction is the rule and the earlier value is replaced. ## 2. Build the steps in working order Write one step for each action someone must take, in the order the work is done. Each step has one owner, which must be a role from roles.csv spelled as it is there. The owner is the role that does the action. When the notes do not say who owns an action, or people in the notes disagree about it, the owner is `unassigned`. Never guess an owner. Put every numbered rule into the step it belongs to, written in digits with its unit as the notes write it. Keep replaced values out of the steps. Leave out anything that is not part of the job the notes describe. Do not add steps, limits or reasons that are not in the notes. ## 3. Write the procedure and its sources Write output/steps.csv with columns step,owner,action,source_quote. step counts 1, 2, 3 with no gaps. action is one or two plain sentences. source_quote is one run of at least 5 words copied exactly from the notes that backs the step. Copy it letter for letter. Do not join two passages and do not use dots to skip words. Write output/sop.md with these parts in this order: a title, `## Purpose` in two sentences, `## Roles` with one line for each role in roles.csv that owns a step or is named in a step (`unassigned` is not a role and does not go here), `## Steps` with one line per step written `<step>. <owner>: <action>` using the same owner and the same action text as steps.csv, `## Replaced rules` with one line per value the notes corrected giving the old value and the new one. Last comes `## Open questions` with every `unassigned` step and everything the notes say is still unknown. ## Done looks like - Every step has one owner from roles.csv or is marked unassigned. - Every source quote can be found word for word in the notes. - Every numbered rule in the notes sits in a step, using the latest value.
input/receiving_notes.md · 68 lines, 5 KB
# Shadowing notes: inbound dock, chilled and frozen Brackwater Foods, north warehouse. Two mornings on the dock, Tue and Wed. Typed up from my notebook so sorry about the order, I wrote things down as people said them. ## Tue, first truck 05:40 - Got there late, parking is a mess before 6. Canteen opens 06:30 fyi. - Priya (receiver) already had the driver's paperwork. First thing she does is look the delivery up on the day's appointment list and pull the PO. If it's not on the list she sends the driver to wait in the yard and tells Imre. Did not see that happen. - Imre = shift lead. He gives the truck a door and he is the only one who signs the BOL. Said twice: "nobody signs a BOL but me". - Pallets come off, Priya probes them. 3 cases per pallet: one from the top, one from the middle, one from the bottom layer. Writes each reading on the temp log sheet that hangs on the door post. - Chilled has to be 8 C or colder (that is what the laminated sheet on the wall says). Frozen has to be -18 C or colder. - Tomas from QA came by. I asked if he does the probing. He said he used to, but since spring the receiving clerk does it and QA only gets called when a reading is out. - Forklift battery on truck 3 was flat again. Jonas swapped it. Not a receiving thing but it cost ten minutes. - Counting: Priya counts cases on every pallet against the PO line. Small differences get written on the BOL. Big ones, someone rings purchasing. Need to find out what "big" means. - After the count Imre signs, driver leaves. - Bea (inventory) keys the receipt into the stock system with lot numbers and best before dates. She says it has to be in within 1 hour of the truck being unloaded or the pickers start seeing ghost stock. ## Tue, later - Asked Imre about the door. Rule is the dock door is open no more than 30 minutes per truck. He times it on the wall clock. - A pallet of yoghurt read 7 C on the middle case. Priya put a red hold tag on it and Jonas moved it to cage Q (the quarantine cage by door 4). She rang Tomas. - Tomas: QA has 2 hours from the call to decide, release or reject. He decides, nobody else. Until then the pallet does not leave cage Q. - So wait, 7 C failed? The wall sheet says 8. Tomas: the wall sheet is old. Limit for chilled went to 5 C after the March audit. 5 C or colder is the number, he will get the sheet reprinted. - Rejected pallets go back on the supplier's next truck or a booked return. Who books the return pickup with the carrier? Asked Imre: he thinks purchasing does. Asked Sunniva in purchasing by phone: she thinks the dock does. Nobody could tell me. Flag this. - Lunch. The soup is fine. ## Wed, 05:30, three trucks - Before anything else, before the doors are opened: Marek (other receiver) reads the seal number on the trailer and checks it against the seal number on the BOL. If the seal is broken or the number does not match he does not open the doors, he calls the dock lead. Imre then decides whether to refuse the load. I missed this on Tuesday because I was late. It is the second thing after the paperwork check. - Correction on the door time. Imre said 30 yesterday out of habit. It has been 20 minutes per truck since the summer, there is a memo. 20 is the rule. - Putaway: accepted pallets have to be in their racking slot within 45 minutes of coming off the truck. Jonas and Lin (forks) do this. Chilled and frozen go before anything ambient. - Damage. One pallet had a crushed corner. Marek took 4 photos (the label, the damage up close, the whole pallet, the inside of the trailer) and wrote the damage on the BOL before the driver left. He says always 4, the claims people bounce it otherwise. - Found out what "big" means for count differences. More than 2% of the ordered quantity on a PO line and the dock lead rings the purchasing coordinator before the BOL is signed. 2% or less, the receiver writes the difference on the BOL and it gets signed as normal. - Order of things on the dock as far as I can tell: paperwork, seal, door, unload and probe as pallets come off, hold anything out of temperature, photos if damaged, count, purchasing call if needed, sign, putaway, key the receipt. Putaway and keying overlap a bit in real life. - End of shift Tomas collects the temp log sheets from every door and files them in the QA office. They are kept for 24 months. An auditor asked for last year's in March which is how the 5 C thing came up. - Lin asked if the new hi-vis vests are in. They are not. - Radio channel for the dock is 4. Yard is 6. ## Things I still do not know - Who books return pickups for rejected pallets (see Tue). - Whether the 45 minutes for putaway is different for frozen. Jonas shrugged.
input/roles.csv · 7 lines, 275 bytes
role,held_by,also_called Receiving Clerk,Priya; Marek,receiver; clerk Dock Lead,Imre,shift lead; lead Quality Tech,Tomas,QA; QC Inventory Controller,Bea,inventory; stock control Forklift Operator,Jonas; Lin,forks; lift driver Purchasing Coordinator,Sunniva,purchasing; buyer
output/sop.md · written by the agent, 46 lines
# Standard procedure: inbound dock receiving, chilled and frozen (Brackwater Foods, north warehouse) ## Purpose This procedure sets out the order of work for receiving an inbound chilled or frozen truck, from the paperwork check to keying the receipt. It gives each step one owner and carries the limits the notes give. ## Roles - Receiving Clerk (Priya, Marek) - Dock Lead (Imre) - Quality Tech (Tomas) - Inventory Controller (Bea) - Forklift Operator (Jonas, Lin) - Purchasing Coordinator (Sunniva) ## Steps 1. Receiving Clerk: Look the delivery up on the day's appointment list and pull the PO. 2. Receiving Clerk: If the delivery is not on the list, send the driver to wait in the yard and tell the Dock Lead. 3. Receiving Clerk: Before the doors are opened, read the seal number on the trailer and check it against the seal number on the BOL. 4. Receiving Clerk: If the seal is broken or the number does not match, do not open the doors and call the Dock Lead. 5. Dock Lead: Decide whether to refuse the load. 6. Dock Lead: Give the truck a door. 7. Dock Lead: Time the door on the wall clock and keep it open no more than 20 minutes per truck. 8. Receiving Clerk: As pallets come off, probe 3 cases per pallet: one from the top, one from the middle and one from the bottom layer. 9. Receiving Clerk: Write each reading on the temp log sheet that hangs on the door post. 10. Receiving Clerk: Put a red hold tag on any pallet that reads out of limit: chilled must be 5 C or colder and frozen must be -18 C or colder. 11. Forklift Operator: Move the held pallet to cage Q, the quarantine cage by door 4. 12. Receiving Clerk: Call the Quality Tech about the held pallet. 13. Quality Tech: Decide to release or reject the held pallet within 2 hours of the call; the pallet does not leave cage Q until then. 14. unassigned: Send rejected pallets back on the supplier's next truck or a booked return pickup with the carrier; the notes do not say who books the pickup. 15. Receiving Clerk: If a pallet is damaged, take 4 photos: the label, the damage up close, the whole pallet and the inside of the trailer. 16. Receiving Clerk: Write the damage on the BOL before the driver leaves. 17. Receiving Clerk: Count the cases on every pallet against the PO line. 18. Receiving Clerk: If the difference is 2% or less of the ordered quantity on a PO line, write the difference on the BOL. 19. Dock Lead: If the difference is more than 2% of the ordered quantity on a PO line, ring the Purchasing Coordinator before the BOL is signed. 20. Dock Lead: Sign the BOL after the count. 21. Forklift Operator: Put accepted pallets in their racking slot within 45 minutes of coming off the truck, chilled and frozen before anything ambient. 22. Inventory Controller: Key the receipt into the stock system with lot numbers and best before dates within 1 hour of the truck being unloaded. 23. Quality Tech: At the end of the shift, collect the temp log sheets from every door and file them in the QA office. 24. Quality Tech: Keep the filed temp log sheets for 24 months. ## Replaced rules - Dock door open time per truck: was 30 minutes, now 20 minutes (Imre said 30 out of habit; a memo sets 20). - Chilled temperature limit: was 8 C or colder (old wall sheet), now 5 C or colder (changed after the March audit). ## Open questions - Step 14 is unassigned: who books the return pickup with the carrier for rejected pallets. Imre thinks purchasing does, Sunniva in purchasing thinks the dock does, and nobody could say. - Whether the 45 minutes for putaway is different for frozen. Jonas shrugged; the notes do not say.
output/steps.csv · written by the agent, 25 lines
step,owner,action,source_quote 1,Receiving Clerk,Look the delivery up on the day's appointment list and pull the PO.,First thing she does is look the delivery up on the 2,Receiving Clerk,"If the delivery is not on the list, send the driver to wait in the yard and tell the Dock Lead.",If it's not on the list she sends the driver to wait in the yard 3,Receiving Clerk,"Before the doors are opened, read the seal number on the trailer and check it against the seal number on the BOL.",checks it against the seal number on the BOL 4,Receiving Clerk,"If the seal is broken or the number does not match, do not open the doors and call the Dock Lead.","he does not open the doors, he calls the dock lead." 5,Dock Lead,Decide whether to refuse the load.,Imre then decides whether to refuse the load. 6,Dock Lead,Give the truck a door.,He gives the truck a door and he is the only one who signs the BOL. 7,Dock Lead,Time the door on the wall clock and keep it open no more than 20 minutes per truck.,It has been 20 minutes per truck since 8,Receiving Clerk,"As pallets come off, probe 3 cases per pallet: one from the top, one from the middle and one from the bottom layer.","3 cases per pallet: one from the top, one from the middle, one from" 9,Receiving Clerk,Write each reading on the temp log sheet that hangs on the door post.,Writes each reading on the temp log sheet that hangs on the door post. 10,Receiving Clerk,Put a red hold tag on any pallet that reads out of limit: chilled must be 5 C or colder and frozen must be -18 C or colder.,Priya put a red hold tag on it and 11,Forklift Operator,"Move the held pallet to cage Q, the quarantine cage by door 4.",cage Q (the quarantine cage by door 4). She rang Tomas. 12,Receiving Clerk,Call the Quality Tech about the held pallet.,QA only gets called when a reading is out. 13,Quality Tech,"Decide to release or reject the held pallet within 2 hours of the call; the pallet does not leave cage Q until then.","QA has 2 hours from the call to decide, release or reject." 14,unassigned,Send rejected pallets back on the supplier's next truck or a booked return pickup with the carrier; the notes do not say who books the pickup.,Rejected pallets go back on the supplier's next truck or a booked return. 15,Receiving Clerk,"If a pallet is damaged, take 4 photos: the label, the damage up close, the whole pallet and the inside of the trailer.","Marek took 4 photos (the label, the damage up close, the whole" 16,Receiving Clerk,Write the damage on the BOL before the driver leaves.,wrote the damage on the BOL before the driver left. 17,Receiving Clerk,Count the cases on every pallet against the PO line.,Priya counts cases on every pallet against the PO line. 18,Receiving Clerk,"If the difference is 2% or less of the ordered quantity on a PO line, write the difference on the BOL.","2% or less, the receiver writes" 19,Dock Lead,"If the difference is more than 2% of the ordered quantity on a PO line, ring the Purchasing Coordinator before the BOL is signed.",More than 2% of the ordered quantity on a PO line and 20,Dock Lead,Sign the BOL after the count.,"After the count Imre signs, driver leaves." 21,Forklift Operator,"Put accepted pallets in their racking slot within 45 minutes of coming off the truck, chilled and frozen before anything ambient.",accepted pallets have to be in their racking slot within 45 minutes of coming off the truck. 22,Inventory Controller,Key the receipt into the stock system with lot numbers and best before dates within 1 hour of the truck being unloaded.,it has to be in within 1 hour of the truck being unloaded 23,Quality Tech,"At the end of the shift, collect the temp log sheets from every door and file them in the QA office.",End of shift Tomas collects the temp log sheets from every door and files them in the QA office. 24,Quality Tech,Keep the filed temp log sheets for 24 months.,kept for 24 months. An auditor asked for last year's in March
check.py · the check, written before the run
"""Checks the procedure against the notes: quotes are real, owners are real roles, limits are the latest ones."""
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 flat(s):
s = (s or "").lower().replace("’", "'").replace("‘", "'").replace("“", '"').replace("”", '"').replace("*", "").replace("`", "")
return " ".join(s.split())
notes = flat(" ".join(p.read_text() for p in sorted((root/"input").glob("*.md"))))
roles = [r["role"].strip() for r in csv.DictReader((root/"input/roles.csv").open())]
path = root/"output/steps.csv"
if not path.exists():
say(False, "output/steps.csv was not written"); sys.exit(1)
steps = list(csv.DictReader(path.open()))
n = len(steps)
acts = [flat(s.get("action")) for s in steps]; owners = [(s.get("owner") or "").strip() for s in steps]
sop = (root/"output/sop.md").read_text() if (root/"output/sop.md").exists() else ""
sop_lines = [flat(ln) for ln in sop.splitlines()]
numbered = [str(s.get("step", "")).strip() for s in steps] == [str(i) for i in range(1, n + 1)]
in_sop = sum(1 for i in range(n) if any(re.match(rf"{i + 1}[.)]\s+{re.escape(flat(owners[i]))}\s*:", ln) and acts[i] in ln for ln in sop_lines))
say(n >= 8 and numbered and in_sop == n, f"{in_sop} of {n} steps are numbered in order and appear in sop.md with the same owner and wording")
owned = sum(1 for o in owners if o in roles or o == "unassigned")
say(n > 0 and owned == n, f"{owned} of {n} steps have an owner that is a role in roles.csv or is marked unassigned")
quoted = sum(1 for s in steps if len(flat(s.get("source_quote")).strip('"\' ').split()) >= 5 and flat(s.get("source_quote")).strip('"\' ') in notes)
say(n > 0 and quoted == n, f"{quoted} of {n} source quotes appear word for word in the notes")
# The numbered rules a reader can find in the notes. Each one is first confirmed to be in the notes.
limits = [("chilled at 5 C or colder", r"\b5 ?c\b", r"(?<![\d-])5 ?(°|degrees? )?c(elsius)?\b"),
("frozen at -18 C or colder", r"-18 ?c\b", r"(-|minus )18 ?(°|degrees? )?c(elsius)?\b"),
("3 cases probed per pallet", r"3 cases per pallet", r"\b(3|three) cases\b"),
("door open 20 minutes at most", r"20 minutes per truck", r"\b20 minutes\b"),
("hold decision in 2 hours", r"2 hours from the call", r"\b(2|two) hours\b"),
("receipt keyed within 1 hour", r"within 1 hour", r"\b(1|one) hour\b|\b60 minutes\b"),
("putaway within 45 minutes", r"within 45 minutes", r"\b45 minutes\b"),
("count difference over 2%", r"more than 2%", r"\b2 ?(%|percent)"),
("4 photos of damage", r"4 photos", r"\b(4|four) photos\b"),
("log sheets kept 24 months", r"kept for 24 months", r"\b24 months\b|\b(2|two) years\b")]
assert all(re.search(src, notes) for _, src, _ in limits), "a limit in the check is not in the notes"
have = [name for name, _, pat in limits if any(re.search(pat, a) for a in acts)]
say(len(have) == len(limits), f"{len(have)} of {len(limits)} numbered rules from the notes are written into a step")
old = [("8 C for chilled", r"\b8 c or colder", r"(?<![\d-])8 ?(°|degrees? )?c(elsius)?\b"), ("30 minutes for the door", r"no more than 30 minutes", r"\b30 minutes\b")]
assert all(re.search(src, notes) for _, src, _ in old)
stale = sum(1 for a in acts for _, _, pat in old if re.search(pat, a))
say(n > 0 and stale == 0, f"{len(acts) - min(stale, len(acts))} of {n} steps are free of the {len(old)} values the notes later replaced")
def first(pat): return next((i for i, a in enumerate(acts) if re.search(pat, a)), None)
def owner_of(pat, role): return any(re.search(pat, a) and owners[i] == role for i, a in enumerate(acts))
duties = [("seal check", r"\bseal", "Receiving Clerk"), ("temperature probe", r"\bprob(e|es|ing)\b", "Receiving Clerk"),
("hold decision", limits[4][2], "Quality Tech"), ("signing the delivery paper", r"\bsigns?\b", "Dock Lead"),
("putaway", limits[6][2], "Forklift Operator"), ("keying the receipt", limits[5][2], "Inventory Controller"),
("booking return pickups", r"\breturn", "unassigned")]
duty = [name for name, pat, role in duties if owner_of(pat, role)]
say(len(duty) == len(duties), f"{len(duty)} of {len(duties)} key duties sit with the owner the notes name or are unassigned where nobody owns them")
order = [(r"\bseal", r"\bprob(e|es|ing)\b"), (r"\bprob(e|es|ing)\b", limits[6][2]), (limits[7][2], limits[5][2])]
held = sum(1 for a, b in order if first(a) is not None and first(b) is not None and first(a) < first(b))
openq = flat(sop.split("## Open questions")[-1]) if "## Open questions" in sop else ""
say(held == len(order) and "return" in openq, f"{held} of {len(order)} order rules hold (seal before probe, probe before putaway, count before keying) and the return pickup is raised as an open question")
# No number may be written that the notes do not hold. Step numbers and pointers to a step are left aside.
words = "zero one two three four five six seven eight nine ten eleven twelve".split()
num = r"(?<![\w.])\d+(?:\.\d+)?(?![\w.]|:\d)"
said = set(re.findall(num, notes)) | {str(i) for i, w in enumerate(words) if re.search(rf"\b{w}\b", notes)}
seen = wrong = 0; odd = []
for s in sop.splitlines() + [x.get("action") or "" for x in steps]:
s = re.sub(r"^\s*\d+[.)]\s", "", s)
for m in re.finditer(r"\bsteps? (\d+)", s.lower()): # a pointer to a step must hit a real step, and an unassigned one when it says so
seen += 1; k = int(m.group(1))
if not 1 <= k <= n or (re.search(rf"\bstep {k} is unassigned", s.lower()) and owners[k - 1] != "unassigned"): wrong += 1; odd.append("step " + m.group(1))
for x in re.findall(num, re.sub(r"(?i)\bsteps? \d+", " ", s)):
seen += 1
if x not in said: wrong += 1; odd.append(x)
swaps = [("the door time", limits[3][2], old[1][2]), ("the chilled limit", limits[0][2], old[0][2])]
part = sop.split("## Replaced rules")[-1].split("\n## ")[0] if "## Replaced rules" in sop else ""
both = sum(1 for _, new, was in swaps if any(re.search(new, flat(ln)) and re.search(was, flat(ln)) for ln in part.splitlines()))
say(seen > 0 and wrong == 0 and both == len(swaps), f"{seen - wrong} of {seen} numbers in sop.md and the steps are numbers the notes hold and {both} of {len(swaps)} replaced rules give the old value beside the new one" + (": not " + ", ".join(odd[:3]) if odd else ""))
sys.exit(0 if ok else 1)
receiving_notes.md: sample data written by Atris. Fingerprint 5dd3a7a2811a.
roles.csv: sample data written by Atris. Fingerprint 39c56af9e413.
sop.md: written by the agent. Fingerprint 97f1d21d867e.
steps.csv: written by the agent. Fingerprint 28bf2f6d9557.