diff --git a/docs/notification/api-surface-snapshot.txt b/docs/notification/api-surface-snapshot.txt
index f1ecb1ce..7c73b7bc 100644
--- a/docs/notification/api-surface-snapshot.txt
+++ b/docs/notification/api-surface-snapshot.txt
@@ -2,7 +2,7 @@
# Every top-level public type under the platform packages. Growth is a reviewed change.
# Update only after review with:
# ./gradlew :adapter:outbound:notification:updateNotificationApiSurface -PapproveNotificationApiSurfaceChange
-# types: 378
+# types: 379
dev.caskeleton.adapter.outbound.notification.NotificationConfig
dev.caskeleton.adapter.outbound.notification.NotificationRoutesSettings
dev.caskeleton.adapter.outbound.notification.core.FailOpenNotificationProvider
@@ -100,6 +100,7 @@ dev.caskeleton.application.notification.platform.admin.AdminAuthorizationGuard
dev.caskeleton.application.notification.platform.admin.AdminOperationClaim
dev.caskeleton.application.notification.platform.admin.AdminOperationResult
dev.caskeleton.application.notification.platform.admin.AdminOperationStorePort
+dev.caskeleton.application.notification.platform.admin.AdminTargetNotFoundException
dev.caskeleton.application.notification.platform.admin.ChangeProviderStateCommand
dev.caskeleton.application.notification.platform.admin.ChangeProviderStateUseCase
dev.caskeleton.application.notification.platform.admin.ChangeSuppressionCommand
diff --git a/docs/notification/operations.md b/docs/notification/operations.md
index e9fb4a2c..cf526540 100644
--- a/docs/notification/operations.md
+++ b/docs/notification/operations.md
@@ -51,11 +51,28 @@ redrive는 `NotificationId`와 `RecipientDeliveryId`를 유지하고, 새 `Deliv
- 확인은 두 겹이다. permission은 전송의 호출자가 이 연산을 부를 수 있는지다(`@RequiresPermission`). authority와
tenant 범위는 command의 `AdminActor`가 쥐고, 연산이 건드리는 delivery의 tenant와 대조한다.
-- redrive가 받은 attempt id가 없거나 그 attempt가 운영자 tenant 밖이면 둘 다 `DeliveryAttemptNotFoundException`이다.
- 이 예외는 `ApiErrorCarrier`라서 모든 전송이 code `DELIVERY_ATTEMPT_NOT_FOUND`(category `NOT_FOUND`, retryable false)로
- 답하고 서버 오류로 남기지 않는다. web은 404다. 운영자 입력이라 서버 오류가 아니고, 두 경우가 같은 답이라 다른 tenant에 그 id가 있는지도
- 알 수 없다. 예외의 descriptor는 알림 code 목록의 `VALIDATION_FAILED`라 응답 code와 다르다. reconcile은 묶음 안의 없는
- id를 건너뛴다.
+- 아래 거절은 모두 운영자 입력이라 서버 오류가 아니다. 거절 예외는 `ApiErrorCarrier`라서 실패를 답하는 전송(web·GraphQL·gRPC)이
+ 아래 code(`NotificationAdminErrorCode`)로 답하고 서버 오류로 남기지 않는다. 예외의 descriptor는 알림 code 목록 값이라
+ 응답 code와 다르다. 전송마다의 모양은 `docs/upgrade/2026-11-notification-admin-refusals.md` 2.1절이다. 이 표 밖의 거절
+ (provider 상태 연산에서 runtime이 받아들이지 않은 변경, 없는 profile)은 아직 500과 ERROR 로그다.
+
+ | 거절 | code | web | retryable | 운영자가 할 일 |
+ |---|---|---|---|---|
+ | authority가 없다. tenant 범위 운영자가 provider 상태를 바꾸려 했다 | `ADMIN_ACCESS_DENIED` | 403 | false | authority를 받거나 tenant 범위 없는 운영자에게 맡긴다 |
+ | redrive의 attempt id가 없거나 그 attempt가 운영자 tenant 밖이다. reconcile 묶음에 그런 id가 하나라도 있다 | `DELIVERY_ATTEMPT_NOT_FOUND` | 404 | false | id를 확인한다. reconcile은 묶음 전체가 거절되니 그 id를 빼고 다시 보낸다 |
+ | suppression이 운영자 tenant 밖의 tenant를 골랐다 | `ADMIN_TARGET_NOT_FOUND` | 404 | false | tenant를 확인한다 |
+ | 모호한 attempt를 중복 위험 승인 없이 redrive했다 | `DUPLICATE_RISK_APPROVAL_REQUIRED` | 409 | false | 중복 위험을 받아들이면 승인을 붙여 다시 보낸다 |
+ | operation id가 전에 다른 요청에 쓰였다 | `ADMIN_OPERATION_CONFLICT` | 422 | false | 새 operation id를 쓴다 |
+ | 같은 operation id·같은 요청을 다른 호출자가 아직 처리하고 있다 | `ADMIN_OPERATION_IN_PROGRESS` | 409 | false | 기다렸다가 같은 id·같은 요청을 다시 보낸다. 끝났으면 저장된 결과가 온다. 오래 가면 아래처럼 새 id를 쓴다 |
+
+- authority는 대상을 읽기 전에 본다. 그래서 403은 대상에 대해 아무것도 알려 주지 않는다. tenant 밖의 대상은 authority
+ 거절이 아니라 없는 대상과 같은 404다. redrive와 reconcile은 없는 attempt와 남의 tenant attempt가 같은 답이라 다른 tenant에
+ 그 id가 있는지 알 수 없다.
+- reconcile은 provider를 부르기 전에 묶음의 id를 모두 본다. 하나라도 없거나 운영자 tenant 밖이면 묶음 전체를 거절하고
+ 아무것도 묻지 않는다(dry run도 같다). 그래서 처리 수(`affected`)는 묶음의 id 수와 같다. 보존 기간이 지나 지워진 attempt
+ id가 섞인 묶음도 거절된다.
+- provider 호출 중에 프로세스가 멈춘 reconcile의 operation id는 claim이 끝나지 않아(claim에 만료가 없다) 계속 진행 중으로
+ 답한다. 그 묶음은 새 operation id로 보낸다. 그래서 진행 중은 retryable이 false다.
- 모든 연산은 운영자가 준 operation id로 멱등이다. 같은 id·같은 요청은 저장된 결과를 돌려주고, 같은 id·다른 요청은
충돌이다. 대상 확인(tenant·중복 위험)과 claim과 쓰기는 한 쓰기 트랜잭션에서 커밋한다. reconcile만 대상 확인을 읽기
트랜잭션에서 하고, provider 호출은 트랜잭션 밖에서 하며, claim과 결과를 따로 커밋한다.
diff --git a/docs/upgrade/2026-11-notification-admin-redrive.md b/docs/upgrade/2026-11-notification-admin-redrive.md
index 26251e16..66ace525 100644
--- a/docs/upgrade/2026-11-notification-admin-redrive.md
+++ b/docs/upgrade/2026-11-notification-admin-redrive.md
@@ -34,6 +34,10 @@
- `ReconcileDeliveriesUseCase`는 묶음 안의 없는 attempt id를 그대로 건너뛴다.
- suppression·reconcile·provider 상태 연산은 남의 tenant 대상을 전처럼 `AdminAccessDeniedException`으로 거절한다.
authority가 없을 때의 답도 네 연산 모두 그대로다.
+- 2026-11-23에 위 두 줄의 일부가 낡았다. reconcile의 없는 id와 남의 tenant attempt, suppression의 남의 tenant의 답과,
+ authority 없음의 응답(예외는 그대로 `AdminAccessDeniedException`, 이제 403)은
+ `docs/upgrade/2026-11-notification-admin-refusals.md` 2.1절이 대신한다. provider 상태 연산이 tenant 범위 운영자를
+ `AdminAccessDeniedException`으로 거절하는 것은 그대로다(이제 403).
- 오류 code 목록(`NotificationFailureCode`)과 템플릿 오류 code registry(`docs/registries/error-codes.yaml`)는 그대로다.
not-found 코드는 그 목록이 아니라 전송이 읽는 `NotificationAdminErrorCode`에 두었다. 새 예외의 descriptor는 있는
값(`VALIDATION_FAILED`, `INVALID_PAYLOAD`)이라 descriptor code와 응답 code가 다르다.
diff --git a/docs/upgrade/2026-11-notification-admin-refusals.md b/docs/upgrade/2026-11-notification-admin-refusals.md
new file mode 100644
index 00000000..b86865cc
--- /dev/null
+++ b/docs/upgrade/2026-11-notification-admin-refusals.md
@@ -0,0 +1,63 @@
+# 업그레이드 안내 — 2026-11 알림 운영자 연산의 거절
+
+- 범위: 알림 운영자 연산 넷(`RedriveDeliveryUseCase`·`ReconcileDeliveriesUseCase`·`ChangeSuppressionUseCase`·
+ `ChangeProviderStateUseCase`)이 운영자 입력을 거절할 때 전송이 내는 답과, reconcile이 없는 attempt id와 남의 tenant
+ attempt를 다루는 규칙을 바꾼 변경. 설정 키는 그대로다. 공개 타입이
+ 하나 늘었고(`AdminTargetNotFoundException`), 공개 메서드 `AdminAuthorizationGuard.requireTenant`의 인자가 하나 줄었다.
+ 템플릿은 이 연산을 부르는 전송을 싣지 않는다. 알림 capability(`:composition:notification-platform`)를 싣고 이 연산에
+ 전송(운영자 화면, admin endpoint)을 연 서비스만 해당한다.
+- 근거: 2026-11-23 리뷰 발견 REV-BE-0058과 REV-BE-0059. 운영자 실수는 클라이언트 탓이라 carrier로 답하고, 남의 것은 없는 것과 같은 404로
+ 답한다는 것은 `docs/manual/06-errors.md` 「판단: 어떤 예외 타입으로 던지나」와 `docs/manual/07-authorization.md`
+ 「객체 단위 권한」이 이미 약속했다. 거절마다 status를 고른 것과 reconcile 묶음을 통째로 거절하는 것은 review 허브의
+ 권하는 안이고 소유자 결정이 아니다
+ (`docs/work/reference/decisions.md` 2.3절).
+
+## 1. 누가 읽나
+
+이 템플릿을 `upstream` remote로 두고 merge해 받는 파생 서비스가 읽는다. 특히 알림 운영자 연산을 부르는 전송을 연 서비스다.
+
+## 2. 바뀐 동작
+
+### 2.1 2026-11-23 — 거절 다섯을 클라이언트 오류로, reconcile의 없는·남의 id를 404 하나로 (따라 할 일 있음)
+
+거절마다 답하는 code다. code는 `application-notification`의 `NotificationAdminErrorCode`다.
+
+| code | 거절 | 예외 | status | category | retryable |
+| --- | --- | --- | --- | --- | --- |
+| `ADMIN_ACCESS_DENIED` | 운영자에게 연산의 authority가 없다. 또는 tenant 범위 운영자가 provider 상태를 바꾸려 했다 | `AdminAccessDeniedException` | 403 | `AUTHZ` | false |
+| `ADMIN_TARGET_NOT_FOUND` | suppression이 운영자 tenant 밖의 tenant를 골랐다 | `AdminTargetNotFoundException`(새 타입) | 404 | `NOT_FOUND` | false |
+| `DUPLICATE_RISK_APPROVAL_REQUIRED` | 모호한 attempt의 redrive가 중복 위험 승인 없이 왔다 | `DuplicateRiskApprovalRequiredException` | 409 | `CONFLICT` | false |
+| `ADMIN_OPERATION_CONFLICT` | operation id가 전에 다른 요청에 쓰였다 | 공개되지 않은 타입(`RuntimeException`) | 422 | `VALIDATION` | false |
+| `ADMIN_OPERATION_IN_PROGRESS` | 같은 operation id·같은 요청을 다른 호출자가 아직 처리하고 있다 | 공개되지 않은 타입(`RuntimeException`) | 409 | `CONFLICT` | false |
+
+| # | 바뀐 것 | 전에는 | 할 일 | 안 하면 | 해당 서비스 |
+| --- | --- | --- | --- | --- | --- |
+| 1 | 위 다섯 예외가 `ApiErrorCarrier`를 구현한다. 실패를 답하는 공용 처리기가 위 code로 답한다. web은 위 status와 error 본문(code·category·category별 고정 문구·retryable)이고, 서버 오류 로그와 span 오류를 남기지 않는다. 다섯 모두 retryable false라 `Retry-After` 헤더도 없다. GraphQL은 errors의 code가 위 code이고 category는 `AUTHORIZATION`(403)·`BUSINESS`(404·409)·`REQUEST`(422)다. 실패 자신이 carrier라서 등록 매핑보다 먼저 답한다. resolver observation은 전처럼 던진 예외를 오류로 센다(`graphql.outcome=ERROR`와 span 오류). gRPC는 `PERMISSION_DENIED`(403)·`NOT_FOUND`(404)·`ABORTED`(409)·`INVALID_ARGUMENT`(422)와 trailer `error-code`·`error-category`·`error-retryable`이고 서버 오류 로그를 남기지 않는다. STOMP `@MessageMapping`이 던진 실패는 전처럼 frame을 보내지 않고 ERROR 로그만 사라진다. 예외 타입·메시지·descriptor(알림 code 목록 값)는 그대로다 | carrier가 아니어서 공용 처리기가 서버 오류로 다뤘다. web은 500 `INTERNAL_ERROR`와 ERROR 로그·span 오류, gRPC는 `INTERNAL`, GraphQL은 이 타입(또는 상위 타입)을 등록한 매핑이 없으면 `INTERNAL_ERROR`였다. STOMP는 frame 없이 ERROR 로그를 남겼다. 운영자 실수가 5xx 경보를 울렸다 | 500·`INTERNAL`을 거절로 읽던 운영자 화면·모니터링을 위 code로 바꾼다. `ADMIN_OPERATION_IN_PROGRESS`는 기다렸다가 같은 요청을 다시 보낸다(첫 요청이 끝났으면 저장된 결과가 온다). claim에 만료가 없어서 provider 호출 중에 프로세스가 멈춘 reconcile의 id는 끝나지 않는다. 그래서 retryable이 false이고, 오래 가면 새 operation id로 보낸다. retryable을 보고 자동으로 다시 보내는 공용 재시도는 이 code를 다시 보내지 않는다. `ADMIN_OPERATION_CONFLICT`는 다시 보내지 않고 새 operation id를 쓴다. GraphQL에 `GraphQlExceptionResolver`로 이 예외나 상위 타입(`NotificationException`, `RuntimeException` 등)을 등록해 자기 code로 답하던 서비스는 그 매핑이 더 쓰이지 않는다(`docs/work/reference/decisions.md` 2.3절 「GraphQL 판정 순서」). 자기 code가 필요하면 이 예외를 감싼 자기 예외로 던지고 그 타입을 등록한다. web `@ExceptionHandler`와 이 예외를 직접 잡던 코드는 그대로 동작한다 | 운영자 화면이 이 code를 모르면 거절을 처리하지 못한다. 5xx만 세던 경보 규칙은 이 거절을 더 보지 않는다. GraphQL의 등록 매핑에 기대던 분기는 code가 바뀌어 깨진다 | 알림 운영자 연산 전송을 연 서비스 |
+| 2 | suppression이 운영자 tenant 밖의 tenant를 고르면 `AdminTargetNotFoundException`이다. 이 예외는 상태를 싣지 않는다. 거절은 그 tenant의 어떤 것도 읽지 않아서, 답으로 그 tenant가 무엇을 가졌는지 알 수 없다 | `AdminAccessDeniedException`(`required()`는 `SUPPRESS`)이었다. 운영자에게 authority가 없을 때와 같은 예외였다 | 이 경우를 `AdminAccessDeniedException`으로 잡던 코드를 `AdminTargetNotFoundException`으로 바꾼다. `AdminAccessDeniedException`은 이제 authority가 없을 때와 tenant 범위 운영자의 provider 상태 변경에만 난다. 공용 처리기에 맡겼다면 고칠 코드는 없다(web 응답이 404로 바뀐다) | 그 catch가 이 예외를 놓쳐 공용 처리기로 간다. 서비스가 만든 거절 응답 대신 `ADMIN_TARGET_NOT_FOUND`(web은 404)가 나간다 | 알림 운영자 연산 전송을 연 서비스 |
+| 3 | `AdminAuthorizationGuard.requireTenant(AdminActor, TenantId)`가 authority 인자를 받지 않는다. tenant 밖이면 `AdminTargetNotFoundException`을 던진다 | `requireTenant(AdminActor, TenantId, NotificationAdminAuthority)`가 그 authority를 실은 `AdminAccessDeniedException`을 던졌다 | 이 guard를 자기 연산에 쓰는 서비스는 셋째 인자를 지우고, 거절을 잡던 곳은 2행대로 바꾼다 | 컴파일이 실패한다 | 이 guard를 직접 부르는 서비스 |
+| 4 | reconcile 묶음에 없는 attempt id나 운영자 tenant 밖의 attempt가 하나라도 있으면 provider를 부르기 전에 묶음 전체를 `DeliveryAttemptNotFoundException`(404 `DELIVERY_ATTEMPT_NOT_FOUND`, redrive와 같은 답)으로 거절한다. dry run도 같다. operation id를 claim하지 않고 audit도 남기지 않는다. 없는 id와 남의 tenant id가 같은 답이라 다른 tenant에 그 attempt가 있는지 알 수 없다. 통과한 묶음의 처리 수(`affected`)는 묶음의 id 수와 같다. 이 판정은 operation id claim보다 먼저라, 끝난 operation id를 다시 보내도(replay) 먼저 지난다. 그 사이 attempt가 지워졌으면 저장된 결과 대신 이 404다(redrive도 같다) | 없는 id는 건너뛰고도 처리 수에 셌다(dry run은 id 수를 그대로 답했다). 남의 tenant attempt는 `AdminAccessDeniedException(RECONCILE)`이라 web에서 500이었다. 그래서 tenant 범위 운영자가 id를 넣어 보는 것만으로 남의 tenant에 그 attempt가 있는지 알 수 있었다 | 보존 기간이 지나 지워진 attempt id를 섞어 보내던 운영자 도구는 그 id를 빼고 다시 보낸다. 답은 어느 id인지 알려 주지 않으니 묶음을 나눠 보내 찾는다. reconcile의 남의 tenant 거절을 `AdminAccessDeniedException`으로 잡던 코드는 `DeliveryAttemptNotFoundException`으로 바꾼다 | 지워진 id 하나가 묶음 전체를 막는다. 그 catch가 이 예외를 놓쳐 공용 처리기로 가고 `DELIVERY_ATTEMPT_NOT_FOUND`(web은 404)가 나간다 | 알림 운영자 연산 전송을 연 서비스 |
+
+## 3. 바뀌지 않은 것
+
+- redrive의 없는 attempt id와 남의 tenant attempt는 전처럼 404 `DELIVERY_ATTEMPT_NOT_FOUND`다
+ (`docs/upgrade/2026-11-notification-admin-redrive.md` 2.1절).
+- authority는 대상을 읽기 전에 본다. 그래서 403은 대상에 대해 아무것도 알려 주지 않는다.
+- reconcile 묶음에 같은 id를 두 번 넣으면 전처럼 그 id를 두 번 처리하고 두 번 센다.
+- 같은 operation id·같은 요청은 전처럼 저장된 결과를 돌려준다.
+- carrier가 아닌 실패는 공용 처리기가 전처럼 500으로 답한다(web `GlobalExceptionHandler`). 운영자 연산에서도 2.1절이 다루지
+ 않은 거절은 그대로다. provider 상태 연산이 runtime이 받아들이지 않은 변경(`ProviderConfigurationException`)이나 없는 profile을
+ 받으면 전처럼 500과 ERROR 로그다.
+- 오류 code 목록(`NotificationFailureCode`)과 템플릿 오류 code registry(`docs/registries/error-codes.yaml`)는 그대로다.
+ 응답 code는 전송이 읽는 `NotificationAdminErrorCode`에 두었다. 예외의 descriptor는 알림 code 목록 값이라
+ descriptor code와 응답 code가 다르다.
+- 같은 operation id를 다른 요청에 쓴 거절이 409가 아니라 422인 것은 같은 멱등 키·다른 요청을 422로 답하는 규칙을
+ 따랐다(`docs/manual/06-errors.md` 「판단: 어떤 예외 타입으로 던지나」). operation id가 이 연산의 멱등 키다.
+
+## 4. 되돌리는 법
+
+다섯 예외의 carrier 구현, `NotificationAdminErrorCode`의 다섯 행, `AdminTargetNotFoundException`, `requireTenant`의 인자,
+reconcile의 묶음 판정, 문서와 API surface 기준선 행을 함께 revert하고, 이 문서에 되돌린 행을 더한다. operation id 재사용만 409로 바꾸려면
+`ADMIN_OPERATION_CONFLICT`를 `(409, Category.CONFLICT, false)`로 바꾸고, 시험 행, 그 enum 상수와
+`AdminOperationConflictException`의 Javadoc, 이 문서·`docs/web/http-contract.md` 4절·`docs/notification/operations.md`·
+`docs/work/reference/decisions.md` 2.3절의 422를 409로 고친다. 진행 중을 retryable true로 바꾸려면 claim에 만료가 먼저
+있어야 한다.
diff --git a/docs/web/http-contract.md b/docs/web/http-contract.md
index 8af6eb86..73d541d1 100644
--- a/docs/web/http-contract.md
+++ b/docs/web/http-contract.md
@@ -15,7 +15,8 @@
- 헤더 규칙(3절): `WebMvcRequestIdFilterTest`, `CorsSecurityFilterIntegrationTest`
- web 전용 코드(4절): `TransportErrorHandlingTest`, `IdempotencyKeyHeaderTest`, web-advanced
`WebAdvancedErrorMappingTest`, 알림 기능 코드는 web-notification의 `NotificationAdminRefusalHttpAnswerTest`
- (`DELIVERY_ATTEMPT_NOT_FOUND`)와 `NotificationSubmissionControllerTest`(`IDEMPOTENCY_CONFLICT`)
+ (운영자 연산 거절: `DELIVERY_ATTEMPT_NOT_FOUND`·`ADMIN_*`·`DUPLICATE_RISK_APPROVAL_REQUIRED`)와
+ `NotificationSubmissionControllerTest`(`IDEMPOTENCY_CONFLICT`)
## 1. Envelope 키 존재 규칙
@@ -191,7 +192,7 @@ CORS가 켜져 있으면(`app.cors.enabled=true`) cross-origin 실제 응답의
## 4. web 전용 오류 코드
`OperationalError`(`docs/registries/error-codes.yaml`) 밖의 코드다. HTTP 어댑터가 내는 코드와, 기능 leaf의 enum이 내고
-HTTP가 그대로 답하는 코드(`DELIVERY_ATTEMPT_NOT_FOUND`, `IDEMPOTENCY_CONFLICT`)가 있다.
+HTTP가 그대로 답하는 코드(알림 운영자 연산 거절, `IDEMPOTENCY_CONFLICT`)가 있다.
| 코드 | status | category | `retryable` | `Retry-After` | 언제 |
| --- | --- | --- | --- | --- | --- |
@@ -200,7 +201,12 @@ HTTP가 그대로 답하는 코드(`DELIVERY_ATTEMPT_NOT_FOUND`, `IDEMPOTENCY_CO
| `RATE_LIMIT_UNAVAILABLE` | 503 | `TRANSIENT_DEPENDENCY` | `true` | 있음 | rate-limit 저장소 응답 없음(`docs/web/runbook.md`) |
| `RATE_LIMIT_INCOMPATIBLE` | 503 | `INTERNAL` | `false` | 없음 | rate-limit 제공자가 계약과 맞지 않음 |
| `OPERATION_NOT_FOUND` | 404 | `NOT_FOUND` | `false` | 없음 | durable operation 조회(`DurableOperationController`)에서 그 operation이 없거나 다른 호출자의 것이다. 둘을 가르지 않는다 |
-| `DELIVERY_ATTEMPT_NOT_FOUND` | 404 | `NOT_FOUND` | `false` | 없음 | 알림 운영자 redrive(`RedriveDeliveryUseCase`)가 받은 attempt가 없거나 운영자 tenant 밖이다. 둘을 가르지 않는다. 코드는 `application-notification`의 `NotificationAdminErrorCode`라 모든 전송이 같은 코드로 답한다. 템플릿은 이 연산의 전송을 싣지 않는다(`docs/notification/operations.md`) |
+| `DELIVERY_ATTEMPT_NOT_FOUND` | 404 | `NOT_FOUND` | `false` | 없음 | 알림 운영자 redrive(`RedriveDeliveryUseCase`)가 받은 attempt나 reconcile(`ReconcileDeliveriesUseCase`) 묶음의 attempt 하나가 없거나 운영자 tenant 밖이다. 둘을 가르지 않는다. reconcile은 provider를 부르기 전에 묶음 전체를 거절한다. 코드는 `application-notification`의 `NotificationAdminErrorCode`라 실패를 답하는 전송(web·GraphQL·gRPC)이 같은 코드로 답한다. 템플릿은 이 연산의 전송을 싣지 않는다(`docs/notification/operations.md`) |
+| `ADMIN_ACCESS_DENIED` | 403 | `AUTHZ` | `false` | 없음 | 알림 운영자 연산에서 운영자에게 그 연산의 authority가 없거나, tenant 범위 운영자가 provider 상태를 바꾸려 했다. authority는 대상을 읽기 전에 보므로 대상에 대해 알려 주지 않는다. 코드는 `application-notification`의 `NotificationAdminErrorCode`다(아래 운영자 연산 행 모두 같다). 템플릿은 이 연산의 전송을 싣지 않는다(`docs/notification/operations.md`) |
+| `ADMIN_TARGET_NOT_FOUND` | 404 | `NOT_FOUND` | `false` | 없음 | 알림 운영자 suppression이 운영자 tenant 밖의 tenant를 골랐다. 권한 거절(403)이 아니라 없는 대상과 같은 404라 그 tenant가 무엇을 가졌는지 알려 주지 않는다 |
+| `DUPLICATE_RISK_APPROVAL_REQUIRED` | 409 | `CONFLICT` | `false` | 없음 | 이미 사용자에게 닿았을 수 있는 attempt의 redrive가 중복 위험 승인 없이 왔다. 같은 요청은 다시 거절된다. 승인을 붙여 보낸다 |
+| `ADMIN_OPERATION_CONFLICT` | 422 | `VALIDATION` | `false` | 없음 | 알림 운영자 연산의 operation id(그 연산의 멱등 키)가 전에 다른 요청에 쓰였다. 같은 멱등 키·다른 요청이라 409가 아니다(`docs/manual/06-errors.md`). 새 operation id를 쓴다 |
+| `ADMIN_OPERATION_IN_PROGRESS` | 409 | `CONFLICT` | `false` | 없음 | 같은 operation id·같은 요청을 다른 호출자가 아직 처리하고 있다. 기다렸다가 같은 요청을 다시 보내면 끝난 결과가 온다. 다만 claim에 만료가 없어서 provider 호출 중에 프로세스가 멈춘 reconcile의 id는 끝나지 않는다. 그래서 2절의 `IDEMPOTENT_IN_FLIGHT`(lease가 지나면 409가 끝난다)와 달리 retryable이 `false`이고 `Retry-After`도 없다. 오래 가면 새 operation id를 쓴다 |
| `IDEMPOTENCY_CONFLICT` | 422 | `VALIDATION` | `false` | 없음 | 알림 제출(`POST /notifications`)이 본문의 `idempotencyKey`를 이미 다른 알림에 쓴 키로 받았다. 견주는 것은 본문이 아니라 알림 plan 지문이다. 2절의 `Idempotency-Key` 헤더와는 다른 키라 `IDEMPOTENT_REQUEST_MISMATCH`가 아니다. 다시 보내지 않는다. 새 알림이면 새 키를 쓴다. 코드는 `application-notification`의 `NotificationSubmissionErrorCode`라 실패를 답하는 전송(web·GraphQL·gRPC)이 같은 코드로 답한다(`docs/manual/05-idempotency.md` 「executor를 쓰지 않는 중복 판정 둘」) |
- 컨트롤러 파라미터 제약 위반(`@RequestParam @Max(10)`)은 요청 본문 위반과 같은
diff --git a/docs/work/reference/decisions.md b/docs/work/reference/decisions.md
index 9c272f76..7b61da3c 100644
--- a/docs/work/reference/decisions.md
+++ b/docs/work/reference/decisions.md
@@ -111,8 +111,10 @@
| GraphQL DataLoader 키 실패 | 등록된 `ApiErrorCode`만 노출 | 소유자 | 결정 25 |
| Draft-12 offset 불일치 | problem 문서는 프로토콜 예외로 유지 | 소유자 | 결정 12 |
| 알림 category 생략 | 거부(400), 판정은 유스케이스 | 소유자 | 결정 13 |
-| 알림 redrive의 없는·남의 attempt | 없는 attempt id와 운영자 tenant 밖의 attempt를 같은 404 carrier(`DeliveryAttemptNotFoundException`, code `DELIVERY_ATTEMPT_NOT_FOUND`) 하나로 답한다. 권한 거절(403)로 바꾸는 안과 문서만 500으로 고치는 안은 버렸다. 알림 code 목록(`NotificationFailureCode`)과 템플릿 registry는 넓히지 않는다. 다른 운영자 연산의 tenant 거절은 그대로다 | 기본값(2026-11-22, review 허브가 고른 권하는 안, 자율 운영. 소유자가 정한 것이 아니고 뒤집을 수 있다) | review 허브 REV-BE-0039 정정(2026-11-22 12:51), `docs/upgrade/2026-11-notification-admin-redrive.md` 2.1절 |
+| 알림 redrive의 없는·남의 attempt | 없는 attempt id와 운영자 tenant 밖의 attempt를 같은 404 carrier(`DeliveryAttemptNotFoundException`, code `DELIVERY_ATTEMPT_NOT_FOUND`) 하나로 답한다. 권한 거절(403)로 바꾸는 안과 문서만 500으로 고치는 안은 버렸다. 알림 code 목록(`NotificationFailureCode`)과 템플릿 registry는 넓히지 않는다. 다른 운영자 연산의 tenant 거절은 그대로다(2026-11-23에 아래 「알림 운영자 연산의 거절」·「알림 reconcile의 없는·남의 attempt」 행이 바꿨다) | 기본값(2026-11-22, review 허브가 고른 권하는 안, 자율 운영. 소유자가 정한 것이 아니고 뒤집을 수 있다) | review 허브 REV-BE-0039 정정(2026-11-22 12:51), `docs/upgrade/2026-11-notification-admin-redrive.md` 2.1절 |
| 알림 제출의 같은 키·다른 plan | 알림 제출이 이미 다른 plan에 쓴 `idempotencyKey`를 받으면 422 carrier(`IdempotencyConflictException`, code `IDEMPOTENCY_CONFLICT`, category `VALIDATION`, retryable false)로 답한다. code는 기능 enum `NotificationSubmissionErrorCode`에 둔다. executor의 `IDEMPOTENT_REQUEST_MISMATCH`를 다시 쓰는 안과 web-notification에만 처리기를 두는 안은 버렸다. `NotificationException` 전체를 carrier로 만들지 않는다(서버 쪽 실패까지 4xx가 된다). 알림 code 목록(`NotificationFailureCode`)과 템플릿 registry는 넓히지 않는다 | 기본값(2026-11-22, review 허브가 고른 권하는 안, 자율 운영. 소유자가 정한 것이 아니고 뒤집을 수 있다) | review 허브 REV-BE-0054 요청(2026-11-22 12:58), `docs/upgrade/2026-11-notification-idempotency-conflict.md` 2.1절 |
+| 알림 운영자 연산의 거절 | 운영자 입력 거절 다섯을 carrier로 답한다. code는 기능 enum `NotificationAdminErrorCode`다: authority 없음 403 `ADMIN_ACCESS_DENIED`, suppression의 tenant 밖 대상 404 `ADMIN_TARGET_NOT_FOUND`(권한 거절이 아니라 없는 대상과 같은 답), 중복 위험 승인 없음 409 `DUPLICATE_RISK_APPROVAL_REQUIRED`, operation id 재사용 422 `ADMIN_OPERATION_CONFLICT`, 같은 id 진행 중 409 `ADMIN_OPERATION_IN_PROGRESS`(retryable false, `Retry-After` 없음: claim에 만료가 없어 provider 호출 중 멈춘 reconcile의 id는 끝나지 않는다. 다시 보내도 되는지는 code가 알린다). 요청의 표는 재사용을 409로 적었지만, 같은 멱등 키·다른 요청은 422라는 `docs/manual/06-errors.md` 판단 표와 executor 선례(`IDEMPOTENT_REQUEST_MISMATCH`)를 따라 422로 했다. 문서만 500으로 고치는 안과 web 처리기에서 이름으로 잡는 안은 버렸다. 알림 code 목록(`NotificationFailureCode`)과 템플릿 registry는 넓히지 않는다 | 기본값(2026-11-23, review 허브가 고른 권하는 안, 자율 운영. 422는 백엔드 개발자가 매뉴얼에 맞췄고 review가 2026-11-23에 확정했다(요청 표가 판단 표보다 먼저 쓰였다). 소유자가 정한 것이 아니고 뒤집을 수 있다) | review 허브 REV-BE-0058 요청(2026-11-23 09:40), `docs/upgrade/2026-11-notification-admin-refusals.md` 2.1절 |
+| 알림 reconcile의 없는·남의 attempt | reconcile 묶음에 없는 attempt id나 운영자 tenant 밖의 attempt가 하나라도 있으면 provider를 부르기 전에 묶음 전체를 redrive와 같은 404 carrier(`DeliveryAttemptNotFoundException`)로 거절한다. dry run도 같다. 처리 수는 묶음의 id 수다. 대가로 보존 기간이 지나 지워진 id가 섞인 묶음도 거절된다. 없는 id와 남의 id를 둘 다 건너뛰고 있는 것만 세는 안(「남의 id가 있으면 아무것도 안 바꾼다」가 깨지고 오타가 성공으로 보인다)과 지금대로 두는 안(존재가 드러난다)은 버렸다 | 기본값(2026-11-23, review 허브가 고른 권하는 안, 자율 운영. 소유자가 정한 것이 아니고 뒤집을 수 있다) | review 허브 REV-BE-0059 요청(2026-11-23 09:40), `docs/upgrade/2026-11-notification-admin-refusals.md` 2.1절 4행 |
| 오류 코드 로그 레벨 | `error-codes.yaml`에 `log_level` 칸을 두지 않는다. 레벨은 실패 종류·경로가 정한다(`ServerFailureLog`, 보안 필터 `AuthErrorResponseWriter`). 칸이 다시 생기면 `OperationalErrorRegistryContractTest`가 실패한다. 보안 필터는 5xx(`AUTH_JWKS_UNAVAILABLE`·`INTERNAL_AUTH_MISCONFIGURATION`)를 ERROR, 4xx를 WARN으로 남긴다. 401 서명·issuer·audience 불일치는 WARN | 소유자 | 2026-11-06, `docs/design/2026-11-06-error-code-log-level-design.md` 10절 |
| 감싼 carrier를 전송이 읽는 법 | web·GraphQL·STOMP·gRPC 네 전송 모두 원인 사슬의 첫 carrier를 본다. 감싼 carrier의 응답이 500 `INTERNAL_ERROR` 대신 그 carrier의 코드가 된다. 그보다 먼저 답하는 것은 아래 「GraphQL 판정 순서」(등록 매핑)와 「인자 변환 단계의 감싼 carrier」 두 행이다 | 소유자 | `1103` 18.4절(RR7-01-05), 2026-11-06 |
| GraphQL 판정 순서 | 플랫폼 거부 → 실패 자신이 carrier → 등록된 application 매핑 → 원인 사슬의 첫 carrier → 거부된 인자(`IllegalArgumentException`, 인자 binder의 `BindException`) → 가림(`INTERNAL_ERROR`). 앱이 등록한 실패는 carrier를 원인으로 들어도 등록한 코드로 답한다(web에서 앱의 도메인 advice가 먼저 받는 것과 같다). 실패 자신이 carrier인 타입(예: `LockAcquisitionTimeoutException`)을 등록한 매핑은 쓰이지 않는다. 로그 줄은 어느 단계가 답하든 원인 사슬의 첫 carrier로 정한다 — 등록 매핑이 답해도 그 안의 서버 쪽 carrier 줄은 남는다 | 소유자(2026-11-07). 로그 줄도 소유자(2026-11-07, 기본값 확인) | `1103` 19.4절 ①(RR8-01-01), 2026-11-07 총괄 세션 전달 |
diff --git a/src/adapter/inbound/web-notification/src/test/java/dev/caskeleton/adapter/inbound/web/notification/NotificationAdminRefusalHttpAnswerTest.java b/src/adapter/inbound/web-notification/src/test/java/dev/caskeleton/adapter/inbound/web/notification/NotificationAdminRefusalHttpAnswerTest.java
index b5bec64b..9b65109a 100644
--- a/src/adapter/inbound/web-notification/src/test/java/dev/caskeleton/adapter/inbound/web/notification/NotificationAdminRefusalHttpAnswerTest.java
+++ b/src/adapter/inbound/web-notification/src/test/java/dev/caskeleton/adapter/inbound/web/notification/NotificationAdminRefusalHttpAnswerTest.java
@@ -6,41 +6,74 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.read.ListAppender;
+import com.jayway.jsonpath.Configuration;
+import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
+import com.jayway.jsonpath.Option;
import dev.caskeleton.adapter.inbound.web.error.GlobalExceptionHandler;
import dev.caskeleton.application.notification.platform.admin.AdminActor;
import dev.caskeleton.application.notification.platform.admin.AdminAuthorizationGuard;
+import dev.caskeleton.application.notification.platform.admin.ChangeSuppressionCommand;
+import dev.caskeleton.application.notification.platform.admin.ChangeSuppressionUseCase;
import dev.caskeleton.application.notification.platform.admin.DuplicateRiskGuard;
import dev.caskeleton.application.notification.platform.admin.NotificationAdminAuthority;
import dev.caskeleton.application.notification.platform.admin.NotificationAdminErrorCode;
+import dev.caskeleton.application.notification.platform.admin.ReconcileDeliveriesCommand;
+import dev.caskeleton.application.notification.platform.admin.ReconcileDeliveriesUseCase;
+import dev.caskeleton.application.notification.platform.admin.ReconcileRequest;
import dev.caskeleton.application.notification.platform.admin.RedriveDeliveryCommand;
import dev.caskeleton.application.notification.platform.admin.RedriveDeliveryUseCase;
import dev.caskeleton.application.notification.platform.admin.RedriveRequest;
+import dev.caskeleton.application.notification.platform.admin.SuppressionRequest;
import dev.caskeleton.application.notification.platform.admin.testkit.InMemoryAdminOperationStore;
import dev.caskeleton.application.notification.platform.api.ContactPointId;
import dev.caskeleton.application.notification.platform.api.DeliveryAttemptId;
import dev.caskeleton.application.notification.platform.api.ProviderProfileId;
import dev.caskeleton.application.notification.platform.api.TenantId;
import dev.caskeleton.application.notification.platform.api.delivery.RecipientDeliveryState;
+import dev.caskeleton.application.notification.platform.callback.DeliveryAttemptSnapshot;
+import dev.caskeleton.application.notification.platform.callback.ProviderEventProjectionService;
+import dev.caskeleton.application.notification.platform.callback.StandardDeliveryProjector;
+import dev.caskeleton.application.notification.platform.callback.testkit.InMemoryProviderEventLedger;
import dev.caskeleton.application.notification.platform.dispatch.NotificationRequestRecord;
import dev.caskeleton.application.notification.platform.dispatch.RecipientDeliveryRecord;
+import dev.caskeleton.application.notification.platform.dispatch.ReconciliationGatewayPort;
+import dev.caskeleton.application.notification.platform.dispatch.ReconciliationService;
+import dev.caskeleton.application.notification.platform.dispatch.SuppressionSideEffect;
+import dev.caskeleton.application.notification.platform.dispatch.SyntheticEventFingerprint;
+import dev.caskeleton.application.notification.platform.dispatch.testkit.InMemoryContactPointStore;
import dev.caskeleton.application.notification.platform.dispatch.testkit.InMemoryDeliveryAttemptStore;
import dev.caskeleton.application.notification.platform.dispatch.testkit.InMemoryNotificationRequestStore;
import dev.caskeleton.application.notification.platform.dispatch.testkit.InMemoryRecipientQueue;
import dev.caskeleton.application.notification.platform.dispatch.testkit.NotificationRows;
+import dev.caskeleton.application.notification.platform.dispatch.testkit.Sha256ProviderRequestIdHasher;
+import dev.caskeleton.application.notification.platform.observation.NotificationMetricsPort;
import dev.caskeleton.application.notification.platform.observation.testkit.RecordingNotificationAudit;
+import dev.caskeleton.application.notification.platform.policy.SuppressionReason;
+import dev.caskeleton.application.notification.platform.policy.SuppressionScope;
+import dev.caskeleton.application.notification.platform.policy.testkit.InMemorySuppressionStore;
+import dev.caskeleton.application.notification.platform.provider.ReconciliationResult;
import dev.caskeleton.application.transaction.testkit.DirectTransactionPort;
+import dev.caskeleton.shared.error.Category;
import dev.caskeleton.shared.error.ClientErrorMessages;
import java.time.Clock;
+import java.time.Duration;
import java.time.Instant;
import java.time.ZoneOffset;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
-import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Supplier;
+import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
+import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.LoggerFactory;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.web.servlet.MockMvc;
@@ -51,41 +84,78 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
- * What an HTTP caller sees when a notification operator's redrive names an attempt the operator
- * cannot reach.
+ * What an HTTP caller sees when a notification operator operation refuses a request.
*
*
The template ships no operator endpoint. The probe controller below is the transport a service
- * would write: it hands the command to the real use case over the notification fakes and lets the
- * failure reach the real {@link GlobalExceptionHandler}. The use case's own table (both refusals,
- * claims, audit) is {@code NotificationAdminUseCasesTest}; this one is the answer on the wire.
+ * would write: it hands the command to the real use cases over the notification fakes and lets the
+ * failure reach the real {@link GlobalExceptionHandler}. The use cases' own tables (claims, audit,
+ * provider calls) are {@code NotificationAdminUseCasesTest}; this one is the answer on the wire.
+ *
+ *
Every refusal here answers the operator's own input — a missing authority, a target out of
+ * reach, an unapproved duplicate risk, a reused or busy operation id — so none is answered or
+ * recorded as a server failure.
*/
class NotificationAdminRefusalHttpAnswerTest {
private static final Clock CLOCK =
Clock.fixed(Instant.parse("2026-11-23T00:00:00Z"), ZoneOffset.UTC);
+ private static final TenantId TENANT_A = new TenantId("tenant-a");
+ private static final TenantId TENANT_B = new TenantId("tenant-b");
private static final AdminActor TENANT_B_OPERATOR =
new AdminActor(
"operator-b",
- Set.of(NotificationAdminAuthority.REDRIVE),
- Optional.of(new TenantId("tenant-b")));
+ EnumSet.of(
+ NotificationAdminAuthority.REDRIVE,
+ NotificationAdminAuthority.RECONCILE,
+ NotificationAdminAuthority.SUPPRESS),
+ Optional.of(TENANT_B));
private static final String UNKNOWN_ATTEMPT = "00000000-0000-7000-8000-000000000099";
+ // A body without a field reads as null, so a success answer fails the comparison by its values.
+ private static final Configuration LENIENT_JSON =
+ Configuration.defaultConfiguration().addOptions(Option.SUPPRESS_EXCEPTIONS);
+ private static final String ANSWER_FIELDS =
+ "[status, success, error code, category, message, retryable, Retry-After, handler log lines,"
+ + " span error codes]";
private final InMemoryNotificationRequestStore requests = new InMemoryNotificationRequestStore();
private final InMemoryDeliveryAttemptStore attempts = new InMemoryDeliveryAttemptStore(requests);
+ private final InMemoryRecipientQueue recipients = new InMemoryRecipientQueue(requests, CLOCK);
+ private final InMemoryAdminOperationStore operations = new InMemoryAdminOperationStore();
private final RecordingNotificationAudit audit = new RecordingNotificationAudit();
+ private final DirectTransactionPort transactions = new DirectTransactionPort();
private final List spanErrorCodes = new ArrayList<>();
+ private final AtomicInteger providerCalls = new AtomicInteger();
+ private ProviderCall duringProviderCall = () -> {};
+ private AdminActor actor = TENANT_B_OPERATOR;
private final MockMvc mvc =
MockMvcBuilders.standaloneSetup(
- new RedriveProbe(
+ new OperatorProbe(
new RedriveDeliveryUseCase(
new AdminAuthorizationGuard(),
new DuplicateRiskGuard(),
attempts,
- new InMemoryRecipientQueue(requests, CLOCK),
- new InMemoryAdminOperationStore(),
+ recipients,
+ operations,
audit,
- new DirectTransactionPort(),
- CLOCK)))
+ transactions,
+ CLOCK),
+ new ReconcileDeliveriesUseCase(
+ new AdminAuthorizationGuard(),
+ attempts,
+ reconciliation(),
+ operations,
+ audit,
+ transactions,
+ CLOCK),
+ new ChangeSuppressionUseCase(
+ new AdminAuthorizationGuard(),
+ new InMemorySuppressionStore(),
+ operations,
+ audit,
+ transactions,
+ UUID::randomUUID,
+ CLOCK),
+ () -> actor))
.setControllerAdvice(
new GlobalExceptionHandler((error, code) -> spanErrorCodes.add(code)))
.build();
@@ -100,58 +170,218 @@ class NotificationAdminRefusalHttpAnswerTest {
void anUnreachableRedriveAnswersOneNotFoundAndRecordsNoServerFailure(
String target, boolean dryRun) throws Exception {
// given
- String attemptId = "foreign".equals(target) ? storedAttemptOfTenantA() : UNKNOWN_ATTEMPT;
- Logger handlerLogger = (Logger) LoggerFactory.getLogger(GlobalExceptionHandler.class);
- ListAppender handlerLog = new ListAppender<>();
- handlerLog.start();
- handlerLogger.addAppender(handlerLog);
+ String attemptId = "foreign".equals(target) ? storedAttemptOf(TENANT_A) : UNKNOWN_ATTEMPT;
// when
- MockHttpServletResponse response;
- try {
- response =
- mvc.perform(
- post("/operator/redrives/{attemptId}", attemptId)
- .param("dryRun", String.valueOf(dryRun)))
- .andReturn()
- .getResponse();
- } finally {
- handlerLogger.detachAppender(handlerLog);
- handlerLog.stop();
- }
+ List