Skip to content

v0.2.2: Portion display order, barcode digit forms, and per-ID batch fallback

Choose a tag to compare

@cyanheads cyanheads released this 14 Nov 21:17
· 7 commits to main since this release
v0.2.2
3461af6

Portion display order, barcode digit forms, and per-ID batch fallback

  • usda_get_food portions follow FDC's display order (ascending sequenceNumber, unnumbered last), so servingInfo, unit: "serving", allPortions, and the usda://food/{fdcId} portions no longer take FDC's array-first portion (#40)
  • usda_search_foods matches a bare 12-14-digit barcode with a valid check digit against its 12-, 13-, and 14-digit forms and its 12-digit form without the check digit, in one upstream call (#41)
  • A /foods batch attempt that times out at 15 s is refetched per ID, at most 10 in flight per process, inside the call's 45 s deadline; usda_get_foods and the new usda_compare_foods deferredIds list IDs unanswered at the deadline, or whose retries ran out on a transient failure while another ID answered. A non-transient 4xx or a complete body of the wrong shape fails the call (#42)
  • usda_compare_foods raises too_few_foods (with deferredIds) only when even answers for the deferred IDs could not make 2 foods, and retry_deadline_exceeded otherwise (#42)
  • Record requests (usda_get_food, usda://food/{fdcId}, a one-ID batch, a refetch) run to the call's 45 s deadline instead of being cut at 15 s, so a first attempt that hangs fails at 45 s, where 0.2.1 retried at 15 s (#42)
  • A complete FDC 200 body that is not JSON is ServiceUnavailable with retryable: false, sent once; retry_deadline_exceeded reads FDC <path> request exceeded … and carries a recovery hint on every tool and the resource (#42); the bare-code no_results hint points to a product-name search (#41)
  • deps: @biomejs/biome ^2.6.6 → ^2.6.7 (dev)

CHANGELOG v0.2.2 · release PR #45