Feat/issue 39 llm personalized insight generation - #84
Open
nattyakos07-web wants to merge 3 commits into
Open
Conversation
nattyakos07-web
commented
Aug 21, 2026
- Add UserPerformance and TrendSignal interfaces (discriminated union,
priorities 1-5) in src/coach/interfaces/trend.interface.ts
- Implement TrendService.detectSignals() with five signal detectors:
hot-streak (≥4 consecutive correct, priority 1)
cold-streak (≥4 consecutive wrong, priority 2)
improving (recent-10 accuracy ≥15pp above overall, priority 3)
declining (recent-10 accuracy ≥15pp below overall, priority 4)
near-milestone (within 2 of total round-number or PB streak, p. 5)
- All six thresholds configurable via TREND_* env vars with documented
defaults; invalid values fall back to defaults gracefully
- Results are always priority-ordered; multiple simultaneous signals
are all returned
- Service is pure and deterministic (no side effects, no mutation)
- Add CoachModule exposing TrendService
- 194 exhaustive unit tests: positive + negative for every signal type,
simultaneous signals, priority ordering, env overrides, determinism
…rena1X#39) - Add CoachingInsight and LlmInsightResponse interfaces - Add coaching-insight prompt template (UserPerformance + TrendSignal[]) - Add INSIGHT_BLOCKLIST with containsInsightBlockedPhrase() enforcement - Add CoachService.generateInsights() wiring performance → trends → LLM → validated insights - Hard rules enforced post-generation: max 280 chars, no gambling phrases - Fallback to deterministic template messages on LLM failure or full rejection - Update CoachModule to register CoachService and LlmService
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.