learning_ai_clock/backend
saravanakumardb1 8ca9e27532 test(ai-context): TODO-009 unit tests for LLM context message generators
Adds 18 new tests covering:

Backend (13 tests in ai-context.test.ts):
- keyword fallback — meeting, doctor, flight, case-insensitive
- generic fallback — no match, minute/hour formatting
- LLM path — flag-gated (off = no fetch), extraction-service success,
  Ollama cascade when extraction returns null, error → keyword fallback,
  short Ollama response rejected, non-200 fallthrough
- prompt construction — includes category, urgency, timeOfDay,
  recentTimerLabels

Web (5 new tests in context-messages.test.ts):
- LLM success path
- keyword fallback when backend returns 500
- keyword fallback when backend throws
- generic fallback when backend fails and no keyword matches
- payload shape — POST /api/context-message with all params

Test counts: backend 240 (was ~227), web 399 (was ~394), all green.
2026-04-17 12:40:10 -07:00
..
src test(ai-context): TODO-009 unit tests for LLM context message generators 2026-04-17 12:40:10 -07:00
.env.example fix(backend): harden Phase A endpoints — Zod validation, feature flag gate, state filtering 2026-03-31 23:56:35 -07:00
.gitignore feat(backend): scaffold product-specific Fastify backend (port 4011) 2026-03-01 20:39:08 -08:00
Dockerfile fix(docker): .docker-deps COPY + optional secret + .npmrc.docker simplification 2026-04-13 14:05:54 -07:00
eslint.config.js chore(backend): add eslint config and lint script 2026-03-26 22:59:50 -07:00
package.json feat(backend): add domain event bus + webhook dispatch 2026-04-13 11:28:38 -07:00
tsconfig.json feat(backend): scaffold product-specific Fastify backend (port 4011) 2026-03-01 20:39:08 -08:00
vitest.config.ts feat(backend): scaffold product-specific Fastify backend (port 4011) 2026-03-01 20:39:08 -08:00