fix(bdc): is_active checks a dropped BDC's own filings once its report row expires - #1396
Merged
Merged
Conversation
…t row expires (huul) Since #1146 the register unions the last three SEC BDC reports and keeps each registrant's newest row. 22 registrants the 2026 report dropped (Ares Capital, Gladstone Capital, Great Elm, Goldman Sachs Private Credit, ...) keep 2025 rows dated ~2025-05-29, which leave the 18-month window around 2026-11-29: is_active would have flipped to False for BDCs that file every quarter. Rows now carry in_latest_report. is_active: - report row inside the window -> True, no request; - row from the newest report, outside the window -> False (the SEC's own current snapshot; these are the 1995-dated dormant registrants); - row from an older report, outside the window -> the company's newest filing date from its submissions JSON, lru-cached per CIK, so at most 22 requests per session today rather than one per stale row (52). An unreachable SEC falls back to the report row with a warning; any other error propagates rather than reading as "inactive". An explicit get_bdc_list(year=...) older than the newest report marks every row not-latest, since it is a snapshot of then. PR #1380's version exposed the window rule as a helper for callers but left is_active on the stale row. Tests freeze the module clock at 2026-12-01: offline cases for each branch, the register flag, the submissions parse, and a live ARCC/MAIN check (ARCC's own latest filing >= its 2026-07-29 10-Q). Co-Authored-By: Claude Opus 5.5 <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.
Bead edgartools-huul (salvaged from closed PR #1380).
Problem
Since #1146 the BDC register combines the last three SEC BDC reports and keeps each registrant's newest row. The 2026 report dropped 22 registrants, including Ares Capital, Gladstone Capital, Great Elm and Goldman Sachs Private Credit. Their 2025 rows are dated around 2025-05-29 and leave the 18-month window around 2026-11-29. After that,
is_activewould have returnedFalsefor BDCs that file every quarter.Fix
Rows now carry
in_latest_report, andis_activedecides like this:True, no requestFalse: SEC's own current snapshot (the 1995-dated dormant registrants)That means at most 22 requests per session today, not 52 (one per stale row). If SEC can't be reached,
is_activefalls back to the report row with a warning. Any other error propagates rather than quietly reading as "inactive". An explicitget_bdc_list(year=...)older than the newest report is treated as a snapshot of that time.PR #1380's version exposed the window rule as a helper for callers but left
is_activereading the stale row.Verification
in_latest_report=Falsewith a row dated 2025-05-29, its own latest filing is on or after its 2026-07-29 10-Q, andis_activeisTrue. MAIN is in the latest report and active.get_latest_bdc_report_year()treats a 200 as a complete report, and the 2026 one is missing ARES CAPITAL CORP #1146 regression tests pass.test-fast: the only failure is the dt1f1 20-F test, which also fails on main.🤖 Generated with Claude Code