Skip to content

fix(xbrl): securities need section evidence; cash plus short-term investments gets its own concept - #2072

Open
dgunning wants to merge 1 commit into
mainfrom
fix/1436-securities-evidence
Open

dgunning wants to merge 1 commit into
mainfrom
fix/1436-securities-evidence

Conversation

@dgunning

Copy link
Copy Markdown
Owner

Refs #1436

This implements the first PR from the scope I posted on #1436, based on synfonia-llc's design. It doesn't close the issue. CashAndMarketableSecurities and CashAndCashEquivalents still share the label "Cash and Cash Equivalents"; that relabel, with the ifrs-full_CashAndCashEquivalents move, is the separate conditional PR described there.

What changes

  1. Securities need a section. AvailableForSaleSecurities and HeldToMaturitySecurities join the require-evidence rule from [DATA] 135 balance-sheet elements bypass their dedicated concept, land in the wrong class, or standardize as a total #1438 (fix(xbrl): require section evidence for three current/noncurrent entries (#1438) #2071). With a current or noncurrent section, on the row or from a classified calculation parent, they resolve as before: ShortTermInvestments or LongtermInvestments. Without one, get_standard_concept() and get_display_name() return None where they used to return LongtermInvestments by candidate order. lookup() still lists both candidates. The change is two entries in the REQUIRE_SECTION_EVIDENCE frozenset.
  2. Cash plus short-term investments gets its own concept. CashCashEquivalentsAndShortTermInvestments maps to a concept of the same name, displayed as "Cash, Cash Equivalents and Short-Term Investments", instead of CashAndMarketableSecurities ("Cash and Cash Equivalents"). This PR touches one gaap_mappings.json entry, a new display_names.json entry and a section_membership.json Current Assets entry. No other open PR touches gaap_mappings.json.
  3. Stitching keeps the IESC tag switch. I added the new concept to _EQUIVALENT_STANDARD_CONCEPTS alongside CashAndCashEquivalents and CashAndMarketableSecurities. Without that, separating it broke issue with cash and cash equivalents for multiyear data IESC #610. IESC tagged its one cash line CashCashEquivalentsAndShortTermInvestments in its FY2023 10-K (0001048268-23-000097) and CashAndCashEquivalentsAtCarryingValue in its FY2024 10-K (0001048268-24-000134), and both report $75,770,000 at 2023-09-30. The [DATA] Stitched balance sheet merges any two cash-bucket lines from different filings, so cash plus short-term investments can show as cash and cash equivalents #1685 guard still applies: lines in the group merge only when the filings share a period and every shared period agrees. Microsoft's cash line and its total disagree in every period, so they stay two rows.

Verification

Ground truth, offline from committed fixtures:

  • Microsoft FY2024 10-K, 0000950170-24-087843 (tests/fixtures/xbrl/msft/10k_2024): "Cash and cash equivalents" is $18,315,000,000 at 2024-06-30 and stays CashAndMarketableSecurities. "Total cash, cash equivalents, and short-term investments" is $75,543,000,000 and moves to CashCashEquivalentsAndShortTermInvestments. On main both were CashAndMarketableSecurities.
  • Pathfinder Bancorp FY2024 10-K, 0000950170-25-047820 (tests/fixtures/xbrl_gz/pbhc/10k_2024): "Held-to-maturity securities, at amortized cost" is $158,683,000 at 2024-12-31 and $179,286,000 at 2023-12-31, on an unclassified bank balance sheet whose calculation parent is Assets. Its concept was LongtermInvestments on main and is none here; the label and values are unchanged.
  • IESC: test_issue_1685.py and test_issue_610_iesc_cash.py pass, both network tests included, run one file at a time.

The new regression file is tests/issues/regression/test_issue_1436_section_evidence.py (21 tests). On origin/main 11 fail: Microsoft, the label, Pathfinder, the no-side cases and the Assets-parent case. The 10 that pass are controls: classified sections, current and noncurrent parents, both stitching cases and the bad-context error. On this branch the fast suite (pytest -m fast -n 8) gives 52,725 passed, 9 skipped, 1 xfailed. check-regression-provenance passes. Lint on the touched files matches main; the three existing warnings in stitching/core.py are unchanged.

One existing test changed on purpose. In test_issue_1436_securities_not_cash.py, two parametrized tests now expect no concept for the two require-evidence tags when no section is given. The count of entries that lead with the cash concept goes from 22 to 21, and the test asserts that the combined tag isn't among them. The expected-candidates JSON is unchanged, because lookup() is unchanged.

Every changed fixture row

I took standard_concept for every non-abstract row of every statement role in the 67 committed XBRL fixture sets, standardized through xbrl.standardization.standardize_statement_data(), on origin/main and on this branch. 25 of 98,326 rows change, and every changed row uses one of the three target tags:

  • Rows 1–9: the combined total moves from CashAndMarketableSecurities to its own concept. Five are balance-sheet totals (Coca-Cola, Microsoft) and four are note lines (Netflix, SLB).
  • Rows 10–25: AFS/HTM rows with no side lose LongtermInvestments. Pathfinder's balance-sheet line is row 23; the other 15 are in notes. Row 14 is Costco's "Short-term Investments" note line, which main called long-term.
