Files
clean-architecture-backend-…/docs/notification/module-mapping.md
T
DongHyeonka 5786126cfa fix!: 남은 리뷰 항목과 합친 뒤 드러난 결함을 고친다
문제: 앞 커밋 뒤에도 알림·파일 서버 묶음이 합쳐지지 않았고, 포트 다수에
fake와 실제 구현이 함께 통과하는 공유 계약이 없었고, SpotBugs가 신뢰도
HIGH만 봤고, application-core에 관계없는 클래스 묶음 패키지(outbound)가
있었다. 묶음을 합치자 lane·검사가 새로 드러낸 결함도 있었다(JpaOutbox
Store가 읽기 전용 트랜잭션에서 이벤트를 조용히 잃음, gRPC admission
controller가 public synchronized라 외부 lock에 막힘, 소비자 decode 타입
등록 경로 없음, compose Redis 익명 접근, local-fileserver lane DB 없음).

방법: 리뷰 README 15절에 남은 결정을 모두 적고 그대로 고쳤다. 트랜잭션·
멱등성·발행·notification 포트에 testFixtures 계약 키트를 두고 fake와
PG·Redis 구현이 상속한다(fake 변이로 계약이 잡는지 확인). SpotBugs는
MEDIUM으로 내리고 진짜 결함은 고치고 오탐은 위치·패턴별 이유를 단
제외로 처리했다. 업무 기능 패키지 규칙을 application-core/CLAUDE.md에
정본으로 두고 ArchUnit 2개와 생성 명령이 강제한다. compose Redis는
infra/redis-sdk ACL로 뜬다. 묶음별 결과는 리뷰 README 16절에 있다.

위험·한계: APP_FLYWAY_ENABLED가 dev·prod에도 적용된다. app.security
오타 키가 이제 기동을 막는다. SES 콜백 replay 창 기본값이 1시간이다.
템플릿 패키지 목록은 CLAUDE.md 표와 TemplatePackageOwnership 두 곳에
있고 일치 검사는 없다. 실제 CI runner 실행은 확인하지 못했다.

검증: ci, mainCheck, integrationCheck, -p optional-platforms ci
integrationCheck, performanceCheck, releaseCheck(-PgitRevision),
verify-compose-profile-contracts(18 lane) 통과. compose lane 실제 기동:
local-fileserver, notification ingest·serving·handoff, local-redis,
all-adapters(smoke 3개 포함).

Refs: docs/reviews/2026-11-01-maturity-review/README.md 15·16절
BREAKING CHANGE: APP_FLYWAY_ENABLED가 dev·prod 프로필에도 적용되고,
app.security의 모르는 키는 기동을 거부한다. MessageHandler에
schemaVersions()가 생겨 decode 목록을 handler 선언에서 만든다.
2026-11-03 19:52:06 +09:00

8.0 KiB

Notification Delivery Platform — module mapping

Source design: docs/superpowers/specs/2026-08-10-notification-platform-design.md

Source plan: docs/superpowers/plans/2026-08-10-notification-platform-implementation-plan.md

Why a mapping exists

