Skip to content

feat(updater): closed funds skip fetch and guard, guard rejection is failed, test groups of at most five - #86

Merged
daggerok merged 1 commit into
mainfrom
feat/closed-funds-guard-policy
Oct 26, 2026
Merged

daggerok merged 1 commit into
mainfrom
feat/closed-funds-guard-policy

Conversation

@daggerok

Copy link
Copy Markdown
Owner

What changed

  • Q1 (open-items etfs): the shared holdings-guard block now carries ClosedFund, closedFund, markClosedFunds, withoutClosedFunds (applied with apply-holdings-guard.ts). CLOSED_FUNDS is added right after HOLDINGS_GUARD_RELAX and stays empty: XLUI was checked against SEC filings and is still trading (497K 2026-04-28, 485BPOS 2026-10-09, no liquidation filing)
  • Wiring in main(): withoutClosedFunds wraps selected (after the catalog, TICKERS and return/yield filters, before the cursor and the MAX_FETCHES slice), markClosedFunds wraps the sorted index rows right before index.json is built. A closed fund whose row is published passes the unknown-TICKERS check even when the live catalog dropped it, and its row is never pruned
  • Q2: no behaviour change. A guard rejection already throws inside processFund and is reported failed (fund line, [ done ] tally, step summary, all-failed error). A new fund whose holdings the guard rejects, or that no source answered (navhist 404 fails it), gets a catalog-only row from freshRow (dataFile null, holdings 0, the same 30 metrics keys with returnsBasis) and no files; the guard reads the previous state from meta.json, never from an index row
  • Q12: test groups split to at most five tests (controls 4+3, parsing 3+3, metrics 4+4, pipeline 5+4+4, network 5); the monthEnd fixture shared by both metrics groups moved to module scope instead of a copy

Why

One closed-fund policy and one guard-failure policy across the 29 brands, test groups of one to five tests

Checks run

  • New test a closed fund is never fetched or reported failed: ...; it fails with withoutClosedFunds reverted (all 1 selected funds failed), with markClosedFunds reverted (row mismatch) and with the TICKERS exemption reverted (unknown ticker XLK)
  • bun test: 38 -> 39 tests, 293 -> 305 expect() calls; identical counts before and after the split (39 / 305)
  • gates.sh SPDR: test, test with the workflow env, both bun build, git diff --check, hub checks, exec bit, tc/check.sh adds no IDE errors vs origin/main -> SPDR GATES OK
  • Real run TICKERS=XLU REQUEST_SLEEP=0 bun scripts/update-data.ts: 1 unchanged, 0 failed; with XLU temporarily in CLOSED_FUNDS: [ closed ] XLU, 0 funds processed, 0 failed, index.json diff only the closed marks plus generatedAt (data discarded)

…failed, test groups of at most five

- open-items etfs Q1: shared CLOSED_FUNDS block (empty for SPDR), closed funds leave the queue before any request and their index row is marked closed; a published closed fund passes the unknown TICKERS check and is never pruned
- open-items etfs Q2: already compliant (guard rejection is failed, a new fund gets a catalog-only row), verified with mocked runs
- open-items etfs Q12: test groups split to at most five tests, shared month-end fixture moved to module scope
@daggerok
daggerok merged commit 67ab564 into main Oct 26, 2026
1 check passed
@daggerok
daggerok deleted the feat/closed-funds-guard-policy branch October 26, 2026 05:05
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