# Fixture Statement Tag Label Before After
1 xbrl/ko/10k_2012 BalanceSheet CashCashEquivalentsAndShortTermInvestments TOTAL CASH, CASH EQUIVALENTS AND SHORT-TERM INVESTMENTS CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
2 xbrl/ko/10k_2024 BalanceSheet CashCashEquivalentsAndShortTermInvestments Total Cash, Cash Equivalents and Short-Term Investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
3 xbrl/msft/10k_2015 BalanceSheet CashCashEquivalentsAndShortTermInvestments Total cash, cash equivalents, and short-term investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
4 xbrl/msft/10k_2024 BalanceSheet CashCashEquivalentsAndShortTermInvestments Total cash, cash equivalents, and short-term investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
5 xbrl/nflx/10k_2024 Disclosures CashCashEquivalentsAndShortTermInvestments Cash, cash equivalents, and short-term investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
6 xbrl/nflx/10q_2024 Disclosures CashCashEquivalentsAndShortTermInvestments Cash, cash equivalents, and short-term investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
7 xbrl/nflx/2024 Disclosures CashCashEquivalentsAndShortTermInvestments Cash, cash equivalents, and short-term investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
8 xbrl/special_cases/dimensional/ko BalanceSheet CashCashEquivalentsAndShortTermInvestments Total Cash, Cash Equivalents and Short-Term Investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
9 xbrl_gz/slb/10k_2025 Disclosures CashCashEquivalentsAndShortTermInvestments Cash and short-term investments CashAndMarketableSecurities CashCashEquivalentsAndShortTermInvestments
10 xbrl/cost/10k_2021 Disclosures AvailableForSaleSecurities Available-for-sale, recorded basis LongtermInvestments none
11 xbrl/cost/10k_2021 Disclosures HeldToMaturitySecurities Held-to-maturity, cost basis LongtermInvestments none
12 xbrl/cost/10k_2021 Disclosures AvailableForSaleSecurities Available-for-sale, recorded basis, total LongtermInvestments none
13 xbrl/cost/10k_2021 Disclosures HeldToMaturitySecurities Held-to-maturity, cost basis, total LongtermInvestments none
14 xbrl/cost/10k_2021 Disclosures AvailableForSaleSecurities Short-term Investments LongtermInvestments none
15 xbrl/jpm/10k_2013 Disclosures AvailableForSaleSecurities Available-for-sale securities LongtermInvestments none
16 xbrl/jpm/10k_2013 Disclosures AvailableForSaleSecurities Available-for-sale securities, maturities, fair value, total LongtermInvestments none
17 xbrl/jpm/10k_2013 Disclosures AvailableForSaleSecurities Available-for-sale Securities LongtermInvestments none
18 xbrl/jpm/10k_2013 Disclosures HeldToMaturitySecurities Held-to-maturity Securities, Amortized Cost LongtermInvestments none
19 xbrl/ko/10k_2012 Disclosures AvailableForSaleSecurities Available-for-sale securities, estimated fair value, total LongtermInvestments none
20 xbrl/msft/10k_2015 Disclosures AvailableForSaleSecurities Recorded Basis LongtermInvestments none
21 xbrl/msft/10k_2015 Disclosures HeldToMaturitySecurities Held to maturity investments, recorded basis LongtermInvestments none
22 xbrl/msft/10k_2015 Disclosures AvailableForSaleSecurities Recorded basis of investment components LongtermInvestments none
23 xbrl_gz/pbhc/10k_2024 BalanceSheet HeldToMaturitySecurities Held-to-maturity securities, at amortized cost (fair valu... LongtermInvestments none
24 xbrl_gz/pbhc/10k_2024 Disclosures HeldToMaturitySecurities Held-to-maturity securities, debt maturities, Amortized Cost LongtermInvestments none
25 xbrl_gz/pbhc/10k_2024 Disclosures HeldToMaturitySecurities Held-to-maturity securities, debt maturities, Amortized Cost LongtermInvestments none

25 of 98326 rows across 67 fixture directories.

Not in this PR

  • The cash relabel and the ifrs-full_CashAndCashEquivalents move (the second PR on [DATA] Debt and equity securities standardize as "Cash and Cash Equivalents" (32 rows), and two concepts share that label #1436), and with them the shared "Cash and Cash Equivalents" label.
  • The legacy concept_mappings.json still lists the combined tag under "Cash and Cash Equivalents". Its only reader is the 8-K earnings label matcher, which uses the first tag in each list (CashEquivalentsAtCarryingValue), so the combined tag never reaches it.
  • Other ambiguous securities entries keep the first-candidate fallback. One example is Pathfinder's MarketableSecurities ($4,076,000), which still reads LongtermInvestments on its unclassified balance sheet.
  • EntityFacts. It doesn't use ReverseIndex or gaap_mappings.json for these tags, so it has no change.

AI tool: Claude Code, Claude Opus 5.5.

🤖 Generated with Claude Code

…estments gets its own concept

AvailableForSaleSecurities and HeldToMaturitySecurities map to one long-term
and one short-term investment concept, and get_standard_concept() took the
first, LongtermInvestments, when no section gave a side. Pathfinder Bancorp's
held-to-maturity securities ($158,683,000, FY2024 10-K 0000950170-25-047820)
on its unclassified bank balance sheet came back long-term on candidate order
alone. Both tags join the require-evidence rule from GH #1438.

CashCashEquivalentsAndShortTermInvestments shared CashAndMarketableSecurities
with the plain cash tags, so Microsoft's $75,543M total and its $18,315M cash
line (FY2024 10-K 0000950170-24-087843) had one concept. It now has its own,
"Cash, Cash Equivalents and Short-Term Investments". It stays in the stitcher's
cash equivalence group so IESC's switch between the two tags for one line
(GH #610) still merges, under the common-period agreement guard (GH #1685).

25 of 98,326 committed fixture rows change, all on the three target tags.

Refs #1436

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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