feat: use configured work days for weekly pace#1451
Conversation
|
Codex review: found issues before merge. Reviewed June 13, 2026, 5:51 AM ET / 09:51 UTC. Summary Reproducibility: not applicable. as a bug reproduction. Source inspection and the linked issue show current main uses seven-day linear weekly pace while this PR deliberately changes the product semantics for configured work days. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Choose and document the persisted-setting contract: either explicitly approve unified marker-and-pace semantics for existing values, or preserve marker-only upgrade behavior and add a separate opt-in or migration with fresh-install and upgrade coverage. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction. Source inspection and the linked issue show current main uses seven-day linear weekly pace while this PR deliberately changes the product semantics for configured work days. Is this the best way to solve the issue? Unclear pending product approval. The algorithm is focused and well covered, but silently reusing an existing stored marker preference is not the safest upgrade path unless the owner explicitly accepts that contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a2b56ea2b362. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
795bfac to
22903e3
Compare
|
Rebased onto current Autoreview caught and this head fixes one edge case: a fully depleted quota after the final configured workday now remains exhausted instead of reporting that it lasts through the weekend. Proof:
Fresh CI is running. Keeping this draft/unmerged for product review of the workday pacing semantics. |
22903e3 to
c994ca7
Compare
|
Rebased onto current Exact head: Proof:
Fresh CI is running. Keeping this draft and unmerged for the existing product decision on changing the semantics of the persisted work-day setting. |
b695eb5 to
999b083
Compare
|
Prepared on exact head Proof:
Not merging autonomously: interpreting configured work days as quota-consumption pace changes user-facing product semantics. |
The existing weeklyProgressWorkDays setting only affected visual markers on the progress bar. This change threads the work-days value into UsagePace.weekly() so that the expected usage curve distributes 100% across configured work days only. Non-work days contribute zero expected usage, producing a flat curve on weekends. Users who work Mon-Fri and consume 100% by Friday now see "on pace" instead of a misleading ~29% deficit from the 7-day linear model. Fixes #1356
Address Codex bot review feedback: when the weekly reset time is not at midnight, the previous 24-hour-slice approach could misclassify hours near day boundaries. Now uses calendar.startOfDay to split intervals at local midnight, ensuring each slice is classified by its actual calendar weekday regardless of reset time offset.
Align the valid workDays range (>= 2) with the UI picker (Off/4/5/7) and marker path (2...7) to prevent inconsistent behavior from stale or manual values.
999b083 to
19a120a
Compare
|
Prepared on exact head Proof:
Keeping this draft and unmerged. The remaining question is product/upgrade semantics: whether the existing persisted work-day display preference should also control quota pace and ETA. |
Summary
Supersedes #1357 because repository CI would not start for the fork head. Preserves @pstanton237's commits and authorship.
Fixes #1356.
Validation
swift test --filter UsagePacemake check