Fix the overstatement check for a design doc
Your task
You used an AI to draft a design doc for an order pipeline. It says the design "guarantees exactly-once processing", "scales linearly" and "has no single point of failure", and it has no limitations section. Before design review, your team runs a check that flags every absolute claim with nothing behind it.
An assistant wrote flag_overstated_claims(doc_lines). It is in the editor. It has a bug. Find it and fix it.
Input and output:
doc_lines: the doc's lines. Each is written<claim>|<evidence>, where the evidence names what backs the claim, like a load test. The evidence can be empty, and a line can have no|at all.- Return the findings as strings, in document order.
Rules the tests check:
- Split a line at its first
|. The claim is the text before it and the evidence is the text after it. With no|, the whole line is the claim and the evidence is empty. - Trim whitespace (spaces, tabs, newlines) from both ends of the claim and of the evidence.
- A claim is absolute when its lowercased text contains any of these terms:
exactly-once,linearly,no single point of failure,guarantees,unlimited,always,never,infinite,zero downtime,100%. A term counts anywhere, even inside a longer word. - Flag an absolute claim when its trimmed evidence is empty. The finding is the trimmed claim. A line is flagged once even with several terms, and a repeated line is flagged each time.
- The doc has a limitations section when any trimmed, lowercased claim contains
limitationsornon-goals. That line can be flagged too. - If the doc has no limitations section, add
"missing: limitations section"as the last finding.
Examples
flag_overstated_claims(doc_lines: list[str]) -> list[str]Example 1
Input
flag_overstated_claims(["The pipeline guarantees exactly-once processing.|", "Latency budget is 200ms per event.|see load test 2026-03"])Output
["The pipeline guarantees exactly-once processing.", "missing: limitations section"]Example 2
Input
flag_overstated_claims(["Non-goals: cross-region failover is out of scope.|", "Throughput scales linearly with partitions.|benchmark: 4 brokers, 12k events per second"])Output
[]