Files
finanzen/backlog/tasks/task-7 - Add-all-read-only-savings-agent-insight-tools.md

55 lines
2.8 KiB
Markdown

---
id: TASK-7
title: Add all read-only savings agent insight tools
status: Done
assignee: []
created_date: '2026-06-15 19:39'
updated_date: '2026-06-15 19:54'
labels: []
dependencies: []
priority: high
ordinal: 7000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Expand Talk to Savings with eight additional read-only AI SDK tools for accounts, categories, recurring transactions, anomalies, uncategorized transactions, period comparison, fixed-cost forecasting, and savings-rate explanations.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Agent registers all eight new read-only tools and returns compact trace summaries without raw/private fields
- [x] #2 Metadata and data-quality tools return scoped, sanitized accounts, categories, and uncategorized transaction insight
- [x] #3 Period, savings-rate, recurring, fixed-cost forecast, and anomaly tools compute deterministic aggregates
- [x] #4 Convex tests cover each new tool and mocked ask() registration
- [x] #5 Focused tests, targeted lint, build, and full lint status are documented
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
1. Add failing coverage for all eight read-only savings insight tools and ask() registry
2. Implement scoped/sanitized internal Convex queries and deterministic finance helpers
3. Register the tools in savingsChat.ask and add compact trace summaries
4. Verify focused tests, targeted lint, build, and document full-lint blockers
<!-- SECTION:PLAN:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Implemented eight new read-only tools in convex/savingsChat.ts: accounts, categories, recurring patterns, anomalies, uncategorized transactions, period comparison, fixed-cost forecast, and savings-rate explanation.
Verification: npx vitest convex/savingsChat.test.ts --run --reporter=dot passed (17 tests).
Verification: npx eslint convex/savingsChat.ts convex/savingsChat.test.ts src/pages/SavingsChatPage.tsx passed.
Verification: npm run build passed with existing Vite chunk-size warning.
Full npm run lint still fails on unrelated existing files: convex/bank/comdirectProvider.ts, convex/bank/config.ts, src/components/import/TanAwaitDialog.tsx, several react-refresh only-export-components files, and src/pages/SettingsPage.tsx; warnings also remain in generated Convex files and React Hook Form/TanStack Table locations.
Hardened compare_periods snapshots to omit category IDs while keeping existing summarize_spending output compatible. Re-ran focused Vitest, targeted ESLint, and build successfully after this change.
<!-- SECTION:NOTES:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Closed as Done after explicit user confirmation to mark all tasks done. Implementation and verification notes are already recorded on the task.
<!-- SECTION:FINAL_SUMMARY:END -->