Skip to content

Fix #382 duplicate test declarations breaking the main build - #385

Merged
jaywedgeworth22 merged 7 commits into
mainfrom
wise/fix-382-duplicate-test-decls
Nov 8, 2026
Merged

jaywedgeworth22 merged 7 commits into
mainfrom
wise/fix-382-duplicate-test-decls

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Bounded repair: compile regression, one production regression, one accepted-intent gap, one stale fixture

Main at cb8759f does not compile (#382 redeclared four test funcs) and carried further red the compile break hid. This PR makes the full suite green locally (691 CodeCapsTests + all QuotaCoreTests, Mac, head d83f52f).

1. Compile repair (#382 duplicate test declarations)

Four pairs qualified body-for-body:

  • testAWakeAfterThreeMissedWeeksAlerts: byte-identical duplicate -> added copy REMOVED.
  • The other three pairs DIFFER: hotfix: alert on mid-window restores that roll the window forward #382's added copies use the two-window courtesyWindow (5h+7d) batch shape while the pre-existing originals use single stamped reading(...) calls; the restore copy adds a repeat-poll no-double-alert assertion. Both variants preserved; the hotfix: alert on mid-window restores that roll the window forward #382 copies renamed to their actual shape:
    • testAWakeAfterTwoMissedPeriodsWithItsWeeklyWindowAlerts
    • testAWaitForUsageProviderSilentThroughTheGapWithItsFiveHourWindowDoesNotAlert
    • testAWaitForUsageProviderRestoreWithItsFiveHourWindowAlertsOnceNotTwice

2. Regression fix: explicit period start must advance (#357 contract)

#382's whole-multiple edit to explicitStartConfirmsPeriod changed its zero-advance guard to return true, letting a MiniMax weekly deadline correction with an UNMOVED explicit start confirm a rollover - contradicting #357's unchanged comment ("their explicit start must advance too") and breaking merged test testMiniMaxWeeklyDeadlineCorrectionNeedsAnAdvancedExplicitPeriodStart (passed at 9ecc644, failed at cb8759f). Restored guard periods >= 1 else { return false }. Whole-multiple advances (the #382 missed-periods case) unaffected.

3. Slept-through resets: smaller window no longer swallowed in mixed batches

Accepted intent (owner iMessage 2026-11-06, verbatim: offered "If your Mac sleeps through several quota resets, CodeCaps can miss the reset notification when you open it again. I'd fix that so it tells you a reset happened while you were away. Want that?" - answer "Yes that's good."). The 5h window's two-period slept-through rollover FIRES when polled alone but was silently DROPPED when the 7d companion rode in the same batch (reason filter: not largest, minimum above near-cap threshold, not mid-window -> continue). Added sleptThroughMultiplePeriods rescue: a fired transition on a smaller window surfaces as .newPeriod only when the vendor's end moved by TWO OR MORE whole cadences (drift-tolerance, calendar-month band mirroring the deadline path) AND real quota readings exist on both sides. Ordinary one-period resets of smaller windows stay quiet (testSmallerWindowStaysQuiet pinned), windows never seen with a percentage stay quiet and masked current readings cannot alarm (both pinned). This is notification-surfacing of an already-detected reset, distinct from the unknown-window false-positive question, which this PR does not touch.

4. Stale widget fixture reconciled (strengthened)

WidgetTests.testWidgetOnlyLetsAFreshWindowCapAPlan expected literal windows.filter { !$0.isSupplementaryVideoQuota }; #357's merged production reads ... && !$0.isModelDetail }. Literal updated to the stronger form and a new assertion pins the capPool fallback ("a platform reporting only video windows keeps them"). No production widget change.

Nothing here settles the unknown-window preference, touches #384, or authorizes release.

… three distinct stamped-reading variants
@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.

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.

​

swu-wise Bot and others added 4 commits November 8, 2026 10:12
…adences (accepted slept-through-reset intent)
…he 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>
@jaywedgeworth22
jaywedgeworth22 merged commit 9206390 into main Nov 8, 2026
3 of 4 checks passed
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