2.9 KiB
Notification Capability Composition Ownership
Goal
Move reusable Notification provider/runtime Spring composition out of app-bootstrap and into the Notification capability leaf while preserving the existing application transaction boundary, master switch, legacy-route bridge, platform mode, secret validation, workers, metrics, and actuator behavior.
Final ownership
adapter:outbound:notification owns:
- NotificationPlatformAutoConfiguration as the Boot entry point;
- package-private core/runtime configuration slices for codec, secrets, registries, provider assembly, provider policy, runtime dispatch support, workers, and observability;
- notification health endpoint and observation convention;
- legacy route configuration imports until NTF-INT-004 removes them;
- strict notification secret validation through CapabilityStartupValidationException.
app-bootstrap owns:
- NotificationApplicationCompositionAutoConfiguration;
- construction of transaction-bound application services and inbound use cases;
- the Notification admin application service;
- NotificationDispatchService and callback/projection services whose transaction boundary is an application decision;
- repository-wide startup failure reporting.
This split is required by NTF-020: TransactionPort and product-level operator/application policy must not move into the outbound Notification adapter merely because Spring composition moved.
Runtime activation
The existing master switch ca-skeleton.notification.platform.enabled remains the root gate. NotificationPlatformAutoConfiguration contributes reusable capability runtime only when enabled. NotificationApplicationCompositionAutoConfiguration is ordered after that leaf auto-configuration and is gated by the same switch.
Public API
The ownership move must not expand the Notification public API. Internal Spring configuration and observation helper types remain package-private. The existing public NotificationPlatformAutoConfiguration is reused as the Boot entry point.
Compatibility
- configuration keys do not change;
- provider/mode and worker lifecycle semantics do not change;
- secret validation remains fail-closed with exit 78;
- health endpoint remains non-sensitive;
- existing ConditionalOnMissingBean override seams remain;
- current notification evidence/configuration/API gates remain owned by the notification leaf;
- the outbound Notification leaf has no TransactionPort dependency.
Build boundary
This phase moves Spring ownership, not build inclusion. One intentional compile-time edge remains from NotificationApplicationCompositionAutoConfiguration to NotificationDispatchProperties, the typed runtime bounds object produced by the leaf. Duplicating its configuration binding in app-bootstrap would create a second SSOT. Removing this final concrete compile edge belongs to the later build-inclusion/runtimeOnly phase, where the selected-capability boundary can be redesigned without duplicating configuration policy.