feat: attribute-driven self-assembling SystemPromptBuilder#11
Merged
Conversation
Replace monolithic 800-line static SystemPromptBuilder with a modular architecture where AI action metadata lives on command classes via C# attributes. Application layer: - Add [AiAction], [AiField], [AiRule], [AiExample] attributes - Decorate all 6 existing commands + SuggestBreakdownAction metadata class - Re-add reminderEnabled/reminderMinutesBefore to AiAction model Infrastructure layer: - ActionDiscoveryService scans Application assembly via reflection (singleton) - IPromptSection interface with Order-based assembly - 12 section classes (Static, Dynamic, Auto) compose the prompt - ActionCapabilitiesSection (Order 150) renders capabilities near top - ActionSchemaSection (Order 900) auto-generates schema, rules, examples - Static facade preserves backward compat for existing callers Adding a new AI action = decorating ONE command class, zero other changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thomasluizon
added a commit
that referenced
this pull request
Jun 27, 2026
…es a soft-delete leak) (#11) (#263) * feat(api): undo backend — restore endpoints + sub-habit cascade soft-delete (#11) Soft-delete already exists (sync tombstones); this adds the missing Restore. POST /api/{habits,goals,tags}/{id}/restore (IgnoreQueryFilters + ownership + sub-habit cascade). DeleteHabitCommand now cascade-soft-deletes the sub-habit subtree (closes a leak where a deleted parent's children stayed visible in aggregates). HabitHierarchy helper. 8 EF-filter leak tests covering every log-reading query shape + cascade + preservation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(api): address #263 review — concurrency-retry + pay-gate-aware restore - Add IConcurrencyRetryable to RestoreHabitCommand + RestoreTagCommand (match RestoreGoalCommand): a DbUpdateConcurrencyException during the restore save is now retried by ConcurrencyRetryBehavior instead of surfacing as HTTP 500. - RestoreHabit + RestoreTag controllers use result.ToPayGateAwareResult(...) + ProducesResponseType(403), matching RestoreGoal — no hand-written pay-gate block. - Scope RestoreHabitCommand hydration to deleted habits (&& h.IsDeleted): excludes the live set. Kept the deleted subtree rather than HabitId-only, since cascade restore needs the descendants. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 9, 2026
fix(api): apply eligible banked freeze during streak recalculation to close the hourly-job race
#383
Merged
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
SystemPromptBuilderwith attribute-driven self-assembling architecture[AiAction],[AiField],[AiRule],[AiExample]attributes on command classes carry all AI prompt metadataActionDiscoveryServicescans Application assembly via reflection at startup (singleton, cached)IPromptSectionclasses compose the prompt in Order sequenceSuggestBreakdownActionmetadata-only class for the action with no MediatR commandreminderEnabled/reminderMinutesBeforetoAiAction(lost during prior refactor)Test plan
dotnet buildsucceeds (0 warnings, 0 errors)🤖 Generated with Claude Code