Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Checkpoint: the complete nightly run. Due computation, approval routing, exception queue — one function, one honest report.
Write nightly_run(items, today). For each item in order, print
one line:
- not due (
today - last_done < every) →{task}: not due - due, named approver →
{task}: awaiting sign-off ({name}) - due, auto,
result == "ok"→{task}: ran - due, auto, any other result →
{task}: EXCEPTION — {result}
Then the summary line
ran: {n} exceptions: {n} awaiting sign-off: {n}
(two spaces between fields), and the verdict:
verdict: NEEDS ATTENTION — {n} exception(s) if any exceptions,
else verdict: CLEAN.
Expected output:
pull-wms-export: EXCEPTION — export missing
regenerate-low-stock-report: ran
forklift-inspection-log: awaiting sign-off (miguel)
post-300a-summary: awaiting sign-off (vera)
vendor-scorecards: not due
ran: 1 exceptions: 1 awaiting sign-off: 2
verdict: NEEDS ATTENTION — 1 exception(s)