How TideWindow is built
Station pages are generated at build time from NOAA CO-OPS tide predictions (high/low, datum MLLW, local time). Water temperature and wind are requested from the same station when a sensor exists. If NOAA wind is missing, the National Weather Service hourly forecast is the fallback. Calls are spaced so we stay polite to both APIs.
Sunrise, sunset, and moon phase are computed in the build from lat/lon. No third-party astronomy API is used.
Best windows show the next upcoming stretch for each activity, with a Now, Next, Later today, Tomorrow, or After dark chip. Kayaking and boat launch stay inside civil twilight and roll to tomorrow when today is gone. Fishing can include dawn and dusk. The briefing restates the same fishing window as the card. These are not permits, not small-craft decisions, and not a substitute for looking at the water.
AI briefings and the free neuron budget
Workers AI on the Cloudflare free plan allows 10,000 neurons per day. A tight briefing is about 8 neurons. A question-box answer is about 10. TideWindow reserves 1,500 neurons (about 150 answers) for the question box, leaving about 8,500 for briefings, or about 1,000 briefings a day.
Wave 1 stations get up to two AI restatements a day (morning and mid-afternoon, kicked by Worker cron). Everyone else, and any station whose AI slot is skipped, keeps a numbers-based template sentence so the page is still unique. The model may only restate our numbers. It must not invent fish reports or say it is safe to go.
Refresh
Cloudflare Workers Builds redeploys from git. A Worker cron at 11:00 UTC and 20:00 UTC refreshes NOAA snapshots in D1 and writes AI briefings. Station pages recompute windows from that stored data at request time, so numbers do not wait on a redeploy.