feat: EDGAR 10-K → fiber fragment adapter (SP-ADAPT-TREE-001, real edition)#321
Merged
Conversation
…-001, real edition) Moves fibered retrieval from fixtures onto REAL documents. edgar_fiber_adapter.py fetches a company's latest 10-K from EDGAR (data.sec.gov submissions -> primary doc), extracts its Item-level table of contents (the tree descend navigates), and emits a Crystal Atlas fragment fiber_projection.project consumes: document root ⊑ Item sections, registrant anchored under Item 1 to the real filing URL. No model, no datastore. Honest scope: the Item extractor is a heuristic over filing HTML (strip tags -> match 'Item N. Title', dedup) — recovers the standard Part I-IV items, not a production parser (exhibits/XBRL out of scope). It emits ONLY what the filing structurally states; no ownership %s or subsidiary edges invented — cross-fiber ownership (Exhibit 21 -> GLEIF -> E_R) is the documented follow-up. Network only in fetch; parsing is pure + offline-testable. Proof: the committed fixture edgar_aapl_10k.fragment.json is Apple's ACTUAL latest 10-K (17 real items, anchored to the real sec.gov URL), and the test descends its real table of contents to 'Item 1A - Risk Factors' with the keyword navigator — no network in the suite. Tests (+3, full suite 303 green): extract_items on a compact HTML fixture; to_fragment anchors the registrant under Item 1; the real Apple fragment projects and descend navigates it. Stdlib-only (urllib); live fetch exercised by the CLI.
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.
What
Moves fibered retrieval from fixtures onto real documents.
edgar_fiber_adapter.pyfetches a company's latest 10-K from EDGAR (data.sec.govsubmissions → primary doc), extracts its Item-level table of contents (the treedescendnavigates), and emits a Crystal Atlas fragmentfiber_projection.projectconsumes: document root ⊑ Item sections, registrant anchored under Item 1 to the real filing URL. No model, no datastore.Proof — it runs on a REAL filing
The committed fixture
edgar_aapl_10k.fragment.jsonis Apple's actual latest 10-K (17 real items, anchored to the realsec.govURL), and the test descends its real table of contents to "Item 1A — Risk Factors" with the keyword navigator — no network in the suite.Honest scope
The Item extractor is a heuristic over filing HTML (strip tags → match
Item N. Title, dedup) — it recovers the standard Part I–IV items, not a production parser (exhibits/XBRL R-files out of scope). It emits only what the filing structurally states — no ownership %s or subsidiary edges are invented. Cross-fiber ownership (Exhibit 21 → GLEIF → E_R edge, which enables /multi-hop) is the documented follow-up. Network lives only in the fetch path; parsing + fragment emission are pure and offline-tested.Tests (+3, full suite 301 green)
extract_itemson a compact HTML fixture ·to_fragmentanchors the registrant under Item 1 · the real Apple fragment projects anddescendnavigates it. Stdlib-only (urllib); the live fetch path is exercised by the CLI (--cik 320193).Unblocks the
--modeleval: point the real Claude scorer at these real fragments (needs the key, which the CI env lacks).