Repository navigation
feat(updater): closed funds skip fetch and guard, guard rejection is failed, test groups of at most five - #86
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ClosedFund,closedFund,markClosedFunds,withoutClosedFunds(applied withapply-holdings-guard.ts).CLOSED_FUNDSis added right afterHOLDINGS_GUARD_RELAXand stays empty: XLUI was checked against SEC filings and is still trading (497K 2026-04-28, 485BPOS 2026-10-09, no liquidation filing)main():withoutClosedFundswrapsselected(after the catalog, TICKERS and return/yield filters, before the cursor and the MAX_FETCHES slice),markClosedFundswraps the sorted index rows right beforeindex.jsonis 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 prunedprocessFundand is reportedfailed(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 fromfreshRow(dataFile null, holdings 0, the same 30 metrics keys withreturnsBasis) and no files; the guard reads the previous state frommeta.json, never from an index rowmonthEndfixture shared by both metrics groups moved to module scope instead of a copyWhy
One closed-fund policy and one guard-failure policy across the 29 brands, test groups of one to five tests
Checks run
a closed fund is never fetched or reported failed: ...; it fails withwithoutClosedFundsreverted (all 1 selected funds failed), withmarkClosedFundsreverted (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, bothbun build,git diff --check, hub checks, exec bit,tc/check.shadds no IDE errors vs origin/main ->SPDR GATES OKTICKERS=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)