Skip to content

Add four recipes for a public API's habits - #54

Merged
shergin merged 1 commit into
masterfrom
claude/epic-taussig-240119
Oct 19, 2026
Merged

shergin merged 1 commit into
masterfrom
claude/epic-taussig-240119

Conversation

@shergin

@shergin shergin commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Answers #52 with four recipes, each with its Swift and Kotlin halves. None adds a concept.

  • docs/recipes/budgeted-transport.md: a wrapper around the one verb that holds one request in flight, sends a write before a refresh before a browse page, meters the sends under the server's limit, pauses every request for a minute after a 429, and turns AniList's outage 403 into an error of the app's. A handle's fetch carries that error beside the data, and the view shows a calm line. The built-in transports keep a refused response's status and body but not its headers, so Retry-After is not read and the wait is the full minute. The page says so.
  • docs/recipes/json-scalar.md: customLists(asArray: true) read as a mapped type. Checked against the live API, it is an array of {name, enabled} objects, not of names. The page says customScalarTypes maps a scalar, not a field, and that a map stays a type of the app's, never a dictionary on the read path.
  • docs/recipes/fields-by-path.md: what a list fragment selects, where path-dependent and viewer-dependent fields go, and a probe that tells them apart. An anonymous request on 2026-10-18 got voiceActors filled under Page.media, so the page cites the report rather than stating it.
  • docs/recipes/unpaged-collection.md: MediaListCollection as one operation with a long @cacheExpiration, grouped on the client from each entry's own fields, so a mutation's response moves the row with no updater. The image carries it to the next launch.

Linked from the README, docs/README.md and the site's Recipes section. CHANGELOG entry under Unreleased.

Checks: every code block was compiled in scratch hosts over AniList's schema, a Swift target built with BATON_COMPILER=local and -warnings-as-errors and a Kotlin module with compileKotlinJvm, then deleted. The budget was also run over a scripted base transport in both runtimes. scripts/check-boundaries.sh, scripts/hostile-name-sweep.py, the site build, and cargo fmt --check and clippy on site/ pass. No Swift, Kotlin or compiler source changed, so those suites were not run again.

A budgeted transport, a Json scalar read as a value, fields a server
nulls by path, and an unpaged collection into the image, as #52 asks.
The code was compiled in both runtimes against AniList's schema in
scratch hosts, and the budget run over a scripted base transport.
@shergin
shergin merged commit 3d0c510 into master Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant