Documentation
¶
Overview ¶
Command refresh-spx-members pulls the current S&P-500 constituent list from Wikipedia's "List of S&P 500 companies" article and rewrites internal/breadth/spx/members_data.go with the result. Runs as a developer tool — the daemon itself ALSO scrapes Wikipedia at runtime (internal/breadth/spx/refresh.go) using the same shared parser, so this script and the daemon land on identical bytes for identical inputs. Single source of truth for the parse logic lives at internal/breadth/spx/wikipedia.go.
Invoked by `make refresh-spx-members` and `make release`. The release flow fails-closed if the rewrite produces a diff: the maintainer commits the membership update separately, then re-runs the release. This keeps the binary's checked-in member list in lockstep with the git tag.
Sanity bounds: refuses to write if fewer than MinMembers or more than MaxMembers tickers are extracted (Wikipedia table structure breakage would otherwise silently corrupt the list). The S&P 500 actually carries ~500–505 names with the dual-class entries (BRK.B, GOOG/GOOGL, etc.); the band is intentionally wider than that to absorb transient mid-rebalance editing on the source page.