Skip to content

feat(serve): describe_filing names each note once instead of listing every network - #107

Merged
jfrench9 merged 1 commit into
mainfrom
feature/describe-filing-compact
Nov 10, 2026
Merged

jfrench9 merged 1 commit into
mainfrom
feature/describe-filing-compact

Conversation

@jfrench9

@jfrench9 jfrench9 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Summary

describe_filing listed 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 with describe_filing in 73 of 114 records of the serve rung and went straight to search_text in 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 disclosures already computes), gives the count of blocks behind them, and says that disclosures with one of those names lists that note's blocks for information_block to read. The primary statements keep their rows (id, name, kind, role). --pure is 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: disclosures is a list of note names (families with at least one block that is not a classified statement), disclosure_blocks is the network count, and networks_note points at the disclosures tool.
  • xbrlkit/serve/server.py — the describe_filing tool 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: disclosures was a list of {id, name, concepts} objects and is now a list of strings, with disclosure_blocks beside it. Anything that read a network id from that list gets the ids from disclosures(topic) instead; statement and information_block already take a name or part of one. Nothing in the package reads the old list. --pure output, the load_filing receipt and every other tool are unchanged.

Testing

just test-all green (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):

published row (0.21.5) this branch
lookups: accuracy 91.7% 90.0%
lookups: cost per question $0.0698 $0.0432
derived: accuracy 63.0% 61.1%
derived: cost per question $0.0991 $0.0681
turns per record 3.4 / 3.9 3.3 / 4.1

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.

@jfrench9
jfrench9 merged commit d2f3df3 into main Nov 10, 2026
6 checks passed
@jfrench9
jfrench9 deleted the feature/describe-filing-compact branch November 10, 2026 01:16
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