Design a recurring North Pier depot review for a fictional 30-day pilot. At 08:15 local time each day, it compares the last settled reporting window with the previous verified snapshot. It can read parcel status and create a draft report. It cannot rebook shipments or contact customers. The deliverable is a schedule contract, a run prompt, a validation gate, an alert policy, and a replayable audit row. This project describes a workflow; it does not create a live schedule or send a message.
Project: build a North Pier recurring review
Specify the run
The scheduler supplies resolved start and end instants, local time-zone identity, and stable run key. The application supplies a fresh status snapshot with its collection time and partition manifest. The prompt classifies new holds, released holds, and unresolved records only after the freshness and completeness gate passes. A stale empty response remains unknown. If one day is missed, the next run identifies the uncovered interval rather than silently merging it with today's window.
Constrain effects and alerts
For window W-47, six held parcels are unchanged and H-71 becomes newly held. The run writes a draft and emits one alert candidate about H-71. The notification service checks mute settings and a deduplication key before delivery. A timeout after draft creation triggers a receipt lookup; the retry reuses the draft. A proposed customer email remains a draft requiring a supervisor's fresh approval tied to that exact recipient and shipment state. After the pilot expires or access is revoked, the run stops.
Schedule: daily 08:15 local, end after 30 days.
Run key: north-pier / W-47 / review-v3.
Inputs: resolved window, snapshot S-47, partition manifest.
Decision: six unchanged holds; H-71 new hold.
Effect: draft receipt R-47; one alert candidate.
Retry: reuse R-47, check alert receipt before any send.
Customer email: draft only, supervisor approval required.Release and operating cost
Test a fresh zero result, stale zero result, missing partition, missed run, duplicate invocation, ambiguous send, revoked access, and expired pilot. Treat unauthorized effects and false all-clear reports as hard failures. Comparing N records is O(N) with keyed sets; a receipt check is O(1) average in an indexed store. The audit row records schedule event, window, snapshot hash, prompt version, validation outcome, artifact ID, alert decision, and receipts. Replay against the frozen snapshot checks decision fields without claiming identical wording from a model.
Common Mistakes
- Do not let a stale zero look like a verified empty depot.
- Do not create a second draft merely because the first invocation timed out.
- Do not send customer outreach under a read-only review grant.
- Do not notify the manager on every unchanged run.
Connected lessons
- Recurring prompts: define the trigger and stop condition
- Recurring prompts: bind local time and data windows
- Recurring prompts: validate fresh inputs and empty states
- Recurring prompts: survive retries without duplicate effects
- Recurring prompts: notify only on actionable changes
- Recurring prompts: renew authority for sensitive actions
- Recurring prompts: make every run replayable and auditable
- Tool effects: reconcile receipts before retrying
- Prompt changes in CI: test the merge candidate
- Recurring prompt workflow decisions
