refactor: vertical-slice feature folders (Notifications pilot)#200
Open
antosubash wants to merge 13 commits into
Open
refactor: vertical-slice feature folders (Notifications pilot)#200antosubash wants to merge 13 commits into
antosubash wants to merge 13 commits into
Conversation
Captures the target module layout (Features/<Agg>/<Op>/), the partial-class split that preserves SM0025/SM0026, the rule for Contracts/Shared vs feature-scoped DTOs, and the pilot-first migration plan starting with the Notifications module.
Phase 0 (migration script + tests) and Phase 1 (Notifications module conversion to Features/Infrastructure/ layout with partial-class NotificationService split). Covers the spec exception for partial-class namespaces that emerged during plan review.
…e/ subfolder Move NotificationsDbContext, NotificationService, Notifier, NotificationsLog, Channels/*, EntityConfigurations/*, and Jobs/* into Infrastructure/ to start the feature-folder migration. Update internal using statements; no public contract changes. See spec: docs/superpowers/specs/2026-05-14-vertical-slice-feature-folders-design.md
Endpoints/Notifications/* moved to Features/Notifications/<Op>/. The feature- scoped QueryNotificationsRequest moved to Contracts/Features/Notifications/List/. Entity, value-object, and channel-payload contracts remain at Contracts root to avoid migration-snapshot churn (revisit in a follow-up phase).
…artials NotificationService becomes a sealed partial class. Each cross-module contract method (ListAsync, GetUnreadCountAsync, GetByIdAsync, MarkReadAsync, MarkAllReadAsync) moves to a fragment file co-located with its feature folder. The root partial in Infrastructure/ retains the constructor and implements clause. Partial fragments deliberately keep the owning class's namespace (Infrastructure) rather than matching folder; their *folder* identifies the slice.
Replace Unit/NotificationServiceTests.cs with per-feature files under Features/Notifications/<Op>/, sharing a NotificationServiceTestFixture base. Cross-cutting tests (NotifierTests, TestBackgroundJobs) remain in Unit/.
Add lesson: migration script must not be used on pre-existing partial-class fragment files (would silently break partial-class semantics by rewriting the fragment's namespace to match folder). Amend spec C5: shared test fixtures live at the aggregate folder level, not inside any single operation folder.
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
Features/<Op>/co-locates each API endpoint with its partial-class fragment ofNotificationService; cross-cuttingChannels/,Jobs/,EntityConfigurations/, andServices/consolidate underInfrastructure/;Pages/(IViewEndpoint + React) intentionally untouched.scripts/feature-folder-migrate.mjsconsumes a per-module TSV manifest and performsgit mv+ namespace rewrite. 11 unit tests coverderiveNamespace,rewriteNamespace, andparseManifest. Smoke-tested end to end.QueryNotificationsRequestintoContracts/Features/Notifications/List/. Entity types and cross-feature DTOs stay at Contracts root to avoid EF migration-snapshot churn (documented as a follow-up decision in the spec).tasks/lessons.md— including the migration script's limitation on pre-existing partial-class fragments.See
docs/superpowers/specs/2026-05-14-vertical-slice-feature-folders-design.mdfor the design anddocs/superpowers/plans/2026-05-14-vertical-slice-notifications-pilot.mdfor the executed plan.Test Plan