Fix market data review issues#4
Merged
gsarchioni merged 1 commit intomainfrom Mar 29, 2026
Merged
Conversation
Address issues from MARKET_DATA_REVIEW.md: - PriceCache.version now acquires lock on read (thread safety) - PriceCache.remove() bumps version (SSE detects ticker removal) - GBMSimulator and SimulatorDataSource normalize ticker case - Add PriceCache.tickers() method for querying tracked symbols - Move router creation inside create_stream_router() factory - Add event: price-update field to SSE events - Type _fetch_snapshots return as list[TickerSnapshot] - Fix stale CLAUDE.md references to nonexistent files Adds 16 new tests (89 total, all passing): - 6 tests for SSE stream generator (previously untested) - 5 tests for PriceCache (version on remove, tickers method) - 3 tests for GBMSimulator ticker normalization - 2 tests for SimulatorDataSource ticker normalization Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Addresses all actionable issues from
planning/MARKET_DATA_REVIEW.md:PriceCache.versionread now acquires the lock (thread safety)PriceCache.remove()increments version so SSE detects ticker removalGBMSimulatorandSimulatorDataSourcenormalize ticker case (upper().strip()), matchingMassiveDataSourcebehaviorPriceCache.tickers()method returns the set of tracked symbolscreate_stream_router()— no module-level side effectevent: price-updatefield for named event listeners_fetch_snapshotsreturn typed aslist[TickerSnapshot]planning/MARKET_DATA_SUMMARY.mdandplanning/archiveIssues ed-donner#3 (SSE sends all tickers) and ed-donner#9 (GBM dt drift) are noted in the review as acceptable/non-blocking and are not addressed here.
Test plan