Commit 9880a39
committed
fix: comprehensive security, persistence, and AI authenticity improvements
Security:
- Restrict static serving to ./public/ — .env.local no longer HTTP-accessible
- Real JWT signature verification using jsonwebtoken (not base64 decode)
- Stripe webhook signature verification via stripe.webhooks.constructEvent()
- Add JWT_SECRET, STRIPE_WEBHOOK_SECRET to .env.example
Persistence:
- Replace in-memory Map() database with better-sqlite3 SQLite
- WAL mode + UPSERT prepared statements for atomic operations
- Data persists across server restarts
AI Experience Fix:
- LLM-first planning: Gemini/Groq always called first for all questions
- Hardcoded analytic/heuristic planners are now fallback-only (not default)
- buildAgentTrace() now reflects what actually ran — no more fake static strings
- llmError propagated to agent trace for transparency
Runtime Bug Fixes:
- AbortController on both SSE stream loops prevents zombie LLM token burn on disconnect
- MediaPipe hand tracking fails gracefully with UI fallback (no viewport crash)
Code Quality:
- Remove unused imports in planSchema.js and app.js
- Fix consistent-return lint in auth.js and llmQuota.js
Production:
- GitHub Actions CI pipeline (.github/workflows/ci.yml)
- New env vars documented in .env.example1 parent d807486 commit 9880a39
18 files changed
Lines changed: 3428 additions & 98 deletions
File tree
- .github/workflows
- data
- public
- assets
- models
- server
- db
- middleware
- routes
- services
- src
- ai
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
Binary file not shown.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
Loading
Loading
0 commit comments