Address market data backend review findings - #155
Closed
raunaksachdev wants to merge 10 commits into
Closed
Conversation
…gent tooling README now describes what's actually built (market data subsystem only) rather than the full target app, with planned features/API/testing sections linked back to PLAN.md. PLAN.md updated to match decisions made since the last pass: Angular over Next.js, free-tier OpenRouter model, ECharts, plus SQLite/avg-cost/ SSE clarifications. Adds project-level agent tooling (change-reviewer subagent, doc-review command, marketplace.json) and its first review output. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019K6SfhrZQx6fCUASEDwJNW
…87476887332 Add Claude Code GitHub Workflow
Writes planning/MARKET_DATA_DESIGN.md as an implementation-ready reference covering the unified MarketDataSource interface, PriceCache, GBM simulator, Massive API client, SSE streaming, and FastAPI lifecycle wiring. Code snippets are verified against the current backend/app/market/ implementation, correcting drift present in the older planning/archive/MARKET_DATA_DESIGN.md (lazy-import framing for the massive client, GBMSimulator.get_tickers() visibility, stream.py's generator return type). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RyKr4TS8gMZPNU8roFiYUT
…dvkdo docs: add comprehensive market data design reference
Fresh pass over backend/app/market/ and its test suite: confirms all 7 issues from the prior archived review are genuinely fixed, verifies 73/73 tests pass at 91% coverage, and surfaces a few new low-severity findings (a dormant falsy-timestamp edge case in PriceCache, two test-quality gaps, and stale coverage figures in MARKET_DATA_SUMMARY.md). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add independent code review of the market data backend
… fix flaky/weak tests, fix falsy-timestamp bug - Add ASGI-route-level and generator-level tests for stream.py (0% -> 100% coverage on that module). Note: the httpx ASGITransport / FastAPI TestClient recipe suggested in MARKET_DATA_DESIGN.md deadlocks against _generate_events's infinite loop in the installed dependency versions (both buffer the full response before returning), so the tests instead drive the real generator and route handler coroutine directly. - Fix PriceCache.update() treating an explicit timestamp=0.0 as falsy and silently replacing it with time.time(). - test_exception_resilience now actually injects a step() failure and asserts the loop recovers, instead of just asserting the task is alive. - Widen the timing margin in test_custom_update_interval to remove latent flakiness risk. - ruff format the 3 flagged test files. - Add httpx as a dev dependency (needed for the new stream tests). - Update the stale coverage figures in planning/MARKET_DATA_SUMMARY.md and README.md to the current 79 tests / 99% overall. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Author
|
Opened against the wrong repo by mistake (gh defaulted to upstream instead of my fork). Recreating against raunaksachdev/finally. |
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
planning/MARKET_DATA_REVIEW.md:stream.pywas untested (0% on the SSE generator/route); now at 100% via generator-level and route-handler-level tests (backend/tests/market/test_stream.py). Note: the httpxASGITransport/ FastAPITestClientrecipe suggested inMARKET_DATA_DESIGN.md§12.4 deadlocks against_generate_events's infinite loop with the currently installed dependency versions (both buffer the entire ASGI response before returning control), so these tests drive the real generator and route coroutine directly instead.PriceCache.update()silently replacing an explicittimestamp=0.0withtime.time()(falsy-zero bug, dormant in production but worth closing).test_exception_resiliencenow actually injects astep()failure and asserts the simulator loop recovers, instead of just checking the task is alive.test_custom_update_intervalto remove latent CI flakiness risk.ruff format's the 3 previously-flagged test files.planning/MARKET_DATA_SUMMARY.mdand the top-levelREADME.mdto the current numbers (79 tests, 99% overall coverage).Test plan
uv run pytest -v— 79 passed, 0 faileduv run pytest --cov=app— 99% overall (stream.py: 100%, up from 33%)uv run ruff check app/ tests/— all checks passeduv run ruff format --check app/ tests/— all files formatted🤖 Generated with Claude Code