feat: refund tracked storage usage on deletion and replacement

Persist per-file storage receipts, preserve refundability on rename, account for PDF replacements and permit deletion at the consumption limit. Update CGU, installation documentation and regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-08 05:40:08 +00:00
commit ed8f41bd4a
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
17 changed files with 5636 additions and 65 deletions

View file

@ -113,7 +113,15 @@ balance and subscription/payment tables without clearing existing counters.
Consumption is in **points**, independent of `EstimatedCompensation` and
currency. Counters have no automatic reset. Storage means cumulative
instrumented writes, not current occupancy; the historical CPU counter is
instrumented writes less individually tracked bytes removed or replaced,
not total filesystem occupancy. Replacements refund their tracked previous
size and charge the new size. Legacy files without an individual receipt
receive no refund; storage counters never become negative. Deletion remains
available at the consumption limit, but API/transfer/CPU costs are not refunded.
Apply the `RefundableResourceStorage` migration before deployment; its empty
receipt table deliberately does not infer provenance from historical counters.
Renames preserve receipts and repeated PDF generation replaces the previous
tracked volume rather than charging the whole file again. The historical CPU counter is
instrumented elapsed processing time, not exhaustive CPU profiling.
Authenticated HTTP operations are admitted atomically against known costs