Repository navigation
hotfix: alert on mid-window restores that roll the window forward - #382
Conversation
CC-215's mid-window gates require the reported period end to hold still, so a restore where the vendor moves the end forward was missed entirely. Two tests regressed with merged PR #378: the courtesy reset that rolls the window forward alerted nothing, and an early reset whose period end moved with a restore-sized rise alerted nothing either. CI does not run swift tests on pushes to main, so both slipped through. Add a third route to the forward-jump rule: with the end still ahead, a restore-sized rise (vendorRestoreRise) that lands at or above the courtesy ceiling and started at or below it proves the reset. A rolling slide cannot meet it: its climb is gradual, so one poll's rise past the ceiling never carries a 30-point rise with it. Fixes CC-218. Owner 2026-11-07.
Code Review Could Not Complete
|
| Options | Enabled |
|---|---|
| Bug | ✅ |
| Performance | ✅ |
| Security | ✅ |
| Business Logic | ✅ |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations.
Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Keep main's climb-gated forward-jump rules and this branch's rolledRestore rule for a mid-window restore that rolls the window forward. Co-Authored-By: Claude <noreply@anthropic.com>
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀
|
| Options | Enabled |
|---|---|
| Bug | ✅ |
| Performance | ✅ |
| Security | ✅ |
| Business Logic | ✅ |
… three distinct stamped-reading variants
…ndow courtesyWindow variants
…a rollover (restores the #357 contract)
#378 and #382 each added the same four tests to ResetAlarmTrackerTests, so the file redeclared them and the test target failed to compile (main has the same duplicates). Keep the later copies, which also assert the repeat poll stays silent, and remove the earlier ones. Production code is unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
* Fix #382 duplicate test declarations: drop one identical copy, rename three distinct stamped-reading variants * Rename the three distinct #382 copies accurately: they are the two-window courtesyWindow variants * Fix #382 regression: an unmoved explicit period start cannot confirm a rollover (restores the #357 contract) * Surface smaller-window rollovers that span two or more whole missed cadences (accepted slept-through-reset intent) * Reconcile stale atCapWindow source literal with the merged video+model-detail filter; pin the capPool fallback * Remove duplicate isModelDetail and plan-window accessors that broke the iOS companion compile The stored isModelDetail (captured at construction) and the fuller primaryWindows, detailWindows and hasModelDetails already exist; the leftover computed duplicates were invalid redeclarations. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: swu-wise[bot] <344778455+swu-wise[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
PR #357 carries the same intent but its implementation is entangled with its tracker rework (periodStartAt plumbing), so this is a fresh minimal patch rather than a cherry-pick.
Fixes CC-220.
Fixes missed reset alert for CC-218 where a mid-window restore rolled the quota window forward instead of holding the period end. Adds a rolledRestore condition to forward detection that fires when the window has not reached its scheduled end but remaining jumps by at least the vendor restore rise to land at or above the courtesy restore ceiling from at or below it. This preserves the intent of the existing held-end rules while covering the reissued-period case noted by owner on 2026-11-07, with CC-215 false-alert shape explicitly excluded because gradual rolling slides do not carry a 30-point single-poll rise. Operational impact is user-visible reset alerts now trigger for forward-rolled restores that were previously missed. No test changes are included in this patch and operational behavior remains unverified beyond automated review; automated code review found no issues.