Rank customer requests from raw feedback.
Done by an agent. Checked twice.
A ranked list of what customers ask for, counted by customer not by message, each with a real quote.
Real files in
- feedback.csv
Four weeks of customer feedback for an invoicing app: 60 items from support, sales calls, surveys, app reviews and cancellation calls. Some accounts write several times and one is spelled three ways.. 61 lines, 8 KB.
Sample data written by Atris. Not a real company.
Three steps
- 1.Read and sort every feedback item
- 2.Count by customer and rank
- 3.Write the result
Claude Sonnet 5.5, 1 min. No web. It never saw the check.
Checked twice
- Passed: 60 of 60 feedback items are placed (52 under a request, 8 set aside) and summary.md states the same counts
- Passed: 12 of 12 requests state the accounts and mentions recounted from their own items
- Passed: 12 of 12 quotes appear word for word in the item they name and run 25 words or fewer
- Passed: 12 of 12 requests sit in rank order: most accounts, then most mentions, then earliest item
- Passed: 22 of 22 pairs of items marked by hand as the same ask share a request
- Passed: 10 of 10 pairs marked by hand as different asks sit under different requests
- Passed: 8 of 8 items marked by hand as asking for nothing are set aside
- Passed: 5 of 5 top requests are restated in summary.md with the name, accounts, mentions and quote that requests.csv holds
- Passed: 1 of 1 requests where one account wrote more than half of 3 or more mentions are named in summary.md with that account and both numbers, recounted from the input
Second review by Claude Opus 5.5: pass.
Then we broke a copy of the output 8 ways on purpose. The check caught 7.
rank,request,accounts,mentions,feedback_ids,quote,quote_id 1,Recurring invoices,7,9,FB-001;FB-007;FB-015;FB-020;FB-028;FB-031;FB-038;FB-044;FB-058,Recurring invoices. I have six retainers that bill the same amount on the 1st of every month.,FB-007 2,Pay invoice by card online,6,7,FB-003;FB-012;FB-020;FB-023;FB-034;FB-045;FB-057,Let customers pay online with a credit card.,FB-012 3,Multiple currencies,6,7,FB-005;FB-021;FB-024;FB-039;FB-048;FB-054;FB-059,"I need to invoice in yen and reais, not only US dollars.",FB-024 4,Automatic overdue reminders,5,5,FB-006;FB-018;FB-035;FB-047;FB-054,Automatic reminders for late payers.,FB-018 5,Custom invoice branding and layout,4,5,FB-008;FB-025;FB-037;FB-043;FB-060,Let me change the invoice layout and add our logo at the top.,FB-037 6,Accounting software sync,3,6,FB-004;FB-009;FB-019;FB-029;FB-041;FB-056,We need our invoices to flow into our accounting software automatically.,FB-004 7,Mobile phone app,3,4,FB-010;FB-026;FB-046;FB-053,Wish there was a real phone app.,FB-046 8,Time tracking to invoice,3,3,FB-013;FB-036;FB-050,Built in time tracking that feeds the invoice would replace two tools for us.,FB-036 9,User roles and limited logins,3,3,FB-017;FB-042;FB-049,Please add a view only user.,FB-017 10,Partial payments and deposits,2,2,FB-014;FB-027,We need to record a partial payment and show the balance left.,FB-027 11,Purchase order number field,2,2,FB-033;FB-051,A purchase order number field on the invoice.,FB-033 12,Dark mode,1,1,FB-030,Needs dark mode.,FB-030
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. Run 1 passed the check but not the second review. 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
- I recounted every request from its feedback_ids. Recurring invoices has 7 accounts and 9 mentions. Card payment has 6 accounts and 7 mentions (Marrow Creek appears twice), and so does multiple currencies (the blank-account FB-005 counts as its own account; Dunlin appears twice). Accounting sync has 3 accounts and 6 mentions, because the three Osprey spellings are one account. All counts match the rows.
- Ranking and tie-breaks are correct. Card payment and currencies are tied at 6/7, and card payment goes first because its lowest id (FB-003) comes before FB-005. Time tracking and user roles are tied at 3/3, and FB-013 comes before FB-017. Partial payments and PO number are tied at 2/2, and FB-014 comes before FB-033.
- All 60 items are accounted for: 52 unique ids in requests.csv (FB-020 and FB-054 are each correctly listed under two requests) plus 8 in no_request.csv, with none in both. The summary header lines show 60/52/8/12.
- All 12 quotes appear word for word in the items they name and are under 25 words. For example, FB-007 reads 'Recurring invoices. I have six retainers that bill the same amount on the 1st of every month.' The only concentration line needed is Osprey writing 4 of the 6 accounting-sync mentions. Mobile app (Harrowgate 2 of 4) is exactly half, so it correctly gets no line.
What this run does not show
- The grouping is tested on 32 pairs of items marked by hand before the run, not on every pair.
- The check does not read the reason given for setting an item aside, so a wrong reason would pass.
- Run 1 failed the second review over a loosely applied summary rule, so this pass is run 2 after 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 7 of 8. 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 reason on row 8 of no_request.csv from Complaint with no ask (dashboard conf... to Outage/login problem report
Open every file
flow.md · the three steps the agent followed
# Rank customer requests from raw feedback function: product for: the product manager who decides what to build next goal: The team sees what customers ask for most, counted by customer and backed by their own words. ## 1. Read and sort every feedback item Read input/feedback.csv. Decide what each item asks the product to do. - A request is one thing a customer wants the product to do that it does not do today. - Praise, a how-to question, a bug or outage report and a complaint with no ask are not requests. Set those aside with a short reason. - An item that asks for two different things belongs to both requests. - Items that ask for the same thing in different words belong to one request. Keep two asks apart when building one would not give the customer the other. ## 2. Count by customer and rank For each request count two numbers: - accounts: how many different accounts asked. An account that writes five times counts once. Names that differ only by letter case, punctuation or an ending such as Inc, LLC or Ltd are one account. An item with a blank account counts as one account of its own. - mentions: how many feedback items ask for it. Rank the requests: most accounts first, then most mentions, then the request whose lowest feedback_id comes first. Ranks run 1, 2, 3 with no ties. Pick one quote for each request: a run of words copied exactly from one of its items, at most 25 words, with nothing added, dropped or changed. ## 3. Write the result Write output/requests.csv with columns rank,request,accounts,mentions,feedback_ids,quote,quote_id. One row per request in rank order. request is a short plain name. feedback_ids lists every item in the request, separated by `;`. quote_id is the feedback_id the quote came from. Write output/no_request.csv with columns feedback_id,reason, one row per item set aside. Write output/summary.md. Start with these four lines, each with its number: `Feedback items read: `, `Items with a request: `, `Items with no request: `, `Requests found: `. Then the top five requests, one line each, with accounts, mentions and the quote. Then check every request that has 3 or more mentions: when one account wrote more than half of them, add a line that names the request and the account and gives both numbers. Requests with 1 or 2 mentions get no such line. ## Done looks like - Every feedback item is in requests.csv or in no_request.csv, never in both. - Every count can be worked out again from the feedback_ids on its row. - Every quote can be found word for word in the item it names.
input/feedback.csv · 61 lines, 8 KB
feedback_id,date,channel,account,plan,text FB-001,2026-11-02,support,Brightwell Dental,team,We bill the same 40 patients on plans every month. Please let us set an invoice to repeat monthly so we stop copying it by hand. FB-002,2026-11-02,survey,Kettle & Pine Studio,free,Love how fast I can make an invoice. Nothing to add right now. FB-003,2026-11-02,sales_call,Marrow Creek Landscaping,business,Their clients want to pay by card straight from the invoice. Today they mail checks. Asked if we have a pay button. FB-004,2026-11-03,support,Osprey Legal Group,business,We need our invoices to flow into our accounting software automatically. Typing them in twice is killing us. FB-005,2026-11-03,app_review,,free,Good app but I invoice clients in euros and pounds and it only does dollars. Need other currencies. FB-006,2026-11-03,support,Tindall Bikes,team,Can the app chase unpaid invoices for me? An automatic reminder a week after the due date would save me awkward emails. FB-007,2026-11-04,survey,Fennick Consulting,team,Recurring invoices. I have six retainers that bill the same amount on the 1st of every month. FB-008,2026-11-04,support,Glasswing Media,business,I want to put my logo and brand colors on the invoice. The default template looks generic. FB-009,2026-11-04,support,Osprey Legal Group LLC,business,Following up on my earlier ticket. Any date for sending invoices to the accounting system without retyping? FB-010,2026-11-05,sales_call,Harrowgate Plumbing,team,Techs are in vans all day. They want to create and send an invoice from a phone app before leaving the job. FB-011,2026-11-05,support,Lowen & Daughters Bakery,free,How do I change my password? FB-012,2026-11-05,survey,Quillfeather Books,team,Let customers pay online with a credit card. A pay now link on the invoice email would get us paid faster. FB-013,2026-11-06,support,Saltmarsh Surveyors,business,We track hours per project in a spreadsheet and then retype them. Let us log time in the app and turn the hours into an invoice. FB-014,2026-11-06,churn_call,Thistledown Events,team,Cancelled because they take a 30 percent deposit up front and the app cannot record a part payment against an invoice. FB-015,2026-11-06,support,Brightwell Dental,team,Is there any way to schedule an invoice to go out by itself each month? Asking again as the month end is close. FB-016,2026-11-09,app_review,,free,Five stars. Simple and clean. FB-017,2026-11-09,support,Umberfield Architects,business,Our bookkeeper needs to see invoices but should not be able to edit or send them. Please add a view only user. FB-018,2026-11-09,survey,Varnish & Vine,team,Automatic reminders for late payers. I forget to follow up and it costs me. FB-019,2026-11-09,support,Osprey Legal Group,business,Third request: accounting sync. We export a file every Friday and fix it by hand before loading it into the accounting system. FB-020,2026-11-10,sales_call,Wexcombe Tutors,team,Parents pay monthly. They asked for invoices that repeat on a schedule and for card payment on the invoice so parents can pay in one tap. FB-021,2026-11-10,support,Yarrowby Farm Supply,business,We sell to Canada. Need invoices in Canadian dollars with the right symbol and totals. FB-022,2026-11-10,support,Zennor Yoga,free,The invoice PDF came out blank this morning. Worked again an hour later. FB-023,2026-11-11,survey,Calloway Print Shop,team,Card payments. Half my customers ask where to enter their card. FB-024,2026-11-11,support,Dunlin Translation,team,"I work with agencies in Japan and Brazil. I need to invoice in yen and reais, not only US dollars." FB-025,2026-11-11,support,Glasswing Media,business,Custom invoice design please. At least let me move the logo and pick a font. FB-026,2026-11-12,sales_call,Embleton Roofing,team,Wants a phone app to build invoices on site. Said the website is too fiddly on a small screen with gloves on. FB-027,2026-11-12,support,Pellam Tax Partners,business,Clients keep asking to pay part now and the rest later. We need to record a partial payment and show the balance left. FB-028,2026-11-12,survey,Fennick Consulting,team,Still waiting on repeating invoices for retainers. FB-029,2026-11-13,support,osprey legal group,business,Can you at least tell us if the accounting integration is planned? We are evaluating other tools. FB-030,2026-11-13,app_review,,free,Needs dark mode. The white screen is harsh at night. FB-031,2026-11-13,support,Marrow Creek Landscaping,business,Seasonal contracts bill the same amount every month from April to October. A recurring invoice would handle that. FB-032,2026-11-16,support,Tindall Bikes,team,Thanks for fixing the tax rounding issue so quickly. FB-033,2026-11-16,survey,Saltmarsh Surveyors,business,A purchase order number field on the invoice. Our council clients reject invoices without one. FB-034,2026-11-16,sales_call,Kettle & Pine Studio,free,Would upgrade if clients could pay the invoice online by card. FB-035,2026-11-16,support,Harrowgate Plumbing,team,Payment reminders that send themselves when an invoice is overdue. We have 60 open invoices and no time to chase. FB-036,2026-11-17,support,Umberfield Architects,business,We bill hourly. Built in time tracking that feeds the invoice would replace two tools for us. FB-037,2026-11-17,survey,Quillfeather Books,team,Let me change the invoice layout and add our logo at the top. FB-038,2026-11-17,support,Lowen & Daughters Bakery,free,Wholesale orders are the same every week. Could an invoice repeat weekly without me recreating it? FB-039,2026-11-18,churn_call,Dunlin Translation,team,Left for another tool mainly because we cannot invoice in other currencies. Also mentioned the price. FB-040,2026-11-18,support,Calloway Print Shop,team,Is the app down? I cannot log in. FB-041,2026-11-18,support,Pellam Tax Partners,business,Our accounting package needs the invoices. Is there a sync or do we keep exporting by hand? FB-042,2026-11-19,sales_call,Yarrowby Farm Supply,business,Asked for two logins with different rights: the owner can do everything and the office clerk can only create drafts. FB-043,2026-11-19,survey,Varnish & Vine,team,Brand the invoice. Colors and logo. FB-044,2026-11-19,support,Zennor Yoga,free,Students pay monthly memberships. Please add invoices that renew and send on their own each month. FB-045,2026-11-20,support,Embleton Roofing,team,Customers want to pay with a card as soon as the job is done. Add a card payment option to the invoice. FB-046,2026-11-20,app_review,,free,Wish there was a real phone app. I do everything from my phone. FB-047,2026-11-20,support,Brightwell Dental,team,Insurers pay late every time. Could the system send a polite reminder on its own when an invoice is 14 days overdue? FB-048,2026-11-23,survey,Glasswing Media,business,We invoice clients in the UK and the EU. Multi currency is the one thing we miss. FB-049,2026-11-23,support,Wexcombe Tutors,team,We have three tutors who send their own invoices. Each needs their own login with limits on what they can see. FB-050,2026-11-23,support,Tindall Bikes,team,Workshop jobs are billed by the hour. Let mechanics clock time on a job and add it to the invoice. FB-051,2026-11-24,sales_call,Calloway Print Shop,team,Big customers send a purchase order and want its number printed on our invoice. No field for it today. FB-052,2026-11-24,support,Osprey Legal Group,business,Your new dashboard is confusing. FB-053,2026-11-24,survey,Harrowgate Plumbing,team,"An app for the phone, please. The techs will not carry laptops." FB-054,2026-11-25,support,Fennick Consulting,team,"Two asks. First, automatic overdue reminders. Second, let me bill in Swiss francs for one client." FB-055,2026-11-25,support,Quillfeather Books,team,"The search box on the invoice list is great, found a 2024 invoice in seconds." FB-056,2026-11-25,sales_call,Saltmarsh Surveyors,business,They push invoices into their accounting system by hand each month and want that connected. FB-057,2026-11-26,support,Marrow Creek Landscaping,business,Any news on card payments? Two clients asked again this week. FB-058,2026-11-26,survey,Pellam Tax Partners,business,Recurring invoices for our monthly bookkeeping clients. FB-059,2026-11-27,support,Umberfield Architects,business,Invoices in euros for our Dublin office. FB-060,2026-11-27,support,Kettle & Pine Studio,free,Please let me upload my own logo to the invoice.
output/no_request.csv · written by the agent, 9 lines
feedback_id,reason FB-002,"Praise, no ask" FB-011,How-to question (password change) FB-016,"Praise, no ask" FB-022,Bug report (blank PDF) FB-032,"Thanks for a fix, no ask" FB-040,Outage/login problem report FB-052,Complaint with no ask (dashboard confusing) FB-055,"Praise, no ask"
output/requests.csv · written by the agent, 13 lines
rank,request,accounts,mentions,feedback_ids,quote,quote_id 1,Recurring invoices,7,9,FB-001;FB-007;FB-015;FB-020;FB-028;FB-031;FB-038;FB-044;FB-058,Recurring invoices. I have six retainers that bill the same amount on the 1st of every month.,FB-007 2,Pay invoice by card online,6,7,FB-003;FB-012;FB-020;FB-023;FB-034;FB-045;FB-057,Let customers pay online with a credit card.,FB-012 3,Multiple currencies,6,7,FB-005;FB-021;FB-024;FB-039;FB-048;FB-054;FB-059,"I need to invoice in yen and reais, not only US dollars.",FB-024 4,Automatic overdue reminders,5,5,FB-006;FB-018;FB-035;FB-047;FB-054,Automatic reminders for late payers.,FB-018 5,Custom invoice branding and layout,4,5,FB-008;FB-025;FB-037;FB-043;FB-060,Let me change the invoice layout and add our logo at the top.,FB-037 6,Accounting software sync,3,6,FB-004;FB-009;FB-019;FB-029;FB-041;FB-056,We need our invoices to flow into our accounting software automatically.,FB-004 7,Mobile phone app,3,4,FB-010;FB-026;FB-046;FB-053,Wish there was a real phone app.,FB-046 8,Time tracking to invoice,3,3,FB-013;FB-036;FB-050,Built in time tracking that feeds the invoice would replace two tools for us.,FB-036 9,User roles and limited logins,3,3,FB-017;FB-042;FB-049,Please add a view only user.,FB-017 10,Partial payments and deposits,2,2,FB-014;FB-027,We need to record a partial payment and show the balance left.,FB-027 11,Purchase order number field,2,2,FB-033;FB-051,A purchase order number field on the invoice.,FB-033 12,Dark mode,1,1,FB-030,Needs dark mode.,FB-030
output/summary.md · written by the agent, 15 lines
Feedback items read: 60 Items with a request: 52 Items with no request: 8 Requests found: 12 Top five requests: 1. Recurring invoices - 7 accounts, 9 mentions - "Recurring invoices. I have six retainers that bill the same amount on the 1st of every month." (FB-007) 2. Pay invoice by card online - 6 accounts, 7 mentions - "Let customers pay online with a credit card." (FB-012) 3. Multiple currencies - 6 accounts, 7 mentions - "I need to invoice in yen and reais, not only US dollars." (FB-024) 4. Automatic overdue reminders - 5 accounts, 5 mentions - "Automatic reminders for late payers." (FB-018) 5. Custom invoice branding and layout - 4 accounts, 5 mentions - "Let me change the invoice layout and add our logo at the top." (FB-037) Concentration: Accounting software sync - Osprey Legal Group wrote 4 of 6 mentions (more than half). Notes: FB-020 counts in both Recurring invoices and Pay invoice by card; FB-054 in both Automatic overdue reminders and Multiple currencies. FB-005 has a blank account and counts as its own account. The three Osprey Legal Group spellings are one account. Weekly repeat (FB-038) is grouped with recurring invoices.
check.py · the check, written before the run
"""Recounts every request from its own items, looks up every quote, and tests the grouping on hand-marked pairs."""
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)
items = {r["feedback_id"]: r for r in csv.DictReader((root/"input/feedback.csv").open())}
def account(fid):
name = re.sub(r"[^a-z0-9& ]", "", items[fid]["account"].lower())
name = re.sub(r"\s+(inc|llc|ltd|co|corp)$", "", " ".join(name.split()))
return name or "blank " + fid
def num(fid): return int(fid.split("-")[1])
fb = lambda n: f"FB-{n:03d}"
# Marked by hand before the run. SAME: two items that ask for the same thing. DIFFERENT: two that do not.
SAME = [(1, 7), (31, 44), (7, 58), (3, 12), (23, 45), (34, 57), (21, 24), (48, 59), (4, 41), (19, 56), (6, 18),
(35, 47), (8, 43), (37, 60), (10, 53), (13, 36), (14, 27), (33, 51), (20, 1), (20, 3), (54, 6), (54, 21)]
DIFFERENT = [(1, 6), (3, 14), (27, 45), (4, 13), (10, 30), (17, 36), (21, 33), (12, 18), (31, 35), (5, 46)]
NOTHING = [2, 11, 16, 22, 32, 40, 52, 55]
rp, npth = root/"output/requests.csv", root/"output/no_request.csv"
if not rp.exists() or not npth.exists():
say(False, "output/requests.csv and output/no_request.csv were not both written"); sys.exit(1)
reqs = list(csv.DictReader(rp.open()))
aside = {(r.get("feedback_id") or "").strip() for r in csv.DictReader(npth.open())}
member = {}
for i, r in enumerate(reqs):
r["ids"] = [x.strip() for x in (r.get("feedback_ids") or "").split(";") if x.strip()]
for x in r["ids"]: member.setdefault(x, set()).add(i)
placed = sum(1 for f in items if (f in member) != (f in aside))
unknown = (set(member) | aside) - set(items)
summary = (root/"output/summary.md").read_text() if (root/"output/summary.md").exists() else ""
want = {"Feedback items read": len(items), "Items with a request": len(set(member) & set(items)),
"Items with no request": len(aside & set(items)), "Requests found": len(reqs)}
stated = all(re.search(re.escape(k) + r":\D{0,4}" + str(v) + r"\b", summary) for k, v in want.items())
say(placed == len(items) and not unknown and stated,
f"{placed} of {len(items)} feedback items are placed ({want['Items with a request']} under a request, {want['Items with no request']} set aside) and summary.md states the same counts")
def intval(s):
try: return int(str(s).strip())
except ValueError: return None
counted = sum(1 for r in reqs if r["ids"] and all(x in items for x in r["ids"]) and len(set(r["ids"])) == len(r["ids"])
and intval(r.get("accounts")) == len({account(x) for x in r["ids"]}) and intval(r.get("mentions")) == len(r["ids"]))
say(bool(reqs) and counted == len(reqs), f"{counted} of {len(reqs)} requests state the accounts and mentions recounted from their own items")
def quote_ok(r):
q, qid = " ".join((r.get("quote") or "").split()).strip("\"' "), (r.get("quote_id") or "").strip()
return bool(q) and qid in r["ids"] and qid in items and q in " ".join(items[qid]["text"].split()) and 3 <= len(q.split()) <= 25
quoted = sum(1 for r in reqs if quote_ok(r))
say(bool(reqs) and quoted == len(reqs), f"{quoted} of {len(reqs)} quotes appear word for word in the item they name and run 25 words or fewer")
def rank_key(r):
known = [x for x in r["ids"] if x in items]
return (-len({account(x) for x in known}), -len(known), min([num(x) for x in known] or [10**6]))
in_order = sum(1 for i, r in enumerate(reqs) if intval(r.get("rank")) == i + 1 and (i == 0 or rank_key(reqs[i - 1]) <= rank_key(r)))
say(bool(reqs) and in_order == len(reqs), f"{in_order} of {len(reqs)} requests sit in rank order: most accounts, then most mentions, then earliest item")
share = lambda a, b: bool(member.get(fb(a), set()) & member.get(fb(b), set()))
same = sum(1 for a, b in SAME if share(a, b))
say(same == len(SAME), f"{same} of {len(SAME)} pairs of items marked by hand as the same ask share a request")
apart = sum(1 for a, b in DIFFERENT if fb(a) in member and fb(b) in member and not share(a, b))
say(apart == len(DIFFERENT), f"{apart} of {len(DIFFERENT)} pairs marked by hand as different asks sit under different requests")
none = sum(1 for n in NOTHING if fb(n) in aside)
say(none == len(NOTHING), f"{none} of {len(NOTHING)} items marked by hand as asking for nothing are set aside")
# Stricter lines added after the run: the write-up is compared with the table and the mentions are recounted by account.
flat = lambda s: " ".join((s or "").split())
slines = [flat(l) for l in summary.splitlines() if l.strip()]
def has_count(line, n, word):
return bool(re.search(rf"\b{n}\s+{word}s?\b|\b{word}s?\W{{0,3}}{n}\b", line, re.I))
def top_ok(r):
name, q = flat(r.get("request")), flat(r.get("quote")).strip("\"' ")
return any(name and name in l and q and q in l and has_count(l, intval(r.get("accounts")), "account")
and has_count(l, intval(r.get("mentions")), "mention") for l in slines)
top = reqs[:5]
shown = sum(1 for r in top if top_ok(r))
say(bool(top) and shown == len(top), f"{shown} of {len(top)} top requests are restated in summary.md with the name, accounts, mentions and quote that requests.csv holds")
plain = lambda s: " ".join(re.sub(r"[^a-z0-9& ]", "", s.lower()).split())
heavy = []
for r in reqs:
known = [x for x in r["ids"] if x in items]
if len(known) < 3: continue
per = {}
for x in known: per[account(x)] = per.get(account(x), 0) + 1
who, most = max(per.items(), key=lambda kv: kv[1])
if most * 2 > len(known): heavy.append((flat(r.get("request")), who, most, len(known)))
def heavy_ok(name, who, most, n):
return any(name in l and who in plain(l) and re.search(rf"\b{most}\b", l) and re.search(rf"\b{n}\b", l) for l in slines)
flagged = sum(1 for h in heavy if heavy_ok(*h))
if heavy:
say(flagged == len(heavy), f"{flagged} of {len(heavy)} requests where one account wrote more than half of 3 or more mentions are named in summary.md with that account and both numbers, recounted from the input")
else:
say(True, "no request with 3 or more mentions has one account behind more than half of them, recounted from the input")
sys.exit(0 if ok else 1)
feedback.csv: sample data written by Atris. Fingerprint f736d9b06014.
no_request.csv: written by the agent. Fingerprint 0cfbd2086119.
requests.csv: written by the agent. Fingerprint 95c68392dbe9.
summary.md: written by the agent. Fingerprint c6b3ef939fdf.