Repository navigation
feat(serve): describe_filing names each note once instead of listing every network - #107
Merged
Merged
Conversation
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.
Summary
describe_filinglisted every presentation network of a filing by id, name and concept count. On a 10-K that list is most of the payload: across the 26 filings the Filing Ladder runs on it was 15,000 of a mean 25,200 characters (38,000 of 48,800 at the largest). The ladder's published transcripts show what the list bought: the model opened withdescribe_filingin 73 of 114 records of the serve rung and went straight tosearch_textin 47 of those, and every later turn of the record paid for the list again.Under the product profile the response now names each note once (the disclosure families
disclosuresalready computes), gives the count of blocks behind them, and says thatdisclosureswith one of those names lists that note's blocks forinformation_blockto read. The primary statements keep their rows (id, name, kind, role).--pureis unchanged: it lists every network by the filer's own role, as before.Measured on the same 26 filings: mean 25,200 characters down to 11,600; largest 48,800 down to 13,600.
Changes
xbrlkit/serve/tools.py—describe_filing:disclosuresis a list of note names (families with at least one block that is not a classified statement),disclosure_blocksis the network count, andnetworks_notepoints at thedisclosurestool.xbrlkit/serve/server.py— thedescribe_filingtool description and the server instructions say "the statements by role and the notes by name".xbrlkit/serve/README.md— the tool table row, the same wording.tests/test_serve.py— the two assertions that pinned the per-network list now pin the names and the block count.Output Impact
SERVED — the shape of one key in
describe_filing's JSON changes under the product profile:disclosureswas a list of{id, name, concepts}objects and is now a list of strings, withdisclosure_blocksbeside it. Anything that read a network id from that list gets the ids fromdisclosures(topic)instead;statementandinformation_blockalready take a name or part of one. Nothing in the package reads the old list.--pureoutput, theload_filingreceipt and every other tool are unchanged.Testing
just test-allgreen (705 passed).An exploratory, unregistered Filing Ladder pass of the serve rung against this branch (114 records, same questions, model and judge as the published v0.2.1 row; local only, not a published result):
Each accuracy difference is one question's worth of records and inside the row's standard error; cost per question fell 38% on lookups and 31% on derived questions.