The plan was written against a hypothetical repository (modules/notification/**, root package io.backend.skeleton.notification, 31 Gradle projects). This repository is a fail-closed 19-leaf Clean Architecture template: src/settings.gradle rejects any registry that does not contain exactly the 19 modules in src/config/architecture/modules.json, and verifyCleanArchitectureDependencies rejects any project edge outside allowed_dependencies.

Creating 31 new Gradle projects would violate HARD-STOP #5 of AGENTS.md. The package README anticipates this and instructs the implementer to map dependency catalog and package/file paths onto the host repository's rules while preserving the public contracts and reliability semantics.

Every logical module of the plan is therefore implemented as a package inside the registered leaf that owns its responsibility. No public contract, evidence rule, or reliability semantic is dropped.

Logical module → registered leaf

Plan module Registered leaf Package
notification-core-api application-core dev.caskeleton.application.notification.platform.api
notification-content-api application-core …platform.api.content
notification-contact-api application-core …platform.contact
notification-template-api application-core …platform.template
notification-policy application-core …platform.policy
notification-provider-spi application-core …platform.provider
notification-callback-api application-core …platform.callback
notification-inbox-api application-core …platform.inbox
notification-admin-api application-core …platform.admin
notification-security (ports) application-core …platform.security
notification-observability (ports) application-core …platform.observation
notification-dispatch-runtime adapter:outbound:notification dev.caskeleton.adapter.outbound.notification.platform.dispatch
notification-security (AES-GCM/HMAC impl) adapter:outbound:notification …platform.security
notification-template-thymeleaf (reference renderer) adapter:outbound:notification …platform.template
notification-email-smtp adapter:outbound:notification …platform.provider.smtp
notification-email-ses adapter:outbound:notification …platform.provider.ses
notification-observability (Micrometer impl) adapter:outbound:notification …platform.observation
notification-admin-runtime adapter:outbound:notification …platform.admin
notification-spring-boot-starter adapter:outbound:notification …platform.autoconfigure
notification-persistence-jpa adapter:outbound:persistence-notification dev.caskeleton.adapter.outbound.persistence.notification.platform (store adapters), ….platform.entity (JPA rows), ….platform.repository (Spring Data interfaces and SQL text)
notification-inbox-jpa adapter:outbound:persistence-notification …persistence.notification.platform (JpaNotificationInbox, InboxCommitEventPublisher, InboxOutboxRecordFactory); row and repository in ….platform.entity / ….platform.repository
notification-callback-mvc adapter:inbound:web-notification dev.caskeleton.adapter.inbound.web.notification.platform.callback
notification-submission-mvc adapter:inbound:web-notification dev.caskeleton.adapter.inbound.web.notification.platform.submission
application composition (use cases, callback bridge, config/module-defaults/notification.yml) composition:notification-platform dev.caskeleton.composition.notification
notification-testkit test source sets of the owning leaves …platform.testkit

Dependency-direction consequences

The plan's module DAG (*-api → provider-spi/policy → runtime/adapters → starter) is preserved by the leaf DAG that the registry already enforces:

application-core (all *-api, provider SPI, policy, callback contracts)
        ↑                        ↑                      ↑
adapter:outbound:notification    adapter:outbound:persistence-notification    adapter:inbound:web-notification
        ↑                                    ↑ (runtimeOnly, with persistence-jpa)    ↑ (→ adapter:inbound:web)
        └──────────── composition:notification-platform ───────────────────────┘
                                   ↑
                             app-bootstrap (one line)

Two plan edges cannot be expressed as project edges in this repository, and are replaced by ports:

  1. notification-email-ses → httpclient platform. (The Twilio, FCM, APNs, Web Push and Webhook adapters that shared this edge were removed: none had an assembler.) adapter-outbound-notification is not allowed to depend on adapter-outbound-httpclient, and SES no longer needs it: the SES adapter sends through the AWS SDK v2 sesv2 client (owner decision 17), which signs requests itself. The adapter-local JDK HTTP gateway and SigV4 signer were deleted with that change. The client is built per profile with SDK retries off, no default credential chain (each request carries its profile's credential) and the profile's endpoint, which still passes the notification routability guard.
  2. notification-inbox-jpa → optional messaging outbox integration. adapter-outbound-persistence-notification may not depend on adapter-outbound-messaging; the inbox publishes through the existing persistence outbox tables plus the NotificationInboxSignalPort application port, and app-bootstrap binds the relay.

Commit policy

AGENTS.md pins commit policy to human-only. Step 5 (git add / git commit) of every plan task 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 types (NOTIF-ADR-005)

NOTIF-ADR-005 made ..notification.platform.. canonical. The R1 types directly under dev.caskeleton.application.notification had no production consumer and were removed on 2026-09-25, together with the ArchUnit rule that kept the two namespaces apart. What remains there is the simple notification port the adapter core implements — NotificationPort, Notification, NotificationChannel. The removed types and their last commit are listed in docs/capability-status.md under "제거된 코드".