Recheck an AI-drafted project schedule against business days
Recompute each date of an AI-drafted schedule with working days, or take only durations and predecessors from the model and let a script compute the dates.
Give a model ten tasks and their durations in working days, ask for a schedule with start and end dates, and people say you get end dates on a Saturday or holidays counted as working days. In this test, all 18 results that contained dates matched a recomputation with working days. So this post is not about fixing wrong dates. It is about checking in a second whether they are right, and about not asking the model for dates at all.
[1] Save the request. It is an invented training-platform rollout with exactly two days off. The span also contains 12/25 and 1/1 on the calendar, which a model could silently treat as holidays. Keep the same tasks as tasks.en.csv (id, task, days, pre).
Employee training platform rolloutProject start: 2026-12-21 (Monday)Working days: Monday to Friday. The only days off are these two: 2026-12-23 (Wed) and 2027-01-14 (Thu)Rule: a task starts on the first working day after all of its predecessors have finished. A task with no predecessor starts on the project start date. The end date is the last day on which the task's duration (in working days) has been worked, counting the start date as day 1. Tasks (ID / name / duration in working days / predecessors)T1 / Gather requirements / 4 / noneT2 / Shortlist vendors / 6 / T1T3 / Security review / 7 / T2T4 / Contract negotiation / 9 / T2T5 / Account integration design / 6 / T3T6 / Content migration plan / 5 / T2T7 / Pilot environment setup / 6 / T4, T5T8 / Pilot run / 14 / T7T9 / Admin training / 3 / T7T10 / Company-wide announcement and launch / 4 / T6, T8, T9[2] Ask in two ways. One is a single sentence: "Build a project schedule from the task list below. Every task needs a start date and an end date." The other asks for no dates at all, only durations and predecessors, which is the split-the-job approach in Google's prompting strategies.
<instructions>Tidy up the task list in <request> but do not calculate any dates.1. For every task, write the ID, the duration (working days) and the predecessors exactly as given in the request.2. Write them as a ```csv block with the header `id,duration,predecessors`. Join several predecessors with `;`, and leave the field empty when there is none.Add no commentary. Do not write any dates.</instructions> <request>[3] Append the request and run each way three times.
$ { cat headD.en.txt request.en.txt; echo "</request>"; } > promptD.en.txt$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config < promptD.en.txt > outD.en.1.txtThe first result of the no-dates version (middle cut):
id,duration,predecessorsT1,4,T2,6,T1T3,7,T2…T8,14,T7T9,3,T7T10,4,T6;T8;T9[4] Write the checking script. It hard-codes the start date, the two days off and the rule (a task starts on the working day after its last predecessor ends), and recomputes every task from tasks.en.csv. For an answer with dates it compares table rows and CSV rows line by line; for a structure-only answer it checks duration and predecessors against the original, then prints the computed dates.
#!/usr/bin/env python3"""usage: check.py tasks.csv answer.txt"""import csv, re, sysfrom datetime import date, timedeltaSTART, HOL = date(2026, 12, 21), {date(2026, 12, 23), date(2027, 1, 14)}work = lambda d: d.weekday() < 5 and d not in HOLdef nxt(d): d += timedelta(1) while not work(d): d += timedelta(1) return dtasks = list(csv.DictReader(open(sys.argv[1], encoding="utf-8")))exp, end = {}, {}for r in tasks: # 1. recompute with working days pre = [p for p in r["pre"].split(";") if p] s = nxt(max(end[p] for p in pre)) if pre else START e = s for _ in range(int(r["days"]) - 1): e = nxt(e) end[r["id"]] = e exp[r["id"]] = (s, e)txt = open(sys.argv[2], encoding="utf-8").read()fails = []if "duration" in txt: # 2-a. structure only: if duration and predecessors match the original, print the computed dates m = re.search(r"```csv\n(.*?)```", txt, re.S) rows = list(csv.DictReader(m.group(1).strip().splitlines())) if m else [] if len({r["id"] for r in rows}) < len(rows): fails.append("more than one row for the same id") got = {r["id"]: r for r in rows} for r in tasks: g = got.get(r["id"]) if not g or g["duration"] != r["days"] or g["predecessors"] != r["pre"]: fails.append(f"{r['id']}: duration/predecessors differ from the original {g}") if not fails: print("id,start,end\n" + "\n".join(f"{i},{s},{e}" for i, (s, e) in exp.items()))else: # 2-b. dates given: compare line by line (table rows and CSV rows) D = r"(?:(\d{4})-)?(\d{2})-(\d{2})" # no year: December is 2026, anything else 2027 day = lambda y, m, d: date(int(y or (2026 if m == "12" else 2027)), int(m), int(d)) got = {} for line in txt.splitlines(): m = re.match(r"\s*\|?\s*(T\d+)\s*[|,].*?" + D + r".*?" + D, line) # table rows and CSV rows only if m: got.setdefault(m.group(1), []).append((day(*m.groups()[1:4]), day(*m.groups()[4:7]))) for i, (s, e) in exp.items(): for g in got.get(i, [None]): if g is None: fails.append(f"{i}: no schedule row") elif g != (s, e): off = [f"{x}({'MonTueWedThuFriSatSun'[x.weekday()*3:x.weekday()*3+3]})" for x in g if not work(x)] fails.append(f"{i}: answer {g[0]}~{g[1]} / computed {s}~{e}" + (f" · day off/weekend {off}" if off else ""))print("\n".join("FAIL " + f for f in fails) or "OK")sys.exit(1 if fails else 0)[5] Run it. The six results from the one-sentence and the dates-rule prompts all printed OK. The three no-dates results kept every duration and predecessor, so the script printed the dates:
$ python -I -X utf8 check.en.py tasks.en.csv outD.en.1.txtid,start,endT1,2026-12-21,2026-12-25T2,2026-12-28,2027-01-04…T10,2027-02-22,2027-02-25OKI also cross-checked the Korean set's end date with numpy's busday_offset. A simpler schedule (days off on 11/11 and 12/9) was run six more times in Korean, and those matched too.
[6] Test whether the script catches bad input. I edited the result files by hand in six ways (counting 12/25 as a day off, a start on a Saturday, a deleted row, an end date one day late, a changed duration and a duplicated id row in the structure-only table), and all six were caught. One example: T1 ending on 12-28 instead of 12-25. This file is not model output.
$ python -I -X utf8 check.en.py tasks.en.csv bad/e1.txtFAIL T1: answer 2026-12-21~2026-12-28 / computed 2026-12-21~2026-12-25The first version of my script read dates inside a commentary sentence ("T5 (ends 01-22)") as schedule rows and failed a correct table, and it could not read a table written without the year. The script above has both fixed.
[7] Limits. The script trusts tasks.en.csv, so a typo when copying the request either raises false alarms or lets the same misreading through. If you read the rule differently ("start the same day the predecessor ends"), a correct answer will look wrong. The model's commentary, such as the critical path, is not checked.