feat: data-cost and storage UX — footprint, sync/timestamp bytes, wifi-only (R-03/R-18/R-19)#29
Open
ChelseaKR wants to merge 1 commit into
Open
Conversation
…i-only (R-03/R-18/R-19)
A tenant on a low-end device with a metered link should never be surprised by
what habitable stores or sends. This adds three linked transparency features.
R-03 storage footprint: `Vault.storage_footprint()` walks the vault and returns a
StorageFootprint (sealed originals, the by-design shared-copy doubling, metadata,
total, and per-capture sizes). `habitable status` prints a plain "storage:" line
("… total — … sealed originals + … shared copies (originals are kept twice by
design)"), `AppServer.status()` surfaces the raw bytes, and the app renders them
with a one-line explanation of the doubling (EN/ES). A new human_bytes() helper
formats decimal (SI) sizes on both the Python and JS sides.
R-18 data-cost transparency: SyncResult now carries bytes_sent/bytes_received
(counted for both LocalDirTransport and the relay path); `habitable sync` prints
"data: sent X, received Y". Rfc3161HttpTSA records request/response byte counts,
and `resolve`/`retimestamp` print the total network bytes used. Docs note a
timestamp is typically a few KB.
R-19 Wi-Fi-only / metered options: a new additive `[network] allow_metered`
(default true, schema stays v1) plus `--wifi-only` / `--allow-metered` flags on
resolve, retimestamp, and sync. Because a desktop CLI cannot detect a metered
link, this is an explicit gate: when wifi-only is in effect and the operation
would hit the network (relay transport, or a real RFC 3161 authority — dev/local
authorities and directory sync are free), it refuses with a clear message. The
setting is exposed read-only in AppServer.status().
Tests in tests/test_datacost.py cover footprint math, human_bytes, sync byte
counters over LocalDirTransport, [network] parsing, and the CLI refusal/allow
paths. Docs/mobile.md gains a footprint-and-data-cost section; the persona
backlog marks R-03/R-18/R-19 done. make test/lint/type + i18n gates green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A tenant on a low-end device with a metered link should never be surprised by
what habitable stores or sends. This adds three linked transparency features.
R-03 storage footprint:
Vault.storage_footprint()walks the vault and returns aStorageFootprint (sealed originals, the by-design shared-copy doubling, metadata,
total, and per-capture sizes).
habitable statusprints a plain "storage:" line("… total — … sealed originals + … shared copies (originals are kept twice by
design)"),
AppServer.status()surfaces the raw bytes, and the app renders themwith a one-line explanation of the doubling (EN/ES). A new human_bytes() helper
formats decimal (SI) sizes on both the Python and JS sides.
R-18 data-cost transparency: SyncResult now carries bytes_sent/bytes_received
(counted for both LocalDirTransport and the relay path);
habitable syncprints"data: sent X, received Y". Rfc3161HttpTSA records request/response byte counts,
and
resolve/retimestampprint the total network bytes used. Docs note atimestamp is typically a few KB.
R-19 Wi-Fi-only / metered options: a new additive
[network] allow_metered(default true, schema stays v1) plus
--wifi-only/--allow-meteredflags onresolve, retimestamp, and sync. Because a desktop CLI cannot detect a metered
link, this is an explicit gate: when wifi-only is in effect and the operation
would hit the network (relay transport, or a real RFC 3161 authority — dev/local
authorities and directory sync are free), it refuses with a clear message. The
setting is exposed read-only in AppServer.status().
Tests in tests/test_datacost.py cover footprint math, human_bytes, sync byte
counters over LocalDirTransport, [network] parsing, and the CLI refusal/allow
paths. Docs/mobile.md gains a footprint-and-data-cost section; the persona
backlog marks R-03/R-18/R-19 done. make test/lint/type + i18n gates green.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Backfill PR for a completed roadmap item (
roadmap/data-cost-and-storage-ux-r-03-r-18-r-19-8, 1 commit(s) overmain). Part of the portfolio roadmap batch.