Skip to content

Port upstream 0.63.0: MiniMax checked reset arithmetic (stacked on #651) - #740

Closed
Finesssee wants to merge 1 commit into
port/micro-0.66.0-minimax-storage-discoveryfrom
port/micro-0.63.0-minimax-checked-reset
Closed

Finesssee wants to merge 1 commit into
port/micro-0.66.0-minimax-storage-discoveryfrom
port/micro-0.63.0-minimax-checked-reset

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Closes the remaining MiniMax half of GAP-17 (audit-0.63.0 Gap 1, partial item #6): guard the MiniMax reset-time arithmetic so an oversized reset value can never abort the refresh. The rest of steipete#3758/steipete#3764 was already covered by #585/#586.

  • coding_plan.rs::resets_at: build the offset with Duration::try_seconds (None for an unrepresentable remains, e.g. i64::MAX after the >1_000_000 ms heuristic) and finish with now.checked_add_signed; a reset that lands at/before now is dropped, so the usage percentage survives with no reset line.
  • coding_plan_html.rs::parse_resets_at_from_text: "Resets in N " text with a very large N saturates seconds as i64; the same try_seconds + checked_add_signed guard turns it into no reset line instead of a panic.
  • Tests: oversized remains = i64::MAX, negative/zero remains, positive small/ms remains, future end-time precedence, "Resets in 99999999999999999999 days" saturation, and a normal 2-day text.

Stacked on #651 (port/micro-0.66.0-minimax-storage-discovery at 084719a8). Backend only, no UI change (a dropped reset line is the intended behavior). No new dependencies.

Validation

  • cargo fmt --all --check: pass
  • cargo clippy both manifests --all-targets -- -D warnings: clean except the 3 documented pre-existing main-drift sites
  • cargo test rust manifest: 2306 passed / 0 failed / 1 ignored (minimax coding-plan focused: 19/0 incl. the new overflow tests)
  • cargo test desktop manifest: 489 passed / 1 failed — bootstrap_payload_exposes_every_provider_variant, the documented Isolate bootstrap payload test from real settings #684 environment-dependent baseline on branches without Make the bootstrap catalog test hermetic (#684) #711 (expected)

Upstream reference

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Adversarial validation (lane-A) at cd00d98

Implementation matches audit-0.63.0.md Gap 1 exactly: oversized remains / "Resets in N days" text can no longer abort the refresh; the offset is built with Duration::try_seconds and applied via now.checked_add_signed, returning no reset line and keeping the usage percentage. Tests cover remains = i64::MAX, negative/zero remains, small/ms remains, future end-time precedence, the 99999999999999999999-days saturation case, and a normal 2-day text (6 new tests).

Checks at cd00d98 (CARGO_TARGET_DIR=W:\cargo-target\lane-a, jobs=4, RUST_TEST_THREADS=4): fmt pass; clippy both manifests -D warnings (3 documented pre-existing main-drift sites only, 0 in diff); rust tests 2306/0/1-ign; desktop tests 489/1 (documented #684 #711 baseline, expected).

Stacked on #651 at 084719a; backend only, no UI proof required.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Shipped in v0.70.0: this PR's head is included in main via #735 (merge commit 9d0a37a). Closing as integrated.

@Finesssee Finesssee closed this Oct 3, 2026
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