Skip to content

fix(prices): remove silent simulation and expose data provenance (#2) - #14

Merged
ayushcmd merged 1 commit into
mainfrom
fix/issue-2-market-data
Dec 1, 2026
Merged

ayushcmd merged 1 commit into
mainfrom
fix/issue-2-market-data

Conversation

@ayushcmd

@ayushcmd ayushcmd commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Closes #2

Changes

  • Removed automatic GBM/random price and history fallback. Return observed Yahoo Finance quotes, explicitly stale last-known observations, or null/unavailable records. Preserve identity for every configured market.
  • Separate observation/bar timestamp from retrieval timestamp, mark observations older than 30 minutes stale (including closed markets), and never infer market-open status or invent volume. 5-minute bars are not a certified real-time feed.
  • Propagate provenance through REST, WebSocket, ticker, CSV/JSON export, correlation and AI context; label stale and missing records in the frontend, fail closed for legacy unmarked responses, exclude incomplete quotes from calculations and stale quotes from alert triggers.
  • Label India reference assumptions and modeled values; prevent simulator calculations without an available base quote.
  • Add five mocked backend regression tests and a PR workflow for backend tests, frontend type check and build. Document the new API contract in docs/price-data-contract.md.

Validation and limitations

  • Source changes assembled and inspected through GitHub. Tests and builds have not been executed locally; review the PR workflow results and browser preview before merge.
  • Nullable fields are an API contract change: deploy the compatible frontend and backend together (frontend first if staged, since it rejects legacy unmarked data).
  • Last-known cache is process-local, so a cold restart with provider failure yields unavailable records. Market state and volume remain unknown until authoritative integration. Provider availability, timestamp/contract semantics, and existing symbol/unit mappings need live validation. Cache coalescing included narrowly to preserve consistency; comprehensive upstream performance work remains perf(backend): Coalesce commodity price refreshes and bound upstream yfinance work #5.
  • India macro baselines, FX fallback, alert crossing semantics, AI rate limits, and socket lifecycle issues remain separate issues.

Do not merge until tests and preview are reviewed.

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
commoditychain Ready Ready Preview Dec 1, 2026 12:34pm UTC

@netlify

netlify Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for commoditychain ready!

Name Link
🔨 Latest commit dfb8c5e
🔍 Latest deploy log https://app.netlify.com/projects/commoditychain/deploys/6b0ebecb9e359d92fd33916b
😎 Deploy Preview https://deploy-preview-14--commoditychain.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9357a3cc-bd92-4775-a195-2335741c5bd5
Commits

Reviewing files that changed from the base of the PR and between 1893b19 and dfb8c5e.

Files selected for processing: 29

  • .github/workflows/price-provenance.yml
  • backend/models/commodity.py
  • backend/routers/analyst.py
  • backend/routers/correlation.py
  • backend/routers/export.py
  • backend/routers/india.py
  • backend/routers/prices.py
  • backend/services/commodity_service.py
  • backend/tests/test_price_provenance.py
  • docs/price-data-contract.md
  • frontend/src/app/alerts/page.tsx
  • frontend/src/app/analyst/page.tsx
  • frontend/src/app/converter/page.tsx
  • frontend/src/app/correlation/page.tsx
  • frontend/src/app/explorer/page.tsx
  • frontend/src/app/export/page.tsx
  • frontend/src/app/india/page.tsx
  • frontend/src/app/learn/page.tsx
  • frontend/src/app/map/page.tsx
  • frontend/src/app/news/page.tsx
  • frontend/src/app/page.tsx
  • frontend/src/app/simulator/page.tsx
  • frontend/src/app/watchlist/page.tsx
  • frontend/src/components/Navbar.tsx
  • frontend/src/components/Topbar.tsx
  • frontend/src/hooks/usePrices.ts
  • frontend/src/lib/api.ts
  • frontend/src/lib/utils.ts
  • frontend/src/types/index.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ayushcmd ayushcmd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove silent simulation

@ayushcmd
ayushcmd merged commit 4938a40 into main Dec 1, 2026
9 checks passed

This branch was successfully deployed

1 active deployment
Preview — dfb8c5e9 Deployed Dec 1, 2026 by vercel[bot]
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.

fix(prices): Disclose simulated market data and its provenance instead of labeling it live

1 participant