Files
clean-architecture-backend-…/docs/notification/callback-reconciliation.md
T
donghyeon-kaandClaude Opus 5.5 642b7e0d18 review-followup Wave 3 라운드 3(P23): notification — SES를 AWS SDK sesv2로, persistence-notification leaf 추출
- 결정 17: 자체 JDK HTTP gateway·SigV4 서명기 삭제, SES를 AWS SDK v2 `sesv2`로(기존 설정 계약 유지, SDK 재시도 끔,
  기본 자격 증명 체인 끔, endpoint 라우팅 검사 유지) — 로컬 가짜 서버로 실제 SDK client 계약 테스트
- S2-#1b: notification persistence를 `adapter:outbound:persistence-notification`으로(migration V1–V10 바이트·위치 동일,
  persistence-jpa → application-notification edge 제거), composition이 새 leaf를 가져옴
- 레지스트리 2개 삭제, provider 상태 전이표 하나, `ProviderCapabilities.dispatchOnly(...)`, dispatch record 전이 메서드,
  미조립 회전 경로·중복 제출 진입점·테스트 전용 생성자 삭제
- 통합: at-rest 계약 테스트가 새 leaf 경로를 보고 `src/main/java`만 훑게(ORCH-new-2), app-bootstrap 알림 선택 주석(P23-new-3)

검증: ./gradlew check architectureCheck verifyDependencyLocks verifyPublicPathSnapshot :app-bootstrap:verifyEnvKeys
configContractCheck :app-bootstrap:integrationTest :sample-portfolio:integrationTest
persistence-jpa jpaPlatformContractTest jpaPlatformMigrationTest --continue 통과(704 task)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 12:44:29 +09:00

2.1 KiB

Callbacks and reconciliation

Ingestion order

body size limit
  → content type
  → profile lookup
  → signature verification
  → append to the ledger
  → duplicate detection
  → normalization
  → attempt resolution
  → projection
  → side effects
  → 2xx

Appending before projecting is what makes a fast 2xx honest. The provider is told the event is recorded, and a projector defect becomes a replay problem rather than a lost event.

A rejected signature is recorded in the security audit, never in the provider event ledger. Writing it to the ledger would let anyone who can reach the endpoint fill a delivery history with noise.

Duplicates and ordering

Duplicate suppression uses (providerProfileId, providerEventId) where the provider supplies an event id, and a deterministic fingerprint over profile, request id, event type, occurrence time and payload digest where it does not. A duplicate is acknowledged and projected exactly once.

Out-of-order callbacks are normal. Ordering is resolved by event semantics, not by arrival time.

Unknown fields

Callback parsers tolerate unknown JSON fields. Normalization only rejects a payload when a field required to identify the attempt is missing. Providers add fields; that must not stop ingestion.

Reconciliation

Reconciliation targets:

  • attempts stuck in DISPATCHING past their lease
  • ambiguous submissions
  • accepted attempts whose callback SLA has expired
  • unmatched provider events

A confirmed query result is appended to the same ledger with source = RECONCILIATION and projected by the same projector, so projection replay stays possible: there is no privileged second path that writes projections directly.

Where a provider has no status-query capability, the platform records Unsupported and leaves the attempt ambiguous. It does not infer a final status.

The shipped families, SES and SMTP, have no reconciliation: their assemblers contribute no ReconciliationCapability, so every reconciliation job for them ends Unsupported. The slot on AssembledProvider is for a provider family an adopter assembles with a status query of its own.