Skip to content

Fix/market data review#35

Open
stevehome wants to merge 9 commits intoed-donner:mainfrom
stevehome:fix/market-data-review
Open

Fix/market data review#35
stevehome wants to merge 9 commits intoed-donner:mainfrom
stevehome:fix/market-data-review

Conversation

@stevehome
Copy link
Copy Markdown

No description provided.

stevehome and others added 9 commits March 23, 2026 11:29
- Add project README.md with setup, architecture, and dev instructions
- Update PLAN.md: switch LLM integration from OpenRouter to direct Cerebras API, add review notes and open questions section, clarify SSE/portfolio/chat details
- Update cerebras SKILL.md to reflect direct Cerebras API via LiteLLM

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…7066532

1Add Claude Code GitHub Workflow
…ommands

- Increment _version in PriceCache.remove() so SSE clients detect ticker removals
- Add planning review and API docs
- Add Claude commands and plugin config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comprehensive review of backend/app/market/ covering test results (73/73 passing),
coverage analysis (91% overall), and identified issues with recommendations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fety and design issues

- PriceCache.version: acquire lock (free-threaded Python safety, 4.2)
- GBMSimulator._add_ticker_internal: remove dead guard, add caller contract note (4.1)
- SimulatorDataSource add/remove_ticker: document start() pre-condition (4.5)
- stream.py: move APIRouter creation inside create_stream_router() to prevent double-registration (4.4)
- Add test_stream.py: 7 new tests covering _generate_events, router factory, and handler response (4.3)
- Add test for all 10 default tickers Cholesky decomposition (4.6)
- Add httpx to dev dependencies for async test client

Coverage: 91% → 98%. All 81 tests pass, lint clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stevehome
Copy link
Copy Markdown
Author

extra tests and fixes
ok to merge

@MarouaneBD
Copy link
Copy Markdown

Code review

Found 2 issues:

  1. README.md was updated to require CEREBRAS_API_KEY, but planning/PLAN.md (the authoritative project spec embedded in CLAUDE.md) still specifies OPENROUTER_API_KEY as the required environment variable and describes the LLM integration as "LiteLLM → OpenRouter". The two documents are now inconsistent — PLAN.md section 5 and 9 should be updated to reflect the switch to direct Cerebras API.

finally/README.md

Lines 42 to 46 in 639ee2e

| Variable | Required | Description |
|----------|----------|-------------|
| `CEREBRAS_API_KEY` | Yes | LLM inference via Cerebras |
| `MASSIVE_API_KEY` | No | Real market data via Massive/Polygon. Uses simulator if absent. |
| `LLM_MOCK` | No | Set `true` for deterministic mock LLM responses (testing/CI) |

  1. The integration example in planning/MARKET_API.md shows app.include_router(router, prefix="/api"), but create_stream_router() returns a router that already stores routes under /stream/prices (with the router itself carrying the /api/stream prefix). Following the example literally would register the endpoint at /api/api/stream/prices instead of /api/stream/prices.

router = create_stream_router(price_cache)
app.include_router(router, prefix="/api")
# Registers: GET /api/stream/prices (text/event-stream)
```

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants