Skip to content

fix(chat): share calm voice character rules with notifications - #705

Merged
thomasluizon merged 1 commit into
redesign/mainfrom
fix/ticket-1251-astra-chat-voice
Oct 5, 2026
Merged

thomasluizon merged 1 commit into
redesign/mainfrom
fix/ticket-1251-astra-chat-voice

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Fixes thomasluizon/orbit-tickets#1251.

An image-attached chat prompt demonstrated an exclamation mark and prohibited dashes, while its tone guidance invited celebration and omitted the character bans. The composed chat system prompt now makes all five bans absolute in every language and keeps acknowledgement calm and specific. Chat can still use markdown, bullet points, and habit emoji fields through tools.

Intended approach

  • src/Orbit.Infrastructure/Services/Prompts/NotificationVoice.cs exposes CharacterRules and composes the notification voice from those rules plus its existing tone and formatting restrictions. This keeps one source for the character bans without applying notification formatting restrictions to chat.
  • src/Orbit.Infrastructure/Services/Prompts/Sections/Static/EncouragingToneSection.cs includes the shared character rules, replaces the invitation to celebrate with calm acknowledgement, and explicitly preserves chat formatting and habit emoji tools.
  • src/Orbit.Infrastructure/Services/Prompts/Sections/Dynamic/ImageInstructionsSection.cs removes the doubled hyphen and the exclamation mark from its instructions and reply example.
  • src/Orbit.Infrastructure/Services/Prompts/Sections/Static/ClarificationGuidanceSection.cs replaces every em dash with ordinary punctuation.
  • tests/Orbit.Infrastructure.Tests/Services/NotificationVoiceTests.cs adds the actual BuildStatic plus BuildDynamic chat prompt with an image attached to the character guard and checks every required ban, language scope, formatting, and habit emoji tool allowance.
  • tests/Orbit.Infrastructure.Tests/Services/PromptSectionTests.cs adds a separate tone regression test without changing existing cases.

Assumptions

  • Kept the shared character rules in NotificationVoice and included them through the existing tone section; rejected a separate chat voice type or section because the ticket permits reuse here and this preserves the current composition and ordering.

Test evidence

The unchanged tests passed with the defect present. Command:

env -u LANG dotnet test tests/Orbit.Infrastructure.Tests --filter 'FullyQualifiedName~NotificationVoiceTests|FullyQualifiedName~EncouragingToneSectionTests' --verbosity minimal
  • Before editing tests or implementation: exit 0, 127 passed.
  • After strengthening tests, with implementation still unfixed: exit 1, 127 passed and 7 failed. NoPromptDemonstratesACharacterItBans failed for the composed chat prompt because the image reply example contained an exclamation mark. All five ChatPromptBansCharactersInEveryLanguageAndPreservesFormattingAndHabitEmojiTools cases failed for their missing ban. Build_KeepsAcknowledgementCalmAndSpecific failed because calm acknowledgement guidance was absent.
  • After fixing implementation, the same command: exit 0, 134 passed.

Build and broader verification:

Command Exit code Result
env -u LANG dotnet build Orbit.slnx --verbosity minimal 0 0 errors
env -u LANG dotnet test tests/Orbit.Infrastructure.Tests --no-build --verbosity minimal 0 3,286 passed
env -u LANG dotnet test 0 9,421 passed across all four test projects
LC_ALL=en_US.UTF-8 dotnet build Orbit.slnx --verbosity minimal 0 0 errors
LC_ALL=en_US.UTF-8 dotnet test tests/Orbit.Infrastructure.Tests --no-build --verbosity minimal 0 3,286 passed
LC_ALL=en_US.UTF-8 dotnet test 0 9,421 passed across all four test projects

Pre-commit formatting, dash, timeless, root allowlist, and suppression allowlist checks passed. Existing package version and obsolete API warnings remain. No DTO, endpoint, version floor, user date, or background scheduling behavior changes.

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes All six changed files were reviewed, including chat prompt composition, notification consumers, and regression tests; no Critical or High findings were identified.

  • Shared character rules: Chat and notifications reuse the same all-language character bans while keeping notification-only formatting restrictions out of chat.
  • Calm chat guidance: Progress acknowledgements and image/clarification examples now align with the intended voice, while chat markdown, bullet points, and habit emoji tools remain permitted.
  • Regression coverage: Tests exercise the composed image-attached prompt and calm tone guidance. All 162 focused tests and all 3,286 Infrastructure unit tests passed locally; these verify prompt instructions, not live model-output compliance.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@thomasluizon
thomasluizon merged commit c840a3e into redesign/main Oct 5, 2026
26 checks passed
@thomasluizon
thomasluizon deleted the fix/ticket-1251-astra-chat-voice branch October 5, 2026 07:20
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