logs.gokuls.in

1 pull request merged across 1 repo

Offline-Protocol/offline-protocol-sdk

Two things in one branch: a sweep of every tracked document against the code at d43f4aba, and the fixes an outside review of the service image, HTTP front and offline-first demo asked for before the demo is shown to anyone.

The documentation sweep (45375ce1)

Every tracked markdown file was read against the code, and each edit corrects a claim the code contradicts. The larger ones:

  • Defaults that drifted: the deduplicator is 5000 ids for 7 days (docs said 1000 for 1 hour), the retry ceiling is 5 minutes (said 30 s), pending decryption lives 24 hours (said 30 minutes), and the internet connect timeout is 10 s.
  • Behaviour added since the docs were written: the undecryptable answer and fifth receive outcome (#543), sealed service bodies and svc_versions (#544), resends offered to the mesh (#540), sessions through a third device (#537), and the Python peripheral's hello (#542).
  • Removed or renamed surface: the path config and top-K relays, Error::LastAdmin, PeerDiscovered/TransportChanged, userId in config examples, scripts that moved under bindings/react-native/scripts.
  • Indexes: the ADR count, the HTTP front chapter, and the examples are now listed in docs/README.md.
  • Two source comments said custody receipts and multi-hop discovery responses were unimplemented. Both are implemented.

ADRs keep their reasoning; three gain a one-line "see also" where later code changed what they describe.

The review fixes

  • Caller trust (880212f4). X-Offline-Protocol-Sender cannot be forged through the front, but it is an unsigned header on the callback request. The chapter, R23 and the image README now say a provider may authorize on it only when nothing but the front reaches its callback, and that with auto_key_exchange any SDK device reaching a host can call every registered service.
  • A 504 can still run (880212f4). The request is not withdrawn, and a provider that receives it within 60 s past its deadline still serves it. The chapter, its error table and R23 now say so and recommend an application idempotency key.
  • Packaging (880212f4). The Python README gains a Linux wheel recipe that runs entirely in a container. The image README says how an application container reaches the front, what host networking means on Docker Desktop, and why OP_LISTEN must be a reserved address. The docker0 sentence was also wrong: a record that lists docker0 first never connects from the dialling side, rather than backing off and recovering.
  • Two-box HTTP demo (5cfd6875). examples/http-front/compose.yml runs two boxes with the provider and client sharing each box's network namespace. client.py replaces curl, which the image lacks. The provider gains --allow and prints its own address.
  • Harness (f2d2b55f). Scenario 4 no longer pairs A and C first, so on fresh identities they have never met. New scenario 5 delivers through B while the sender is off.

How it was verified

CheckResult
cargo clippy --workspace -- -D warningsclean
cargo test --workspace --lib3201 passed
cargo fmt --all -- --check, cargo doc -p offline-protocol under -D warningsclean
tests/http_front/test_demo.py5 passed; both new tests fail when the allowlist check or the client's error path is removed
Entrypoint guard, shellcheckpass
Relative links and anchors in every changed fileall resolve
Linux wheel built by the new recipe, then the image built by its own Dockerfilemanylinux_2_34_aarch64 wheel; image has the front and the verifier
run.py --fresh, run.py twice, run.py --fresh --scenario 5 on that image1, 2, 4, 5 pass every run; 4 reported "A and C had never met" on fresh identities
Two-box HTTP compose on that image200 with box A as caller; --allow gives 403 and 200; 504 at the requested timeout with box B off; 502 after a box B restart until the provider is recreated (documented)

Not run: anything on two physical hosts, host networking, Bluetooth, the relay, Reticulum, phones.

Not in this PR

  • No release. The image still needs a checkout wheel until a release ships the http extra and the verifier.
  • No front or engine changes. A per-registration secret so the provider can authenticate the front, a per-sender share of the 32 callback slots, and skipping a refused endpoint when dialing a peer stream are each worth a separate PR.
  • Doc items the sweep flagged but did not change, for lack of certainty:
  • preferOnline is described as "always use Internet", but it is a scoring bonus in dors.rs.
  • The capability table in mls-integration.md lacks data_versions, ctrl_versions and ack_versions.
  • docs/react-native-integration.md lists 45 of about 80 event types.
  • The BLE spec requires a peripheral to refuse a prepared write, and BlueZ cannot.
  • Several pre-existing em dashes remain in bindings/python/README.md.