GrepBoard/Manuals
605 manuals ·

Check dates, weekdays and missing details in an AI-written notice

·Tested on Gemini 3.8 Flash · 2026-10·Test scope ↓·7 steps

Write an elevator notice with Gemini, recompute each date's weekday from the calendar, and check the six required items and the memo's values by script.

A draft notice says "Thursday, Nov 14". In 2026, November 14 is a Saturday. Staff would plan around a day that is off by two. Below, Gemini writes an elevator-maintenance notice and a short script recomputes the weekday of every date in it.

One thing first: in this test Gemini never got a weekday wrong. The same memo was run 18 times under three conditions and every run was right. The check is still worth keeping, for two reasons. Without it you have to open a calendar every time to know the notice is right, and turning a relative phrase like "Monday of next week" into a date was something a one-line request actually skipped (in the Korean runs).

[1] Put the facts in a memo file. Two dates, one of them relative ("Monday of next week").

memo.en.txt
Building: Main office, Tower AWork 1: Monday of next week, 18:00-21:00, elevators 1 and 2 out of serviceWork 2: Nov 12, 09:00-12:00, elevators 3 and 4 out of serviceAffected: staff on floors 3-7Impact: during the work the listed elevators cannot be used, so moving between floors 3-7 is inconvenientAlternative: cross the 2nd-floor link bridge to Tower B and use its elevators; stairs are marked with exit signsContact: Facilities Team, ext. 4120 (chat channel #facilities-help)

[2] Write the prompt. Google's prompt-writing guide builds a prompt from persona, task, context and format, and says you do not need all four. Here the persona is one phrase (the general affairs desk), the context is "staff will plan from this notice", and the format is a date style plus six named items. The Gemini API guide says to state constraints on the response, hence the line that forbids invented values.

tail.en.txt
Today is October 21, 2026. As the general affairs desk, write an internal notice using only the facts in <memo>. Staff will plan their days from this notice, so dates and weekdays must not be wrong. Rules:- Write every date as `Thursday, Oct 29` (weekday, month, day). Work out the weekday from the 2026 calendar. Turn relative expressions such as "Monday of next week" into dates.- Copy times, elevator numbers, floors, team names and extension numbers exactly as written in the memo.- Include all six items: When, Where, Who is affected, Impact, Alternative route, Contact. Put the item name in front of each.- Do not invent dates, numbers or contact details that are not in the memo.- Output the notice only, with no explanation.

[3] Wrap the memo in <memo>, add the instructions after it and run. The agy CLI can read files in its working folder, so the runs were made from an empty folder.

console
$ (echo "<memo>"; cat memo.en.txt; echo "</memo>"; cat tail.en.txt) > prompt.en.txt$ agy -p "$(cat prompt.en.txt)" --model gemini-3.8-flash --effort high --output-format text > out.en.1.txt$ cat out.en.1.txtWhen: Work 1: Monday, Oct 26, 18:00-21:00, elevators 1 and 2 out of serviceWork 2: Thursday, Nov 12, 09:00-12:00, elevators 3 and 4 out of serviceWhere: Main office, Tower AWho is affected: staff on floors 3-7Impact: during the work the listed elevators cannot be used, so moving between floors 3-7 is inconvenientAlternative route: cross the 2nd-floor link bridge to Tower B and use its elevators; stairs are marked with exit signsContact: Facilities Team, ext. 4120 (chat channel #facilities-help)

"Monday of next week" became Monday, Oct 26, and November 12 got Thursday. Both are correct. But that is only me looking at a calendar, and the next notice needs the same look. The script does that.

[4] The checking script finds every date, computes its 2026 weekday with Python's datetime and compares it with the one written. It also checks: dates with no weekday, dates that are not in the memo, whether each date's own line holds that date's time and elevators, whether each memo value (times, elevator numbers, floors, team, extension) appears as many times as in the memo, and whether the six items start a line.

check.py (excerpt)
...  (date patterns, expected dates, memo values: see run/check.py)fail, seen = [], set()dates = list(pat.finditer(text))if not dates:    fail.append("no dates found")for m in dates:    mo, d, wd = found(m)    seen.add((mo, d))    try:        real = datetime.date(YEAR, mo, d).weekday()    except ValueError:        fail.append(f"{mo}/{d}: not a real date"); continue    realname = WD[real]    if wd is None:        fail.append(f"{mo}/{d}: no weekday written (calendar says {realname})")    elif wd != realname:        fail.append(f"{mo}/{d}: written {wd}, calendar says {realname}")NL = chr(10)# each date must sit on the same line as its own time and elevators (swapped slots must not pass)for (mo, d), (tm, el) in zip(sorted(EXPECT), SLOTS):    for m in dates:        if found(m)[:2] == (mo, d):            ls, le = text.rfind(NL, 0, m.start()) + 1, text.find(NL, m.end())            line = text[ls:le if le != -1 else len(text)]            if tm not in line or el not in line:                fail.append(f"{mo}/{d}: its line lacks its own time/elevators ({tm}, {el})")...memo = open(f"memo.{lang}.txt", encoding="utf-8").read()for k in KEEP:                                            # as many times as the memo has it, so one intact copy cannot hide a changed one    if text.count(k) < memo.count(k):        fail.append(f"memo value missing or changed: {k} (memo {memo.count(k)}x, notice {text.count(k)}x)")...

[5] Run it.

console
$ python3 -I check.py en out.en.1.txtdates found: 2, distinct: [(10, 26), (11, 12)]exit 0

Nine English runs and nine Korean runs, 18 in all, under three conditions:

ConditionWhat changedResult
Athe prompt aboveall 6 runs pass
B"Today is October 21, 2026" and "from the 2026 calendar" removedall 6 runs pass
Clast year's notice (weekdays from last year's calendar) plus this year's dates, Nov 12 and Nov 14; the format example deliberately shows a wrong Wednesday, Nov 12all 6 runs pass

B passing may only mean the CLI knows today's date from its environment (not verified). A plain chat box may not, so the prompt keeps the date.

The one-line request (memo plus "Write an internal notice from this.") was run 3 times in English. Every date and weekday was right and all three still failed the check, because of format: times written as 18:00 – 21:00, "Elevators 1 & 2" instead of "elevators 1 and 2", different item names. In the Korean one-line runs, one run left "next Thursday" unconverted and two had a date with no weekday, so those were real date problems. This check is strict about format; read the flagged lines before deciding.

[6] To see whether the script catches anything, the first result was broken by hand: wrong weekdays, a weekday removed, an item name changed, the two work times swapped. All 5 English edits (one of them swapping the two work times) were caught with exit code 1, and so were all 10 edits of the Korean result (inputs and outputs are in run/bad*.txt; they are not model output). One example:

console
$ python3 -I check.py en bad5.en.txtdates found: 2, distinct: [(10, 26), (11, 12)]FAIL 10/26: its line lacks its own time/elevators (18:00-21:00, elevators 1 and 2)FAIL 11/12: its line lacks its own time/elevators (09:00-12:00, elevators 3 and 4)exit 1

The first version let a notice with the two work times swapped pass (it only counted how often each time appeared); it now checks each date's line. The Korean test run found two more holes. A changed memo value passed when one intact copy of it was still elsewhere in the notice, for example "3~7층" changed in one line and untouched in another, so it now has to appear as many times as in the memo. And a weekday written before the date, as in "목요일(10월 29일)", was read as "no weekday", so the script now looks a few characters back.

[7] Read what the script cannot see.

  • It only proves the notice matches the memo. If the memo has the wrong schedule, it passes.
  • It counts the memo's values but does not compare the Impact and Alternative route sentences with the memo.
  • Put relative phrases such as "next week" into dates in the memo first.

#notice#gemini#prompt#date-check