feat(bug): upload client, offline queue, history and install id #25

Merged
Breadway merged 3 commits from feature/breadbug-upload into main 2026-10-20 10:12:14 +08:00
Owner

Refs BREAD-21

Stacked on #24. Part of ECO-EP1.

What

  • bread-bug::upload: Client (send, delete, status), Queue, History, and the anonymous install_id.
  • https only (plain http for loopback), redirects never followed (a 3xx is a refusal), 10 s connect / 30 s total timeouts, response size cap, receipt format validated. Prepared::verify() runs immediately before every send, and the hash goes to the server as X-Breadbug-Sha256.
  • Install id: random 128 bit, ~/.local/state/bread/breadbug/install.json (0600), replaced every 30 days.
  • Errors are classified: network errors, 429 and 5xx are retriable and queue the exact previewed bytes (max 20, exponential backoff capped at 6 h); other 4xx are rejections and are dropped.
  • Receipt and deletion token go to history.jsonl (0600, bounded to 200). An identical resend returns the original receipt without a new token.
  • CLI: --send/Send action now really sends; new history [--refresh], delete <receipt>, queue [flush|cancel|clear]. With upload off (default) none of them touch the network.
  • Docs: README and docs/breadbug.md "Sending" section.

Tests

  • 17 upload tests against a mock HTTP server (headers/bytes, classification matrix, redirects, bad receipts, tampered bytes never sent, https enforcement, delete/status, history, queue backoff/delivery/drop/cap, install id rotation).
  • 8 CLI tests (send then delete, queue then flush, rejected not queued, clear/cancel, nothing touches the network while off, saved files in history).
  • End to end by hand against the real breadbug-server (breadbug-server PR #1): sent, stored unquarantined (a clean client report passes the server re-scrub), history --refresh, delete, row gone.
  • clippy -D warnings clean.
Refs BREAD-21 Stacked on #24. Part of ECO-EP1. ## What - `bread-bug::upload`: `Client` (send, delete, status), `Queue`, `History`, and the anonymous `install_id`. - https only (plain http for loopback), redirects never followed (a 3xx is a refusal), 10 s connect / 30 s total timeouts, response size cap, receipt format validated. `Prepared::verify()` runs immediately before every send, and the hash goes to the server as `X-Breadbug-Sha256`. - Install id: random 128 bit, `~/.local/state/bread/breadbug/install.json` (0600), replaced every 30 days. - Errors are classified: network errors, 429 and 5xx are retriable and queue the exact previewed bytes (max 20, exponential backoff capped at 6 h); other 4xx are rejections and are dropped. - Receipt and deletion token go to `history.jsonl` (0600, bounded to 200). An identical resend returns the original receipt without a new token. - CLI: `--send`/Send action now really sends; new `history [--refresh]`, `delete <receipt>`, `queue [flush|cancel|clear]`. With upload off (default) none of them touch the network. - Docs: README and docs/breadbug.md "Sending" section. ## Tests - 17 upload tests against a mock HTTP server (headers/bytes, classification matrix, redirects, bad receipts, tampered bytes never sent, https enforcement, delete/status, history, queue backoff/delivery/drop/cap, install id rotation). - 8 CLI tests (send then delete, queue then flush, rejected not queued, clear/cancel, nothing touches the network while off, saved files in history). - End to end by hand against the real `breadbug-server` (breadbug-server PR #1): sent, stored unquarantined (a clean client report passes the server re-scrub), `history --refresh`, `delete`, row gone. - clippy `-D warnings` clean.
feat(bug): upload client, offline queue, history and anonymous install id
All checks were successful
check / check (push) Successful in 7m9s
3452926e4c
breadbug --send / the send action now transmit the previewed bytes to the
intake server (https only, no redirects, hash re-verified, 30s timeout) with
a random rotating install id. Unreachable servers (network, 429, 5xx) queue
the exact bytes with exponential backoff; rejected reports are dropped. A
receipt and deletion token are kept in a 0600 history file.

New commands: history [--refresh], delete <receipt>, queue
[flush|cancel|clear]. With upload off (the default) nothing touches the
network. Verified end to end against a local breadbug-server: send,
server-side clean (not quarantined), delete, row gone.

Refs BREAD-21
Merge pull request #24: freeze watchdog and consented live stack capture
All checks were successful
dev release / build (push) Successful in 3m45s
90cd7b4b6f
Integrate the reviewed watchdog prerequisite. BREAD-18 remains open for integrated verification.
Merge remote-tracking branch 'origin/main' into feature/breadbug-upload
All checks were successful
check / check (push) Successful in 9m25s
e1c8965c2c
# Conflicts:
#	breadbug/src/lib.rs
#	breadbug/src/tests.rs
Breadway changed target branch from feature/breadbug-watchdog to main 2026-10-20 09:17:24 +08:00
docs(bug): describe the implemented upload and live-stack paths
All checks were successful
check / check (push) Successful in 19m40s
d770b188ea
Sign in to join this conversation.
No reviewers
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
Breadway/bread!25
No description provided.