Skip to content

Add sync receipts naming which devices hold the case, plus a metered-data policy #297

Description

@ChelseaKR

What

After a sync, an organizer cannot answer "is this case safely on more than one device?" Add signed sync receipts: each successful merge writes a receipt (peer identity, case id, both heads, HLC watermark, transport) into the vault; habitable status and the app show "in sync with N devices as of ; last receipt from ", and a case held by one device only is flagged. Alongside it, a per-vault network policy (--metered, Wi-Fi only) that defers timestamp fetch and sync on metered links and shows the estimated bytes before a sync.

Why it matters

RR-07 ("you are in sync as of X; this case is on N devices") is the organizer-persona finding, and peer redundancy is the project's only backup story that does not involve a server. RR-13 is the data-cost transparency item for tenants on metered plans. Receipts are local and signed and never go to a relay, so metadata resistance (#288) is not weakened.

Scope

  • A receipt record and signature in syncstate.py; status, the app, and the packet cover sheet (device count only; no identities in the packet).
  • Policy in config.py; resolve and sync honour it; a byte estimate from delta size.
  • EN/ES copy; the readability gate applies.

Out of scope

  • Any server-side presence.
  • Automatic sync scheduling.

Done when

  • Two devices syncing produce matching receipts on both sides; a tampered receipt fails its signature check.
  • A single-device case shows the redundancy warning; after one sync it clears.
  • With --metered, resolve defers and reports what it deferred; nothing is fetched.

Pointers

  • src/habitable/sync.py, src/habitable/syncstate.py, src/habitable/pairing.py, src/habitable/cli.py (status, resolve), docs/sync-protocol-v2.md
  • docs/RESEARCH-ROADMAP.md (RR-07, RR-13); v2.x: metadata-resistant sync #288

Proposed with AI assistance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeatureMajor new capability proposal

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions