# fix\(cost\): mark a quota week partial when its last day was scanned before midnight \(\#349\) · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/d573df8a4e1aa3fa8c119df813c030675269fc99)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: d573df8a4e1aa3fa8c119df813c030675269fc99

Requested commit: d573df8a4e1aa3fa8c119df813c030675269fc99

Commit: d573df8a4e1aa3fa8c119df813c030675269fc99

Tree: 0caeaff6e76d0c23574df323e45843bf15407cbe

Author: Simone

Committer: GitHub

## Message

```
fix(cost): mark a quota week partial when its last day was scanned before midnight (#349)

The local cost history ends on the day the CLI scanned it. A scan taken
before midnight, such as one kept across an overnight suspend or shown
while the post-midnight refresh is still running, holds only part of that
day. QuotaWindowCost counted the row as a complete day, so after a reset
at local midnight the week that just closed showed every date and an
exact total that was missing the end of its last day.

When the history does not reach today, its last row is now a lower bound
and any quota week that counts it reads "at least". Earlier weeks and a
history scanned today are unchanged. This is the Quota weeks counterpart
of the AI Insights pre-midnight fix in #340.

Docs: usage guide Quota weeks paragraph, cost-history contract, and an
Unreleased Fixed entry.


Claude-Session: https://claude.ai/code/session_01TyLjj3QgxCcyMUFLdNo5L8

Co-authored-by: Claude <noreply@anthropic.com>
```

## Parents

- [1941537a5ed31331889e64ae075ca8017d4a9cf7](https://git.cafe/lucenx/codexbar-plasma/commit/1941537a5ed31331889e64ae075ca8017d4a9cf7?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/d573df8a4e1aa3fa8c119df813c030675269fc99?format=markdown)
