Summary
After completing the original five-item daily plan and selecting "Add more today,"
Today increased to a capacity of 10 but only contained nine accounted items:
- 5 completed
- 3 reviews remaining
- 1 new start remaining
- 0 other visible items
The header displayed "4 of 10 left today," even though 5 completed plus 4 remaining
equals 9. The refill message said "Added 1 more to today."
Settings at the time:
- Daily target: 5
- Reserved new starts: 3
The expected refill batch was 5 additional items, ideally 2 eligible reviews and
3 new starts.
Steps to Reproduce
- Set the daily target to 5.
- Set reserved new starts to 3.
- Have enough new problems scheduled on upcoming days.
- Have already-due reviews capacity-leveled onto upcoming days.
- Complete all five items in today's original plan.
- Select "Add more today."
- Inspect the Today queue, summary cards, headline, and refill message.
The competing review backlog may be necessary to expose the problem. Existing tests
only verify a refill where new starts do not compete with due reviews.
Expected Behavior
- Refill adds a complete five-item batch when at least five eligible items exist.
- The refill batch receives its own three-new-start reserve.
- With sufficient work, the result should be 2 eligible reviews and 3 new starts.
- Completed, deferred, and pending counts should equal today's stored capacity.
- The confirmation message should report the total batch added.
- Reviews should not be pulled earlier than their ideal review date.
Actual Behavior
- Only four items appear after refill: 3 reviews and 1 new start.
- The stored/displayed capacity becomes 10.
- Five completed plus four pending accounts for only nine slots.
- The confirmation reports only one item because it counts selected new candidates
that remain assigned to Today after replanning, not all work pulled forward.
Technical Notes
refillTodayPlan calculates the desired capacity before replanning. It marks selected
new candidates for Today and then calls the global planDailyWork scheduler.
Commit c6fff1a changed reserve accounting so completed new starts subtract from the
calendar day's remaining reserve. After completing three new starts, explicit refill
therefore enters replanning with zero protected new-start slots.
That explains why reviews can displace refill candidates, but it does not fully explain
why the final queue contains only four items. There is no post-replan check ensuring
that the requested batch survived or that final plan load matches capacity.
The Today headline also uses stored capacity as a denominator rather than deriving the
total from completed, deferred, and pending work, allowing "4 of 10" to appear when
only nine items are accounted for.
Relevant areas:
src/lib/planning.ts: refillTodayPlan
src/lib/planning.ts: completed-new-start reserve calculation
src/components/TodayClient.tsx: dailyPlanTotal and refill message
Acceptance Criteria
- Add a regression test with completed new starts and a competing due-review backlog.
- When at least five eligible items exist, refill produces five additional pending items.
- Explicit refill applies the configured new-start reserve to the new batch.
- Final capacity equals completed + deferred/consumed + pending work.
- Snoozed consumed slots remain correctly accounted for.
- No review is moved before its ideal review date.
- The refill message reports the complete result rather than only retained new candidates.
- The Today headline cannot imply more accounted work than actually exists.
Summary
After completing the original five-item daily plan and selecting "Add more today,"
Today increased to a capacity of 10 but only contained nine accounted items:
The header displayed "4 of 10 left today," even though 5 completed plus 4 remaining
equals 9. The refill message said "Added 1 more to today."
Settings at the time:
The expected refill batch was 5 additional items, ideally 2 eligible reviews and
3 new starts.
Steps to Reproduce
The competing review backlog may be necessary to expose the problem. Existing tests
only verify a refill where new starts do not compete with due reviews.
Expected Behavior
Actual Behavior
that remain assigned to Today after replanning, not all work pulled forward.
Technical Notes
refillTodayPlancalculates the desired capacity before replanning. It marks selectednew candidates for Today and then calls the global
planDailyWorkscheduler.Commit
c6fff1achanged reserve accounting so completed new starts subtract from thecalendar day's remaining reserve. After completing three new starts, explicit refill
therefore enters replanning with zero protected new-start slots.
That explains why reviews can displace refill candidates, but it does not fully explain
why the final queue contains only four items. There is no post-replan check ensuring
that the requested batch survived or that final plan load matches capacity.
The Today headline also uses stored capacity as a denominator rather than deriving the
total from completed, deferred, and pending work, allowing "4 of 10" to appear when
only nine items are accounted for.
Relevant areas:
src/lib/planning.ts:refillTodayPlansrc/lib/planning.ts: completed-new-start reserve calculationsrc/components/TodayClient.tsx:dailyPlanTotaland refill messageAcceptance Criteria