refactor: 리펙토링 진행중 의존성 gradle은 얇게 유지, 각 모듈에서 처리하고 있는 부분에 대해서 리펙토링

This commit is contained in:
donghyeon-ka
2026-09-23 17:27:09 +09:00
parent 60b6a319e7
commit 9da00eb782
2485 changed files with 56091 additions and 23550 deletions
@@ -50,7 +50,7 @@ mapping 문서는 목록을 소유한다 — 목록을 두 곳에 복제하면
## 강제
두 namespace 사이의 production dependency는 **0건**이며, 이것은 문서가 아니라 ArchUnit 규칙이 지킨다
(`CleanArchitectureTest`의 `NOTIFICATION_R1_AND_PLATFORM_DO_NOT_DEPEND_ON_EACH_OTHER`).
(`ApplicationBoundaryArchitectureTest`의 `NOTIFICATION_R1_AND_PLATFORM_DO_NOT_DEPEND_ON_EACH_OTHER`).
변환이 필요해지면 `dev.caskeleton.application.notification.compatibility.r1` 한 패키지에만 두고, 그
패키지만 규칙에서 예외로 인정한다. 예외를 한 곳으로 모으는 것이 목적이다 — 두 모델이 서로를 아는
+8 -42
View File
@@ -3,18 +3,6 @@
# change: ./gradlew updateNotificationApiSurface -PapproveNotificationApiChange
dev.caskeleton.adapter.outbound.notification.NotificationConfig
dev.caskeleton.adapter.outbound.notification.NotificationRoutesSettings
dev.caskeleton.adapter.outbound.notification.catalog.CompiledNotificationBinding
dev.caskeleton.adapter.outbound.notification.catalog.NotificationBindingCompiler
dev.caskeleton.adapter.outbound.notification.catalog.NotificationCanonicalRouteCatalog
dev.caskeleton.adapter.outbound.notification.catalog.NotificationCatalogException
dev.caskeleton.adapter.outbound.notification.catalog.NotificationCutoverRouteCatalog
dev.caskeleton.adapter.outbound.notification.catalog.NotificationPlanAdapter
dev.caskeleton.adapter.outbound.notification.catalog.NotificationProviderCapabilityCard
dev.caskeleton.adapter.outbound.notification.catalog.NotificationProviderCapabilityDescriptorSource
dev.caskeleton.adapter.outbound.notification.catalog.NotificationProviderDescriptor
dev.caskeleton.adapter.outbound.notification.catalog.NotificationProviderRuntimeProfile
dev.caskeleton.adapter.outbound.notification.catalog.NotificationRouteDescriptor
dev.caskeleton.adapter.outbound.notification.catalog.NotificationTemplateDescriptor
dev.caskeleton.adapter.outbound.notification.core.FailOpenNotificationProvider
dev.caskeleton.adapter.outbound.notification.core.NotificationProvider
dev.caskeleton.adapter.outbound.notification.core.RoutingNotifier
@@ -32,8 +20,14 @@ dev.caskeleton.adapter.outbound.notification.platform.autoconfigure.Notification
dev.caskeleton.adapter.outbound.notification.platform.autoconfigure.ProviderRuntimeAssembler
dev.caskeleton.adapter.outbound.notification.platform.autoconfigure.ProviderType
dev.caskeleton.adapter.outbound.notification.platform.autoconfigure.SmtpProviderRuntimeAssembler
dev.caskeleton.adapter.outbound.notification.platform.callback.CallbackLimits
dev.caskeleton.adapter.outbound.notification.platform.callback.CallbackVerificationResult
dev.caskeleton.adapter.outbound.notification.platform.callback.MapProviderCallbackAdapterRegistry
dev.caskeleton.adapter.outbound.notification.platform.callback.MapProviderEventProjectorRegistry
dev.caskeleton.adapter.outbound.notification.platform.callback.ProviderCallbackAdapter
dev.caskeleton.adapter.outbound.notification.platform.callback.ProviderCallbackAdapterRegistry
dev.caskeleton.adapter.outbound.notification.platform.callback.ProviderCallbackVerificationRequest
dev.caskeleton.adapter.outbound.notification.platform.callback.VerifiedCallback
dev.caskeleton.adapter.outbound.notification.platform.dispatch.AttemptPermit
dev.caskeleton.adapter.outbound.notification.platform.dispatch.CapabilityReconciliationGateway
dev.caskeleton.adapter.outbound.notification.platform.dispatch.ConfiguredProfileCatalog
@@ -150,31 +144,9 @@ dev.caskeleton.adapter.outbound.notification.platform.template.TemplateSlotMode
dev.caskeleton.adapter.outbound.notification.platform.template.TemplateSlotPolicy
dev.caskeleton.adapter.outbound.notification.platform.template.ThymeleafNotificationRenderer
dev.caskeleton.adapter.outbound.notification.platform.template.ThymeleafStringTemplateEngine
dev.caskeleton.adapter.outbound.notification.provider.AttemptCorrelationId
dev.caskeleton.adapter.outbound.notification.provider.InlineNotificationAttemptAdapter
dev.caskeleton.adapter.outbound.notification.provider.NotificationAdmissionReadinessAdapter
dev.caskeleton.adapter.outbound.notification.provider.NotificationAttemptContext
dev.caskeleton.adapter.outbound.notification.provider.NotificationProviderAttemptAdapter
dev.caskeleton.adapter.outbound.notification.provider.NotificationProviderAttemptClient
dev.caskeleton.adapter.outbound.notification.provider.NotificationProviderRateAdmission
dev.caskeleton.adapter.outbound.notification.provider.NotificationProviderReadinessProbe
dev.caskeleton.adapter.outbound.notification.provider.NotificationProviderReadinessSnapshot
dev.caskeleton.adapter.outbound.notification.provider.NotificationProviderSecretMaterialProvider
dev.caskeleton.adapter.outbound.notification.provider.NotificationReconciliationAdapter
dev.caskeleton.adapter.outbound.notification.provider.NotificationSecretMaterialHandle
dev.caskeleton.adapter.outbound.notification.provider.PreparedNotificationAttempt
dev.caskeleton.adapter.outbound.notification.provider.ProviderMessageReference
dev.caskeleton.adapter.outbound.notification.provider.ReconciliationLookupMode
dev.caskeleton.adapter.outbound.notification.slack.webhook.SlackClient
dev.caskeleton.adapter.outbound.notification.slack.webhook.SlackNotificationAdapterConfig
dev.caskeleton.adapter.outbound.notification.slack.webhook.SlackWebhookProvider
dev.caskeleton.adapter.outbound.notification.template.LocalEmailRenderer
dev.caskeleton.adapter.outbound.notification.template.NotificationTemplateCatalog
dev.caskeleton.adapter.outbound.notification.template.NotificationTemplateManifest
dev.caskeleton.adapter.outbound.notification.template.NotificationTemplateRenderer
dev.caskeleton.adapter.outbound.notification.template.RenderedNotification
dev.caskeleton.adapter.outbound.notification.template.SlackBlockKitRenderer
dev.caskeleton.adapter.outbound.notification.template.TemplateRenderingException
dev.caskeleton.application.notification.ApplyNotificationReceiptCommand
dev.caskeleton.application.notification.ApplyNotificationReceiptResult
dev.caskeleton.application.notification.ApplyNotificationReceiptUseCase
@@ -292,7 +264,6 @@ dev.caskeleton.application.notification.platform.admin.RedriveCommand
dev.caskeleton.application.notification.platform.admin.SetProviderStateCommand
dev.caskeleton.application.notification.platform.admin.SuppressCommand
dev.caskeleton.application.notification.platform.api.CallbackIngestionResult
dev.caskeleton.application.notification.platform.api.CallbackRequest
dev.caskeleton.application.notification.platform.api.CancelCommand
dev.caskeleton.application.notification.platform.api.CancelResult
dev.caskeleton.application.notification.platform.api.ChannelPreferenceOverride
@@ -306,6 +277,8 @@ dev.caskeleton.application.notification.platform.api.DeduplicationSpec
dev.caskeleton.application.notification.platform.api.DeliveryAttemptId
dev.caskeleton.application.notification.platform.api.EncodedNotificationPlan
dev.caskeleton.application.notification.platform.api.IdempotencyKey
dev.caskeleton.application.notification.platform.api.NormalizedEventType
dev.caskeleton.application.notification.platform.api.NormalizedProviderEvent
dev.caskeleton.application.notification.platform.api.NotificationAcceptance
dev.caskeleton.application.notification.platform.api.NotificationId
dev.caskeleton.application.notification.platform.api.NotificationOrchestrator
@@ -372,22 +345,16 @@ dev.caskeleton.application.notification.platform.api.routing.DeliveryStrategy
dev.caskeleton.application.notification.platform.api.routing.ExplicitChannel
dev.caskeleton.application.notification.platform.api.routing.OrderedFallback
dev.caskeleton.application.notification.platform.callback.AppendEventResult
dev.caskeleton.application.notification.platform.callback.CallbackLimits
dev.caskeleton.application.notification.platform.callback.CallbackPayloadProtectionPort
dev.caskeleton.application.notification.platform.callback.CallbackVerificationResult
dev.caskeleton.application.notification.platform.callback.DeliveryAttemptResolverPort
dev.caskeleton.application.notification.platform.callback.DeliveryAttemptSnapshot
dev.caskeleton.application.notification.platform.callback.DeliveryProjection
dev.caskeleton.application.notification.platform.callback.DeliveryProjectionStorePort
dev.caskeleton.application.notification.platform.callback.EngagementFacts
dev.caskeleton.application.notification.platform.callback.IngestProviderCallbackApplicationUseCase
dev.caskeleton.application.notification.platform.callback.NormalizedEventType
dev.caskeleton.application.notification.platform.callback.NormalizedProviderEvent
dev.caskeleton.application.notification.platform.callback.NotificationSideEffectPort
dev.caskeleton.application.notification.platform.callback.ProjectionResult
dev.caskeleton.application.notification.platform.callback.ProjectionStatus
dev.caskeleton.application.notification.platform.callback.ProviderCallbackAdapter
dev.caskeleton.application.notification.platform.callback.ProviderCallbackAdapterRegistry
dev.caskeleton.application.notification.platform.callback.ProviderEventLedger
dev.caskeleton.application.notification.platform.callback.ProviderEventProjectionService
dev.caskeleton.application.notification.platform.callback.ProviderEventProjector
@@ -398,7 +365,6 @@ dev.caskeleton.application.notification.platform.callback.ProviderEventSource
dev.caskeleton.application.notification.platform.callback.ProviderRequestIdHash
dev.caskeleton.application.notification.platform.callback.StandardDeliveryProjector
dev.caskeleton.application.notification.platform.callback.SuppressionFacts
dev.caskeleton.application.notification.platform.callback.VerifiedCallback
dev.caskeleton.application.notification.platform.callback.VerifiedProviderEvent
dev.caskeleton.application.notification.platform.contact.ApnsDeviceToken
dev.caskeleton.application.notification.platform.contact.ApnsEnvironment
+47 -10
View File
@@ -54,9 +54,10 @@ nonce and tag. A larger configured value would pass every check above the databa
## Provider profiles
Profiles are a map under `providers`, keyed by profile id. There are no environment variables for
them, because the keys are deployment-chosen; supply them as YAML or as
`CA_SKELETON_NOTIFICATION_PLATFORM_PROVIDERS_<ID>_<FIELD>`.
Profiles are a map under `providers`, keyed by profile id. Arbitrary deployment-chosen ids can be
supplied as YAML or through Spring relaxed binding (`CA_SKELETON_NOTIFICATION_PLATFORM_PROVIDERS_<ID>_<FIELD>`).
The shipped reference profiles `smtp` and `ses` additionally expose explicit `APP_NOTIFICATION_PLATFORM_SMTP_*`
and `APP_NOTIFICATION_PLATFORM_SES_*` aliases so operators do not have to invent binding names.
| Field | Meaning |
|---|---|
@@ -64,7 +65,7 @@ them, because the keys are deployment-chosen; supply them as YAML or as
| `enabled` | A disabled profile is bound and validated but contributes no runtime |
| `primary-for-channel` | Exactly one primary per channel |
| `environment` | Required when enabled |
| `credential-profile` | Resolved through `SecretMaterialProvider`; never an inline secret |
| `credential-profile` | Provider credential key id resolved through `SecretMaterialProvider`; never inline secret material |
| `topic` | APNs bundle id |
| `vapid-public-key` | Web Push application server key |
| `callback-signing-secret-ref` | Reference, not material |
@@ -75,6 +76,41 @@ them, because the keys are deployment-chosen; supply them as YAML or as
A profile pins provider type, environment, credential profile, timeouts, concurrency and rate limit.
Sender identity and credential profile are separate concerns.
### SES profile fields
An enabled SES profile adds a typed `ses` block:
| Field | Meaning |
|---|---|
| `ses.endpoint` | SES API base URI; the mapper appends `/v2/email/outbound-emails` |
| `ses.region` | SigV4 region |
| `ses.sender-identity` | verified SES From identity |
| `ses.access-key-id` | AWS access key id; identifier only, not secret material |
| `ses.configuration-set` | optional SES configuration-set name |
| `credential-profile` | key id for the secret access-key material; generation 1 is activated at assembly |
The shipped reference profile is `providers.ses` and is disabled by default. It is controlled by
`APP_NOTIFICATION_PLATFORM_SES_*`; its secret material comes from
`APP_NOTIFICATION_PLATFORM_PROVIDER_CREDENTIAL_KEY`, whose active key id must match
`APP_NOTIFICATION_PLATFORM_SES_CREDENTIAL_KEY_ID`.
`type` is the closed **provider model**, not a promise that the shipped composition contains a
dispatch assembler for every value. Current shipped reachability is:
| Provider type | Contract/adapter code | Shipped dispatch assembler | Shipped callback assembler | What happens when enabled for dispatch |
|---|---|---|---|---|
| `SMTP` | yes | **yes** | no | assembles when Spring Mail relay settings are complete |
| `SES` | yes | **yes** | **yes** | assembles an EMAIL runtime from the typed `ses` block; SNS callback verification remains available in `INGEST_ONLY` |
| `TWILIO` | yes | no | no | dispatch fails startup by profile name |
| `FCM` | yes | no | no | dispatch fails startup by profile name |
| `APNS` | yes | no | no | dispatch fails startup by profile name |
| `WEB_PUSH` | yes | no | no | dispatch fails startup by profile name |
| `WEBHOOK` | yes | no | no | dispatch fails startup by profile name |
This distinction is deliberate: tested provider protocol code is not the same thing as a
composition-reachable provider. Adding a family to the shipped runtime requires a
`ProviderRuntimeAssembler` plus the settings/secret inputs that adapter actually needs.
## SMTP relay
The one provider profile the template ships, off. A deployment that wants the common case sets
@@ -98,15 +134,16 @@ already owns them and a second spelling would be a second thing to keep in step.
| Property | Environment variable | Default | Bound |
|---|---|---|---|
| `smtp.tls-mode` | `APP_NOTIFICATION_PLATFORM_SMTP_TLS_MODE` | `STARTTLS_REQUIRED` | `STARTTLS_REQUIRED` or `IMPLICIT_TLS` |
| `smtp.sender-identity` | `APP_NOTIFICATION_PLATFORM_SMTP_SENDER_IDENTITY` | `no-reply@example.invalid` | address |
| `smtp.connect-timeout` | `APP_NOTIFICATION_PLATFORM_SMTP_CONNECT_TIMEOUT` | `5s` | positive, finite |
| `smtp.read-timeout` | `APP_NOTIFICATION_PLATFORM_SMTP_READ_TIMEOUT` | `10s` | positive, finite |
| `smtp.write-timeout` | `APP_NOTIFICATION_PLATFORM_SMTP_WRITE_TIMEOUT` | `10s` | positive, finite |
| `smtp.max-concurrency` | `APP_NOTIFICATION_PLATFORM_SMTP_DISPATCH_CONCURRENCY` | `4` | positive |
The TLS mode enum has no plaintext member. An unencrypted relay is refused by construction rather
than by a validator somebody has to remember to run.
SMTP transport configuration has one owner: Spring Mail. The actual `JavaMailSenderImpl` must use required STARTTLS (`mail.smtp.starttls.enable=true` plus `mail.smtp.starttls.required=true`) or implicit TLS (`mail.smtp.ssl.enable=true`). It must also have positive `mail.smtp.connectiontimeout`, `mail.smtp.timeout`, and `mail.smtp.writetimeout` values. SMTP assembly fails before serving traffic when those properties are absent or invalid.
The native environment contract is `SPRING_MAIL_HOST`, `SPRING_MAIL_PORT`, optional
`SPRING_MAIL_USERNAME` / secret `SPRING_MAIL_PASSWORD`, plus the
`SPRING_MAIL_PROPERTIES_MAIL_SMTP_*` TLS and timeout keys listed in `.env.example`. These names stay
Spring-native because Spring Boot itself owns and consumes `spring.mail.*`; the notification module
does not create a second alias for the same relay.
The default sender is an RFC 2606 reserved domain that resolves nowhere, so a deployment that forgot
to set one produces a traceable bounce instead of mail apparently sent from an address it does not
+5 -2
View File
@@ -32,10 +32,13 @@
"callback-supported": {
"requires": "signature verification, duplicate suppression, and an event that arrives before its attempt is stored",
"status": "satisfied",
"lane": ":adapter:outbound:persistence-jpa:jpaPlatformContractTest",
"lanes": [
":adapter:outbound:persistence-jpa:jpaPlatformContractTest",
":application-notification:test"
],
"evidence": [
"adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/java/dev/caskeleton/adapter/outbound/persistence/notification/LateEventBindingContractTest.java",
"application-core/src/test/java/dev/caskeleton/application/notification/platform/callback/CallbackIngestionAtomicityTest.java"
"application-notification/src/test/java/dev/caskeleton/application/notification/platform/callback/CallbackIngestionAtomicityTest.java"
]
},
"recoverable": {
+5 -2
View File
@@ -37,8 +37,11 @@ R1 public type 100개를 어떻게 할 것인지 다루지 않았다. 그래서
문서 어디에도 답이 없었다.
- **canonical은 `..notification.platform..`이다.** NOTIF-ADR-005가 근거와 함께 정한다.
- **R1은 남지만 새 production consumer를 받지 않는다.** 삭제 계획은 별개이며, R0 삭제와 함께
사라지지 않는다.
- **application R1 public contract는 남지만 새 production consumer를 받지 않는다.** 삭제 계획은
별개이며, R0 삭제와 함께 사라지지 않는다.
- R1을 따라 만들어졌지만 composition root에서 한 번도 조립되지 않았던 outbound adapter의
`catalog/`, `provider/`, `template/` 실험 구현은 제거했다. 실제 runtime은
`dev.caskeleton.adapter.outbound.notification.platform..`만 사용한다.
- **전수 분류표는 `docs/notification/module-mapping.md`에 있다** (replace / bridge / retain / delete).
- **두 namespace 간 production dependency는 0건이며 ArchUnit이 강제한다.** 변환이 필요하면
`dev.caskeleton.application.notification.compatibility.r1` 한 곳에만 둔다.
+20 -2
View File
@@ -51,7 +51,7 @@ that owns its responsibility. No public contract, evidence rule, or reliability
| `notification-observability` (Micrometer impl) | `adapter:outbound:notification` | `…platform.observation` |
| `notification-admin-runtime` | `adapter:outbound:notification` | `…platform.admin` |
| `notification-reactor` | `adapter:outbound:notification` | `…platform.reactor` |
| `notification-spring-boot-starter` | `adapter:outbound:notification` (+ `app-bootstrap` wiring) | `…platform.autoconfigure` |
| `notification-spring-boot-starter` | `adapter:outbound:notification` | `…platform.autoconfigure` |
| `notification-persistence-jpa` | `adapter:outbound:persistence-jpa` | `dev.caskeleton.adapter.outbound.persistence.notification.platform` |
| `notification-inbox-jpa` | `adapter:outbound:persistence-jpa` | `…persistence.notification.platform.inbox` |
| `notification-callback-mvc` | `adapter:inbound:web` | `dev.caskeleton.adapter.inbound.web.notification.platform.callback` |
@@ -93,13 +93,31 @@ Two plan edges cannot be expressed as project edges in this repository, and are
is therefore intentionally **not** executed by the agent; the working tree carries the change and the
human owner commits.
## Runtime reachability after the R1 adapter cleanup
The application R1 contract covered by NOTIF-ADR-005 is a separate question from the abandoned
outbound implementation that had been built around it. The latter is gone: the notification leaf no
longer contains top-level `catalog/`, `provider/`, or `template/` R1 adapter packages. They had no
production composition consumer and were proved only by their own fakes.
The useful rendering invariant from that experiment was not discarded. R2
`platform.template.TemplateSlotPolicy` now validates the final HTML against the reviewed tag and
attribute subset in addition to escaping substituted values. Active script markup, event-handler
attributes and non-HTTPS HTML links are refused.
R2 provider protocol packages remain because they implement the canonical platform SPI and have
contract tests. Their presence does **not** make them shipped dispatch runtimes. Current composition
reachability is SMTP and SES for dispatch, with SES also available for callback ingestion; the remaining
provider packages are extension assets until a composition contributes a `ProviderRuntimeAssembler`
with the settings and secret sources that family requires. See `support-matrix.md` for the explicit table.
## R1 public type disposition (NOTIF-ADR-005)
NOTIF-ADR-005 makes `..notification.platform..` canonical and keeps the R1 namespace in place
without new consumers. The ADR owns the rule; this table owns the list, so the two do not drift
apart by being written twice.
`NOTIFICATION_R1_AND_PLATFORM_DO_NOT_DEPEND_ON_EACH_OTHER` in `CleanArchitectureTest` enforces the
`NOTIFICATION_R1_AND_PLATFORM_DO_NOT_DEPEND_ON_EACH_OTHER` in `ApplicationBoundaryArchitectureTest` enforces the
boundary: production dependencies between the two namespaces are zero, and the only permitted
exception is `dev.caskeleton.application.notification.compatibility.r1`.
+19
View File
@@ -24,6 +24,25 @@ against real PostgreSQL; the wire and the crash are not. That is what the grade
| In-app inbox | Own database | Optional stable | `PERSISTED`, `SEEN`, `READ` |
| Webhook | HTTP client platform | Extension | Whatever the receiving HTTP contract states |
## Shipped provider assembly reachability
The grade above describes protocol/reliability evidence. It does **not** mean every reference
implementation is selectable in the default composition. Dispatch reachability is a separate axis:
| Provider family | Dispatch assembler in shipped composition | Callback assembler | Current use |
|---|---|---|---|
| SMTP | **yes** | no | EMAIL dispatch reference family |
| SES | **yes** | **yes** | EMAIL dispatch + SNS callback ingestion; disabled reference profile ships in `config/notification.yml` |
| Twilio | no | no | contract implementation / extension wiring |
| FCM | no | no | contract implementation / extension wiring |
| APNs | no | no | contract implementation / extension wiring |
| Web Push | no | no | contract implementation / extension wiring |
| Webhook | no | no | extension wiring |
An enabled dispatch profile with no assembler fails startup by profile/family; it never silently
assembles into an empty runtime. SMTP additionally names `spring.mail.host` when its shipped
assembler is absent because the relay was not configured.
## What each grade requires
| Grade | Requires |