Skip to content

fix(research): [PR1] excise dead/dormant yfinance sites (R1/R2/R4)#197

Merged
cipher813 merged 1 commit into
mainfrom
fix/yf-pr1-deadcode
May 17, 2026
Merged

fix(research): [PR1] excise dead/dormant yfinance sites (R1/R2/R4)#197
cipher813 merged 1 commit into
mainfrom
fix/yf-pr1-deadcode

Conversation

@cipher813
Copy link
Copy Markdown
Owner

yfinance-centralization arc — PR 1 (research dead-code excision)

Plan doc: alpha-engine-docs/private/yfinance-centralization-260516.md (items R1, R2, R4, PR 1).

Exact changes

  • R2 — deleted data/scanner.py::apply_balance_sheet_filter (zero callers; git grep found only the def). Removed the now-unused MAX_DEBT_TO_EQUITY / MIN_CURRENT_RATIO / BALANCE_SHEET_EXEMPT_SECTORS imports in scanner.py (used only by that fn). config.py definitions kept — config-surface/signature change is explicitly out of scope.
  • R1 — deleted data/fetchers/price_fetcher.py::fetch_short_interest + import yfinance as yf + the short-interest-only telemetry (_yf_request_count, get_yf_request_count). No live caller — scoring/aggregator.py's short_interest_data param is never populated by any caller (only offline_stubs registered it). Module docstring updated to "yfinance-free".
  • R4 — deleted the entire data/fetchers/options_fetcher.py module. fetch_options_signals had no live caller; cache_options_to_s3 + private helpers served only it; the module had no live function. The two from data.fetchers.options_fetcher import fetch_options_data imports in quant_tools.py/qual_tools.py referenced a symbol that never existed anywhere in the repo (verified) — so get_options_flow already had no working data path. Replaced both dead fallback legs with the tool's existing {"error": ...} shape.
  • Removed the now-stale offline_stubs registrations/stub fns for the deleted symbols (dev-only; the apply loop already tolerated missing targets — cleaned for consistency).
  • Kept (out of scope per plan): scoring/aggregator.py's inert short_interest_data / options_data params.

Graceful-degrade preserved

This is a zero-runtime-behavior-change PR. The only nominal "data path" touched (R4) was already non-functional (fetch_options_data symbol never existed → import error). qual_tools.get_options_flow retains its working S3-first path unchanged; both get_options_flow tools now return the tool's documented {"error": ...} degrade shape instead of raising an uncaught ImportError — strictly safer under all-agents-strict (#195), never introduces a raise where the contract degraded. No read that degraded before now raises.

Tests

No test file referenced any deleted symbol (verified via git grep over tests/). Full suite python -m pytest tests/ -q -p no:cacheprovider: 1321 passed, 1 pre-existing acceptable failuretests/test_scoring.py::TestRSIScoring::test_bull_overbought_matches_neutral_post_revert (stale-local-config; passes on CI). Identical to the pre-change baseline. Zero new failures.

Deferred

None for this PR. R3 (balance-sheet tool) → PR2; R5 (perf-tracker fallback) → PR3.


DEPLOY HELD — research auto-deploys on merge; do not merge until user directs. Part of the yfinance-centralization arc (plan doc alpha-engine-docs/private/yfinance-centralization-260516.md); intended to land before the held Research re-run.

🤖 Generated with Claude Code

yfinance-centralization arc (plan: alpha-engine-docs/private/yfinance-centralization-260516.md),
PR 1 — research dead-code excision. Zero runtime behavior change (dead/dormant code
with no live consumers; the one nominal-data path R4 fed was already broken).

Deleted:
- R2: data/scanner.py::apply_balance_sheet_filter (zero callers — git grep found
  only the def). Also removed the now-unused MAX_DEBT_TO_EQUITY / MIN_CURRENT_RATIO
  / BALANCE_SHEET_EXEMPT_SECTORS config imports (used only by that fn; config.py
  definitions kept — signature/config-surface change is out of scope).
- R1: data/fetchers/price_fetcher.py::fetch_short_interest + `import yfinance as yf`
  + the short-interest-only telemetry (`_yf_request_count`, `get_yf_request_count`).
  No live caller — scoring/aggregator.py's `short_interest_data` param is never
  populated (only offline_stubs registered it). Docstring updated to state the
  module is now yfinance-free.
- R4: data/fetchers/options_fetcher.py — deleted the whole module. `fetch_options_signals`
  had no live caller; `cache_options_to_s3` + private helpers served only it; the
  module had no live function. The two `from data.fetchers.options_fetcher import
  fetch_options_data` imports in quant_tools/qual_tools referenced a symbol that
  NEVER existed anywhere in the repo (verified) — i.e. get_options_flow already
  had no working data path (the import raised, caught/uncaught depending on tool).
  Replaced both fallback legs with the tool's existing `{"error": ...}`
  graceful-degrade shape (qual_tools keeps its working S3-first path intact;
  quant_tools had no S3 path). Net behavior: tools no longer raise an uncaught
  ImportError under all-agents-strict — they degrade gracefully per their
  documented contract; no live data path changed (there was none).

Kept (out of scope per plan): scoring/aggregator.py's inert `short_interest_data`
/ `options_data` params (removing them is a separate signature change).

Tests: no test file referenced any deleted symbol (verified). offline_stubs
registrations/stubs for the deleted symbols removed for consistency (dev-only;
the apply loop already tolerates missing targets). Full suite:
1321 passed, 1 pre-existing acceptable failure
(tests/test_scoring.py::TestRSIScoring::test_bull_overbought_matches_neutral_post_revert
— stale-local-config, passes on CI). Identical to pre-change baseline.
Zero new failures.

**DEPLOY HELD — research auto-deploys on merge; do not merge until user directs.
Part of the yfinance-centralization arc (plan doc
alpha-engine-docs/private/yfinance-centralization-260516.md); intended to land
before the held Research re-run.**

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit 12c9ceb into main May 17, 2026
1 check passed
@cipher813 cipher813 deleted the fix/yf-pr1-deadcode branch May 17, 2026 01:39
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