Repository navigation
fix(holdings): keep junk sheets and non-numeric weights out of the feed - #84
Merged
Merged
Conversation
- product-page top holdings: a weight that is no number stays empty, never "0", so the holdings guard's numeric check can fire (open-items etfs Q4) - a published sheet that fails the guard on its own is not republished: WSLS and WTAL lose their allocation tables (weight sums 581 and 600) and the product-page source label until a valid source exists (Q5)
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
parseTopHoldingsMarkdownturns a weight that is no number into an empty cell instead of"0", soholdingsGuard's numeric check can reject a broken product-page listHOLDINGS_GUARD_RELAX, no row-count check). A sheet that fails is junk: it is not republished, the fund getstotalRows: 0with the default sourcenot available from current public SEC filing, the stale page file is removed, and the run prints[ holdings ] <T>: published holdings dropped (...). A later N-PORT filing or a real Name + weight list on the product page fills it againTICKERS=WSLS,WTAL):funds/{WSLS,WTAL}/holdings/001.jsondeleted,holdingsandsource.holdingsSourcein their meta.json reset, index rowsholdings: 0, counts 39,334 -> 39,243 holdings rows. Nothing else in the feed changedWhy
open-items etfs Q4 and Q5, owner decisions 2026-10-25. WSLS and WTAL (launched 2026-10-08, series S000109280 and S000109282, no N-PORT yet) still published the allocation summary the old parser read as holdings (weights add up to 581.43 and 599.68); WT-1 (#82) stopped new junk but kept republishing the old sheet
Evidence that only these two are affected: running the guard over every published sheet (96 funds) rejects exactly WSLS and WTAL; BTCW (1 row) and WSPC (top 10, relaxed
sum) pass. A valid published list is still kept when the page turns into an allocation summary (existing test unchanged)Checks
bun test: 53 pass, 0 fail, exit 0; with the oldupdate-data.ts2 fail (the empty-weight parsing case and the junk-sheet pipeline case)bun build --target=bun scripts/update-data.ts --outfile=/dev/nullandbun build --target=bun src/main.tsx --outfile=/dev/null: exit 0TICKERS=WSLS,WTAL REQUEST_SLEEP=0 bun scripts/update-data.ts:2 updated, 0 failedwith the twodroppedlines (committed); a second run overWSPC,BTCW,WSLS,WTAL: WSLS and WTALunchanged, WSPC and BTCW pass the guard,0 failed(their refreshed data discarded).claude/tools/etfs/tc/check.sh: 64 lines before and after, same set (pre-existing[ide]errors), none addedgit diff --check: cleanNot changed here:
parseNportstill writes"0"for a missingpctVal/valUSD; that belongs to the shared N-PORT reader work (ETF-H2)