Repository navigation
fix(holdings): accept only a name and weight table as product-page top holdings - #82
Merged
Merged
Conversation
…p holdings The product-page fallback parsed the Holdings Summary allocation table of the long/short funds (Group, Long, Short, Group Weight) as holdings. Only a Name plus weight table inside the Holdings section counts now, the section ends at the next heading, and a list whose weights add up to more than 105 is rejected unless the fund is in TOP_HOLDINGS_LEVERAGED (empty).
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
parseTopHoldingsMarkdown(product-page top holdings fallback) reads only the### Holdingssection up to the next heading of level 1-3, and only a table whose header isNameplus a weight column (Weight (%)). Any other table (the long/short funds'Group | Long | Short | Group Weightallocation summary) gives no rowsTOP_HOLDINGS_LEVERAGED, which stays empty: WSLS and WTAL publish no holdings list at all, so nothing needs the overrideWhy
WSLS (Efficient Long/Short U.S. Smallcap) and WTAL (Global Alpha) published their allocation table as holdings: 34 and 57 rows like "Group" 0, "Cash&Collateral" 100, "Equities" 100.72, sectors, "Equity Futures" 90, summing to 581.43 and 599.68. The old parser matched
### Holdings Summary, skipped only aNameheader row and took the second column (Long) of any tableEvidence
### Holdings Summarywith| Group | Long | Short | Group Weight |(Equities long 100.72% short -88.06%, Equity Futures 90%); WSPC shows### Holdings/| Name | Weight (%) |top 10 plus Remaining Portfolio, then### Sector Breakdown(also Name/Weight, must not be read)After this PR
WSLS and WTAL keep their published allocation rows: the parser gives nothing, so the updater re-uses the published sheet (not checked by the guard, which only checks fresh holdings) and refreshes everything else. They change only when an N-PORT filing appears or the published sheet is removed (owner decision, not done here)
Checks run
bun test: 53 pass, 0 fail (rc 0); same with the config values exported as env: 53 pass (rc 0)parsingtest (WSPC-like list stopping at the next heading, WSLS-like allocation summary, a list summing 191.4, no holdings section) andpipelinetest (a published Name/Weight list, then an allocation summary: holdings stay as published, returns refresh, exit code 0). With the origin/main parser both tests fail (checked once)bun build --target=bun scripts/update-data.ts --outfile=/dev/null: rc 0;git diff --check: cleantc/check.sh: esnext 0, ide 67 error lines (same as origin/main)