Skip to content

feat(ai): tighten the daily summary to one ~140-char sentence - #201

Merged
thomasluizon merged 2 commits into
mainfrom
feature/concise-daily-summary
Jun 11, 2026
Merged

thomasluizon merged 2 commits into
mainfrom
feature/concise-daily-summary

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

What

  • Daily summary prompt now asks for ONE short sentence (two very short ones only when the day needs both) and points at a single pending habit instead of "one or two".
  • Hard cap lowered from 200 to 140 chars (MaxSummaryChars), maxOutputTokens 200 -> 120.

Why

The redesigned Início summary card (navy+violet redesign) is a compact 3-line surface with a "see more" expander. The previous prompt allowed ~200 chars / two sentences and the model consistently filled the whole budget with 3-4 sentence pep talks, so every summary landed clamped. Shorter generations fix this at the source instead of leaning on the UI clamp.

Paired UI change: thomasluizon/orbit-ui-mobile#164 (summary card slimming is part of the redesign PR).

Validation

  • dotnet test tests/Orbit.Infrastructure.Tests — 997/997 passed (full chain compiled).
  • CapToSentence tests pass explicit char limits, so the constant change is behavior-safe.

🤖 Generated with Claude Code

The redesigned Inicio summary card is a compact 3-line surface, but the
prompt allowed up to two sentences and ~200 chars and the model kept
drifting to 3-4 sentence pep talks at the full budget. Lead with one
completed habit, point at a single pending one, cap at 140 chars and
120 output tokens.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped prompt-tightening. The constant (200→140) and token cap (200→120) are internally consistent — at typical token densities, 120 output tokens comfortably exceeds the 140-char hard cap, so CapToSentence remains the effective ceiling and no generated text will be truncated at the token boundary before the capper runs. CapToSentence tests are parameterized with explicit limits so they remain correct and decoupled from MaxSummaryChars. No API contract, auth, or DB changes; nothing to flag.

@thomasluizon
thomasluizon merged commit b081539 into main Jun 11, 2026
4 checks passed
@thomasluizon
thomasluizon deleted the feature/concise-daily-summary branch June 11, 2026 21:35
@sonarqubecloud

Copy link
Copy Markdown

thomasluizon added a commit that referenced this pull request Jun 30, 2026
#196) (#268)

* feat(api): achievement-system expansion + free-tier XP earning (#196)

- Append Social/Sharing/Together achievement categories
- Define 10 achievements: FirstFriend, SquadGoals, Cheerleader, ShowOff,
  YearInReview, TeamPlayer, MissionAccomplished, BattleBuddy (defined for
  siblings #197-#201) + StreakImmortal/Unstoppable (wired on streak/volume)
- Add idempotent IGamificationService.TryGrantAchievementsAsync grant funnel
- Add POST /api/achievements/report-event (auth, whitelisted keys:
  card_shared->ShowOff, wrapped_viewed->YearInReview); no Pro gate
- A1: free users earn habit-log + goal XP and level up (achievements stay
  Pro-gated) behind the gamification_free_tier flag predicate
- Data-only migration enabling gamification_free_tier
- Portuguese notification strings for the 10 new achievements
- Inventory report-event in the agent capability catalog

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(api): pin Microsoft.OpenApi to patched 2.7.5 (GHSA-v5pm-xwqc-g5wc)

The Dependency Scan flags a high-severity advisory: Microsoft.AspNetCore.OpenApi
10.0.9 transitively resolves the vulnerable Microsoft.OpenApi 2.0.0 ("circular
schema references may terminate OpenAPI parsing"). Pin a direct reference to the
patched 2.7.5. This affects main and every open branch, not just this PR; it rides
on the foundation PR so it lands on main first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 30, 2026
* feat(api): 1:1 accountability buddies (#201)

Adds a 1:1 accountability-buddy system on top of the #193 social
foundation: invite -> accept between two accepted friends, per-user
linked-habit joins, moderated check-ins that push the buddy, a
Daily/Weekly cadence, multiple pairs per user up to a cap, and
either-party revoke.

- Domain: AccountabilityPair / AccountabilityPairHabit /
  AccountabilityCheckIn entities + AccountabilityPairStatus /
  AccountabilityCadence enums + guards.
- Application: AccountabilityPairService, 6 commands + 2 queries,
  FluentValidation, no-N+1 pairs query.
- API: AccountabilityController (7 routes) + accountability-invites /
  accountability-checkins rate-limit policies.
- Persistence: AddAccountabilityBuddies migration (3 tables, unique
  (PairId,UserId,HabitId) and (PairId,UserId,Date) indexes).
- Battle Buddy award wired on pair-accept via the "battle_buddy"
  string id; no-ops until #196 ships the achievement definition.
- Registered the new controller actions in the agent catalog.
- Tests: domain entity guards + handler/validator/query unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(api): integrate main, rescaffold AddAccountabilityBuddies, grant BattleBuddy now #196 ships

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant