S1-2: Test fixtures from known-bad companies #26

Merged
chris-kreidl merged 1 commit from s1-2-test-fixtures into main 2026-11-06 02:00:07 +00:00
chris-kreidl commented 2026-11-06 01:46:29 +00:00 (Migrated from github.com)

🤖 Claude: Closes #7

Trimmed SEC companyfacts fixtures for the five companies that broke the old pipeline, plus expected values checked against each company's filed 10-K.

What's here

  • scripts/make-fixtures.ts: regenerates fixtures from data/ (all forms and periods, allowlisted tags only; ~23 MB → 2.1 MB)
  • test/fixtures/companyfacts/*.json: the fixtures (compact; excluded from bun fmt via bunfig.toml)
  • test/fixtures/expected.ts: exact line items per company, the accession number, the statement page verified, and notes on quirks
  • test/fixtures.test.ts: 65 tests: values match the filings, the trimming keeps what's needed, and the stale-tag cases behind #1 are present

Found while verifying (affects later stories)

Company Finding Story
HRB No operating income line in FY26; EBIT must be derived (pretax + interest = $934.5M) #8 (criteria updated)
DRI LongTermDebt holds only the noncurrent portion #8 (criteria updated)
CPB Debt is $7,137M, not ≈ $7.5B; commercial paper is already in DebtCurrent #8 (criteria corrected)
MU / DRI Finance leases are inside debt for MU and separate for DRI #9 (your decision, see comment)

Also

  • tsconfig.json gets "types": ["bun"], which takes bun check from 65 errors to 0 across the repo, covering part of #11's criterion.

Definition of Done

  • Acceptance criteria met and demonstrated: five fixtures; every expected value verified against SEC statement pages (R3/R4/R6/R7) on 2026-11-05
  • bun test passes; new logic has tests (65 pass)
  • bun check is clean (whole repo) and bun fmt --check passes on all files in this PR. The only failures are the 4 old scripts and CLAUDE.md, tracked in #11
  • Runs end to end on real data: fixtures generated from the Nov 5 data/ refresh

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded validation coverage for financial filing data across multiple companies, including reported values, fiscal year-end details, quarterly data, and edge cases in line-item availability.
    • Added checks that compact test data retains required financial facts and excludes unrelated ones, helping catch inconsistencies in filing-based calculations.
🤖 **Claude:** Closes #7 Trimmed SEC companyfacts fixtures for the five companies that broke the old pipeline, plus expected values checked against each company's filed 10-K. ### What's here - `scripts/make-fixtures.ts`: regenerates fixtures from `data/` (all forms and periods, allowlisted tags only; ~23 MB → 2.1 MB) - `test/fixtures/companyfacts/*.json`: the fixtures (compact; excluded from `bun fmt` via `bunfig.toml`) - `test/fixtures/expected.ts`: exact line items per company, the accession number, the statement page verified, and notes on quirks - `test/fixtures.test.ts`: 65 tests: values match the filings, the trimming keeps what's needed, and the stale-tag cases behind #1 are present ### Found while verifying (affects later stories) | Company | Finding | Story | |---|---|---| | HRB | No operating income line in FY26; EBIT must be derived (pretax + interest = $934.5M) | #8 (criteria updated) | | DRI | `LongTermDebt` holds only the noncurrent portion | #8 (criteria updated) | | CPB | Debt is $7,137M, not ≈ $7.5B; commercial paper is already in `DebtCurrent` | #8 (criteria corrected) | | MU / DRI | Finance leases are inside debt for MU and separate for DRI | #9 (**your decision**, see comment) | ### Also - `tsconfig.json` gets `"types": ["bun"]`, which takes `bun check` from 65 errors to 0 across the repo, covering part of #11's criterion. ### Definition of Done - [x] Acceptance criteria met and demonstrated: five fixtures; every expected value verified against SEC statement pages (R3/R4/R6/R7) on 2026-11-05 - [x] `bun test` passes; new logic has tests (65 pass) - [x] `bun check` is clean (whole repo) and `bun fmt --check` passes on all files in this PR. The only failures are the 4 old scripts and `CLAUDE.md`, tracked in #11 - [x] Runs end to end on real data: fixtures generated from the Nov 5 `data/` refresh 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Tests** * Expanded validation coverage for financial filing data across multiple companies, including reported values, fiscal year-end details, quarterly data, and edge cases in line-item availability. * Added checks that compact test data retains required financial facts and excludes unrelated ones, helping catch inconsistencies in filing-based calculations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2026-11-06 01:46:40 +00:00 (Migrated from github.com)

Explain Change →

Walkthrough

The change adds a script to generate trimmed company-facts fixtures for five tickers. It adds five fixture datasets, expected filing values, and tests for fixture metadata, facts, and tag filtering.

Changes: Company facts fixtures

Layer / File(s) Summary
Fixture generation and tooling
scripts/make-fixtures.ts, bunfig.toml, tsconfig.json
The script maps five tickers to CIKs, filters facts by an allowlist, and writes compact fixture files. The formatter ignores the fixture directory, and TypeScript includes Bun types.
Fixture data and validation
test/fixtures/expected.ts, test/fixtures/companyfacts/*, test/fixtures.test.ts
Expected filing metadata and selected line items accompany five company-facts fixtures. Tests check CIKs, filing dates and values, allowlisted tags, quarterly facts, and specified stale-tag cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

A rabbit checks each fact in line
Five ticker files arrive on time
Tags stay within the listed gate
Filing dates confirm each state
The burrow stores the data fine

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Free
  • Run ID: 91c97138-3d69-49ca-ab44-1bd753eac01c
Commits

Reviewing files that changed from the base of the PR and between 6576d5f66e and ffb977ea22.

Files selected for processing: 10

  • bunfig.toml
  • scripts/make-fixtures.ts
  • test/fixtures.test.ts
  • test/fixtures/companyfacts/CPB.json
  • test/fixtures/companyfacts/DRI.json
  • test/fixtures/companyfacts/HRB.json
  • test/fixtures/companyfacts/MU.json
  • test/fixtures/companyfacts/OTEX.json
  • test/fixtures/expected.ts
  • tsconfig.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

<!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/chris-kreidl/screener/pull/26?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> The change adds a script to generate trimmed company-facts fixtures for five tickers. It adds five fixture datasets, expected filing values, and tests for fixture metadata, facts, and tag filtering. **Changes: Company facts fixtures** |Layer / File(s)|Summary| |:---|:---| |**Fixture generation and tooling** <br> `scripts/make-fixtures.ts`, `bunfig.toml`, `tsconfig.json`|The script maps five tickers to CIKs, filters facts by an allowlist, and writes compact fixture files. The formatter ignores the fixture directory, and TypeScript includes Bun types.| |**Fixture data and validation** <br> `test/fixtures/expected.ts`, `test/fixtures/companyfacts/*`, `test/fixtures.test.ts`|Expected filing metadata and selected line items accompany five company-facts fixtures. Tests check CIKs, filing dates and values, allowlisted tags, quarterly facts, and specified stale-tag cases.| **Estimated code review effort:** 3 (Moderate) | ~20 minutes </dd> </dl> </details> <!-- walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> > [!NOTE] > <details> > <summary><strong>Summarized by CodeRabbit Free</strong></summary> > <dl> > <dd> > <br> > > Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting <https://app.coderabbit.ai/settings/billing>. > > </dd> > </dl> > </details> <!-- poem_footer_start --> <sub>A rabbit checks each fact in line <br>Five ticker files arrive on time <br>Tags stay within the listed gate <br>Filing dates confirm each state <br>The burrow stores the data fine</sub> <!-- poem_footer_end --> <!-- tips_end --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: Unavailable - **Branch**: Unavailable - **File**: No configuration file from this repository applied - **Commit**: Unavailable - **Layers**: Organization UI - **Review profile**: ASSERTIVE - **Plan**: Free - **Run ID**: `91c97138-3d69-49ca-ab44-1bd753eac01c` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 6576d5f66e71410d5270cf67baaec57209fda105 and ffb977ea22e1201c2d29f2a20b67685270990681. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 10</strong></summary> <dl> <dd> <br> * `bunfig.toml` * `scripts/make-fixtures.ts` * `test/fixtures.test.ts` * `test/fixtures/companyfacts/CPB.json` * `test/fixtures/companyfacts/DRI.json` * `test/fixtures/companyfacts/HRB.json` * `test/fixtures/companyfacts/MU.json` * `test/fixtures/companyfacts/OTEX.json` * `test/fixtures/expected.ts` * `tsconfig.json` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/screener!26
No description provided.