Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

fix(market-datasets): remove stooq — unreachable for agents; Polish data via EODHD, WSE indices EODHD-only - #112

Merged
tomlupo merged 2 commits into
mainfrom
fix/market-datasets-no-stooq
Oct 4, 2026
Merged

tomlupo merged 2 commits into
mainfrom
fix/market-datasets-no-stooq

Conversation

@qute-coder

@qute-coder qute-coder Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

stooq blocks datacenter IPs (Hetzner, since 2026-04-21) and answers anything non-browser with a JavaScript challenge. No agent session can fetch from it (Tom, 2026-09-30). The market-datasets skill still routed Polish data there first. Found in the dm-evo-core market-data source review (dm-evo Linear epic TOM-1318).

What

  • Deleted the three stooq fetchers. source='stooq' raises a ValueError that says why and what replaces it.
  • Routing:
    • Polish stocks and ETFs go to EODHD .WAR when EODHD_API_KEY is set, else Yahoo .WA.
    • WSE indices go to EODHD .INDX only. Without the key they raise, because Yahoo serves no history for them (probed: ^WIG20 and ^MWIG40 return 0 rows; WIG20.WA and WIG.WA return 1 row). Every spelling (^X, X.INDX, X.WA, X.WAR, any case) is normalised by one helper.
    • PLN FX goes to NBP, then Yahoo.
  • references/eodhd.md: coverage and licensing verified 2026-09-30 on the Historian plan, using our key read-only:
    • available: WIG, WIG20 and mWIG40 .INDX, GPW Beta ETFs .WAR, XAUUSD.FOREX from 1990;
    • 403 on this plan: GBOND, MONEY, fundamentals and macro;
    • pricing-page plans are personal-use only.
  • dividend_treatment.md is rewritten around the chain-returns trap: an incrementally appended adjusted series loses dividends. It happened in dm-evo-core, fixed by TOM-1310.
  • Playbooks no longer recommend stooq. security_master.csv columns are unchanged; ticker_stooq round-trips as a legacy column.

Known, not changed

  • Bare registry names that only resolved via the stooq column (xtb, ccc, ing) now fall through to Yahoo as bare US tickers.
  • source='eodhd' passes identifiers untranslated. That predates this PR.
  • Removal-mode nits: the yahoo/pdr ^{up} index branch in _ticker_for_source is now unreachable, and _polish_index_key repeats a strip().lower().
  • After merge: re-sync the tracked copies in dm-evo-core and dm-evo-lab (.claude/skills/market-datasets/PROVENANCE.yaml).

Review

Three rounds, run as subagents of the authoring session:

  • Round 1 NO-SHIP: caret spellings of indices, and docs promising a Yahoo fallback.
  • Round 2 NO-SHIP: .WA index spellings.
  • Round 3 SHIP at 6e2b63d.

The skill has no tests. Routing was checked with no network over 14 index spellings, with and without a key.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JidPXNWK2SDcuqn8Wd83GD

Review provenance

The in-session review axes, and the commit each one actually read. A verdict against a branch NAME has no referent — the name moves. Check freshness with qute_review_freshness.py <owner/repo> <pr#>; it exits 1 when an axis is stale and 2 when it cannot tell.

  • standards — verdict SHIP, reviewed at 6e2b63d8f90948a63e38b96c311414dbe7caae65, range main...HEAD, at 2026-09-30T17:10:18+02:00

tomlupo and others added 2 commits September 30, 2026 17:07
…ata via EODHD, indices EODHD-only

stooq blocks datacenter IPs (Hetzner, since 2026-04-21) and answers anything
non-browser with a JavaScript challenge, so no agent session can fetch from it
(Tom, 2026-09-30). Moving means moving: its three fetchers are deleted.

- Routing: Polish stocks/ETFs (`pko`, `.WA`, `.WAR`) -> EODHD `.WAR` when
  EODHD_API_KEY is set, else Yahoo `.WA`. WSE INDICES (`wig20`, `^WIG`,
  `WIG20.INDX`) -> EODHD `.INDX` only; without the key they RAISE, because
  Yahoo serves no history for them (probed: ^WIG20 / ^MWIG40 0 rows). PLN FX
  -> NBP, then Yahoo. `source='stooq'` raises ValueError naming why and what
  replaces it.
- references/eodhd.md: coverage and licensing verified 2026-09-30 on the
  Historian plan (WIG / WIG20 / mWIG40 .INDX, GPW Beta ETFs .WAR, XAUUSD from
  1990; 403 on GBOND, MONEY, fundamentals, macro; pricing-page plans are
  personal-use only).
- dividend_treatment.md rewritten around the chain-returns trap (an
  incrementally appended adjusted series loses dividends).
- security_master.csv columns unchanged; `ticker_stooq` round-trips as a
  legacy column no fetcher reads. Bare registry names that only resolved via
  that column (xtb, ccc, ing) now fall through to Yahoo — noted, not aliased.
- Playbooks no longer recommend stooq.

The tracked copies in dm-evo-core and dm-evo-lab (.claude/skills/market-datasets,
PROVENANCE.yaml) need a re-sync after merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JidPXNWK2SDcuqn8Wd83GD
…AR, any case) normalises before the index check (review round 2)

One helper, _polish_index_key, feeds both the router and the EODHD symbol
builder, so no spelling reaches the ^ or .WA branches and Yahoo. Checked over
14 spellings, with and without an EODHD key.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JidPXNWK2SDcuqn8Wd83GD
@qute-coder
qute-coder Bot requested a review from tomlupo September 30, 2026 15:10
@tomlupo
tomlupo merged commit 9f3c854 into main Oct 4, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant