Retry classifier hardening and per-attempt deadline tests (from issue 24, items 3-9) #80

Open
opened 2026-09-23 01:55:01 +02:00 by clawbot · 1 comment
Collaborator

Split out of #24, whose items 1 and 2 stay there because they change the download path. This issue takes items 3 to 9: the retry classifier and the retrying API client entry points. The original wording of each item is in #24 and its two comments.

Where things are (branch next2)

  • src/retry.ts: TRANSPORT_CODES (line 51), CONNECT_CODES (80), MAX_CAUSE_DEPTH (85, walked at 95), and isSafeToReplay (166), which reduces the cause chain with .some().
  • src/api/client.ts: getRetryOptions (145) returns the internal object. There are per-attempt AbortSignal.timeout calls in each entry point. The idempotency comments are at 227, 274 and 302.
  • README.md:379-395: the idempotency section.

Definition of done

  1. Item 3: every errno in TRANSPORT_CODES and CONNECT_CODES has a test pinning which side it falls on.
  2. Item 4: every retrying entry point (postJSON, putJSON, putFile, getFileStream, getThumbnailStream, plus getJSON, already done) has a test proving attempt N+1 gets a fresh deadline.
  3. Item 5: getRetryOptions() returns a copy, or a frozen object. A test proves a caller cannot change the client's settings.
  4. Item 6: tests pin the depth limit and prove a cyclic cause chain terminates.
  5. Item 7: the list of endpoints the replay rule covers is stated once. The other place points to it.
  6. Item 8: postJSON and putJSON use redirect: "manual", and a redirect is treated as an error, not replayed. A test covers this.
  7. Item 9: isSafeToReplay matches its "when in doubt, do not replay" rule. A chain containing any error that shows the request went out is not replayable. A test pins this.
  8. Each fix has a test that fails when the fix is reverted. No test depends on wall-clock time. make check green. TODO.md updated in the same commit.

Out of scope: download deadlines and stream cancellation, which stay in #24.

Model: opus-5-5

Split out of https://git.eeqj.de/sneak/quak/issues/24, whose items 1 and 2 stay there because they change the download path. This issue takes items 3 to 9: the retry classifier and the retrying API client entry points. The original wording of each item is in https://git.eeqj.de/sneak/quak/issues/24 and its two comments. ## Where things are (branch `next2`) - `src/retry.ts`: `TRANSPORT_CODES` (line 51), `CONNECT_CODES` (80), `MAX_CAUSE_DEPTH` (85, walked at 95), and `isSafeToReplay` (166), which reduces the cause chain with `.some()`. - `src/api/client.ts`: `getRetryOptions` (145) returns the internal object. There are per-attempt `AbortSignal.timeout` calls in each entry point. The idempotency comments are at 227, 274 and 302. - `README.md:379-395`: the idempotency section. ## Definition of done 1. Item 3: every errno in `TRANSPORT_CODES` and `CONNECT_CODES` has a test pinning which side it falls on. 2. Item 4: every retrying entry point (`postJSON`, `putJSON`, `putFile`, `getFileStream`, `getThumbnailStream`, plus `getJSON`, already done) has a test proving attempt N+1 gets a fresh deadline. 3. Item 5: `getRetryOptions()` returns a copy, or a frozen object. A test proves a caller cannot change the client's settings. 4. Item 6: tests pin the depth limit and prove a cyclic `cause` chain terminates. 5. Item 7: the list of endpoints the replay rule covers is stated once. The other place points to it. 6. Item 8: `postJSON` and `putJSON` use `redirect: "manual"`, and a redirect is treated as an error, not replayed. A test covers this. 7. Item 9: `isSafeToReplay` matches its "when in doubt, do not replay" rule. A chain containing any error that shows the request went out is not replayable. A test pins this. 8. Each fix has a test that fails when the fix is reverted. No test depends on wall-clock time. `make check` green. `TODO.md` updated in the same commit. Out of scope: download deadlines and stream cancellation, which stay in https://git.eeqj.de/sneak/quak/issues/24. Model: opus-5-5
clawbot self-assigned this 2026-09-23 01:55:07 +02:00
Author
Collaborator

Implemented in #83 (base next2). All seven items are fixed or pinned by tests. The PR body has the details.

Model: opus-5-5

Implemented in https://git.eeqj.de/sneak/quak/pulls/83 (base `next2`). All seven items are fixed or pinned by tests. The PR body has the details. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/quak#80