Write a price increase notice and match it to the price table
Have an AI draft a price increase email for eight items, then check every amount, increase rate and date in it against the price table with a script.
An AI draft of the price increase email is in, and now someone has to check by hand how each increase was rounded to one decimal place, and whether milk really takes effect on December 16 - for eight items. The example is an invented food-ingredient supplier's price table: eight items, two effective dates, and one item whose price stays the same. A short request and a structured request (price table, reasons, calculation rules) were compared with the same checker.
[1] The input is a CSV price table. The short prompt is the table plus one line.
Write a price increase notice email to our customers using the price table below. The reasons are rising raw material prices and higher shipping costs. Item,Pack,Current price (USD),New price (USD),Effective dateAll-purpose flour,20 kg,24.50,26.90,2026-12-01Sugar,15 kg,31.20,33.00,2026-12-01Cooking oil,18 L,48.90,52.80,2026-12-01Butter,454 g,8.70,9.40,2026-12-01Eggs (large),30 count,7.30,7.30,2026-12-01Milk,1 L,2.65,2.79,2026-12-16Whipping cream,1 L,9.90,10.60,2026-12-16Mixed nuts,1 kg,18.40,19.90,2026-12-16The structured prompt follows the goal, context, source (the material to use) and expectation (how to answer) structure from Microsoft's Copilot prompt guide. Following the Gemini prompting advice not to assume the model has the information it needs, it also states the send date and a memo of reasons, and it fixes the increase formula and the rounding place as rules.
[Goal]Write an email that notifies customers of a price adjustment. [Context]I am a sales manager at a food-ingredient supplier and the recipients are store managers we already supply. The email goes out on 2026-11-10.Give only the reasons in this memo and do not invent others: rising raw material prices for wheat and fats, and higher shipping costs. [Price table]Item,Pack,Current price (USD),New price (USD),Effective dateAll-purpose flour,20 kg,24.50,26.90,2026-12-01Sugar,15 kg,31.20,33.00,2026-12-01Cooking oil,18 L,48.90,52.80,2026-12-01Butter,454 g,8.70,9.40,2026-12-01Eggs (large),30 count,7.30,7.30,2026-12-01Milk,1 L,2.65,2.79,2026-12-16Whipping cream,1 L,9.90,10.60,2026-12-16Mixed nuts,1 kg,18.40,19.90,2026-12-16 [Rules]1. Use only amounts, dates and item names that appear in the price table. Do not create numbers that are not in it, such as a total or an average increase.2. Copy all 8 items into a table (Item, Pack, Current price, New price, Increase, Effective date).3. Calculate each increase as (new price - current price) / current price x 100, round to one decimal place, and write it like "9.8%". If the new price equals the current price, write "unchanged".4. Do not mix up the effective dates; copy the effective date column exactly from the price table. [Expected output]One subject line and the body. Write the body in a polite, plain business tone, about 120 words not counting the table, and end with the signature "Sales Team".[2] Both prompts were run twice in English and twice in Korean. The short prompt ran 4 times on Gemini, and the same prompt and the structured prompt ran 4 times each on Claude. This is the line for a structured run on Claude.
$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config < run/p2.en.prompt.txt > run/p2.en.2.out.txt…| Item | Pack | Current price (USD) | New price (USD) | Increase | Effective date ||---|---|---|---|---|---|| All-purpose flour | 20 kg | 24.50 | 26.90 | 9.8% | 2026-12-01 || Sugar | 15 kg | 31.20 | 33.00 | 5.8% | 2026-12-01 || Cooking oil | 18 L | 48.90 | 52.80 | 8.0% | 2026-12-01 || Butter | 454 g | 8.70 | 9.40 | 8.0% | 2026-12-01 || Eggs (large) | 30 count | 7.30 | 7.30 | unchanged | 2026-12-01 || Milk | 1 L | 2.65 | 2.79 | 5.3% | 2026-12-16 || Whipping cream | 1 L | 9.90 | 10.60 | 7.1% | 2026-12-16 || Mixed nuts | 1 kg | 18.40 | 19.90 | 8.2% | 2026-12-16 |…[3] Instead of matching numbers by eye, run/notice_check_en.py compares the email with the price table. For each item row it checks that the current price, new price and effective date are there and right; if an increase rate is written, that it equals (new - current) / current x 100 rounded to one decimal place (a .05 rounds up); and that an item with the same price is marked unchanged and has no rate. A number or a Month D date in a sentence outside the table must be in the price table or the prompt, or be calculated from them. For an email whose tables are split under headings by effective date, the date in the heading is used. The part that looks at rows and sentences:
…for name, pack, cur, new, day in rows: cur, new, rt = num(cur), num(new), rate(num(cur), num(new)) prices |= {cur, new} line = next((l for l in mail.splitlines() if name.lower() in l.lower() and len(NUM.findall(l)) >= 3), None) # first line holding the item name and at least 3 numbers if line is None: fails.append((name, M["no_row"].format(name))); continue table_lines.append(line) toks = [num(t) for t in NUM.findall(line)] bad = [M["cur"]] * (cur not in toks) + [M["new"]] * (new not in toks) if rt == 0: has_flat = re.search(r"unchanged|no change|held|frozen|(?<![\d.])0(?:\.0)?\s*%", line, re.I) nonzero = [x for x in re.findall(r"(\d+(?:\.\d+)?)\s*%", line) if Decimal(x) != 0] bad += [M["flat"]] * (not has_flat or bool(nonzero)) elif "%" in line and rt not in toks: bad.append(M["rate"].format(rt)) elif "%" not in line: warns.append(M["norate"].format(name)) has_any = any(f in line for r in rows for f in date_forms(r[4])) if not (any(f in line for f in date_forms(day)) or (not has_any and heading_has(lines.index(line), date_forms(day)))): bad.append(M["date"].format(day)) other = set(re.findall(r"\d{4}-\d{2}-\d{2}", line)) - {day} if other: bad.append(M["other"].format(sorted(other))) if bad: fails.append((name, M["wrong"].format(name, ", ".join(bad))))…for l in mail.splitlines(): if l in table_lines: continue for t in NUM.findall(re.sub(r"^[\s#>*-]*\d+[.)]\s", "", l)): # a leading list number such as '2.' is not counted if num(t) not in allowed: fails.append(("-", M["stray"].format(t, l.strip()[:40])))md = [(int(d[5:7]), int(d[8:])) for d in {r[4] for r in rows} | set(re.findall(r"\d{4}-\d{2}-\d{2}", prompt))] # allowed (month, day) pairsMD = re.compile(r"(" + "|".join(m[:3] for m in MONTHS) + r")[a-z]*\.?\s+(\d{1,2})(?!\d)")for l in lines: if l in table_lines: continue for m in MD.finditer(l): pair = ([i + 1 for i, x in enumerate(MONTHS) if x.startswith(m[1])][0], int(m[2])) if pair not in md: fails.append(("-", M["baddate"].format(m[0], l.strip()[:40])))…$ python run/notice_check_en.py run/price_table.en.csv run/p2.en.prompt.txt run/p2.en.2.out.txtitems right 8/8 · FAIL 0 · WARN 0The short prompt on Claude, English run 1, had a right table except for one row.
$ python run/notice_check_en.py run/price_table.en.csv run/p1.en.prompt.txt run/p1.en.1.out.txtFAIL Eggs (large): effective date 2026-12-01 missing or wrongWARN All-purpose flour: no increase rate writtenWARN Sugar: no increase rate writtenWARN Cooking oil: no increase rate writtenWARN Butter: no increase rate writtenWARN Milk: no increase rate writtenWARN Whipping cream: no increase rate writtenWARN Mixed nuts: no increase rate writtenitems right 7/8 · FAIL 1 · WARN 7[4] To test the checker, a passing email was copied eight times with exactly one defect each (two digits of the new price swapped, an increase rate one tenth off, 7.975 truncated to 7.9 instead of rounded, milk given the wrong effective date, a +1.0% on the unchanged item, one item missing, an average increase that is not in the table, an invented cut-off date), using run/make_faults.py. All eight returned FAIL (these are not model output). The first version of the checker missed two of them. The +1.0% on the unchanged item slipped through because it contains the characters "0%", and "November 20" slipped through because 20 appears in the pack size "20 kg". The fix rejects any non-zero percent on an unchanged item and compares dates as (month, day) pairs. One example:
$ python run/notice_check_en.py run/price_table.en.csv run/p2.en.prompt.txt run/fault_en_round.txtFAIL Cooking oil: increase 8.0% missing or wrongitems right 7/8 · FAIL 1 · WARN 0[5] Results for the 6 English runs. g1 is the short prompt on Gemini, p1 the same prompt on Claude, p2 the structured prompt on Claude.
$ python run/summary.py eng1.en.1.out.txt: items right 8/8 · FAIL 0 · WARN 7g1.en.2.out.txt: items right 8/8 · FAIL 0 · WARN 7p1.en.1.out.txt: items right 7/8 · FAIL 1 · WARN 7p1.en.2.out.txt: items right 8/8 · FAIL 0 · WARN 7p2.en.1.out.txt: items right 8/8 · FAIL 0 · WARN 0p2.en.2.out.txt: items right 8/8 · FAIL 0 · WARN 0- The calculated increase rates were never wrong. In the 8 runs that wrote rates in the table (6 Korean, 2 English
p2), all 56 rates (7 changed items each) equalled the rounded value. The boundary case, cooking oil at 7.975 rounding up to 8.0, was right in all 8 (run/count_rates.py). - The short prompt leaked outside the table. 4 of its 8 runs (3 Korean, 1 English) got a FAIL. A Korean Gemini run wrote a month that is not in the price table, another invented order cut-off dates (November 30 and December 15), and a Korean Claude run added a note about "today, 2026-10-23" and "about 5 to 7 weeks". In the English Claude run above, the Eggs row has
N/Afor its effective date. The 4 structured runs had 0 FAIL. - The short English prompt never wrote increase rates. All 4 runs have no rate column, so each gets 7 WARNs. Nothing was asked for, so it is not an error, but it leaves out the first number a customer looks for.
- The sentences with no numbers were the largest group. Reading the 12 emails by hand for terms or promises that are not in the memo ("orders placed and confirmed before each effective date will be honored at the current price", "we will review the price again") found them in all 8 short-prompt runs and in 1 of the 4 structured runs (English run 2, where the model itself said it was an assumption). The checker lets them pass because they carry no numbers.
Two things this does not settle: whether the terms in the email (the cut-off for the old price, how pre-orders are handled, any notice period in the contract) match your agreement is for a person to check, and information that is not in the price table, such as whether prices include tax, should go into the prompt first.