Space quota: stored-byte credits; space trash uncharged (#806) #807

Merged
Cordy merged 2 commits from fix-806 into main 2026-09-28 06:02:07 +00:00
Owner

Closes #806 (live-check findings on v0.6.300).

  • credit() stats the written file and credits its stored size minus the replaced file's stored size, which is the walk's unit. Before this, plaintext credits under encryption let the cap slip by ~1–2 % within a cache window.
  • /spaces/<d>/.trash is outside the charged tree: spacePrefix excludes it, and treeSize skips it at the space root. The trash layer's .meta write passes in a full space.
  • Rename leaving a capped tree (delete into trash, move out) credits the source immediately. A restore from trash is a move into the space and is checked.
  • Tests: RED 5f3b8571 (TestCreditsInStoredUnits, TestDeleteInFullSpaceAndTrashNotCharged) → green; go test ./... ok.
Closes #806 (live-check findings on v0.6.300). - `credit()` stats the written file and credits its stored size minus the replaced file's stored size, which is the walk's unit. Before this, plaintext credits under encryption let the cap slip by ~1–2 % within a cache window. - `/spaces/<d>/.trash` is outside the charged tree: `spacePrefix` excludes it, and `treeSize` skips it at the space root. The trash layer's `.meta` write passes in a full space. - `Rename` leaving a capped tree (delete into trash, move out) credits the source immediately. A restore from trash is a move into the space and is checked. - Tests: RED 5f3b8571 (`TestCreditsInStoredUnits`, `TestDeleteInFullSpaceAndTrashNotCharged`) → green; `go test ./...` ok.
Cordy merged commit 0c17402440 into main 2026-09-28 06:02:07 +00:00
Cordy deleted branch fix-806 2026-09-28 06:02:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#807
No description provided.