Add Codex historical pace with risk forecasting and backfill + follow-ups for historical pace hardening#482
Add Codex historical pace with risk forecasting and backfill + follow-ups for historical pace hardening#482ratulsarna wants to merge 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f08efa15b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| guard coverageStart <= windowStart.addingTimeInterval(Self.coverageTolerance) else { | ||
| return existingDataset | ||
| } | ||
| guard coverageEnd >= calibrationEnd.addingTimeInterval(-Self.coverageTolerance) else { | ||
| return existingDataset |
There was a problem hiding this comment.
Handle zero-usage boundary days during history backfill
These coverage guards make backfill bail out unless the first and last usageBreakdown entries are close to the current window boundaries, but the dashboard scraper only emits days with positive credits (it skips v <= 0), so zero-usage days at the start or end of the week are omitted. In that common case, coverageStart/coverageEnd drift away from windowStart/calibrationEnd, this function returns early, and historical pace never gets seeded (the app stays on linear fallback). Please treat missing boundary days as zero-usage coverage (or synthesize empty days) before enforcing these checks.
Useful? React with 👍 / 👎.
Supersedes #438.
Includes targeted follow-up fixes from the audit:
Credit to @tristanmanchester for the original implementation and foundation. Thank you.