Problem
/api/verify has a pdf-present check that fails when a bill has no PDF on disk. A brand-new statement registers from the API (totalDueAmount) before National Grid publishes its PDF (the PDF lags the statement by ~1–3 days). So every month, when a new bill arrives, /api/verify goes red (ok:false, "missing PDF") for a day or two until the PDF publishes — a transient false alarm that trips monitoring (Gatus) and the deploy health check, even though nothing is wrong (the scraper retries the PDF each scrape and it self-heals).
Proposal
Make the pdf-present check grace-aware: treat a bill whose statementDate is within a recent grace window (e.g. ≤ ~4 days old) and has no PDF as pending, not failed — i.e. don't count it as a verification failure. Only flag a genuinely missing PDF (an older bill whose PDF should exist but doesn't = real data loss). currentCharges-based numeric checks already skip when currentCharges is null, so this is purely the presence check.
Acceptance criteria
Pointers
app/src/lib/ngrid/verify.ts (the pdf-present check).
app/src/app/api/verify/route.ts.
Problem
/api/verifyhas apdf-presentcheck that fails when a bill has no PDF on disk. A brand-new statement registers from the API (totalDueAmount) before National Grid publishes its PDF (the PDF lags the statement by ~1–3 days). So every month, when a new bill arrives,/api/verifygoes red (ok:false, "missing PDF") for a day or two until the PDF publishes — a transient false alarm that trips monitoring (Gatus) and the deploy health check, even though nothing is wrong (the scraper retries the PDF each scrape and it self-heals).Proposal
Make the
pdf-presentcheck grace-aware: treat a bill whosestatementDateis within a recent grace window (e.g. ≤ ~4 days old) and has no PDF as pending, not failed — i.e. don't count it as a verification failure. Only flag a genuinely missing PDF (an older bill whose PDF should exist but doesn't = real data loss).currentCharges-based numeric checks already skip whencurrentChargesis null, so this is purely the presence check.Acceptance criteria
/api/verifyok:false.Pointers
app/src/lib/ngrid/verify.ts(thepdf-presentcheck).app/src/app/api/verify/route.ts.