S1-3: Fiscal-year fact extraction #33
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
epic:E1-foundation
epic:E2-correct-metrics
epic:E3-fast-jobs
epic:E4-cli
epic:E5-web-ui
epic:E6-history
good first issue
help wanted
invalid
question
sprint-tracking
story
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/screener!33
Loading…
Reference in a new issue
No description provided.
Delete branch "8-fiscal-year-extraction"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🤖 Claude: Closes #8
Adds
src/extract.ts:extractFiscalYearFacts()reads every metric from a company's latest 10-K fiscal year only, with the source XBRL tag recorded for each value. This is the core fix for #1 (stale tags).How it was built
claude[bot]on GitHub wrote the extractor and 24 tests against the fixtures (commit600381a). Run log8618cf6.The fix:
LongTermDebtis usually the totalThe first version treated
LongTermDebtas the noncurrent portion, as DRI uses it, and added the current portion on top. I checked filers' debt maturity schedules, whose yearly repayments sum to total principal: in 10 of 12 testable casesLongTermDebtis the total, as the US-GAAP taxonomy defines it. Current debt was double-counted (Exelon +$1.7B; CIM +$1.7B on $3.1B).Now
LongTermDebtis treated as the total unless the maturity schedule matchesLongTermDebt+ next year's repayments (DRI, Xerox).LongTermDebtis the total, verified against its filed balance sheet: $1,442K current + $24,224K noncurrent = $25,666K.Real-data results (5,170 companies with a fiscal year in the last 13 months)
LongTermDebt+ current added)ShortTermBorrowings(a separate line, correct)Known gaps (not in this story)
DebtCurrent+ totalLongTermDebtmay double-count.analyze.tsdoesn't use the extractor yet. That's wired up in S1-6 (#11).Decisions raised by
claude[bot](FYI; defaults seem right)Definition of Done
LongTermDebt; CPB $7,137M without double-counted commercial paper; MU/DRI debt match FY26bun test: 100 passbun checkclean;bun fmt --checkpasses on changed files🤖 Generated with Claude Code
🤖 Claude: ## Code review
No issues found. Checked for bugs and CLAUDE.md compliance.