Claude/market data backend design tc26mr - #167
Open
zuoang25 wants to merge 2 commits into
Open
Conversation
* "Update Claude PR Assistant workflow" * "Update Claude Code Review workflow"
Write planning/MARKET_DATA_DESIGN.md covering the full market data subsystem: the PriceUpdate model, the thread-safe PriceCache, the MarketDataSource interface both implementations honour, the GBM simulator (model, time step, Cholesky-correlated moves, shock events), the Massive REST client (polling budget, threading, two-level error handling), the factory, the SSE endpoint and wire format, FastAPI lifecycle integration, watchlist coordination, configuration, testing strategy, edge cases, and known gaps. Numerical claims about the simulator are verified against the running implementation; Appendix A reproduces the verification script and its output (correlation matrix positive-definiteness, realised volatility and correlation vs targets). References are given for the GBM model, the Cholesky construction, the Massive API limits, and the SSE spec. Also point CLAUDE.md at the new document. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U5pzyDaXVowQAY4YPLSM1C
There was a problem hiding this comment.
🟡 Changes recommended
There are a few documentation/config-example correctness issues (stored as inline comments) that should be fixed to avoid misleading readers copying the examples.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a comprehensive, implementation-aligned design document for the market data backend and wires it into the repository’s documentation pointers, plus minor adjustments to Claude Code workflow configuration comments.
Changes:
- Added
planning/MARKET_DATA_DESIGN.mddetailing the market data subsystem architecture, interfaces, simulator, Massive client, cache, SSE stream, and integration/testing notes. - Updated
CLAUDE.mdto reference the new market data design document alongside existing summaries/archives. - Tweaked Claude Code GitHub workflow prompts/arguments (and an example comment) for code review automation.
File summaries
| File | Description |
|---|---|
| planning/MARKET_DATA_DESIGN.md | New detailed market data backend design document (architecture, APIs, examples, testing, known gaps). |
| CLAUDE.md | Adds a pointer to the new market data design doc in the repo’s documentation index. |
| .github/workflows/claude.yml | Adjusts a commented claude_args example line (documentation-only). |
| .github/workflows/claude-code-review.yml | Updates Claude Code Review workflow prompt/args to enable commenting behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return router | ||
| ``` | ||
|
|
||
| **3. `PriceCache.version` reads without the lock.** Safe today — a CPython `int` read is atomic under the GIL — but inconsistent with every other accessor, and not guaranteed under a free-threaded build (PEP 703 [17]). One-line fix: |
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | ||
| # or https://code.claude.com/docs/en/cli-reference for available options | ||
| # claude_args: '--allowed-tools Bash(gh pr:*)' | ||
| # claude_args: '--allowed-tools Bash(gh pr *)' |
|
|
||
| This document is the full design of the market data subsystem: the unified data-source interface, the built-in Geometric Brownian Motion (GBM) simulator, the Massive (formerly Polygon.io) REST client, the shared price cache, and the Server-Sent Events (SSE) endpoint that pushes prices to the browser. Every code block below is either verbatim from the implementation or a worked example that runs against it. | ||
|
|
||
| Numerical claims in §6 (volatility calibration, correlation targets, positive-definiteness of the correlation matrix) were verified by running the implementation; the verification script is reproduced in [Appendix A](#appendix-a--reproducing-the-calibration-checks) so it can be re-run in a Jupyter notebook. |
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.
No description provided.