Skip to content

Task #94: BCTC consistency check — flag extract vs DB history - #76

Merged
thanhhale288 merged 1 commit into
mainfrom
cursor/epic5-phase6-task94-bctc-consistency-check
Aug 19, 2026
Merged

Task #94: BCTC consistency check — flag extract vs DB history#76
thanhhale288 merged 1 commit into
mainfrom
cursor/epic5-phase6-task94-bctc-consistency-check

Conversation

@thanhhale288

Copy link
Copy Markdown
Owner

Summary

  • bctc_consistency.py: So sánh extract fields (từ upload/prefill) với FinancialReport gần nhất trong DB cho cùng ticker; flag lệch ≥ 10%; không overwrite im lặng.
  • POST /api/benchmark/consistency: Nhận { ticker, fields }, trả ConsistencyReport với per-field flags (ok / warn / mismatch).
  • FE BenchmarkConsistencyBanner: Hiển thị banner cảnh báo khi có mismatch sau khi nạp prefill. Im lặng khi không có DB record hoặc tất cả ok.
  • 10 unit tests — 106/106 benchmark tests pass.

Test plan

  • pytest tests/benchmark/test_bctc_consistency.py — 10 passed
  • pytest tests/benchmark/ — 106 passed
  • npm run build trong frontend/ — ✓ no errors
  • CI xanh

Made with Cursor

…ent overwrite

- backend/app/services/bctc_consistency.py: compare extract fields vs latest
  annual FinancialReport per ticker; flag mismatch ≥10%, warn on null sides;
  never overwrites DB.
- POST /api/benchmark/consistency: endpoint returning ConsistencyReport JSON.
- Schema: BctcConsistencyIn / BctcConsistencyOut / BctcConsistencyFlagOut.
- tests/benchmark/test_bctc_consistency.py: 10 unit tests (all pass).
- FE: api.benchmarkConsistency() helper; BenchmarkConsistencyBanner shows
  warning only on mismatch flags (silent when no DB record or all ok).

Co-authored-by: Cursor <cursoragent@cursor.com>
@thanhhale288
thanhhale288 merged commit f6f786d into main Aug 19, 2026
2 checks passed
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.

1 participant