Repository navigation
Fix Astra habit listings and single-day fallback periods - #996
Merged
Merged
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Across all 22 changed files, reviewed the habit-read guidance, shared period formatting, account-local date propagation, and stored-response downgrade behavior.
- Tool selection: Habit listings explicitly use
query_habits, compound habit-and-goal listings require both queries, andget_daily_summaryis reserved for completion totals or recaps. - Period labels: Single-day fallbacks render one localized date or account-local
Today/Hoje; multi-day ranges retain both endpoints across the shared formatter's callers. - Stored replay: Typed blocks use the current account date when downgraded, while already composed text remains unchanged. No response-contract changes were introduced.
- Verification: All 197 focused Application tests and 54 focused Infrastructure tests passed. The captured replay verifies formatting and delivery, not live-model tool selection; the bilingual live gate rerun remains outside this review.
gpt-6.1-sol | 𝕏
|
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.




Tracks thomasluizon/orbit-tickets#1617
A request to list habits and goals could select a daily recap, and a one-day recap fallback rendered the same date twice. Habit-query and daily-summary descriptions now distinguish listings from completion recaps; the shared read rule requires both queries for compound listings of habits and goals. The shared fallback formatter renders a single day once, using Today or Hoje when it matches the account's current date.
Approach
GetDailySummaryTool.cs,QueryHabitsTool.csand the existing grounding rule inGlobalRulesSection.csclarify model tool selection. The tool set and executed model plan stay intact.ReadFallbackText.csowns period labels for summaries, totals, comparisons, metrics, recaps, habit calendars and history. Composition passes the turn'sIUserDateServicedate through every period fallback path. Stored typed-block negotiation receives the current account date throughAstraBlockAnswerService; stored text retains its original wording.AnswerComposition.mddocuments this behavior. The captured g8r2 tool plan replays at the model-service port through production tools and composition. Other tests cover past, present, future and multi-day labels, serialization, streamed replies, persistence and downgrade replay.Assumptions
Test evidence
Before implementation changes:
dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~ReadFallbackTextTests|FullyQualifiedName~G8_CapturedCompoundFallbackKeepsFactsWithoutTitles': exit 0, 114 passed with the defect present.dotnet test tests/Orbit.Application.Tests --no-build --filter 'FullyQualifiedName~DaySummary_PreservesIndependentReadTextFallback': exit 0, 8 passed. This unchanged test explicitly expected the duplicated date range.dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~DaySummary_PreservesIndependentReadTextFallback|FullyQualifiedName~G8R2_CapturedSummaryFallbackUsesAccountToday': exit 1, 12 failed for the intended date-label mismatch. The captured path returned29/10/2026 a 29/10/2026or10/29/2026 to 10/29/2026instead of Hoje or Today.dotnet test tests/Orbit.Infrastructure.Tests --filter 'FullyQualifiedName~AstraBehaviourPromptTests': exit 0, 19 unchanged tests passed.dotnet test tests/Orbit.Infrastructure.Tests --filter 'FullyQualifiedName~HabitListings_RequireHabitAndGoalQueriesInsteadOfADailyRecap': exit 1, 2 failed in both composition modes before the prompt fix.After implementation changes:
dotnet test tests/Orbit.Application.Tests --configuration Release --no-build --filter 'FullyQualifiedName~ReadFallbackTextTests|FullyQualifiedName~G8_CapturedCompoundFallbackKeepsFactsWithoutTitles|FullyQualifiedName~G8R2_|FullyQualifiedName~DaySummary_|FullyQualifiedName~AstraBlockAnswerServiceTests|FullyQualifiedName~ChatToolMetadataTests': exit 0, 197 passed, including the strengthened tests.dotnet test tests/Orbit.Infrastructure.Tests --configuration Release --no-build --filter 'FullyQualifiedName~AstraBehaviourPromptTests|FullyQualifiedName~AstraBlockAnswerRecoveryTests|FullyQualifiedName~AstraPickListPreviewTests': exit 0, 45 passed.Full verification after the commit:
dotnet build Orbit.slnx --configuration Releasedotnet test tests/Orbit.Domain.Tests --configuration Release --no-builddotnet test tests/Orbit.Application.Tests --configuration Release --no-builddotnet test tests/Orbit.Infrastructure.Tests --configuration Release --no-builddotnet test tests/Orbit.Analyzers.Tests --configuration Release --no-buildpython3 .github/scripts/openapi_artifacts.py freshnessgit diff --exit-code -- src/Orbit.Api/openapi.json src/Orbit.Api/openapi_v2.json src/Orbit.Api/openapi_v1-r2.json src/Orbit.Api/openapi_v2-r2.jsonThe pre-commit format, root allowlist, dash, timeless-text and suppression checks passed. Deterministic replay preserves the captured daily-summary tool choice; it does not prove live model selection changed. The coordinator owns the bilingual live gate rerun.
Copy for approval
Model instructions are sent in English for both request locales. The pt-BR versions below are review translations of the changed text, not additional runtime prompts. Unchanged instruction tails retain their existing wording.
get_daily_summarydescription:Changed prefix of
query_habitsdescription:Changed read-rule sentences:
Visible period labels reuse the existing localized catalog:
Today: Completed / scheduled: 0/2; another single day:10/28/2026: Completed / scheduled: 0/2; a multi-day range keeps10/28/2026 to 10/29/2026.Hoje: Concluídos / agendados: 0/2; outro dia:28/10/2026: Concluídos / agendados: 0/2; um período de vários dias mantém28/10/2026 a 29/10/2026.