Add AI retrospective feature#7
Merged
Merged
Conversation
Pro-only feature that generates AI-powered habit analysis over configurable time periods (week, month, quarter, semester, year). - PayGate: CanUseRetrospective (Pro-only, config-gated) - IRetrospectiveService interface + GeminiRetrospectiveService - Per-habit stats: completion rate, scheduled vs completed, bad habit slips - Structured prompt with Highlights/Missed/Trends/Suggestion sections - Retry with exponential backoff (same as summary service) - GetRetrospectiveQuery with 1-hour memory cache - GET /api/habits/retrospective?period=week&language=en endpoint - DI registration in Program.cs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon
added a commit
that referenced
this pull request
Apr 15, 2026
ValidateOrbitSecuritySettings (Production only) now also: - Rejects any Cors:AllowedOrigins containing 'localhost' or 'http://' so a misconfigured prod deploy fails fast instead of silently allowing local origins to send credentialed requests. - Requires Jwt:SecretKey to be configured (not REPLACE-placeholder) and at least 64 characters long to match HS256 security assumptions. Covers backend plan F1 (P0 #7) and F9 JWT hardening. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon
added a commit
that referenced
this pull request
Apr 15, 2026
ValidateOrbitSecuritySettings (Production only) now also: - Rejects any Cors:AllowedOrigins containing 'localhost' or 'http://' so a misconfigured prod deploy fails fast instead of silently allowing local origins to send credentialed requests. - Requires Jwt:SecretKey to be configured (not REPLACE-placeholder) and at least 64 characters long to match HS256 security assumptions. Covers backend plan F1 (P0 #7) and F9 JWT hardening. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
GET /api/habits/retrospective?period=week&language=enendpointCanUseRetrospectivePayGate check (config-gated viaRetrospectiveProOnly)GeminiRetrospectiveServicebuilds detailed prompt with per-habit completion rates, bad habit slips, sub-habit statsGetRetrospectiveQuerywith 1-hour memory cache keyed byretro:{userId}:{period}:{dateFrom}:{language}ISummaryServicepatternFrontend PR
Companion: https://github.com/thomasluizon/orbit-ui/pull/11
Test plan
GET /api/habits/retrospectivereturns 403 PAY_GATEfromCache: true🤖 Generated with Claude Code