Addresses the tracked follow-up debt from thicken-openlibrary: the client
already bounds /type/redirect stub chasing at MAX_REDIRECT_HOPS, but a
chain that outlives the budget silently handed back an opaque stub, which
downstream commands rendered as an empty-shaped record with no hint why.
The walk now emits a stderr warning naming the unresolved location before
returning; mocked test drives HOPS+1 chained stubs end to end.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-08-26 19:35:15 -04:00
Magnus Hedemarkandfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
cmd_work tolerates explicit "authors": null (and non-dict entries) via
(data.get("authors") or []) guarded iteration, returning an empty array
instead of raising TypeError. cmd_isbn --json now emits authors as an
array of bare OLA keys matching `work --json` under the same field:
the edition path uses tolerant key extraction (flat refs, stray
double-nested refs), dedupes, and falls back to the linked work's
double-nested author keys when the edition ships none; publishers
likewise become a real list. Human output still renders comma-joined
labels. Refreshes the recipe gotcha note that still described the old
raw-curl work-record shape.
Adds mocked coverage: null-author work record (JSON [] + human '?'),
cross-command symmetric author arrays, tolerant edition key-only and
mixed-shape refs, ISBN handoff type stability, human label rendering,
and label-vs-key separation on mixed records.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-08-26 19:32:59 -04:00
Magnus Hedemarkandfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
27 tests across five classes: help output, argument errors, dry-run plans, mocked-client logic (merge-stub following with .json suffix repair, work-author fallback for authors:null editions, editions paging, ratings join, covers-host URLs, empty-results-as-success), plus two live probes gated behind OPENLIBRARY_LIVE_TESTS=1 that skip cleanly otherwise. Passes strict-markers pytest, unittest discovery, and the proxy-trap zero-egress rerun.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>