mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
v1.4.16 phase B5e: ship the table that backs per-recommendation thumbs-up / thumbs-down feedback. Each row captures (userId, recId, recText) with snapshotted severity + metric-source attributes plus the provider + prompt-version that produced the rec — server-fills the attribution from the user's most recent cached payload so the client can't tamper. Dedup key (userId, recommendationId, recommendationText) lets a regeneration that rewrites the same id with new text re-rate cleanly while blocking accidental double-submission of the same (id + text). Indexes: (userId, createdAt) for the per-user timeline and (severity, helpful, createdAt) for the daily aggregator's slice. Both are needed by the v1.4.16 admin AI quality preview. GDPR: ON DELETE CASCADE through users; cascade-delete integration test now seeds and asserts a feedback row. Same migration adds AppSettings.adminAiInsightsFeedbackSummary — the JSON blob the daily aggregator (next commit) writes a per-(severity x provider x prompt) helpful-rate to. Null until the aggregator runs or until there is feedback in the 30-day window. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>