3.1 KiB
3.1 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, priority, ordinal
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | ordinal |
|---|---|---|---|---|---|---|---|---|---|
| TASK-1 | Add complete chat transaction context | In Progress | 2026-06-15 13:52 | 2026-06-15 14:02 | high | 1000 |
Description
Make the savings chat evaluate every transaction matching the selected date range, account, and basis instead of silently sampling 150/300 rows. This includes exact context totals, a full prompt context for the AI action, and regression coverage for large transaction windows.
Acceptance Criteria
- #1 Chat context totals count all matching transactions in the selected range, including more than 400 rows
- #2 Account filtering is applied before counting and summing transactions
- #3 The chat action no longer accepts or passes maxTransactions and reports the complete transaction count
- #4 The frontend no longer passes maxTransactions and continues to show exact totals
- #5 Regression tests, lint, and build verification pass or documented blockers are reported
Implementation Plan
- Add Convex test dependencies and Vitest edge-runtime config
- Write failing convex-test regression for 450 chat transactions and account filtering
- Refactor savingsChat backend to remove maxTransactions and use indexed full scans
- Update schema indexes for account+basis filters
- Remove frontend maxTransactions arguments
- Run focused test, lint, and build verification
- Record verification notes and leave task In Progress pending user confirmation
Implementation Notes
RED verified: npx vitest convex/savingsChat.test.ts --run fails because getContext does not return isComplete and still uses limited context shape.
Verification:
- PASS npx vitest convex/savingsChat.test.ts --run
- PASS npm run build
- PASS npx eslint convex/savingsChat.ts convex/savingsChat.test.ts src/pages/SavingsChatPage.tsx vitest.config.ts
- BLOCKED npm run lint still fails on pre-existing/unrelated files: convex/bank/comdirectProvider.ts, convex/bank/config.ts, src/components/import/TanAwaitDialog.tsx, layout/UI fast-refresh exports, SettingsPage.tsx, and related existing warnings. SavingsChatPage is no longer in the lint output.
Review fix:
- Added effective-basis fallback for legacy transactions without effectiveMonth by reading bookingDate range and including only rows where effectiveMonth is undefined.
- Added prompt-context regression coverage via internal.savingsChat.getPromptContext.
- PASS npx vitest convex/savingsChat.test.ts --run (2 tests)
- PASS npm run build
- PASS npx eslint convex/savingsChat.ts convex/savingsChat.test.ts src/pages/SavingsChatPage.tsx vitest.config.ts
Final review:
- Subagent re-review found no remaining correctness/spec issues.
- Prior blocker resolved: effective-basis loading now includes rows without effectiveMonth via bookingDate fallback queries.
- Fresh full npm run lint still fails only on unrelated existing files; no SavingsChatPage issue remains.