Skip to content

hotfix: alert on mid-window restores that roll the window forward - #382

Merged
jaywedgeworth22 merged 3 commits into
mainfrom
zcode/cc218-courtesy-hotfix
Nov 8, 2026
Merged

jaywedgeworth22 merged 3 commits into
mainfrom
zcode/cc218-courtesy-hotfix

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

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.

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.
@jaywedgeworth22
jaywedgeworth22 enabled auto-merge (squash) November 8, 2026 05:17
@linear-code

linear-code Bot commented Nov 8, 2026

Copy link
Copy Markdown

CC-220

@kody-ai

kody-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Code Review Could Not Complete ⚠️

The review failed before suggestions could be generated.

Reason: The configured API key (open_router) appears invalid or lacks permission. Check the key in your settings.

open_router · meta/muse-spark-1.3-contributor · HTTP 403 · generalist

Provider said: Workspace weekly budget of $25.00 exceeded. Contact your org admin. $25.01 of $25.00 used; resets 2026-11-09T00:00:00.000Z.

After fixing the issue, comment @kody review on this PR to re-run the review.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@kody-ai

kody-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

⚠️ Note: some checks couldn't be completed in this run, so auto-approval (when enabled) was skipped. Check the details at https://app.kodus.io/pull-requests and then comment @kody review on this PR to retry once the issue is resolved.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

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-ai

kody-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Never log tokens or credentials; only safeIssues may reach the handoff file
Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@jaywedgeworth22
jaywedgeworth22 merged commit cb8759f into main Nov 8, 2026
3 of 4 checks passed
swu-wise Bot added a commit that referenced this pull request Nov 8, 2026
… three distinct stamped-reading variants
swu-wise Bot added a commit that referenced this pull request Nov 8, 2026
swu-wise Bot added a commit that referenced this pull request Nov 8, 2026
jaywedgeworth22 added a commit that referenced this pull request Nov 8, 2026
#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>
jaywedgeworth22 added a commit that referenced this pull request Nov 8, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant