Explain 403 as entitlement, return lookup tables whole - #14
Merged
Conversation
Two paper cuts from #8. A tier-gated endpoint answers with a bare {"message":"Forbidden"}, which is indistinguishable from a credentials problem — and because every other command keeps working on the same key, the natural conclusion is that auth broke. Print a hint under 403 saying it is entitlement, not authentication, and contrast it with the 401 a rejected key actually returns. 401 gets its own hint pointing at `quartr auth show`. The "undocumented typeId 25" turns out to be the default page size: the document-type catalog has 46 rows and the CLI asked for 10, so 25 (shareholder letter) and 46 (DEFM14A) were simply past the cutoff — the API has had them all along. Rather than hand-maintain a static table that would drift, mark the two lookup tables as full catalogs and page them to exhaustion by default. An explicit --limit or --cursor opts back out. README gains a table of the common ids for quick reference, labelled as a convenience with the lookup commands as the source of truth. Closes #8 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8. Stacked on #13 (review the last commit only).
1. 403 no longer reads as an auth failure
The contrast with 401 is the load-bearing part — it is what lets a reader stop re-checking their key. 401 gets its own hint pointing at
quartr auth show.The raw API error is still printed verbatim above the hint, so nothing is hidden or swallowed.
2. The "undocumented typeId 25" was a truncated page
Worth stating plainly: the catalog was never missing anything.
/document-typeshas 46 rows, the CLI asked for 10, and the ids people actually need sit past the cutoff:25 (
Shareholder letter) and 46 (DEFM14A) have been in the API all along. Nothing said the list was cut, so it read as an incomplete catalog.So rather than ship a hand-maintained static table that would drift out of date, the two lookup tables are marked
fullCatalogand paged to exhaustion by default:An explicit
--limitor--cursoropts back out, so paging still works for anyone who wants it. This only applies toevent-typesanddocument-types— bounded reference tables where a partial answer is a wrong answer. Content endpoints are untouched.The README gains a table of the common ids (10-K = 11, 10-Q = 7, 8-K = 10, slides = 5, shareholder letter = 25, DEFM14A = 46, Q1–Q4 calls = 26–29), explicitly labelled a convenience with the lookup commands as the source of truth.
Tests
403 and 401 hints; the catalog paging to exhaustion at
limit=500; and an explicit--limit 5making exactly one request.🤖 Generated with Claude Code