Reviewer: Astra (GPT-6-Astra via Codex). Whole-branch review of feat/k2-connectivity at 82189dac9bba3b7fa2f56a334ebee081b24c1982, against fetched origin/main (300c4d1). Binding spec: rastrillo/native spec/offline-kit at 6049830, §3.2–3.4 and the K2 slice in §4.10.
VERDICT: CHANGES-REQUIRED
- P2 — a connectivity wake bypasses Retry-After.
native/apple/Sources/SheetsKit/SheetLive.swift:40. A 429 withRetry-After: 30becomes a 30-second argument towait, but any foreground/path/reachability event ends that wait and immediately starts another stream attempt. Scratch reproduction against the realSheetModel.watch,BackoffandNativeConnectivity: send the 429, foreground after 100 ms, inspect after another 600 ms; stream count is 2, expected 1. Keep a monotonic server-imposed retry deadline (capped at five minutes) separately from exponential backoff. Wakes may reset exponential delay and reassess connectivity, but must not erase the remaining server floor. Preserve the path-down/no-timer behavior. Add a regression test with a connectivity event inside Retry-After.
- P2 — unsuccessful connection setup is counted as a stable open stream.
native/apple/Sources/SheetsKit/SheetLive.swift:12and:37–38.openedis captured beforeclient.stream, so a refused or timed-out request taking over five seconds resets backoff even thoughonOpennever ran. Scratch reproduction: three quick 503s, then a fourth 503 delayed 5.2 seconds; a fifth attempt occurs within 700 ms instead of retaining the expected 2–4-second delay. Capture the start of the successfully opened stream inonOpen; only call the stable-stream reset when that open stream actually lived longer than five seconds. A delayed refusal must keep its accumulated backoff.
- P2 — the live label contradicts per-origin connectivity.
native/apple/Sources/SheetsKit/SheetLive.swift:31and:39. On a satisfied path, an offline-class request error setslivetoReconnecting; the later correction checks onlyisPathSatisfied. TheisOffline(origin)check at the next iteration lasts only until the next failure overwrites it. A scratch test using real NativeHTTP, its actual connectivity observer and a closed loopback port establishedisOffline(origin) == truewhilemodel.live == "Reconnecting". Derive the displayed connectivity state from the observable per-origin value, or otherwise retainOfflineafter request failures as well as path failures. Account for the observer's asynchronous MainActor delivery. The existing path-down test does not exercise this case.
Validation: the branch's Swift suite passed (18 Swift Testing tests plus 5 XCTest cases, with one existing fixture-dependent skip). native/scripts/build-iphone.sh simulator ran XcodeGen first and the simulator build succeeded. Mutation check: replacing the backoff wait with a fixed two-second wait made the new liveStreamBacksOffBetweenQuickFailures fail specifically with 1 attempt, expected at least 2. The full Swift suite passed again after restoring the source. A separate offline cancellation probe passed and confirmed no further attempts after the watch task stopped. The three probes above failed on the unmodified production implementation; they were scratch-only tests, not changes to this branch.
Other checks: SheetModel's protocol-typed transport is used by the real production loop, so these are not tests of a replacement reconnect implementation. However, ScriptedTransport does not emit NativeHTTP outcome-observer notifications; the new tests leave that integration uncovered, which is why the real-HTTP probe matters. The immediate-failure loop does wait and does not spin without delay. The existing account/window lifetime and stale-stream guards remain in place. There are no server/migration changes here.
Spec departures: per-origin connectivity is accepted; no banner summary/durable-save claim is appropriate until persistence exists. App-localized English banner copy is acceptable for K2, with the shared package catalog/12 locales still required at K3. The English wording is approved. Re-pin to the reviewed native main revision after native #7 lands, as already planned.
Review-only: no branch edits, commits, pushes or merges. Scratch mutations were restored, and the scratch worktree and build outputs have been removed. Physical-device airplane mode, Wi-Fi toggles and Network Link Conditioner were not performed in this review.