Skip to content

Commit b67c1a9

Browse files
robingenzclaude
andcommitted
feat!: every catalog value of the client is lowercase snake_case
The owner decided on 2026-10-25 that every catalog value is lowercase snake_case with no prefix, and the API carries it from monorepo bbce0eb9 on, in one cut with no alias. openapi.json is that API's /openapi: the 44 error codes drop the E_ prefix, forbidden, not_found, idempotency_key_reused; the audience warnings are fingerprint_unknown and unsupported_condition_share; an app's framework react-native is react_native. No path, operation, schema or field changed. The models follow the snapshot: Framework takes react_native and AudienceWarning.code the two lowercase warnings. The client's own code for a body outside the error shape follows the rule, E_UNEXPECTED_RESPONSE becoming unexpected_response, and the docstrings, the session-only note, the test fixtures and test titles name the codes in the new form. The plan-gated docstrings take the snapshot's new wording, a plan that includes the feature. CLAUDE.md states the rule. BREAKING CHANGE: HotCodePushError.code carries the API's lowercase codes, not_found rather than E_NOT_FOUND, and unexpected_response rather than E_UNEXPECTED_RESPONSE; Framework is react_native rather than react-native, and AudienceWarning.code is fingerprint_unknown or unsupported_condition_share. A caller comparing the old values must change them. The API answers the new spellings to every client version, so a comparison against "E_NOT_FOUND" never matches again, whichever client you pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5142bdb commit b67c1a9

35 files changed

Lines changed: 1122 additions & 1122 deletions

‎CLAUDE.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ Run `uv run ruff format .` before every commit; the format check, lint, type che
5555

5656
- Auth is `Authorization: Bearer <token>`; the token falls back to `HOTCODEPUSH_TOKEN` and stays optional, since `/health` needs none.
5757
- Every request sends `X-HotCodePush-Client: <name>/<version>`, `python/<this package's version>` unless the caller passes its own `client`; `User-Agent` goes out only when the caller sets `user_agent`, since a session keeps it and the sessions page names the client by it.
58-
- Every error is one JSON shape, `code`, `message`, `details`; `HotCodePushError` carries them and the status verbatim, and a body without the shape becomes `E_UNEXPECTED_RESPONSE`.
58+
- Every error is one JSON shape, `code`, `message`, `details`; `HotCodePushError` carries them and the status verbatim, and a body without the shape becomes `unexpected_response`.
5959
- Every call goes through `HttpClient`, never a bare `httpx` call: sixty seconds per attempt, `JSON_TIMEOUT_SECONDS` or the caller's `timeout`, and ten minutes for a binary upload, `UPLOAD_TIMEOUT_SECONDS`, each httpx's limit on every phase of the attempt, the connect, each read and write and the pool; `send_with_retry` makes three attempts, backing off exponentially from 500 ms, on a transport error, 408, 429 and 5xx; a 429 or a 503 waits its `Retry-After` instead, at most sixty seconds, the rate-limit window.
6060
- Every creating `POST` — the eight operations whose OpenAPI document lists the `Idempotency-Key` header: organizations, invitations, apps, channels, releases, rollbacks, bundles and binaries — goes through `fetch_creating_post`, which sends the caller's `idempotency_key` or a UUID generated per call and kept across its retries. A checkout and a customer portal session carry no key and are never retried, since each call creates another Polar object.
61-
- Any other `POST` is retried only where a repeat is safe, `is_retryable=True`: `pause`, `resume`, the subscription's `cancel` and `uncancel`, a bundle's `complete`, a channel's bulk `revoke`, a signing key's `create`, the SSO verification, the two multipart starts and a file upload's completion; a pack's completion is never retried, since a repeat answers `E_NOT_FOUND` for an upload R2 already closed.
61+
- Any other `POST` is retried only where a repeat is safe, `is_retryable=True`: `pause`, `resume`, the subscription's `cancel` and `uncancel`, a bundle's `complete`, a channel's bulk `revoke`, a signing key's `create`, the SSO verification, the two multipart starts and a file upload's completion; a pack's completion is never retried, since a repeat answers `not_found` for an upload R2 already closed.
6262
- Lists take `limit` and `offset`; `relations` and `ids` are lists sent as comma lists, `?relations=user`, `?ids=a,b`, and any other list repeats its parameter, `?attribute=a&attribute=b`.
6363
- `me` is accepted wherever a `{userId}` appears; the client passes it through.
6464
- The `/v1/auth/*` slice is Better Auth's and outside the document; its client lives in the CLI and the console, never here.
@@ -75,7 +75,7 @@ Run `uv run ruff format .` before every commit; the format check, lint, type che
7575
- A model is a `HotCodePushModel` named after the API's entity, its fields the snapshot's properties in snake_case: required ones without a default, nullable ones `X | None`, a relation `X | None = None`; a date-time is a `datetime`, an enum a `Literal`, an alias in `models.py` when two types share it.
7676
- A query flag documented as `"true" | "false"` is a `bool`.
7777
- After a resource's `list` method, an annotation writes `builtins.list`, since the method shadows the builtin in the class body.
78-
- A method whose operation the document marks with `sessionAuth` carries ``An API token answers `E_FORBIDDEN`; sign in with a session.`` in its docstring; the contract test holds the note to the document.
78+
- A method whose operation the document marks with `sessionAuth` carries ``An API token answers `forbidden`; sign in with a session.`` in its docstring; the contract test holds the note to the document.
7979

8080
## The OpenAPI snapshot
8181

@@ -98,7 +98,7 @@ The integration test runs by hand against that API, started with `ENVIRONMENT=de
9898
- Result variables carry the past participle of their operation: `fetched_channel`, `resolved_error`.
9999
- Alphabetical ordering within a scope: imports, dict keys, keyword arguments, model fields, declarations of one kind.
100100
- Booleans carry `is` or `has`; a state with a moment is a timestamp such as `paused_at`, never a boolean.
101-
- Error codes are `E_` plus SCREAMING_SNAKE, passed through verbatim, never renamed.
101+
- Every value of a catalog is lowercase snake_case with no prefix, error codes included: `not_found`, `unexpected_response`; the API's are passed through verbatim, never renamed.
102102
- Never `cast` or `# type: ignore`; a real check.
103103
- Test titles read `test_<verb>_…`, the verb in the third person, conditions starting with `when`; one test per request and branch.
104104

0 commit comments

Comments
 (0)