Skip to content

feat(updater): shared calendar dates, ticker and new-fund checks, guard keeps numeric weights - #88

Merged
daggerok merged 1 commit into
mainfrom
feat/shared-updater-blocks
Oct 26, 2026
Merged

daggerok merged 1 commit into
mainfrom
feat/shared-updater-blocks

Conversation

@daggerok

Copy link
Copy Markdown
Owner

What changed

SPDR adopts the shared updater blocks of the ETF template that it has a path for (.claude/tools/etfs/etf-std/*.block.ts, applied with apply-block.ts, byte-identical in every brand), as in Schwab daggerok/Schwab#75. SPDR has no N-PORT code and no Yahoo window (its NAV history comes from SSGA's workbook and mergeOlderRows already keeps older rows), so nport-reader and windowed-chart are left out:

  • holdings-guard (Q24): an all-non-numeric weight sheet never replaces a published sheet with numeric weights, even when numeric and sum are relaxed (spdrHoldingsProblem passes holdingsWeightCount of the published pages)
  • calendar-dates: toIsoDate and the workbook historyDate are calendarIso (same days as before, plus Aug 31, 2026 and two-digit years); withoutYoungReturns now nulls 1y, 3y, 5y and 10y figures a fund is too young for, not only since inception
  • fund-selection (Q27, Q28): a TICKERS entry outside the live catalog and the published funds stops the run right after the catalog, before the bulk feeds and any fund request (a published fund that left the catalog now counts as known, like a published closed fund before); NEW FUNDS: names a fund on its first successful publish (was: every catalog ticker missing from the index before the run, published or not), NEW FUNDS (not published yet): a new fund that has no data yet
  • Brand ticker hygiene (ACA, tickers on 2+ securities): SSGA's Ticker of a line in another currency is the local code (ACA = Arcosa in USD and Credit Agricole in EUR, 2330, A000660), so withListedTickers publishes - for a line whose Local Currency is not USD, and for futures, options and cash lines; the row stays keyed by its Identifier

Published values that change on the next run: holdings tickers of non-USD lines in the international funds (CWI, SPDW, SPEM, GXC and the rest) become -, and futures, option and CASH_USD lines lose their ticker; USD equity tickers (SPY, XLK) stay as they are

How it was checked

  • bun test: 45 pass, 0 fail (exit 0), also with the workflow control variables of update-data.config.json exported; the new tests fail without their wiring (checked by removing each piece: guard argument, ticker check, NEW FUNDS report, age rule, calendar dates)
  • bun build --target=bun scripts/update-data.ts --outfile=/dev/null, bun build --target=bun src/main.tsx --outfile=/dev/null, git diff --check, hub check-readme.ts, check-scripts.ts, apply-block.ts --check holdings-guard,calendar-dates,fund-selection (identical), split-test-groups.ts (no group over five)
  • .claude/tools/etfs/tc/check.sh: no new errors (48 -> 48 pre-existing lines)
  • live runs (data discarded): TICKERS="SPY XLK CWI GLD" -> 4 updated with the new trading day, SPY and XLK tickers unchanged, CWI local tickers -> -; HISTORY_RANGE=1y TICKERS=SPY -> history 5764 rows kept

…rd keeps numeric weights

SPDR adopts the shared updater blocks it has a path for (holdings-guard Q24, calendar-dates, fund-selection Q27 Q28; no N-PORT or Yahoo window) and publishes a bare holdings ticker only for a U.S. listing.
@daggerok
daggerok merged commit bd0fb78 into main Oct 26, 2026
1 check passed
@daggerok
daggerok deleted the feat/shared-updater-blocks branch October 26, 2026 06:41
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