review-followup Wave 2: 정합성 수정 통합과 검증, 현황표·재개 프롬프트
13개 작업 묶음(P1–P13)의 W2 커밋을 합치고 전체 게이트로 검증했다. - 묶음별 정합성 수정(notification dispatch·recovery, object storage staged publication, fileserver 복구·정리, gRPC 플랫폼, Redis 분류·lease TTL, JPA outbox claim 순서·durable operation HTTP, web 요청 id·category 필수, graphql 에러 mapper, Mongo profile 바인딩, build 소스 보존 게이트·compose smoke info 확인) - 통합 때 드러난 3건 수정: outbox claim 테스트 fixture의 가짜 envelope hash, sample scan이 새 operation controller를 등록하던 문제, SpotBugs aux classpath 파일이 truncate되지 않아 로컬에서 ".jar.jar"로 실패하던 문제 - 현황표: 묶음 결과 반영, 소유자 결정 21–27, 후속 발견 결함 47행, 요약 갱신 - docs/capability-status.md 「제거된 코드」에 85행 추가 - 묶음 결과 파일·에이전트 지시·스크립트를 docs로 옮기고 desktop 재개 프롬프트 추가 검증: check, ci verifyDependencyLocks, mainCheck, architecture/public path/env keys/config contract, bootstrap·sample integration/system, build-logic·build-tools test, optional-platforms ci, qualificationBootJar 통과. integrationCheck는 이번 작업 전에도 실패하던 lane(Redis topology 모드 인자, httpclient failure injection, AWS 보호 lane)만 실패. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
700d89fd92
commit
016597ac78
@@ -39,7 +39,7 @@ lanes and CI; it is not a deployment artifact.
|
||||
| GraphQL transport | `backend.graphql.enabled` / `APP_GRAPHQL_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:graphql')`) | leaf-level | On when present; `false` also excludes Spring GraphQL's own auto-configuration, so no `/graphql` (`GraphQlCapabilityActivationTest`). `graphqlTransportQualificationTest` runs the HTTP boundary. The deployment-mode/runtime-profile rule is the module's own `GraphQlPlatformStartupValidator`. The default jar does not ship GraphQL, so a compose lane that exercises it runs the qualification jar. |
|
||||
| Object storage | `app.object-storage.enabled` (no `APP_*` row), `true` | yes | yes (one line: `runtimeOnly project(':adapter:outbound:objectstorage')`) | MinIO only | Own `ObjectStorageAutoConfiguration` (was bound through bootstrap's properties scan); on when present, `false` leaves only the explicit legacy seam (`ObjectStorageAutoConfigurationTest`). `app-bootstrap:integrationTest` assembles it against digest-pinned MinIO. |
|
||||
| gRPC platform | — (build-level) | yes | **no** | yes | Absent from the main build entirely: `optional-platforms` is a separate Gradle build, so the switch is the `include`, not an environment variable. `-p optional-platforms ci` runs on every PR and `integrationCheck` certifies the operation ledger against real PostgreSQL. |
|
||||
| gRPC transport (`adapter:inbound:grpc`) | `ca-skeleton.grpc.enabled` (no `APP_*` row), `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:grpc')`) | leaf-level | Own `AutoConfiguration.imports` (`GrpcServerConfig`); on when present, and the loopback plaintext listener still needs `ca-skeleton.grpc.allow-insecure-local=true` (`GrpcSafeActivationTest`, `grpcTransportQualificationTest`). |
|
||||
| gRPC transport (`adapter:inbound:grpc`) | `ca-skeleton.grpc.server.enabled` (no `APP_*` row), `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:grpc')`) | leaf-level | Own `AutoConfiguration.imports` (`GrpcServerConfig`); on when present, and the loopback plaintext listener still needs `ca-skeleton.grpc.server.allow-insecure-local=true` (`GrpcSafeActivationTest`, `grpcTransportQualificationTest`). |
|
||||
| WebSocket transport | `app.websocket.enabled` / `APP_WEBSOCKET_ENABLED`, `true` | yes | yes (one line: `runtimeOnly project(':adapter:inbound:websocket')`) | — | Own `AutoConfiguration.imports` (`WebSocketConfig`), on in a servlet app when present (`WebSocketAutoConfigurationTest`); `ConditionalTransportBuildContractTest` asserts it has no default production edge. |
|
||||
| Web Advanced library (`adapter:inbound:web-advanced`) | — (build-level; three `backend.web.advanced.*.enabled` switches inside) | yes | **no** | — | No composition root depends on it; `app-bootstrap` takes it `testRuntimeOnly` for the ArchUnit import. No real-provider lane: `webAdvancedTest` (the `web-advanced` tag, run by `release.yml` → `web-stable-release-gate`) is unit and context-runner level. The Nginx lane went with the proxy library on 2026-09-25. |
|
||||
|
||||
@@ -71,6 +71,8 @@ web 경로의 `W/`는 `src/adapter/inbound/web/src/main/java/dev/caskeleton/adap
|
||||
|
||||
복구가 필요하면 표의 커밋에서 경로를 꺼낸다(`git show <커밋>:<경로>`).
|
||||
|
||||
리뷰 후속 작업(2026-09-25~28, `docs/superpowers/plans/2026-09-25-review-followup.md`)에서 지운 것은 마지막으로 존재한 커밋이 `6d27356e`인 행으로 표 끝에 이어 붙였다.
|
||||
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
| --- | --- | --- | --- |
|
||||
| 파일 publication R1/R2 어댑터(`FileserverR2Config`, `FileExportConfig`, local-persistent provider 등 31개)와 테스트 | `src/adapter/outbound/fileserver/src/main/java/dev/caskeleton/adapter/outbound/fileserver/*.java`, 같은 위치의 `src/test` 루트 파일 | `208077fd` | 조립 경로 없음(component scan 밖, 호출자 없음) |
|
||||
@@ -254,3 +256,88 @@ web 경로의 `W/`는 `src/adapter/inbound/web/src/main/java/dev/caskeleton/adap
|
||||
| 끄는 장치 테스트: `AdapterActivationEndpointTest`, `AdapterActivationReportShapeTest`, `CapabilityDependencyValidatorTest`, `MasterSwitchRegistryContractTest`, `ShippedRuntimeFacadePresenceTest`, `DisabledAdapterSentinelTest`, `OptionalAdapterBeanGatingTest`, `AutoConfigurationReachabilityParityTest`, `RedisOptionalityContractTest`, persistence-jpa `OutboxMasterSwitchWiringContractTest` | `src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/{activation,contract}/`, `src/app-bootstrap/src/test/java/dev/caskeleton/adapter/outbound/`, `src/adapter/outbound/persistence-jpa/src/test/java/dev/caskeleton/adapter/outbound/persistence/outbox/` | `208077fd` | W4-5: 기본 jar에 실린 capability가 꺼져 있음을 증명하던 테스트. 이제 기본 조립에 없는 것이 꺼진 상태이고, 각 leaf가 "있으면 켜짐 / `enabled=false`면 꺼짐"을 스스로 증명한다 |
|
||||
| systemTest `activation/AdapterActivationInventory`, `DependencyErrorStartupContractTest`, `FiveAdapterOffInventoryTest`, `MasterSwitchEnvironmentPostProcessorTest` | `src/app-bootstrap/src/systemTest/java/dev/caskeleton/bootstrap/activation/` | `208077fd` | W4-5: 다섯 어댑터를 모두 싣고 끈 기동과 의존 오류 메시지를 확인하던 lane. 기본 조립 기동은 systemTest `composition/DefaultCompositionBootTest`(local/dev/prod, capability bean 0개)가, capability별 켜짐/꺼짐은 각 leaf의 activation 테스트가 본다 |
|
||||
| bootstrap `GraphQlDeploymentModeRegistryParityTest` | `src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/activation/GraphQlDeploymentModeRegistryParityTest.java` | `208077fd` | W4-5: 규칙(deployment mode ↔ runtime profile)이 graphql `GraphQlPlatformStartupValidator`로 옮겨 가면서 테스트도 graphql leaf의 같은 이름 테스트로 옮김 |
|
||||
| `OutboxRepository.purgePublishedBefore(Instant)`, `InboxRepository.purgeProcessedBefore(Instant)`와 JDBC 구현 | `src/messaging/messaging-reliability-api/src/main/java/dev/caskeleton/messaging/reliability/{Outbox,Inbox}Repository.java`, `src/messaging/messaging-{outbox,inbox}-jdbc-postgresql/src/main/java/.../Jdbc{Outbox,Inbox}Repository.java` | `6d27356e` | M-6: 개수 제한 없는 단일 DELETE. bounded 버전만 남김 |
|
||||
| JAAS 문자열에 사용자 이름·비밀번호를 넣던 코드(`jaas`, `scramJaas`, `plainJaas`, `escapeJaas`)와 그 테스트 `aSecretWithQuotesIsEscaped`, `aSecretWithAControlCharacterIsRefused` | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaSecurityConfigurer.java`, `.../KafkaSecurityConfigurerTest.java` | `6d27356e` | M-2d/M-2f: 자격 증명이 JAAS에 들어가지 않으므로 escape할 값이 없음. callback handler로 대체 |
|
||||
| `CredentialRuntime` 5-인자 생성자 | `src/messaging/messaging-security/src/main/java/dev/caskeleton/messaging/security/CredentialRuntime.java` | `6d27356e` | username을 받는 생성자로 대체, 호출자는 registry 하나 |
|
||||
| `BrokerCredentialProfile.MutualTls(String)` 1-인자 형태 | `src/messaging/messaging-security/src/main/java/dev/caskeleton/messaging/security/BrokerCredentialProfile.java` | `6d27356e` | key store 없는 MUTUAL_TLS는 동작할 수 없음. `(credentialId, keyStoreLocation, keyStoreType)`으로 대체 |
|
||||
| 테스트 `handlerTimeoutCancelsTheOutstandingHandlerBeforeThePartitionPermitIsReleased` | `src/messaging/messaging-kafka/src/test/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrarTest.java` | `6d27356e` | M-3: CompletableFuture cancel을 단언해 결함을 고정하던 테스트 |
|
||||
| `spring.kafka.bootstrap-servers` 모듈 기본값, compose 계약의 `SPRING_KAFKA_BOOTSTRAP_SERVERS` 3곳, producer의 `Environment` 인자 | `src/adapter/outbound/messaging-kafka/src/main/resources/config/module-defaults/messaging.yml`, `src/config/runtime/compose-profile-contracts.json`, `src/messaging/messaging-spring-boot-starter-kafka/.../KafkaMessagingAutoConfiguration.java` | `6d27356e` | M-2b: broker 주소 출처를 `app.messaging.brokers.<b>` 하나로 |
|
||||
| direct 전송·direct multipart 조정자와 보조 타입 14개(`DirectTransferCoordinator`, `DirectMultipartCoordinator`, `DirectGrantProvider`, `DirectMultipartProvider`, `DirectGrantReplayCache`, `DirectMultipartGrantLedger`, `DirectMultipartCompletionVerifier`, `DirectPartAcknowledgementVerifier`, `DirectPublishedObjectResolver`, `DirectTransferPolicy`, `DirectTransferCorsPolicy`, `DirectTransferSessionRecord`, `DirectGrantGeneration`, `PresignedGrantRedactor`) | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/direct/` | `6d27356e` | main 호출자 0, 조립 경로 없음(소유자 결정 D1·D-7a) |
|
||||
| managed multipart 5개(`ManagedMultipartCoordinator`, `MultipartOperationResolver`, `MultipartPartLedger`, `MultipartUploadPlan`, `MultipartCompletionEvidence`) | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/multipart/` | `6d27356e` | main 호출자 0 |
|
||||
| S3 direct·multipart·presigner·operation resolver 6개(`S3DirectTransferProvider`, `S3DirectMultipartProvider`, `S3ManagedMultipartProvider`, `S3DirectCompletionVerifier`, `S3PresignerFactory`, `S3ObjectOperationResolver`) | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/s3/` | `6d27356e` | 위 조정자만 쓰던 provider. contribution이 만들기만 하고 아무도 꺼내 쓰지 않았다 |
|
||||
| operation 해결·epoch 커널 5개(`ObjectOperationResolutionService`, `ObjectOperationEpochRecord`, `ObjectOperationEpochState`, `DirectGrantSessionState`, `MultipartUploadState`)와 `ObjectOperationStateMachine.advanceDirectGrant/advanceMultipart`, `PendingObjectEffect.Kind`의 DIRECT_*·MULTIPART_* 값, `ObjectRequestFingerprintCodec.OperationKind`의 DIRECT_*·MULTIPART_* 값 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/`, `.../codec/ObjectRequestFingerprintCodec.java` | `6d27356e` | 삭제된 조정자 전용. fingerprint 정규 바이트 형식(`direct-parameter` 줄 포함)은 기존 기록 호환을 위해 유지 |
|
||||
| direct/multipart control record 5종(`ObjectDirectSessionRecord`, `ObjectDirectMultipartSessionRecord`, `ObjectDirectMultipartGrantRecord`, `ObjectMultipartSessionRecord`, `ObjectMultipartPartRecord`)과 codec 분기·`Family` 값, `ObjectControlKeyCodec.{multipart,directSession,multipartPart,directMultipartGrant,operationEpoch}`, `ObjectHandleCodec.{directUpload,multipart,partReceipt}` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/control/`, `.../codec/` | `6d27356e` | 삭제된 조정자만 쓰던 영속 레코드. 이 family를 쓴 조립 경로가 없어 저장된 레코드도 없다 |
|
||||
| capability 값 `DIRECT_UPLOAD`·`DIRECT_MULTIPART` | `ObjectStorageProvider.Capability`, `application-objectstorage/.../model/ObjectCapabilityRequirement.java` | `6d27356e` | 구현이 사라진 뒤에도 설정하면 조용히 무시되는 옵션이 된다(capability 규칙 3) |
|
||||
| `SelectedObjectStorageProviderFactory`의 `managedMultipart/directTransfer/directMultipart` 슬롯·getter·생성자 3개 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/SelectedObjectStorageProviderFactory.java` | `6d27356e` | 테스트만 호출(`S3ProviderCompositionTest`) |
|
||||
| `S3ClientPolicy.{requireSdkCompatibleMpuObjectSize,requirePartCount,requirePartSize}`, `MINIMUM_NON_FINAL_PART_BYTES` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/s3/S3ClientPolicy.java` | `6d27356e` | multipart provider 전용 |
|
||||
| 포트 `DirectObjectUploadPort`·`DirectObjectDownloadGrantPort`·`DirectMultipartUploadPort` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/port/` | `6d27356e` | 구현·소비자 0 |
|
||||
| direct/multipart 요청·응답 타입 15개(`Direct{Upload,Download}Grant`, `DirectUploadCompletion{Request,Receipt}`, `Direct{Upload,Download}GrantRequest`, `Multipart{Start,Complete,Abort}Request`, `MultipartPartAcknowledgement`, `MultipartReceipt`, `MultipartSession`, `PartUploadGrant{,Request}`)과 `ObjectModelSupport.{immutableHeaders,requireExpiry}` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/{model,request}/` | `6d27356e` | 삭제된 포트 전용 |
|
||||
| 식별자 `DirectTransferSessionId`·`MultipartPartNumber`·`PartReceiptToken`, `ObjectIdentitySupport.requirePartReceipt` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/identity/` | `6d27356e` | 삭제된 포트·레코드 전용 |
|
||||
| `RoutingObjectDirectGrantAdapter` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectDirectGrantAdapter.java` | `6d27356e` | private 생성자만 있는 빈 클래스, 참조 0 (D-7b) |
|
||||
| `ObjectStorageMaintenanceCapabilityConfig` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/ObjectStorageMaintenanceCapabilityConfig.java` | `6d27356e` | 빈 `@Configuration` (D-7b) |
|
||||
| `ObjectPurgeMaintenancePort`, `ObjectPurgeRequest` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/{port,request}/` | `6d27356e` | 구현 0 (D-7c) |
|
||||
| 삭제 코드 전용 테스트 17개(`direct/` 6개, `multipart/` 2개, `ObjectOperationEpochTest`, `ObjectMutationResponseLossTest`, `S3{DirectMultipart,DirectTransfer,ManagedMultipart}ProviderTest`, `S3ObjectOperationResolverTest`, `MinioDirectTransfer{Contract,Fault}Test`, `S3SdkApiCharacterizationTest.sdkMultipartIntegerPartCountAndMinimumPartBoundariesFailClosed`) | `src/adapter/outbound/objectstorage/src/test/java/dev/caskeleton/adapter/outbound/objectstorage/` | `6d27356e` | 대상 코드 삭제 |
|
||||
| `AwsS3DirectMutationPreconditionsTest`와 workflow 입력 `run_protected_aws_direct_mutation`·env `OBJECT_STORAGE_AWS_DIRECT_MUTATION_ENABLED` | `src/adapter/outbound/objectstorage/src/objectStorageAwsQualificationTest/.../AwsS3DirectMutationPreconditionsTest.java`, `.github/workflows/object-storage-qualification.yml` | `6d27356e` | direct 전송 lane의 별도 권한 검사. direct 코드가 없으니 검사할 대상이 없다 |
|
||||
| APNs provider adapter(4 클래스)와 테스트 | `src/adapter/outbound/notification/src/{main,test}/java/dev/caskeleton/adapter/outbound/notification/platform/provider/apns/` | `6d27356e` | assembler 없음 — 켜면 기동 실패. S4-#3a |
|
||||
| FCM provider adapter(10 클래스)와 테스트 | `…/platform/provider/fcm/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| Twilio provider adapter(9 클래스)와 테스트 | `…/platform/provider/twilio/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| Web Push provider adapter(10 클래스)와 테스트 | `…/platform/provider/webpush/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| Webhook provider adapter(3 클래스)와 테스트 | `…/platform/provider/webhook/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| `SesSuppressionUpdater` | `…/platform/provider/ses/SesSuppressionUpdater.java` | `6d27356e` | main 참조 0. suppression은 projection side-effect 경로가 담당. S4-#3a |
|
||||
| `ProviderType.APNS/FCM/TWILIO/WEB_PUSH/WEBHOOK` | `…/platform/autoconfigure/ProviderType.java` | `6d27356e` | 조립할 수 없는 종류. 이제 binding에서 unknown type으로 실패 |
|
||||
| provider 설정 필드 `topic`, `vapid-public-key`, `callback-signing-secret-ref` | `…/platform/autoconfigure/NotificationPlatformSettings.java` (Provider) | `6d27356e` | 삭제된 5종만 읽던 키. capability 규칙 3(동작 안 하는 옵션은 키를 두지 않음) |
|
||||
| `SecretPurpose.VAPID_SIGNING`, 설정 `secrets.vapid-signing-key`·`active-key-ids.VAPID_SIGNING`, env `APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY`·`APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY_ID` | `src/application-notification/…/platform/security/SecretPurpose.java`, `src/composition/notification-platform/src/main/resources/config/module-defaults/notification.yml`, `src/.env.example`, `docs/registries/env-keys.yaml`, `docs/registries/secrets-classification.yaml`, `scripts/run-compose-runtime-smoke.sh` | `6d27356e` | Web Push 삭제로 소비자 0 |
|
||||
| Twilio·FCM·APNs·Web Push runbook 절, support-matrix·module-mapping 행 | `docs/notification/provider-runbooks.md`, `docs/notification/support-matrix.md`, `docs/notification/module-mapping.md`, `docs/notification/configuration-reference.md` | `6d27356e` | 설명 대상 코드 삭제 |
|
||||
| tus `Upload-Defer-Length: 1` 수락 분기 | `src/adapter/inbound/web-fileserver/src/main/java/dev/caskeleton/adapter/inbound/web/fileserver/tus/TusRequestParser.java` `declaredLength` | `6d27356e` | C-5c. 길이를 나중에 확정할 PATCH가 없어 끝나지 않는 upload만 만들었다. 이제 400 |
|
||||
| 테스트 `aDeferredLengthUploadIsNeverAutoFinalized` | `src/adapter/inbound/web-fileserver/src/test/java/dev/caskeleton/adapter/inbound/web/fileserver/tus/TusProtocolContractTest.java` | `6d27356e` | 위 분기를 전제로 한 테스트. `aCreateThatDefersItsLengthIsRefusedBecauseTheExtensionIsNotOffered`로 대체 |
|
||||
| 테스트 `scopeSemaphoreRegistryIsBoundedAndOverflowScopesShareConservativeCapacity` | `src/application-fileserver/src/test/java/dev/caskeleton/application/fileserver/quota/TransferAdmissionControllerTest.java` | `6d27356e` | C-9b. 유휴 scope가 overflow로 몰린다는 옛 동작을 단언. `theScopeRegistryStaysBoundedAsCallersComeAndGo`로 대체 |
|
||||
| lifecycle delete·admin forceDelete·cancel의 retire 복사본 | `DefaultFileLifecycleService.delete`, `DefaultFileserverAdminService.forceDelete`, `DefaultUploadApplicationService.cancel` 본문 | `6d27356e` | S1-#5. `cleanup/FileRetirement` 하나로 합침 |
|
||||
| `GrpcStableModuleCatalog`(+`GrpcStableModuleCatalogTest`) | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcStableModuleCatalog.java` | `6d27356e` | leaf 목록을 core-api에 재기술(registry SSOT 중복), main 호출자 0 (S7-#4) |
|
||||
| `GrpcStableBuildInvariant` | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcStableBuildInvariant.java` | `6d27356e` | 상수 반환·항상 빈 set으로만 불림. 격리는 `verifyCleanArchitectureDependencies`가 강제 (S7-#4, N-9b/c) |
|
||||
| `GrpcPlatformStartupValidator.validateAdvancedIsolation` + `stableModuleDependencies` 파라미터 | `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java` | `6d27356e` | 항상 `Set.of()`로 호출돼 항상 통과 (N-9b) |
|
||||
| `GrpcAdvancedModuleGuard.requireStableStarterIsClean`, `advancedModules` | `src/grpc-advanced/grpc-advanced-bootstrap/src/main/java/dev/caskeleton/grpc/advanced/bootstrap/GrpcAdvancedModuleGuard.java` | `6d27356e` | 삭제된 catalog/invariant 위임, main 호출자 0 |
|
||||
| `GrpcApplicationBoundaryRules`, `GrpcRawApiImportRule`, `GrpcServiceAdapterMarker`(+`GrpcApplicationBoundaryRulesTest`) | `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/architecture/` | `6d27356e` | 문자열로 ArchUnit 흉내, 자기 테스트의 합성 입력만 검사. 경계 규칙은 app-bootstrap ArchUnit이 검사 |
|
||||
| `GrpcKotlinCompatibilityGate`, `GrpcKotlinProfile` | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/kotlin/` | `6d27356e` | `supportableHere()` 상수 false, main 호출자 0 |
|
||||
| `GrpcWebCompatibilityGate` | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/web/GrpcWebCompatibilityGate.java` | `6d27356e` | 상수 메서드 + main 호출자 0(`GrpcWebRpcSupport.require`가 같은 규칙) |
|
||||
| `GrpcServletStartupValidator`, `GrpcServletCapabilityMatrix`, `GrpcServletCompatibilityProfile`(+`GrpcServletStartupValidatorTest`) | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/servlet/` | `6d27356e` | Servlet 전송 코드 없이 상수 matrix·gate만 있던 패키지, main 호출자 0 |
|
||||
| `GrpcEdition2024Gate`, `GrpcEdition2026Guard` | `src/grpc-advanced/grpc-advanced-edition/src/main/java/dev/caskeleton/grpc/advanced/edition/` | `6d27356e` | 상수 반환 gate·무조건 throw guard, main 호출자 0 |
|
||||
| `GrpcResolverSafetyPolicy.acceptAfterClose`, `mayCarryBusinessMetadata`; `CREDENTIAL_SHAPED` 정규식 | `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/discovery/GrpcResolverSafetyPolicy.java` | `6d27356e` | 상수 메서드(S7-#4) / 부분일치 정규식이 정상 키를 거부(N-4, W1 커밋) |
|
||||
| `GrpcXdsStartupGuard` + 테스트 리소스 `xds/bootstrap.json` | `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/xds/GrpcXdsStartupGuard.java` | `6d27356e` | 상수 메서드 포함 guard, main 호출자 0 |
|
||||
| `GrpcAdvancedInfrastructureTestkit` | `src/grpc-advanced/grpc-advanced-diagnostics/src/main/java/dev/caskeleton/grpc/advanced/diagnostics/GrpcAdvancedInfrastructureTestkit.java` | `6d27356e` | capability별 인프라 목록 상수, main 호출자 0 (문서 표로 대체) |
|
||||
| 설정 키 `ca-skeleton.capabilities.rate-limit.default-policy-id` (+ `RedisCapabilitySettings.RateLimit.defaultPolicyId` getter/setter) | `src/adapter/outbound/cache-redis/src/main/resources/config/module-defaults/cache-redis.yml`, `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/capability/RedisCapabilitySettings.java` | `6d27356e` | S6-#6b: 같은 env 키에 두 설정 키가 묶여 있었다. `app.rate-limit.default-policy-id` 하나로 통일 |
|
||||
| `SmtpProviderRuntimeAssembler.capabilities()` (SMTP capability 사본) | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/autoconfigure/SmtpProviderRuntimeAssembler.java` | `6d27356e` | 어댑터 `capabilities()`와 값이 달랐다(S4-#4a). 이제 snapshot이 어댑터 값을 쓴다 |
|
||||
| actuator `loggers` 노출과 `POST`/`DELETE /actuator/loggers/**` `denyAll` 규칙 | `src/app-bootstrap/src/main/resources/config/observability.yml`, `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/management/security/ManagementSecurityConfig.java` | `6d27356e` | actuator 체인에 인증 수단이 없어 어떤 자격증명으로도 도달할 수 없었다(L-7a) |
|
||||
| `IdempotencyExecutor.preserveUnknown` | `src/application-core/src/main/java/dev/caskeleton/application/idempotency/IdempotencyExecutor.java` | `6d27356e` | `recordFailure`로 대체했다(A-8b) |
|
||||
| `GraphQlExecutionProfile`(BLOCKING_MVC·REACTIVE_WEBFLUX·MIXED_CONTROLLED), `GraphQlExecutionProfileException` | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/execution/` | `6d27356e` | D4: servlet 단일 스택이라 고를 프로파일이 없음 |
|
||||
| `GraphQlRuntimeTransport`와 `GraphQlPlatformAutoConfiguration`의 `ServletRuntimeDetection`·`ReactiveRuntimeDetection`, `GraphQlPlatformRuntime.transport` | `.../graphql/autoconfigure/` | `6d27356e` | D4: 프로파일과 실행 서버 대조가 필요 없어짐 |
|
||||
| `GraphQlBlockingBridge`, `GraphQlBlockingBridgeFullException`, `GraphQlBatchLoaderRegistrar`의 bridge·profile 인자, `GraphQlBlockingBridgeTest` | `.../graphql/runtime/`, `src/adapter/inbound/graphql/src/test/java/dev/caskeleton/adapter/inbound/graphql/runtime/` | `6d27356e` | D4: event loop 에서 blocking 작업을 빼내는 bridge. servlet 에서는 호출 스레드 inline 실행(J-4b 결함 경로) |
|
||||
| 설정 `backend.graphql.execution-profile`(`APP_GRAPHQL_EXECUTION_PROFILE`), `backend.graphql.unbridged-blocking-resolvers`와 validator의 reactive 검사 | `GraphQlPlatformSettings.java`, `GraphQlPlatformStartupValidator.java`, `src/main/resources/config/graphql.yml`, `docs/registries/env-keys.yaml`, `src/.env.example` | `6d27356e` | D4: 동작할 수 없는 옵션은 키를 두지 않는다 |
|
||||
| 테스트: `GraphQlTransportNeutralityTest`의 context 기반 프로파일 케이스 7개, `GraphQlBatchLoaderRegistrationTest` reactive·bridge 2건, `GraphQlPlatformStartupValidatorTest.aBlockingResolverWithoutABridgeCannotRunOnTheReactiveProfile` | `src/adapter/inbound/graphql/src/test/java/dev/caskeleton/adapter/inbound/graphql/` | `6d27356e` | 대상 코드 삭제 |
|
||||
| `GraphQlPlatformRejectionMapper.map`(unknown → INTERNAL_ERROR 정적 메서드) | `.../graphql/runtime/GraphQlPlatformRejectionMapper.java` | `6d27356e` | 모든 경로가 `GraphQlWireErrorMapper.map`을 쓰게 되어 호출자 없음 (`mapFieldFailure`는 `map`으로 이름 변경) |
|
||||
| `JpaDangerousConfigurationGuard`의 OSIV 검사 분기와 `OPEN_IN_VIEW_KEY` 상수 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/startup/JpaDangerousConfigurationGuard.java` | `6d27356e` | S6-#3b. `OpenInViewSafetyValidator`가 모든 profile에서 먼저 거부하므로 local 예외가 도달 불가능한 죽은 코드 |
|
||||
| `OutboxEventJpaRepository.deletePublishedBefore`(무제한 단일 DELETE) | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxEventJpaRepository.java` | `6d27356e` | E-8b. 배치 삭제 `deletePublishedBatch`로 교체 |
|
||||
| rate-limit client IP 모드 (`RateLimitClientIpMode`, `ClientIpResolver`, `ClientIpResolverFactory`, `ForwardedHeaderClientIpResolver`, `RemoteAddrClientIpResolver`)와 설정 `app.rate-limit.client-ip-mode` / env `APP_RATE_LIMIT_CLIENT_IP_MODE` | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/` | `6d27356e` | I-5a·NEW-10c: `FORWARDED_HEADERS_TRUSTED`가 호출자가 쓰는 XFF 맨 왼쪽 값을 키로 씀. 운영 정본은 `server.forward-headers-strategy=native` + `server.tomcat.remoteip.internal-proxies`의 `getRemoteAddr()` 하나 |
|
||||
| `RequestLoggingFilter`의 request/correlation/trace id 발급·MDC 기록·응답 헤더 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/filter/RequestLoggingFilter.java` | `6d27356e` | I-4a·I-4b: `WebMvcRequestIdFilter`로 이동(두 필터가 trace를 따로 만들던 것 제거) |
|
||||
| 알림 제출 category 기본값 `"transactional"` | `src/adapter/inbound/web-notification/.../submission/NotificationSubmissionController.java` | `6d27356e` | I-6a 결정 13 |
|
||||
| `WorkLogController.requireIfMatch`(트랜잭션 밖 get 후 비교) | `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/adapter/inbound/web/controller/WorkLogController.java` | `6d27356e` | S6-#11b: 비교를 update 유스케이스 트랜잭션 안으로 |
|
||||
| reactive gateway·SSE·streaming·runtime 패키지 (`DefaultReactiveHttpGateway`, `ReactiveHttpGateway`, `DefaultReactiveSseGateway`, `ReactiveSseGateway`, `ReactiveStreamingGateway`, `ReactiveAttemptExecutor`, `ReactiveClientRuntime`, `WebClientRuntimeFactory`, `WebClientBodyWriter`, `WebClientResponseMapper`, `BoundedDataBufferFlux`, `FirstByteDeliveryGuard`, `MultipartReplayability`, `ReactiveBodySource`, `SseIdleTimeoutException`, `SseOperation`, `SseReconnectPolicy`) | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/webclient/` | `6d27356e` | 결정 9: httpclient reactive 스택 삭제, blocking 경로 하나만 유지 |
|
||||
| Reactor Netty transport (`ReactorNettyTransportProvider`, `ReactorHttpClientFactory`, `ReactorConnectionProviderFactory`, `ReactorFailureClassifier`, `ReactorPoolMetricsBinder`) | `.../httpclient/reactor/` | `6d27356e` | 결정 9 |
|
||||
| reactive 자격증명 (`ReactiveCredentialProviderRegistry`, `ReactiveRequestCredentialProvider`) | `.../httpclient/auth/` | `6d27356e` | 결정 9 |
|
||||
| reactive 재시도·resilience (`ReactiveAttemptResiliencePipeline`, `ReactiveLogicalCall`, `ReactiveRetryCoordinator`) | `.../httpclient/resilience/` | `6d27356e` | 결정 9 |
|
||||
| reactive typed client (`DefaultReactiveHttpServiceRegistry`, `ReactiveHttpServiceRegistry`, `ReactiveKernelHttpExchangeAdapter`, `ReactiveOperationContext`, `ReactiveServiceInvocationHandler`), `ServiceOperationDescriptor.reactive` 플래그와 blocking/reactive 혼합 검사 | `.../httpclient/service/` | `6d27356e` | 결정 9 |
|
||||
| reactive transport SPI (`ReactiveTransportProvider`, `ReactiveTransportCapabilities`), `TransportCapabilityValidator`의 reactive overload | `.../httpclient/transport/` | `6d27356e` | 결정 9 |
|
||||
| 설정 키 `app.httpclient.clients[N].api`(`APP_HTTPCLIENT_CLIENTS_N_API`)와 `ClientApiType`, `TransportType.REACTOR_NETTY`, actuator `api` 항목 | `.../httpclient/profile/ClientApiType.java`, `docs/httpclient/env-fields.yaml` | `6d27356e` | 남은 값이 하나뿐인 키(동작하지 않는 옵션은 키를 두지 않음). H2 전용 프로필은 이제 모든 transport에서 `HTTP2_REQUIRED_TRANSPORT_UNSUPPORTED` |
|
||||
| 기동 위반 코드 `REACTIVE_REDIRECT_UNSUPPORTED`, `REACTIVE_AUTHENTICATION_UNSUPPORTED`, `DYNAMIC_TARGET_PROFILE_API_UNSUPPORTED` | `.../profile/ClientProfileValidator.java`, `.../autoconfigure/HttpClientStartupValidator.java` | `6d27356e` | reactive 프로필이 없어 판정 대상 없음 |
|
||||
| reactive bean (`httpClientReactiveTransportProviders`, `httpClientReactiveCredentialProvider`, `ReactiveAttemptExecutor`, `reactiveHttpGateway`, `ReactiveHttpServiceRegistry`, `ReactiveStreamingGateway`, `ReactiveSseGateway`) | `.../httpclient/autoconfigure/` | `6d27356e` | 결정 9 |
|
||||
| reactive 테스트 (`BlockHoundEventLoopTest`, `DefaultReactiveHttpGatewayTest`, `FirstByteRetryBoundaryTest`, `ReactiveSseGatewayTest`, `ReactiveStreamingLifecycleTest`, `ReactiveRetryCoordinatorTest`, `ReactiveHttpServiceRegistryTest`, `ReactiveAuthenticationContractTest`, `BlockingReactiveSignatureSeparationTest`), 계약·protocol 테스트의 reactor case | `src/adapter/outbound/httpclient/src/test/java/...` | `6d27356e` | 대상 코드 삭제. forward proxy 경로 테스트는 blocking(Apache)으로 옮김(`ForwardProxyContractTest.gatewayRoutesTheCallThroughTheConfiguredForwardProxy`) |
|
||||
| reactive testkit (`ReactiveTestGateways`, `ReactiveTransportContract`, `ReactiveEventsClient`, `MixedSignatureClient`, `NettyLeakDetectionExtension`, `EventPayload`, `MockHttpServer.enqueueSse`, `ClientProfiles.reactor`, `HttpClientContract.blockHoundSelected`) | `src/adapter/outbound/httpclient/src/testFixtures/java/...` | `6d27356e` | 대상 코드 삭제 |
|
||||
| `Http2StreamSaturationTest`(Reactor Netty 전용), `ReactiveClientBenchmark` | `.../src/httpClientPerformanceTest/...`, `.../src/jmh/...` | `6d27356e` | 대상 transport 삭제 |
|
||||
| `httpClientBlockHoundTest` lane, `check` 의존, 계약 lane 기본 transport의 `reactor`, `io.netty.leakDetection.level` 시스템 속성 | `src/adapter/outbound/httpclient/build.gradle` | `6d27356e` | reactor event loop이 없어 검증 대상 없음 |
|
||||
| 의존 `spring-webflux`, `reactor-core`, `reactor-netty-http`, `reactor-test`, `blockhound`, testFixtures `netty-common`·`logback-classic`·`reactor-core`, 카탈로그 `blockhound` | `src/adapter/outbound/httpclient/build.gradle`, `src/gradle/libs.versions.toml` | `6d27356e` | 결정 9 |
|
||||
| CI matrix `transport: reactor`, release의 `httpClientBlockHoundTest` | `.github/workflows/pr-adapters.yml`, `.github/workflows/release.yml` | `6d27356e` | 없는 lane·transport 호출 제거 |
|
||||
| `MongoBulkWritePlan.estimatedEncodedBytes` (plan 생성 시 `toJson()` 크기 추정) | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/bulk/MongoBulkWritePlan.java` | `6d27356e` | 매핑 전 값에 codec이 없어 실패(F-4b). 매핑된 문서의 실제 BSON 크기 검사(`MongoBulkExecutor.mappedWrites`)로 대체 |
|
||||
| `MongoCsfleClientFactory.settingsFor`의 `encryptedFieldsMapJson` 인자 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleClientFactory.java` | `6d27356e` | 호출자 JSON을 schema로 쓰던 경로(F-5b). `profile.fields()`에서 생성 |
|
||||
| 설정 키 `ca-skeleton.persistence-mongo.active-profile` | `src/adapter/outbound/persistence-mongo/src/main/resources/config/mongo.yml` | `6d27356e` | `ca-skeleton.persistence-mongo.platform.active-profile`로 이동(F-2a, `MongoPlatformSettings`에 한 번 바인딩). env 키는 그대로 |
|
||||
| `GitCommandResult` record | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/GitCommandResult.java` | `6d27356e` | O-3b에서 git 호출이 exit code를 직접 판정하는 `checkIgnore` 하나로 줄어 쓰는 곳이 없음 |
|
||||
| `git rev-parse --show-toplevel` 호출(checkout 판정) | `VerifyNoIgnoredSourcePackagesTask.java` | `6d27356e` | 실패하면 "checkout 아님"으로 읽혀 게이트가 통과하던 원인. `.git` 존재 판정으로 대체 |
|
||||
| compose 계약 필드 `expectedSwitchesOn` | `src/config/runtime/compose-profile-contracts.json` | `6d27356e` | 읽는 코드가 없던 필드. `expectedCapabilitiesOn`(info 이름)으로 재정의 |
|
||||
|
||||
@@ -117,7 +117,7 @@ Set `inline-safe-profile: true` only when downloads are never served inline from
|
||||
| Key | Default | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `instance-upload-permits` | `16` | concurrent uploads this node admits |
|
||||
| `scope-upload-permits` | `4` | concurrent uploads one namespace admits |
|
||||
| `scope-upload-permits` | `4` | concurrent uploads one caller (principal) admits; over it is a retryable `429` |
|
||||
| `direct-download-permits` | `64` | concurrent non-delegated downloads |
|
||||
| `soft-high-water` | `0.70` | storage fraction at which pressure is reported |
|
||||
| `hard-high-water` | `0.85` | storage fraction at which uploads are refused |
|
||||
@@ -141,6 +141,11 @@ without it still queues cleanup items; another node or an operator reclaims them
|
||||
eight times is abandoned rather than retried forever — it stays visible to an operator, parked
|
||||
rather than discarded.
|
||||
|
||||
Each pass also expires uploads whose `expiresAt` has passed (the record becomes `EXPIRED` and its
|
||||
staged bytes are queued), purges orphans the admin plane retired to quarantine, and runs
|
||||
reconciliation over stale `UPLOADED`/`VERIFYING`/`FAILED` records, so an ambiguous publish settles
|
||||
without an operator.
|
||||
|
||||
## Management plane — `admin`
|
||||
|
||||
| Key | Default | Meaning |
|
||||
|
||||
@@ -56,7 +56,7 @@ port rather than the public one.
|
||||
| `401` | unauthenticated |
|
||||
| `403` / `404` | denied, or hidden under the existence-hiding profile |
|
||||
| `409` | state, offset, or lease conflict |
|
||||
| `410` | expired upload resource |
|
||||
| `410` | expired or ended (cancelled, rejected, quarantined) upload resource |
|
||||
| `411` | `require-content-length` profile with no length |
|
||||
| `412` | precondition failed |
|
||||
| `413` | size or quota policy violation |
|
||||
|
||||
@@ -105,7 +105,10 @@ evidence, replayability, stage, retryability, attempt, elapsed, remaining deadli
|
||||
| `HttpDeadlineExceededException` | the effective deadline was reached | never |
|
||||
| `HttpCircuitOpenException` | the upstream circuit is open | never |
|
||||
| `HttpBulkheadRejectedException` | no attempt or logical admission permit was available | never |
|
||||
| `HttpRateLimitRejectedException` | the local attempt rate limit or retry budget rejected the attempt | never |
|
||||
| `HttpRateLimitRejectedException` | the local attempt rate limiter rejected the attempt | never |
|
||||
| `HttpRetryBudgetExhaustedException` | the per-upstream retry budget refused a further attempt | never |
|
||||
| `HttpRuntimeDrainingException` | the profile's runtime was retired (certificate rotation) before a granted retry started | never — a new call runs on the replacement |
|
||||
| `HttpUnknownTransportException` | the engine failed in a way no category above describes; the metadata evidence, not the type, says whether it was sent | never |
|
||||
| `HttpAmbiguousExecutionException` | a non-idempotent request was sent and the outcome is unknown | never — reconcile instead |
|
||||
|
||||
## Traces
|
||||
|
||||
@@ -166,6 +166,12 @@ app:
|
||||
`kafka`뿐이다. 위 예시가
|
||||
`production: false`인 것은 이 페이지가 그대로 실행되는 fixture이기 때문이며, 실 배포는 셋 다 참이다.
|
||||
|
||||
Kafka producer는 이 항목 하나로 만든다. `bootstrap-servers`, `acks`, `enable-idempotence`,
|
||||
`max-in-flight-requests-per-connection`, `delivery-timeout`이 그대로 client 설정이 된다.
|
||||
`spring.kafka.bootstrap-servers`는 읽지 않는다. type이 `kafka`인 항목이 정확히 하나가 아니면 기동에
|
||||
실패한다. `send()`가 metadata를 기다리며 호출 스레드를 막는 시간(`max.block.ms`)은 기본 publish
|
||||
timeout(5s)이다.
|
||||
|
||||
## 보안
|
||||
|
||||
```yaml
|
||||
|
||||
@@ -21,7 +21,7 @@ Flyway version `1000..1999`를 예약해서 애플리케이션의 일반적인
|
||||
classpath:db/migration/messaging
|
||||
```
|
||||
|
||||
현재 순서는 `V1001..V1004`(outbox/admin)와 `V1101`(inbox)이다. starter 테스트가 두 JDBC
|
||||
현재 순서는 `V1001..V1005`(outbox/admin)와 `V1101`(inbox)이다. starter 테스트가 두 JDBC
|
||||
모듈을 실제 combined classpath로 올려 version 중복과 예약 대역 이탈을 검사한다. 개별 DDL의
|
||||
의미와 전환 순서는 [migration-guide.md](migration-guide.md)를 따른다.
|
||||
|
||||
@@ -46,6 +46,11 @@ leaseBatch(100, 30s) -- lease로 다중 relay 인스턴스 안전
|
||||
→ REJECTED → markFailed
|
||||
```
|
||||
|
||||
row 하나의 실패는 그 row에서 끝난다. envelope로 만들 수 없는 row(예약 header `msg.*`를 담은 row
|
||||
등)는 `FAILED`가 되고, publisher가 예외를 던지면 결과를 모르므로 `AMBIGUOUS`가 된다. 같은 batch의
|
||||
나머지 row는 그대로 publish된다. pass 전체가 실패하면(DB 연결 등) WARN 로그를 남기고
|
||||
`messaging.outbox.relay.failed.passes` 카운터를 올린다.
|
||||
|
||||
### 핵심 규칙: ambiguous는 같은 messageId로 재시도
|
||||
|
||||
새 id를 발급하면 "전달됐을 수도 있는 메시지"가 "확실히 두 번째인 메시지"가 되어
|
||||
@@ -61,8 +66,16 @@ status IN ('PENDING','AMBIGUOUS','IN_FLIGHT')
|
||||
AND (lease_expires_at IS NULL OR lease_expires_at <= now)
|
||||
AND next_attempt_at <= now
|
||||
AND attempts < maxAttempts
|
||||
AND (ordering_key IS NULL
|
||||
OR 같은 destination·ordering_key의 더 오래된 미완료 row가 없음)
|
||||
```
|
||||
|
||||
`ordering_key`가 있는 row는 같은 key의 더 오래된 row가 `PENDING`·`AMBIGUOUS`·`IN_FLIGHT`인 동안
|
||||
claim되지 않는다. 이 조건이 없으면 두 relay가 같은 key의 두 row를 나눠 가져가거나, AMBIGUOUS로
|
||||
재시도되는 row보다 뒤의 row가 먼저 나간다(`OutboxPostgresIT#aNewerRowWaitsWhileAnOlderRowWithTheSameOrderingKeyIsUnfinished`).
|
||||
`V1005`의 partial index가 이 확인을 받친다. 더 오래된 row가 `FAILED`·`EXHAUSTED`가 되면 뒤의 row는
|
||||
진행한다.
|
||||
|
||||
`IN_FLIGHT`가 목록에 있는 것이 핵심이다. relay가 publish 도중 죽으면 row는 `IN_FLIGHT`로 남는데,
|
||||
이를 제외하면 그 메시지는 **영원히** 발행되지 않는다 — outbox가 막으려던 바로 그 실패다. 대신
|
||||
lease가 만료됐을 때만 회수하므로, 살아 있는 relay가 들고 있는 row는 회수되지 않는다.
|
||||
@@ -107,6 +120,9 @@ message_id만으로 중복 제거하면 같은 event를 소비하는 두 번째
|
||||
broker의 최대 redelivery window보다 **길어야** 한다.
|
||||
row를 먼저 지우면 늦게 도착한 redelivery가 두 번 처리된다.
|
||||
|
||||
outbox·inbox cleanup job은 한 번에 최대 1,000행씩 지우고, 지운 수가 1,000보다 적으면 멈춘다.
|
||||
repository port에는 개수 제한 없는 삭제 메서드가 없다.
|
||||
|
||||
## CDC 대안
|
||||
|
||||
relay는 polling 하나뿐이다. Debezium Event Router 매핑(`DebeziumOutboxEventRouter` 등)은 조립하는
|
||||
|
||||
@@ -49,6 +49,15 @@ full jitter는 `[0, delay]` 균등 분포다. jitter가 없으면 같은 초에
|
||||
pause-and-seek는 메시지가 로그의 자기 자리를 떠나지 않는다. partition을 멈추고, 기다리고,
|
||||
같은 offset으로 seek해 재전달한다. 뒤의 메시지도 함께 기다리며 이것이 의도된 동작이다.
|
||||
|
||||
`KafkaConsumerRegistrar`가 handler 실패(예외, settle 없이 끝남, timeout)를 다루는 방식:
|
||||
|
||||
- 재전달은 destination `retry`의 backoff 뒤에 한다. 최소 1초. 0초 재시도는 없다.
|
||||
- 같은 offset의 실패 횟수가 `retry.maxAttempts`에 닿으면 `KafkaQuarantinePublisher`에 쓰고,
|
||||
쓰기가 확인되면 offset을 넘긴다. quarantine이 없으면 backoff로 계속 재시도한다(메시지를 버리지
|
||||
않는다). 그래서 `production` destination은 quarantine 없이 만들 수 없다(`KAFKA_QUARANTINE_REQUIRED`).
|
||||
- handler timeout이 지나도 handler가 끝날 때까지 partition slot을 잡고 있는다. `CompletableFuture`를
|
||||
cancel해도 handler는 멈추지 않으므로, slot을 먼저 풀면 같은 offset이 두 번 동시에 돈다.
|
||||
|
||||
## RabbitMQ: delayed retry queue
|
||||
|
||||
core broker에 per-message delay가 없으므로 **TTL + DLX**로 구현한다.
|
||||
|
||||
@@ -120,3 +120,8 @@ driver type.
|
||||
unordered bulk write that partially fails is `PARTIAL_BULK_WRITE`, not a failure: some documents were
|
||||
written. The result's per-item outcomes say which indexes succeeded and which failed, so a caller can
|
||||
resume rather than replay.
|
||||
|
||||
`execute(context, documentType, plan)` maps every filter and update through the document type, as
|
||||
the single-document path does, so `@Field` names and registered converters (`DomainDocumentId`,
|
||||
`BigInteger`) mean the same thing in a batch. The command's byte ceiling is measured on those mapped
|
||||
documents before anything is sent.
|
||||
|
||||
@@ -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: 379
|
||||
# types: 380
|
||||
dev.caskeleton.adapter.outbound.notification.NotificationConfig
|
||||
dev.caskeleton.adapter.outbound.notification.NotificationRoutesSettings
|
||||
dev.caskeleton.adapter.outbound.notification.core.FailOpenNotificationProvider
|
||||
@@ -59,6 +59,7 @@ dev.caskeleton.adapter.outbound.notification.platform.observation.NotificationHe
|
||||
dev.caskeleton.adapter.outbound.notification.platform.observation.NotificationHealthSnapshot
|
||||
dev.caskeleton.adapter.outbound.notification.platform.observation.NotificationServingThresholds
|
||||
dev.caskeleton.adapter.outbound.notification.platform.provider.EmailAttachments
|
||||
dev.caskeleton.adapter.outbound.notification.platform.provider.EmailRecipients
|
||||
dev.caskeleton.adapter.outbound.notification.platform.provider.ProviderResults
|
||||
dev.caskeleton.adapter.outbound.notification.platform.provider.UnconfiguredAttachmentResolver
|
||||
dev.caskeleton.adapter.outbound.notification.platform.provider.http.JdkNotificationHttpGateway
|
||||
|
||||
@@ -2945,8 +2945,9 @@ env_keys:
|
||||
- name: APP_MESSAGING_KAFKA_BROKERS
|
||||
# source: feature-domain-event-outbox-contract — "Kafka는 optional integration adapter"
|
||||
# (broker 활성화 시 endpoint 필요)
|
||||
# Also feeds spring.kafka.bootstrap-servers (the messaging platform's Kafka transport) through
|
||||
# the Kafka module's config/module-defaults/messaging.yml, so one key addresses both paths.
|
||||
# Also feeds app.messaging.brokers.kafka.bootstrap-servers (the messaging platform's Kafka
|
||||
# transport) through the Kafka module's config/module-defaults/messaging.yml, so one key
|
||||
# addresses both paths. spring.kafka.bootstrap-servers is not read.
|
||||
type: csv_list
|
||||
default: null
|
||||
allowed_values: null
|
||||
@@ -3472,7 +3473,7 @@ env_keys:
|
||||
required_test: fileserver-platform:off-state-zero-side-effects-and-env-round-trip
|
||||
|
||||
- name: APP_FILESERVER_PLATFORM_QUOTA_SCOPE_UPLOAD_PERMITS
|
||||
# Concurrent uploads admitted per namespace.
|
||||
# Concurrent uploads admitted per caller (principal).
|
||||
type: integer
|
||||
default: 4
|
||||
allowed_values: null
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| M-2c | 완료 | `BrokerAccessListTest.aDeclaredDestinationTheSecurityEntryDoesNotListIsRejectedAsForbidden` FAIL("Expecting Optional[PUBLISH_PREPARATION_FAILED] to contain PUBLISH_FORBIDDEN" — 목록 밖 destination이 접근 검사를 통과) → PASS. `messagingDestinationAccess`가 선언 destination 중 해당 broker security 항목의 `access.publishable`에 있는 것만 허용: `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingCoreAutoConfiguration.java:422`. security 항목이 없는 broker는 기존대로 선언 destination 전부. 빈 목록이면 publish 불가(문서화: `docs/messaging/configuration-reference.md` 보안 절, `docs/messaging/security.md` ACL 절) |
|
||||
| M-2d | 완료 | `KafkaProducerSecurityTest.theProducerAuthenticatesAsTheUsernameTheProviderReturnsNotAsTheCredentialId` FAIL(JAAS가 `username="kafka-producer"`=credential id, `password=` 고정, callback handler 없음) → PASS. `CredentialProvider.username(credentialId)` 추가(`src/messaging/messaging-security/src/main/java/dev/caskeleton/messaging/security/CredentialProvider.java:43`), `CredentialRuntime.username()`, SASL 사용자 이름이 없으면 기동 실패 `SASL_USERNAME_MISSING`(`KafkaSecurityConfigurerTest.aSaslCredentialWhoseProviderNamesNoUserIsRefused`). 실제 lane: `MessagingSecuredBrokerQualificationTest.aPublishIsConfirmedByAPrivateCaBrokerThatRequiresSaslAsTheProviderUser` PASS, 확인용으로 provider 사용자 이름을 틀리게 바꾸면 REJECTED(broker가 SASL을 실제로 검사함) |
|
||||
| M-2e | 완료 | NEW-4b와 같은 결함, 한 번 수정. `KafkaProducerSecurityTest.aPrivateCaTrustStoreReachesTheProducer`·`mutualTlsPresentsTheProducerKeyStoreUnlockedByItsCredential`·`mutualTlsOnABrokerWithoutTlsFailsStartup` FAIL("trust-store.location binds nothing") → PASS, `mutualTlsWithoutAKeyStoreFailsStartupNamingTheKey` PASS, `KafkaSecurityConfigurerTest.aTrustStoreOnABrokerWithoutTlsIsRefused` PASS. 설정: `app.messaging.security.<b>.trust-store.{location,type,password-credential-id}`, `<role>.key-store.{location,type}`(`BrokerSecuritySettings.java`), 모델 `BrokerTrustStore`(신규), `BrokerCredentialProfile.MutualTls(credentialId, keyStoreLocation, keyStoreType)`(`BrokerCredentialProfile.java:58`), Kafka 설정 `ssl.truststore.*`/`ssl.keystore.*`(`KafkaSecurityConfigurer.java:102,129`). key-store 없는 MUTUAL_TLS·TLS 꺼진 MUTUAL_TLS·TLS 꺼진 trust-store는 기동 실패(평문 fallback 없음, `MessagingConfigurationCompiler.java:276`, `KafkaSecurityConfigurer.java:190`). 실제 lane: 테스트 시점에 keytool로 만든 사설 CA로 서명된 broker 두 개 — SASL_SSL, `ssl.client.auth=required` SSL — 로 publish CONFIRMED(`MessagingSecuredBrokerQualificationTest` 2건). trust-store 생략은 JVM 기본 trust store(공인 CA broker용, 문서화) |
|
||||
| M-2f | 완료 | NEW-4d와 같은 결함, NEW-4d 방향(`sasl.client.callback.handler.class`) 채택. `KafkaProducerSecurityTest.aRotatedPasswordReachesTheNextAuthenticationWithoutRebuildingTheProducer` FAIL(callback handler 없음, 비밀번호가 JAAS 문자열에 고정) → PASS. JAAS는 login module 이름만(`... required;`), `KafkaCredentialCallbackHandler`가 인증마다 `CredentialRuntimeRegistry`에서 사용자 이름·비밀번호를 읽음(`src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaCredentialCallbackHandler.java:62`, `KafkaSecurityConfigurer.java:156`). producer를 바꾸지 않으므로 transport generation 1 유지 — 주석 정정(`KafkaMessagingAutoConfiguration.java:277`), Javadoc 정정(`KafkaSecurityConfigurer.java:15-30`), `docs/messaging/security.md` Rotation 절. 한계(문서화): registry는 provider가 만료 시각을 줄 때만 다시 가져옴, key/trust store 비밀번호는 client 재생성(재기동) 필요 |
|
||||
| NEW-4b | 완료 | M-2e 행과 같은 수정·테스트 |
|
||||
| NEW-4d | 완료 | M-2f 행과 같은 수정·테스트 |
|
||||
| M-2b | 완료 | NEW-4c와 같은 결함. 결정대로 `spring.kafka.bootstrap-servers` 의존 제거(NEW-4c의 "spring.kafka fallback + 불일치 시 실패" 추천은 이 결정으로 대체). `KafkaProducerConfigTest.theProducerConnectsToTheBrokerEntryAddressesNotToSpringKafka`·`aBrokerWithoutAnEntryFailsStartupNamingTheKey` FAIL(broker 항목이 있어도 spring.kafka가 없으면 기동 실패 / spring.kafka만으로 기동) → PASS. producer는 type=kafka인 `app.messaging.brokers.<name>` 항목 정확히 하나에서 만든다(`src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:150-205`). 모듈 기본값이 `APP_MESSAGING_KAFKA_BROKERS`를 `app.messaging.brokers.kafka.bootstrap-servers`로 연결(`src/adapter/outbound/messaging-kafka/src/main/resources/config/module-defaults/messaging.yml`), `KafkaCapabilityActivationTest` 2건 PASS. 함께 수정: `docs/registries/env-keys.yaml`(APP_MESSAGING_KAFKA_BROKERS 주석), `src/README.md`, `src/adapter/outbound/messaging-kafka/README.md`, compose 계약(`src/config/runtime/compose-profile-contracts.json`에서 `SPRING_KAFKA_BOOTSTRAP_SERVERS` 3곳 삭제, `scripts/verify-compose-profile-contracts.sh` 18 lane 일치), `docs/messaging/configuration-reference.md`. env 키 이름은 바뀌지 않음(`.env.example` 변경 없음) |
|
||||
| NEW-4c | 완료 | M-2b 행과 같은 수정·테스트 |
|
||||
| M-3 | 완료 | `KafkaConsumerRegistrarTest.aTimedOutHandlerStillRunningIsNotDispatchedASecondTime` FAIL("Expected size: 1 but was: 2" — 첫 handler가 도는 중 같은 offset 재dispatch) → PASS, `aTimedOutHandlerIsRedeliveredOnceItFinishesWithoutSettling` PASS. timeout이면 `cancel` 없이 `handler.whenComplete`에서 requeue와 permit·work count 반환(`src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java:374-395`). 방향보다 한 단계 더: requeue도 완료 시점으로 미룸(maxInFlight>1에서도 같은 offset 동시 실행 없음). 결함을 고정하던 기존 테스트 `handlerTimeoutCancelsTheOutstandingHandlerBeforeThePartitionPermitIsReleased`(cancel 여부 단언) 삭제 |
|
||||
| M-4a | 완료 | `DefaultMessagePublisherTest.anOversizedPayloadIsRejectedAsNotRetryableInsteadOfThrown` FAIL(`MessageTooLargeException` 동기 throw) → PASS, `aSaturatedPermitPoolRejectsAsRetryableWithinTheCallersDeadline` FAIL(5초 안에 끝나지 않음) → PASS. admission을 try 안으로, 크기 초과 REJECTED retryable=false, backpressure REJECTED retryable=true(`src/messaging/messaging-runtime-core/src/main/java/dev/caskeleton/messaging/runtime/DefaultMessagePublisher.java:226-236,333`) |
|
||||
| M-4b | 완료 | `OutboxRelayTest.aRowThatCannotBecomeAnEnvelopeFailsWhileTheRestOfItsBatchPublishes` FAIL(예약 header row의 예외가 `runOnce` 밖으로) → PASS(`[FAILED, PUBLISHED]`), `aPublisherThatThrowsLeavesTheRowAmbiguousRatherThanStrandingTheBatch` FAIL → PASS. envelope 변환 실패는 `markFailed`, publisher 예외는 결과 불명이라 AMBIGUOUS(같은 id로 재시도, attempt 예산 적용)(`src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/OutboxRelay.java:176-190,254`). CLAIM 시 attempts 증가는 하지 않음: row 단위 처리로 poison row 무한 재claim이 사라짐. relay 프로세스가 row 처리 중 죽는 경우는 lease 만료 재claim으로 남음 |
|
||||
| M-4c | 완료 | `MessagingOutboxRelayLifecycleTest.aRelayPassThatFailsIsCountedOnTheMeterRegistry` FAIL(`MeterNotFoundException 'messaging.outbox.relay.failed.passes'`) → PASS. `FunctionCounter messaging.outbox.relay.failed.passes`(`src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingReliabilityAutoConfiguration.java:124`), 원인 포함 WARNING 로그(`System.Logger`, `OutboxRelayWorker.java:193`). 로그 자체는 자동 테스트 없음. `OutboxRelayWorkerTest.aFailedPassDoesNotEndTheLoop`는 pass 실패를 DB 장애(repository 예외)로 재현하도록 변경(publisher 예외는 이제 row에서 처리됨) |
|
||||
| M-5a | 완료 | `KafkaProducerConfigTest.theProducerStopsWaitingForMetadataWithinTheDefaultPublishDeadline` FAIL → PASS(`max.block.ms` = `PublishOptions.defaults().timeout()` 5s, `KafkaMessagingAutoConfiguration.java:186`), permit 대기를 남은 budget으로 제한(`InFlightLimiter.java:63`, `MessagingAdmissionController.java:91`, `DefaultMessagePublisher.java:232`), 테스트 `DefaultMessagePublisherTest.aSaturatedPermitPoolRejectsAsRetryableWithinTheCallersDeadline` |
|
||||
| M-5b | 완료 | `ReactiveFacadeTest.theBlockingPublishRunsOffTheSubscribingThread` FAIL("Expected not same: Thread[#1,Test worker]") → PASS. `.subscribeOn(Schedulers.boundedElastic())`(`src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/DefaultReactiveMessagePublisher.java:41`) |
|
||||
| M-6 | 완료 | `OutboxOperationsTest`·`InboxOperationsTest.cleanupAsksForBoundedBatchesAndStopsAtTheFirstShortOne` FAIL("Expecting [] to contain exactly [1000, ...]") → PASS. 두 job이 `(cutoff, 1000)`을 짧은 batch가 나올 때까지 반복(`OutboxCleanupJob.java:53`, `InboxCleanupJob.java:56`), port의 1-인자 purge와 JDBC 구현 삭제(`OutboxRepository`, `InboxRepository`, `JdbcOutboxRepository`, `JdbcInboxRepository`). PG lane `OutboxPostgresIT.retentionRemovesOnlyPublishedRows`·`InboxPostgresIT.retentionRemovesOldRows` bounded 호출로 PASS |
|
||||
| M-7 | 완료 | `KafkaConsumerRegistrarTest.aFailedHandlerWaitsOutItsBackoffBeforeThePartitionIsReadAgain` FAIL(즉시 resume) → PASS, `aHandlerThatSpendsItsAttemptBudgetIsQuarantinedAndCommittedPast` FAIL("Expecting Optional to contain 11L but was empty") → PASS, `aProductionDestinationWithoutAQuarantineIsRefused` FAIL(거부 없음) → PASS. offset별 실패 횟수, `BackoffCalculator` 지연(최소 1초), `retry.maxAttempts` 도달 시 quarantine 후 commit, quarantine 없으면 backoff로 계속 재시도, production destination에 quarantine이 없으면 생성자에서 `KAFKA_QUARANTINE_REQUIRED`(`KafkaConsumerRegistrar.java:185,695`), `KafkaQuarantinePublisher.unavailable()`을 단일 인스턴스로. 재시도 시각은 주입 가능한 `InstantSource`. 참고: consumer는 아직 starter가 조립하지 않음(결정 10, Wave 3) |
|
||||
| M-11 | 완료 | `OutboxPostgresIT.aNewerRowWaitsWhileAnOlderRowWithTheSameOrderingKeyIsUnfinished`(실제 PostgreSQL) — 새 조건을 끈 SQL로 FAIL(같은 key의 뒤 row까지 3건 claim) → PASS. 최소 수정(기동 거부) 대신 claim 제외를 택함: relay는 기동 때 어떤 destination이 outbox로 나가는지 알 수 없다. CLAIM에 "같은 destination·ordering_key의 더 오래된 PENDING/AMBIGUOUS/IN_FLIGHT row가 없을 것" 조건과 `(created_at, message_id)` 순서(`src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/JdbcOutboxRepository.java:113-140`), 새 migration `V1005__messaging_outbox_ordering_key_index.sql`(messaging 예약 대역, `md5(ordering_key)` partial index). `twoRelaysClaimingConcurrently...` fixture는 서로 다른 key로 변경. `leaseBatch`(main 호출자 없음)에는 적용 안 함 |
|
||||
| S6-#2b | 완료 | 기본값 불일치만 수정(조립 위치 이동은 X1-#1i, Wave 3 3-C). `OutboxSettingsTest.bindsAllSixDefaultsWhenFieldsAreNull` FAIL("Expecting value to be false but was true") → PASS, `OutboxConfigTest.withoutTheRelayKeyTheRelaySchedulerIsNotAssembled` FAIL(scheduler 조립됨) → PASS. `matchIfMissing` 삭제(`src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/outbox/OutboxConfig.java:69`), null 기본값 false(`OutboxSettings.java:37`), `src/app-bootstrap/README.md` 문구 |
|
||||
| S6-lead-3 | 남음 | 이유: sample을 `OutboxAppendPort`로 옮기려면 `ValidatedIntegrationEvent`를 만들 encoder가 있어야 하는데 템플릿에 없다(`IntegrationEventEncoderPort` 구현 0). 결정 7(템플릿 JSON encoder 제공 + legacy 포트 삭제)이 Wave 3 3-C 작업. sample의 legacy 포트 사용처 3곳(`CreateWorkLogUseCase`, `PosterEventPublisher`, `PosterImagePublicationEventPublisher`) |
|
||||
| S7-lead-3 | 남음 | 이유: = X1 표 Kafka producer(legacy `KafkaSender` R0 경로). 결정 7로 Wave 3 3-C에서 경로째 삭제. 이번 묶음 지시대로 legacy seam은 손대지 않음 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `OutboxRepository.purgePublishedBefore(Instant)`, `InboxRepository.purgeProcessedBefore(Instant)`와 JDBC 구현 | `src/messaging/messaging-reliability-api/src/main/java/dev/caskeleton/messaging/reliability/{Outbox,Inbox}Repository.java`, `src/messaging/messaging-{outbox,inbox}-jdbc-postgresql/src/main/java/.../Jdbc{Outbox,Inbox}Repository.java` | `6d27356e` | M-6: 개수 제한 없는 단일 DELETE. bounded 버전만 남김 |
|
||||
| JAAS 문자열에 사용자 이름·비밀번호를 넣던 코드(`jaas`, `scramJaas`, `plainJaas`, `escapeJaas`)와 그 테스트 `aSecretWithQuotesIsEscaped`, `aSecretWithAControlCharacterIsRefused` | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaSecurityConfigurer.java`, `.../KafkaSecurityConfigurerTest.java` | `6d27356e` | M-2d/M-2f: 자격 증명이 JAAS에 들어가지 않으므로 escape할 값이 없음. callback handler로 대체 |
|
||||
| `CredentialRuntime` 5-인자 생성자 | `src/messaging/messaging-security/src/main/java/dev/caskeleton/messaging/security/CredentialRuntime.java` | `6d27356e` | username을 받는 생성자로 대체, 호출자는 registry 하나 |
|
||||
| `BrokerCredentialProfile.MutualTls(String)` 1-인자 형태 | `src/messaging/messaging-security/src/main/java/dev/caskeleton/messaging/security/BrokerCredentialProfile.java` | `6d27356e` | key store 없는 MUTUAL_TLS는 동작할 수 없음. `(credentialId, keyStoreLocation, keyStoreType)`으로 대체 |
|
||||
| 테스트 `handlerTimeoutCancelsTheOutstandingHandlerBeforeThePartitionPermitIsReleased` | `src/messaging/messaging-kafka/src/test/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrarTest.java` | `6d27356e` | M-3: CompletableFuture cancel을 단언해 결함을 고정하던 테스트 |
|
||||
| `spring.kafka.bootstrap-servers` 모듈 기본값, compose 계약의 `SPRING_KAFKA_BOOTSTRAP_SERVERS` 3곳, producer의 `Environment` 인자 | `src/adapter/outbound/messaging-kafka/src/main/resources/config/module-defaults/messaging.yml`, `src/config/runtime/compose-profile-contracts.json`, `src/messaging/messaging-spring-boot-starter-kafka/.../KafkaMessagingAutoConfiguration.java` | `6d27356e` | M-2b: broker 주소 출처를 `app.messaging.brokers.<b>` 하나로 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P1-new-1` (고침) `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java` — broker 항목의 `acks`, `enable-idempotence`, `max-in-flight-requests-per-connection`, `delivery-timeout`을 검증만 하고 producer에는 하드코딩 값을 넣음(capability 기준 3 위반). 적용하자 기본 `delivery-timeout: 30s`가 Kafka 4의 `linger.ms(5) + request.timeout.ms(30s)` 조건에 걸려 producer 생성이 실패함 → `linger.ms=0`, `request.timeout.ms=min(30s, delivery-timeout)`으로 맞춤. 테스트 `KafkaProducerConfigTest.theProducerAppliesTheBrokerEntryDeliverySettings` FAIL → PASS
|
||||
- `P1-new-2` (고침) `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java` — in-flight 천장·drain·pool 거부로 pause한 partition을 다시 resume하는 코드가 없음. ordered partition은 한 poll에 두 record를 받으면 첫 record 뒤 영구 정지. `resumeSaturated()`(`:463`) 추가. 테스트 `KafkaConsumerRegistrarTest.aPartitionPausedAtItsCeilingResumesOnceItsDeliveryFinishes` FAIL("Expected size: 2 but was: 1") → PASS
|
||||
- `P1-new-3` (고침) 같은 파일 — requeue 재개 시각을 `Instant.now()`로, poll은 호출자가 준 `now`로 비교해 두 시계가 섞임(테스트에서 재시도가 영원히 안 풀리거나 즉시 풀림). `InstantSource` 하나로 통일(M-7 수정에 포함)
|
||||
- 참고(결함 아님, 문서화): `CredentialRuntimeRegistry`는 provider가 만료 시각을 주지 않으면 credential을 다시 가져오지 않음 → 만료 시각 없는 credential은 rotation되지 않음(`docs/messaging/security.md`)
|
||||
|
||||
## 검증
|
||||
- `./gradlew :messaging:messaging-{security,kafka,runtime-core,policy,outbox-jdbc-postgresql,inbox-jdbc-postgresql,reliability-api,spring-boot-starter,spring-boot-starter-kafka}:check :adapter:outbound:messaging-kafka:check :app-bootstrap:check` — 통과 (app-bootstrap test 455건, skip 5 기존 조건부; messaging·adapter 단위 테스트 전부 통과)
|
||||
- `:messaging:messaging-spring-boot-starter:integrationTest`(실제 Kafka 4.1.0) — 3/3 통과: 기존 round trip + 사설 CA SASL_SSL + 사설 CA mTLS
|
||||
- `:messaging:messaging-kafka:verifyMessagingCertificationEvidence`(messagingCertificationTest, Kafka+Toxiproxy) — 37/37 통과, 커밋된 manifest 변경 없음
|
||||
- `:messaging:messaging-outbox-jdbc-postgresql:integrationTest` 29/29, `:messaging:messaging-inbox-jdbc-postgresql:integrationTest` 6/6 (실제 PostgreSQL)
|
||||
- `./gradlew architectureCheck :app-bootstrap:verifyEnvKeys` — 통과
|
||||
- `scripts/verify-compose-profile-contracts.sh` — 18 lane 일치
|
||||
- 실행 안 함: `verifyDependencyLocks`(의존성 변경 없음), 전체 `mainCheck`(묶음 범위 밖, 건드린 messaging lane만 실행)
|
||||
|
||||
## 추가한 migration
|
||||
- `src/messaging/messaging-outbox-jdbc-postgresql/src/main/resources/db/migration/messaging/V1005__messaging_outbox_ordering_key_index.sql` (messaging 예약 대역 1000–1999, persistence-jpa `applied-migrations.sha256` 대상 아님)
|
||||
@@ -0,0 +1,29 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| I-5a | 완료 | 커밋 `983cc832`(W1). 결정대로 `FORWARDED_HEADERS_TRUSTED` 모드 삭제. 비인증 키는 `getRemoteAddr()` 하나(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/RateLimitKeyResolver.java:45`). `RateLimitWebConfigTest.spoofedForwardedForDoesNotChangeTheUnauthenticatedKey`(Review Focus 3: 옛 `client-ip-mode=forwarded-headers-trusted`를 남긴 배포에서 위조 XFF 두 개를 보내도 키가 peer 주소 하나) FAIL(`Expecting actual ["9:CLIENT_IP\|12:198.51.100.1\|…", "…198.51.100.2…"] to contain exactly ["9:CLIENT_IP\|11:203.0.113.7\|…" ×2]`)→PASS. `server.forward-headers-strategy=framework`면 rate limit 켤 때 기동 거부(`RateLimitWebConfig.java:38`), `RateLimitWebConfigTest.frameworkForwardHeadersStrategyIsRefusedWhileRateLimiting` FAIL(`context started successfully`)→PASS. env 키 `APP_RATE_LIMIT_CLIENT_IP_MODE`·설정 키 `app.rate-limit.client-ip-mode` 삭제(`env-keys.yaml`, `.env.example`, `cache-redis.yml`, sample `application.yml`, README 2곳). `APP_SERVER_FORWARD_HEADERS_STRATEGY` allowed_values `[none, native]`, `.env.example` 값 `framework`→`native`, `server.yml` 주석에 `native` + `server.tomcat.remoteip.internal-proxies` 명시 |
|
||||
| NEW-10c | 완료 | I-5a와 같은 수정(같은 커밋·테스트). 현황표 수정 방향(`trusted-proxies` CIDR 설정 추가)은 오케스트레이터 결정(모드 삭제 + native/internal-proxies)으로 대체. `.env.example`이 `framework`(모든 peer의 XFF를 믿음)를 기본으로 권하던 것도 이 행의 원인이라 `native`로 바꾸고 `framework`는 rate limit 기동 거부로 막음 |
|
||||
| X2-P2-7b | 완료 | I-5a와 같은 결함. client IP 해석 경로가 `getRemoteAddr()` 하나만 남음(XFF를 직접 읽는 main 코드 grep 0건, `ForwardedHeaderClientIpResolver` 삭제). 남은 `web-notification/.../ExternalRequestUrlResolver`는 client IP가 아니라 URL(proto/host) 해석이고 이미 trusted proxy일 때만 읽는다. 그 forwarded 파싱 삭제·설정 통합은 현황표 I-5b(W3)가 소유해서 이번에 건드리지 않음 |
|
||||
| I-8b | 완료 | NEW-10b와 같은 수정. `CorsSettingsTest.originThatIsNotExactlySchemeHostPortFailsWithTheEnvKeyName`(10개 입력) FAIL(`Expecting actual not to be null` — 예외 없음)→PASS, `exactOriginWithPortIsAccepted` PASS. `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/settings/CorsSettings.java:44,64`. 옛 validator 규칙 중 둘은 넣지 않음: "소문자만"(Spring `CorsConfiguration.checkOrigin`이 대소문자 무시 비교), "credentials면 allowedHeaders `*` 거부"(Spring은 `*`를 요청 헤더 목록으로 되돌려 주므로 credentials와 함께 동작한다 — 넣으면 지금 동작하는 기본값(`*`)을 깨뜨림) |
|
||||
| NEW-10b | 완료 | `CorsSettings` compact constructor가 origin마다 `URI` 파싱: `http`/`https`, host 필수, path(끝 `/` 포함)·query·fragment·user info·와일드카드 호스트·`"null"` 거부, `*`는 기존대로 credentials 없을 때만. 메시지에 `APP_SECURITY_CORS_ORIGINS (ca-skeleton.cors.allowed-origins)`. 테스트는 I-8b 행 |
|
||||
| NEW-10a | 완료 | `RequestBodyBoundaryTest.duplicateJsonKeyIsRejectedAsValidationFailure`(`{"role":"user","role":"admin"}` → 400 `VALIDATION_FAILED`) FAIL(`Status expected:<400> but was:<200>`)→PASS. `JsonMapperBuilderCustomizer`로 `StreamReadFeature.STRICT_DUPLICATE_DETECTION`(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/autoconfigure/WebMvcPlatformAutoConfiguration.java:84`). 위치는 현황표의 `WebAdapterAutoConfiguration` 대신 같은 leaf의 `WebMvcPlatformAutoConfiguration`(요청 경계 필터와 같이 servlet 앱 조건·`backend.web.mvc.enabled`에 묶이고, 테스트가 무거운 security 조립 없이 이 루트 하나로 검증됨) |
|
||||
| I-2b | 완료 | `RequestBodyBoundaryTest.jsonBodyOverTheCeilingIsRejectedAsPayloadTooLarge` FAIL(`Response status expected:<413> but was:<200>`)→PASS, `jsonBodyWithinTheCeilingReachesTheController` PASS. 새 `JsonBodyLimitFilter`(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/filter/JsonBodyLimitFilter.java:33`): JSON 본문만(multipart·form·tus·콜백은 각자 상한), 선언 Content-Length 초과는 읽기 전에, chunked/거짓 길이는 스트림 계수로 `MaxUploadSizeExceededException` → 기존 핸들러 413 `PAYLOAD_TOO_LARGE` Envelope. Jackson이 bean 속성 안에서 이 예외를 감싸는 경우도 413(`GlobalExceptionHandler.java:281`), `GlobalExceptionHandlerTest.unreadableBodyCausedByTheSizeCeilingIsPayloadTooLarge` FAIL(`expected: 413 CONTENT_TOO_LARGE but was: 400 BAD_REQUEST`)→PASS, `JsonBodyLimitFilterTest` 2건. 상한은 `backend.web.mvc.max-json-body-size`(기본 1MB, `WebMvcPlatformSettings.java:31`). JSON 깊이는 Jackson 3.1 기본 `StreamReadConstraints`(maxNestingDepth 500, maxNumberLength 1000)가 Boot가 만든 mapper에 이미 적용되어 있어 따로 두지 않음(`MapperBuilder`에 factory 제약을 바꾸는 API가 없어 customizer로는 설정 불가). 문서·문자열 길이는 본문 상한이 막음 |
|
||||
| I-2a | 완료 | `NotificationCallbackMvcControllerTest.aDeclaredOversizeBodyIsRefusedWithoutReadingIt`, `anUndeclaredOversizeBodyIsRefusedAfterReadingOneByteOverTheCeiling` FAIL(컴파일: `method callback … cannot be applied to given types` — `@RequestBody byte[]` 시그니처)→PASS. 컨트롤러가 `HttpServletRequest`만 받아 Content-Length 초과면 읽지 않고 413, 아니면 `readNBytes(max+1)`(`src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/NotificationCallbackMvcController.java:85,91`) |
|
||||
| I-3b | 완료 | 커밋 `5c08d3be`(W2). `GlobalExceptionHandlerTest.classLevelConstraintViolationIsReportedAgainstTheRequest` FAIL(`expected: [{code=INVALID, field=request, message=Invalid value}] but was: []`)→PASS. `getAllErrors()`(`GlobalExceptionHandler.java:263`), `ClientSafeValidationDetails.from(ObjectError)`가 global error를 `field=request`로(`ClientSafeValidationDetails.java:56`) |
|
||||
| I-4a | 완료 | request/correlation/trace/span id 발급·MDC·응답 헤더를 `WebMvcRequestIdFilter`(HIGHEST+10, Security 앞) 한 곳으로 이동(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/filter/WebMvcRequestIdFilter.java:95,103`), ERROR/ASYNC 재디스패치에 같은 값 복원. `SecurityModeWebContractTest.anUnauthenticatedRejectionCarriesTheAssignedRequestIdInItsMeta`(실제 JWT security 체인이 쓴 401 Envelope의 `meta.requestId` = `X-Request-Id`) FAIL(`expected: "13499754-…" but was: null`)→PASS. `WebMvcRequestIdFilterTest.assignedIdentifiersAreOnMdcDuringTheChainAndMatchWhatTheResponseCarries`·`inboundCorrelationIdLosesLineBreaksBeforeReachingMdc` FAIL(`No value present` / `expected "fooFAKE LOG" but was null`)→PASS, `mdcIsClearedWhenTheRequestLeavesTheFilter`·`anErrorRedispatchRestoresTheSameIdentifiersOnMdc` PASS. 순서: `OperationalContractRuntimeTest.requestIdFilterIsRegisteredAheadOfSpringSecurity`(`src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/runtime/OperationalContractRuntimeTest.java:135`, 슬라이스에 `SecurityFilterAutoConfiguration`을 넣어 실제 `springSecurityFilterChain` 등록과 비교) PASS. fixture 문제: `PipelineOrderFixtureApplication`은 의미 순서·async 1회 관측만 증명한다고 주석에 적고 실제 순서는 위 두 테스트가 맡음. `RequestLoggingFilter`는 principal을 읽으려고 보안 체인 안쪽에 남음 → 체인이 거절한 요청의 접근 로그 줄은 없고 entry point/access-denied handler의 `security failure` 로그(이제 request_id 포함)가 대신함 |
|
||||
| I-4b | 완료 | trace는 `WebMvcRequestIdFilter`만 만든다(`TraceParent.parse` 또는 새 root, WebTraceId·MDC·응답 `traceparent`가 같은 값). `RequestLoggingFilterTest.assignsNoIdentifierOrTraceOfItsOwn` FAIL(`Expecting [X-Request-Id, X-Correlation-Id, traceparent] not to contain …`)→PASS, `WebMvcRequestIdFilterTest.responseTraceparentCarriesTheTraceIdTheFilterAssigned`·`validInboundTraceparentIsAdoptedWithItsSpanAndEchoed` FAIL(`NullPointerException` — 헤더 없음)→PASS. `RequestLoggingFilter`의 id/trace 생성 코드 삭제(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/filter/RequestLoggingFilter.java`), 옮겨진 테스트는 `WebMvcRequestIdFilterTest`로 |
|
||||
| I-6a | 완료 | 결정 13. 컨트롤러의 `DEFAULT_CATEGORY="transactional"` 삭제, `request.category()`를 그대로 넘김(`NotificationSubmissionController.java:87`). 판정은 `AcceptNotificationCommand`(application-notification, `AcceptNotificationCommand.java:70`)가 → `IllegalArgumentException` → 400 `BAD_PARAMETER`. `NotificationSubmissionControllerTest.submissionWithoutCategoryIsRejectedBeforeTheUseCaseRuns` FAIL(`[500, 1]` — 유스케이스가 transactional로 호출됨)→PASS(`[400, 0]`), `AcceptNotificationApplicationUseCaseTest.anAcceptanceWithoutCategoryIsRefusedRatherThanDefaulted` PASS(소유자 명시) |
|
||||
| S6-#11b | 완료 | `UpdateWorkLogCommand.expectedVersion`(`OptionalLong`, `sample-portfolio/.../application/command/UpdateWorkLogCommand.java:25`), 비교는 `UpdateWorkLogUseCase` 쓰기 트랜잭션 안(`UpdateWorkLogUseCase.java:43`, 불일치 → 새 `WorkLogVersionMismatchException` → `DomainExceptionHandler`가 412 `PRECONDITION_FAILED`). 컨트롤러는 헤더만 해석(`WorkLogController.java:211`). `WorkLogControllerWireTest.patchWithIfMatchDoesNotReadTheWorkLogOutsideTheUpdate` FAIL(`NoInteractionsWanted … GetWorkLogUseCase`)→PASS, `WorkLogUseCasesTest.staleExpectedVersionIsRefusedInsideTheUpdate`·`currentExpectedVersionAppliesTheUpdate`, `patchHandsTheIfMatchVersionToTheUpdateUseCase`, `patchWithStaleIfMatchReturns412`(유스케이스 예외 경로로 변경) PASS. 동작 변화: 여러 태그를 나열한 `If-Match`(예: `W/"1", W/"2"`)는 이제 읽지 않고 412(`patchWithAListIfMatchIsRefusedAs412`) — 이 리소스는 validator 하나만 내보냄 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| rate-limit client IP 모드 (`RateLimitClientIpMode`, `ClientIpResolver`, `ClientIpResolverFactory`, `ForwardedHeaderClientIpResolver`, `RemoteAddrClientIpResolver`)와 설정 `app.rate-limit.client-ip-mode` / env `APP_RATE_LIMIT_CLIENT_IP_MODE` | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/` | `6d27356e` | I-5a·NEW-10c: `FORWARDED_HEADERS_TRUSTED`가 호출자가 쓰는 XFF 맨 왼쪽 값을 키로 씀. 운영 정본은 `server.forward-headers-strategy=native` + `server.tomcat.remoteip.internal-proxies`의 `getRemoteAddr()` 하나 |
|
||||
| `RequestLoggingFilter`의 request/correlation/trace id 발급·MDC 기록·응답 헤더 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/filter/RequestLoggingFilter.java` | `6d27356e` | I-4a·I-4b: `WebMvcRequestIdFilter`로 이동(두 필터가 trace를 따로 만들던 것 제거) |
|
||||
| 알림 제출 category 기본값 `"transactional"` | `src/adapter/inbound/web-notification/.../submission/NotificationSubmissionController.java` | `6d27356e` | I-6a 결정 13 |
|
||||
| `WorkLogController.requireIfMatch`(트랜잭션 밖 get 후 비교) | `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/adapter/inbound/web/controller/WorkLogController.java` | `6d27356e` | S6-#11b: 비교를 update 유스케이스 트랜잭션 안으로 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P10-new-1` (고침, W1): `src/.env.example:25`가 `APP_SERVER_FORWARD_HEADERS_STRATEGY=framework`를 권했다. `framework`는 Spring `ForwardedHeaderFilter`가 모든 peer의 `X-Forwarded-For`를 믿어 `getRemoteAddr()` 자체를 호출자가 고르게 하므로, rate-limit 모드와 상관없이 비인증 키를 우회할 수 있었다. `native`로 바꾸고 registry allowed_values에서 `framework`를 뺐으며, rate limit이 켜진 상태에서 `framework`면 기동을 거부한다(`RateLimitWebConfig.java:38`). 다만 rate limit이 꺼진 배포에서 `framework`를 막는 런타임 가드는 없다(설정 통합은 I-5b/W3).
|
||||
- `P10-new-2` (고침, W2): `WebMvcRequestIdFilter`의 traceparent 정규식은 all-zero trace id 등을 받아들였고 `RequestLoggingFilter`의 `TraceParent.parse`는 거부해서, 같은 요청에서 두 필터가 다른 trace id를 가질 수 있었다(I-4b의 한 원인). 이제 `TraceParent.parse` 하나만 쓴다.
|
||||
- `P10-new-3` (고침, W1): 옛 콜백 컨트롤러의 `@RequestBody byte[]`는 form POST(`application/x-www-form-urlencoded`, query string 없음)에서 Spring 7 `ServletServerHttpRequest.getBody()`가 요청 파라미터로 다시 만든 본문을 준다(`getBodyFromServletRequestParameters`, spring-web 7.0.9 bytecode로 확인). provider(예: Twilio form 콜백)가 서명한 원래 octet과 달라질 수 있어 클래스 주석의 "exact octets" 약속과 어긋났다. I-2a 수정으로 `getInputStream()`을 직접 읽어 해소. 실서버 form POST 검증은 I-2c(W4) 범위.
|
||||
@@ -0,0 +1,50 @@
|
||||
# P11 결과 — HTTP client (`adapter:outbound:httpclient`) + H-8·H-9(messaging)
|
||||
|
||||
worktree 브랜치 `worktree-agent-afdf5842812e13046`. 커밋: D `06764fcb`, W1 `c44030e8`, W2 `52511391`.
|
||||
경로 약어: `HC` = `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient`,
|
||||
`MSG` = `src/adapter/outbound/messaging/src/main/java/dev/caskeleton/adapter/outbound/messaging`.
|
||||
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| S3-#1 | 완료 | D 커밋 `06764fcb`에서 reactive 스택(WebClient·Reactor Netty)과 webflux·reactor·reactor-netty·reactor-test·blockhound 의존 삭제. blocking(RestClient) 경로 하나만 남음. `clients[N].api` 설정 키·`ClientApiType`·`TransportType.REACTOR_NETTY` 삭제, env-fields.yaml 행 삭제, lockfile 재생성(httpclient·app-bootstrap). Jetty HTTP/3 실험 transport는 reactive SPI에 묶여 있어 blocking SPI(`JettyClientHttpRequestFactory`)로 옮김(자동 조립 안 됨은 그대로) `HC/http3/JettyHttp3TransportProvider.java:49` |
|
||||
| H-5a | 해당 없음(코드 삭제) | D `06764fcb`에서 `webclient/ReactiveAttemptExecutor` 삭제. blocking은 단계 기록함: `HC/restclient/BlockingAttemptExecutor.java:233,238`(`tracker.enter(REQUEST_BODY/RESPONSE_HEADERS)`)이 classifier로 전달 |
|
||||
| H-5b | 해당 없음(코드 삭제) | D `06764fcb`에서 `WebClientResponseMapper`·`ReactorFailureClassifier` 삭제. blocking은 크기 초과를 `HC/restclient/ResponseSizeLimiter.java:42,50`에서 `HttpResponseTooLargeException`으로 던지고 `BlockingAttemptExecutor.java:303`이 `RESPONSE_TOO_LARGE`로 분류 |
|
||||
| H-5c | 완료 | blocking 결함(`StableBlockingExceptionMapper`)이라 W2에서 수정. `StableBlockingExceptionMapperTest.unknownTransportFailureIsNotReportedAsAConnectFailure` FAIL(`expected HttpUnknownTransportException but was HttpConnectException`)→PASS. `HC/restclient/StableBlockingExceptionMapper.java:40`, 새 타입 `HC/api/error/HttpUnknownTransportException.java`. reactive 쪽 테스트는 코드 삭제로 없음 |
|
||||
| H-7b | 해당 없음(코드 삭제) | D `06764fcb`에서 `ReactiveAttemptExecutor` 삭제. blocking `categoryOf`에는 세 case 있음 `HC/restclient/BlockingAttemptExecutor.java:308-310` |
|
||||
| S3-#2a | 해당 없음(코드 삭제) | D `06764fcb`에서 `webclient/ReactiveStreamingGateway` 삭제. blocking 스트리밍은 deadline·credential·admission 적용 `HC/restclient/BlockingStreamingGateway.java:69,82,106` |
|
||||
| H-2 | 완료 | `DefaultDynamicTargetGatewayTest.traceHeadersStayOffTheWireWhenThePolicyDisablesPropagation` FAIL(`Expecting actual: [true, true] to contain exactly [false, false]`)→PASS, 켜진 경우 `traceHeadersAreSentWhenThePolicyEnablesPropagation` PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:186` |
|
||||
| H-3a | 완료 | `DefaultDynamicTargetGatewayTest.seeOtherHopSendsAGetWithoutTheOriginalBody` FAIL(`["GET", "{"name":"grace"}"]` ≠ `["GET", ""]`)→PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:155` |
|
||||
| H-3b | 완료 | `DefaultDynamicTargetGatewayTest.temporaryRedirectWithAOneShotBodyIsRejectedAsNotReplayable` FAIL(`Expecting actual not to be null` — 예외 없이 재전송)→PASS. hop마다 `RedirectEvaluator` 판정 `HC/dynamic/DefaultDynamicTargetGateway.java:133-150`(거부 `:147`, 메트릭 outcome=거부 코드) |
|
||||
| H-3c | 완료 | `DefaultDynamicTargetGatewayTest.crossOriginHopDropsTheCallerSuppliedApiKey` FAIL(`[true, true]` ≠ `[true, false]`)→PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:162`. 수정 방향대로 `SensitiveHeaderStripper` 표준 이름만 제거함 — 관례 밖 이름의 호출자 헤더는 P11-new-4 |
|
||||
| H-4a | 완료 | `BlockingRedirectCoordinatorTest.crossOriginHopDropsTheProfileCredentialHeader` FAIL(`[true, true]` ≠ `[true, false]`)→PASS. `HC/restclient/BlockingAttemptExecutor.java:187`(붙인 자격증명 헤더 이름을 stripper에 추가), `HC/security/SensitiveHeaderStripper.java:61`(`alsoStripping`, `withAdditional`은 이것에 위임 — H-4b(W3) 삭제 대상은 그대로). 참고: 기동 검증이 API key + `allowCrossOrigin`을 이미 거부하므로 방어 계층 수정 |
|
||||
| H-6a | 완료 | `OAuth2CredentialProviderTest.aSlowRefreshDoesNotHoldUpAnotherRegistrationThatSharesItsBin` FAIL(`java.util.concurrent.TimeoutException` — 같은 bin의 다른 registration이 느린 refresh 뒤에서 대기)→PASS. `HC/auth/OAuth2CredentialProvider.java:65-69`(`cache.get` → lock 밖 `tokenLoader.load` → `cache.put`) |
|
||||
| H-6b | 완료 | `SingleFlightTokenLoaderTest.aCallerThatJoinedLaterStillGetsTheTokenAfterAnEarlierCallerTimedOut` FAIL(`ExecutionException: CancellationException`)→PASS. timeout·interrupt 분기에서 `cancel(true)` 제거 `HC/auth/SingleFlightTokenLoader.java:81`, `CancellationException`→`HttpAuthenticationException` `:113` |
|
||||
| H-8 | 완료 | `PlatformIntegrationEventPublishAdapterTest.aFailureOtherThanAnIncompatibleValueIsNotTurnedIntoARefusal` FAIL(`Expecting actual not to be null` — NPE가 REJECTED_BEFORE_SEND로 바뀜)→PASS. catch를 `IllegalArgumentException`으로 좁힘 `MSG/platformbridge/PlatformIntegrationEventPublishAdapter.java:62`; 나머지 예외는 전파되어 relay가 실제 원인 타입으로 재시도·보고. 수정 방향 중 "cause를 거부 결과에 싣기"는 하지 않음: 포트가 `OutboxPublishOutcome` enum만 돌려줘 원인을 실을 자리가 없고, 실으려면 application-core 포트·relay 변경(계층 밖)이 필요. 로그로 남기는 것도 예외 메시지를 운영 로그에 쓰지 않는 규칙(`Slf4jOutboxRelayFailureReportAdapter`)과 충돌 |
|
||||
| H-9 | 완료 | `KafkaSenderInterruptionTest.anInterruptedAcknowledgementWaitRethrowsWithTheInterruptFlagRestored` FAIL(`[InterruptedException, false]`)→PASS, `OutboundMessagePublisherTest.anInterruptedSendIsSwallowedWithTheInterruptFlagKept`·`OutboxMessagePublishAdapterTest$FailClosedPath.anInterruptedSendKeepsTheRelayThreadInterrupted` FAIL(`Expecting value to be true but was false`)→PASS. `src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/KafkaSenderAutoConfiguration.java:115`, `MSG/core/OutboundMessagePublisher.java:41`, `MSG/outbox/OutboxMessagePublishAdapter.java:100`(삼키는 지점 두 곳 모두 복원) |
|
||||
| S3-#13b | 완료 | `DefaultGenericHttpGatewayTest.anExhaustedRetryBudgetIsReportedAsItsOwnFailureNotARateLimit`·`aRetryRefusedByADrainingRuntimeIsReportedAsItsOwnFailureNotARateLimit` FAIL(`expected HttpRetryBudgetExhaustedException/HttpRuntimeDrainingException but was HttpRateLimitRejectedException`)→PASS. `HC/restclient/DefaultGenericHttpGateway.java:183,281`, 새 타입 `HC/api/error/HttpRetryBudgetExhaustedException.java`·`HttpRuntimeDrainingException.java`, `docs/httpclient/operations.md` 예외 표 갱신. 두 경로는 재시도 판정과 다음 attempt 사이의 경합에서만 도달하므로 테스트는 `TestGateways.forProfile(profile, transport, eligibility)`로 판정기를 주입해 재현 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| reactive gateway·SSE·streaming·runtime 패키지 (`DefaultReactiveHttpGateway`, `ReactiveHttpGateway`, `DefaultReactiveSseGateway`, `ReactiveSseGateway`, `ReactiveStreamingGateway`, `ReactiveAttemptExecutor`, `ReactiveClientRuntime`, `WebClientRuntimeFactory`, `WebClientBodyWriter`, `WebClientResponseMapper`, `BoundedDataBufferFlux`, `FirstByteDeliveryGuard`, `MultipartReplayability`, `ReactiveBodySource`, `SseIdleTimeoutException`, `SseOperation`, `SseReconnectPolicy`) | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/webclient/` | `6d27356e` | 결정 9: httpclient reactive 스택 삭제, blocking 경로 하나만 유지 |
|
||||
| Reactor Netty transport (`ReactorNettyTransportProvider`, `ReactorHttpClientFactory`, `ReactorConnectionProviderFactory`, `ReactorFailureClassifier`, `ReactorPoolMetricsBinder`) | `.../httpclient/reactor/` | `6d27356e` | 결정 9 |
|
||||
| reactive 자격증명 (`ReactiveCredentialProviderRegistry`, `ReactiveRequestCredentialProvider`) | `.../httpclient/auth/` | `6d27356e` | 결정 9 |
|
||||
| reactive 재시도·resilience (`ReactiveAttemptResiliencePipeline`, `ReactiveLogicalCall`, `ReactiveRetryCoordinator`) | `.../httpclient/resilience/` | `6d27356e` | 결정 9 |
|
||||
| reactive typed client (`DefaultReactiveHttpServiceRegistry`, `ReactiveHttpServiceRegistry`, `ReactiveKernelHttpExchangeAdapter`, `ReactiveOperationContext`, `ReactiveServiceInvocationHandler`), `ServiceOperationDescriptor.reactive` 플래그와 blocking/reactive 혼합 검사 | `.../httpclient/service/` | `6d27356e` | 결정 9 |
|
||||
| reactive transport SPI (`ReactiveTransportProvider`, `ReactiveTransportCapabilities`), `TransportCapabilityValidator`의 reactive overload | `.../httpclient/transport/` | `6d27356e` | 결정 9 |
|
||||
| 설정 키 `app.httpclient.clients[N].api`(`APP_HTTPCLIENT_CLIENTS_N_API`)와 `ClientApiType`, `TransportType.REACTOR_NETTY`, actuator `api` 항목 | `.../httpclient/profile/ClientApiType.java`, `docs/httpclient/env-fields.yaml` | `6d27356e` | 남은 값이 하나뿐인 키(동작하지 않는 옵션은 키를 두지 않음). H2 전용 프로필은 이제 모든 transport에서 `HTTP2_REQUIRED_TRANSPORT_UNSUPPORTED` |
|
||||
| 기동 위반 코드 `REACTIVE_REDIRECT_UNSUPPORTED`, `REACTIVE_AUTHENTICATION_UNSUPPORTED`, `DYNAMIC_TARGET_PROFILE_API_UNSUPPORTED` | `.../profile/ClientProfileValidator.java`, `.../autoconfigure/HttpClientStartupValidator.java` | `6d27356e` | reactive 프로필이 없어 판정 대상 없음 |
|
||||
| reactive bean (`httpClientReactiveTransportProviders`, `httpClientReactiveCredentialProvider`, `ReactiveAttemptExecutor`, `reactiveHttpGateway`, `ReactiveHttpServiceRegistry`, `ReactiveStreamingGateway`, `ReactiveSseGateway`) | `.../httpclient/autoconfigure/` | `6d27356e` | 결정 9 |
|
||||
| reactive 테스트 (`BlockHoundEventLoopTest`, `DefaultReactiveHttpGatewayTest`, `FirstByteRetryBoundaryTest`, `ReactiveSseGatewayTest`, `ReactiveStreamingLifecycleTest`, `ReactiveRetryCoordinatorTest`, `ReactiveHttpServiceRegistryTest`, `ReactiveAuthenticationContractTest`, `BlockingReactiveSignatureSeparationTest`), 계약·protocol 테스트의 reactor case | `src/adapter/outbound/httpclient/src/test/java/...` | `6d27356e` | 대상 코드 삭제. forward proxy 경로 테스트는 blocking(Apache)으로 옮김(`ForwardProxyContractTest.gatewayRoutesTheCallThroughTheConfiguredForwardProxy`) |
|
||||
| reactive testkit (`ReactiveTestGateways`, `ReactiveTransportContract`, `ReactiveEventsClient`, `MixedSignatureClient`, `NettyLeakDetectionExtension`, `EventPayload`, `MockHttpServer.enqueueSse`, `ClientProfiles.reactor`, `HttpClientContract.blockHoundSelected`) | `src/adapter/outbound/httpclient/src/testFixtures/java/...` | `6d27356e` | 대상 코드 삭제 |
|
||||
| `Http2StreamSaturationTest`(Reactor Netty 전용), `ReactiveClientBenchmark` | `.../src/httpClientPerformanceTest/...`, `.../src/jmh/...` | `6d27356e` | 대상 transport 삭제 |
|
||||
| `httpClientBlockHoundTest` lane, `check` 의존, 계약 lane 기본 transport의 `reactor`, `io.netty.leakDetection.level` 시스템 속성 | `src/adapter/outbound/httpclient/build.gradle` | `6d27356e` | reactor event loop이 없어 검증 대상 없음 |
|
||||
| 의존 `spring-webflux`, `reactor-core`, `reactor-netty-http`, `reactor-test`, `blockhound`, testFixtures `netty-common`·`logback-classic`·`reactor-core`, 카탈로그 `blockhound` | `src/adapter/outbound/httpclient/build.gradle`, `src/gradle/libs.versions.toml` | `6d27356e` | 결정 9 |
|
||||
| CI matrix `transport: reactor`, release의 `httpClientBlockHoundTest` | `.github/workflows/pr-adapters.yml`, `.github/workflows/release.yml` | `6d27356e` | 없는 lane·transport 호출 제거 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P11-new-1` — `app.httpclient.clients[N].timeout.streaming-idle`(`APP_HTTPCLIENT_CLIENTS_N_TIMEOUT_STREAMING_IDLE`)은 바인딩만 되고 main 코드 어디서도 읽지 않음(reactive 삭제 전에도 그랬음). `HC/profile/TimeoutSettings.java:25`, `docs/httpclient/configuration-reference.md`의 `streaming-idle` 행. 동작하지 않는 옵션은 키를 두지 않는 규칙 위반. 고치지 않음.
|
||||
- `P11-new-2` — `scripts/verify-httpclient-docs.py:22`가 없는 경로 `src/app-bootstrap/.../autoconfigure/httpclient/HttpClientStartupValidator.java`를 읽어 `FileNotFoundError`로 실패함. 경로를 `.../httpclient/autoconfigure`로 바꿔 돌리면 `rotation-drain-timeout`이 `docs/httpclient/configuration-reference.md`에 없다는 drift 1건이 남음(이 묶음 변경과 무관, 그 외 drift 0). 고치지 않음(scripts는 P13 범위).
|
||||
- `P11-new-3` — `httpClientFailureInjectionTest`의 `FailureInjectionContractTest.disabledProxyFailsBeforeARequestCanBeSent`가 이 머신에서 실패(`expected: NOT_SENT but was: SENT_NO_RESPONSE`). Docker userland proxy(`docker-proxy` 동작 중)가 꺼진 Toxiproxy 리스너의 published 포트 연결을 받은 뒤 닫으므로 client는 실제로 요청을 보낸 것으로 관찰함. 이 묶음은 evidence 분류 코드를 바꾸지 않음(lane은 `check` 밖, Docker 필요). 테스트가 Docker 네트워크 모드에 의존함. 고치지 않음.
|
||||
- `P11-new-4` — Dynamic Target cross-origin hop은 `SensitiveHeaderStripper` 표준 이름(`authorization`·`cookie`·`x-api-key`·`api-key` 등)만 제거하므로, 호출자가 `HeaderPolicy`로 넘긴 관례 밖 이름의 자격증명 헤더(예: `X-Client-Key`)는 다음 origin으로 따라감 `HC/dynamic/DefaultDynamicTargetGateway.java:162`. cross-origin hop에서 호출자 헤더를 전부 버릴지는 결정 필요 — 승인자: 저장소 소유자.
|
||||
@@ -0,0 +1,29 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| F-1a | 완료 | `PolicyAwareMongoQueryBuilderTest.anOperatorShapedEqualityValueIsRefused`·`anOperatorShapedLowerBoundIsRefused`·`anOperatorShapedUpperBoundIsRefused`(각 6값: `Map.of("$ne","")`, `Document("$ne",null)`, `BsonDocument("$gt")`, `JsonObject("{$regex}")`, `Pattern`, `BsonRegularExpression`), `anEqualityValueThatIsACollectionIsRefusedInFavourOfWhereIn`, `aRegexHiddenInAMembershipListIsRefused` FAIL(`AssertionError: Expecting actual not to be null`, 23건)→PASS. 공용 검사 `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/query/MongoOperator.java:96`(`requireScalar`), 호출 `query/PolicyAwareMongoQueryBuilder.java:45,52,59,71`. 수정 방향과 차이: 새 공개 타입 `MongoQueryValues`는 API surface 한도(271, `-PraiseMongoApiSurfaceCeiling` 필요)에 걸려 기존 공개 enum `MongoOperator`의 인스턴스 메서드로 둠(surface 불변). `Pattern`·`BsonRegularExpression`도 거부(값 자리 정규식이 regex 정책 우회), `whereIn` 원소에도 적용. |
|
||||
| F-1b | 완료 | `MongoAtomicOperationsTemplateTest.anOperatorDocumentAsTheIdentifierIsRefused`(`AtomicFilter.id(Map.of("$gt",""))`), `anOperatorDocumentAsAnExpectedStateIsRefused`, `anOperatorDocumentPassedToTheConstructorIsRefused` FAIL(`AssertionError` at `MongoAtomicOperationsTemplateTest.java:42`)→PASS. `imperative/atomic/AtomicFilter.java:36`(compact constructor에서 `MongoOperator.EQ::requireScalar`). 패키지 edge `imperative -> query`를 `MongoModuleBoundaryTest` matrix에 추가(DAG 유지). |
|
||||
| F-5a | 완료 | `MongoCsfleClientFactoryTest.theSchemaIsKeyedByTheCollectionNamespace` — 재현 FAIL(`Expecting all elements of ["customers"] to match`)→PASS. `MongoCsfleProfile`에 `database` component 추가, `namespace()` = `database.collection`(`advanced/encryption/csfle/MongoCsfleProfile.java:23,67`), `MongoCsfleClientFactory.java:76`. |
|
||||
| F-5b | 완료 | `MongoCsfleClientFactoryTest.theSchemaIsGeneratedFromTheFieldPolicies`(중첩 경로 `contact.email` → 중첩 `properties`, Random/Deterministic 알고리즘, keyId UUID) 재현 FAIL(`Expecting actual "{}" to contain "ssn"`)→PASS, `anAliasWithoutADataKeyIdIsRefused`, `aFieldInsideAnEncryptedParentIsRefused`. `encryptedFieldsMapJson` 인자 제거, 대신 `Map<String, UUID> dataKeyIds`(alias→data key id: 자동 암호화 schema는 alias가 아니라 key id를 받으므로 호출자가 key vault에서 해석) — `MongoCsfleClientFactory.java:55,91`. Deterministic 필드는 `bsonType: string` 고정(`ponytail:` 주석, 비문자열 equality 필드가 생기면 정책에 타입 추가). |
|
||||
| F-5c | 완료 | `MongoCsfleClientFactoryTest.theKeyVaultConnectsWithItsOwnCredential` 재현 FAIL(`Expecting actual not to be null` — `getKeyVaultMongoClientSettings()`)→PASS. 생성자가 `MongoCredentialResolver`를 받아 `profile.keyVaultCredential()`로 key vault `MongoClientSettings`를 만든다(`MongoCsfleClientFactory.java:40,64-73`). 실제 암호화 lane은 불가: 자동 암호화는 `mongocryptd` 또는 `crypt_shared`(MongoDB Enterprise 배포물)가 필요하고 lane이 쓰는 community `mongo:8.0` 이미지에는 없다. driver 쪽 `org.mongodb:mongodb-crypt`도 이 leaf 의존성에 없다(새 의존성·네트워크 다운로드 필요). 그래서 driver에 넘기는 `AutoEncryptionSettings`를 설정 단위 테스트로 검증함. F-5d(W4, 단위 테스트 추가)도 이 테스트로 사실상 충족. |
|
||||
| X2-P1-1b | 완료 | `MongoProfileClientSettingsAutoConfigurationTest.aTypedProfileResolvesItsUriThroughTheApplicationSecretSource` FAIL(`IllegalStateException: MongoDB typed profiles are configured but no MongoCredentialResolver bean is available`)→PASS, `aSecretSourceWithoutTheReferencedKeyFailsClosed`. `src/config/architecture/modules.json:81-86`(`adapter-outbound-persistence-mongo` → `application-core`), `src/adapter/outbound/persistence-mongo/build.gradle:32`(`implementation project(':application-core')`), bridge bean `client/MongoProfileClientSettingsAutoConfiguration.java:57`(`@ConditionalOnBean(SecretSourcePort)`·`@ConditionalOnMissingBean(MongoCredentialResolver)`, `MongoCredentialResolver.fromSecretSource(secretSource::resolve)`), `security/MongoCredentialResolver.java:42`(key = `secret://<source>/<name>`의 `<name>`, Redis·httpclient와 같은 규칙). `MongoRegistryPermissionParityTest`(app-bootstrap) PASS. 이유는 W1 커밋 메시지에 적음. |
|
||||
| F-2a | 완료 | `MongoStartupValidatorTest.anInactiveProfileWithAnotherTopologyDoesNotFailStartup`(primary=REPLICA_SET 활성, local=STANDALONE) FAIL(`MongoOperationRejectedException: profile 'local' declares topology STANDALONE but is connected to REPLICA_SET`)→PASS, `MongoPlatformPropertiesTest.aProfileSetWhoseActiveNameMatchesNoneOfItsProfilesIsRefused`. `activeProfile`을 `MongoPlatformSettings` 첫 component로 한 번 바인딩(`autoconfigure/MongoPlatformSettings.java:34,74,83`), validator는 활성 profile만 비교(`autoconfigure/MongoStartupValidator.java:67`), customizer의 raw `getProperty` 제거(`client/MongoProfileClientSettingsAutoConfiguration.java:63,90`). 설정 키가 `ca-skeleton.persistence-mongo.active-profile` → `ca-skeleton.persistence-mongo.platform.active-profile`로 이동(`src/main/resources/config/mongo.yml:14`, EPP `MongoDefaultsEnvironmentPostProcessor.java:47`). env 키 `APP_PERSISTENCE_MONGO_ACTIVE_PROFILE`는 그대로라 `env-keys.yaml`·`.env.example` 변경 없음. |
|
||||
| F-2b | 완료 | `MongoStartupValidatorTest.anInactiveProfileWithAnotherTopologyDoesNotMakeTheInstanceUnready` FAIL(`Expecting value to be true but was false`)→PASS. `autoconfigure/MongoPlatformHealthIndicator.java:89`(활성 profile 하나만 비교), health detail에 `activeProfile` 추가(`:83`). |
|
||||
| F-4a | 완료 | 실제 Mongo lane `MongoBulkMappingLaneTest.aBulkUpdateWritesTheFieldUnderItsMappedName`(`mongoReplicaSetTest`) FAIL(`expected {_id=o-1, st=PAID} but was {_id=o-1, st=NEW, status=PAID}`)→PASS. `MongoBulkExecutor.execute(context, documentType, plan)`로 시그니처 변경, `QueryMapper`/`UpdateMapper`로 entity 매핑(`imperative/bulk/MongoBulkExecutor.java:68,130`). `bulkOps(...)`는 CSOT `withTimeout`을 잃어서 쓰지 않음. |
|
||||
| F-4b | 완료 | 실제 Mongo lane `MongoBulkMappingLaneTest.aBulkUpdateCarriesValuesThatNeedAConverter`(`DomainDocumentId` id + `BigInteger` 값, `findById`로 왕복) FAIL(`CodecConfigurationException: Can't find a codec for ... DomainDocumentId`)→PASS. 크기 한도를 plan 생성자에서 executor로 옮겨 매핑된 문서를 collection codec으로 `RawBsonDocument` 인코딩한 실제 byte로 판정(`MongoBulkExecutor.java:150`), `MongoBulkWritePlan.estimatedEncodedBytes` 삭제. 한도 회귀 테스트는 `MongoBulkOutcomeTest.aPlanOverTheByteCeilingIsRefused`(hermetic, `mappedWrites` 직접 호출)로 이동. |
|
||||
| F-8 | 완료 | 실제 Mongo lane `MongoMigrationLaneTest.aLeaseWriteThatFailsForAnotherReasonIsRaisedRatherThanReportedAsALostRace`(validator로 insert를 121 실패시킴) FAIL(`Expecting actual not to be null`)→PASS. `migration/MongoCollectionMigrationLock.java:116`. 수정 방향(`code == 11000`)보다 조금 넓게 `ErrorCategory.DUPLICATE_KEY`(11000·11001·12582, driver 정의)로 판정 — 같은 패키지 `MongoCollectionMigrationLedger.java:160`과 같은 기준. |
|
||||
|
||||
커밋: W1 `ceddd6d1`(F-1a·F-1b·F-5a·F-5b·F-5c·X2-P1-1b), W2 `3dc06bba`(F-2a·F-2b·F-4a·F-4b·F-8). D 커밋 없음(결정된 삭제 대상 없음).
|
||||
|
||||
검증(최종 상태 `3dc06bba`): `:adapter:outbound:persistence-mongo:check` 통과(test 80, mongoStableContractTest 464, 실패·skip 0), `verifyMongoApiSurface` 통과(271 유지), 실제 Mongo lane `mongoReplicaSetTest` 6·`mongoMigrationTest` 9·`mongoSecurityIntegrationTest` 10·`mongoCompatibilityTest` 2·`mongoFailoverTest` 6·`mongoPerformanceTest` 3 전부 통과, `architectureCheck`·`verifyDependencyLocks` 통과, `:app-bootstrap:verifyEnvKeys` OK, `:app-bootstrap:test --tests '*MongoRegistryPermissionParityTest'` 2건 통과(W1 시점). lockfile 변경 없음(application-core는 외부 의존성 없음).
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `MongoBulkWritePlan.estimatedEncodedBytes` (plan 생성 시 `toJson()` 크기 추정) | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/bulk/MongoBulkWritePlan.java` | `6d27356e` | 매핑 전 값에 codec이 없어 실패(F-4b). 매핑된 문서의 실제 BSON 크기 검사(`MongoBulkExecutor.mappedWrites`)로 대체 |
|
||||
| `MongoCsfleClientFactory.settingsFor`의 `encryptedFieldsMapJson` 인자 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleClientFactory.java` | `6d27356e` | 호출자 JSON을 schema로 쓰던 경로(F-5b). `profile.fields()`에서 생성 |
|
||||
| 설정 키 `ca-skeleton.persistence-mongo.active-profile` | `src/adapter/outbound/persistence-mongo/src/main/resources/config/mongo.yml` | `6d27356e` | `ca-skeleton.persistence-mongo.platform.active-profile`로 이동(F-2a, `MongoPlatformSettings`에 한 번 바인딩). env 키는 그대로 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P12-new-1` (미수정, 코드 읽기로만 확인): bulk 경로가 `access.rawOperations().getCollection(...)`의 raw collection에 `bulkWrite`를 해서, `MongoConsistencyBinder`가 profile별 template에 `setWriteConcern`으로 건 write concern이 적용되지 않는다(Spring `MongoTemplate.getCollection`은 template write concern을 붙이지 않음). 위치 `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/bulk/MongoBulkExecutor.java:91`, write concern 설정 `imperative/MongoConsistencyBinder.java:78`. 고치려면 `ScopedAccess`가 profile write concern을 노출하고 bulk가 `withWriteConcern`을 붙여야 함(`MongoTemplate`에 public getter 없음).
|
||||
- `F-1c`(W5, Javadoc "compile-time impossibility")는 F-1a를 고치면서 같은 파일 Javadoc을 "런타임 스칼라 검사"로 바꿔 사실상 해결(`query/PolicyAwareMongoQueryBuilder.java:16-20`). 현황표 갱신 때 참고.
|
||||
@@ -0,0 +1,19 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| O-5b | 완료 | W1 `50cb2d9e`. `src/build-logic/build.gradle:9-12`, `src/build-tools/build.gradle:10-13`에 `dependencyLocking { lockAllConfigurations(); lockMode = STRICT }`. lockfile 커밋: `src/build-logic/gradle.lockfile`, `src/build-tools/gradle.lockfile`(+ `--write-locks`가 만든 `settings-gradle.lockfile` 2개, main build와 같은 형태). 재생성: `./gradlew -p build-logic dependencies --write-locks`(build-tools도 같음). 재현(FAIL): lockfile의 `spotless-plugin-gradle:8.6.0`을 `8.5.0`으로 바꾸고 `./gradlew -p build-logic compileJava` → `:compileJava FAILED ... Dependency version enforced by Dependency Locking`. 복원 후 `-p build-logic test` 80/80, `-p build-tools test` 35/35 통과. 범위 한계는 P13-new-1 참고. |
|
||||
| O-3a | 완료 | `VerifyNoIgnoredSourcePackagesFunctionalTest.sourceInAnIgnoredPackageOfAnAuxiliarySourceSetFailsTheGate` FAIL(`UnexpectedBuildSuccess` — integrationTest source set 미검사)→PASS, `...sourceInAnIgnoredPackageOfTheSamplePortfolioFailsTheGate` FAIL(`found no Java sources at all; the gate would pass vacuously.` — sample 제외)→PASS. 수정: `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/ArchitecturePlugin.java:196-215` — 모든 project의 모든 `SourceSet.java.srcDirs`를 모으고 build 디렉터리 아래(생성 코드)만 뺀다. sample도 포함. 실제 저장소: main build 4784개 Java 소스 검사(이전 main/test·sample 제외 약 4117개), optional-platforms 341개, 둘 다 OK. |
|
||||
| O-3b | 완료 | `VerifyNoIgnoredSourcePackagesFunctionalTest.gitFailingInsideACheckoutFailsTheGateInsteadOfPassing` FAIL(`UnexpectedBuildSuccess` — 깨진 `.git`에서 git exit 128인데 통과)→PASS. 수정: `VerifyNoIgnoredSourcePackagesTask.java:70,102-150` — checkout 여부를 git 출력이 아니라 상위 디렉터리의 `.git` 존재로 판단(`checkoutRoot`), checkout 안에서 `git check-ignore`가 실행 불가(`IOException`)거나 exit가 0/1이 아니면 `GradleException`. `.git`이 없는 소스 묶음만 기존처럼 이름 규칙만 적용. `rev-parse` 호출과 `GitCommandResult` 삭제. |
|
||||
| O-3c | 완료 | `src/optional-platforms/build.gradle:38-40` — `ci`가 `verifyCleanArchitectureDependencies` 대신 `architectureCheck`(방향 + purity + `verifyNoIgnoredSourcePackages`)에 의존. 재현: `./gradlew -p optional-platforms ci --dry-run`에서 `verifyNoIgnoredSourcePackages` 0회 → 수정 후 포함. `./gradlew -p optional-platforms ci` BUILD SUCCESSFUL, `verifyNoIgnoredSourcePackages: OK — 341 Java sources`. |
|
||||
| NEW-1a | 완료 | 방식: Spring Boot `management.info.env.enabled=true`(`src/app-bootstrap/src/main/resources/config/observability.yml:86-94`, `info.*` 트리만 노출, env 전체 아님)와, 각 capability 모듈이 자기 설정 파일에 `info.capabilities.<name>.enabled: ${<스위치 키>:<auto-config의 matchIfMissing과 같은 기본값>}`을 싣는다. JPA는 `vendor: ${ca-skeleton.persistence.vendor:postgresql}`도 싣는다(vendor=postgresql이면 `JpaDataSourceProfileValidator`가 실제 DB가 PostgreSQL인지 기동 때 확인하므로 선택자=실제 DB). Java 코드 추가 없음, capability 모듈 8개의 yml만 추가: `persistence-jpa.yml`, `persistence-mongo/config/mongo.yml`, `messaging-kafka/.../messaging.yml`, `notification-platform/.../notification.yml`, `graphql/config/graphql.yml`, `cache-redis.yml`, `fileserver-platform/.../fileserver.yml`, `httpclient.yml`. 계약 재정의: `expectedSwitchesOn`(property 키) → `expectedCapabilitiesOn`(info 이름), 최상위 `capabilities` 카탈로그(8개) 추가, `$activationComment`/`$vendorComment` 갱신(`src/config/runtime/compose-profile-contracts.json:741-752`). smoke: `scripts/run-compose-runtime-smoke.sh:434-468` — health 응답 뒤 `/actuator/info`를 받아 ①보고된 capability 이름 집합 = 카탈로그(모듈 누락·info 꺼짐 검출, all-off lane이 빈 목록끼리 비교하는 헛검사가 안 되게) ②enabled=true 집합 = `expectedCapabilitiesOn` ③JPA가 켜졌으면 `vendor`, 아니면 `none` = `expectedPersistenceVendor`. 정적 검사 `scripts/verify-compose-profile-contracts.sh:133-146`(check 6): 카탈로그 밖 이름, JPA 켜짐/꺼짐과 맞지 않는 vendor를 거부. 실제 실행(Docker, qualification 이미지): 재현 — off-local이 persistence-jpa를 기대하도록 바꾼 계약에서 HEAD의 smoke는 `all 1 blocking lanes passed`(결함), 새 smoke는 `off-local: the application reports [] on, the contract expects [persistence-jpa]`로 FAIL. 실제 계약: `--lane off-local` passed(8개 모두 `enabled:"false"`), `--lane local-jpa` passed(`persistence-jpa {enabled:"true",vendor:"postgresql"}`), `--lane off-prod` passed. `--lane local-redis`는 info 검사(`redis enabled:"true"`)를 통과한 뒤 기존 3c 기동 로그 검사에서 실패(P13-new-2). 정적 검사: 실제 계약 18 lane 전부 match, 깨진 사본(카탈로그 밖 이름·JPA 켜짐+vendor none)은 두 lane FAIL. 한계: objectstorage·websocket·gRPC는 모든 lane에서 꺼지고 info에 보고하지 않는다(예전 activation endpoint도 보고하지 않던 셋). `ConfigurationNamespaceContractTest`의 허용 root에 프레임워크 namespace `info` 추가(`app-bootstrap/src/test/.../ConfigurationNamespaceContractTest.java:57-74`). |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `GitCommandResult` record | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/GitCommandResult.java` | `6d27356e` | O-3b에서 git 호출이 exit code를 직접 판정하는 `checkIgnore` 하나로 줄어 쓰는 곳이 없음 |
|
||||
| `git rev-parse --show-toplevel` 호출(checkout 판정) | `VerifyNoIgnoredSourcePackagesTask.java` | `6d27356e` | 실패하면 "checkout 아님"으로 읽혀 게이트가 통과하던 원인. `.git` 존재 판정으로 대체 |
|
||||
| compose 계약 필드 `expectedSwitchesOn` | `src/config/runtime/compose-profile-contracts.json` | `6d27356e` | 읽는 코드가 없던 필드. `expectedCapabilitiesOn`(info 이름)으로 재정의 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- **P13-new-1** (미수정, O-5b의 남은 범위): included build lock은 build-logic·build-tools 자신의 configuration(compile/test)만 잠근다. main build가 plugin을 쓸 때의 settings·root buildscript classpath는 main build에서 따로 해석되고 잠기지 않는다. 증거: `./gradlew buildEnvironment`에서 `project :build-tools`의 `jackson-databind:3.0.2 -> 3.1.5`(lockfile은 3.0.2). 고치려면 `src/settings.gradle`·`src/build.gradle`·`src/optional-platforms/*`에 `buildscript { dependencyLocking { lockAllConfigurations() } }`와 `buildscript-gradle.lockfile`/`settings-gradle.lockfile` 재생성이 필요하고, Spring Boot plugin 버전을 올릴 때마다 main build 설정 단계가 lock 재생성을 요구하게 된다(소유자 판단 필요).
|
||||
- **P13-new-2** (미수정, Redis/P6 영역·NEW-1b에서 드러날 항목): `local-redis` lane은 기동 로그 무음 검사(스크립트 3c)를 통과할 수 없다. lane 자신이 주는 `APP_REDIS_AUTHENTICATION_ANONYMOUS_ACCESS_ACCEPTED=true`와 advanced credential 미설정 때문에 `RedisSdkAutoConfiguration`이 기동 중 WARN 2줄(`Redis is running without credentials ...`, `no advanced credential reference is configured ...`)을 찍는다. 증거: `lane-local-redis` 로그 `local-redis: the startup log is not silent`. capability·info 검사는 통과했다.
|
||||
@@ -0,0 +1,56 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| D-7a | 완료 | D 커밋 `2c7b3d25`(+ 문서 후속 `f8bf7b6d`). `direct/`·`multipart/` 패키지, S3 direct·multipart·presigner·operation resolver, `ObjectOperationResolutionService`·`ObjectOperationEpochRecord`, `Direct*Port` 3개와 그 요청·응답 타입 삭제(main −5,017줄, test −2,221줄). 삭제 전후 `git grep`으로 main 참조 0 확인(남은 언급은 `docs/reviews`·`docs/superpowers`·`docs/evidence`의 과거 기록뿐). 함께 정리: `SelectedObjectStorageProviderFactory`의 `Object` 슬롯 3개·생성자 3개(`config/SelectedObjectStorageProviderFactory.java`), S3 contribution의 presigner/direct/multipart 조립(`s3/S3ObjectStorageProviderContribution.java`), direct/multipart 전용 control record 5종과 codec 분기, `ObjectControlKeyCodec`·`ObjectHandleCodec` 메서드, 상태 enum. `DIRECT_UPLOAD`/`DIRECT_MULTIPART` capability 값은 제거해서, 설정에 남아 있으면 조용히 무시되지 않고 바인딩에서 실패한다. 남은 6개 control record family의 골든 digest는 삭제 전과 같다(`ObjectControlRecordCodecTest.everyRecordFamilyHasAFrozenGoldenEnvelopeDigest` PASS) — 유지되는 레코드의 저장 형식은 바뀌지 않았다. AWS lane `requires`에서 `AwsS3DirectMutationPreconditionsTest` 제거(`src/adapter/outbound/objectstorage/build.gradle:89`), workflow 입력 `run_protected_aws_direct_mutation` 제거(`.github/workflows/object-storage-qualification.yml`) |
|
||||
| D-7b | 완료 | `2c7b3d25`. `RoutingObjectDirectGrantAdapter`, 빈 `ObjectStorageMaintenanceCapabilityConfig` 삭제, `ObjectStorageAutoConfiguration.java:21-25` import 목록에서 제거 |
|
||||
| D-7c | 완료 | `2c7b3d25`. `ObjectPurgeMaintenancePort`와 전용 `ObjectPurgeRequest` 삭제, `ObjectStoragePortContractTest`의 purge 단언을 `scannerAndStagedPublicationAreSeparatePrivilegeSurfaces`로 정리 |
|
||||
| D-1a | 완료 | `StagedObjectPublicationLifecycleTest$Abort.abortIsRejectedWhenTheOperationPublishedAfterAuthorization` FAIL(`Expecting message to be: "published operation cannot be aborted"` — 수정 전엔 데이터를 지운 뒤 terminate에서 다른 예외)→PASS, `…$Abort.rejectedAbortAfterPublicationKeepsThePublishedBytesReadable` FAIL(`ObjectStorageProviderException: local object is absent`)→PASS. `kernel/StagedObjectPublicationKernel.java:299-331`. 수정 방향과 다른 점: 새 상태 `ABORT_IN_PROGRESS`를 만들지 않고 `ABORTED` 자체를 retire 전에 CAS로 기록한다(영속 enum 추가 없음). 같은 fence 역할을 하고, 재시도는 D-2c 경로가 retire를 다시 시도해 crash 창을 메운다 |
|
||||
| D-1b | 완료 | `…$AuthorizeAbort.authorizeAbortIsRejectedOnceTheReferenceIsPublished` FAIL(`Expecting actual not to be null`)→PASS. `kernel/ObjectPublicationHandoffService.java:101-123` |
|
||||
| D-1c | 완료 | `…$FinalizePublication.finalizeAfterAbortWasAuthorizedIsRejected` FAIL(`Expecting actual not to be null`)→PASS. `ObjectFinalizeRequest`에 `handoffFence`·`claimant` 추가(`application-objectstorage/.../request/ObjectFinalizeRequest.java:15-32`), finalize가 활성·일치 lease 요구(`StagedObjectPublicationKernel.java:247-254`, `control/ObjectPublicationHandoffRecord.java:176` `heldBy`). 이미 PUBLISHED인 replay는 lease를 보지 않는다(release 뒤 reconcile 재호출이 계속 REPLAYED). sample 호출부 `sample-portfolio/.../poster/ReconcilePosterImageUploadUseCase.java:106-114` |
|
||||
| D-6a | 완료 | `FilesystemObjectStorageAdapterTest.getRejectsAStoredObjectLargerThanTheReadCeiling` FAIL(`Expecting actual not to be null`)→PASS, `…putRejectsContentLargerThanTheReadCeiling` FAIL→PASS. `FilesystemObjectStorageAdapter.java:33,57,81`. 수정 방향과 다른 점: "설정 최대값" 대신 고정 상한 16 MiB 상수(`ponytail:` 주석). legacy seam(`@Deprecated(forRemoval=true)`)에는 크기 설정 키가 없고, 삭제 예정 seam에 새 설정 키·env 문서를 늘리지 않으려고 상수로 했다. put도 같은 상한으로 막아 "쓴 것은 항상 다시 읽힌다"를 유지 |
|
||||
| D-6b | 완료 | `FilesystemObjectStorageAdapterTest.putReturnsALogicalLocationThatHidesTheServerPath` FAIL(`expected: objectstorage:posters/7/image but was: file:///tmp/junit-…/posters/7/image`)→PASS. `FilesystemObjectStorageAdapter.java:71`(`logicalLocation`). 결함을 굳히던 특성 테스트는 `LegacyObjectStorageBehaviorTest.filesystemReceiptNamesTheKeyInsteadOfTheServerPath`로 바꿈 |
|
||||
| X2-P1-1a | 완료 | `S3ProviderCompositionTest.capabilityConfigResolvesS3CredentialsThroughTheSecretSourcePort` FAIL(`IllegalArgumentException: S3 provider binding is invalid: credential environment references did not resolve completely`)→PASS. `s3/S3ObjectStorageProviderContribution.java:33`(공개 생성자가 `SecretSourcePort`를 받고 `System::getenv` 제거), `config/ObjectStorageCapabilityConfig.java:47-51`(`ObjectProvider<SecretSourcePort>`를 자격 증명을 실제로 풀 때 조회 — secret backend 없는 local-only 조립도 기동됨). 새 설정·env 키 없음 |
|
||||
| D-2a | 완료 | `…$ReleaseClaim.repeatedReleaseByTheSameClaimantReplays` FAIL(`IllegalStateException: publication handoff owner/fence is stale`)→PASS. `ObjectPublicationHandoffRecord.java:121-126`, `ObjectPublicationHandoffService.java:97,125-137`(바뀐 게 없으면 쓰지 않고 REPLAYED) |
|
||||
| D-2b | 완료 | `…$AuthorizeAbort.repeatedAuthorizeAbortForTheSameFenceReplays` FAIL(`IllegalStateException: active or stale handoff cannot authorize abort`)→PASS. `ObjectPublicationHandoffRecord.java:142-147` |
|
||||
| D-2c | 완료 | `…$Abort.repeatedAbortReplays` FAIL(`IllegalStateException: publication terminal transition is invalid`)→PASS. `StagedObjectPublicationKernel.java:317-323`. 수정 방향과 다른 점: provider 호출 전에 바로 REPLAYED를 주지 않고 retire를 한 번 더 시도한 뒤(이미 없으면 정상) REPLAYED — D-1a에서 ABORTED를 retire보다 먼저 기록하므로, 그 사이 crash가 바이트를 고아로 남기지 않게 하려는 것 |
|
||||
| D-3a | 완료 | `…$Stage.stageRetriedAfterACrashBeforeTheStageRecordStagesTheObject` FAIL(`IllegalStateException: stage operation is not uploadable`)→PASS. `StagedObjectPublicationKernel.java:84-127`(DATA_UPLOADED면 저장된 객체를 inspect해서 stage 기록을 다시 만들고, 동시 재시도 충돌은 REPLAYED) |
|
||||
| D-3b | 완료 | `…$FinalizePublication.finalizeSucceedsWhenVerifyWasRetriedAfterACrashBeforeTheOperationAdvanced` FAIL(`IllegalStateException: staged operation is not finalizable`)→PASS. `StagedObjectPublicationKernel.java:192-229`(REPLAYED 경로도 operation을 INTEGRITY_VERIFIED/SCAN_PENDING까지 전진) |
|
||||
| D-3c | 완료 | `…$FinalizePublication.finalizeRetriedAfterACrashInReferencePublicationPublishes` FAIL(`staged operation is not finalizable`)→PASS. `StagedObjectPublicationKernel.java:262-285` |
|
||||
| D-3d | 완료 | `…$FinalizePublication.finalizeSucceedsWhenTheCleanVerdictWasRetriedAfterACrash` FAIL(`staged operation is not finalizable`)→PASS. `config/RoutingObjectScanMaintenanceAdapter.java:92-115` |
|
||||
| D-5 / X1-#8b | 완료 | `LocalDevObjectStorageRecoveryTest.aConcurrentReaderNeverSeesAPartiallyCreatedControlRecord` FAIL(`Expecting empty but was: [ObjectControlCorruptionException: control record is corrupt …]`)→PASS. `filesystem/LocalDevObjectControlStore.java:51-78`(temp 파일에 다 쓰고 `force` 후 `Files.createLink`). 동시성 재현이라 수정 전 FAIL은 확률적이다(300회 create/read 중 부분 파일 읽기 발생). 수정 뒤에는 부분 파일이 구조상 보이지 않는다 |
|
||||
| D-9 | 완료 | `…$Inspect.scanGatedReferenceReportsItsCleanVerdict` FAIL(`Expecting actual: Optional[NOT_REQUIRED]`)→PASS. `config/RoutingObjectReadAdapter.java:53-58`. 이 보고가 참이 되려면 managed publish의 scan 우회를 막아야 해서 P2-new-1을 함께 고쳤다 |
|
||||
| D-10 | 완료 | `ObjectStorageCapabilityAssemblerTest.closeReleasesProvidersInReverseCreationOrderAndKeepsEveryFailure` FAIL(`Expecting message to be: "close failed: a"`)→PASS. `config/ObjectStorageCapabilityAssembler.java:52-82,137-140`(provider를 생성 순서 `List`로 보관, 역순 close, 첫 실패에 나머지 `addSuppressed`; assemble 실패 경로도 같은 helper) |
|
||||
| NEW-6 | 완료 | 결정적 FAIL 재현은 못 했다(부하 의존 간헐 실패, 실패 로그 없음). 원인인 벽시계 예산을 없앴다: 예산 `CallBudget.fromNow(365일)`, `get` 타임아웃은 1분 hang guard로만, bridge마다 새 `ReadOperation`, truncated/oversized 두 테스트로 분리. `adapter/outbound/objectstorage/src/test/.../s3/S3AsyncResponseBodyBridgeTest.java` 3/3 PASS |
|
||||
|
||||
다른 묶음·Wave 행에 미친 영향(이 묶음 ID 아님, 오케스트레이터 참고):
|
||||
- S4-#12(W3): `SelectedObjectStorageProviderFactory`의 `Object` 슬롯·`Class<T>.cast` 제거됨. 남은 건 provider·controlStore·close 3개 필드뿐이라 `record ProviderInstance` 전환은 선택 사항.
|
||||
- S1-#17a(W3): `DirectTransferSessionId`·`PartReceiptToken`(과 `MultipartPartNumber`) 삭제로 식별자 클래스가 줄었다.
|
||||
- S4-#11b(W3): 빈 `RoutingObjectDirectGrantAdapter` 삭제분은 끝남.
|
||||
- TEST-FAKE-ObjectControlStore(W4): `ManagedMultipartCoordinatorTest`·`ObjectMutationResponseLossTest`·`ObjectOperationEpochTest` 등 삭제로 fake 수가 줄었다. 새 `StagedObjectPublicationLifecycleTest`의 `CrashingControlStore`는 장애 주입용 wrapper다(실제 local store 위임).
|
||||
- P13 영역 파일 `.github/workflows/object-storage-qualification.yml`을 고쳤다(삭제된 direct mutation 입력·env 제거). 통합 시 충돌 가능.
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| direct 전송·direct multipart 조정자와 보조 타입 14개(`DirectTransferCoordinator`, `DirectMultipartCoordinator`, `DirectGrantProvider`, `DirectMultipartProvider`, `DirectGrantReplayCache`, `DirectMultipartGrantLedger`, `DirectMultipartCompletionVerifier`, `DirectPartAcknowledgementVerifier`, `DirectPublishedObjectResolver`, `DirectTransferPolicy`, `DirectTransferCorsPolicy`, `DirectTransferSessionRecord`, `DirectGrantGeneration`, `PresignedGrantRedactor`) | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/direct/` | `6d27356e` | main 호출자 0, 조립 경로 없음(소유자 결정 D1·D-7a) |
|
||||
| managed multipart 5개(`ManagedMultipartCoordinator`, `MultipartOperationResolver`, `MultipartPartLedger`, `MultipartUploadPlan`, `MultipartCompletionEvidence`) | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/multipart/` | `6d27356e` | main 호출자 0 |
|
||||
| S3 direct·multipart·presigner·operation resolver 6개(`S3DirectTransferProvider`, `S3DirectMultipartProvider`, `S3ManagedMultipartProvider`, `S3DirectCompletionVerifier`, `S3PresignerFactory`, `S3ObjectOperationResolver`) | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/s3/` | `6d27356e` | 위 조정자만 쓰던 provider. contribution이 만들기만 하고 아무도 꺼내 쓰지 않았다 |
|
||||
| operation 해결·epoch 커널 5개(`ObjectOperationResolutionService`, `ObjectOperationEpochRecord`, `ObjectOperationEpochState`, `DirectGrantSessionState`, `MultipartUploadState`)와 `ObjectOperationStateMachine.advanceDirectGrant/advanceMultipart`, `PendingObjectEffect.Kind`의 DIRECT_*·MULTIPART_* 값, `ObjectRequestFingerprintCodec.OperationKind`의 DIRECT_*·MULTIPART_* 값 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/`, `.../codec/ObjectRequestFingerprintCodec.java` | `6d27356e` | 삭제된 조정자 전용. fingerprint 정규 바이트 형식(`direct-parameter` 줄 포함)은 기존 기록 호환을 위해 유지 |
|
||||
| direct/multipart control record 5종(`ObjectDirectSessionRecord`, `ObjectDirectMultipartSessionRecord`, `ObjectDirectMultipartGrantRecord`, `ObjectMultipartSessionRecord`, `ObjectMultipartPartRecord`)과 codec 분기·`Family` 값, `ObjectControlKeyCodec.{multipart,directSession,multipartPart,directMultipartGrant,operationEpoch}`, `ObjectHandleCodec.{directUpload,multipart,partReceipt}` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/control/`, `.../codec/` | `6d27356e` | 삭제된 조정자만 쓰던 영속 레코드. 이 family를 쓴 조립 경로가 없어 저장된 레코드도 없다 |
|
||||
| capability 값 `DIRECT_UPLOAD`·`DIRECT_MULTIPART` | `ObjectStorageProvider.Capability`, `application-objectstorage/.../model/ObjectCapabilityRequirement.java` | `6d27356e` | 구현이 사라진 뒤에도 설정하면 조용히 무시되는 옵션이 된다(capability 규칙 3) |
|
||||
| `SelectedObjectStorageProviderFactory`의 `managedMultipart/directTransfer/directMultipart` 슬롯·getter·생성자 3개 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/SelectedObjectStorageProviderFactory.java` | `6d27356e` | 테스트만 호출(`S3ProviderCompositionTest`) |
|
||||
| `S3ClientPolicy.{requireSdkCompatibleMpuObjectSize,requirePartCount,requirePartSize}`, `MINIMUM_NON_FINAL_PART_BYTES` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/s3/S3ClientPolicy.java` | `6d27356e` | multipart provider 전용 |
|
||||
| 포트 `DirectObjectUploadPort`·`DirectObjectDownloadGrantPort`·`DirectMultipartUploadPort` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/port/` | `6d27356e` | 구현·소비자 0 |
|
||||
| direct/multipart 요청·응답 타입 15개(`Direct{Upload,Download}Grant`, `DirectUploadCompletion{Request,Receipt}`, `Direct{Upload,Download}GrantRequest`, `Multipart{Start,Complete,Abort}Request`, `MultipartPartAcknowledgement`, `MultipartReceipt`, `MultipartSession`, `PartUploadGrant{,Request}`)과 `ObjectModelSupport.{immutableHeaders,requireExpiry}` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/{model,request}/` | `6d27356e` | 삭제된 포트 전용 |
|
||||
| 식별자 `DirectTransferSessionId`·`MultipartPartNumber`·`PartReceiptToken`, `ObjectIdentitySupport.requirePartReceipt` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/identity/` | `6d27356e` | 삭제된 포트·레코드 전용 |
|
||||
| `RoutingObjectDirectGrantAdapter` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectDirectGrantAdapter.java` | `6d27356e` | private 생성자만 있는 빈 클래스, 참조 0 (D-7b) |
|
||||
| `ObjectStorageMaintenanceCapabilityConfig` | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/ObjectStorageMaintenanceCapabilityConfig.java` | `6d27356e` | 빈 `@Configuration` (D-7b) |
|
||||
| `ObjectPurgeMaintenancePort`, `ObjectPurgeRequest` | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/{port,request}/` | `6d27356e` | 구현 0 (D-7c) |
|
||||
| 삭제 코드 전용 테스트 17개(`direct/` 6개, `multipart/` 2개, `ObjectOperationEpochTest`, `ObjectMutationResponseLossTest`, `S3{DirectMultipart,DirectTransfer,ManagedMultipart}ProviderTest`, `S3ObjectOperationResolverTest`, `MinioDirectTransfer{Contract,Fault}Test`, `S3SdkApiCharacterizationTest.sdkMultipartIntegerPartCountAndMinimumPartBoundariesFailClosed`) | `src/adapter/outbound/objectstorage/src/test/java/dev/caskeleton/adapter/outbound/objectstorage/` | `6d27356e` | 대상 코드 삭제 |
|
||||
| `AwsS3DirectMutationPreconditionsTest`와 workflow 입력 `run_protected_aws_direct_mutation`·env `OBJECT_STORAGE_AWS_DIRECT_MUTATION_ENABLED` | `src/adapter/outbound/objectstorage/src/objectStorageAwsQualificationTest/.../AwsS3DirectMutationPreconditionsTest.java`, `.github/workflows/object-storage-qualification.yml` | `6d27356e` | direct 전송 lane의 별도 권한 검사. direct 코드가 없으니 검사할 대상이 없다 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- **P2-new-1 (고침)** managed `publish`가 SCAN_CLEAN destination에서 scan 없이 게시한다 — `RoutingObjectMutationAdapter.publish`가 INTEGRITY_VERIFIED에서 곧바로 REFERENCE_PUBLISH_IN_PROGRESS로 가고 `requirePolicy`는 요구 수준이 같은지만 봤다. 이제 scan-gated destination이면 거부한다(`config/RoutingObjectMutationAdapter.java:437-443`). `StagedObjectPublicationLifecycleTest$ManagedPublish.managedPublishToAScanGatedDestinationIsRejected` FAIL(`Expecting actual not to be null`)→PASS. D-9의 CLEAN 보고가 참이 되려면 필요했다.
|
||||
- **P2-new-2 (보류, 승인자: 저장소 소유자 결정 필요)** sample abort와 reconcile의 경합에서 intent가 멈춘다 — `AbortPosterImageUploadUseCase`(`sample-portfolio/.../poster/AbortPosterImageUploadUseCase.java:63-81,91`)는 DB에 ABORT_AUTHORIZED를 먼저 커밋한 뒤 저장소에 `authorizeAbort`를 부른다. 그 사이 reconcile이 finalize를 끝냈다면(TX3 전) D-1b로 저장소가 거부하고, `ReconcilePosterImageUploadUseCase`(`:100-102`)는 PENDING이 아닌 intent를 거부해서 게시된 객체가 붙지도 retire되지도 않는다. 수정 전에는 같은 경합이 게시된 바이트를 지웠다(더 나쁨). ABORT_AUTHORIZED + 게시됨을 SUPERSEDED/retire로 수렴시킬지 sample 흐름 결정이 필요하다.
|
||||
- **P2-new-3 (남음)** S3 managed provider `retire`가 항상 UNSUPPORTED를 던진다(`s3/S3ManagedObjectProvider.java:121-125`). S3 profile은 `CONDITIONAL_RETIREMENT`를 주장할 수 있어 destination 컴파일은 통과한다. D-1a 순서에서 S3 abort는 ABORTED를 기록한 뒤 retire에서 실패한다(바이트 잔존, 재시도도 같은 실패). S3는 readiness 근거가 없어 배포 불가라 이번에 고치지 않았다.
|
||||
- 참고(결함 아님): `docs/evidence/object-storage/batch-d-checkpoint.md:46-62`가 삭제된 테스트 클래스 이름을 실행 명령으로 적고 있다. 과거 시점 증거라 손대지 않았다(W5 문서 drift 후보).
|
||||
@@ -0,0 +1,50 @@
|
||||
# P3 notification — 결과
|
||||
|
||||
worktree 브랜치 `worktree-agent-a9bbc66a423c4d1fa`, 커밋 D `38d31b98`, W1 `12adea6e`, W2 `6db6214c`.
|
||||
|
||||
검증: 4개 leaf `check` 통과, `:adapter:outbound:persistence-jpa:jpaPlatformContractTest` 208건·`postgresqlNotificationSchemaActivationIntegrationTest` 8건 통과(실패·skip 0), `architectureCheck` 통과, `:app-bootstrap:verifyEnvKeys` OK, `verifyNotificationApiSurface` 통과. 의존성 변경 없음(`verifyDependencyLocks` 미실행). 새 테스트는 application·adapter 단위 테스트이고 persistence-jpa(P9 leaf)에 PG 테스트를 추가하지는 않았다 — 변경은 기존 포트(`find`/`saveHeldBy`/`transition`)만 쓰고 그 JPA 동작은 위 PG lane이 이미 검증한다.
|
||||
경로는 `src/` 기준 상대 경로를 줄였다: `ntf-adapter/` = `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/`, `ntf-app/` = `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/`.
|
||||
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| S4-#3a | 완료 | D 커밋 `38d31b98`. `provider/{apns,fcm,twilio,webpush,webhook}` main·test 삭제, `SesSuppressionUpdater` 삭제. `ProviderType`은 SES·SMTP만(`ntf-adapter/autoconfigure/ProviderType.java:26-30`). 5종만 쓰던 설정 필드 `topic`·`vapid-public-key`·`callback-signing-secret-ref` 삭제(`NotificationPlatformSettings.java` Provider), `SecretPurpose.VAPID_SIGNING`·`vapid-signing-key`·env 키 2개(`APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY`, `_KEY_ID`)를 `notification.yml`·`.env.example`·`env-keys.yaml`·`secrets-classification.yaml`·`scripts/run-compose-runtime-smoke.sh`에서 삭제. 문서: `docs/notification/{configuration-reference,support-matrix,module-mapping,provider-runbooks}.md`, `composition/notification-platform/README.md`. 새 테스트 `NotificationPlatformSettingsTest.aRemovedProviderTypeFailsStartupAsUnknown`(5종 → "unknown provider type"). API surface 416→379 재승인. `verifyEnvKeys` OK |
|
||||
| B-2e | 완료 | `SnsCertificateCacheTest.aCertificateNotIssuedToSnsIsRefused` FAIL(`Expecting actual not to be null` — CN=sns.test.invalid 인증서의 키를 그대로 반환)→PASS. `ntf-adapter/autoconfigure/NotificationCallbackProviderConfig.java:89`(subject가 `CN=sns.amazonaws.com`/`.com.cn`이 아니면 거부), `:80` 유효기간 검사도 추가(P3-new-2) |
|
||||
| B-6 | 완료 | `JdkNotificationHttpGatewaySecurityTest.aResponseBodyThatNeverEndsIsCutAtTheCapWithoutWaitingForItsEnd` FAIL(`TimeoutException` — 요청 timeout 10초가 지나도 끝나지 않는 body를 끝까지 기다려 JUnit 20초 timeout)→PASS. `ntf-adapter/provider/http/JdkNotificationHttpGateway.java:147-160`(`ofInputStream` + `readNBytes(max)` 후 close, 읽기는 호출 스레드에서 `Supplier`로) |
|
||||
| B-7a | 완료 | `NotificationAdminApplicationServiceTest.aTenantScopedOperatorCannotReconcileAnotherTenantsAttempt` FAIL(`Expecting actual not to be null` — 예외 없이 진행)→PASS. `ntf-app/admin/NotificationAdminApplicationService.java:161-168`(attempt마다 소유 tenant 확인, 배치 중 하나라도 남의 것이면 아무것도 안 함). 없는 attemptId는 reconcile이 아무것도 하지 않으므로 검사 생략 |
|
||||
| B-7b | 완료 | `NotificationAdminApplicationServiceTest.aTenantScopedOperatorCannotChangeAGlobalProviderState` FAIL(`Expecting actual not to be null`)→PASS. `ntf-app/admin/AdminAuthorizationGuard.java:58`(`requireGlobal`), 호출 `NotificationAdminApplicationService.java:305` |
|
||||
| X2-P2-7b | 남음 | 이유: I-5a와 같은 결함·같은 파일(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/ForwardedHeaderClientIpResolver.java`)이고 소유 leaf `adapter:inbound:web`은 P10 범위다. 수정 방향도 갈린다(이 행: trusted proxy 확인 추가 / I-5a: 모드 자체 삭제 + native forward-headers). P3 leaf인 web-notification의 `ExternalRequestUrlResolver`는 이미 trusted proxy일 때만 forwarded 헤더를 쓴다. P10 I-5a 결과로 함께 닫는 것이 맞다. 설정 통합은 I-5b(W3) |
|
||||
| B-3 | 완료 | `NotificationDispatchServiceTest.aTemplateThatCannotRenderFailsTheDeliveryInsteadOfLeavingItClaimed` FAIL(`TemplateVariableValidationException: TEMPLATE_VARIABLES_INVALID`가 dispatch 밖으로 새어 lease가 남음)→PASS. `ntf-app/dispatch/NotificationDispatchService.java:147-163`(render·profile의 재시도 불가 `NotificationException` → 수신자 FAILED + `lastFailureCategory`, lease 해제), `:201` `failBeforeAttempt`(fenced `saveHeldBy`). 수정 방향의 "제출 시 변수 스키마 검증"은 하지 않았다: poison pill을 닫는 것은 dispatch 쪽 처리이고(템플릿 내용·엔진 오류도 여기서 걸림), 제출 검증은 `NotificationSubmissionService` 생성자·조립 변경이 필요한 입력 품질 개선이다 |
|
||||
| B-4a | 완료 | `LeaseRecoveryServiceTest.aDispatchingDeliveryWhoseAttemptsAllCompletedIsRequeued` FAIL(`Expecting actual: [] to contain exactly ... READY_TO_DISPATCH`)→PASS. `ntf-app/dispatch/LeaseRecoveryService.java:123-133`. 수정 방향(recovery에서 retry policy 재적용)보다 작게: recorder가 이미 결과를 수신자 행에 썼고 dispatch의 `RoutingDecisionEngine`이 그 사실(accepted면 stop→COMPLETED, ambiguous면 reconcile)로 다음 단계를 다시 정하므로 READY_TO_DISPATCH로 되돌리면 된다. recovery에 retry policy·profile 의존을 끌어오지 않는다 |
|
||||
| B-4b | 완료 | `ReconciliationServiceTest.anUnsupportedAnswerParksADispatchingDeliveryForAnOperator`, `aFailedAnswerParksADispatchingDeliveryForAnOperator` FAIL(`Expecting actual: [DISPATCHING, Optional[2026-09-20T00:00:00Z]] to contain exactly [RECONCILIATION_REQUIRED, Optional.empty]`)→PASS. `ntf-app/dispatch/ReconciliationService.java:126,132,148`(`parkForOperator`: DISPATCHING인 수신자만 `RECONCILIATION_REQUIRED`·next 없음으로, 이미 끝난 수신자는 그대로 — `anUnsupportedAnswerLeavesAFinishedDeliveryAlone`) |
|
||||
| B-5a | 완료 | `DispatchOutcomeRecorderTest.aLateMatchedCallbackProjectionIsNotOverwrittenByTheRecorder` FAIL(컴파일: `record(attempt, recipient, lease, …)` 시그니처 없음 — lease 인자를 요구하는 테스트)→PASS. fake 투영 저장소가 JPA처럼 수신자 행에 DELIVERED/DEVICE_DELIVERED를 올린다. `ntf-app/dispatch/DispatchOutcomeRecorder.java:122`(투영 뒤 수신자를 다시 읽고 recorder 소유 필드만 갱신) |
|
||||
| B-5b | 완료 | `DispatchOutcomeRecorderTest.aRecorderThatLostItsLeaseWritesNothingToTheRecipient` FAIL(컴파일, 위와 같음)→PASS. `DispatchOutcomeRecorder.java:153` `saveHeldBy(updated, lease)`, 호출 `NotificationDispatchService.java:194`. 빈 결과(lease 상실)면 쓰지 않고, 이어지는 next-step 쓰기도 fenced라 no-op |
|
||||
| B-7c | 완료 | `NotificationAdminApplicationServiceTest.reconcileAsksTheProviderWithNoTransactionOpen` FAIL(`Expecting actual: [true] to contain exactly [false]`)→PASS. `ntf-app/admin/AdminOperationExecutor.java:54`(`executeOutsideTransaction`: claim 트랜잭션 → 본문 트랜잭션 없이 → 결과 저장은 본문이 자기 트랜잭션에서), reconcile만 이 경로(`NotificationAdminApplicationService.java:183`). 실패 시 claim을 `FAILED` 결과로 닫음(`AdminOperationExecutorTest.anOperationThatFailsOutsideTheTransactionCompletesItsClaimAsFailed`) — 안 닫으면 같은 id가 영구 IN_PROGRESS. redrive·suppress·provider state는 DB/메모리 작업뿐이라 기존 단일 트랜잭션 유지 |
|
||||
| B-9a | 완료 | `SmtpNotificationProviderAdapterTest.aNonEmailContactPointFailsBeforeTheCallStarts` FAIL(`Expecting actual throwable to be an instance of ProviderCallNotStartedException but was IllegalArgumentException`)→PASS. `ntf-adapter/provider/EmailRecipients.java`(reveal 실패·비 email → `ProviderCallNotStartedException(CONTACT_POINT_INVALID, INVALID_RECIPIENT)`), SMTP `SmtpNotificationProviderAdapter.java:86`, SES도 같은 결함이라 함께 `SesNotificationProviderAdapter.java:111`. 첨부 open 실패는 이미 `AttachmentUnavailable/IntegrityException`(preDispatch, ambiguous=false)이라 dispatch가 not-submitted로 처리 — 변경 불필요 |
|
||||
| B-9b | 완료 | `NotificationDispatchServiceTest.aDeliveryBlockedByNotBeforeStaysScheduledForThatTime` FAIL(`Expecting Optional to contain: 2026-09-20T01:00:00Z but was empty`)→PASS. `ntf-app/dispatch/DispatchPipeline.java:60`(`Blocked`에 `notBefore`), `DispatchGuardOutcome.Blocked`에 `nextDispatchAt`, `NotificationDispatchService.java:142` |
|
||||
| X1-#6e | 완료 | B-5a·B-5b와 같은 결함. 같은 수정·테스트(`DispatchOutcomeRecorder.java:122,153`) |
|
||||
| S4-#3b | 완료 | `NotificationProviderAssemblyTest.anSesHardBounceIsProjectedRatherThanFailedForWantOfAProjector` FAIL(컴파일: `providerEventProjectorRegistry(AssembledPlatform, List)` 없음 — registry가 빈 bean 목록으로만 만들어지던 구조)→PASS(hard bounce → `DeliveryOutcome.BOUNCED`). 빈 슬롯 유지·연결: `ProviderCallbackAssembler.projector()` 추가, SES는 `SesDeliveryProjector`(`SesProviderCallbackAssembler.java:34`), assembly가 콜백을 만들 때 projector를 `AssembledPlatform.projectors`에 넣음(`NotificationProviderAssembly.java:134`, INGEST_ONLY 포함), registry는 `platform.projectors()` + 선언된 bean(`NotificationPlatformRegistriesConfig.java:46`). `SesSuppressionUpdater`는 소유자 승인 삭제(D)라 연결하지 않았다 — suppression은 `ProviderEventProjectionService`의 `NotificationSideEffectPort` 경로가 이미 처리 |
|
||||
| NEW-8a | 완료 | B-4b와 같은 결함. 같은 수정·테스트(`ReconciliationService.java:148`). 수정 방향대로 `ambiguousAttemptExists`·attempt는 건드리지 않아 redrive는 계속 duplicate-risk 승인을 요구 |
|
||||
| NEW-8b | 완료 | B-4a와 같은 결함. 같은 수정·테스트(`LeaseRecoveryService.java:123`). 방향의 "staleAfter 지나면 reconcile 호출" 대신 requeue: 모든 attempt가 완료라 provider에 물을 것이 없고, dispatch 라우팅이 기록된 결과로 다음 단계를 정한다. `expiredDispatching`이 이미 staleAfter로 거른다 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| APNs provider adapter(4 클래스)와 테스트 | `src/adapter/outbound/notification/src/{main,test}/java/dev/caskeleton/adapter/outbound/notification/platform/provider/apns/` | `6d27356e` | assembler 없음 — 켜면 기동 실패. S4-#3a |
|
||||
| FCM provider adapter(10 클래스)와 테스트 | `…/platform/provider/fcm/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| Twilio provider adapter(9 클래스)와 테스트 | `…/platform/provider/twilio/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| Web Push provider adapter(10 클래스)와 테스트 | `…/platform/provider/webpush/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| Webhook provider adapter(3 클래스)와 테스트 | `…/platform/provider/webhook/` | `6d27356e` | 같은 이유. S4-#3a |
|
||||
| `SesSuppressionUpdater` | `…/platform/provider/ses/SesSuppressionUpdater.java` | `6d27356e` | main 참조 0. suppression은 projection side-effect 경로가 담당. S4-#3a |
|
||||
| `ProviderType.APNS/FCM/TWILIO/WEB_PUSH/WEBHOOK` | `…/platform/autoconfigure/ProviderType.java` | `6d27356e` | 조립할 수 없는 종류. 이제 binding에서 unknown type으로 실패 |
|
||||
| provider 설정 필드 `topic`, `vapid-public-key`, `callback-signing-secret-ref` | `…/platform/autoconfigure/NotificationPlatformSettings.java` (Provider) | `6d27356e` | 삭제된 5종만 읽던 키. capability 규칙 3(동작 안 하는 옵션은 키를 두지 않음) |
|
||||
| `SecretPurpose.VAPID_SIGNING`, 설정 `secrets.vapid-signing-key`·`active-key-ids.VAPID_SIGNING`, env `APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY`·`APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY_ID` | `src/application-notification/…/platform/security/SecretPurpose.java`, `src/composition/notification-platform/src/main/resources/config/module-defaults/notification.yml`, `src/.env.example`, `docs/registries/env-keys.yaml`, `docs/registries/secrets-classification.yaml`, `scripts/run-compose-runtime-smoke.sh` | `6d27356e` | Web Push 삭제로 소비자 0 |
|
||||
| Twilio·FCM·APNs·Web Push runbook 절, support-matrix·module-mapping 행 | `docs/notification/provider-runbooks.md`, `docs/notification/support-matrix.md`, `docs/notification/module-mapping.md`, `docs/notification/configuration-reference.md` | `6d27356e` | 설명 대상 코드 삭제 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P3-new-1` (고침, W1): `ntf-app/admin/AdminAuthorizationGuard.java` `requireTenant`가 어떤 작업이든 거부 시 `AdminAccessDeniedException(SUPPRESS)`를 던졌다 — redrive·reconcile 거부가 SUPPRESS 권한 부족으로 보고됨. 실제 권한을 인자로 받게 고침(`:41`).
|
||||
- `P3-new-2` (고침, W1): SNS 서명 인증서의 유효기간을 확인하지 않았다(`NotificationCallbackProviderConfig.java:80` `checkValidity()` 추가, B-2e와 함께).
|
||||
- `P3-new-3` (안 고침): JDK HttpClient의 요청 timeout은 응답 body 읽기를 덮지 않는다. B-6 재현 테스트의 FAIL이 증거다(요청 timeout 10초가 지나도 body 대기가 끝나지 않아 JUnit 20초 timeout). 상한 전까지 body를 조금씩 흘리는 provider(또는 SNS 인증서 host)는 dispatch 스레드를 무기한 잡을 수 있다. 위치 `ntf-adapter/provider/http/JdkNotificationHttpGateway.java:79-82`(`send` 뒤 `body().get()`). 고치려면 body 읽기에 deadline이 필요하다(예: deadline에 stream을 닫는 타이머). 설계가 필요해 이번 범위에서 제외.
|
||||
- `P3-new-4` (고침, W2): SES adapter도 B-9a와 같은 결함(비 email 연락처·reveal 실패가 ambiguous로 기록). 공용 `EmailRecipients`로 SMTP와 함께 고침.
|
||||
- `P3-new-5` (안 고침): 라우트의 profile runtime이 사라진 경우 `gateway.profile()`이 `IllegalStateException`(`ntf-adapter/dispatch/ProviderRuntimeRegistry.java:50`)을 던져 B-3과 같은 경로(attempt row 전, lease 미해제 → requeue 반복)를 탄다. 설정 drift라 "고쳐질 때까지 재시도"로 볼 수도 있어 FAILED로 닫지 않았다. 판단 필요 시 소유자 결정.
|
||||
- `P3-new-6` (안 고침): dispatch의 guard `Blocked` 전이와 routing stop 전이(`ntf-app/dispatch/NotificationDispatchService.java:138-142`, `applyRoutingStop`)는 lease fencing 없는 `transition`을 쓴다(B-5b와 같은 계열). provider 호출 전 짧은 구간이라 위험은 낮다.
|
||||
@@ -0,0 +1,50 @@
|
||||
# P4 결과 — file server
|
||||
|
||||
- worktree: `/home/donghyeon/workspace/desktop-server-git/clean-architecture-backend-template/.claude/worktrees/agent-a4be05fc0e42cb70c`, 브랜치 `worktree-agent-a4be05fc0e42cb70c`
|
||||
- 커밋: `433bacdb` (W1), `ed2c0929` (W2). D 커밋 없음(P4는 결정된 삭제 없음).
|
||||
- 새 migration: `src/adapter/outbound/persistence-fileserver/src/main/resources/db/migration/jpa/fileserver/V5__fileserver_file_owner.sql` (fileserver stream 버전 5).
|
||||
`applied-migrations.sha256`에는 줄을 추가하지 않았다. 그 테스트(`AppliedMigrationImmutabilityTest`)는 persistence-jpa의 `src/main/resources/db/migration`만 읽고, fileserver migration은 persistence-fileserver leaf에 있다. 줄을 추가하면 `appliedMigrationsKeepTheBytesTheyWereAppliedWith`가 실패한다(아래 P4-new-1).
|
||||
- registry edge 추가: `composition-fileserver-platform -> adapter-outbound-persistence-jpa` (NEW-11, W2 커밋 메시지에 이유).
|
||||
- lockfile: `src/composition/fileserver-platform/gradle.lockfile` 재생성(+12줄). app-bootstrap lockfile은 변화 없음.
|
||||
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| C-2a | 완료 | `FinalizeUploadServiceTest.aQuarantineVerdictSchedulesNoCleanupOfTheStagedBytes` FAIL(`Expecting empty but was: [CleanupItem[... FAILED_VERIFICATION_CONTENT ...]]`)→PASS. `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultFinalizeUploadService.java:272`(REJECTED일 때만 staging cleanup 예약, QUARANTINE은 세션만 terminal) |
|
||||
| C-2b | 완료 | `CleanupServiceTest.aStagingItemForAQuarantinedFileLeavesTheStagedBytesInPlace` FAIL(`Expecting value to be true but was false`)→PASS. `.../cleanup/DefaultCleanupService.java:197`(QUARANTINED면 삭제 없이 done) |
|
||||
| C-5a | 완료 | `CleanupServiceTest.anUploadPastItsExpiryIsMovedToExpired` FAIL(`expected: EXPIRED but was: UPLOADING`)→PASS, `theStagedBytesOfAnExpiredUploadAreReclaimed` FAIL(`Expecting value to be false but was true`)→PASS, W2에서 `anUploadThatExpiredBeforeItsFirstAppendIsExpiredToo` FAIL(`expected: EXPIRED but was: CREATED`)→PASS. `DefaultCleanupService.java:125`(batch 시작 시 만료 열린 세션 terminal → CREATED/UPLOADING/FAILED 레코드 EXPIRED + `EXPIRED_UPLOAD` 예약). 반복 조회로 limit가 막히지 않게 `findExpired`는 terminal 세션 제외: `src/adapter/outbound/persistence-fileserver/.../repository/JpaUploadSessionRepository.java:19`, PG `PostgreSqlFileserverMetadataStoreIntegrationTest.aTerminatedExpiredSessionIsNotListedAgain` PASS |
|
||||
| C-5c | 완료 | `TusProtocolContractTest.aCreateThatDefersItsLengthIsRefusedBecauseTheExtensionIsNotOffered` FAIL(`Status expected:<400> but was:<201>`)→PASS. `src/adapter/inbound/web-fileserver/.../tus/TusRequestParser.java:65`. 기존 `aDeferredLengthUploadIsNeverAutoFinalized`는 이 테스트로 대체 |
|
||||
| C-8a | 완료 | 결정 14. `RoleBasedFileAccessPolicyTest.aCallerWithTheSameRolesIsDeniedAFileSomebodyElseOwns`(READ_METADATA·DOWNLOAD·APPEND·FINALIZE·DELETE·COPY·MOVE 7건), `theSamePrincipalInAnotherTenantIsDeniedTheFile`, `aFileWithNoRecordedOwnerIsDeniedToEveryDataPlaneCaller` 모두 FAIL(`Expecting actual not to be null` = 거부 안 됨)→PASS, `theOwnerIsGrantedEveryDataOperationWithoutAnException` PASS. `src/adapter/outbound/fileserver/.../security/RoleBasedFileAccessPolicy.java:74,86`. 모델: `FileOwner`(`.../api/metadata/FileOwner.java`), `FileRecord.owner`/`FileDescriptor.owner`/`FileRecordDraft.owner`, 생성 시 `context.subject().asOwner()`(`DefaultUploadApplicationService`, copy는 복사한 사람). 저장: `V5__fileserver_file_owner.sql`(`owner_principal_id varchar(256)`, `owner_tenant_id varchar(64)`), `FileEntity`·`FileEntityMapper`·`JpaFileMetadataStore.insert`. PG `aNewRecordKeepsTheOwnerItWasCreatedFor` PASS, `UploadApplicationServiceTest.aCreatedFileIsOwnedByTheCallerInItsTenant` PASS. **기존 행(owner NULL) 처리:** data plane에서는 누구에게도 허용하지 않는다(fail closed). 소유자를 추론할 근거가 없고, 역할 모델상 남의 파일에 대한 조치는 감사되는 관리 plane(force-delete·reverify, descriptor 없음)이 담당하기 때문이다. **ADMIN 예외:** 두지 않는다. 기존 역할 모델이 "admin은 write를 상속하지 않는다"이므로 data plane 연산은 admin 역할이어도 소유자 검사를 받는다. **anonymous read**가 켜진 배포는 전 파일 공개를 선택한 것이라 read 등급에서 소유자 검사를 건너뛴다(기존 의미 유지). **tenant:** subject 속성 `tenant`(`FileAccessSubject.TENANT_ATTRIBUTE`)와 비교한다. web 플랫폼은 아직 tenant를 해석하지 않아(`WebRequestContext`를 만드는 곳 없음) 현재는 양쪽 모두 비어 있고, transport가 속성을 채우면 그대로 적용된다. 문서 `docs/fileserver/security.md` 「Authorization」 |
|
||||
| C-8b | 완료 | `FinalizeUploadServiceTest.aCallerTheFinalizeOperationIsDeniedToPublishesNothing` FAIL(`Expecting actual not to be null`)→PASS. `DefaultFinalizeUploadService.java:109`(digest·검증·publish 전에 FINALIZE 인가, 정책은 생성자 주입 — `composition/.../FileserverUploadServiceConfiguration`) |
|
||||
| C-8c | 완료 | `FileserverAdminServiceTest.aCallerDeniedAdminReadsCannotSeeStorageHealth` FAIL(`Expecting actual not to be null`)→PASS. 새 `FileOperation.ADMIN_READ`(admin 등급, `RoleBasedFileAccessPolicy.java:102`), `DefaultFileserverAdminService.java:206`. `RoleBasedFileAccessPolicyTest.adminReadsNeedTheAdminRoleRatherThanTheReadRole` PASS |
|
||||
| C-3a | 완료 | `FileserverCleanupWorkerTest.aRunReconcilesTheFilesWhoseOutcomeWasLeftOpen`, `aFailingCleanupBatchStillLetsReconciliationRun` — FAIL은 컴파일 실패(`constructor FileserverCleanupWorker ... cannot be applied`, reconciliation을 받을 방법이 없었음)→PASS. 별도 worker 대신 기존 `FileserverCleanupWorker`가 매 회차 cleanup 뒤 `reconcileRecoverable(maxItems)`를 독립 try로 실행(`src/composition/fileserver-platform/.../FileserverCleanupWorker.java`, `FileserverCleanupConfiguration`). 같은 `cleanup.enabled` 스위치를 쓴다(설정 키 추가 없음). recovery queue는 pending 중복을 갱신만 한다(`JpaRecoveryQueue.enqueue`) |
|
||||
| C-3b | 완료 | `FinalizeUploadServiceTest.theContentKeyIsRecordedBeforeThePublishIsAttempted` FAIL(`Expecting Optional to contain a value but it was empty`)→PASS. `DefaultFinalizeUploadService.java:214`(UPLOADED→VERIFYING 전이에 `FileRecordMutation.intendedContentKey`), `UploadContentGateway.newContentKey()`, `FinalizeContentCommand.contentKey`(기존 4인자 생성자 유지), publisher가 그 key로 게시(`AtomicMoveContentPublisher`, `MetadataPointerContentPublisher`). 부수 조치: 검증은 staged bytes를 읽도록 `VerificationRequest.contentKey=empty`(미게시 key로 읽으면 RETRY 고착), 미게시 key의 content 정리는 quota를 회수하지 않음(`DefaultCleanupService.java:275`, `publishedAt` 있을 때만) |
|
||||
| C-3c | 완료 | `FinalizeUploadServiceTest.anAmbiguousPublishIsQueuedForRecovery` FAIL(`... to contain entry PUBLISH_UNCONFIRMED`)→PASS. `DefaultFinalizeUploadService.java:130`(inNew로 recovery 기록 후 재던짐, 기록 실패는 suppressed) |
|
||||
| C-3d | 완료 | NEW-3과 같은 결함. `TransactionPort`에 timeout 옵션이 없어 가장 작은 변경으로 `SpringTransactionPort`의 REQUIRES_NEW template에 30초 설정. `SpringTransactionPortTest.inNewBoundsItsTransactionToThirtySeconds` FAIL(`expected: 30 but was: -1`)→PASS. `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/transaction/SpringTransactionPort.java:62`. 포트 시그니처 변경 없음(구현·fake 수정 불필요). `verifyJpaApiSurface` OK |
|
||||
| C-4a | 완료 | `UploadApplicationServiceTest.cancellingAPublishedUploadQueuesItsContentForReclamation` FAIL(`[CANCELLED_STAGING] to contain [DELETED_READY_CONTENT]`)→PASS. cancel이 `FileRetirement.retire(record, uploadId)`를 쓴다(`DefaultUploadApplicationService.java:265`): content key가 있으면 content 정리도 예약. 409 거부 대신 retire 재사용을 택함(삭제와 같은 DELETE 인가를 이미 거침) |
|
||||
| C-4b | 완료 | `CleanupServiceTest.aCancelledUploadReachesDeletedOnceItsStagingIsReclaimed` FAIL(`expected: DELETED but was: DELETING`)→PASS. `DefaultCleanupService.java:218`(staging 정리와 같은 트랜잭션에서 content key 없는 DELETING→DELETED). quota release는 넣지 않았다: reservation은 upload에 연결되지 않은 scope 단위 TTL 장부이고 만료로 정리된다(`JpaQuotaCommitGateway` 설계 주석) |
|
||||
| C-5b | 완료 | `CleanupServiceTest.aRetiredOrphanIsPurgedFromQuarantine` FAIL(`Expecting value to be false but was true`)→PASS. `CleanupContentGateway.purgeQuarantined` 추가, `DefaultCleanupService.java:243`, `LocalCleanupContentGateway.java:41`(ledger를 다시 확인하는 `OrphanScanPort.purgeQuarantined`에 위임). staging root scan은 하지 않았다(더 작은 수정): staging 객체는 항상 세션이 있고(세션 commit 뒤에만 생성), 이제 모든 세션 끝(cancel·reject·C-5a 만료, CREATED 포함)이 staging 정리를 예약하므로 scan이 찾을 대상은 대기 중인 정리 항목뿐이다. 예외 한 가지는 P4-new-4 |
|
||||
| C-6 | 완료 | `UploadApplicationServiceTest.anAppendToACancelledUploadIsRefusedAsGone` FAIL(`Expecting actual throwable to be an instance of UploadExpiredException`, 실제는 재시도 가능한 lease 충돌)→PASS, `theStatusOfACancelledUploadIsGone` FAIL(`Expecting actual not to be null`)→PASS. `DefaultUploadApplicationService.java:332`(terminal → `UPLOAD_EXPIRED` 410), status도 `requireActiveSession`(`:245`) |
|
||||
| C-7a | 완료 | `LocalAppendEngineTest.aReattachedHandleResumesTheRunningDigestInsteadOfRereadingThePrefix` FAIL(`Expecting Optional to contain a value but it was empty`)→PASS, 보호 테스트 `aRolledBackAppendLeavesTheCachedDigestDescribingOnlyTheSurvivingPrefix` PASS. `src/adapter/outbound/fileserver/.../local/LocalBlockingContentStore.java:61,187,437`(uploadId별 LRU 1024, 복사본으로 넣고 꺼냄, 실패·finalize·discard 시 제거), `StreamingDigest.copy()` |
|
||||
| C-7b | 완료 | `TusProtocolContractTest.theCompletingPatchFinalizesOnTheTransferExecutor` FAIL(`"Test worker" to start with "fs-transfer-"`)→PASS. `TusController.java:180`, draft-12도 동일(`Draft12UploadController.java:151`). 파일 재읽기: C-7a 캐시로 `stagingDigest`가 보통 디스크를 읽지 않으므로 finalize의 전체 읽기는 `verifyStaged` 1회로 줄었다. `stagingDigest` 결과를 `verifyStaged`에 넘겨 그 1회까지 없애는 것은 하지 않았다 — 디스크에서 다시 증명한다는 게시 설계(`ContentPublishVerification` 주석)를 버리게 되고, finalize는 writer lease 없이 실행되기 때문 |
|
||||
| C-9a | 완료 | `TransferAdmissionControllerTest.anExhaustedScopeIsARetryableAdmissionRejection` FAIL(`... to be an instance of TransferAdmissionRejectedException`)→PASS. `src/application-fileserver/.../quota/DefaultTransferAdmissionController.java:61` |
|
||||
| C-9b | 완료 | `UploadApplicationServiceTest.admissionIsCountedPerCallerRatherThanPerNamespace` FAIL(`expected: null but was: QuotaExceededException`)→PASS. `DefaultUploadApplicationService.java:280`(`QuotaScope.ofPrincipal`, create·append). quota 예약은 namespace 그대로. principal 수가 무한하므로 표가 차면 유휴(모든 permit 반환) semaphore를 버린다(`DefaultTransferAdmissionController.java:123`, 조회+획득을 한 lock 안에서): `newCallersStillGetTheirOwnScopeOnceTheTableHasFilledWithIdleOnes` FAIL(`expected: null but was: QuotaEx...`)→PASS. 기존 `scopeSemaphoreRegistryIsBoundedAndOverflowScopesShareConservativeCapacity`는 이 동작과 모순이라 `theScopeRegistryStaysBoundedAsCallersComeAndGo`로 교체. env 설명 갱신(`docs/registries/env-keys.yaml` `..._SCOPE_UPLOAD_PERMITS`, `docs/fileserver/configuration.md`) |
|
||||
| C-11 | 완료 | `Draft12ProtocolTest.aCreationBodyIsStoredAsTheFirstPartOfTheUpload` FAIL(`expected: "abc" but was: ""`)→PASS, `theFinalLengthComesFromUploadLengthRatherThanTheCreationBody` FAIL(`OptionalLong[3] to contain 6L`)→PASS. `Draft12UploadController.java:109,205`(`Upload-Length` 헤더, POST body는 offset 0 append, `Upload-Complete: ?1`이면 finalize). 한계: Content-Length 없는 chunked POST body는 저장하지 않는다 |
|
||||
| S1-#5 | 완료 | `FileserverAdminServiceTest.forceDeletingAFileThatWasNeverPublishedRetiresItCompletely` FAIL(`expected: DELETED but was: DELETING`)→PASS. 세 호출부가 `src/application-fileserver/.../cleanup/FileRetirement.java:40` 하나를 쓴다: `DefaultFileLifecycleService.java:84`, `DefaultFileserverAdminService.java:167`, `DefaultUploadApplicationService.java:265`. `cleanup` 패키지에 둔 이유: 세 호출 패키지가 이미 cleanup을 의존하고 cleanup은 그들을 의존하지 않아 새 패키지 순환이 생기지 않는다 |
|
||||
| S1-lead-6 | 완료 | SQL의 허용 상태 문자열을 없애고 `JpaFileMetadataStore`가 전이표(`FileStateMachine.canTransition(s, DELETING)`)에서 목록을 만들어 파라미터로 넘긴다: `src/adapter/outbound/persistence-fileserver/.../repository/FileTransitionRepository.java:73`, `JpaFileMetadataStore.java:56`. 동작이 바뀐 게 아니라 중복 제거라 FAIL 재현 대상이 없음. PG `aRecordInAStateWithNoDeletingEdgeIsNotMarkedDeleting`(VERIFYING 거부)·기존 `logicalDeleteMovesTheRecordOutOfPublicReadability` PASS |
|
||||
| NEW-3 | 완료 | C-3d와 같은 수정·테스트. `SpringTransactionPort.java:62` |
|
||||
| NEW-11 | 완료 | `src/composition/fileserver-platform/build.gradle`에 `runtimeOnly project(':adapter:outbound:persistence-jpa')`, `src/config/architecture/modules.json` edge 추가, README 갱신(`src/composition/fileserver-platform/README.md` 저장소 줄, `src/README.md:270` 표). `architectureCheck`·`verifyDependencyLocks` 통과. JPA 줄 없이 fileserver만 고른 조립의 기동 테스트는 추가하지 않았다: 모든 테스트 classpath(app-bootstrap integrationTest 포함)에 persistence-jpa가 이미 있어 "없는 조립"을 만들 수 없다. 대신 조립 lane `:app-bootstrap:integrationTest`(fileserver PG 왕복 포함 4건) 통과 |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| tus `Upload-Defer-Length: 1` 수락 분기 | `src/adapter/inbound/web-fileserver/src/main/java/dev/caskeleton/adapter/inbound/web/fileserver/tus/TusRequestParser.java` `declaredLength` | `6d27356e` | C-5c. 길이를 나중에 확정할 PATCH가 없어 끝나지 않는 upload만 만들었다. 이제 400 |
|
||||
| 테스트 `aDeferredLengthUploadIsNeverAutoFinalized` | `src/adapter/inbound/web-fileserver/src/test/java/dev/caskeleton/adapter/inbound/web/fileserver/tus/TusProtocolContractTest.java` | `6d27356e` | 위 분기를 전제로 한 테스트. `aCreateThatDefersItsLengthIsRefusedBecauseTheExtensionIsNotOffered`로 대체 |
|
||||
| 테스트 `scopeSemaphoreRegistryIsBoundedAndOverflowScopesShareConservativeCapacity` | `src/application-fileserver/src/test/java/dev/caskeleton/application/fileserver/quota/TransferAdmissionControllerTest.java` | `6d27356e` | C-9b. 유휴 scope가 overflow로 몰린다는 옛 동작을 단언. `theScopeRegistryStaysBoundedAsCallersComeAndGo`로 대체 |
|
||||
| lifecycle delete·admin forceDelete·cancel의 retire 복사본 | `DefaultFileLifecycleService.delete`, `DefaultFileserverAdminService.forceDelete`, `DefaultUploadApplicationService.cancel` 본문 | `6d27356e` | S1-#5. `cleanup/FileRetirement` 하나로 합침 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- **P4-new-1** (미수정) fileserver migration(`src/adapter/outbound/persistence-fileserver/src/main/resources/db/migration/jpa/fileserver/V1..V5`)은 불변성 테스트가 없다. `AppliedMigrationImmutabilityTest`는 persistence-jpa의 `src/main/resources/db/migration`만 읽는다(`src/adapter/outbound/persistence-jpa/src/test/java/.../migration/AppliedMigrationImmutabilityTest.java:25`). 그래서 V5 줄을 `applied-migrations.sha256`에 넣을 수 없었다(넣으면 그 테스트가 실패). C-10/S2-#11(persistence-fileserver 자체 테스트, W4)과 함께 풀 문제.
|
||||
- **P4-new-2** (미수정) 재조정이 READY를 복원할 때 quota를 commit하지 않는다. `src/application-fileserver/.../recovery/DefaultFileReconciliationService.java` `reconcilePrePublishWithKey`는 VERIFYING→READY 전이만 하고 `QuotaCommitGateway.commit`이 없다. C-3a·C-3b로 이 경로가 실제로 실행되므로, 재조정으로 복구된 파일은 durable quota를 쓰지 않는다.
|
||||
- **P4-new-3** (미수정) `DefaultFinalizeUploadService.advanceToVerifying`의 CREATED 분기가 CREATED→UPLOADED를 시도하지만 전이표에는 CREATED→UPLOADING뿐이라 `IllegalStateException`이 난다(`.../upload/DefaultFinalizeUploadService.java` `advanceToVerifying` 첫 if).
|
||||
- **P4-new-4** (미수정) lifecycle delete(`DefaultFileLifecycleService.delete`)로 진행 중 upload(UPLOADING)를 지우면 레코드는 DELETED가 되지만 세션은 ACTIVE로 남고 staging 정리가 예약되지 않는다. 이후 만료 sweep도 레코드가 DELETED라 staging을 예약하지 않아 staged bytes가 남는다. `FileRetirement`에 upload를 찾는 방법(`StagingUploadLocator`)을 넘기면 풀린다.
|
||||
@@ -0,0 +1,51 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| S7-#4 | 완료 | 삭제 커밋 `9b296c7c`(P5 D). 상수 gate·guard·catalog·invariant·testkit·문자열 ArchUnit 흉내 삭제(아래 「제거된 코드」). 전부 main 호출자 0이었다. `GrpcRawApiImportRule`·`GrpcApplicationBoundaryRules`는 자기 테스트의 합성 입력만 검사하고 저장소 코드를 검사하지 않아서 테스트로 옮기지 않고 삭제했다(inbound→outbound 규칙은 app-bootstrap ArchUnit `INBOUND_ADAPTERS_DO_NOT_DEPEND_ON_OUTBOUND_ADAPTERS`가 이미 검사). `GrpcResolverSafetyPolicy`는 상수 메서드 2개만 삭제. starter의 항상 통과하던 advanced 격리 검사도 함께 제거 `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java:41`. 문서 갱신: `src/grpc/CLAUDE.md`, `src/grpc-advanced/CLAUDE.md`, `docs/runbooks/grpc-advanced-capabilities.md`, `docs/compatibility/grpc-advanced-support-matrix.md` |
|
||||
| K-11a | 완료 | `WebSocketAutoConfigurationTest.clientChannelExecutorsAreBoundedByTheConfiguredQueueCapacity` FAIL(`[(2147483647, false), (2147483647, false)]` ≠ `[(64, true), (64, true)]`)→PASS. inbound·outbound 둘 다 스레드 CPU×2 고정(core=max), 큐 `app.websocket.channel-queue-capacity`(기본 10000, `@Positive`) `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/stomp/WebSocketConfig.java:74,83`, `.../stomp/WebSocketSettings.java:32`. 새 env 키 `APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY`(`docs/registries/env-keys.yaml`, `src/.env.example`), `verifyEnvKeys` 통과. 커밋 `b39d3de0` |
|
||||
| N-3 | 완료 | `GrpcPlatformAutoConfigurationContextTest.enabledPlatformWithoutAnEnvironmentRefusesToStartInsteadOfAssumingLocal` FAIL(`Expecting actual not to be null` — LOCAL 가정으로 기동 성공)→PASS. 기본값 제거 `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformProperties.java:30`, 미설정 violation `.../GrpcPlatformStartupValidator.java:80`. 검증 전 생성되는 reflection 정책 bean은 environment가 없으면 PROD 바닥(비활성)으로 만든다 `.../GrpcPlatformAutoConfiguration.java`(reflection bean). 커밋 `b39d3de0` |
|
||||
| N-4 | 완료 | `GrpcResolverSafetyPolicyTest.aServiceConfigWithRetryThrottlingIsAccepted` FAIL(`credential-shaped field` 위반)→PASS, `aServiceConfigThatTurnsOnRetriesIsRefused` FAIL(`Expected size: 1 but was: 0`)→PASS. 수정 방향과 다른 점: 이 leaf 클래스패스에 JSON 파서가 없고 새로 들이지 않기로 한 leaf라서, service config를 gRPC가 쓰는 파싱된 `Map<String, ?>`로 받게 바꿨다(`NameResolver.Helper.parseServiceConfig`와 같은 형태) `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/discovery/GrpcResolverUpdate.java:17`. top-level 필드 allowlist `.../GrpcResolverSafetyPolicy.java:25,68`, `methodConfig`의 `retryPolicy`·`hedgingPolicy`는 거부(resolver는 catalog를 모르므로 검증 대신 거부) `:89`, `token` 부분일치 정규식 삭제. 커밋 `b39d3de0` |
|
||||
| K-6 | 완료 | `GrpcP1BoundaryWireTest.aSuccessfullyCompletedCallStillRunsTheServiceOnCloseHandler`(실제 Netty, `setOnCloseHandler`) FAIL(`Expecting value to be true but was false`)→PASS, `GrpcExceptionHandlingInterceptorTest.aCancelAfterTheCallClosedStillReachesTheServiceListener` FAIL→PASS. gate는 onMessage/onHalfClose/onReady에만, onCancel/onComplete는 try/catch만 `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcExceptionHandlingInterceptor.java:70,79`. 커밋 `a498ad84` |
|
||||
| K-10b | 완료 | `GrpcAuthenticationInterceptorTest.aThrowingPolicyIsLoggedWithItsTypeAndMethodButNotItsMessage` FAIL(출력 `""`)→PASS. 예외 타입·메서드만 WARN, 메시지(자격 증명 가능)는 남기지 않음 `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationInterceptor.java:44`. 커밋 `a498ad84` |
|
||||
| N-2 | 완료 | `GrpcDeadlineBudgetTest.aBudgetRunsOutAsTimePassesAfterItWasCreated` FAIL(`Expecting value to be true but was false`, sleep 판)→PASS(주입 시계 판), `aDownstreamDerivedLaterGetsOnlyWhatIsLeftThen` 추가. 단조 시계의 절대 deadline + 주입 `LongSupplier` `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/deadline/GrpcDeadlineBudget.java:44,93`. 방향과 다른 점: `remaining(now)` 대신 시계를 주입해 호출부 시그니처를 유지. budget이 살아 있게 되면서 두 번 읽기 경합이 생기는 곳을 한 번 읽기로 고침 `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/resilience/GrpcRetryCoordinator.java:82`, `.../GrpcWaitForReadyValidator.java:39`. 커밋 `a498ad84` |
|
||||
| N-5a | 완료 | `GrpcAdmissionControllerTest.racingCallersNeverGetPastTheConcurrencyAndQueueBounds` FAIL(`expected: 2 but was: 4`)→PASS. 두 카운터를 한 락으로(`tryAdmit`·`promoteFromQueue`·`release` 모두 check-then-act였음) `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/server/GrpcAdmissionController.java:52`. 커밋 `a498ad84` |
|
||||
| N-5b | 완료 | `GrpcCredentialRotationManagerTest.racingRotationsNeverLeaveAnOlderGenerationCurrent` FAIL(`expected: 4L but was: 3L`)→PASS, `aDrainCompletedDuringARotationNeverRevertsTheNewGeneration` FAIL(`expected: 3L but was: 2L`)→PASS. CAS 루프 `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:108`, `completeDrain`은 `updateAndGet` `:126`. 커밋 `a498ad84` |
|
||||
| N-5c | 완료 | `GrpcChannelRuntimeRegistryTest.racingRotationsDrainEveryReplacedRuntimeAndKeepTheNewestCurrent` FAIL(`"2 draining [1, 1]"`, `"3 draining [1, 1]"` 발생)→PASS. install/rotate/draining/retireQuiescent를 registry 락 하나로, drain 목록은 락 안의 `HashMap`/`ArrayList` `src/grpc/grpc-client/src/main/java/dev/caskeleton/grpc/client/GrpcChannelRuntimeRegistry.java:86`. 커밋 `a498ad84` |
|
||||
| N-5d | 완료 | `GrpcServiceHealthRegistryTest.aServiceMarkedServingWhileDrainBeginsNeverReturnsTheInstanceToServing` FAIL(`[DRAINING/DRAINING, DRAINING/UNKNOWN, SERVING/SERVING]`)→PASS. 쓰기 메서드 전부 같은 락 `src/grpc/grpc-admin/src/main/java/dev/caskeleton/grpc/admin/GrpcServiceHealthRegistry.java:50,86`. 커밋 `a498ad84` |
|
||||
| N-5e | 완료 | `GrpcStreamAdmissionConcurrencyTest.aCallerRefusedByTheGlobalBoundLeavesNoTrackedEntry` FAIL(`expected: 1 but was: 2`)→PASS. global 검사를 `computeIfAbsent` 앞으로 `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamAdmission.java:42`. 커밋 `a498ad84` |
|
||||
| N-6a | 완료 | `GrpcSerializedStreamWriterTest.theByteBoundCountsEachPayloadsOwnSize` RED(테스트 컴파일 실패 — `LongSupplier`는 payload를 받지 못함)→PASS. `ToLongFunction<? super T>` `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcSerializedStreamWriter.java:74`. 커밋 `a498ad84` |
|
||||
| N-6b | 완료 | `GrpcSerializedStreamWriterTest.aWriteWhileTheTransportIsNotReadyTellsTheProducerToPause` RED(컴파일 실패 — 결과 값 없음)→PASS. `GrpcStreamWriteResult.ACCEPTED_PAUSE`(queued=true) `.../GrpcSerializedStreamWriter.java:103`. 커밋 `a498ad84` |
|
||||
| N-6c | 완료 | `GrpcSerializedStreamWriterTest.flushStopsWhenTheTransportStopsBeingReady` RED(컴파일 실패 — readiness 인자 없음)→PASS. `flush(BooleanSupplier)`가 메시지마다 ready 확인, 남은 바이트 정확히 차감 `.../GrpcSerializedStreamWriter.java:133`. 커밋 `a498ad84` |
|
||||
| N-7 | 완료 | `GrpcContextBinderTest.wrappedWorkSeesTheSubmittingCallsCancellationOnAnotherThread` FAIL(`Expecting AtomicBoolean(false) to have value: true`)→PASS. `Context.current()` 전체를 캡처해 `captured.wrap(work)` `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/context/GrpcContextBinder.java:97`. 커밋 `a498ad84` |
|
||||
| N-8a | 완료 | 실제 Envoy v1.31 `--mode validate`: 수정 전 `No TLS certificates found for server context`, 수정 후 `configuration ... OK`(임시 자체서명 인증서를 placeholder 경로에 마운트). `GrpcWebCompatibilityTest.theReferenceProxyTerminatesTlsWithACertificate` FAIL→PASS. `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:62`. 커밋 `a498ad84` |
|
||||
| N-8b | 완료 | `GrpcWebCompatibilityTest.theReferenceProxyExposesEveryTrailerThePlatformSends`(`GrpcErrorMapper`·`GrpcValidationInterceptor` 상수와 대조) FAIL(`error-code,error-category`만 있음)→PASS, `theReferenceProxyLetsTheBrowserSendItsDeadlineAndClientHeaders` FAIL→PASS. `envoy.yaml:41,43` |
|
||||
| N-8c | 완료 | `GrpcWebCompatibilityTest.theReferenceRouteLeavesStreamLengthToTheCallersDeadline` FAIL→PASS. route `timeout: 0s` + `max_stream_duration.grpc_timeout_header_max: 0s` `envoy.yaml:34,36`(Envoy validate 통과) |
|
||||
| N-11a | 완료 | `GrpcOperationLedgerRepositoryTest.aConflictWhoseRowVanishedBeforeTheReadIsNotTakenAsOwnership` FAIL(`Expecting actual not to be null`)→PASS. 0행 + 조회 실패면 `IllegalStateException` `src/grpc/grpc-operation-ledger-jpa/src/main/java/dev/caskeleton/grpc/ledger/JpaGrpcOperationLedger.java:58`. PG lane(`integrationCheck`) 18건 통과. 커밋 `a498ad84` |
|
||||
| N-11b | 완료 | 리뷰의 "`sha256:` 형식 검증 안 거침"은 틀림(`GrpcOperationIdentity.java:29`가 검사) — 길이만 고침. `GrpcOperationIdentityTest.aCallerFingerprintWiderThanItsLedgerColumnIsRefused`·`anIdentityWhoseStorageKeyWouldNotFitTheLedgerIsRefused` FAIL(`Expecting actual not to be null`)→PASS. V001 컬럼 폭(caller 256, method 256, hash 80, storage key 512)으로 compact constructor에서 거부 `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/ledger/GrpcOperationIdentity.java:24,40`. migration 변경 없음. 커밋 `a498ad84` |
|
||||
| X1-지도-Admission / in-flight | 완료 | N-5a와 같은 수정. `Semaphore` 대신 한 락: in-flight와 queued 두 카운터를 한 결정에서 함께 봐야 해서 semaphore 두 개로는 원자적으로 안 된다. `GrpcAdmissionController.java:52`, `GrpcAdmissionControllerTest` |
|
||||
| X1-#10a | 완료 | 위와 같음(동시 호출 수 > 한도 테스트 `GrpcAdmissionControllerTest.racingCallersNeverGetPastTheConcurrencyAndQueueBounds`, optional build) |
|
||||
| X2-P1-3b | 완료 | `GrpcSafeActivationTest.theVendorPlatformNamespaceBesideTheAdapterDoesNotFailItsStrictBinding` FAIL(`UnboundConfigurationPropertiesException: The elements [ca-skeleton.grpc.platform.enabled] were left unbound`)→PASS. 어댑터 prefix `ca-skeleton.grpc` → `ca-skeleton.grpc.server` `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcServerSettings.java:17`, `GrpcServerConfig.java`. 어댑터 키는 env-keys registry에 행이 없었다(추가·수정 없음). 갱신: `src/adapter/inbound/grpc/{CLAUDE,README}.md`, `src/README.md:269`(env `CA_SKELETON_GRPC_SERVER_ALLOW_INSECURE_LOCAL`). **오케스트레이터 할 일:** `docs/capability-status.md:42`의 `ca-skeleton.grpc.enabled`·`ca-skeleton.grpc.allow-insecure-local`을 `.server.` 경로로. Wave 3-B(`app.*`)에서도 `app.grpc.server`처럼 벤더 prefix와 형제로 둬야 같은 충돌이 다시 안 생긴다. 커밋 `a498ad84` |
|
||||
| N-9b | 해당 없음(코드 삭제) | P5 목록 밖이지만 D 삭제로 함께 닫힘: `validateAdvancedIsolation`과 `stableModuleDependencies` 파라미터 삭제(`GrpcStableBuildInvariant` 삭제에 따른 것). 커밋 `9b296c7c` |
|
||||
| N-9c | 완료 | P5 목록 밖이지만 D에서 함께 닫힘: runtime 강제를 적던 문장을 build-time만으로 정정 `src/grpc/CLAUDE.md`(Stable 범위 절), `src/grpc-advanced/CLAUDE.md:18-19`. 커밋 `9b296c7c` |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `GrpcStableModuleCatalog`(+`GrpcStableModuleCatalogTest`) | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcStableModuleCatalog.java` | `6d27356e` | leaf 목록을 core-api에 재기술(registry SSOT 중복), main 호출자 0 (S7-#4) |
|
||||
| `GrpcStableBuildInvariant` | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcStableBuildInvariant.java` | `6d27356e` | 상수 반환·항상 빈 set으로만 불림. 격리는 `verifyCleanArchitectureDependencies`가 강제 (S7-#4, N-9b/c) |
|
||||
| `GrpcPlatformStartupValidator.validateAdvancedIsolation` + `stableModuleDependencies` 파라미터 | `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java` | `6d27356e` | 항상 `Set.of()`로 호출돼 항상 통과 (N-9b) |
|
||||
| `GrpcAdvancedModuleGuard.requireStableStarterIsClean`, `advancedModules` | `src/grpc-advanced/grpc-advanced-bootstrap/src/main/java/dev/caskeleton/grpc/advanced/bootstrap/GrpcAdvancedModuleGuard.java` | `6d27356e` | 삭제된 catalog/invariant 위임, main 호출자 0 |
|
||||
| `GrpcApplicationBoundaryRules`, `GrpcRawApiImportRule`, `GrpcServiceAdapterMarker`(+`GrpcApplicationBoundaryRulesTest`) | `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/architecture/` | `6d27356e` | 문자열로 ArchUnit 흉내, 자기 테스트의 합성 입력만 검사. 경계 규칙은 app-bootstrap ArchUnit이 검사 |
|
||||
| `GrpcKotlinCompatibilityGate`, `GrpcKotlinProfile` | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/kotlin/` | `6d27356e` | `supportableHere()` 상수 false, main 호출자 0 |
|
||||
| `GrpcWebCompatibilityGate` | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/web/GrpcWebCompatibilityGate.java` | `6d27356e` | 상수 메서드 + main 호출자 0(`GrpcWebRpcSupport.require`가 같은 규칙) |
|
||||
| `GrpcServletStartupValidator`, `GrpcServletCapabilityMatrix`, `GrpcServletCompatibilityProfile`(+`GrpcServletStartupValidatorTest`) | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/servlet/` | `6d27356e` | Servlet 전송 코드 없이 상수 matrix·gate만 있던 패키지, main 호출자 0 |
|
||||
| `GrpcEdition2024Gate`, `GrpcEdition2026Guard` | `src/grpc-advanced/grpc-advanced-edition/src/main/java/dev/caskeleton/grpc/advanced/edition/` | `6d27356e` | 상수 반환 gate·무조건 throw guard, main 호출자 0 |
|
||||
| `GrpcResolverSafetyPolicy.acceptAfterClose`, `mayCarryBusinessMetadata`; `CREDENTIAL_SHAPED` 정규식 | `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/discovery/GrpcResolverSafetyPolicy.java` | `6d27356e` | 상수 메서드(S7-#4) / 부분일치 정규식이 정상 키를 거부(N-4, W1 커밋) |
|
||||
| `GrpcXdsStartupGuard` + 테스트 리소스 `xds/bootstrap.json` | `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/xds/GrpcXdsStartupGuard.java` | `6d27356e` | 상수 메서드 포함 guard, main 호출자 0 |
|
||||
| `GrpcAdvancedInfrastructureTestkit` | `src/grpc-advanced/grpc-advanced-diagnostics/src/main/java/dev/caskeleton/grpc/advanced/diagnostics/GrpcAdvancedInfrastructureTestkit.java` | `6d27356e` | capability별 인프라 목록 상수, main 호출자 0 (문서 표로 대체) |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P5-new-1` — `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:37`(virtual host `cors`): Envoy v1.31 validate가 `VirtualHost.cors`를 deprecated("will be removed soon")로 경고한다. per-filter `typed_per_filter_config`의 `CorsPolicy`로 옮겨야 한다. 안 고침(N-8d가 이 파일을 W3에서 옮길 때 같이).
|
||||
- `P5-new-2` — `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcMethodName.java`: `parse`는 전체 이름을 256자로 제한하지만 생성자는 service·method를 각각 256자로만 제한해 canonical이 최대 513자가 된다. ledger 쪽은 N-11b에서 막았지만 타입 자체의 두 경로가 다르다. 안 고침.
|
||||
- `P5-new-3` — `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:125` `completeDrain()`이 인자 없이 "지금 draining인 것"을 지워서, 그 사이 새 rotation이 시작한 drain(방금 교체된 세대)을 일찍 끝낼 수 있다. 경합 자체(현재 세대 되돌림)는 N-5b로 고쳤고, 이건 API 문제(`completeDrain(generation)`)라 안 고침.
|
||||
- `P5-new-4` — `src/grpc-advanced/grpc-advanced-{resilience,compat,edition,streaming}/build.gradle`: `api project(':grpc-advanced:grpc-advanced-bootstrap')`를 main이 쓰지 않는다(resilience는 `GrpcXdsStartupGuard` 삭제로 새로 0, 나머지 셋은 원래 0). build 줄과 registry edge 정리는 W3 구조 작업. 안 고침.
|
||||
@@ -0,0 +1,39 @@
|
||||
# P6 결과 — Redis (`adapter:outbound:redis-runtime`, `adapter:outbound:redis-sdk`, `adapter:outbound:cache-redis`)
|
||||
|
||||
worktree 브랜치 `worktree-agent-a6ab0657d876ae6b9`. 커밋: `22f28a3e`(W1), `5761314d`(W2). D 없음.
|
||||
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| NEW-5a | 완료 | W1 `22f28a3e`. `infra/redis-sdk/acl/application-advanced.acl:1`, `infra/redis-sdk/acl/all-accounts.acl:3`에 `+time` 추가(`admin-readonly`는 이미 있음). probe가 `redis.call('TIME')`을 실제 실행: `cache-redis/.../capability/RedisSemanticScriptAclProbe.java:29-38`. 단위 `RedisSemanticScriptAclProbeTest.anAccountDeniedACommandTheScriptsCallFailsStartup[TIME]` FAIL(`Expecting actual not to be null`)→PASS. 실제 Redis `LiveRedisSemanticScriptAclProbeTest.theAdvancedAccountPassesTheStartupProbe`: 새 probe + 옛 ACL에서 FAIL(`ERR ACL failure in script: User ca-skeleton-application-advanced has no permissions to run the 'time' command`) → ACL 수정 후 PASS. 이 클래스를 `cache-redis/build.gradle` `redisTopologyLane` standalone·cluster 필수 클래스에 등록. `infra/redis-sdk/acl/README.md`에 `+time` 이유 기록 |
|
||||
| G-1b | 완료 | NEW-5c와 같은 수정(아래) |
|
||||
| NEW-5c | 완료 | 멱등성 `RedisIdempotencyStoreAdapter.java:132,258,319,356,505`, lease `RedisDistributedLeaseAdapter.java:175,239,368,409`에 `catch (RedisOperationException)` + `!metadata().ambiguousExecution()` → `Unavailable`/`UNAVAILABLE`(lease는 `UNAVAILABLE_BEFORE_SEND`, renew/release는 handle을 ACTIVE로 유지). 테스트: `RedisIdempotencyStoreAdapterTest.aSaturatedScriptLaneRefusesTheClaimAsUnavailable`(FAIL `Indeterminate[...] to be an instance of Unavailable`→PASS), `aSaturatedScriptLaneRefusesOwnerTransitionsAsUnavailable`[markExecutionStarted/renew/complete/markFailed/releaseBeforeExecution](FAIL `expected: UNAVAILABLE but was: INDETERMINATE`→PASS), `RedisDistributedLeaseAdapterTest.aSaturatedScriptLaneRefusesAcquireBeforeSend`/`aSaturatedScriptLaneRefusesInspectBeforeSend`/`aRenewRefusedBeforeSendLeavesTheHandleActive`/`aReleaseRefusedBeforeSendLeavesTheHandleActive`(FAIL `expected: Unavailable[category=UNAVAILABLE_BEFORE_SEND] but was: Indeterminate`→PASS). 현황표 수정 방향의 테스트 제안(`runtime(false)`)은 틀렸다: 그 경우 EVALSHA가 서버까지 가서 NOPERM으로 거부되므로 not-sent가 아니다. 대신 SCRIPT lane을 포화시킨 owner(`RedisRuntimeOwner.borrow`가 `RedisCommandRejectedException`)로 재현했다. openLane 실패 같은 타입 없는 예외는 기존대로 Indeterminate(기존 `anUnreachableRedisIsIndeterminate` 유지) |
|
||||
| S3-#4a | 완료 | 멱등성·lease는 NEW-5c 수정. cache는 현황표 근거("lane 거절도 Indeterminate")가 사실과 다름: cache는 이미 lane 거절을 `DEGRADED_UNAVAILABLE`(=안 보냄)로 돌려준다. 빠진 쪽은 반대 방향이었다 — 보낸 뒤 응답을 잃은 쓰기도 `DEGRADED_UNAVAILABLE`였다. `RedisCacheRegionAdapter.java:241,294,314,328`에 `sent` 플래그를 두어 쓰기 명령을 보낸 뒤의 실패는 `INDETERMINATE`, 그 전(lane 거절·연결·generation 조회)은 `DEGRADED_UNAVAILABLE`. 테스트 `RedisCacheRegionAdapterTest.aWriteWhoseReplyWasLostIsIndeterminate`/`anInvalidationWhoseReplyWasLostIsIndeterminate`/`aRegionInvalidationWhoseReplyWasLostIsIndeterminate` FAIL(`expected: INDETERMINATE but was: DEGRADED_UNAVAILABLE`)→PASS, 가드 `aWriteThatFailedBeforeItsSetWasSentDegrades` PASS |
|
||||
| G-1c | 완료 | `redis-runtime/.../config/RedisHealthContributor.java:108`: borrow 거부(`RedisCommandRejectedException`)는 owner가 OPEN이면 `saturated`(reachable=true, UP), 아니면 `shutting-down`. `RedisHealthContributorTest.aSaturatedLaneIsLoadNotAnOutage` FAIL(`[false, "unreachable"]` ≠ `[true, "saturated"]`)→PASS. 트레이드오프(Redis가 멈춰 lane이 계속 가득 차면 saturated로 보임)는 클래스 javadoc에 기록 — 해당 요청은 timeout 후 fail-closed |
|
||||
| G-2a | 완료 | `RateLimitScripts.java:55`(fixed-window `start`/`count` 두 필드 덮어쓰기), `:90`(sliding-counter `start`/`cur`/`prev` 회전), `:36-44` 주석을 실제 동작(히트마다 PEXPIRE, 상태 크기 고정)으로 수정. in-memory fake(`redis-runtime` testFixtures `InMemoryRedisCommandGateway` fixedWindow/slidingCounter)도 같은 레이아웃으로. 실제 Redis `LiveRedisSemanticPortsTest.windowCounterStateDoesNotGrowAcrossSkippedWindows`[FIXED_WINDOW, SLIDING_COUNTER] FAIL(`expected: 1L but was: 4L`)→PASS. 배포 시 기존 per-window 필드 키는 카운터가 한 번 리셋되고 옛 필드는 늘지 않은 채 TTL로 사라짐 |
|
||||
| G-3a | 완료 | `RedisDistributedLeaseAdapter.java:169`: status 2 replay handle은 `observedValidityOf(reply.remainingMillis())`. `RedisDistributedLeaseAdapterTest.aReplayedAcquireKeepsOnlyTheServersRemainingTtl` FAIL(`30S to be less than or equal to 10S`)→PASS. 소유자 결정 8대로 lease 포트 유지 |
|
||||
| G-3b | 완료 | `RedisDistributedLeaseAdapter.java:148`(tryAcquire), `:341`(renew): `localValidityOf`를 `owner.borrow` 전에 호출, IAE는 호출자에게 전파. `aTtlWithinTheDriftBudgetIsRejectedBeforeReachingRedis`·`aRenewTtlWithinTheDriftBudgetIsRejectedBeforeReachingRedis`(FAIL `Expecting actual not to be null`→PASS), `aTtlWithinTheDriftBudgetLeavesTheResourceFree`(FAIL: `Owned[...]` to be an instance of `Absent`→PASS) |
|
||||
| G-9a | 완료 | `RedisSemanticFailureLogger.java:28,58`: once-per-JVM `Set` → key별 마지막 WARN 시각 맵, `WARN_INTERVAL`(1분)마다 다시 WARN. 테스트용 package-private `report(..., nowNanos)`. `RedisSemanticFailureLoggerTest.aContinuingFailureWarnsAgainOnceTheWindowHasPassed` FAIL(`Expected size: 2 but was: 1`)→PASS |
|
||||
| G-9b | 완료 | `RedisSemanticFailureLogger.java:39`: `ExecutionException`/`CompletionException` cause를 풀어 기록. `aWrappedFailureIsReportedByItsCause` FAIL(`expected "IllegalStateException" but was "ExecutionException"`)→PASS |
|
||||
| G-10a | 완료 | `RedisSemanticScriptAclProbe.java:29-38`: probe key에서 `TIME`→`HSET`→`PEXPIRE`→`HGET`→`DEL`을 실행하고 읽은 값이 쓴 값과 같을 때만 `{1}`. `anAccountDeniedACommandTheScriptsCallFailsStartup`[HSET/PEXPIRE/HGET/DEL] FAIL→PASS. 실제 Redis standalone·cluster에서 `LiveRedisSemanticScriptAclProbeTest` 2건 PASS. 테스트 ACL `+time`은 NEW-5a(W1)에서 추가 |
|
||||
| G-10b | 완료 | `RedisCorrectnessRoles.java:71` `anyScriptRoleSelected`(idempotency/rate-limit/lease), `RedisSdkAutoConfiguration.java:296`: 스크립트 role이 선택되면 `redisRequired`가 SCRIPT lane에서 `SCRIPT LOAD`+`EVALSHA`(`return 1`, key `<namespace>:probe:{health}:script`)도 확인(`RedisHealthContributor.java:92`). 실제 Redis `LiveRedisCompositionTest.aBrokenAdvancedAccountTakesRequiredRedisDown` FAIL(`expected: DOWN but was: UP`)→PASS, `aWorkingAdvancedAccountKeepsRequiredRedisUp` PASS. 단위 `RedisHealthContributorTest.aScriptLaneItsAccountCannotRunIsUnreachable` PASS |
|
||||
| S6-#6b | 완료 | 두 키 모두 읽히고 있었다(web `EdgeRateLimitTransportSettings`가 `app.rate-limit.*`, cache-redis `RedisRateLimitConfig`가 `ca-skeleton.capabilities.rate-limit.default-policy-id`). 소유자 결정 16(`app.*` 통일)에 맞춰 `app.rate-limit.default-policy-id` 하나만 남김: `cache-redis.yml:65` 줄과 `RedisCapabilitySettings.RateLimit.defaultPolicyId` 삭제, `RedisRateLimitConfig.java:34,60`이 `app.rate-limit.default-policy-id`로 검증. env 키 `APP_RATE_LIMIT_DEFAULT_POLICY_ID`는 그대로(`env-keys.yaml`·`.env.example` 변경 없음). `RedisCapabilityCompositionTest.aDefaultPolicyTheLimiterDoesNotHaveIsRefusedAtStartup` FAIL(`Expecting actual not to be null`)→PASS |
|
||||
| NEW-5b | 완료 | `LiveRedisSemanticPortsTest.java:193`: token-bucket adapter 시계 `Clock.offset(+1h)` → `Clock.systemUTC()`. `tokenBucketWithNonDivisibleRefillUsesIntegerExpiry` FAIL(W1 후에도 `AssertionError at :194`)→PASS. 기존 실패 4건(`theIdempotencyStoreClaimsOnceUnderTheAdvancedAccount`, `idempotencyLeaseExpiryUsesRedisTimeAcrossSkewedCallers`, `theRateLimiterEnforcesUnderTheAdvancedAccount`, `tokenBucketWithNonDivisibleRefillUsesIntegerExpiry`) 모두 PASS: 앞의 3건은 NEW-5a ACL, 마지막은 NEW-5b |
|
||||
|
||||
집계: 완료 14 / 해당 없음 0 / 보류 0 / 남음 0.
|
||||
|
||||
### 검증 (worktree, `--max-workers=2`)
|
||||
- `:adapter:outbound:redis-runtime:check :adapter:outbound:redis-sdk:check :adapter:outbound:cache-redis:check` — BUILD SUCCESSFUL. test: runtime 49/49, sdk 312/312, cache-redis 100/100.
|
||||
- `redisTopologyTest` standalone(redis 7.4, 새로 띄운 컨테이너, ACL 파일 기동 시 로드): runtime 7/7, sdk 14/14, cache-redis 12/12(`LiveRedisSemanticPortsTest` 10, `LiveRedisSemanticScriptAclProbeTest` 2). 시작 전 기준선: cache-redis 8건 중 4건 실패.
|
||||
- `redisTopologyTest` cluster(infra/redis-sdk/cluster, 7100): runtime 7/7, sdk 18/18, cache-redis 12/12.
|
||||
- `architectureCheck :app-bootstrap:verifyEnvKeys` — BUILD SUCCESSFUL.
|
||||
- sentinel·tls lane은 이 머신에서 실행하지 않음(sentinel은 host network 다중 노드, tls는 cache-redis가 선언하지 않는 lane). `LiveRedisCompositionTest`의 새 2건은 sentinel lane에도 태그돼 있다.
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| 설정 키 `ca-skeleton.capabilities.rate-limit.default-policy-id` (+ `RedisCapabilitySettings.RateLimit.defaultPolicyId` getter/setter) | `src/adapter/outbound/cache-redis/src/main/resources/config/module-defaults/cache-redis.yml`, `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/capability/RedisCapabilitySettings.java` | `6d27356e` | S6-#6b: 같은 env 키에 두 설정 키가 묶여 있었다. `app.rate-limit.default-policy-id` 하나로 통일 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P6-new-1` (고침, W2): `src/adapter/outbound/cache-redis/README.md` 「Useful focused checks」가 `./gradlew :app-bootstrap:test --tests '*RedisSemanticScriptAclProbeTest'`를 안내했지만 그 테스트는 cache-redis leaf에 있다. `:adapter:outbound:cache-redis:test`로 수정. 같은 README의 probe 설명(`return {1}`)도 현재 동작으로 갱신.
|
||||
- `P6-new-2` (미수정, 판단 필요): `IdempotencyExecutor`(application-core)는 `complete`가 `UNAVAILABLE`이면 곧바로 `IdempotencyUnavailableException`을 던진다(`IdempotencyExecutor.java:228`). 이번 수정으로 SCRIPT lane 포화 시 complete가 `INDETERMINATE`(재조정 경로) 대신 `UNAVAILABLE`을 받으므로, 효과는 이미 일어났는데 레코드는 EXECUTING으로 남고 호출자는 unavailable 오류를 받는다. 포트 의미상 `UNAVAILABLE`(아무것도 안 바뀜)이 맞는 분류이고, 포화 상태에서는 재조정 inspect도 같은 lane이라 실패하므로 결과는 이전과 사실상 같다. executor가 complete `UNAVAILABLE`을 재시도/재조정할지는 application-core 정책 결정 — 승인자: 저장소 소유자 결정 필요.
|
||||
@@ -0,0 +1,33 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| A-1a | 완료 | `FailOpenDependencyLoggerTest.failureLogKeepsOnlyTheExceptionTypeAndDropsTheRecipientAndWebhookUrlInItsMessage` FAIL→PASS (FAIL: `error="RuntimeException: 550 rejected alice@example.com via https://hooks.slack.com/services/T000/B000/XXXX"`는 `error="RuntimeException"`를 포함하지 않음). `src/adapter/outbound/support/src/main/java/dev/caskeleton/adapter/outbound/support/FailOpenDependencyLogger.java:40-51` — `error="{}"`에 `getSimpleName()`만 넣음. 커밋 `9a05d686` (W1) |
|
||||
| A-1b | 완료 | 같은 테스트(`FailOpenDependencyLoggerTest.java:64-79`)가 예외 메시지에 `alice@example.com`·`https://hooks.slack.com/services/...`를 넣고 렌더된 로그에 둘 다 없음을 단언한다. 수정 전 FAIL 확인. 커밋 `9a05d686` |
|
||||
| TEST-F-2c | 완료 | `RoutingNotifierTest.failingProvider`가 `"POST " + WEBHOOK_URL + " rejected " + n.recipient()`를 던진다(`RoutingNotifierTest.java:54,134`). `failOpenProviderLogsFailureWithProviderIdAndNoPii`·`piiNeverReachesLogOnSendFailure`가 수신자(`alice@example.com`)와 webhook URL이 로그에 없음을 단언한다. 수정 전 둘 다 FAIL(`not to contain: "alice@example.com"`) → PASS. `FailOpenDependencyLoggerTest` 쪽은 A-1b. 같은 결함이 있던 `NotificationAdapterTest.failingProvider`도 수신자를 메시지에 넣게 고쳤다(`NotificationAdapterTest.java:80`, 두 테스트 FAIL→PASS). 커밋 `9a05d686` |
|
||||
| A-7a | 완료 | `ValidatedIntegrationEventTest.envelopeHashThatIsNotTheSha256OfTheEnvelopeBytesIsRefused` FAIL(`Expecting actual not to be null`)→PASS. DB 복원 경로는 `OutboxStoreAdapterTest.claimBatchRefusesACanonicalRowWhoseStoredEnvelopeHashIsNotItsBytesHash`가 PASS(`invalid canonical outbox metadata…` + 원인 메시지 확인). 코드: `src/application-core/src/main/java/dev/caskeleton/application/messaging/event/ValidatedIntegrationEvent.java:85-89`. 계산은 새로 만든 `Sha256.of(byte[])`(`src/application-core/src/main/java/dev/caskeleton/application/messaging/contract/Sha256.java:21-29`)로 한다. 임의 해시로 이벤트를 만들던 테스트 픽스처 5곳을 `Sha256.of(envelope)`로 바꿨다(application-core 1, messaging 2, persistence-jpa 2). 커밋 `3a39b6b5` (W2) |
|
||||
| A-7b | 완료 | `ValidatedIntegrationEventTest.correlationIdLongerThan128CharactersIsRefused`·`causationIdLongerThan128CharactersIsRefused` FAIL→PASS. 경계값 테스트 `correlationIdOf128CharactersIsAccepted` PASS. `ValidatedIntegrationEvent.java:36-37` `{0,127}` — outbox `correlation_id`·`causation_id` varchar(128)과 같다. 커밋 `3a39b6b5` |
|
||||
| A-8b | 완료 | `IdempotencyExecutorTest.aStoreFailureWhileRecordingTheActionFailureIsSuppressedUnderIt` 3건(thrown / effect unknown / retryable no effect) FAIL(`IllegalStateException: store unavailable … to refer to the same object`)→PASS. `src/application-core/src/main/java/dev/caskeleton/application/idempotency/IdempotencyExecutor.java:197-219,273-289` — `markFailed` 호출 세 곳을 `recordFailure` 하나로 모았다. store 예외는 원래 예외에 `addSuppressed`로 붙는다. 현황표는 `preserveUnknown` 두 곳만 적었지만 `RetryableNoEffect` 경로도 같은 결함이라 함께 고쳤다. 커밋 `3a39b6b5` |
|
||||
| X1-#1d | 남음 | 이유: E-5a·E-5b와 같은 변경이다(같은 SQL, `PostgreSqlOutboxClaimRepository`·`H2OutboxClaimRepository`, 새 migration). P9 W2가 이미 작업 중이다 — P9 worktree `agent-adbb19427d5d1740b`의 미커밋 `PostgreSqlOutboxClaimRepository`에 canonical `(tenant_scope, aggregate_type, aggregate_id)` + `(aggregate_sequence, event_index)` gate가 들어가 있다. 여기서 따로 구현하면 cherry-pick 충돌과 migration 번호 중복이 생긴다. 통합 때 P9의 E-5a·E-5b 결과로 함께 닫는다 |
|
||||
| S4-#4a | 완료 | `SmtpProviderRuntimeAssemblerTest.theAssembledProfileDeclaresTheAdaptersOwnCapabilities` FAIL(`maxPayloadBytes=26214400` vs `25000000`)→PASS. assembler에 있던 capability 사본 `capabilities()`를 지우고, snapshot이 SES처럼 `adapter.capabilities()`를 쓴다: `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/autoconfigure/SmtpProviderRuntimeAssembler.java:108,115-134`. 값은 어댑터 쪽(25,000,000 B, 1일) 하나로 정했다. P3가 바꾼 테스트 `profile()` 줄은 건드리지 않았다. 커밋 `3a39b6b5` |
|
||||
| S4-#14a | 완료 | `ProviderRuntimeStateTest.anOperatorStateDoesNotLetResumeClearAnAuthenticationFailure`(DISABLED·DRAINING) FAIL→PASS. `aLateAuthenticationFailureDoesNotOverwriteAnOperatorState`(DISABLED·DRAINING) FAIL(`expected DISABLED but was AUTHENTICATION_FAILED`)→PASS. 전이 규칙은 `ProviderRuntime.moveTo` 한 곳에 있다(`src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/dispatch/ProviderRuntime.java:229-255`). AUTH_FAILED는 rotation(새 runtime)으로만 벗어나고, DISABLED/DRAINING은 인증 실패로 덮이지 않는다. `markAuthenticationFailed`가 이제 적용 여부를 boolean으로 돌려준다. `RegistryProviderRuntimeControl.java:36`은 그 값을 그대로 반환한다(전에는 항상 true). notification API surface(type 목록)는 바뀌지 않았다(`verifyNotificationApiSurface` 통과). 커밋 `3a39b6b5` |
|
||||
| L-7a | 완료 | 실제 배포 yml을 읽는 `ManagementActuatorSecurityContractTest.applicationYmlExposureIncludePinsAllowlistExactly`·`applicationYmlPinsShowDetailsNeverAndShutdownDisabled` FAIL→PASS. `ActuatorSecurityHttpTest.loggersEndpointIsNotExposed`(인증된 사용자도 404)·`actuatorLinksChallengeUnauthenticatedCallerWith401`(D3 401 확인 대상을 `/actuator` 링크로 옮김) PASS. 변경: `src/app-bootstrap/src/main/resources/config/observability.yml:36`(`include: health,prometheus,info`), `:44`(`show-details: never`), `ManagementSecurityConfig.java:33-37`(loggers `denyAll` 규칙 삭제). `src/app-bootstrap/README.md` 해당 절도 고쳤다. P10이 바꾼 `observability.yml:151` 줄은 건드리지 않았다. 커밋 `3a39b6b5` |
|
||||
| L-8a | 완료 | `SampleSchemaOwnershipDefaultsTest.sampleDefaultsLeaveTheSchemaToFlyway[spring.flyway.out-of-order]` FAIL(`"true"`)→PASS. `src/sample-portfolio/src/main/resources/application.yml:45` `out-of-order: false`. 커밋 `3a39b6b5` |
|
||||
| L-8b | 완료 | 같은 테스트 `[spring.jpa.hibernate.ddl-auto]` FAIL(`${APP_DATASOURCE_DDL_AUTO:update}`)→PASS. `application.yml:53` `${APP_DATASOURCE_DDL_AUTO:validate}` — env registry 기본값 `validate`와 같아졌다. env 키 변경은 없다(`verifyEnvKeys` 통과). 커밋 `3a39b6b5` |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `SmtpProviderRuntimeAssembler.capabilities()` (SMTP capability 사본) | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/autoconfigure/SmtpProviderRuntimeAssembler.java` | `6d27356e` | 어댑터 `capabilities()`와 값이 달랐다(S4-#4a). 이제 snapshot이 어댑터 값을 쓴다 |
|
||||
| actuator `loggers` 노출과 `POST`/`DELETE /actuator/loggers/**` `denyAll` 규칙 | `src/app-bootstrap/src/main/resources/config/observability.yml`, `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/management/security/ManagementSecurityConfig.java` | `6d27356e` | actuator 체인에 인증 수단이 없어 어떤 자격증명으로도 도달할 수 없었다(L-7a) |
|
||||
| `IdempotencyExecutor.preserveUnknown` | `src/application-core/src/main/java/dev/caskeleton/application/idempotency/IdempotencyExecutor.java` | `6d27356e` | `recordFailure`로 대체했다(A-8b) |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P7-new-1` — `src/adapter/outbound/notification/src/test/java/dev/caskeleton/adapter/outbound/notification/core/NotificationAdapterTest.java:65-82`: `RoutingNotifierTest`와 같은, 절대 실패하지 않는 PII 단언이 있었다(`"provider-failure"`). 고쳤다(W1 `9a05d686`).
|
||||
- `P7-new-2` — `IdempotencyExecutor`의 `RetryableNoEffect` 경로도 `markFailed`가 예외를 던지면 원래 action 예외를 잃었다. A-8b와 함께 고쳤다(W2 `3a39b6b5`).
|
||||
- `P7-new-3` — `src/sample-portfolio/src/main/resources/db/sample-migration/V2__work_log.sql:26-27`의 주석은 "local dev relies on ddl-auto=update"라고 적혀 있다. 실제로는 `SamplePostgreSqlPersistenceConfig.sampleMigrationStrategy`가 sample schema를 migrate한다. 이미 적용된 migration이라 파일 바이트는 바꾸지 않았다(고치지 않음, Wave 5 문서 정리 후보).
|
||||
- `P7-new-4`(다른 묶음과 겹치는 부분) — L-7a로 `show-details: never`가 되면 `show-components`도 따라서 never가 된다. 그러면 `/actuator/health` 응답에 component가 나오지 않는다. P13 `NEW-1a`(compose smoke가 켜진 capability를 확인)는 health component 대신 `info` 경로를 써야 한다.
|
||||
|
||||
## 검증 (이 worktree, `--max-workers=2`)
|
||||
- `:application-core:check :adapter:outbound:support:check :adapter:outbound:notification:check :adapter:outbound:messaging:check :adapter:outbound:persistence-jpa:check :app-bootstrap:check :sample-portfolio:check` — BUILD SUCCESSFUL. unit test: application-core 214, support 29, notification 399(skip 1), messaging 41, persistence-jpa 477, app-bootstrap 452(skip 5), sample-portfolio 285. 실패 0
|
||||
- `:app-bootstrap:integrationTest`(4) `:sample-portfolio:integrationTest`(49, Testcontainers PostgreSQL) `:sample-portfolio:systemTest`(3) `architectureCheck`(app-bootstrap architectureTest 180 포함) `:app-bootstrap:verifyEnvKeys` — BUILD SUCCESSFUL. 실패 0
|
||||
- `:adapter:outbound:notification:verifyNotificationApiSurface` — 통과
|
||||
@@ -0,0 +1,31 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| J-8 | 완료 | `runtime/GraphQlDocumentAuthorizationHandlerTest.aProtectedFieldOnARenamedRootTypeIsStillDenied`(query·mutation 2건), `aContextWithoutASchemaIsRefusedInsteadOfGuessingRootNames` FAIL(`Expecting actual not to be null` — 거부 없이 통과) → PASS. root 이름을 `context.schema().getQueryType()/getMutationType()/getSubscriptionType()`에서 읽고, schema나 해당 root가 없으면 `IllegalStateException`(→ INTERNAL_ERROR, fail-closed). `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlDocumentAuthorizationHandler.java:68,87`. 커밋 `0392d8c9` |
|
||||
| J-2 | 완료 | `cost/GraphQlFragmentReachabilityTest.typenameIsNotTreatedAsIntrospection`(3건) FAIL(`selectsIntrospection`이 true) → PASS, systemTest `runtime/GraphQlPlatformExecutionPathTest.typenameIsAnsweredWhenTheClientProfileForbidsIntrospection`(introspection 금지 profile + `{ _health __typename }`) FAIL(`GRAPHQL_DOCUMENT_SHAPE_REJECTED`/`INTROSPECTION` 에러) → PASS. `__schema`/`__type`만 차단. `.../cost/GraphQlDocumentShapeAnalyzer.java:50,221`. 커밋 `aa5f4d90` |
|
||||
| J-3a | 완료 | `error/GraphQlExceptionResolverTest.aMaskedFailureIsLoggedOnceAtErrorWithItsExecutionId` FAIL(`Expected size: 1 but was: 0`) → PASS. 마스킹 분기에서 `graphql failure masked as INTERNAL_ERROR (executionId=…)` + 예외를 ERROR 한 번. 모든 경로가 이 분기를 거치게 된 것은 S5-#6a 수정 덕분. `.../error/GraphQlExceptionResolver.java:61`. 커밋 `aa5f4d90` |
|
||||
| J-4a | 완료 | `runtime/GraphQlWireErrorMapperTest.dataLoaderFailuresKeepAPlatformCode`(2건) FAIL(`["INTERNAL_ERROR","INTERNAL"]`) → PASS. batch timeout → `REQUEST_TIMEOUT`/TIMEOUT, missing key → 새 platform code `GRAPHQL_BATCH_KEY_MISSING`/BUSINESS. `.../runtime/GraphQlPlatformRejectionMapper.java:106,113`, `.../error/GraphQlErrorCode.java:48,72`, `GraphQlErrorCodeCatalogTest` 갱신. Spring GraphQL `ExceptionResolversExceptionHandler`가 `CompletionException`을 벗겨 넘기는 것 확인(2.0.5 소스). 커밋 `aa5f4d90` |
|
||||
| J-4b | 해당 없음(코드 삭제) | bridge 포화 경로(`GraphQlBlockingBridge`·`Schedulers.fromExecutor`)는 event loop 전용이라 D4(servlet 단일)에 맞춰 삭제. 남은 경로는 호출 스레드 inline(`Mono.fromCallable`)이라 예외가 그대로 mapper에 도달(J-4a 매핑 적용). 삭제 커밋 `6390bf89` |
|
||||
| J-9a | 완료 | 재현됨. systemTest `runtime/GraphQlPlatformExecutionPathTest.aChunkedBodyOverTheRawCapIsRefusedWith413`(Content-Length 없는 chunked 200KB 본문) FAIL(`expected: 413 but was: 500`) → PASS. 원인: `FrameworkServlet`(spring-webmvc 7.0.9 `FrameworkServlet.java:1006-1008`)이 decoder 안에서 던진 unchecked `BodyTooLargeException`을 `ServletException("Request processing failed")`으로 감쌈. `IOException/ServletException/RuntimeException`을 잡아 cause chain(최대 16단계)에서 찾으면 413, 아니면 그대로 rethrow. `.../runtime/servlet/GraphQlRequestBodyLimitFilter.java:85,98`. 커밋 `aa5f4d90` |
|
||||
| J-12 | 완료 | `autoconfigure/GraphQlDeploymentModeContractTest.aProductionModeRefusesTheAnonymousPrincipalResolver`(PRODUCTION_INTERNAL·PUBLIC) FAIL(`to have failed but context started successfully`) → PASS, `aProductionModeWithAnExplicitPolicyAndResolverStarts` PASS. 기본 `graphQlPrincipalResolver` bean이 production이면 `GraphQlPlatformConfigurationException`(mode 없으면 REQUIRED_MESSAGE). `.../autoconfigure/GraphQlPlatformAutoConfiguration.java:243`. 커밋 `aa5f4d90` |
|
||||
| X2-P2-6b (J-12와 한 행) | 남음 | 이유: 나머지 수정 방향(`AuthorizationPrincipal`에 tenant 추가해 모든 inbound가 생성, gRPC `GrpcAuthenticationPolicy` boolean 교체, 가명을 `UserPrincipalPseudonymizerPort` 하나로)은 application-core·gRPC·graphql을 함께 바꾸는 공통 작업이라 Wave 3 3-D(tenant 값 타입)와 같이 해야 함. GraphQL 기본 Spring Security `Authentication` → principal resolver는 tenant를 어느 claim에서 읽을지 정해야 해서 이번에 만들지 않음(production은 이제 resolver 없이 기동 거부) |
|
||||
| S5-#6a | 완료 | `runtime/GraphQlRequestStageErrorMappingTest.anApiErrorCarrierFromThePrincipalResolverKeepsItsCode`, `anApiErrorCarrierFromAPipelineStageKeepsItsCode` FAIL(`expected "TENANT_SUSPENDED" but was "INTERNAL_ERROR"`) → PASS. 두 테스트 모두 auto-configuration이 만든 bean으로 돌려 "세 곳이 mapper bean을 받는다"를 검증. `GraphQlWireErrorMapper.map(Throwable, ctx)`(플랫폼 거부 → ApiErrorCarrier → application 매핑) + `toGraphQlError`(carrier는 category로 classification) 하나로 interceptor·instrumentation·field resolver가 모두 이것을 씀. `.../runtime/GraphQlWireErrorMapper.java:61,79`, `GraphQlPlatformWebInterceptor.java:168`, `GraphQlPlatformInstrumentation.java:89`, `GraphQlDataFetcherExceptionResolver`, 주입 `GraphQlPlatformAutoConfiguration.java:357,413`. 호출자가 없어진 `GraphQlPlatformRejectionMapper.map` 삭제. 커밋 `aa5f4d90` |
|
||||
| NEW-9a | 완료 | S5-#6a와 같은 결함, 같은 수정·같은 테스트. 수정 방향 중 category switch 3개(`GraphQlWireErrorMapper.category`·`clientMessage`, `GraphQlWireErrors.classificationOf`)를 EnumMap 표 하나로 합치는 일은 지시대로 하지 않음 — Wave 3 3-A(Category별 한국어 문구 표를 shared-contract에)에서 `clientMessage`가 그 표로 대체되므로 그때 함께. 커밋 `aa5f4d90` |
|
||||
| S5-lead-3 | 남음 | 이유: 공통 tenant 값 타입(shared-contract/application-core)을 만들고 web·graphql(그리고 messaging·persistence·notification의 tenant 타입)이 담게 하는 일은 계획서 Wave 3 3-D 「tenant 값 타입」 공통 작업이고 web은 P10 범위. 이번에는 증상만 막음: GraphQL `TenantContext` 검증을 web과 같은 문법 `[A-Za-z0-9][A-Za-z0-9_.-]{0,63}`으로 맞춰 "한 전송만 통과하는 tenant"를 없앰. `context/GraphQlRequestContextTest.aTenantTheWebTransportRefusesIsRefusedHereToo`(4건) FAIL(`Expecting actual not to be null`) → PASS. `.../context/TenantContext.java:38`. 커밋 `aa5f4d90` |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `GraphQlExecutionProfile`(BLOCKING_MVC·REACTIVE_WEBFLUX·MIXED_CONTROLLED), `GraphQlExecutionProfileException` | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/execution/` | `6d27356e` | D4: servlet 단일 스택이라 고를 프로파일이 없음 |
|
||||
| `GraphQlRuntimeTransport`와 `GraphQlPlatformAutoConfiguration`의 `ServletRuntimeDetection`·`ReactiveRuntimeDetection`, `GraphQlPlatformRuntime.transport` | `.../graphql/autoconfigure/` | `6d27356e` | D4: 프로파일과 실행 서버 대조가 필요 없어짐 |
|
||||
| `GraphQlBlockingBridge`, `GraphQlBlockingBridgeFullException`, `GraphQlBatchLoaderRegistrar`의 bridge·profile 인자, `GraphQlBlockingBridgeTest` | `.../graphql/runtime/`, `src/adapter/inbound/graphql/src/test/java/dev/caskeleton/adapter/inbound/graphql/runtime/` | `6d27356e` | D4: event loop 에서 blocking 작업을 빼내는 bridge. servlet 에서는 호출 스레드 inline 실행(J-4b 결함 경로) |
|
||||
| 설정 `backend.graphql.execution-profile`(`APP_GRAPHQL_EXECUTION_PROFILE`), `backend.graphql.unbridged-blocking-resolvers`와 validator의 reactive 검사 | `GraphQlPlatformSettings.java`, `GraphQlPlatformStartupValidator.java`, `src/main/resources/config/graphql.yml`, `docs/registries/env-keys.yaml`, `src/.env.example` | `6d27356e` | D4: 동작할 수 없는 옵션은 키를 두지 않는다 |
|
||||
| 테스트: `GraphQlTransportNeutralityTest`의 context 기반 프로파일 케이스 7개, `GraphQlBatchLoaderRegistrationTest` reactive·bridge 2건, `GraphQlPlatformStartupValidatorTest.aBlockingResolverWithoutABridgeCannotRunOnTheReactiveProfile` | `src/adapter/inbound/graphql/src/test/java/dev/caskeleton/adapter/inbound/graphql/` | `6d27356e` | 대상 코드 삭제 |
|
||||
| `GraphQlPlatformRejectionMapper.map`(unknown → INTERNAL_ERROR 정적 메서드) | `.../graphql/runtime/GraphQlPlatformRejectionMapper.java` | `6d27356e` | 모든 경로가 `GraphQlWireErrorMapper.map`을 쓰게 되어 호출자 없음 (`mapFieldFailure`는 `map`으로 이름 변경) |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- `P8-new-1` (미수정): `GraphQlBatchLoadException`(per-key 실패, adopter가 준 `errorCode`)을 mapper가 모른다 → `INTERNAL_ERROR`로 가려지고 adopter code가 사라짐. `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/dataloader/GraphQlBatchResultMapper.java:131`, 매핑 없음 `.../runtime/GraphQlPlatformRejectionMapper.java`. 코드를 그대로 wire에 내보내도 되는지(검증되지 않은 adopter 문자열) 결정 후 `GraphQlErrorCode.of(...)`로 매핑.
|
||||
- `P8-new-2` (미수정): instrumentation 이 platform context 없이 온 요청(= interceptor 미배선 설정 오류)을 `INTERNAL_ERROR`+`PLATFORM_CONTEXT`로 거부하지만 로그를 남기지 않아, 잘못 조립된 배포가 모든 요청을 조용히 실패시킨다. `.../runtime/GraphQlPlatformInstrumentation.java:65-70`.
|
||||
- `P8-new-3` (고침, 문서): graphql `CLAUDE.md` 「Error mapping」 절이 없는 클래스 `GraphqlExceptionResolver`와 "비-carrier 예외는 null 반환"을 설명하고 있었음. 현재 경로(한 mapper, 마스킹+로그)로 고침. 커밋 `aa5f4d90`.
|
||||
- `P8-new-4` (미수정, W5 문서): 이번 D 삭제 대상(`GraphQlRuntimeTransport`, `GraphQlExecutionProfile`, `GraphQlBlockingBridge`)을 설명하는 학습 문서가 남아 있음 — `docs/study/graphql-walkthrough.ko.md:157,461,871,1078`(결정 6 대상), `docs/graphql-superpowers-package/**`.
|
||||
- 참고: brief가 적은 graphql reactive 잔재(`REACTIVE` 런타임 감지·`REACTIVE_WEBFLUX`)는 J-4b가 건드리는 bridge와 한 묶음이라 D 커밋 `6390bf89`에서 지웠다.
|
||||
@@ -0,0 +1,43 @@
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
| E-10a | 완료 | `TenantAwareRepositoryGuardTest.openingAnAdminScopeRecordsItsReasonInTheAuditSink` FAIL(컴파일: "constructor TenantAwareRepositoryGuard ... cannot be applied", audit sink 없음)→PASS, `anAuditSinkThatFailsLeavesNoAdminScopeOpen` PASS. 생성자가 `Consumer<String>` audit sink를 받고 scope를 열기 전에 사유를 기록: `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/experimental/tenant/TenantAwareRepositoryGuard.java:31,56`. PG `TenantColumnIsolationTest`(jpa-contract) 통과 |
|
||||
| E-10c | 완료 | `SchemaMultiTenantConnectionProviderTest.aFailedResetAbortsTheConnectionSoThePoolCannotLendItOutWithTheTenantSchema` FAIL("WantedButNotInvoked: connection.abort")→PASS, `aFailedResetReachesTheCaller` PASS. reset 실패 시 `abort(Runnable::run)` 후 close, 예외 전파: `.../experimental/schema/SchemaMultiTenantConnectionProvider.java:60-74`. Hikari는 abort된 커넥션을 close 때 evict한다(javap로 `ProxyConnection`이 abort를 가로채지 않음 확인) |
|
||||
| E-2b | 완료 | NEW-7a와 같은 결함·같은 수정. 아래 NEW-7a 행 참고 |
|
||||
| E-3a | 완료 | `CanonicalOutboxAppendAdapterTest.appendOutsideACallerTransactionIsRefusedBeforeAnyWrite` FAIL("Expecting actual not to be null")→PASS. `.../outbox/CanonicalOutboxAppendAdapter.java:40-44` 첫 줄에 caller 트랜잭션 guard(형제 `OutboxStoreAdapter`와 같은 메시지) |
|
||||
| E-4a | 완료 | 실제 PG `PostgreSqlInboxCutoffIntegrationTest.markAllReadLeavesAnUnreadArchivedItemArchived` FAIL(`[2, READ]` ≠ `[1, ARCHIVED]`)→PASS. 서브쿼리에 `AND state NOT IN ('ARCHIVED','EXPIRED','DELETED')`: `.../notification/platform/inbox/InboxItemJpaRepository.java:91-93`. 이 테스트 클래스는 SQL 사본을 실행하고 있어서(결함이 안 보였던 이유) repository `@Query` 값을 읽어 실행하도록 바꿈 |
|
||||
| E-4b | 완료 | `InboxItemEntityTest.markReadLeavesAnItemThatLeftTheInboxWhereItIs` / `markSeen...` (ARCHIVED·EXPIRED·DELETED 각 3건) FAIL(`[true, READ]`/`[true, SEEN]`)→PASS. `.../inbox/InboxItemEntity.java` `leftTheInbox()` 가드 |
|
||||
| E-5a | 완료 | 실제 PG `PostgreSqlOutboxClaimAndMaintenanceIntegrationTest.canonicalEventsSharingAnOccurredAtAreClaimedOneAtATimeInAggregateOrder` FAIL(3건 동시 claim)→PASS, H2 `H2ClaimSqlTest.claimsCanonicalEventsSharingAnOccurredAtOneAtATimeInAggregateOrder` PASS. canonical 쌍은 `(aggregate_sequence, event_index)`로 head 판정·정렬: `.../postgresql/PostgreSqlOutboxClaimRepository.java:25-50`, `.../h2/H2OutboxClaimRepository.java:26-47`. 인덱스 새 migration `V18__outbox_event_unpublished_aggregate_order.sql` + `applied-migrations.sha256` 1줄, `PostgreSqlMigrationIntegrationTest` 버전 목록에 18 추가. legacy row가 낀 쌍은 기존 `occurred_at` 비교 유지(`equalTimestampRowsAreClaimedTogetherLegacyFifoLimitationCharacterization` 그대로 통과) |
|
||||
| E-5b | 완료 | 실제 PG `aDeadCanonicalRowOfAnotherTenantOrTypeDoesNotBlockTheSameAggregateId` FAIL(`[]`)→PASS. E-5a와 같은 SQL 변경(canonical 쌍은 tenant_scope·aggregate_type까지 같아야 같은 aggregate) |
|
||||
| E-7 | 완료 | `OutboxStoreAdapterTest.claimBatchMovesAnUnreadableRowToDeadAndClaimsTheRestOfTheBatch` FAIL(IllegalStateException partial canonical)→PASS, 실제 PG `anUnreadableCanonicalRowDoesNotStopTheRestOfTheBatchFromBeingClaimed`·`anUnreadableCanonicalRowIsMovedToDeadByTheClaim` FAIL(projection mismatch 예외)→PASS. `.../outbox/OutboxStoreAdapter.java:84-110` 매핑 실패 row는 DEAD·lease 해제 후 배치에서 제외(legacy로 낮추지 않으므로 fail-closed 유지) |
|
||||
| E-8a | 완료 | 실제 PG `countByStatusLeavesPublishedRowsUncounted` FAIL(`{PENDING=1, PUBLISHED=1}`)→PASS. `countGroupedByStatus`에 `where e.status <> 'PUBLISHED'`(`.../outbox/OutboxEventJpaRepository.java`), fake `InMemoryOutboxStore.countByStatus` 동일, 포트 문서 갱신, `OutboxMetrics`는 PUBLISHED 시리즈를 내보내지 않음(0 고정 시리즈 방지). lifecycle PG 테스트의 PUBLISHED 카운트 단언 3곳은 row 상태 직접 조회로 교체 |
|
||||
| E-8b | 완료 | `OutboxReaperTest` 3건 FAIL(컴파일: `deletePublishedBatch` 없음)→PASS. native `DELETE … WHERE event_id IN (SELECT … LIMIT n)`(ctid 대신 PG·H2 공통 SQL)를 repository 메서드 `@Transactional`로 배치마다 커밋, 덜 찬 배치에서 종료: `.../outbox/OutboxEventJpaRepository.java:19-35`, `.../outbox/OutboxReaper.java`(배치 1,000, `ponytail:` 주석). 실제 PG `reaperDeletesOldPublishedRowsOutsideAnyCallerTransaction`, H2 `theReaperBatchDeleteRunsOnH2AndStopsAtItsLimit` PASS |
|
||||
| S6-#3b | 완료 | 행동 보존 정리(FAIL→PASS 대상 아님): `OpenInViewSafetyValidator`(모든 profile 거부)를 정본으로 두고 `JpaDangerousConfigurationGuard`의 OSIV 분기·`OPEN_IN_VIEW_KEY` 삭제(`.../startup/JpaDangerousConfigurationGuard.java`), `JpaPlatformReport`는 validator 상수 사용. `OpenInViewSafetyValidatorTest.openInViewTrueFailsStartupUnderALocalConvenienceProfileToo` 추가(수정 전후 모두 PASS = guard의 local 예외가 죽은 코드였다는 증거). guard 테스트는 ddl-auto만 검사하도록 재작성. 학습 문서 `docs/study/postgresql-jpa-walkthrough.ko.md` 표 갱신 |
|
||||
| NEW-7a | 완료 | application: `SubmitDurableOperationUseCaseTest.retryUnderTheSameOperationIdAppendsTheOutboxEventOnlyOnce` FAIL(`[false, 2]` ≠ `[true, 1]`)→PASS. 실제 PG 재현: `DurableOperationSubmissionOutboxIntegrationTest.retryUnderTheSameOperationIdLeavesThePublishedOutboxRowAlone` FAIL(`[false, [PENDING]]` — 재시도가 PUBLISHED row를 merge로 PENDING으로 되돌림 = 재발행)→PASS, `aSecondAppendOfTheSameEventIdIsRefusedByThePrimaryKeyInsteadOfOverwritingTheRow` FAIL(예외 없이 덮어씀)→PASS(`PersistenceFailureException` SQLState 23505). 수정: `submitIfAbsent`가 삽입 행 수 반환(`.../operation/DurableOperationJpaRepository.java:52`), `DurableOperationStorePort.submit` → `DurableOperationSubmitResult(operation, created)`(새 파일 `application-core/.../operation/DurableOperationSubmitResult.java`), use case는 `created`일 때만 append(`SubmitDurableOperationUseCase.java:99-104`), `OutboxEventEntity implements Persistable<String>`(`isNew`, `@PostLoad/@PostPersist`). `DurableOperationStoreContract`에 `retryUnderTheSameOperationIdReturnsTheOperationAsNotCreated` 추가 — fake와 PG adapter(`DurableOperationStoreAdapterContractTest`, jpa-contract) 모두 통과 |
|
||||
| NEW-7b | 완료 | 소유자 결정 15. `adapter:inbound:web` `operation/DurableOperationController`: `POST /operations`(202 + Location, Envelope), `GET /operations/{id}`, `DELETE /operations/{id}`(202). 컨트롤러는 Submit/Get/Cancel 유스케이스만 호출, 인가는 유스케이스 `@RequiresPermission`, owner·tenant 판정은 유스케이스의 `DurableOperationAccessPolicy`(남의 것 = 없는 것 = 404 `OPERATION_NOT_FOUND`). 조립은 `app-bootstrap/.../autoconfigure/operation/DurableOperationConfig`(기존 `OutboxConfig` 패턴, operation store·outbox append·TransactionPort bean이 있을 때만 켜짐, `AutoConfiguration.imports` 등록). 테스트: web slice `DurableOperationControllerTest` 10건, 실제 PG 왕복 `DurableOperationCompositionIntegrationTest` 5건(프록시된 `@RequiresPermission` 403 포함, `integrationTest` lane `requires`에 추가). 새 경로는 인증 필요 경로라 공개 경로 스냅숏은 바뀌지 않음(`verifyPublicPathSnapshot` 통과). `security.yml`에 `operation-submit: operation:submit,operation:cancel`, dev Keycloak realm에 같은 client role 추가. 설계 선택(결정 필요 시 뒤집을 수 있음): id는 서버가 UUID로 발급, 재제출은 payload fingerprint로 dedupe, outbox event type은 `OperationCommand.SUBMITTED_EVENT_TYPE` 하나(클라이언트가 임의 event type을 broker에 싣지 못하게), TTL `OperationCommand.DEFAULT_TIME_TO_LIVE`(1일), tenant는 null(웹 운영 경로에 tenant 해석이 없음) |
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
| `JpaDangerousConfigurationGuard`의 OSIV 검사 분기와 `OPEN_IN_VIEW_KEY` 상수 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/startup/JpaDangerousConfigurationGuard.java` | `6d27356e` | S6-#3b. `OpenInViewSafetyValidator`가 모든 profile에서 먼저 거부하므로 local 예외가 도달 불가능한 죽은 코드 |
|
||||
| `OutboxEventJpaRepository.deletePublishedBefore`(무제한 단일 DELETE) | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxEventJpaRepository.java` | `6d27356e` | E-8b. 배치 삭제 `deletePublishedBatch`로 교체 |
|
||||
|
||||
## 새로 발견한 결함
|
||||
- P9-new-1: `InboxItemEntity.archive()`가 EXPIRED·DELETED 항목도 ARCHIVED로 바꾼다(`src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/inbox/InboxItemEntity.java` `archive`). terminal 상태를 되돌리는 같은 종류의 결함. 고치지 않음(E-4b 범위 밖).
|
||||
- P9-new-2: `PostgreSqlInboxCutoffIntegrationTest`가 repository의 SQL이 아니라 테스트 안의 사본을 실행하고 있어 E-4a가 PG lane에서 보이지 않았다. 고침(repository `@Query`를 읽어 실행).
|
||||
- P9-new-3: 같은 operationId를 다른 요청(다른 scope)으로 재사용하면 fake(`InMemoryDurableOperationStore`)는 조용히 덮어쓰고 PG adapter는 PK 위반으로 실패한다 — fake/adapter 불일치. HTTP 경로는 id를 서버가 발급해 영향 없음. 고치지 않음.
|
||||
- P9-new-4: `WebMvcRequestContextHolder.store(...)`를 부르는 운영 코드가 없어 `WebRequestContext`를 파라미터로 받는 컨트롤러는 항상 `IllegalStateException`으로 실패한다(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/context/WebMvcRequestContextArgumentResolver.java:40`). operation 컨트롤러는 그래서 `@AuthenticationPrincipal`을 쓴다. 고치지 않음(P10 영역).
|
||||
- P9-new-5: 웹 운영 경로에 tenant 해석이 없다(`TenantContext.resolved` 호출자 없음). durable operation HTTP는 tenant를 null로 넘긴다. 결함이라기보다 미구현 — 기록만.
|
||||
|
||||
## 커밋·검증
|
||||
- 브랜치 `worktree-agent-adbb19427d5d1740b`: `21bcba8d` W1, `3152e50b` W2
|
||||
- `:application-core:check` `:adapter:outbound:persistence-jpa:check` `:adapter:inbound:web:check` `:app-bootstrap:check` 통과 (unit: application-core 209, persistence-jpa 490, web 234 + webSecurityBoundaryTest 13, app-bootstrap 454(skip 5, 기존) + systemTest 8)
|
||||
- 실제 PostgreSQL: jpaPlatformContractTest 217, jpaPlatformMigrationTest 45, jpaPlatformFailureTest 3, jpaPlatformQueryPlanTest 3, jpaPlatformSecurityTest 10, jpaPlatformPoolContractTest 8, postgresqlLegacyOutboxRowLifecycle 10, postgresqlLegacyOutboxAppendTransactional 2, postgresqlLegacyOutboxConcurrentRelay 4, postgresqlMigration 5, postgresqlIdempotency 8 — 실패 0, skip 0
|
||||
- `:app-bootstrap:integrationTest` 9/9 (새 `DurableOperationCompositionIntegrationTest` 5 포함)
|
||||
- `architectureCheck`(architectureTest 180), `verifyPublicPathSnapshot`, `:app-bootstrap:verifyEnvKeys`, `verifyDependencyLocks` 통과
|
||||
|
||||
## 기타
|
||||
- 추가한 migration 버전: `postgresql/V18__outbox_event_unpublished_aggregate_order.sql` (다른 묶음과 번호 충돌 시 오케스트레이터 조정 필요, `applied-migrations.sha256`와 `PostgreSqlMigrationIntegrationTest` 버전 목록도 함께).
|
||||
- `SpringTransactionPort`는 건드리지 않음.
|
||||
- 규칙 이탈 1건: W1에서 `TenantAwareRepositoryGuard.java`를 한 번 셸(python heredoc)로 편집했다. 결과는 Read로 확인했고 이후 편집은 전부 Edit/Write 도구로 했다.
|
||||
- 의존성: `adapter:inbound:web` testImplementation에 `testFixtures(project(':application-core'))` 추가. `resolveAndLockAll --write-locks` 결과 lockfile 변화 없음.
|
||||
@@ -47,6 +47,18 @@
|
||||
| 19 | 의존성 checksum 검증 | 추가 안 함 → 보류 | O-5a |
|
||||
| 20 | API surface 검사 단계 | PR(`check`)로 올림 | NEW-13d |
|
||||
|
||||
Wave 1–2 구현 중 나온 질문에 대해 받은 7건(2026-09-28):
|
||||
|
||||
| # | 질문 | 결정 | 해당 행 |
|
||||
|---|---|---|---|
|
||||
| 21 | 알림 route의 provider profile이 사라진 경우 | 일반 재시도 정책(backoff·최대 횟수) 후 FAILED | P3-new-5 |
|
||||
| 22 | sample 포스터 업로드 abort·reconcile 경합 | 먼저 끝난 쪽이 이김(이미 게시됐으면 abort는 409) | P2-new-2 |
|
||||
| 23 | Dynamic Target cross-origin redirect의 호출자 헤더 | 전부 제거, 안전한 헤더만 유지 | P11-new-4 |
|
||||
| 24 | 멱등성 `complete`가 연결 포화로 UNAVAILABLE | 현재 동작 유지 + 문서화 | P6-new-2 |
|
||||
| 25 | GraphQL DataLoader 키 실패의 adopter 에러 코드 | 등록된 `ApiErrorCode`만 노출 | P8-new-1 |
|
||||
| 26 | durable operation HTTP 설계 4개(서버 생성 id, payload 지문으로 재제출 판정, 고정 event type, 1일 보존) | 그대로 승인 | NEW-7b |
|
||||
| 27 | main build가 plugin으로 부르는 build-logic·build-tools 의존성 잠금 | 잠그지 않음 + 문서화 → 보류 | P13-new-1 |
|
||||
|
||||
기존 원칙에서 바로 따라 나와 에이전트가 정한 것(소유자가 뒤집을 수 있음):
|
||||
|
||||
- M-2b: Kafka 주소는 `app.messaging.brokers.<b>.bootstrap-servers` 하나(AGENTS.md capability 기준 4 "prefix 하나").
|
||||
@@ -67,30 +79,30 @@
|
||||
|
||||
## 요약
|
||||
|
||||
2026-09-28, Wave 1–2 통합 후. 괄호는 시작 시점(2026-09-25) 값.
|
||||
|
||||
| 상태 | 행 수 |
|
||||
|---|---|
|
||||
| 완료 | 161 |
|
||||
| 해당 없음 | 106 |
|
||||
| 남음 | 544 |
|
||||
| 보류 | 1 |
|
||||
| 합계 | 812 (중복 병합 16행) |
|
||||
| 완료 | 370 (161) |
|
||||
| 해당 없음 | 112 (106) |
|
||||
| 남음 | 375 (544) |
|
||||
| 보류 | 2 (1) |
|
||||
| 합계 | 859 (812 + 후속 발견 47) |
|
||||
|
||||
| Wave (남음) | 행 수 |
|
||||
|---|---|
|
||||
| W1 | 55 |
|
||||
| W2 | 139 |
|
||||
| W1 | 4 |
|
||||
| W2 | 17 |
|
||||
| W3 | 196 |
|
||||
| W4 | 56 |
|
||||
| W5 | 98 |
|
||||
|
||||
|
||||
| W4 | 57 |
|
||||
| W5 | 101 |
|
||||
|
||||
## 1차 A Core · L Composition/sample
|
||||
|
||||
| ID | 심각도 | 요약 | 상태 | 근거 | Wave | 수정 방향 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| A-1a | Required | `FailOpenDependencyLogger.logFailure`가 `cause.getMessage()`를 WARN 로그에 그대로 남김(수신자 주소·webhook URL 누출 가능, Javadoc은 "PII cannot reach the log") | 남음 | `src/adapter/outbound/support/src/main/java/dev/caskeleton/adapter/outbound/support/FailOpenDependencyLogger.java:39-47`(`:47` `cause.getMessage()`), Javadoc `:10-11`. 호출자 `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/core/FailOpenNotificationProvider.java:42` | W1 | `FailOpenDependencyLogger.java:41,47`에서 `getMessage()`를 빼고 `error="{}"`에 예외 클래스 simple name만 남긴다 |
|
||||
| A-1b | Required | PII 누출 테스트가 메시지 `"connection refused"`로 `@gmail.com` 부재만 확인 → 아무것도 증명 못 함 | 남음 | `src/adapter/outbound/support/src/test/java/dev/caskeleton/adapter/outbound/support/FailOpenDependencyLoggerTest.java:65-72` | W4 | 같은 테스트에서 예외 메시지에 `alice@example.com`, `https://hooks.slack.com/services/...`를 넣고 렌더된 로그에 둘 다 없음을 단언 |
|
||||
| A-1a | Required | `FailOpenDependencyLogger.logFailure`가 `cause.getMessage()`를 WARN 로그에 그대로 남김(수신자 주소·webhook URL 누출 가능, Javadoc은 "PII cannot reach the log") | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `FailOpenDependencyLoggerTest.failureLogKeepsOnlyTheExceptionTypeAndDropsTheRecipientAndWebhookUrlInItsMessage` FAIL→PASS (FAIL: `error="RuntimeException: 550 rejected alice@example.com via https://hooks.slack.com/services/T000/B000/XXXX"`는 `error="RuntimeException"`를 포함하지 않음). `src/adapter/outbound/support/src/main/java/dev/caskeleton/adapter/outbound/support/FailOpenDependencyLogger.java:40-51` — `error="{}"`에 `getSimpleName()`만 넣음. 커밋 `9a05d686` (W1) | - | `FailOpenDependencyLogger.java:41,47`에서 `getMessage()`를 빼고 `error="{}"`에 예외 클래스 simple name만 남긴다 |
|
||||
| A-1b | Required | PII 누출 테스트가 메시지 `"connection refused"`로 `@gmail.com` 부재만 확인 → 아무것도 증명 못 함 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 같은 테스트(`FailOpenDependencyLoggerTest.java:64-79`)가 예외 메시지에 `alice@example.com`·`https://hooks.slack.com/services/...`를 넣고 렌더된 로그에 둘 다 없음을 단언한다. 수정 전 FAIL 확인. 커밋 `9a05d686` | - | 같은 테스트에서 예외 메시지에 `alice@example.com`, `https://hooks.slack.com/services/...`를 넣고 렌더된 로그에 둘 다 없음을 단언 |
|
||||
| A-2a | Required | websocket이 prod 판정을 손으로 재구현(`"prod".equals`, trim/소문자 없음) → `Prod` 프로필에서 prod 안전 검증 건너뜀 | 해당 없음(코드 삭제) | 「제거된 코드」 표 `app.websocket.platform.*` 설정(`WebSocketPlatformSafetyConfiguration`, `WebSocketPlatformStartupValidator` 포함) 행. `git log --diff-filter=D`로 `6d27356e` 삭제 확인, 현재 websocket main에 `getActiveProfiles` 호출 0건 | - | - |
|
||||
| A-2b | Required | `RuntimeProfileSnapshot` Javadoc "repository에서 `getActiveProfiles`를 읽는 유일한 production 타입" 주장이 거짓 | 남음 | `src/adapter/outbound/support/src/main/java/dev/caskeleton/adapter/outbound/support/runtime/RuntimeProfileSnapshot.java:12-13`. 직접 읽는 곳: `src/adapter/inbound/graphql/.../autoconfigure/GraphQlPlatformAutoConfiguration.java:123`, `src/adapter/outbound/fileserver/.../platform/autoconfigure/FileserverSecurityConfiguration.java:81`, `src/adapter/outbound/httpclient/.../autoconfigure/HttpClientProfileAutoConfiguration.java:155-156`, `src/adapter/outbound/objectstorage/.../config/ObjectStorageCapabilityConfig.java:59-61` | W5 | `RuntimeProfileSnapshot.java:12-13` 문장을 "composition root(app-bootstrap)의 reader"로 좁히거나 삭제 |
|
||||
| A-2c | Required | BOOT-002 가드 ArchUnit이 `dev.caskeleton.bootstrap..`만 검사 → 다른 leaf의 새 profile reader·손 판정은 못 잡음 | 남음 | `src/app-bootstrap/src/architectureTest/java/dev/caskeleton/bootstrap/architecture/RuntimeProfileAccessArchitectureTest.java:12-21` (변경 없음, `git diff 208077fd 6d27356e` 0줄) | W3 | 같은 규칙을 `dev.caskeleton..`(messaging·sample 제외)로 넓히고 `getActiveProfiles` 호출 허용 목록을 현재 5곳(`RuntimeProfileSnapshot`, 위 graphql·fileserver·httpclient·objectstorage 클래스)으로 고정 — support에 의존 못 하는 graphql·objectstorage가 있어 snapshot 강제는 불가 |
|
||||
@@ -106,10 +118,10 @@
|
||||
| A-6c | Required | identifier README 패키지 루트·SSOT 오기, 삭제된 UUID 능력을 설명 | 남음 | `src/adapter/outbound/identifier/README.md:3`(`dev.caskeleton.adapter.identifier`, 실제 `...adapter.outbound.identifier`), `:50`(`src/build.gradle`의 `allowedProjectDependencies`), `:11-12` UUIDv7 식별자 생성(main엔 `HmacUserPrincipalPseudonymizer`만). Spock 절은 삭제됨 | W5 | `identifier/README.md:3`, `:50`을 실제 패키지·`src/config/architecture/modules.json`으로, `:11-12` UUID 문장 삭제 |
|
||||
| A-6d | Required | support README가 "CLAUDE.md 없음", SSOT를 `src/build.gradle`로, 없는 `OutboundHttpDependencyLogger`를 언급 | 남음 | `src/adapter/outbound/support/README.md:7-8`(`src/adapter/outbound/support/CLAUDE.md` 존재), `:24`(`class OutboundHttpDependencyLogger` 0건) | W5 | `support/README.md:7-8`을 modules.json·CLAUDE.md 참조로, `:23-24` 비교 문장 삭제 |
|
||||
| A-6e | Required | shared-contract README가 없는 `RateLimiter`/`RateLimiterFactory`를 패턴 예시로 인용 | 남음 | `src/shared-contract/README.md:436,499`, 같은 인용 `src/shared-contract/src/main/java/dev/caskeleton/shared/concurrency/DomainContextPropagatorFactory.java:8` | W5 | 세 곳의 `RateLimiter*` 비교 문장 삭제 |
|
||||
| A-7a | Consider | `ValidatedIntegrationEvent`가 `envelopeSha256`과 `envelopeBytes` 일치를 확인하지 않음 — DB 복원 경로가 저장된 해시를 그대로 신뢰 | 남음 | `src/application-core/src/main/java/dev/caskeleton/application/messaging/event/ValidatedIntegrationEvent.java:78-83`(null 검사만), 복원 `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxStoreAdapter.java:197-214` | W2 | 생성자에서 `envelopeBytes`의 SHA-256을 계산해 `envelopeSha256`과 다르면 `IllegalArgumentException` |
|
||||
| A-7b | Consider | `CORRELATION_GRAMMAR`가 `*`라 correlation/causation id 길이 무제한인데 오류 메시지는 "bounded" | 남음 | `ValidatedIntegrationEvent.java:36,54,58-59,159` | W2 | `CORRELATION_GRAMMAR`를 `[A-Za-z0-9][A-Za-z0-9._:-]{0,127}`로 |
|
||||
| A-7a | Consider | `ValidatedIntegrationEvent`가 `envelopeSha256`과 `envelopeBytes` 일치를 확인하지 않음 — DB 복원 경로가 저장된 해시를 그대로 신뢰 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `ValidatedIntegrationEventTest.envelopeHashThatIsNotTheSha256OfTheEnvelopeBytesIsRefused` FAIL(`Expecting actual not to be null`)→PASS. DB 복원 경로는 `OutboxStoreAdapterTest.claimBatchRefusesACanonicalRowWhoseStoredEnvelopeHashIsNotItsBytesHash`가 PASS(`invalid canonical outbox metadata…` + 원인 메시지 확인). 코드: `src/application-core/src/main/java/dev/caskeleton/application/messaging/event/ValidatedIntegrationEvent.java:85-89`. 계산은 새로 만든 `Sha256.of(byte[])`(`src/application-core/src/main/java/dev/caskeleton/application/messaging/contract/Sha256.java:21-29`)로 한다. 임의 해시로 이벤트를 만들던 테스트 픽스처 5곳을 `Sha256.of(envelope)`로 바꿨다(application-core 1, messaging 2, persistence-jpa 2). 커밋 `3a39b6b5` (W2) | - | 생성자에서 `envelopeBytes`의 SHA-256을 계산해 `envelopeSha256`과 다르면 `IllegalArgumentException` |
|
||||
| A-7b | Consider | `CORRELATION_GRAMMAR`가 `*`라 correlation/causation id 길이 무제한인데 오류 메시지는 "bounded" | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `ValidatedIntegrationEventTest.correlationIdLongerThan128CharactersIsRefused`·`causationIdLongerThan128CharactersIsRefused` FAIL→PASS. 경계값 테스트 `correlationIdOf128CharactersIsAccepted` PASS. `ValidatedIntegrationEvent.java:36-37` `{0,127}` — outbox `correlation_id`·`causation_id` varchar(128)과 같다. 커밋 `3a39b6b5` | - | `CORRELATION_GRAMMAR`를 `[A-Za-z0-9][A-Za-z0-9._:-]{0,127}`로 |
|
||||
| A-8a | Consider | v1 `IdempotencyExecutor.runAndComplete`가 완료 기록 실패를 action 실패로 처리 → 재시도 때 action 재실행 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "요청 멱등성 v1 모델 (`IdempotencyExecutor`(v1) …)" 행(D3). 현재 executor는 try가 `action.run()`만 감쌈(`src/application-core/src/main/java/dev/caskeleton/application/idempotency/IdempotencyExecutor.java:192-198`) | - | - |
|
||||
| A-8b | Consider | 정본 executor(구 V2)에서 `preserveUnknown`이 던지면 원래 action 예외를 잃음 | 남음 | `src/application-core/src/main/java/dev/caskeleton/application/idempotency/IdempotencyExecutor.java:194-198`, `:210-213` | W2 | 두 곳에서 `preserveUnknown` 호출을 try/catch로 감싸 `failure.addSuppressed(e)` 후 원래 예외를 던진다 |
|
||||
| A-8b | Consider | 정본 executor(구 V2)에서 `preserveUnknown`이 던지면 원래 action 예외를 잃음 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `IdempotencyExecutorTest.aStoreFailureWhileRecordingTheActionFailureIsSuppressedUnderIt` 3건(thrown / effect unknown / retryable no effect) FAIL(`IllegalStateException: store unavailable … to refer to the same object`)→PASS. `src/application-core/src/main/java/dev/caskeleton/application/idempotency/IdempotencyExecutor.java:197-219,273-289` — `markFailed` 호출 세 곳을 `recordFailure` 하나로 모았다. store 예외는 원래 예외에 `addSuppressed`로 붙는다. 현황표는 `preserveUnknown` 두 곳만 적었지만 `RetryableNoEffect` 경로도 같은 결함이라 함께 고쳤다. 커밋 `3a39b6b5` | - | 두 곳에서 `preserveUnknown` 호출을 try/catch로 감싸 `failure.addSuppressed(e)` 후 원래 예외를 던진다 |
|
||||
| A-9a | Consider | `UuidCodec` 죽은 코드(외부 참조 0, "canonical" 계약도 틀림) | 해당 없음(코드 삭제) | 「제거된 코드」 표 `UuidCodec` 행 | - | - |
|
||||
| A-9b | Consider | application-core 테스트 헬퍼 `CompiledPackageScanner` 참조 0 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "application-core 테스트 헬퍼 `CompiledPackageScanner`" 행(다른 leaf 사본 2개는 사용 중) | - | - |
|
||||
| A-9c | Consider | `@Deprecated(forRemoval)` `FileExportPort` 호출자 0 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "`FilePublicationPort`·`FileExportPort` 계약" 행 | - | - |
|
||||
@@ -126,10 +138,10 @@
|
||||
| L-5 | Consider | 남은 `StartupSafetyValidator` 검사(multi-instance → lock provider)는 절대 실패할 수 없음 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "`DistributedLockConfig`와 `DistributedLockConfigTest`" 행 — bean이 opt-in persistence-jpa(`DistributedLockPersistenceConfig.java:83-92`)로 옮겨져, JPA 없는 기본 조립에서 `APP_MULTI_INSTANCE_ENABLED=true`면 이 검사만 실패시킴. 테스트 `StartupSafetyValidatorTest.multiInstanceEnabledWithMissingDistributedLockProviderFailsStartup` | - | - |
|
||||
| L-6a | Consider | 관계형 의존 목록이 `DataSourceRequirement`와 `CapabilityDependencyValidator` 두 곳에 있고 fileserver 항목이 어긋남 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "`JpaOffAutoConfigurationImportFilter`, `DataSourceRequirement`" 행과 "bootstrap `activation` 패키지(`CapabilityDependencyValidator` …)" 행. fileserver는 `persistence-fileserver`가 data-jpa를 직접 가져옴 | - | - |
|
||||
| L-6b | Consider | `SecretSourceValidator`가 DB 없는 prod 배포에도 `APP_DATASOURCE_PASSWORD`를 요구 | 완료 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/runtime/SecretSourceValidator.java:109-110`(`ca-skeleton.persistence-jpa.enabled` 아닐 때 건너뜀). 테스트 `SecretSourceValidatorTest.prodProfileWithoutRelationalPersistenceDoesNotRequireADatabasePassword`. 커밋 `6d27356e` | - | - |
|
||||
| L-7a | Consider | actuator chain에 인증 수단(`oauth2ResourceServer`/`httpBasic`)이 없어 `loggers` GET과 `show-details: when-authorized`에 어떤 자격증명으로도 도달 불가 | 남음 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/management/security/ManagementSecurityConfig.java:25-42`, `src/app-bootstrap/src/main/resources/config/observability.yml:34,41` | W2 | 지금도 도달 불가라 잃는 동작이 없으므로 `observability.yml:34`에서 `loggers` 노출 제거, `:41`을 `show-details: never`로, `ManagementSecurityConfig.java:37-40` loggers 규칙 삭제 |
|
||||
| L-7a | Consider | actuator chain에 인증 수단(`oauth2ResourceServer`/`httpBasic`)이 없어 `loggers` GET과 `show-details: when-authorized`에 어떤 자격증명으로도 도달 불가 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 실제 배포 yml을 읽는 `ManagementActuatorSecurityContractTest.applicationYmlExposureIncludePinsAllowlistExactly`·`applicationYmlPinsShowDetailsNeverAndShutdownDisabled` FAIL→PASS. `ActuatorSecurityHttpTest.loggersEndpointIsNotExposed`(인증된 사용자도 404)·`actuatorLinksChallengeUnauthenticatedCallerWith401`(D3 401 확인 대상을 `/actuator` 링크로 옮김) PASS. 변경: `src/app-bootstrap/src/main/resources/config/observability.yml:36`(`include: health,prometheus,info`), `:44`(`show-details: never`), `ManagementSecurityConfig.java:33-37`(loggers `denyAll` 규칙 삭제). `src/app-bootstrap/README.md` 해당 절도 고쳤다. P10이 바꾼 `observability.yml:151` 줄은 건드리지 않았다. 커밋 `3a39b6b5` | - | 지금도 도달 불가라 잃는 동작이 없으므로 `observability.yml:34`에서 `loggers` 노출 제거, `:41`을 `show-details: never`로, `ManagementSecurityConfig.java:37-40` loggers 규칙 삭제 |
|
||||
| L-7b | Consider | `ActuatorSecurityHttpTest`가 `.with(user("ops"))`로 보안 컨텍스트를 주입해 실제로는 도달 불가능한 200을 단언 | 남음 | `src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/ActuatorSecurityHttpTest.java:99-100`(`loggersReadIsAllowedForAuthenticatedCaller`), `:104-120` | W4 | L-7a 적용 후 `loggersReadIsAllowedForAuthenticatedCaller`·loggers write 테스트를 "loggers 비노출(404)" 단언 하나로 교체 |
|
||||
| L-8a | Consider | sample 기본값 `flyway.out-of-order: true`(prod가 금지하는 값) | 남음 | `src/sample-portfolio/src/main/resources/application.yml:45` | W2 | `application.yml:45`를 `out-of-order: false` |
|
||||
| L-8b | Consider | sample 기본값 `ddl-auto: update`가 Flyway 소유 스키마를 덮음(mapping/migration 불일치를 숨김) | 남음 | `src/sample-portfolio/src/main/resources/application.yml:53` | W2 | `application.yml:53`을 `${APP_DATASOURCE_DDL_AUTO:validate}` |
|
||||
| L-8a | Consider | sample 기본값 `flyway.out-of-order: true`(prod가 금지하는 값) | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `SampleSchemaOwnershipDefaultsTest.sampleDefaultsLeaveTheSchemaToFlyway[spring.flyway.out-of-order]` FAIL(`"true"`)→PASS. `src/sample-portfolio/src/main/resources/application.yml:45` `out-of-order: false`. 커밋 `3a39b6b5` | - | `application.yml:45`를 `out-of-order: false` |
|
||||
| L-8b | Consider | sample 기본값 `ddl-auto: update`가 Flyway 소유 스키마를 덮음(mapping/migration 불일치를 숨김) | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 같은 테스트 `[spring.jpa.hibernate.ddl-auto]` FAIL(`${APP_DATASOURCE_DDL_AUTO:update}`)→PASS. `application.yml:53` `${APP_DATASOURCE_DDL_AUTO:validate}` — env registry 기본값 `validate`와 같아졌다. env 키 변경은 없다(`verifyEnvKeys` 통과). 커밋 `3a39b6b5` | - | `application.yml:53`을 `${APP_DATASOURCE_DDL_AUTO:validate}` |
|
||||
| L-9 | Nit | `NotificationApplicationCompositionAutoConfiguration`에 `@Bean` 12개, 고아 Javadoc, inline FQN | 완료 | `src/composition/notification-platform/src/main/java/dev/caskeleton/composition/notification/NotificationApplicationCompositionAutoConfiguration.java:14-27`(`@Bean` 0, `@Import` 3개) → `NotificationSubmissionConfiguration`(7), `NotificationDeliveryConfiguration`(5), `NotificationCallbackConfiguration`(2). 커밋 `6d27356e` | - | - |
|
||||
| L-10a | Nit | outbox 설정 주석이 "NO env placeholders", "Bound into OutboxProperties"라 서술(실제 placeholder 있음, binder는 `OutboxSettings`) | 남음 | bootstrap `config/outbox.yml`은 삭제됐으나 주석이 `src/adapter/outbound/persistence-jpa/src/main/resources/config/module-defaults/persistence-jpa.yml:178-179`로 옮겨 살아 있음(placeholder `:188-192`, 바인더 `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/outbox/OutboxSettings.java`) | W5 | `persistence-jpa.yml:178-179`를 "Bound into OutboxSettings (app-bootstrap); enabled/relay-enabled/canonical-transport-enabled만 env"로, `:180`의 떨어진 relay-enabled 주석을 `:189` 위로 |
|
||||
| L-10b | Nit | `config/idempotency.yml`이 없는 `IdempotencyProperties`를 이름으로 가리킴 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "bootstrap 멱등성 조립 (… `config/idempotency.yml`)" 행 | - | - |
|
||||
@@ -162,23 +174,23 @@
|
||||
| B-2b | Critical | TopicArn allowlist 없음 | 완료 | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/provider/ses/SesCallbackAdapter.java:75-78`, 콜백 켜면 필수 `.../platform/autoconfigure/NotificationPlatformSettings.java:349-355`. 테스트 `SesCallbackAdapterTest.aSignedMessageFromAnotherTopicIsRejected`, `NotificationPlatformSettingsTest.sesCallbacksWithoutAnAllowedTopicListFailBinding`. 커밋 `6d27356e` | - | - |
|
||||
| B-2c | Critical | SNS `Timestamp` 미검사(재전송 무기한) | 완료 | `SesCallbackAdapter.java:79-81`·`withinReplayWindow`, `.../platform/autoconfigure/NotificationCallbackProviderConfig.java:93-98`(`callbacks.replay-skew`). 테스트 `SesCallbackAdapterTest.aSignedMessageOlderThanTheReplayWindowIsRejected`. 커밋 `6d27356e` | - | - |
|
||||
| B-2d | Critical | 인증서 캐시 무제한, `computeIfAbsent` 안에서 네트워크 fetch | 완료 | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/autoconfigure/NotificationCallbackProviderConfig.java:34`(상한 64), `:49-62`(fetch를 map 밖에서). 테스트 `SnsCertificateCacheTest.theCacheForgetsCertificatesOnceItPassesItsBound`·`aCachedCertificateIsNotFetchedAgain`. 커밋 `6d27356e` | - | - |
|
||||
| B-2e | Critical | 받아온 인증서의 subject 검사 없음 | 남음 | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/autoconfigure/NotificationCallbackProviderConfig.java:73-78`(`getPublicKey()`만 반환, `getSubjectX500Principal` 참조 0). host가 SNS 리전 host + https로 제한돼 잔여 위험은 낮음 | W1 | `NotificationCallbackProviderConfig`의 fetch에서 subject CN이 `sns.amazonaws.com`인지 확인 후 key 반환, 불일치 인증서 거부 테스트 추가 |
|
||||
| B-3 | Required | dispatch의 render·profile 실패가 attempt row 전에 터져 영원히 재큐(poison pill) | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/dispatch/NotificationDispatchService.java:146-147`(`insertDispatching` `:149-159` 전, catch 없음). 제출 검증은 `.../dispatch/NotificationSubmissionService.java:115` `templates.get`뿐. render 실패 테스트 없음(`NotificationDispatchServiceTest` 메서드 2개) | W2 | `NotificationDispatchService.dispatch`에서 render/profile의 `NotificationException`을 잡아 recipient를 FAILED(`TEMPLATE_FAILURE`)로 전이 후 lease 해제; `NotificationSubmissionService`에서 변수 스키마 검증을 먼저 수행; 재현 테스트 |
|
||||
| B-4a | Required | 모든 attempt가 완료된 DISPATCHING 행을 recovery가 그대로 둠 → 같은 행만 반복 선택 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/dispatch/LeaseRecoveryService.java:123-139`(`completedAt` 있는 attempt는 건너뜀, 행 상태 불변), `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/RecipientDeliveryJpaRepository.java:184-190`(`ORDER BY lease_until LIMIT`). 해당 테스트 없음 | W2 | `LeaseRecoveryService.recoverOnce`에서 attempt가 전부 완료면 마지막 attempt로 retry policy를 다시 적용해 recipient 상태 확정; `LeaseRecoveryServiceTest`에 케이스 추가 |
|
||||
| B-4b | Required | reconcile `Unsupported`(SMTP·SES)·`Failed`가 행을 DISPATCHING에 남김 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/dispatch/ReconciliationService.java:77-84`, `:126-133`(metric만 올림) | W2 | `ReconciliationService.reconcile`의 `Unsupported`·`Failed` 분기에서 recipient를 `RECONCILIATION_REQUIRED`로 전이(`inWrite`)해 recovery 대상에서 빼고 운영자에게 보이게 |
|
||||
| B-5a | Required | recorder가 late-match 콜백 투영 직후 dispatch 시작 시점 snapshot으로 recipient를 덮어씀 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/dispatch/DispatchOutcomeRecorder.java:100-106`(`bindUnmatched`→`project`), `:109-135`(`recipient.deliveryOutcome()`·`evidenceLevel()` 옛 값으로 `save`). `DispatchOutcomeRecorderTest` fake는 projection 저장 no-op | W2 | 투영 뒤 recipient를 다시 읽고 recorder가 소유한 필드만 갱신; fake가 투영을 실제로 반영하는 테스트 |
|
||||
| B-5b | Required | recorder의 recipient 저장이 lease fencing 없음(포트 계약 위반) | 남음 | `DispatchOutcomeRecorder.java:135` `recipients.save(updated)`; 계약 `.../dispatch/RecipientLeaseStorePort.java:14`("Every operation after the claim is fenced"); `saveHeldBy`는 `.../dispatch/RecipientDeliveryStorePort.java:35`에 이미 있음 | W2 | `record()`에 lease를 넘기고 `saveHeldBy(updated, lease)` 사용, 빈 결과면 lease 상실로 처리 |
|
||||
| B-6 | Required | 알림 HTTP 응답 "상한"이 body 전체를 읽은 뒤 잘라냄 | 남음 | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/provider/http/JdkNotificationHttpGateway.java:136-141`(`ofByteArray()` 후 `copyOf`), 주석 `:72-75`("끝없는 chunked 방지")는 사실과 다름. 초과 응답 테스트 없음. SNS 인증서 fetch도 이 gateway 사용(B-2d) | W1 | `boundedBody`를 `BodySubscribers.ofInputStream()`+`readNBytes(max)`(또는 상한 넘으면 구독 취소)로 교체, 초과 body 테스트 |
|
||||
| B-7a | Required | admin reconcile에 tenant 검사 없음 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/admin/NotificationAdminApplicationService.java:156-182`(`require(RECONCILE)`만; redrive `:105`·suppress `:210`은 `requireTenant` 호출) | W1 | attemptId마다 소유 tenant를 조회해 `authorization.requireTenant` 호출 |
|
||||
| B-7b | Required | tenant 범위 actor가 전역 provider 상태를 바꿀 수 있음 | 남음 | `NotificationAdminApplicationService.java:287-289`(`require(PROVIDER_CONTROL)`만) | W1 | `setProviderState`에서 `actor.tenantId()`가 있으면 거부 |
|
||||
| B-7c | Required | admin executor가 provider 호출까지 한 DB write 트랜잭션에 넣음 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/admin/AdminOperationExecutor.java:32-42`(claim+operation 한 `inWrite`) → reconcile 루프 `NotificationAdminApplicationService.java:179-182`의 provider 왕복이 한 트랜잭션 안 | W2 | executor는 claim과 결과 저장만 각각 트랜잭션으로, operation 본문(provider 호출)은 트랜잭션 밖에서 |
|
||||
| B-2e | Critical | 받아온 인증서의 subject 검사 없음 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `SnsCertificateCacheTest.aCertificateNotIssuedToSnsIsRefused` FAIL(`Expecting actual not to be null` — CN=sns.test.invalid 인증서의 키를 그대로 반환)→PASS. `ntf-adapter/autoconfigure/NotificationCallbackProviderConfig.java:89`(subject가 `CN=sns.amazonaws.com`/`.com.cn`이 아니면 거부), `:80` 유효기간 검사도 추가(P3-new-2) | - | `NotificationCallbackProviderConfig`의 fetch에서 subject CN이 `sns.amazonaws.com`인지 확인 후 key 반환, 불일치 인증서 거부 테스트 추가 |
|
||||
| B-3 | Required | dispatch의 render·profile 실패가 attempt row 전에 터져 영원히 재큐(poison pill) | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `NotificationDispatchServiceTest.aTemplateThatCannotRenderFailsTheDeliveryInsteadOfLeavingItClaimed` FAIL(`TemplateVariableValidationException: TEMPLATE_VARIABLES_INVALID`가 dispatch 밖으로 새어 lease가 남음)→PASS. `ntf-app/dispatch/NotificationDispatchService.java:147-163`(render·profile의 재시도 불가 `NotificationException` → 수신자 FAILED + `lastFailureCategory`, lease 해제), `:201` `failBeforeAttempt`(fenced `saveHeldBy`). 수정 방향의 "제출 시 변수 스키마 검증"은 하지 않았다: poison pill을 닫는 것은 dispatch 쪽 처리이고(템플릿 내용·엔진 오류도 여기서 걸림), 제출 검증은 `NotificationSubmissionService` 생성자·조립 변경이 필요한 입력 품질 개선이다 | - | `NotificationDispatchService.dispatch`에서 render/profile의 `NotificationException`을 잡아 recipient를 FAILED(`TEMPLATE_FAILURE`)로 전이 후 lease 해제; `NotificationSubmissionService`에서 변수 스키마 검증을 먼저 수행; 재현 테스트 |
|
||||
| B-4a | Required | 모든 attempt가 완료된 DISPATCHING 행을 recovery가 그대로 둠 → 같은 행만 반복 선택 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `LeaseRecoveryServiceTest.aDispatchingDeliveryWhoseAttemptsAllCompletedIsRequeued` FAIL(`Expecting actual: [] to contain exactly ... READY_TO_DISPATCH`)→PASS. `ntf-app/dispatch/LeaseRecoveryService.java:123-133`. 수정 방향(recovery에서 retry policy 재적용)보다 작게: recorder가 이미 결과를 수신자 행에 썼고 dispatch의 `RoutingDecisionEngine`이 그 사실(accepted면 stop→COMPLETED, ambiguous면 reconcile)로 다음 단계를 다시 정하므로 READY_TO_DISPATCH로 되돌리면 된다. recovery에 retry policy·profile 의존을 끌어오지 않는다 | - | `LeaseRecoveryService.recoverOnce`에서 attempt가 전부 완료면 마지막 attempt로 retry policy를 다시 적용해 recipient 상태 확정; `LeaseRecoveryServiceTest`에 케이스 추가 |
|
||||
| B-4b | Required | reconcile `Unsupported`(SMTP·SES)·`Failed`가 행을 DISPATCHING에 남김 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `ReconciliationServiceTest.anUnsupportedAnswerParksADispatchingDeliveryForAnOperator`, `aFailedAnswerParksADispatchingDeliveryForAnOperator` FAIL(`Expecting actual: [DISPATCHING, Optional[2026-09-20T00:00:00Z]] to contain exactly [RECONCILIATION_REQUIRED, Optional.empty]`)→PASS. `ntf-app/dispatch/ReconciliationService.java:126,132,148`(`parkForOperator`: DISPATCHING인 수신자만 `RECONCILIATION_REQUIRED`·next 없음으로, 이미 끝난 수신자는 그대로 — `anUnsupportedAnswerLeavesAFinishedDeliveryAlone`) | - | `ReconciliationService.reconcile`의 `Unsupported`·`Failed` 분기에서 recipient를 `RECONCILIATION_REQUIRED`로 전이(`inWrite`)해 recovery 대상에서 빼고 운영자에게 보이게 |
|
||||
| B-5a | Required | recorder가 late-match 콜백 투영 직후 dispatch 시작 시점 snapshot으로 recipient를 덮어씀 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `DispatchOutcomeRecorderTest.aLateMatchedCallbackProjectionIsNotOverwrittenByTheRecorder` FAIL(컴파일: `record(attempt, recipient, lease, …)` 시그니처 없음 — lease 인자를 요구하는 테스트)→PASS. fake 투영 저장소가 JPA처럼 수신자 행에 DELIVERED/DEVICE_DELIVERED를 올린다. `ntf-app/dispatch/DispatchOutcomeRecorder.java:122`(투영 뒤 수신자를 다시 읽고 recorder 소유 필드만 갱신) | - | 투영 뒤 recipient를 다시 읽고 recorder가 소유한 필드만 갱신; fake가 투영을 실제로 반영하는 테스트 |
|
||||
| B-5b | Required | recorder의 recipient 저장이 lease fencing 없음(포트 계약 위반) | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `DispatchOutcomeRecorderTest.aRecorderThatLostItsLeaseWritesNothingToTheRecipient` FAIL(컴파일, 위와 같음)→PASS. `DispatchOutcomeRecorder.java:153` `saveHeldBy(updated, lease)`, 호출 `NotificationDispatchService.java:194`. 빈 결과(lease 상실)면 쓰지 않고, 이어지는 next-step 쓰기도 fenced라 no-op | - | `record()`에 lease를 넘기고 `saveHeldBy(updated, lease)` 사용, 빈 결과면 lease 상실로 처리 |
|
||||
| B-6 | Required | 알림 HTTP 응답 "상한"이 body 전체를 읽은 뒤 잘라냄 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `JdkNotificationHttpGatewaySecurityTest.aResponseBodyThatNeverEndsIsCutAtTheCapWithoutWaitingForItsEnd` FAIL(`TimeoutException` — 요청 timeout 10초가 지나도 끝나지 않는 body를 끝까지 기다려 JUnit 20초 timeout)→PASS. `ntf-adapter/provider/http/JdkNotificationHttpGateway.java:147-160`(`ofInputStream` + `readNBytes(max)` 후 close, 읽기는 호출 스레드에서 `Supplier`로) | - | `boundedBody`를 `BodySubscribers.ofInputStream()`+`readNBytes(max)`(또는 상한 넘으면 구독 취소)로 교체, 초과 body 테스트 |
|
||||
| B-7a | Required | admin reconcile에 tenant 검사 없음 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `NotificationAdminApplicationServiceTest.aTenantScopedOperatorCannotReconcileAnotherTenantsAttempt` FAIL(`Expecting actual not to be null` — 예외 없이 진행)→PASS. `ntf-app/admin/NotificationAdminApplicationService.java:161-168`(attempt마다 소유 tenant 확인, 배치 중 하나라도 남의 것이면 아무것도 안 함). 없는 attemptId는 reconcile이 아무것도 하지 않으므로 검사 생략 | - | attemptId마다 소유 tenant를 조회해 `authorization.requireTenant` 호출 |
|
||||
| B-7b | Required | tenant 범위 actor가 전역 provider 상태를 바꿀 수 있음 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `NotificationAdminApplicationServiceTest.aTenantScopedOperatorCannotChangeAGlobalProviderState` FAIL(`Expecting actual not to be null`)→PASS. `ntf-app/admin/AdminAuthorizationGuard.java:58`(`requireGlobal`), 호출 `NotificationAdminApplicationService.java:305` | - | `setProviderState`에서 `actor.tenantId()`가 있으면 거부 |
|
||||
| B-7c | Required | admin executor가 provider 호출까지 한 DB write 트랜잭션에 넣음 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `NotificationAdminApplicationServiceTest.reconcileAsksTheProviderWithNoTransactionOpen` FAIL(`Expecting actual: [true] to contain exactly [false]`)→PASS. `ntf-app/admin/AdminOperationExecutor.java:54`(`executeOutsideTransaction`: claim 트랜잭션 → 본문 트랜잭션 없이 → 결과 저장은 본문이 자기 트랜잭션에서), reconcile만 이 경로(`NotificationAdminApplicationService.java:183`). 실패 시 claim을 `FAILED` 결과로 닫음(`AdminOperationExecutorTest.anOperationThatFailsOutsideTheTransactionCompletesItsClaimAsFailed`) — 안 닫으면 같은 id가 영구 IN_PROGRESS. redrive·suppress·provider state는 DB/메모리 작업뿐이라 기존 단일 트랜잭션 유지 | - | executor는 claim과 결과 저장만 각각 트랜잭션으로, operation 본문(provider 호출)은 트랜잭션 밖에서 |
|
||||
| B-7d | Required | tenant 거부를 항상 `SUPPRESS` 권한 부족으로 보고 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/admin/AdminAuthorizationGuard.java:42-43` | W5 | `requireTenant` 거부 사유를 tenant 범위 전용 값으로(또는 호출한 연산의 authority를 인자로) |
|
||||
| B-8a | Consider | caller 없는 R1 타입 약 95개 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "Notification R1 타입 96개(`NotificationPort`·`Notification`·`NotificationChannel` 제외)와 테스트 19개" 행. `git ls-files 'src/application-notification/src/main/java/dev/caskeleton/application/notification/*.java'` → 3개만 | - | - |
|
||||
| B-8b | Consider | 조립 0인 Reactor facade와 `reactor-core`·`reactor-test` 의존 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "Notification Reactor facade와 `reactor-core`·`reactor-test`·`spring-web` 의존" 행. `.../notification/platform/reactor` ls-files 0건, `src/adapter/outbound/notification/build.gradle`에 reactor 0건 | - | - |
|
||||
| B-8c | Consider | import 0인 `spring-web` 의존 | 해당 없음(코드 삭제) | 같은 표 행. `src/adapter/outbound/notification/build.gradle`에 `spring-web` 0건 | - | - |
|
||||
| B-8d | Consider | `EmailNotifier`·`SmsNotifier`·`MobilePushNotifier`·`WebPushNotifier`·`ApplicationReceiptServiceImpl` caller 없음 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "notification platform `sms`·`push`·`email`·`webpush` facade와 `ApplicationReceiptServiceImpl`" 행. `git grep` 0건 | - | - |
|
||||
| B-9a | Consider | SMTP 전송 전 실패(비 email 연락처, reveal 실패, 첨부 open 실패)가 ambiguous로 기록 | 남음 | `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/provider/smtp/SmtpNotificationProviderAdapter.java:86-93`(`reveal`, `IllegalArgumentException`), `:99`(`EmailAttachments.open`); `src/application-notification/.../dispatch/NotificationDispatchService.java:278-287`(그 외 `RuntimeException`→ambiguous) | W2 | `SmtpNotificationProviderAdapter.send`의 전송 전 단계 실패를 `ProviderCallNotStartedException`으로 변환 |
|
||||
| B-9b | Consider | notBefore 미도달 시 `next_dispatch_at`을 NULL로 전이 → 다시 claim 안 됨 | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/dispatch/DispatchPipeline.java:56-58`(`Blocked(READY_TO_DISPATCH)`) → `NotificationDispatchService.java:137-139`(`transition(..., Optional.empty())`); claim 조건 `src/adapter/outbound/persistence-jpa/.../notification/platform/RecipientClaimSql.java:29`(`next_dispatch_at <= :now`) | W2 | `Blocked`에 재시도 시각(`notBefore`)을 실어 `transition`에 전달 |
|
||||
| B-9a | Consider | SMTP 전송 전 실패(비 email 연락처, reveal 실패, 첨부 open 실패)가 ambiguous로 기록 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `SmtpNotificationProviderAdapterTest.aNonEmailContactPointFailsBeforeTheCallStarts` FAIL(`Expecting actual throwable to be an instance of ProviderCallNotStartedException but was IllegalArgumentException`)→PASS. `ntf-adapter/provider/EmailRecipients.java`(reveal 실패·비 email → `ProviderCallNotStartedException(CONTACT_POINT_INVALID, INVALID_RECIPIENT)`), SMTP `SmtpNotificationProviderAdapter.java:86`, SES도 같은 결함이라 함께 `SesNotificationProviderAdapter.java:111`. 첨부 open 실패는 이미 `AttachmentUnavailable/IntegrityException`(preDispatch, ambiguous=false)이라 dispatch가 not-submitted로 처리 — 변경 불필요 | - | `SmtpNotificationProviderAdapter.send`의 전송 전 단계 실패를 `ProviderCallNotStartedException`으로 변환 |
|
||||
| B-9b | Consider | notBefore 미도달 시 `next_dispatch_at`을 NULL로 전이 → 다시 claim 안 됨 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `NotificationDispatchServiceTest.aDeliveryBlockedByNotBeforeStaysScheduledForThatTime` FAIL(`Expecting Optional to contain: 2026-09-20T01:00:00Z but was empty`)→PASS. `ntf-app/dispatch/DispatchPipeline.java:60`(`Blocked`에 `notBefore`), `DispatchGuardOutcome.Blocked`에 `nextDispatchAt`, `NotificationDispatchService.java:142` | - | `Blocked`에 재시도 시각(`notBefore`)을 실어 `transition`에 전달 |
|
||||
| B-10a | Consider | adapter README·CLAUDE.md가 구현 전체를 "R0 legacy"로 서술 | 남음 | `src/adapter/outbound/notification/README.md:1-5`, `src/adapter/outbound/notification/CLAUDE.md:18-33` | W5 | R2 platform(SES·SMTP) 기준으로 다시 쓰고 legacy는 `core/`·`email/google`·`slack/webhook` seam만으로 한정 |
|
||||
| B-10b | Consider | `application-notification`에 CLAUDE.md 없음 | 남음 | `src/application-notification/`에 CLAUDE.md 없음(ls). 규칙은 `src/application-core/CLAUDE.md:78-79` 부근에 남아 있음 | W5 | `src/application-notification/CLAUDE.md` 신설, application-core의 notification 절을 옮김 |
|
||||
| B-10c | Consider | CLAUDE.md의 Boot 버전 4.0.0 | 남음 | `src/adapter/outbound/notification/CLAUDE.md:8` vs `src/gradle/libs.versions.toml:84`(`4.0.8`) | W5 | 4.0.8로 고치거나 버전 문구 삭제 |
|
||||
@@ -187,27 +199,27 @@
|
||||
| C-1a | Critical | tus `Upload-Checksum`을 chunk가 아니라 누적 digest와 비교 | 완료 | `src/adapter/outbound/fileserver/src/main/java/dev/caskeleton/adapter/outbound/fileserver/platform/local/LocalAppendEngine.java:64-66`(chunk 전용 digest), `:128-139`; `src/adapter/inbound/web-fileserver/src/main/java/dev/caskeleton/adapter/inbound/web/fileserver/tus/TusController.java:159,166-173`(기대 checksum을 append로 전달); fake `InMemoryUploadApplicationService.java:82-83`도 chunk 단위. 테스트 `TusProtocolContractTest.chunksCarryingTheirOwnCorrectChecksumAreAllAccepted`. 커밋 `6d27356e` | - | - |
|
||||
| C-1b | Critical | checksum 비교가 offset 커밋 뒤 → 불일치 chunk 저장·offset 전진 | 완료 | `LocalAppendEngine.java:74-80`(rollback 경계 안에서 검증, truncate); `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultUploadApplicationService.java:217-222`(append 성공 후에만 `commitOffset`). 테스트 `TusProtocolContractTest.aChunkRejectedForItsChecksumDoesNotAdvanceTheOffset`, `LocalStorageGatewayContractTest.aChunkWhoseChecksumDoesNotMatchIsRejectedAndRolledBackToItsPreAppendLength`. 커밋 `6d27356e` | - | - |
|
||||
| C-1c | Critical | 불일치를 422로 응답(tus는 460) | 완료 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/api/error/FileserverErrorCode.java:47`(`CHECKSUM_MISMATCH(460)`). 테스트 `TusProtocolContractTest.aChunkWhoseChecksumDoesNotMatchAnswersChecksumMismatch`. 커밋 `6d27356e` | - | - |
|
||||
| C-2a | Required | QUARANTINE 판정도 staging bytes 삭제 예약 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultFinalizeUploadService.java:250-252`(REJECT·QUARANTINE 공통 `FAILED_VERIFICATION_CONTENT` enqueue), javadoc `:220-221`("only REJECT")과 모순 | W1 | `applyNonAcceptVerdict`에서 cleanup enqueue를 REJECT일 때만(QUARANTINE은 quarantine 영역으로 이동 또는 보존) |
|
||||
| C-2b | Required | staging cleanup이 레코드 상태 재확인 없이 삭제 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/cleanup/DefaultCleanupService.java:134-146`(`isReclaimable` `:219-223`은 `cleanContent`에만 적용) | W1 | `cleanStaging`에서 fileId 레코드를 읽어 QUARANTINED면 skip |
|
||||
| C-3a | Required | `reconcileRecoverable`·`RecoveryQueue`를 소비하는 곳 없음 | 남음 | bean 정의만 `src/adapter/outbound/fileserver/src/main/java/dev/caskeleton/adapter/outbound/fileserver/platform/autoconfigure/FileserverMaintenanceServiceConfiguration.java:59-65`; main에서 `reconcileRecoverable` 호출 0(`git grep`); composition의 주기 worker는 `FileserverCleanupWorker`뿐 | W2 | `src/composition/fileserver-platform`에 `FileserverCleanupWorker`와 같은 방식으로 `reconcileRecoverable`을 주기 호출하는 worker 추가 |
|
||||
| C-3b | Required | content key가 READY 커밋에만 기록 → pre-publish 복구 경로 도달 불가 | 남음 | `DefaultFinalizeUploadService.java:115`(publish) 뒤 `:303-310`(`publishAt(contentKey)`)에서만 key 저장, VERIFYING 전이 `:171-201`에는 key 없음 | W2 | `ContentKey`를 application이 정해 VERIFYING에 먼저 저장(write-ahead)한 뒤 move |
|
||||
| C-3c | Required | publish의 `AmbiguousCompletionException`이 recovery queue로 안 감 | 남음 | `DefaultFinalizeUploadService.java:115`(try 없음). enqueue는 `commitReady` 실패 경로 `:318-323`뿐 | W2 | `publish` 호출을 감싸 ambiguous면 `recoveryQueue.enqueue`(`inNew`) 후 재던짐 |
|
||||
| C-3d | Consider | (리뷰 외, `6d27356e` 회귀) 보상·복구용 REQUIRES_NEW 쓰기의 30초 상한 소실 | 남음 | `208077fd`의 `FileserverCompensationTransaction`(BUDGET 30s)을 `transactions.inNew`로 교체: `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultUploadApplicationService.java:155`, `DefaultFinalizeUploadService.java:321`; `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/transaction/SpringTransactionPort.java:50-55`(requiresNew template timeout 미설정) | W2 | `SpringTransactionPort`의 `requiresNewTemplate`에 timeout(30s) 설정(`inNew`는 outbox·audit·보상 전용이라 공통 상한으로 충분) |
|
||||
| C-4a | Required | cancel이 READY 파일에도 staging cleanup만 예약 → 게시된 bytes·quota 영구 잔존 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultUploadApplicationService.java:252-273`(`forStaging`만); `src/adapter/outbound/persistence-fileserver/src/main/java/dev/caskeleton/adapter/outbound/persistence/fileserver/repository/FileTransitionRepository.java:67-68`(`markDeleting`이 READY 허용) | W2 | UPLOADED 이후 cancel은 거부(409)하거나 `DefaultFileLifecycleService.delete`(`:71-104`)의 retire 경로 재사용 |
|
||||
| C-4b | Required | staging cleanup이 DELETING→DELETED 전이를 안 함 → 취소된 upload 전부 DELETING 고착 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/cleanup/DefaultCleanupService.java:134-146`(`discardStaging`+`markDone`만) | W2 | `cleanStaging` 끝에서 레코드 DELETING→DELETED(+quota release)를 같은 트랜잭션으로 |
|
||||
| C-5a | Required | 만료 upload를 치우는 sweep 없음(`EXPIRED_UPLOAD` 생산자 0) | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/cleanup/CleanupType.java:10`; main에서 `EXPIRED_UPLOAD` enqueue 0(`git grep`) | W1 | cleanup worker에 `expiresAt` 지난 session을 EXPIRED로 전이하고 `EXPIRED_UPLOAD`를 예약하는 sweep 추가 |
|
||||
| C-5b | Required | orphan 항목은 삭제 없이 done, orphan scan은 contentRoot만 | 남음 | `DefaultCleanupService.java:154-158`(fileId 없음→`markDone`); `src/application-fileserver/.../admin/DefaultFileserverAdminService.java:118-124`(quarantine로 옮긴 뒤 `forOrphan`); `src/adapter/outbound/fileserver/src/main/java/dev/caskeleton/adapter/outbound/fileserver/platform/local/LocalOrphanScanAdapter.java:63,81` | W2 | orphan 항목은 quarantine 경로의 object를 실제 삭제; staging root도 scan |
|
||||
| C-5c | Required | `Upload-Defer-Length: 1` 수락하지만 길이를 확정할 방법 없음 → 끝나지 않는 upload | 남음 | `src/adapter/inbound/web-fileserver/src/main/java/dev/caskeleton/adapter/inbound/web/fileserver/tus/TusRequestParser.java:64-66`; PATCH `TusController.java:153-184`는 `Upload-Length`를 읽지 않음 | W1 | 구현 전까지 `TusRequestParser.declaredLength`에서 `Upload-Defer-Length` 거부 |
|
||||
| C-6 | Required | terminal 세션을 살아 있는 세션으로 취급 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/api/metadata/UploadSession.java:32`(`terminal`, main 참조 0); `DefaultUploadApplicationService.java:321-329`(`requireActiveSession`), `:243-249`(`status`); `src/adapter/outbound/persistence-fileserver/src/main/java/dev/caskeleton/adapter/outbound/persistence/fileserver/JpaUploadSessionStore.java:156-159`("lease held by another owner", retryable=true) | W2 | `requireActiveSession`·`status`에서 `terminal()`이면 410(또는 404) |
|
||||
| C-7a | Required | append마다 prefix 전체를 다시 해시(O(n²) IO) | 남음 | `src/adapter/outbound/fileserver/src/main/java/dev/caskeleton/adapter/outbound/fileserver/platform/local/LocalBlockingContentStore.java:386-395`(`reattach`가 매번 새 handle) → `LocalAppendEngine.java:59-62`(`rehashPrefix`) | W2 | uploadId별 상한 있는 digest 캐시(offset 키)를 store에 두고 `reattach`가 재사용 |
|
||||
| C-7b | Required | finalize가 파일을 두 번 더 읽고 servlet 스레드에서 실행 | 남음 | `LocalBlockingContentStore.java:367-383`(`stagingDigest`), `.../platform/local/ContentPublishVerification.java:33`(`verifyStaged`); `TusController.java:178`(`transferExecutor` 밖) | W2 | `stagingDigest` 결과를 `verifyStaged`에 넘겨 재사용, finalize 호출을 `transferExecutor` 안으로 |
|
||||
| C-8a | Required | 인가가 역할 등급만 보고 파일 owner가 없음 | 남음 | `src/adapter/outbound/fileserver/src/main/java/dev/caskeleton/adapter/outbound/fileserver/platform/security/RoleBasedFileAccessPolicy.java:51-68`(`descriptor` 미사용); `src/application-fileserver/.../api/metadata/FileDescriptor.java:10`(owner 필드 없음); 업로드는 모두 기본 namespace(`TusController.java:107`, `.../controller/FileUploadController.java:185`, `.../draft12/Draft12UploadController.java:87`) | W1 | 결정(2026-09-25): 소유자 검사 추가 — `FileRecord`에 `ownerPrincipalId`(새 migration), 기본 정책이 소유자·tenant 검사 |
|
||||
| C-8b | Required | `FileOperation.FINALIZE`를 인가하지 않음 | 남음 | main에서 `FileOperation.FINALIZE` 참조 0(테스트 `RoleBasedFileAccessPolicyTest.java:66`뿐); `DefaultFinalizeUploadService.java:97-117`에 authorize 없음; `docs/fileserver/security.md:54`("Every public operation calls the injected FileAccessPolicy") | W1 | `DefaultFinalizeUploadService.finalizeUpload`에서 FINALIZE authorize(또는 enum 값 삭제+문서 정정) |
|
||||
| C-8c | Required | admin 조회가 READ_METADATA 등급으로 인가 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/admin/DefaultFileserverAdminService.java:209-211`(transport `RestrictedPathRule`로 완화됨) | W1 | admin 조회용 ADMIN 등급 operation으로 authorize |
|
||||
| C-9a | Required | 업로드 동시성 한도 초과를 `QUOTA_EXCEEDED`(413, 재시도 불가)로 응답 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/quota/DefaultTransferAdmissionController.java:52-57`; `.../api/error/FileserverErrorCode.java:37` | W2 | scope 한도 초과도 `TRANSFER_ADMISSION_REJECTED`(429, retryable)로 |
|
||||
| C-9b | Required | 모든 업로드가 기본 namespace 한 scope → 노드당 동시 업로드 4 | 남음 | `src/composition/fileserver-platform/src/main/resources/config/module-defaults/fileserver.yml:73-74`(scope 4 < instance 16); 컨트롤러 3곳 `defaultNamespace()`(C-8a 근거와 같음) | W2 | scope를 principal 기준으로(C-8a 결정과 함께) |
|
||||
| C-2a | Required | QUARANTINE 판정도 staging bytes 삭제 예약 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FinalizeUploadServiceTest.aQuarantineVerdictSchedulesNoCleanupOfTheStagedBytes` FAIL(`Expecting empty but was: [CleanupItem[... FAILED_VERIFICATION_CONTENT ...]]`)→PASS. `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultFinalizeUploadService.java:272`(REJECTED일 때만 staging cleanup 예약, QUARANTINE은 세션만 terminal) | - | `applyNonAcceptVerdict`에서 cleanup enqueue를 REJECT일 때만(QUARANTINE은 quarantine 영역으로 이동 또는 보존) |
|
||||
| C-2b | Required | staging cleanup이 레코드 상태 재확인 없이 삭제 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `CleanupServiceTest.aStagingItemForAQuarantinedFileLeavesTheStagedBytesInPlace` FAIL(`Expecting value to be true but was false`)→PASS. `.../cleanup/DefaultCleanupService.java:197`(QUARANTINED면 삭제 없이 done) | - | `cleanStaging`에서 fileId 레코드를 읽어 QUARANTINED면 skip |
|
||||
| C-3a | Required | `reconcileRecoverable`·`RecoveryQueue`를 소비하는 곳 없음 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FileserverCleanupWorkerTest.aRunReconcilesTheFilesWhoseOutcomeWasLeftOpen`, `aFailingCleanupBatchStillLetsReconciliationRun` — FAIL은 컴파일 실패(`constructor FileserverCleanupWorker ... cannot be applied`, reconciliation을 받을 방법이 없었음)→PASS. 별도 worker 대신 기존 `FileserverCleanupWorker`가 매 회차 cleanup 뒤 `reconcileRecoverable(maxItems)`를 독립 try로 실행(`src/composition/fileserver-platform/.../FileserverCleanupWorker.java`, `FileserverCleanupConfiguration`). 같은 `cleanup.enabled` 스위치를 쓴다(설정 키 추가 없음). recovery queue는 pending 중복을 갱신만 한다(`JpaRecoveryQueue.enqueue`) | - | `src/composition/fileserver-platform`에 `FileserverCleanupWorker`와 같은 방식으로 `reconcileRecoverable`을 주기 호출하는 worker 추가 |
|
||||
| C-3b | Required | content key가 READY 커밋에만 기록 → pre-publish 복구 경로 도달 불가 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FinalizeUploadServiceTest.theContentKeyIsRecordedBeforeThePublishIsAttempted` FAIL(`Expecting Optional to contain a value but it was empty`)→PASS. `DefaultFinalizeUploadService.java:214`(UPLOADED→VERIFYING 전이에 `FileRecordMutation.intendedContentKey`), `UploadContentGateway.newContentKey()`, `FinalizeContentCommand.contentKey`(기존 4인자 생성자 유지), publisher가 그 key로 게시(`AtomicMoveContentPublisher`, `MetadataPointerContentPublisher`). 부수 조치: 검증은 staged bytes를 읽도록 `VerificationRequest.contentKey=empty`(미게시 key로 읽으면 RETRY 고착), 미게시 key의 content 정리는 quota를 회수하지 않음(`DefaultCleanupService.java:275`, `publishedAt` 있을 때만) | - | `ContentKey`를 application이 정해 VERIFYING에 먼저 저장(write-ahead)한 뒤 move |
|
||||
| C-3c | Required | publish의 `AmbiguousCompletionException`이 recovery queue로 안 감 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FinalizeUploadServiceTest.anAmbiguousPublishIsQueuedForRecovery` FAIL(`... to contain entry PUBLISH_UNCONFIRMED`)→PASS. `DefaultFinalizeUploadService.java:130`(inNew로 recovery 기록 후 재던짐, 기록 실패는 suppressed) | - | `publish` 호출을 감싸 ambiguous면 `recoveryQueue.enqueue`(`inNew`) 후 재던짐 |
|
||||
| C-3d | Consider | (리뷰 외, `6d27356e` 회귀) 보상·복구용 REQUIRES_NEW 쓰기의 30초 상한 소실 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): NEW-3과 같은 결함. `TransactionPort`에 timeout 옵션이 없어 가장 작은 변경으로 `SpringTransactionPort`의 REQUIRES_NEW template에 30초 설정. `SpringTransactionPortTest.inNewBoundsItsTransactionToThirtySeconds` FAIL(`expected: 30 but was: -1`)→PASS. `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/transaction/SpringTransactionPort.java:62`. 포트 시그니처 변경 없음(구현·fake 수정 불필요). `verifyJpaApiSurface` OK | - | `SpringTransactionPort`의 `requiresNewTemplate`에 timeout(30s) 설정(`inNew`는 outbox·audit·보상 전용이라 공통 상한으로 충분) |
|
||||
| C-4a | Required | cancel이 READY 파일에도 staging cleanup만 예약 → 게시된 bytes·quota 영구 잔존 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `UploadApplicationServiceTest.cancellingAPublishedUploadQueuesItsContentForReclamation` FAIL(`[CANCELLED_STAGING] to contain [DELETED_READY_CONTENT]`)→PASS. cancel이 `FileRetirement.retire(record, uploadId)`를 쓴다(`DefaultUploadApplicationService.java:265`): content key가 있으면 content 정리도 예약. 409 거부 대신 retire 재사용을 택함(삭제와 같은 DELETE 인가를 이미 거침) | - | UPLOADED 이후 cancel은 거부(409)하거나 `DefaultFileLifecycleService.delete`(`:71-104`)의 retire 경로 재사용 |
|
||||
| C-4b | Required | staging cleanup이 DELETING→DELETED 전이를 안 함 → 취소된 upload 전부 DELETING 고착 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `CleanupServiceTest.aCancelledUploadReachesDeletedOnceItsStagingIsReclaimed` FAIL(`expected: DELETED but was: DELETING`)→PASS. `DefaultCleanupService.java:218`(staging 정리와 같은 트랜잭션에서 content key 없는 DELETING→DELETED). quota release는 넣지 않았다: reservation은 upload에 연결되지 않은 scope 단위 TTL 장부이고 만료로 정리된다(`JpaQuotaCommitGateway` 설계 주석) | - | `cleanStaging` 끝에서 레코드 DELETING→DELETED(+quota release)를 같은 트랜잭션으로 |
|
||||
| C-5a | Required | 만료 upload를 치우는 sweep 없음(`EXPIRED_UPLOAD` 생산자 0) | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `CleanupServiceTest.anUploadPastItsExpiryIsMovedToExpired` FAIL(`expected: EXPIRED but was: UPLOADING`)→PASS, `theStagedBytesOfAnExpiredUploadAreReclaimed` FAIL(`Expecting value to be false but was true`)→PASS, W2에서 `anUploadThatExpiredBeforeItsFirstAppendIsExpiredToo` FAIL(`expected: EXPIRED but was: CREATED`)→PASS. `DefaultCleanupService.java:125`(batch 시작 시 만료 열린 세션 terminal → CREATED/UPLOADING/FAILED 레코드 EXPIRED + `EXPIRED_UPLOAD` 예약). 반복 조회로 limit가 막히지 않게 `findExpired`는 terminal 세션 제외: `src/adapter/outbound/persistence-fileserver/.../repository/JpaUploadSessionRepository.java:19`, PG `PostgreSqlFileserverMetadataStoreIntegrationTest.aTerminatedExpiredSessionIsNotListedAgain` PASS | - | cleanup worker에 `expiresAt` 지난 session을 EXPIRED로 전이하고 `EXPIRED_UPLOAD`를 예약하는 sweep 추가 |
|
||||
| C-5b | Required | orphan 항목은 삭제 없이 done, orphan scan은 contentRoot만 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `CleanupServiceTest.aRetiredOrphanIsPurgedFromQuarantine` FAIL(`Expecting value to be false but was true`)→PASS. `CleanupContentGateway.purgeQuarantined` 추가, `DefaultCleanupService.java:243`, `LocalCleanupContentGateway.java:41`(ledger를 다시 확인하는 `OrphanScanPort.purgeQuarantined`에 위임). staging root scan은 하지 않았다(더 작은 수정): staging 객체는 항상 세션이 있고(세션 commit 뒤에만 생성), 이제 모든 세션 끝(cancel·reject·C-5a 만료, CREATED 포함)이 staging 정리를 예약하므로 scan이 찾을 대상은 대기 중인 정리 항목뿐이다. 예외 한 가지는 P4-new-4 | - | orphan 항목은 quarantine 경로의 object를 실제 삭제; staging root도 scan |
|
||||
| C-5c | Required | `Upload-Defer-Length: 1` 수락하지만 길이를 확정할 방법 없음 → 끝나지 않는 upload | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `TusProtocolContractTest.aCreateThatDefersItsLengthIsRefusedBecauseTheExtensionIsNotOffered` FAIL(`Status expected:<400> but was:<201>`)→PASS. `src/adapter/inbound/web-fileserver/.../tus/TusRequestParser.java:65`. 기존 `aDeferredLengthUploadIsNeverAutoFinalized`는 이 테스트로 대체 | - | 구현 전까지 `TusRequestParser.declaredLength`에서 `Upload-Defer-Length` 거부 |
|
||||
| C-6 | Required | terminal 세션을 살아 있는 세션으로 취급 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `UploadApplicationServiceTest.anAppendToACancelledUploadIsRefusedAsGone` FAIL(`Expecting actual throwable to be an instance of UploadExpiredException`, 실제는 재시도 가능한 lease 충돌)→PASS, `theStatusOfACancelledUploadIsGone` FAIL(`Expecting actual not to be null`)→PASS. `DefaultUploadApplicationService.java:332`(terminal → `UPLOAD_EXPIRED` 410), status도 `requireActiveSession`(`:245`) | - | `requireActiveSession`·`status`에서 `terminal()`이면 410(또는 404) |
|
||||
| C-7a | Required | append마다 prefix 전체를 다시 해시(O(n²) IO) | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `LocalAppendEngineTest.aReattachedHandleResumesTheRunningDigestInsteadOfRereadingThePrefix` FAIL(`Expecting Optional to contain a value but it was empty`)→PASS, 보호 테스트 `aRolledBackAppendLeavesTheCachedDigestDescribingOnlyTheSurvivingPrefix` PASS. `src/adapter/outbound/fileserver/.../local/LocalBlockingContentStore.java:61,187,437`(uploadId별 LRU 1024, 복사본으로 넣고 꺼냄, 실패·finalize·discard 시 제거), `StreamingDigest.copy()` | - | uploadId별 상한 있는 digest 캐시(offset 키)를 store에 두고 `reattach`가 재사용 |
|
||||
| C-7b | Required | finalize가 파일을 두 번 더 읽고 servlet 스레드에서 실행 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `TusProtocolContractTest.theCompletingPatchFinalizesOnTheTransferExecutor` FAIL(`"Test worker" to start with "fs-transfer-"`)→PASS. `TusController.java:180`, draft-12도 동일(`Draft12UploadController.java:151`). 파일 재읽기: C-7a 캐시로 `stagingDigest`가 보통 디스크를 읽지 않으므로 finalize의 전체 읽기는 `verifyStaged` 1회로 줄었다. `stagingDigest` 결과를 `verifyStaged`에 넘겨 그 1회까지 없애는 것은 하지 않았다 — 디스크에서 다시 증명한다는 게시 설계(`ContentPublishVerification` 주석)를 버리게 되고, finalize는 writer lease 없이 실행되기 때문 | - | `stagingDigest` 결과를 `verifyStaged`에 넘겨 재사용, finalize 호출을 `transferExecutor` 안으로 |
|
||||
| C-8a | Required | 인가가 역할 등급만 보고 파일 owner가 없음 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): 결정 14. `RoleBasedFileAccessPolicyTest.aCallerWithTheSameRolesIsDeniedAFileSomebodyElseOwns`(READ_METADATA·DOWNLOAD·APPEND·FINALIZE·DELETE·COPY·MOVE 7건), `theSamePrincipalInAnotherTenantIsDeniedTheFile`, `aFileWithNoRecordedOwnerIsDeniedToEveryDataPlaneCaller` 모두 FAIL(`Expecting actual not to be null` = 거부 안 됨)→PASS, `theOwnerIsGrantedEveryDataOperationWithoutAnException` PASS. `src/adapter/outbound/fileserver/.../security/RoleBasedFileAccessPolicy.java:74,86`. 모델: `FileOwner`(`.../api/metadata/FileOwner.java`), `FileRecord.owner`/`FileDescriptor.owner`/`FileRecordDraft.owner`, 생성 시 `context.subject().asOwner()`(`DefaultUploadApplicationService`, copy는 복사한 사람). 저장: `V5__fileserver_file_owner.sql`(`owner_principal_id varchar(256)`, `owner_tenant_id varchar(64)`), `FileEntity`·`FileEntityMapper`·`JpaFileMetadataStore.insert`. PG `aNewRecordKeepsTheOwnerItWasCreatedFor` PASS, `UploadApplicationServiceTest.aCreatedFileIsOwnedByTheCallerInItsTenant` PASS. **기존 행(owner NULL) 처리:** data plane에서는 누구에게도 허용하지 않는다(fail closed). 소유자를 추론할 근거가 없고, 역할 모델상 남의 파일에 대한 조치는 감사되는 관리 plane(force-delete·reverify, descriptor 없음)이 담당하기 때문이다. **ADMIN 예외:** 두지 않는다. 기존 역할 모델이 "admin은 write를 상속하지 않는다"이므로 data plane 연산은 admin 역할이어도 소유자 검사를 받는다. **anonymous read**가 켜진 배포는 전 파일 공개를 선택한 것이라 read 등급에서 소유자 검사를 건너뛴다(기존 의미 유지). **tenant:** subject 속성 `tenant`(`FileAccessSubject.TENANT_ATTRIBUTE`)와 비교한다. web 플랫폼은 아직 tenant를 해석하지 않아(`WebRequestContext`를 만드는 곳 없음) 현재는 양쪽 모두 비어 있고, transport가 속성을 채우면 그대로 적용된다. 문서 `docs/fileserver/security.md` 「Authorization」 | - | 결정(2026-09-25): 소유자 검사 추가 — `FileRecord`에 `ownerPrincipalId`(새 migration), 기본 정책이 소유자·tenant 검사 |
|
||||
| C-8b | Required | `FileOperation.FINALIZE`를 인가하지 않음 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FinalizeUploadServiceTest.aCallerTheFinalizeOperationIsDeniedToPublishesNothing` FAIL(`Expecting actual not to be null`)→PASS. `DefaultFinalizeUploadService.java:109`(digest·검증·publish 전에 FINALIZE 인가, 정책은 생성자 주입 — `composition/.../FileserverUploadServiceConfiguration`) | - | `DefaultFinalizeUploadService.finalizeUpload`에서 FINALIZE authorize(또는 enum 값 삭제+문서 정정) |
|
||||
| C-8c | Required | admin 조회가 READ_METADATA 등급으로 인가 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FileserverAdminServiceTest.aCallerDeniedAdminReadsCannotSeeStorageHealth` FAIL(`Expecting actual not to be null`)→PASS. 새 `FileOperation.ADMIN_READ`(admin 등급, `RoleBasedFileAccessPolicy.java:102`), `DefaultFileserverAdminService.java:206`. `RoleBasedFileAccessPolicyTest.adminReadsNeedTheAdminRoleRatherThanTheReadRole` PASS | - | admin 조회용 ADMIN 등급 operation으로 authorize |
|
||||
| C-9a | Required | 업로드 동시성 한도 초과를 `QUOTA_EXCEEDED`(413, 재시도 불가)로 응답 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `TransferAdmissionControllerTest.anExhaustedScopeIsARetryableAdmissionRejection` FAIL(`... to be an instance of TransferAdmissionRejectedException`)→PASS. `src/application-fileserver/.../quota/DefaultTransferAdmissionController.java:61` | - | scope 한도 초과도 `TRANSFER_ADMISSION_REJECTED`(429, retryable)로 |
|
||||
| C-9b | Required | 모든 업로드가 기본 namespace 한 scope → 노드당 동시 업로드 4 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `UploadApplicationServiceTest.admissionIsCountedPerCallerRatherThanPerNamespace` FAIL(`expected: null but was: QuotaExceededException`)→PASS. `DefaultUploadApplicationService.java:280`(`QuotaScope.ofPrincipal`, create·append). quota 예약은 namespace 그대로. principal 수가 무한하므로 표가 차면 유휴(모든 permit 반환) semaphore를 버린다(`DefaultTransferAdmissionController.java:123`, 조회+획득을 한 lock 안에서): `newCallersStillGetTheirOwnScopeOnceTheTableHasFilledWithIdleOnes` FAIL(`expected: null but was: QuotaEx...`)→PASS. 기존 `scopeSemaphoreRegistryIsBoundedAndOverflowScopesShareConservativeCapacity`는 이 동작과 모순이라 `theScopeRegistryStaysBoundedAsCallersComeAndGo`로 교체. env 설명 갱신(`docs/registries/env-keys.yaml` `..._SCOPE_UPLOAD_PERMITS`, `docs/fileserver/configuration.md`) | - | scope를 principal 기준으로(C-8a 결정과 함께) |
|
||||
| C-10 / S2-#11 | Required | persistence-fileserver의 경쟁 조건 SQL에 leaf 테스트 0 | 남음 | `git ls-files src/adapter/outbound/persistence-fileserver` → `build.gradle`·lockfile·main만; 실 SQL 검증은 `src/adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/.../readiness/PostgreSqlFileserver*IntegrationTest.java` 3개(다른 leaf)<br>S2-#11: `persistence-jpa/build.gradle:94-95,157-159`, jpa `postgresqlIntegrationTest/.../readiness/PostgreSqlFileserver*IntegrationTest.java` 3개 + `FileserverJpaTestContext`, `persistence-fileserver/.../JpaFileQuotaService.java:88,93` 테스트용 public, `persistence-fileserver/src`에 test 없음·README/CLAUDE.md 없음 | W4 | persistence-fileserver 자체 strict lane에 acquire-after-terminate, claim-while-leased, stale-token settlement 테스트 추가(PG 테스트 이관)<br>S2-#11: persistence-fileserver에 자기 IT source set(`testFixtures(project(':adapter:outbound:persistence-jpa'))` 재사용)으로 이동, 짧은 CLAUDE.md 추가 |
|
||||
| C-11 | Consider | Draft-12 create가 POST body를 버리고 Content-Length를 최종 길이로 사용 | 남음 | `src/adapter/inbound/web-fileserver/src/main/java/dev/caskeleton/adapter/inbound/web/fileserver/draft12/Draft12UploadController.java:82-99`, `:171-174` | W2 | `declaredLength`를 `Upload-Length` 헤더에서 읽고, POST body가 있으면 append |
|
||||
| C-11 | Consider | Draft-12 create가 POST body를 버리고 Content-Length를 최종 길이로 사용 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `Draft12ProtocolTest.aCreationBodyIsStoredAsTheFirstPartOfTheUpload` FAIL(`expected: "abc" but was: ""`)→PASS, `theFinalLengthComesFromUploadLengthRatherThanTheCreationBody` FAIL(`OptionalLong[3] to contain 6L`)→PASS. `Draft12UploadController.java:109,205`(`Upload-Length` 헤더, POST body는 offset 0 append, `Upload-Complete: ?1`이면 finalize). 한계: Content-Length 없는 chunked POST body는 저장하지 않는다 | - | `declaredLength`를 `Upload-Length` 헤더에서 읽고, POST body가 있으면 append |
|
||||
| C-12a | Nit | outbound/fileserver CLAUDE.md가 의존 2개·bootstrap 소유로 서술 | 완료 | `src/adapter/outbound/fileserver/CLAUDE.md:15-27`(modules.json SSOT 참조로 교체, bootstrap 소유 문구 삭제). 커밋 `6d27356e` | - | - |
|
||||
| C-12b | Nit | composition build.gradle 주석이 HTTP는 `adapter:inbound:web`, 테이블은 `persistence-jpa`라고 서술 | 남음 | `src/composition/fileserver-platform/build.gradle:8-10`(실제 의존은 `:26` web-fileserver, `:32` persistence-fileserver) | W5 | 주석을 web-fileserver·persistence-fileserver로 |
|
||||
| C-12c | Nit | (리뷰 이후 새 drift) 같은 CLAUDE.md가 "default off"·Boot 4.0.0 | 남음 | `src/adapter/outbound/fileserver/CLAUDE.md:8`, `:19` vs `src/composition/fileserver-platform/src/main/resources/config/module-defaults/fileserver.yml:22`(`enabled: ...:true`), `src/gradle/libs.versions.toml:84` | W5 | "모듈이 있으면 켜짐, false로만 끔"과 4.0.8로 |
|
||||
@@ -224,31 +236,31 @@
|
||||
|
||||
| ID | 심각도 | 요약 | 상태 | 근거 | Wave | 수정 방향 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| D-1a | Required | staged `abort`가 operation 단계 확인 없이 provider `retire`(실제 삭제)부터 호출 → PUBLISHED면 삭제 후 `terminate`에서 예외, 참조·manifest는 PUBLISHED로 남음 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:257-269`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/control/ObjectOperationRecord.java:142-148`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/filesystem/LocalDevObjectDataStore.java:147-155`. kernel·control은 208077fd 이후 무변경 | W1 | `abort`에서 `loadOperation`을 먼저 하고 `REFERENCE_PUBLISH_IN_PROGRESS`/`PUBLISHED`면 거부, `retire` 전에 ABORT_IN_PROGRESS를 CAS로 기록 |
|
||||
| D-1b | Required | `authorizeAbort`가 stage·handoff만 보고 operation 단계를 보지 않음 → release 또는 lease 만료 후 publish 단계에서도 abort 허가 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/ObjectPublicationHandoffService.java:101-113`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/control/ObjectPublicationHandoffRecord.java:136-139` | W1 | `ObjectPublicationHandoffService.authorizeAbort`에서 operation을 읽어 `REFERENCE_PUBLISH_IN_PROGRESS` 이후면 거부 |
|
||||
| D-1c | Required | `finalizePublication`이 handoff를 읽지 않고 `ObjectFinalizeRequest`에 fence·claimant가 없음 → lease 만료 후 늦은 finalize가 abort와 경쟁 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:183-237`, `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/request/ObjectFinalizeRequest.java:11-17` | W1 | `ObjectFinalizeRequest`에 `handoffFence`·`claimant` 추가, finalize가 활성·일치 lease를 요구. sample `ReconcilePosterImageUploadUseCase.java:105-112` 호출부 갱신 |
|
||||
| D-2a | Required | 이미 release된 handoff에 `release` 재호출 시 "owner/fence is stale" 예외 → sample reconcile이 terminal READY마다 `releaseClaim`을 불러 두 번째 reconcile이 항상 실패 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/control/ObjectPublicationHandoffRecord.java:119-120,165-171`, `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/application/poster/ReconcilePosterImageUploadUseCase.java:96-97,122-137` | W2 | `ObjectPublicationHandoffRecord.release`: 같은 fence·claimant로 이미 released면 쓰기 없이 REPLAYED, `releaseClaim`이 그 결과를 반환 |
|
||||
| D-2b | Required | `authorizeAbort` 재호출이 idempotent하지 않음: 첫 호출이 `released=false`로 되돌려 lease가 남아 있으면 예외, 지났으면 새 revision을 쓰고 항상 APPLIED | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/control/ObjectPublicationHandoffRecord.java:136-152`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/ObjectPublicationHandoffService.java:101-113` | W2 | 이미 `abortAuthorized`이고 fence가 같으면 쓰기 없이 REPLAYED |
|
||||
| D-2c | Required | 두 번째 staged `abort`는 `retire`=false로 "could not be retired" 예외 → sample `AbortPosterImageUploadUseCase`(IDEMPOTENT 표시)가 ABORT_AUTHORIZED에서 재호출하면 영구 정지 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:257-266`, `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/application/poster/AbortPosterImageUploadUseCase.java:28,73-75,91-92` | W2 | `abort` 첫 단계에서 operation이 이미 ABORTED면 provider 호출 전 REPLAYED 반환(`DirectMultipartCoordinator.java:322-334` 방식) |
|
||||
| D-3a | Required | stage: operation을 DATA_UPLOADED로 먼저 올리고 stage 기록은 나중 → 사이 crash 후 재시도가 "not uploadable", 데이터 고아·abort 불가 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:91-92,123-139` | W2 | operation 레코드를 단일 기준으로: 재시도에서 DATA_UPLOADED면 stage 기록을 create-or-require-same으로 보충하고 APPLIED/REPLAYED 반환 |
|
||||
| D-3b | Required | verifyIntegrity: stage CAS 후 operation 전진 → 사이 crash 후 재시도는 REPLAYED로 끝나고 finalize가 "not finalizable" | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:156-171,206-207` | W2 | `integrityVerified` REPLAYED 경로에서 operation이 INTEGRITY_VERIFIED(SCAN_CLEAN이면 SCAN_PENDING) 미만이면 전진을 마저 수행 |
|
||||
| D-3c | Required | finalize: REFERENCE_PUBLISH_IN_PROGRESS로 올린 뒤 crash하면 모든 재시도가 "not finalizable" | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:200-225` | W2 | `REFERENCE_PUBLISH_IN_PROGRESS`도 받아 idempotent `references.publish`를 다시 실행하고 PUBLISHED로 전진 |
|
||||
| D-3d | Required | scan verdict: stage CAS 후 operation 전진(같은 순서), 재시도는 verdict가 같아 REPLAYED로 끝나 전진 누락 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectScanMaintenanceAdapter.java:82-110` | W2 | REPLAYED여도 operation이 SCAN_PENDING이면 SCAN_CLEAN/QUARANTINED 전이를 마저 수행 |
|
||||
| D-1a | Required | staged `abort`가 operation 단계 확인 없이 provider `retire`(실제 삭제)부터 호출 → PUBLISHED면 삭제 후 `terminate`에서 예외, 참조·manifest는 PUBLISHED로 남음 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `StagedObjectPublicationLifecycleTest$Abort.abortIsRejectedWhenTheOperationPublishedAfterAuthorization` FAIL(`Expecting message to be: "published operation cannot be aborted"` — 수정 전엔 데이터를 지운 뒤 terminate에서 다른 예외)→PASS, `…$Abort.rejectedAbortAfterPublicationKeepsThePublishedBytesReadable` FAIL(`ObjectStorageProviderException: local object is absent`)→PASS. `kernel/StagedObjectPublicationKernel.java:299-331`. 수정 방향과 다른 점: 새 상태 `ABORT_IN_PROGRESS`를 만들지 않고 `ABORTED` 자체를 retire 전에 CAS로 기록한다(영속 enum 추가 없음). 같은 fence 역할을 하고, 재시도는 D-2c 경로가 retire를 다시 시도해 crash 창을 메운다 | - | `abort`에서 `loadOperation`을 먼저 하고 `REFERENCE_PUBLISH_IN_PROGRESS`/`PUBLISHED`면 거부, `retire` 전에 ABORT_IN_PROGRESS를 CAS로 기록 |
|
||||
| D-1b | Required | `authorizeAbort`가 stage·handoff만 보고 operation 단계를 보지 않음 → release 또는 lease 만료 후 publish 단계에서도 abort 허가 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$AuthorizeAbort.authorizeAbortIsRejectedOnceTheReferenceIsPublished` FAIL(`Expecting actual not to be null`)→PASS. `kernel/ObjectPublicationHandoffService.java:101-123` | - | `ObjectPublicationHandoffService.authorizeAbort`에서 operation을 읽어 `REFERENCE_PUBLISH_IN_PROGRESS` 이후면 거부 |
|
||||
| D-1c | Required | `finalizePublication`이 handoff를 읽지 않고 `ObjectFinalizeRequest`에 fence·claimant가 없음 → lease 만료 후 늦은 finalize가 abort와 경쟁 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$FinalizePublication.finalizeAfterAbortWasAuthorizedIsRejected` FAIL(`Expecting actual not to be null`)→PASS. `ObjectFinalizeRequest`에 `handoffFence`·`claimant` 추가(`application-objectstorage/.../request/ObjectFinalizeRequest.java:15-32`), finalize가 활성·일치 lease 요구(`StagedObjectPublicationKernel.java:247-254`, `control/ObjectPublicationHandoffRecord.java:176` `heldBy`). 이미 PUBLISHED인 replay는 lease를 보지 않는다(release 뒤 reconcile 재호출이 계속 REPLAYED). sample 호출부 `sample-portfolio/.../poster/ReconcilePosterImageUploadUseCase.java:106-114` | - | `ObjectFinalizeRequest`에 `handoffFence`·`claimant` 추가, finalize가 활성·일치 lease를 요구. sample `ReconcilePosterImageUploadUseCase.java:105-112` 호출부 갱신 |
|
||||
| D-2a | Required | 이미 release된 handoff에 `release` 재호출 시 "owner/fence is stale" 예외 → sample reconcile이 terminal READY마다 `releaseClaim`을 불러 두 번째 reconcile이 항상 실패 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$ReleaseClaim.repeatedReleaseByTheSameClaimantReplays` FAIL(`IllegalStateException: publication handoff owner/fence is stale`)→PASS. `ObjectPublicationHandoffRecord.java:121-126`, `ObjectPublicationHandoffService.java:97,125-137`(바뀐 게 없으면 쓰지 않고 REPLAYED) | - | `ObjectPublicationHandoffRecord.release`: 같은 fence·claimant로 이미 released면 쓰기 없이 REPLAYED, `releaseClaim`이 그 결과를 반환 |
|
||||
| D-2b | Required | `authorizeAbort` 재호출이 idempotent하지 않음: 첫 호출이 `released=false`로 되돌려 lease가 남아 있으면 예외, 지났으면 새 revision을 쓰고 항상 APPLIED | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$AuthorizeAbort.repeatedAuthorizeAbortForTheSameFenceReplays` FAIL(`IllegalStateException: active or stale handoff cannot authorize abort`)→PASS. `ObjectPublicationHandoffRecord.java:142-147` | - | 이미 `abortAuthorized`이고 fence가 같으면 쓰기 없이 REPLAYED |
|
||||
| D-2c | Required | 두 번째 staged `abort`는 `retire`=false로 "could not be retired" 예외 → sample `AbortPosterImageUploadUseCase`(IDEMPOTENT 표시)가 ABORT_AUTHORIZED에서 재호출하면 영구 정지 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$Abort.repeatedAbortReplays` FAIL(`IllegalStateException: publication terminal transition is invalid`)→PASS. `StagedObjectPublicationKernel.java:317-323`. 수정 방향과 다른 점: provider 호출 전에 바로 REPLAYED를 주지 않고 retire를 한 번 더 시도한 뒤(이미 없으면 정상) REPLAYED — D-1a에서 ABORTED를 retire보다 먼저 기록하므로, 그 사이 crash가 바이트를 고아로 남기지 않게 하려는 것 | - | `abort` 첫 단계에서 operation이 이미 ABORTED면 provider 호출 전 REPLAYED 반환(`DirectMultipartCoordinator.java:322-334` 방식) |
|
||||
| D-3a | Required | stage: operation을 DATA_UPLOADED로 먼저 올리고 stage 기록은 나중 → 사이 crash 후 재시도가 "not uploadable", 데이터 고아·abort 불가 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$Stage.stageRetriedAfterACrashBeforeTheStageRecordStagesTheObject` FAIL(`IllegalStateException: stage operation is not uploadable`)→PASS. `StagedObjectPublicationKernel.java:84-127`(DATA_UPLOADED면 저장된 객체를 inspect해서 stage 기록을 다시 만들고, 동시 재시도 충돌은 REPLAYED) | - | operation 레코드를 단일 기준으로: 재시도에서 DATA_UPLOADED면 stage 기록을 create-or-require-same으로 보충하고 APPLIED/REPLAYED 반환 |
|
||||
| D-3b | Required | verifyIntegrity: stage CAS 후 operation 전진 → 사이 crash 후 재시도는 REPLAYED로 끝나고 finalize가 "not finalizable" | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$FinalizePublication.finalizeSucceedsWhenVerifyWasRetriedAfterACrashBeforeTheOperationAdvanced` FAIL(`IllegalStateException: staged operation is not finalizable`)→PASS. `StagedObjectPublicationKernel.java:192-229`(REPLAYED 경로도 operation을 INTEGRITY_VERIFIED/SCAN_PENDING까지 전진) | - | `integrityVerified` REPLAYED 경로에서 operation이 INTEGRITY_VERIFIED(SCAN_CLEAN이면 SCAN_PENDING) 미만이면 전진을 마저 수행 |
|
||||
| D-3c | Required | finalize: REFERENCE_PUBLISH_IN_PROGRESS로 올린 뒤 crash하면 모든 재시도가 "not finalizable" | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$FinalizePublication.finalizeRetriedAfterACrashInReferencePublicationPublishes` FAIL(`staged operation is not finalizable`)→PASS. `StagedObjectPublicationKernel.java:262-285` | - | `REFERENCE_PUBLISH_IN_PROGRESS`도 받아 idempotent `references.publish`를 다시 실행하고 PUBLISHED로 전진 |
|
||||
| D-3d | Required | scan verdict: stage CAS 후 operation 전진(같은 순서), 재시도는 verdict가 같아 REPLAYED로 끝나 전진 누락 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$FinalizePublication.finalizeSucceedsWhenTheCleanVerdictWasRetriedAfterACrash` FAIL(`staged operation is not finalizable`)→PASS. `config/RoutingObjectScanMaintenanceAdapter.java:92-115` | - | REPLAYED여도 operation이 SCAN_PENDING이면 SCAN_CLEAN/QUARANTINED 전이를 마저 수행 |
|
||||
| D-4 | Required | staged kernel·handoff 서비스에 동작 테스트 없음 | 남음 | `src/adapter/outbound/objectstorage/src/test/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernelTest.java:11-23`(`ObjectScanVerdictPolicy`만), `src/adapter/outbound/objectstorage/src/test/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/ObjectPublicationHandoffRaceTest.java:23-24`(takeover 1건), `src/app-bootstrap/src/integrationTest/java/dev/caskeleton/bootstrap/integration/objectstorage/ObjectStorageCompositionIntegrationTest.java:71-86`(legacy put/get), `src/sample-portfolio/src/test/java/dev/caskeleton/sample/portfolio/application/poster/PosterImagePublicationWorkflowTest.java:85-86`(포트 mock) | W4 | local-dev provider로 stage→verify→finalize→release, abort·replay 전 흐름 테스트 + `ObjectControlStore` 래퍼로 두 쓰기 사이 실패 주입(D-1~D-3 회귀 테스트 겸용) |
|
||||
| D-5 / X1-#8b | Consider | local control store `create`가 `CREATE_NEW` 후 쓰기 → 동시 reserve가 빈/부분 파일을 decode 실패, 쓰기 중 crash면 키 영구 손상 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/filesystem/LocalDevObjectControlStore.java:51-65`<br>X1-#8b: `objectstorage/.../filesystem/LocalDevObjectControlStore.java:51-65`(비교 대상이던 `LocalPublicationJournal`은 삭제) | W2 | temp 파일에 쓰고 `force` 후 `Files.createLink`로 게시(`LocalDevObjectDataStore.java:55-62`와 같은 방식)<br>X1-#8b: temp 파일에 다 쓰고 `force` 후 원자적으로 게시해 부분 파일이 보이지 않게 + 동시 create 테스트 |
|
||||
| D-6a | Consider | legacy filesystem adapter `get`이 크기 제한 없이 `Files.readAllBytes` (L3 closure 기록과 코드 불일치) | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/FilesystemObjectStorageAdapter.java:71` | W1 | 읽기 전 `Files.size`를 설정 최대값과 비교해 초과 시 거부 |
|
||||
| D-6b | Consider | legacy `put`이 `target.toUri()`(서버 절대 경로 `file:///…`)를 반환 → sample이 HTTP 응답 `location`에 노출, sample 기본 설정이 이 backend | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/FilesystemObjectStorageAdapter.java:61`, `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/adapter/inbound/web/mapper/PosterWebMapper.java:35`, `src/sample-portfolio/src/main/resources/application.yml:321-326` | W1 | `FilesystemObjectStorageAdapter.put`이 논리 URI(`objectstorage:` + key)를 반환 |
|
||||
| D-7a | Consider | direct/multipart 코드 약 3.2k줄이 main 호출자 0(`DirectTransferCoordinator`, `DirectMultipartCoordinator`, `ManagedMultipartCoordinator`, `MultipartOperationResolver`, `S3ObjectOperationResolver`, `ObjectOperationResolutionService`, `ObjectOperationEpochRecord`, `SelectedObjectStorageProviderFactory.{managedMultipart,directTransfer,directMultipart}Provider`, 포트 `DirectObjectUploadPort`·`DirectObjectDownloadGrantPort`·`DirectMultipartUploadPort`) | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/{direct,multipart}/`(2,053줄) + S3 direct/multipart 타입(1,160줄), main 참조 0·테스트만(`src/adapter/outbound/objectstorage/src/test/java/dev/caskeleton/adapter/outbound/objectstorage/s3/S3ProviderCompositionTest.java:132,140`). `docs/capability-status.md` 「제거된 코드」 표에 없음 | W3 | D1 규칙(호출자 0 삭제)대로 `direct/`·`multipart/`·S3 direct/multipart provider·`Direct*Port`를 삭제하고 제거 표에 기록 |
|
||||
| D-7b | Consider | 빈 자리 타입: `RoutingObjectDirectGrantAdapter`(참조 0), 빈 `@Configuration` `ObjectStorageMaintenanceCapabilityConfig` | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectDirectGrantAdapter.java:1-10`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/ObjectStorageMaintenanceCapabilityConfig.java:10`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/ObjectStorageAutoConfiguration.java:25` | W3 | 두 타입 삭제, `ObjectStorageAutoConfiguration` import 목록에서 제거 |
|
||||
| D-7c | Consider | 구현 없는 포트 `ObjectPurgeMaintenancePort` | 남음 | `src/application-objectstorage/src/main/java/dev/caskeleton/application/objectstorage/port/ObjectPurgeMaintenancePort.java` (main 구현 0, 테스트 참조만) | W3 | 포트 삭제 |
|
||||
| D-5 / X1-#8b | Consider | local control store `create`가 `CREATE_NEW` 후 쓰기 → 동시 reserve가 빈/부분 파일을 decode 실패, 쓰기 중 crash면 키 영구 손상 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `LocalDevObjectStorageRecoveryTest.aConcurrentReaderNeverSeesAPartiallyCreatedControlRecord` FAIL(`Expecting empty but was: [ObjectControlCorruptionException: control record is corrupt …]`)→PASS. `filesystem/LocalDevObjectControlStore.java:51-78`(temp 파일에 다 쓰고 `force` 후 `Files.createLink`). 동시성 재현이라 수정 전 FAIL은 확률적이다(300회 create/read 중 부분 파일 읽기 발생). 수정 뒤에는 부분 파일이 구조상 보이지 않는다 | - | temp 파일에 쓰고 `force` 후 `Files.createLink`로 게시(`LocalDevObjectDataStore.java:55-62`와 같은 방식)<br>X1-#8b: temp 파일에 다 쓰고 `force` 후 원자적으로 게시해 부분 파일이 보이지 않게 + 동시 create 테스트 |
|
||||
| D-6a | Consider | legacy filesystem adapter `get`이 크기 제한 없이 `Files.readAllBytes` (L3 closure 기록과 코드 불일치) | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `FilesystemObjectStorageAdapterTest.getRejectsAStoredObjectLargerThanTheReadCeiling` FAIL(`Expecting actual not to be null`)→PASS, `…putRejectsContentLargerThanTheReadCeiling` FAIL→PASS. `FilesystemObjectStorageAdapter.java:33,57,81`. 수정 방향과 다른 점: "설정 최대값" 대신 고정 상한 16 MiB 상수(`ponytail:` 주석). legacy seam(`@Deprecated(forRemoval=true)`)에는 크기 설정 키가 없고, 삭제 예정 seam에 새 설정 키·env 문서를 늘리지 않으려고 상수로 했다. put도 같은 상한으로 막아 "쓴 것은 항상 다시 읽힌다"를 유지 | - | 읽기 전 `Files.size`를 설정 최대값과 비교해 초과 시 거부 |
|
||||
| D-6b | Consider | legacy `put`이 `target.toUri()`(서버 절대 경로 `file:///…`)를 반환 → sample이 HTTP 응답 `location`에 노출, sample 기본 설정이 이 backend | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `FilesystemObjectStorageAdapterTest.putReturnsALogicalLocationThatHidesTheServerPath` FAIL(`expected: objectstorage:posters/7/image but was: file:///tmp/junit-…/posters/7/image`)→PASS. `FilesystemObjectStorageAdapter.java:71`(`logicalLocation`). 결함을 굳히던 특성 테스트는 `LegacyObjectStorageBehaviorTest.filesystemReceiptNamesTheKeyInsteadOfTheServerPath`로 바꿈 | - | `FilesystemObjectStorageAdapter.put`이 논리 URI(`objectstorage:` + key)를 반환 |
|
||||
| D-7a | Consider | direct/multipart 코드 약 3.2k줄이 main 호출자 0(`DirectTransferCoordinator`, `DirectMultipartCoordinator`, `ManagedMultipartCoordinator`, `MultipartOperationResolver`, `S3ObjectOperationResolver`, `ObjectOperationResolutionService`, `ObjectOperationEpochRecord`, `SelectedObjectStorageProviderFactory.{managedMultipart,directTransfer,directMultipart}Provider`, 포트 `DirectObjectUploadPort`·`DirectObjectDownloadGrantPort`·`DirectMultipartUploadPort`) | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): D 커밋 `2c7b3d25`(+ 문서 후속 `f8bf7b6d`). `direct/`·`multipart/` 패키지, S3 direct·multipart·presigner·operation resolver, `ObjectOperationResolutionService`·`ObjectOperationEpochRecord`, `Direct*Port` 3개와 그 요청·응답 타입 삭제(main −5,017줄, test −2,221줄). 삭제 전후 `git grep`으로 main 참조 0 확인(남은 언급은 `docs/reviews`·`docs/superpowers`·`docs/evidence`의 과거 기록뿐). 함께 정리: `SelectedObjectStorageProviderFactory`의 `Object` 슬롯 3개·생성자 3개(`config/SelectedObjectStorageProviderFactory.java`), S3 contribution의 presigner/direct/multipart 조립(`s3/S3ObjectStorageProviderContribution.java`), direct/multipart 전용 control record 5종과 codec 분기, `ObjectControlKeyCodec`·`ObjectHandleCodec` 메서드, 상태 enum. `DIRECT_UPLOAD`/`DIRECT_MULTIPART` capability 값은 제거해서, 설정에 남아 있으면 조용히 무시되지 않고 바인딩에서 실패한다. 남은 6개 control record family의 골든 digest는 삭제 전과 같다(`ObjectControlRecordCodecTest.everyRecordFamilyHasAFrozenGoldenEnvelopeDigest` PASS) — 유지되는 레코드의 저장 형식은 바뀌지 않았다. AWS lane `requires`에서 `AwsS3DirectMutationPreconditionsTest` 제거(`src/adapter/outbound/objectstorage/build.gradle:89`), workflow 입력 `run_protected_aws_direct_mutation` 제거(`.github/workflows/object-storage-qualification.yml`) | - | D1 규칙(호출자 0 삭제)대로 `direct/`·`multipart/`·S3 direct/multipart provider·`Direct*Port`를 삭제하고 제거 표에 기록 |
|
||||
| D-7b | Consider | 빈 자리 타입: `RoutingObjectDirectGrantAdapter`(참조 0), 빈 `@Configuration` `ObjectStorageMaintenanceCapabilityConfig` | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `2c7b3d25`. `RoutingObjectDirectGrantAdapter`, 빈 `ObjectStorageMaintenanceCapabilityConfig` 삭제, `ObjectStorageAutoConfiguration.java:21-25` import 목록에서 제거 | - | 두 타입 삭제, `ObjectStorageAutoConfiguration` import 목록에서 제거 |
|
||||
| D-7c | Consider | 구현 없는 포트 `ObjectPurgeMaintenancePort` | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `2c7b3d25`. `ObjectPurgeMaintenancePort`와 전용 `ObjectPurgeRequest` 삭제, `ObjectStoragePortContractTest`의 purge 단언을 `scannerAndStagedPublicationAreSeparatePrivilegeSurfaces`로 정리 | - | 포트 삭제 |
|
||||
| D-7d | Consider | S3 contribution이 쓰이지 않는 `S3ManagedMultipartProvider`(항상)와 presigner·direct provider(capability SUPPORTED일 때)를 생성 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/s3/S3ObjectStorageProviderContribution.java:110-158` | W3 | D-7a 삭제와 함께 `SelectedObjectStorageProviderFactory` 인자·생성 코드 제거 |
|
||||
| D-7e | Consider | S3 자격 증명을 `System::getenv`로 해석(`SecretSourcePort` 미사용, httpclient H6와 같은 패턴) | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/s3/S3ObjectStorageProviderContribution.java:41` | W3 | `ObjectStorageCapabilityConfig`의 S3 contribution bean이 `SecretSourcePort`(`src/application-core/src/main/java/dev/caskeleton/application/outbound/SecretSourcePort.java`)를 받아 `S3ProviderBinding.SecretResolver`로 넘김 |
|
||||
| D-8a | Consider | managed 경로의 참조 게시(`persistPublishedReference`/`createOrRequireSame`)가 `ObjectReferencePublicationService`와 중복 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectMutationAdapter.java:354-421`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/ObjectReferencePublicationService.java:20-92` | W3 | `RoutingObjectMutationAdapter`가 `ObjectReferencePublicationService.publish`를 호출하고 사본 삭제 |
|
||||
| D-8b | Consider | `objectId`/`sha256Hex` 계산 중복 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectMutationAdapter.java:469-500`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/kernel/StagedObjectPublicationKernel.java:389-415` | W3 | `codec` 패키지에 identity helper 하나로 합치고 두 곳이 호출 |
|
||||
| D-8c | Consider | route token 파싱 `split("\\.")[1]`이 두 곳에 복사 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectMutationAdapter.java:504`, `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectReadAdapter.java:103` | W3 | `ObjectReferenceCodec.routeToken(..)` 추가 후 두 곳 교체 |
|
||||
| D-8d | Consider | `clock`을 주입받고도 `Instant.now()`를 12번 호출 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectMutationAdapter.java:60,70`(clock), `:128,152,192,201,212,223,229,283,311,329,341,349`(`Instant.now()`) | W3 | `Instant.now()`를 `clock.instant()`로 교체 |
|
||||
| D-9 | Consider | `inspect`가 scan 상태를 항상 NOT_REQUIRED로 보고(SCAN_CLEAN destination 포함) | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/RoutingObjectReadAdapter.java:53` | W2 | destination `policySnapshot().publicationRequirement()`가 SCAN_CLEAN이면 CLEAN으로 보고 |
|
||||
| D-10 | Nit | capability close가 역순이 아님(`Map.copyOf`는 순서 없음), 하나가 던지면 나머지 close를 건너뜀 | 남음 | `src/adapter/outbound/objectstorage/src/main/java/dev/caskeleton/adapter/outbound/objectstorage/config/ObjectStorageCapabilityAssembler.java:74,111-118` | W2 | provider를 생성 순서 `List`로 보관, 역순 close를 try/catch + `addSuppressed`로 |
|
||||
| D-9 | Consider | `inspect`가 scan 상태를 항상 NOT_REQUIRED로 보고(SCAN_CLEAN destination 포함) | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `…$Inspect.scanGatedReferenceReportsItsCleanVerdict` FAIL(`Expecting actual: Optional[NOT_REQUIRED]`)→PASS. `config/RoutingObjectReadAdapter.java:53-58`. 이 보고가 참이 되려면 managed publish의 scan 우회를 막아야 해서 P2-new-1을 함께 고쳤다 | - | destination `policySnapshot().publicationRequirement()`가 SCAN_CLEAN이면 CLEAN으로 보고 |
|
||||
| D-10 | Nit | capability close가 역순이 아님(`Map.copyOf`는 순서 없음), 하나가 던지면 나머지 close를 건너뜀 | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `ObjectStorageCapabilityAssemblerTest.closeReleasesProvidersInReverseCreationOrderAndKeepsEveryFailure` FAIL(`Expecting message to be: "close failed: a"`)→PASS. `config/ObjectStorageCapabilityAssembler.java:52-82,137-140`(provider를 생성 순서 `List`로 보관, 역순 close, 첫 실패에 나머지 `addSuppressed`; assemble 실패 경로도 같은 helper) | - | provider를 생성 순서 `List`로 보관, 역순 close를 try/catch + `addSuppressed`로 |
|
||||
| D-11a | Nit | leaf CLAUDE.md 허용 의존에서 `application-objectstorage` 누락 | 남음 | `src/adapter/outbound/objectstorage/CLAUDE.md:30` (registry: `application-core`, `shared-contract`, `application-objectstorage`) | W5 | 의존 나열을 지우고 registry 참조 한 줄만 남김 |
|
||||
| D-11b | Nit | CLAUDE.md가 object storage 포트·타입 위치를 `application-core`로 적음 | 남음 | `src/adapter/outbound/objectstorage/CLAUDE.md:17,40` | W5 | `application-objectstorage`로 수정. 같은 절 `:19` "disabled-by-default"도 현재 동작(`ObjectStorageCapabilityConfig`의 `matchIfMissing = true`, 있으면 켜짐)으로 |
|
||||
| D-11c | Nit | CLAUDE.md 기준 버전이 Boot 4.0.0(실제 4.0.8) | 남음 | `src/adapter/outbound/objectstorage/CLAUDE.md:8` | W5 | 버전 문구 삭제 또는 4.0.8 |
|
||||
@@ -259,46 +271,46 @@
|
||||
| E-1c | Critical | outbox-storage `V1__initialize_or_adopt.sql` 적용 후 수정 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "outbox V2 migration stream `jpa/outbox-storage`(V1·V2) … `applied-migrations.sha256`의 해당 4줄"(D2). `git ls-files '…/db/migration/jpa/outbox*'` 0건 | - | - |
|
||||
| E-1d | Critical | 적용된 migration 해시 고정 테스트 부재 | 완료 | `src/adapter/outbound/persistence-jpa/src/test/java/dev/caskeleton/adapter/outbound/persistence/migration/AppliedMigrationImmutabilityTest.java:29`(`appliedMigrationsKeepTheBytesTheyWereAppliedWith`), `:43`(`everyVersionedMigrationIsPinned`), 커밋 6d27356e | - | - |
|
||||
| E-2a | Critical | 같은 요청 재제출이 unique 위반 후 같은 트랜잭션 재조회 → PostgreSQL 25P02 | 완료 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/operation/DurableOperationStoreAdapter.java:43-70`(`submitIfAbsent` 후 조회), `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/operation/DurableOperationJpaRepository.java:39-59`(`ON CONFLICT … DO NOTHING`), 테스트 `DurableOperationStoreAdapterContractTest`(postgresqlIntegrationTest) ← `DurableOperationStoreContract.identicalResubmissionInsideOneTransactionReturnsTheFirstOperation`, 커밋 6d27356e | - | - |
|
||||
| E-2b | Required | (알려진 남은 문제) 같은 operationId 재시도 시 outbox 중복 append: `alreadyAccepted`를 operationId 불일치로만 판단 → 같은 id 재시도는 새 제출로 보고 `outbox.append` 재실행. `OutboxEventEntity`에 `Persistable`/`@Version`이 없어 `repository.save`가 merge로 기존 행을 PENDING·attempt 0으로 덮거나(reaper가 지웠으면 새 행) 재발행 | 남음 | `src/application-core/src/main/java/dev/caskeleton/application/operation/SubmitDurableOperationUseCase.java:99-116`, `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxStoreAdapter.java:57-71`. merge 동작은 Spring Data `isNew` 규칙 기준 판단(실행 미확인) | W2 | `DurableOperationStorePort.submit`이 생성/재사용 여부를 돌려주게 하고(`submitIfAbsent` 영향 행 수 1/0) 그 값으로 append 여부 결정. `DurableOperationStoreContract`에 같은 id 재시도 케이스 추가 |
|
||||
| E-3a | Required | `CanonicalOutboxAppendAdapter.append`에 caller 트랜잭션 확인 없음 → 트랜잭션 밖 호출 시 조용한 dual-write | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/CanonicalOutboxAppendAdapter.java:37` (형제 `OutboxStoreAdapter.java:58`에는 있음) | W2 | `append` 첫 줄에 caller 트랜잭션 guard 추가 |
|
||||
| E-2b | Required | (알려진 남은 문제) 같은 operationId 재시도 시 outbox 중복 append: `alreadyAccepted`를 operationId 불일치로만 판단 → 같은 id 재시도는 새 제출로 보고 `outbox.append` 재실행. `OutboxEventEntity`에 `Persistable`/`@Version`이 없어 `repository.save`가 merge로 기존 행을 PENDING·attempt 0으로 덮거나(reaper가 지웠으면 새 행) 재발행 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): NEW-7a와 같은 결함·같은 수정. 아래 NEW-7a 행 참고 | - | `DurableOperationStorePort.submit`이 생성/재사용 여부를 돌려주게 하고(`submitIfAbsent` 영향 행 수 1/0) 그 값으로 append 여부 결정. `DurableOperationStoreContract`에 같은 id 재시도 케이스 추가 |
|
||||
| E-3a | Required | `CanonicalOutboxAppendAdapter.append`에 caller 트랜잭션 확인 없음 → 트랜잭션 밖 호출 시 조용한 dual-write | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): `CanonicalOutboxAppendAdapterTest.appendOutsideACallerTransactionIsRefusedBeforeAnyWrite` FAIL("Expecting actual not to be null")→PASS. `.../outbox/CanonicalOutboxAppendAdapter.java:40-44` 첫 줄에 caller 트랜잭션 guard(형제 `OutboxStoreAdapter`와 같은 메시지) | - | `append` 첫 줄에 caller 트랜잭션 guard 추가 |
|
||||
| E-3b | Required | caller 트랜잭션 guard가 세 클래스에 복사됨 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxStoreAdapter.java:130-135`, `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/operation/DurableOperationStoreAdapter.java:169-174`, `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/liveevent/JpaLiveEventReplayAdapter.java:163-168` | W3 | `persistence/transaction` 패키지에 공용 helper 하나를 두고 세 곳 + E-3a가 호출 |
|
||||
| E-3c | Required | ownership 테스트가 canonical append adapter를 검사하지 않음 | 남음 | `src/adapter/outbound/persistence-jpa/src/test/java/dev/caskeleton/adapter/outbound/persistence/transaction/PersistenceTransactionOwnershipTest.java:25-47`(DurableOperation·LiveEvent만) | W4 | `PersistenceTransactionOwnershipTest`에 `CanonicalOutboxAppendAdapter`의 트랜잭션 없는 호출 거부 케이스 추가 |
|
||||
| E-4a | Required | `markAllRead` 서브쿼리가 `read_at IS NULL`만 보고 state를 거르지 않음 → 읽지 않고 보관한 ARCHIVED 항목이 READ로 되살아남 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/inbox/InboxItemJpaRepository.java:83-104` | W2 | 서브쿼리에 `AND state NOT IN ('ARCHIVED','EXPIRED','DELETED')` 추가 |
|
||||
| E-4b | Required | 엔티티 `markRead`/`markSeen`이 ARCHIVED·terminal 상태를 막지 않음 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/inbox/InboxItemEntity.java:107-127` | W2 | `markSeen`/`markRead`에서 `archivedAt != null`·terminal이면 false 반환 |
|
||||
| E-4a | Required | `markAllRead` 서브쿼리가 `read_at IS NULL`만 보고 state를 거르지 않음 → 읽지 않고 보관한 ARCHIVED 항목이 READ로 되살아남 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 실제 PG `PostgreSqlInboxCutoffIntegrationTest.markAllReadLeavesAnUnreadArchivedItemArchived` FAIL(`[2, READ]` ≠ `[1, ARCHIVED]`)→PASS. 서브쿼리에 `AND state NOT IN ('ARCHIVED','EXPIRED','DELETED')`: `.../notification/platform/inbox/InboxItemJpaRepository.java:91-93`. 이 테스트 클래스는 SQL 사본을 실행하고 있어서(결함이 안 보였던 이유) repository `@Query` 값을 읽어 실행하도록 바꿈 | - | 서브쿼리에 `AND state NOT IN ('ARCHIVED','EXPIRED','DELETED')` 추가 |
|
||||
| E-4b | Required | 엔티티 `markRead`/`markSeen`이 ARCHIVED·terminal 상태를 막지 않음 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): `InboxItemEntityTest.markReadLeavesAnItemThatLeftTheInboxWhereItIs` / `markSeen...` (ARCHIVED·EXPIRED·DELETED 각 3건) FAIL(`[true, READ]`/`[true, SEEN]`)→PASS. `.../inbox/InboxItemEntity.java` `leftTheInbox()` 가드 | - | `markSeen`/`markRead`에서 `archivedAt != null`·terminal이면 false 반환 |
|
||||
| E-4c | Required | inbox 통합 테스트가 운영 쿼리를 복사한 SQL 문자열을 실행하고 enum에 없는 `'UNREAD'`를 씀. `JpaNotificationInbox`/`InboxItemJpaRepository` 실행 테스트 없음 | 남음 | `src/adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/java/dev/caskeleton/adapter/outbound/persistence/readiness/PostgreSqlInboxCutoffIntegrationTest.java:86-104,117` | W4 | 테스트가 실제 `InboxItemJpaRepository.markAllRead`를 호출하고 ARCHIVED 항목 유지 케이스 추가 |
|
||||
| E-5a | Required | FIFO gate가 `occurred_at <`만 봐서 같은 `occurred_at` 이벤트는 함께 claim, 순서 미정 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/postgresql/PostgreSqlOutboxClaimRepository.java:15-29`(H2 `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/h2/H2OutboxClaimRepository.java`도 같은 SQL), 특성화 테스트 `PostgreSqlLegacyOutboxRowLifecycleIntegrationTest.equalTimestampRowsAreClaimedTogetherLegacyFifoLimitationCharacterization` | W2 | canonical row(`contract_id IS NOT NULL`)는 `(aggregate_sequence, event_index)`로 head 판정·정렬. 인덱스는 새 migration `V18`로 추가(+ `applied-migrations.sha256`) |
|
||||
| E-5b | Required | gate가 `tenant_scope`·`aggregate_type`을 안 봐 다른 tenant/type의 같은 `aggregate_id` DEAD row가 서로 영구 차단 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/postgresql/PostgreSqlOutboxClaimRepository.java:20-25` | W2 | canonical row의 gate 키를 `(tenant_scope, aggregate_type, aggregate_id)`로(E-5a와 같은 SQL 변경, PostgreSQL·H2 두 곳) |
|
||||
| E-5a | Required | FIFO gate가 `occurred_at <`만 봐서 같은 `occurred_at` 이벤트는 함께 claim, 순서 미정 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 실제 PG `PostgreSqlOutboxClaimAndMaintenanceIntegrationTest.canonicalEventsSharingAnOccurredAtAreClaimedOneAtATimeInAggregateOrder` FAIL(3건 동시 claim)→PASS, H2 `H2ClaimSqlTest.claimsCanonicalEventsSharingAnOccurredAtOneAtATimeInAggregateOrder` PASS. canonical 쌍은 `(aggregate_sequence, event_index)`로 head 판정·정렬: `.../postgresql/PostgreSqlOutboxClaimRepository.java:25-50`, `.../h2/H2OutboxClaimRepository.java:26-47`. 인덱스 새 migration `V18__outbox_event_unpublished_aggregate_order.sql` + `applied-migrations.sha256` 1줄, `PostgreSqlMigrationIntegrationTest` 버전 목록에 18 추가. legacy row가 낀 쌍은 기존 `occurred_at` 비교 유지(`equalTimestampRowsAreClaimedTogetherLegacyFifoLimitationCharacterization` 그대로 통과) | - | canonical row(`contract_id IS NOT NULL`)는 `(aggregate_sequence, event_index)`로 head 판정·정렬. 인덱스는 새 migration `V18`로 추가(+ `applied-migrations.sha256`) |
|
||||
| E-5b | Required | gate가 `tenant_scope`·`aggregate_type`을 안 봐 다른 tenant/type의 같은 `aggregate_id` DEAD row가 서로 영구 차단 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 실제 PG `aDeadCanonicalRowOfAnotherTenantOrTypeDoesNotBlockTheSameAggregateId` FAIL(`[]`)→PASS. E-5a와 같은 SQL 변경(canonical 쌍은 tenant_scope·aggregate_type까지 같아야 같은 aggregate) | - | canonical row의 gate 키를 `(tenant_scope, aggregate_type, aggregate_id)`로(E-5a와 같은 SQL 변경, PostgreSQL·H2 두 곳) |
|
||||
| E-5c | Required | README가 "한 배치에 aggregate 당 최대 한 row"라고 적음(같은 `occurred_at`이면 거짓) | 남음 | `src/adapter/outbound/persistence-jpa/README.md:248-249` | W5 | E-5a 수정 후 README를 실제 보장에 맞춤 |
|
||||
| E-6a | Required | H10 tenant 규칙이 필드 이름 `tenantId`로만 판정("Structural" Javadoc과 반대) → `tenant`, `tenantScope` 엔티티 누락 | 남음 | `src/adapter/outbound/persistence-jpa/src/testFixtures/java/dev/caskeleton/adapter/outbound/persistence/testkit/arch/TenantScopedRepositoryPredicate.java:12-19,49` | W4 | `tenant*` 필드 전부(또는 marker annotation)로 판정 |
|
||||
| E-6b | Required | tenant 컬럼을 가진 세 리포지토리가 `JpaRepository`를 상속해 범위 없는 `findAll`/`deleteAll` 노출 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/operation/DurableOperationJpaRepository.java:25-26`, `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/idempotency/IdempotencyRecordJpaRepository.java:12-13`, `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxEventJpaRepository.java:16` | W3 | 세 리포지토리를 `Repository` marker + 쓰는 메서드만 선언으로 축소 |
|
||||
| E-7 | Consider | 잘못된 canonical row 하나가 `claimBatch` 매핑에서 예외 → claim 트랜잭션 전체 롤백 → 매 주기 같은 row 재선택으로 relay 정지 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxStoreAdapter.java:79-94,161-193` | W2 | 매핑 실패 row는 DEAD로 전이하고 배치의 나머지는 계속 |
|
||||
| E-8a | Consider | outbox 지표 쿼리가 매 poll(PT5S)마다 테이블 전체를 status별로 셈(7일치 PUBLISHED 포함) | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxEventJpaRepository.java:54-56`, 호출 `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/outbox/OutboxMetrics.java:89` ← `OutboxRelayScheduler.java:36,49` | W2 | `countGroupedByStatus`에 `where e.status <> 'PUBLISHED'` |
|
||||
| E-8b | Consider | `OutboxReaper`가 PUBLISHED 삭제를 한도 없는 단일 트랜잭션 DELETE로 실행 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxEventJpaRepository.java:21-23`, `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/outbox/OutboxReaper.java:40-42` | W2 | native `DELETE … WHERE ctid IN (SELECT … LIMIT n)`를 0건 될 때까지 배치별 트랜잭션으로 반복 |
|
||||
| E-7 | Consider | 잘못된 canonical row 하나가 `claimBatch` 매핑에서 예외 → claim 트랜잭션 전체 롤백 → 매 주기 같은 row 재선택으로 relay 정지 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): `OutboxStoreAdapterTest.claimBatchMovesAnUnreadableRowToDeadAndClaimsTheRestOfTheBatch` FAIL(IllegalStateException partial canonical)→PASS, 실제 PG `anUnreadableCanonicalRowDoesNotStopTheRestOfTheBatchFromBeingClaimed`·`anUnreadableCanonicalRowIsMovedToDeadByTheClaim` FAIL(projection mismatch 예외)→PASS. `.../outbox/OutboxStoreAdapter.java:84-110` 매핑 실패 row는 DEAD·lease 해제 후 배치에서 제외(legacy로 낮추지 않으므로 fail-closed 유지) | - | 매핑 실패 row는 DEAD로 전이하고 배치의 나머지는 계속 |
|
||||
| E-8a | Consider | outbox 지표 쿼리가 매 poll(PT5S)마다 테이블 전체를 status별로 셈(7일치 PUBLISHED 포함) | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 실제 PG `countByStatusLeavesPublishedRowsUncounted` FAIL(`{PENDING=1, PUBLISHED=1}`)→PASS. `countGroupedByStatus`에 `where e.status <> 'PUBLISHED'`(`.../outbox/OutboxEventJpaRepository.java`), fake `InMemoryOutboxStore.countByStatus` 동일, 포트 문서 갱신, `OutboxMetrics`는 PUBLISHED 시리즈를 내보내지 않음(0 고정 시리즈 방지). lifecycle PG 테스트의 PUBLISHED 카운트 단언 3곳은 row 상태 직접 조회로 교체 | - | `countGroupedByStatus`에 `where e.status <> 'PUBLISHED'` |
|
||||
| E-8b | Consider | `OutboxReaper`가 PUBLISHED 삭제를 한도 없는 단일 트랜잭션 DELETE로 실행 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): `OutboxReaperTest` 3건 FAIL(컴파일: `deletePublishedBatch` 없음)→PASS. native `DELETE … WHERE event_id IN (SELECT … LIMIT n)`(ctid 대신 PG·H2 공통 SQL)를 repository 메서드 `@Transactional`로 배치마다 커밋, 덜 찬 배치에서 종료: `.../outbox/OutboxEventJpaRepository.java:19-35`, `.../outbox/OutboxReaper.java`(배치 1,000, `ponytail:` 주석). 실제 PG `reaperDeletesOldPublishedRowsOutsideAnyCallerTransaction`, H2 `theReaperBatchDeleteRunsOnH2AndStopsAtItsLimit` PASS | - | native `DELETE … WHERE ctid IN (SELECT … LIMIT n)`를 0건 될 때까지 배치별 트랜잭션으로 반복 |
|
||||
| E-9 | Consider | `JpaObservabilityAutoConfiguration` 미사용 코드 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "JPA 두 번째 트랜잭션·재시도 엔진 19종 … `JpaObservabilityAutoConfiguration`". `git grep JpaObservabilityAutoConfiguration -- src` 0건 | - | - |
|
||||
| E-10a | Consider | experimental tenant guard의 "audited" admin scope가 reason을 ThreadLocal에만 두고 기록하지 않음 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/experimental/tenant/TenantAwareRepositoryGuard.java:14-15,36-53` (production 호출자 0, 테스트만) | W1 | 생성자에 audit sink(`Consumer<String>` 등)를 받아 scope 열 때 기록, 또는 "audited" 문구 삭제 |
|
||||
| E-10a | Consider | experimental tenant guard의 "audited" admin scope가 reason을 ThreadLocal에만 두고 기록하지 않음 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): `TenantAwareRepositoryGuardTest.openingAnAdminScopeRecordsItsReasonInTheAuditSink` FAIL(컴파일: "constructor TenantAwareRepositoryGuard ... cannot be applied", audit sink 없음)→PASS, `anAuditSinkThatFailsLeavesNoAdminScopeOpen` PASS. 생성자가 `Consumer<String>` audit sink를 받고 scope를 열기 전에 사유를 기록: `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/experimental/tenant/TenantAwareRepositoryGuard.java:31,56`. PG `TenantColumnIsolationTest`(jpa-contract) 통과 | - | 생성자에 audit sink(`Consumer<String>` 등)를 받아 scope 열 때 기록, 또는 "audited" 문구 삭제 |
|
||||
| E-10b | Consider | public 생성자라 experimental 진입 게이트(`enabledBy`) 목록에서 빠짐 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "`backend.jpa.experimental.*` 플래그 8개(`ExperimentalFeature`, `ExperimentalFeatureGate`, … `enabledBy(..)` 팩토리)와 `ExperimentalEntryConsentTest`" — 게이트 자체 삭제, 진입점은 public 생성자가 정본 | - | - |
|
||||
| E-10c | Consider | `releaseConnection`이 search_path reset 실패 시에도 tenant schema가 걸린 커넥션을 pool에 반환 | 남음 | `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/experimental/schema/SchemaMultiTenantConnectionProvider.java:50-57` | W1 | reset 실패 시 `connection.abort(Runnable::run)`(또는 unwrap 후 evict)로 pool 복귀를 막고 예외 전파 |
|
||||
| E-10c | Consider | `releaseConnection`이 search_path reset 실패 시에도 tenant schema가 걸린 커넥션을 pool에 반환 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): `SchemaMultiTenantConnectionProviderTest.aFailedResetAbortsTheConnectionSoThePoolCannotLendItOutWithTheTenantSchema` FAIL("WantedButNotInvoked: connection.abort")→PASS, `aFailedResetReachesTheCaller` PASS. reset 실패 시 `abort(Runnable::run)` 후 close, 예외 전파: `.../experimental/schema/SchemaMultiTenantConnectionProvider.java:60-74`. Hikari는 abort된 커넥션을 close 때 evict한다(javap로 `ProxyConnection`이 abort를 가로채지 않음 확인) | - | reset 실패 시 `connection.abort(Runnable::run)`(또는 unwrap 후 evict)로 pool 복귀를 막고 예외 전파 |
|
||||
| E-11 / X1-#7d | 권고 | readiness card 외부 prerequisite가 없는 card(`messaging-cdc-dispatch.v1`)를 가리킴 | 해당 없음(코드 삭제) | 가리키던 card `jpa-outbox-cdc-retention-v1`이 「제거된 코드」 표 "readiness card `jpa-outbox-storage-v2`, `jpa-outbox-polling-delivery-v2`, `jpa-outbox-cdc-retention-v1`"로 삭제. `src/config/jpa/readiness-cards.yaml`에 `messaging`/`external` 0건<br>X1-#7d: 해당 카드 `jpa-outbox-cdc-retention-v1` 삭제(`docs/capability-status.md:179`), `grep messaging-cdc-dispatch src/config` → 0 | - | - |
|
||||
| E-12 | Nit | JPA CLAUDE.md 벤더 SQLState 표에 `55P03 → DB_LOCK_TIMEOUT` 누락 | 남음 | `src/adapter/outbound/persistence-jpa/CLAUDE.md:264-270` vs `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/postgresql/PostgreSqlSqlStateErrorMapping.java:16` | W5 | 표에 `55P03` 행 추가 |
|
||||
| F-1a | Required | `PolicyAwareMongoQueryBuilder.whereEquals`(및 `whereAtLeast`/`whereBefore`)가 `Object` 값을 그대로 `Criteria.is/gte/lt`에 넣음 → `Map`/`Document`(`{"$ne":null}`)가 연산자로 해석돼 operator allowlist·regex 정책 우회 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/query/PolicyAwareMongoQueryBuilder.java:43-61` | W1 | 공용 `requireScalar(value)`(Map/Bson/Document 거부, EQ는 Collection도 거부)를 만들어 builder에서 호출 + `Map.of("$ne", …)` 회귀 테스트 |
|
||||
| F-1b | Required | `AtomicFilter.id`/`andEquals`/`toQuery`가 값 타입 검사 없이 `.is(value)` → `AtomicFilter.id(Map.of("$gt",""))`로 단일 문서 보장 붕괴 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/atomic/AtomicFilter.java:38-53,66-74` | W1 | compact constructor에서 모든 값에 F-1a의 `requireScalar` 적용 |
|
||||
| F-1c | Required | Javadoc이 operator injection을 "compile-time impossibility"라고 주장 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/query/PolicyAwareMongoQueryBuilder.java:16-19` | W5 | F-1a 후 "런타임 스칼라 검사로 막는다"로 수정 |
|
||||
| F-1a | Required | `PolicyAwareMongoQueryBuilder.whereEquals`(및 `whereAtLeast`/`whereBefore`)가 `Object` 값을 그대로 `Criteria.is/gte/lt`에 넣음 → `Map`/`Document`(`{"$ne":null}`)가 연산자로 해석돼 operator allowlist·regex 정책 우회 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `PolicyAwareMongoQueryBuilderTest.anOperatorShapedEqualityValueIsRefused`·`anOperatorShapedLowerBoundIsRefused`·`anOperatorShapedUpperBoundIsRefused`(각 6값: `Map.of("$ne","")`, `Document("$ne",null)`, `BsonDocument("$gt")`, `JsonObject("{$regex}")`, `Pattern`, `BsonRegularExpression`), `anEqualityValueThatIsACollectionIsRefusedInFavourOfWhereIn`, `aRegexHiddenInAMembershipListIsRefused` FAIL(`AssertionError: Expecting actual not to be null`, 23건)→PASS. 공용 검사 `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/query/MongoOperator.java:96`(`requireScalar`), 호출 `query/PolicyAwareMongoQueryBuilder.java:45,52,59,71`. 수정 방향과 차이: 새 공개 타입 `MongoQueryValues`는 API surface 한도(271, `-PraiseMongoApiSurfaceCeiling` 필요)에 걸려 기존 공개 enum `MongoOperator`의 인스턴스 메서드로 둠(surface 불변). `Pattern`·`BsonRegularExpression`도 거부(값 자리 정규식이 regex 정책 우회), `whereIn` 원소에도 적용. | - | 공용 `requireScalar(value)`(Map/Bson/Document 거부, EQ는 Collection도 거부)를 만들어 builder에서 호출 + `Map.of("$ne", …)` 회귀 테스트 |
|
||||
| F-1b | Required | `AtomicFilter.id`/`andEquals`/`toQuery`가 값 타입 검사 없이 `.is(value)` → `AtomicFilter.id(Map.of("$gt",""))`로 단일 문서 보장 붕괴 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoAtomicOperationsTemplateTest.anOperatorDocumentAsTheIdentifierIsRefused`(`AtomicFilter.id(Map.of("$gt",""))`), `anOperatorDocumentAsAnExpectedStateIsRefused`, `anOperatorDocumentPassedToTheConstructorIsRefused` FAIL(`AssertionError` at `MongoAtomicOperationsTemplateTest.java:42`)→PASS. `imperative/atomic/AtomicFilter.java:36`(compact constructor에서 `MongoOperator.EQ::requireScalar`). 패키지 edge `imperative -> query`를 `MongoModuleBoundaryTest` matrix에 추가(DAG 유지). | - | compact constructor에서 모든 값에 F-1a의 `requireScalar` 적용 |
|
||||
| F-1c | Required | Javadoc이 operator injection을 "compile-time impossibility"라고 주장 | 완료 | Wave 1–2 P12: F-1a·F-1b 수정 때 같은 파일 Javadoc 정정 | - | F-1a 후 "런타임 스칼라 검사로 막는다"로 수정 |
|
||||
| F-1d | Required | security lane이 "injection" 검증을 표방하지만 injection 케이스 없음 | 남음 | `src/adapter/outbound/persistence-mongo/build.gradle:183`, `src/adapter/outbound/persistence-mongo/src/mongoIntegrationTest/java/dev/caskeleton/adapter/outbound/mongo/security/MongoSecurityIntegrationLaneTest.java`(`$ne`/`$gt`/inject 0건) | W4 | lane에 operator-document 값 거부 케이스 추가 또는 설명에서 "injection" 삭제 |
|
||||
| F-2a | Required | 여러 profile일 때 startup validator가 `active-profile`을 무시하고 모든 profile의 topology를 관측값과 비교 → REPLICA_SET+STANDALONE 조합이면 기동 항상 실패 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/autoconfigure/MongoStartupValidator.java:65-88`, `active-profile`은 `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/client/MongoProfileClientSettingsAutoConfiguration.java:53-54`에서 raw `getProperty`로만 읽음 | W2 | `activeProfile`을 `MongoPlatformSettings`에 한 번 바인딩하고 validator는 그 profile만 검사 + 두 profile 테스트 |
|
||||
| F-2b | Required | health가 `anyMatch(profile.topology() != observed)` → 다른 profile 때문에 readiness 영구 DOWN | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/autoconfigure/MongoPlatformHealthIndicator.java:57-58,86-89` | W2 | F-2a의 바인딩된 active profile 하나만 비교 |
|
||||
| F-2a | Required | 여러 profile일 때 startup validator가 `active-profile`을 무시하고 모든 profile의 topology를 관측값과 비교 → REPLICA_SET+STANDALONE 조합이면 기동 항상 실패 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoStartupValidatorTest.anInactiveProfileWithAnotherTopologyDoesNotFailStartup`(primary=REPLICA_SET 활성, local=STANDALONE) FAIL(`MongoOperationRejectedException: profile 'local' declares topology STANDALONE but is connected to REPLICA_SET`)→PASS, `MongoPlatformPropertiesTest.aProfileSetWhoseActiveNameMatchesNoneOfItsProfilesIsRefused`. `activeProfile`을 `MongoPlatformSettings` 첫 component로 한 번 바인딩(`autoconfigure/MongoPlatformSettings.java:34,74,83`), validator는 활성 profile만 비교(`autoconfigure/MongoStartupValidator.java:67`), customizer의 raw `getProperty` 제거(`client/MongoProfileClientSettingsAutoConfiguration.java:63,90`). 설정 키가 `ca-skeleton.persistence-mongo.active-profile` → `ca-skeleton.persistence-mongo.platform.active-profile`로 이동(`src/main/resources/config/mongo.yml:14`, EPP `MongoDefaultsEnvironmentPostProcessor.java:47`). env 키 `APP_PERSISTENCE_MONGO_ACTIVE_PROFILE`는 그대로라 `env-keys.yaml`·`.env.example` 변경 없음. | - | `activeProfile`을 `MongoPlatformSettings`에 한 번 바인딩하고 validator는 그 profile만 검사 + 두 profile 테스트 |
|
||||
| F-2b | Required | health가 `anyMatch(profile.topology() != observed)` → 다른 profile 때문에 readiness 영구 DOWN | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoStartupValidatorTest.anInactiveProfileWithAnotherTopologyDoesNotMakeTheInstanceUnready` FAIL(`Expecting value to be true but was false`)→PASS. `autoconfigure/MongoPlatformHealthIndicator.java:89`(활성 profile 하나만 비교), health detail에 `activeProfile` 추가(`:83`). | - | F-2a의 바인딩된 active profile 하나만 비교 |
|
||||
| F-3a | Required | change-stream pipeline이 같은 `clusterTime` 트랜잭션 이벤트를 버림 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "Mongo change stream(`changestream/**`)과 change-stream→messaging bridge(`advanced/bridge/`)". `git ls-files` 에 `changestream` 0건 | - | - |
|
||||
| F-3b | Required | consumer가 `fullDocument`만 넘겨 delete 이벤트가 `{}` | 해당 없음(코드 삭제) | 위와 같은 행(`ReactiveMongoChangeStreamConsumer` 삭제) | - | - |
|
||||
| F-3c | Required | BUSY/PARKED 뒤 다음 이벤트 checkpoint가 건너뛴 이벤트를 넘김 | 해당 없음(코드 삭제) | 위와 같은 행(`MongoChangeStreamRunner` 삭제) | - | - |
|
||||
| F-3d | Required | `MongoResumeCheckpoint.belongsTo()` 호출자 없음, cluster 검사 미실행 | 해당 없음(코드 삭제) | 위와 같은 행. 남은 `MongoResumeException`·`MongoTopologyRequirement.changeStreams()`는 어휘만 남은 것으로 이 결함과 무관 | - | - |
|
||||
| F-4a | Required | bulk 경로가 raw `getQueryObject()`/`getUpdateObject()`로 `UpdateOneModel`을 만들어 `@Field` 이름·custom conversion 미적용(atomic 경로는 `operations.updateFirst(…, documentType, …)`) | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/bulk/MongoBulkExecutor.java:76-78`, 비교 `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/atomic/MongoAtomicOperationsTemplate.java:139` | W2 | `documentType`을 받아 `QueryMapper`/`UpdateMapper`로 매핑(또는 `MongoOperations.bulkOps(…)` 사용) + `@Field`·비String 값 테스트 |
|
||||
| F-4b | Required | bulk 크기 추정이 매핑 전 `toJson()`을 호출해 codec 없는 값(`DomainDocumentId`, `BigInteger`)에서 실패 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/imperative/bulk/MongoBulkWritePlan.java:68-69` | W2 | F-4a의 매핑 결과로 크기 추정 |
|
||||
| F-5a | Required | CSFLE `schemaMap` 키가 `db.coll`이 아니라 bare collection → 드라이버가 매칭하지 못해 자동 암호화 안 됨 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleClientFactory.java:40-41` | W1 | namespace(`database.collection`)로 키 지정 |
|
||||
| F-5b | Required | `profile.fields()`를 읽지 않고 호출자가 준 JSON을 그대로 schema로 씀 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleClientFactory.java:32-47`, `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleProfile.java:18-22` | W1 | `fields()`로 schema를 생성하고 `encryptedFieldsMapJson` 인자 제거 |
|
||||
| F-5c | Required | `keyVaultCredential`을 `keyVaultMongoClientSettings`로 넘기지 않음(프로필 Javadoc의 별도 자격 증명 약속 위반) | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleClientFactory.java:43-47`, `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/advanced/encryption/csfle/MongoCsfleProfile.java:11-12,21` | W1 | 별도 credential로 `keyVaultMongoClientSettings` 설정 |
|
||||
| F-4a | Required | bulk 경로가 raw `getQueryObject()`/`getUpdateObject()`로 `UpdateOneModel`을 만들어 `@Field` 이름·custom conversion 미적용(atomic 경로는 `operations.updateFirst(…, documentType, …)`) | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): 실제 Mongo lane `MongoBulkMappingLaneTest.aBulkUpdateWritesTheFieldUnderItsMappedName`(`mongoReplicaSetTest`) FAIL(`expected {_id=o-1, st=PAID} but was {_id=o-1, st=NEW, status=PAID}`)→PASS. `MongoBulkExecutor.execute(context, documentType, plan)`로 시그니처 변경, `QueryMapper`/`UpdateMapper`로 entity 매핑(`imperative/bulk/MongoBulkExecutor.java:68,130`). `bulkOps(...)`는 CSOT `withTimeout`을 잃어서 쓰지 않음. | - | `documentType`을 받아 `QueryMapper`/`UpdateMapper`로 매핑(또는 `MongoOperations.bulkOps(…)` 사용) + `@Field`·비String 값 테스트 |
|
||||
| F-4b | Required | bulk 크기 추정이 매핑 전 `toJson()`을 호출해 codec 없는 값(`DomainDocumentId`, `BigInteger`)에서 실패 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): 실제 Mongo lane `MongoBulkMappingLaneTest.aBulkUpdateCarriesValuesThatNeedAConverter`(`DomainDocumentId` id + `BigInteger` 값, `findById`로 왕복) FAIL(`CodecConfigurationException: Can't find a codec for ... DomainDocumentId`)→PASS. 크기 한도를 plan 생성자에서 executor로 옮겨 매핑된 문서를 collection codec으로 `RawBsonDocument` 인코딩한 실제 byte로 판정(`MongoBulkExecutor.java:150`), `MongoBulkWritePlan.estimatedEncodedBytes` 삭제. 한도 회귀 테스트는 `MongoBulkOutcomeTest.aPlanOverTheByteCeilingIsRefused`(hermetic, `mappedWrites` 직접 호출)로 이동. | - | F-4a의 매핑 결과로 크기 추정 |
|
||||
| F-5a | Required | CSFLE `schemaMap` 키가 `db.coll`이 아니라 bare collection → 드라이버가 매칭하지 못해 자동 암호화 안 됨 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoCsfleClientFactoryTest.theSchemaIsKeyedByTheCollectionNamespace` — 재현 FAIL(`Expecting all elements of ["customers"] to match`)→PASS. `MongoCsfleProfile`에 `database` component 추가, `namespace()` = `database.collection`(`advanced/encryption/csfle/MongoCsfleProfile.java:23,67`), `MongoCsfleClientFactory.java:76`. | - | namespace(`database.collection`)로 키 지정 |
|
||||
| F-5b | Required | `profile.fields()`를 읽지 않고 호출자가 준 JSON을 그대로 schema로 씀 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoCsfleClientFactoryTest.theSchemaIsGeneratedFromTheFieldPolicies`(중첩 경로 `contact.email` → 중첩 `properties`, Random/Deterministic 알고리즘, keyId UUID) 재현 FAIL(`Expecting actual "{}" to contain "ssn"`)→PASS, `anAliasWithoutADataKeyIdIsRefused`, `aFieldInsideAnEncryptedParentIsRefused`. `encryptedFieldsMapJson` 인자 제거, 대신 `Map<String, UUID> dataKeyIds`(alias→data key id: 자동 암호화 schema는 alias가 아니라 key id를 받으므로 호출자가 key vault에서 해석) — `MongoCsfleClientFactory.java:55,91`. Deterministic 필드는 `bsonType: string` 고정(`ponytail:` 주석, 비문자열 equality 필드가 생기면 정책에 타입 추가). | - | `fields()`로 schema를 생성하고 `encryptedFieldsMapJson` 인자 제거 |
|
||||
| F-5c | Required | `keyVaultCredential`을 `keyVaultMongoClientSettings`로 넘기지 않음(프로필 Javadoc의 별도 자격 증명 약속 위반) | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoCsfleClientFactoryTest.theKeyVaultConnectsWithItsOwnCredential` 재현 FAIL(`Expecting actual not to be null` — `getKeyVaultMongoClientSettings()`)→PASS. 생성자가 `MongoCredentialResolver`를 받아 `profile.keyVaultCredential()`로 key vault `MongoClientSettings`를 만든다(`MongoCsfleClientFactory.java:40,64-73`). 실제 암호화 lane은 불가: 자동 암호화는 `mongocryptd` 또는 `crypt_shared`(MongoDB Enterprise 배포물)가 필요하고 lane이 쓰는 community `mongo:8.0` 이미지에는 없다. driver 쪽 `org.mongodb:mongodb-crypt`도 이 leaf 의존성에 없다(새 의존성·네트워크 다운로드 필요). 그래서 driver에 넘기는 `AutoEncryptionSettings`를 설정 단위 테스트로 검증함. F-5d(W4, 단위 테스트 추가)도 이 테스트로 사실상 충족. | - | 별도 credential로 `keyVaultMongoClientSettings` 설정 |
|
||||
| F-5d | Required | CSFLE factory에 테스트·호출자 없음(README가 "테스트 없는 진입점"으로 명시) | 남음 | `src/adapter/outbound/persistence-mongo/README.md:159-162` | W4 | 생성된 `AutoEncryptionSettings`(namespace 키, schema, key-vault 설정) 단위 테스트 추가 |
|
||||
| F-6 | Required | 공유 컬렉션 tenancy 강제 지점(`TenantScopedMongoOperations`) 구현·호출자 없음, 문서는 강제된다고 약속 | 완료 | 인터페이스 삭제(「제거된 코드」 표 "`MongoDataKeyResolver`, `MongoTenantDatabaseResolver`, `TenantScopedMongoOperations`"), 문서를 "adopter repository가 injector를 모든 경로에서 호출, facade 없음"으로 수정(`docs/mongodb/advanced/multi-tenancy.md:15-17`), 커밋 6d27356e | - | - |
|
||||
| F-7 | Consider | reactive cursor가 row마다 두 번 직렬화 | 해당 없음(코드 삭제) | 「제거된 코드」 표 "Mongo reactive 경로(`reactive/**` …)". `MongoReactiveCursorPublisher` 0건 | - | - |
|
||||
| F-8 | Consider | migration lock이 모든 쓰기 오류를 "경쟁에서 짐"으로 삼킴 | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/migration/MongoCollectionMigrationLock.java:112-114` | W2 | `lostTheRace.getError().getCode() == 11000`일 때만 `Optional.empty()`, 그 외 재던짐 |
|
||||
| F-8 | Consider | migration lock이 모든 쓰기 오류를 "경쟁에서 짐"으로 삼킴 | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): 실제 Mongo lane `MongoMigrationLaneTest.aLeaseWriteThatFailsForAnotherReasonIsRaisedRatherThanReportedAsALostRace`(validator로 insert를 121 실패시킴) FAIL(`Expecting actual not to be null`)→PASS. `migration/MongoCollectionMigrationLock.java:116`. 수정 방향(`code == 11000`)보다 조금 넓게 `ErrorCategory.DUPLICATE_KEY`(11000·11001·12582, driver 정의)로 판정 — 같은 패키지 `MongoCollectionMigrationLedger.java:160`과 같은 기준. | - | `lostTheRace.getError().getCode() == 11000`일 때만 `Optional.empty()`, 그 외 재던짐 |
|
||||
| F-9a | Nit | `MongoPlatformAutoConfiguration`에 inline FQN 약 38줄(leaf CLAUDE.md 금지 규칙 위반) | 남음 | `src/adapter/outbound/persistence-mongo/src/main/java/dev/caskeleton/adapter/outbound/mongo/autoconfigure/MongoPlatformAutoConfiguration.java:41,65,72,132-134` 외, 규칙 `src/adapter/outbound/persistence-mongo/CLAUDE.md:69` | W5 | FQN을 import로 교체 |
|
||||
| F-9b | Nit | 고아 Javadoc(`:192-198`) | 해당 없음(코드 삭제) | 고아 Javadoc이 있던 `ReactiveExecution` 블록이 reactive 경로와 함께 삭제(「제거된 코드」 표 reactive 행). 현재 파일에 연속·고아 Javadoc 0건 | - | - |
|
||||
| F-9c | Nit | CLAUDE.md가 조립 방식을 `implementation(project(...))`로 적음(실제 `runtimeOnly`) | 완료 | `src/adapter/outbound/persistence-mongo/CLAUDE.md:52-53`(`runtimeOnly project(':adapter:outbound:persistence-mongo')`), `src/app-bootstrap/build.gradle:146`, 커밋 6d27356e | - | - |
|
||||
@@ -318,12 +330,12 @@
|
||||
| ID | 심각도 | 요약 | 상태 | 근거 | Wave | 수정 방향 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| G-1a | Critical | SCRIPT lane 한도(기본 8)가 연결 수가 아니라 동시 lease 수라 정상 Redis에서도 9번째 동시 호출부터 거부 | 완료 | `src/adapter/outbound/redis-runtime/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/sdk/lettuce/connection/RedisRuntimeOwner.java:145-166`(lane별 fair `Semaphore`, `acquireTimeout`까지 대기 후 거부), `src/adapter/outbound/redis-runtime/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/sdk/config/RedisSdkAutoConfiguration.java:234,241`. 테스트 `RedisScriptLaneAdmissionTest.callersBeyondTheScriptLaneLimitWaitForAReturnedConnectionInsteadOfBeingRefused`, `aCallerStillWaitingWhenTheAcquireTimeoutRunsOutIsRefusedAsNotSent`. 커밋 `6d27356e` | - | - |
|
||||
| G-1b | Critical | Redis에 보내지 않은 lane 거부(`RedisCommandRejectedException`, not-sent)를 idempotency·lease adapter가 `Indeterminate`로 보고 | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/idempotency/RedisIdempotencyStoreAdapter.java:129-131`(외 243-248, 299-304, 331-336, 474-479), `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/lease/RedisDistributedLeaseAdapter.java:167-172`(외 225-227, 341-346, 372-375). `LeaseAcquireOutcome.Unavailable`·`IdempotencyClaimOutcome.Unavailable`는 있지만 쓰지 않음 | W2 | 두 adapter에 `RedisEdgeRateLimitAdapter.java:123-132`과 같은 `catch (RedisOperationException)` + `metadata().ambiguousExecution()` 분기를 넣어 not-sent는 `Unavailable`로 반환하고, 포화된 owner로 거부를 재현하는 테스트 추가 |
|
||||
| G-1c | Critical | `redisRequired` health probe가 업무와 같은 REGULAR lane에서 lease를 빌려, lane 포화가 `acquireTimeout`을 넘으면 Redis 정상이어도 DOWN | 남음 | `src/adapter/outbound/redis-runtime/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/sdk/config/RedisHealthContributor.java:51,61-64`(borrow 거부도 `unreachable`). 대기 후 거부로 바뀌어 순간 포화는 완화됨 | W2 | `RedisHealthContributor.probe()`에서 borrow 거부(`RedisCommandRejectedException`)를 `unreachable`이 아닌 `saturated`(UP 유지)로 분리하거나 lane 한도 밖 전용 probe 연결 사용 |
|
||||
| G-2a | Required | fixed-window/sliding-counter hash가 `windowStart-2w` 필드 하나만 지우고 매 허용마다 `PEXPIRE` 갱신 → 필드·key 무한 증가(M4 회귀) | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/ratelimit/RateLimitScripts.java:57-59,88-90`. 주석 `:39-40`("refreshed per hit이 아니다")은 여전히 코드와 반대 | W2 | `FIXED_WINDOW`는 `start`/`count` 두 필드 덮어쓰기, `SLIDING_COUNTER`는 `start`/`cur`/`prev` 회전으로 바꾸고 `:39-40` 주석 수정 |
|
||||
| G-1b | Critical | Redis에 보내지 않은 lane 거부(`RedisCommandRejectedException`, not-sent)를 idempotency·lease adapter가 `Indeterminate`로 보고 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): NEW-5c와 같은 수정(아래) | - | 두 adapter에 `RedisEdgeRateLimitAdapter.java:123-132`과 같은 `catch (RedisOperationException)` + `metadata().ambiguousExecution()` 분기를 넣어 not-sent는 `Unavailable`로 반환하고, 포화된 owner로 거부를 재현하는 테스트 추가 |
|
||||
| G-1c | Critical | `redisRequired` health probe가 업무와 같은 REGULAR lane에서 lease를 빌려, lane 포화가 `acquireTimeout`을 넘으면 Redis 정상이어도 DOWN | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `redis-runtime/.../config/RedisHealthContributor.java:108`: borrow 거부(`RedisCommandRejectedException`)는 owner가 OPEN이면 `saturated`(reachable=true, UP), 아니면 `shutting-down`. `RedisHealthContributorTest.aSaturatedLaneIsLoadNotAnOutage` FAIL(`[false, "unreachable"]` ≠ `[true, "saturated"]`)→PASS. 트레이드오프(Redis가 멈춰 lane이 계속 가득 차면 saturated로 보임)는 클래스 javadoc에 기록 — 해당 요청은 timeout 후 fail-closed | - | `RedisHealthContributor.probe()`에서 borrow 거부(`RedisCommandRejectedException`)를 `unreachable`이 아닌 `saturated`(UP 유지)로 분리하거나 lane 한도 밖 전용 probe 연결 사용 |
|
||||
| G-2a | Required | fixed-window/sliding-counter hash가 `windowStart-2w` 필드 하나만 지우고 매 허용마다 `PEXPIRE` 갱신 → 필드·key 무한 증가(M4 회귀) | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RateLimitScripts.java:55`(fixed-window `start`/`count` 두 필드 덮어쓰기), `:90`(sliding-counter `start`/`cur`/`prev` 회전), `:36-44` 주석을 실제 동작(히트마다 PEXPIRE, 상태 크기 고정)으로 수정. in-memory fake(`redis-runtime` testFixtures `InMemoryRedisCommandGateway` fixedWindow/slidingCounter)도 같은 레이아웃으로. 실제 Redis `LiveRedisSemanticPortsTest.windowCounterStateDoesNotGrowAcrossSkippedWindows`[FIXED_WINDOW, SLIDING_COUNTER] FAIL(`expected: 1L but was: 4L`)→PASS. 배포 시 기존 per-window 필드 키는 카운터가 한 번 리셋되고 옛 필드는 늘지 않은 채 TTL로 사라짐 | - | `FIXED_WINDOW`는 `start`/`count` 두 필드 덮어쓰기, `SLIDING_COUNTER`는 `start`/`cur`/`prev` 회전으로 바꾸고 `:39-40` 주석 수정 |
|
||||
| G-2b | Required | in-memory fake가 rate-limit 스크립트의 `HDEL`/`PEXPIRE`를 흉내내지 않아 hash 증가가 테스트되지 않음 | 남음 | `src/adapter/outbound/redis-runtime/src/testFixtures/java/dev/caskeleton/adapter/outbound/cache/redis/sdk/lettuce/operations/InMemoryRedisCommandGateway.java:1717-1753`(필드 put만). cache-redis 테스트에 HLEN 단언 0건 | W4 | fake `fixedWindow`/`slidingCounter`를 G-2a의 새 필드 모델에 맞추고, `LiveRedisSemanticPortsTest`에 여러 window 뒤 HLEN ≤ 3 단언 추가 |
|
||||
| G-3a | Required | lease replay(status 2)가 서버 잔여 `PTTL`을 버리고 재시도 시점부터 전체 TTL을 다시 부여 | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/lease/RedisDistributedLeaseAdapter.java:157-161` → `handle()` `:231-239`가 `localValidityOf(request.leaseTtl())` 사용 (`inspect()` `:213`만 `observedValidityOf`) | W2 | status 2 분기에서 `observedValidityOf(reply.remainingMillis())`로 handle 생성 |
|
||||
| G-3b | Required | TTL ≤ drift 검사가 Redis 호출 뒤에 있어, 서버는 lease를 잡았는데 IAE가 catch돼 `Indeterminate` 반환 | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/lease/RedisDistributedLeaseAdapter.java:114-127`(검사), `:145-156`(먼저 스크립트 실행), `:167-172`(IAE를 `Exception`으로 잡음) | W2 | `tryAcquire`·`renew`에서 `localValidityOf(leaseTtl)`을 `owner.borrow` 전에 호출 |
|
||||
| G-3a | Required | lease replay(status 2)가 서버 잔여 `PTTL`을 버리고 재시도 시점부터 전체 TTL을 다시 부여 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RedisDistributedLeaseAdapter.java:169`: status 2 replay handle은 `observedValidityOf(reply.remainingMillis())`. `RedisDistributedLeaseAdapterTest.aReplayedAcquireKeepsOnlyTheServersRemainingTtl` FAIL(`30S to be less than or equal to 10S`)→PASS. 소유자 결정 8대로 lease 포트 유지 | - | status 2 분기에서 `observedValidityOf(reply.remainingMillis())`로 handle 생성 |
|
||||
| G-3b | Required | TTL ≤ drift 검사가 Redis 호출 뒤에 있어, 서버는 lease를 잡았는데 IAE가 catch돼 `Indeterminate` 반환 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RedisDistributedLeaseAdapter.java:148`(tryAcquire), `:341`(renew): `localValidityOf`를 `owner.borrow` 전에 호출, IAE는 호출자에게 전파. `aTtlWithinTheDriftBudgetIsRejectedBeforeReachingRedis`·`aRenewTtlWithinTheDriftBudgetIsRejectedBeforeReachingRedis`(FAIL `Expecting actual not to be null`→PASS), `aTtlWithinTheDriftBudgetLeavesTheResourceFree`(FAIL: `Owned[...]` to be an instance of `Absent`→PASS) | - | `tryAcquire`·`renew`에서 `localValidityOf(leaseTtl)`을 `owner.borrow` 전에 호출 |
|
||||
| G-4a | Required | `capacity.maximum-in-flight-bytes`·`capacity.maximum-reply-bytes`가 바인딩만 되고 적용 안 됨 | 해당 없음(코드 삭제) | `docs/capability-status.md` 「제거된 코드」 `app.redis.limits.*`… 행(174). `RedisSdkSettings`에 getter 없음, env-keys에 `APP_REDIS_CAPACITY_MAXIMUM_*_BYTES` 없음 | - | - |
|
||||
| G-4b | Required | `limits.*` 11개(`maxKeyBytes`~`offlineQueueCommands`·`maxBitmapOffset`)가 적용 안 되고 SDK는 하드코딩 `RedisOperationLimits.defaults()` 사용 | 해당 없음(코드 삭제) | 같은 표 행 174. `src/adapter/outbound/redis-sdk/README.md` "Configuration that is code, not settings" 절이 한도를 코드로 준다고 명시 | - | - |
|
||||
| G-4c | Required | `timeout.collection`·`timeout.admin` 미적용 | 해당 없음(코드 삭제) | 같은 표 행 174. 현재 `Timeouts`는 `fast`·`script`·`batch`만 있고 모두 참조됨(`RedisTopologyClientFactory.java:310`, `RedisCapabilityConfig.java:78`, `RedisSdkAutoConfiguration.java:259`) | - | - |
|
||||
@@ -347,10 +359,10 @@
|
||||
| G-7d | Consider | runtime과 sdk가 같은 패키지 `…cache.redis.sdk.*`를 공유 | 남음 | redis-runtime main 전 파일이 `dev.caskeleton.adapter.outbound.cache.redis.sdk.*`(예: `.../sdk/lettuce/connection/RedisRuntimeOwner.java:1`) | W3 | redis-runtime 패키지를 `dev.caskeleton.adapter.outbound.cache.redis.runtime.*`로 이동 |
|
||||
| G-7e | Consider | runtime `RedisCorrectnessRoles`가 소비자 selector 값(session·idempotency·rate-limit·lease)을 하드코딩 | 남음 | `src/adapter/outbound/redis-runtime/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/sdk/config/RedisCorrectnessRoles.java:32-37` | W3 | selector 목록을 소비자인 cache-redis(`RedisCapabilitySettings`)로 옮기고 runtime은 "required 여부"만 받도록 변경 |
|
||||
| G-8 | Consider | EVALSHA+NOSCRIPT 재로드 헬퍼가 4벌 복사, `CacheScripts`만 메시지 `startsWith("NOSCRIPT")` 폴백 | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/cache/CacheScripts.java:41-87`, `ratelimit/RateLimitScripts.java:209-263`, `lease/LeaseScripts.java:106-160`, `idempotency/IdempotencyScripts.java:213-271` | W3 | cache-redis에 `RegisteredLuaScript`(digest 캐시·NOSCRIPT 판별·재로드 1회) 하나를 두고 네 클래스가 사용 |
|
||||
| G-9a | Consider | 장애 WARN이 capability·operation·type 조합마다 JVM 수명 동안 한 번뿐(`WARNED` 비우지 않음) | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/RedisSemanticFailureLogger.java:19,26` | W2 | `WARNED`를 key별 마지막 WARN 시각 맵으로 바꿔 시간 창(예: 1분)마다 다시 WARN |
|
||||
| G-9b | Consider | `failureType`이 대부분 wrapper(`ExecutionException`) 이름 | 남음 | 같은 파일 `:24`. 호출부는 `.get()`에서 잡은 예외를 그대로 넘김(`RedisDistributedLeaseAdapter.java:167-168` 등) | W2 | `report()`에서 `ExecutionException`·`CompletionException` cause를 풀고 기록 |
|
||||
| G-10a | Consider | SCRIPT ACL probe가 `return {1}`이라 스크립트 내부 명령(`TIME`/`HSET`/`PEXPIRE`/`DEL`) 권한 부족을 기동 때 못 잡음 | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/capability/RedisSemanticScriptAclProbe.java:20`. 실제로 `infra/redis-sdk/acl/application-advanced.acl:1`에 `+time`이 없어 `LiveRedisSemanticPortsTest`가 첫 요청에서 실패(알려진 lane 실패) | W2 | probe 스크립트를 probeKey에 `TIME`·`HSET`·`PEXPIRE`·`HGET`·`DEL`을 실제 실행하는 것으로 교체하고, 테스트 ACL에 `+time` 추가 |
|
||||
| G-10b | Consider | `redisRequired`가 REGULAR lane만 probe → ADVANCED 자격 증명이 깨져도 readiness UP | 남음 | `src/adapter/outbound/redis-runtime/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/sdk/config/RedisHealthContributor.java:51`, `RedisSdkAutoConfiguration.java:259,287` | W2 | script capability가 선택되면 required contributor가 SCRIPT lane에서 등록 스크립트 EVALSHA로 probe |
|
||||
| G-9a | Consider | 장애 WARN이 capability·operation·type 조합마다 JVM 수명 동안 한 번뿐(`WARNED` 비우지 않음) | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RedisSemanticFailureLogger.java:28,58`: once-per-JVM `Set` → key별 마지막 WARN 시각 맵, `WARN_INTERVAL`(1분)마다 다시 WARN. 테스트용 package-private `report(..., nowNanos)`. `RedisSemanticFailureLoggerTest.aContinuingFailureWarnsAgainOnceTheWindowHasPassed` FAIL(`Expected size: 2 but was: 1`)→PASS | - | `WARNED`를 key별 마지막 WARN 시각 맵으로 바꿔 시간 창(예: 1분)마다 다시 WARN |
|
||||
| G-9b | Consider | `failureType`이 대부분 wrapper(`ExecutionException`) 이름 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RedisSemanticFailureLogger.java:39`: `ExecutionException`/`CompletionException` cause를 풀어 기록. `aWrappedFailureIsReportedByItsCause` FAIL(`expected "IllegalStateException" but was "ExecutionException"`)→PASS | - | `report()`에서 `ExecutionException`·`CompletionException` cause를 풀고 기록 |
|
||||
| G-10a | Consider | SCRIPT ACL probe가 `return {1}`이라 스크립트 내부 명령(`TIME`/`HSET`/`PEXPIRE`/`DEL`) 권한 부족을 기동 때 못 잡음 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RedisSemanticScriptAclProbe.java:29-38`: probe key에서 `TIME`→`HSET`→`PEXPIRE`→`HGET`→`DEL`을 실행하고 읽은 값이 쓴 값과 같을 때만 `{1}`. `anAccountDeniedACommandTheScriptsCallFailsStartup`[HSET/PEXPIRE/HGET/DEL] FAIL→PASS. 실제 Redis standalone·cluster에서 `LiveRedisSemanticScriptAclProbeTest` 2건 PASS. 테스트 ACL `+time`은 NEW-5a(W1)에서 추가 | - | probe 스크립트를 probeKey에 `TIME`·`HSET`·`PEXPIRE`·`HGET`·`DEL`을 실제 실행하는 것으로 교체하고, 테스트 ACL에 `+time` 추가 |
|
||||
| G-10b | Consider | `redisRequired`가 REGULAR lane만 probe → ADVANCED 자격 증명이 깨져도 readiness UP | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `RedisCorrectnessRoles.java:71` `anyScriptRoleSelected`(idempotency/rate-limit/lease), `RedisSdkAutoConfiguration.java:296`: 스크립트 role이 선택되면 `redisRequired`가 SCRIPT lane에서 `SCRIPT LOAD`+`EVALSHA`(`return 1`, key `<namespace>:probe:{health}:script`)도 확인(`RedisHealthContributor.java:92`). 실제 Redis `LiveRedisCompositionTest.aBrokenAdvancedAccountTakesRequiredRedisDown` FAIL(`expected: DOWN but was: UP`)→PASS, `aWorkingAdvancedAccountKeepsRequiredRedisUp` PASS. 단위 `RedisHealthContributorTest.aScriptLaneItsAccountCannotRunIsUnreachable` PASS | - | script capability가 선택되면 required contributor가 SCRIPT lane에서 등록 스크립트 EVALSHA로 probe |
|
||||
| G-11a | Consider | application executor를 adapter leaf에서 조립하고 provider마다 lease·codec 적용이 다름 | 완료 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/idempotency/IdempotencyProviderSelectionConfig.java:32-55`(`IdempotencySettings` 하나로 한 번 조립), `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/capability/RedisIdempotencyConfig.java:31-35`(store만 제공). 「제거된 코드」 행 228. 테스트 `IdempotencyProviderCompositionTest.redisComposesOneExecutorOverTheRedisStoreAlone`. 커밋 `6d27356e` | - | - |
|
||||
| G-11b | Consider | 소유자 결정: 멱등성 executor 조립을 별도 `composition:*` 모듈로 이동 — 아직 app-bootstrap에 있고 sample이 두 번째 executor를 조립 | 남음 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/idempotency/IdempotencyProviderSelectionConfig.java:28-55`, `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/bootstrap/idempotency/SampleIdempotencyConfig.java:39`. `src/composition/`에는 fileserver·notification만 있음 | W3 | `composition:idempotency` leaf를 `modules.json`에 등록하고 `IdempotencyProviderSelectionConfig`·`IdempotencySettings`를 옮긴 뒤 app-bootstrap·sample이 그 leaf를 쓰게 하고 `SampleIdempotencyConfig` 삭제 |
|
||||
| G-12a | Nit | `app-bootstrap/CLAUDE.md`가 없는 `autoconfigure/redis/RedisCapabilityConfig`·`RedisKeys`를 가리킴 | 완료 | `src/app-bootstrap/CLAUDE.md:92,102`가 `cache-redis`의 `capability/RedisCapabilityConfig`·`capability/RedisKeys`를 가리킴(두 파일 존재). 커밋 `6d27356e` | - | - |
|
||||
@@ -360,22 +372,22 @@
|
||||
| G-12e | Nit | redis-runtime `RedisSdkSettings`가 바인딩하는 `app.redis.*` env key의 `owner_module`이 cache-redis | 남음 | `docs/registries/env-keys.yaml:2130,2162,2299` 등 23개(`capacity.maximum-in-flight-commands`, `capacity.reject-when-disconnected`, `lifecycle.*`, `tls.*`, `sentinel.*`, `authentication.*`, `cluster.*`, `pubsub.*`)가 `adapter-outbound-cache-redis`. `capacity.maximum-script-connections`(`:2146`)만 runtime으로 고쳐짐 | W5 | 해당 23개 행 `owner_module`을 `adapter-outbound-redis-runtime`으로 변경(`app.redis.enabled`는 cache-redis 기본 설정이 소유하므로 유지) |
|
||||
| H-1a | Critical | canonical bridge `@ConditionalOnBean(EncodedMessagePublisher)`가 platform auto-config보다 먼저 평가됨 | 완료 | `src/adapter/outbound/messaging/src/main/java/dev/caskeleton/adapter/outbound/messaging/autoconfigure/MessagingBridgeRootAutoConfiguration.java:35-36`(`afterName = "...MessagingPlatformRootAutoConfiguration"`). 테스트 `MessagingPlatformBridgeAutoConfigurationTest.bridgeIsAssembledAfterThePlatformRootThatProvidesThePublisher`, 실제 starter 조립 `KafkaCapabilityActivationTest.presentModuleIsOnAndPublishesThroughKafka`. 커밋 `6d27356e` | - | - |
|
||||
| H-1b | Critical | 빈 `producer-id`가 `@ConditionalOnProperty`를 통과해 `new ProducerId("")`로 기동 실패 | 완료 | 같은 파일 `:71,81-91`(`ProducerIdConfigured`: `StringUtils.hasText`). 테스트 `MessagingPlatformBridgeAutoConfigurationTest.blankProducerIdLeavesTheBridgeOutWithoutFailingStartup`("", " "). 커밋 `6d27356e` | - | - |
|
||||
| H-2 | Required | Dynamic Target이 `trace-propagation=false`여도 `traceparent`·`X-Correlation-Id`를 외부 호스트로 보냄 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/dynamic/DefaultDynamicTargetGateway.java:154`(무조건 `PlatformHeaderPropagation.apply`). `tracePropagation`은 바인딩(`DynamicTargetAutoConfiguration.java:46`)만 되고 main에서 읽지 않음. 문서 `docs/httpclient/configuration-reference.md:179` "Off by default" | W1 | `prepare()`에 policy를 넘겨 `if (policy.tracePropagation())`일 때만 적용하고, 헤더 부재 테스트 추가 |
|
||||
| H-3a | Required | Dynamic redirect가 303에서 method만 GET으로 바꾸고 body는 유지 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/dynamic/DefaultDynamicTargetGateway.java:98,134`, `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/api/operation/HttpOperation.java:91-101`(`withMethod`가 body 유지) | W1 | 303 hop에서 `EmptyBody`로 교체(`BlockingRedirectCoordinator`와 같은 처리) |
|
||||
| H-3b | Required | Dynamic redirect가 307/308에서 `BODY_NOT_REPLAYABLE` 검사 없이 body 재전송 | 남음 | 같은 파일 `:121-136`(`RedirectEvaluator` 미사용) | W1 | hop마다 `RedirectEvaluator.evaluate`를 호출해 재전송 불가 body면 거부 |
|
||||
| H-3c | Required | Dynamic redirect가 cross-origin hop에서 호출자 헤더(`X-Api-Key` 등 `HeaderPolicy` 허용 헤더)를 그대로 전달 | 남음 | 같은 파일 `:95-98`(매 hop `operation` 헤더 재사용, `SensitiveHeaderStripper` 미사용) | W1 | origin이 바뀌면 `SensitiveHeaderStripper.stripForCrossOrigin`으로 헤더 정리 후 다음 hop 준비 |
|
||||
| H-2 | Required | Dynamic Target이 `trace-propagation=false`여도 `traceparent`·`X-Correlation-Id`를 외부 호스트로 보냄 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `DefaultDynamicTargetGatewayTest.traceHeadersStayOffTheWireWhenThePolicyDisablesPropagation` FAIL(`Expecting actual: [true, true] to contain exactly [false, false]`)→PASS, 켜진 경우 `traceHeadersAreSentWhenThePolicyEnablesPropagation` PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:186` | - | `prepare()`에 policy를 넘겨 `if (policy.tracePropagation())`일 때만 적용하고, 헤더 부재 테스트 추가 |
|
||||
| H-3a | Required | Dynamic redirect가 303에서 method만 GET으로 바꾸고 body는 유지 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `DefaultDynamicTargetGatewayTest.seeOtherHopSendsAGetWithoutTheOriginalBody` FAIL(`["GET", "{"name":"grace"}"]` ≠ `["GET", ""]`)→PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:155` | - | 303 hop에서 `EmptyBody`로 교체(`BlockingRedirectCoordinator`와 같은 처리) |
|
||||
| H-3b | Required | Dynamic redirect가 307/308에서 `BODY_NOT_REPLAYABLE` 검사 없이 body 재전송 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `DefaultDynamicTargetGatewayTest.temporaryRedirectWithAOneShotBodyIsRejectedAsNotReplayable` FAIL(`Expecting actual not to be null` — 예외 없이 재전송)→PASS. hop마다 `RedirectEvaluator` 판정 `HC/dynamic/DefaultDynamicTargetGateway.java:133-150`(거부 `:147`, 메트릭 outcome=거부 코드) | - | hop마다 `RedirectEvaluator.evaluate`를 호출해 재전송 불가 body면 거부 |
|
||||
| H-3c | Required | Dynamic redirect가 cross-origin hop에서 호출자 헤더(`X-Api-Key` 등 `HeaderPolicy` 허용 헤더)를 그대로 전달 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `DefaultDynamicTargetGatewayTest.crossOriginHopDropsTheCallerSuppliedApiKey` FAIL(`[true, true]` ≠ `[true, false]`)→PASS. `HC/dynamic/DefaultDynamicTargetGateway.java:162`. 수정 방향대로 `SensitiveHeaderStripper` 표준 이름만 제거함 — 관례 밖 이름의 호출자 헤더는 P11-new-4 | - | origin이 바뀌면 `SensitiveHeaderStripper.stripForCrossOrigin`으로 헤더 정리 후 다음 hop 준비 |
|
||||
| H-3d | Required | `DefaultDynamicTargetGateway.exchange`를 호출하는 테스트 0건 | 남음 | httpclient 전체에서 `DefaultDynamicTargetGateway` 참조는 main 2파일(`DefaultDynamicTargetGateway.java`, `DynamicTargetAutoConfiguration.java`)뿐 | W4 | httpclient `src/test`에 redirect 계약 테스트(303 body 제거, 307 1회, cross-origin 헤더 제거, trace off) 추가 |
|
||||
| H-4a | Required | 허용된 API-key 헤더 `X-Client-Key`가 cross-origin redirect에서 제거되지 않음 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/security/SensitiveHeaderStripper.java:23,31-33`(`x-api-key`·`api-key`만), `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/restclient/BlockingExecutionSupport.java:90`(`standard()` 사용), `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/autoconfigure/HttpClientAuthenticationAutoConfiguration.java:34-35` | W1 | `BlockingRedirectCoordinator`의 cross-origin 처리에서 실제 해석된 `RequestCredentials.headers().keySet()`도 함께 제거 |
|
||||
| H-4a | Required | 허용된 API-key 헤더 `X-Client-Key`가 cross-origin redirect에서 제거되지 않음 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `BlockingRedirectCoordinatorTest.crossOriginHopDropsTheProfileCredentialHeader` FAIL(`[true, true]` ≠ `[true, false]`)→PASS. `HC/restclient/BlockingAttemptExecutor.java:187`(붙인 자격증명 헤더 이름을 stripper에 추가), `HC/security/SensitiveHeaderStripper.java:61`(`alsoStripping`, `withAdditional`은 이것에 위임 — H-4b(W3) 삭제 대상은 그대로). 참고: 기동 검증이 API key + `allowCrossOrigin`을 이미 거부하므로 방어 계층 수정 | - | `BlockingRedirectCoordinator`의 cross-origin 처리에서 실제 해석된 `RequestCredentials.headers().keySet()`도 함께 제거 |
|
||||
| H-4b | Required | `SensitiveHeaderStripper.withAdditional` main 호출자 0 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/security/SensitiveHeaderStripper.java:47-55` | W3 | H-4a 적용 후 `withAdditional` 삭제 |
|
||||
| H-5a | Required | reactive 경로가 실패 단계를 기록하지 않아 전송 후 실패도 `VALIDATION`(NOT_SENT)으로 분류 → 호출자가 실행된 POST를 재전송 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/webclient/ReactiveAttemptExecutor.java:166-167`(`baseMetadata.stage()`), webclient 패키지에 `AttemptProgressTracker` 0건. D4는 httpclient reactive를 건드리지 않음(`HttpServiceClientAutoConfiguration.java:52-54`가 계속 조립) | W2 | `exchangeToMono` 안에서 요청 전송 뒤 `REQUEST_BODY`, 응답 수신 시 `RESPONSE_HEADERS`/`RESPONSE_BODY`를 기록해 classifier에 넘김 |
|
||||
| H-5b | Required | `DataBufferLimitException`(응답 크기 초과)이 어디서도 매핑되지 않아 NOT_SENT/connect 실패로 보고 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/webclient/WebClientResponseMapper.java:33`, `reactor/ReactorFailureClassifier.java:106-108`(fallback `notSent(UNKNOWN)`) | W2 | `WebClientResponseMapper`에서 `DataBufferLimitException`을 `HttpResponseTooLargeException`으로 변환 |
|
||||
| H-5c | Required | 모르는 transport 실패가 mapper `default`에서 `HttpConnectException`이 됨 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/restclient/StableBlockingExceptionMapper.java:37` | W2 | `default`를 전용 unknown 예외 타입으로 바꾸고 blocking·reactive 둘 다 테스트 |
|
||||
| H-6a | Required | OAuth2 토큰 네트워크 조회가 `ConcurrentHashMap.compute` 안에서 실행돼 같은 bin 호출자가 모니터에서 대기(N번째 ≈ N×10s) | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/auth/OAuth2CredentialProvider.java:61-67` | W2 | `cache.get` + 만료 검사 → lock 밖에서 `tokenLoader.load(key)` → `cache.put`(single-flight는 loader가 이미 보장) |
|
||||
| H-6b | Required | timeout 난 호출자가 공유 future를 `cancel(true)` → 뒤늦은 합류자는 raw `CancellationException`, pool 스레드는 인터럽트 안 됨 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/auth/SingleFlightTokenLoader.java:79-83,104`(`CancellationException` catch 없음) | W2 | 호출자 timeout에서는 cancel하지 않고 `inFlight`에서만 제거, `CancellationException`을 `HttpAuthenticationException`으로 변환 |
|
||||
| H-5a | Required | reactive 경로가 실패 단계를 기록하지 않아 전송 후 실패도 `VALIDATION`(NOT_SENT)으로 분류 → 호출자가 실행된 POST를 재전송 | 해당 없음(코드 삭제) | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): D `06764fcb`에서 `webclient/ReactiveAttemptExecutor` 삭제. blocking은 단계 기록함: `HC/restclient/BlockingAttemptExecutor.java:233,238`(`tracker.enter(REQUEST_BODY/RESPONSE_HEADERS)`)이 classifier로 전달 | - | `exchangeToMono` 안에서 요청 전송 뒤 `REQUEST_BODY`, 응답 수신 시 `RESPONSE_HEADERS`/`RESPONSE_BODY`를 기록해 classifier에 넘김 |
|
||||
| H-5b | Required | `DataBufferLimitException`(응답 크기 초과)이 어디서도 매핑되지 않아 NOT_SENT/connect 실패로 보고 | 해당 없음(코드 삭제) | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): D `06764fcb`에서 `WebClientResponseMapper`·`ReactorFailureClassifier` 삭제. blocking은 크기 초과를 `HC/restclient/ResponseSizeLimiter.java:42,50`에서 `HttpResponseTooLargeException`으로 던지고 `BlockingAttemptExecutor.java:303`이 `RESPONSE_TOO_LARGE`로 분류 | - | `WebClientResponseMapper`에서 `DataBufferLimitException`을 `HttpResponseTooLargeException`으로 변환 |
|
||||
| H-5c | Required | 모르는 transport 실패가 mapper `default`에서 `HttpConnectException`이 됨 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): blocking 결함(`StableBlockingExceptionMapper`)이라 W2에서 수정. `StableBlockingExceptionMapperTest.unknownTransportFailureIsNotReportedAsAConnectFailure` FAIL(`expected HttpUnknownTransportException but was HttpConnectException`)→PASS. `HC/restclient/StableBlockingExceptionMapper.java:40`, 새 타입 `HC/api/error/HttpUnknownTransportException.java`. reactive 쪽 테스트는 코드 삭제로 없음 | - | `default`를 전용 unknown 예외 타입으로 바꾸고 blocking·reactive 둘 다 테스트 |
|
||||
| H-6a | Required | OAuth2 토큰 네트워크 조회가 `ConcurrentHashMap.compute` 안에서 실행돼 같은 bin 호출자가 모니터에서 대기(N번째 ≈ N×10s) | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `OAuth2CredentialProviderTest.aSlowRefreshDoesNotHoldUpAnotherRegistrationThatSharesItsBin` FAIL(`java.util.concurrent.TimeoutException` — 같은 bin의 다른 registration이 느린 refresh 뒤에서 대기)→PASS. `HC/auth/OAuth2CredentialProvider.java:65-69`(`cache.get` → lock 밖 `tokenLoader.load` → `cache.put`) | - | `cache.get` + 만료 검사 → lock 밖에서 `tokenLoader.load(key)` → `cache.put`(single-flight는 loader가 이미 보장) |
|
||||
| H-6b | Required | timeout 난 호출자가 공유 future를 `cancel(true)` → 뒤늦은 합류자는 raw `CancellationException`, pool 스레드는 인터럽트 안 됨 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `SingleFlightTokenLoaderTest.aCallerThatJoinedLaterStillGetsTheTokenAfterAnEarlierCallerTimedOut` FAIL(`ExecutionException: CancellationException`)→PASS. timeout·interrupt 분기에서 `cancel(true)` 제거 `HC/auth/SingleFlightTokenLoader.java:81`, `CancellationException`→`HttpAuthenticationException` `:113` | - | 호출자 timeout에서는 cancel하지 않고 `inFlight`에서만 제거, `CancellationException`을 `HttpAuthenticationException`으로 변환 |
|
||||
| H-7a | Consider | `categoryOf`가 `getSimpleName()` 문자열 switch로 blocking·reactive에 중복 | 남음 | `src/adapter/outbound/httpclient/src/main/java/dev/caskeleton/adapter/outbound/httpclient/restclient/BlockingAttemptExecutor.java:291-312`, `webclient/ReactiveAttemptExecutor.java:182-200` | W3 | `HttpClientException`에 `FailureCategory category()`를 두고 각 하위 예외가 구현, 두 switch 삭제 |
|
||||
| H-7b | Consider | reactive `categoryOf`에 CircuitOpen·RateLimitRejected·BulkheadRejected가 없어 telemetry가 `UNKNOWN` | 남음 | `ReactiveAttemptExecutor.java:182-200`(3개 누락), 같은 예외를 `resilience/ReactiveAttemptResiliencePipeline.java:57-70`이 던짐 | W2 | H-7a로 해결. 별도로 하면 reactive switch에 세 case 추가 |
|
||||
| H-8 | Consider | bridge `prepare`가 모든 `RuntimeException`을 cause 없이 `REJECTED_BEFORE_SEND`로 바꿈 | 남음 | `src/adapter/outbound/messaging/src/main/java/dev/caskeleton/adapter/outbound/messaging/platformbridge/PlatformIntegrationEventPublishAdapter.java:60-64` | W2 | catch를 `IllegalArgumentException`으로 좁히고 cause를 `OutboxRelayFailureReport`(또는 거부 예외)로 전달 |
|
||||
| H-9 | Consider | Kafka seam이 `InterruptedException`을 삼켜 종료 중에도 relay가 항목당 최대 30s 계속 처리 | 남음 | `src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/KafkaSenderAutoConfiguration.java:98-110`(`.get()`의 인터럽트가 `throws Exception`으로 나감), `src/adapter/outbound/messaging/src/main/java/dev/caskeleton/adapter/outbound/messaging/outbox/OutboxMessagePublishAdapter.java:94`(→ AMBIGUOUS), `.../core/OutboundMessagePublisher.java:36`(로그 후 무시) | W2 | `kafkaSender` 람다에서 `InterruptedException`을 잡아 `Thread.currentThread().interrupt()` 후 재던지기, `OutboundMessagePublisher`는 interrupt 상태를 보존 |
|
||||
| H-7b | Consider | reactive `categoryOf`에 CircuitOpen·RateLimitRejected·BulkheadRejected가 없어 telemetry가 `UNKNOWN` | 해당 없음(코드 삭제) | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): D `06764fcb`에서 `ReactiveAttemptExecutor` 삭제. blocking `categoryOf`에는 세 case 있음 `HC/restclient/BlockingAttemptExecutor.java:308-310` | - | H-7a로 해결. 별도로 하면 reactive switch에 세 case 추가 |
|
||||
| H-8 | Consider | bridge `prepare`가 모든 `RuntimeException`을 cause 없이 `REJECTED_BEFORE_SEND`로 바꿈 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `PlatformIntegrationEventPublishAdapterTest.aFailureOtherThanAnIncompatibleValueIsNotTurnedIntoARefusal` FAIL(`Expecting actual not to be null` — NPE가 REJECTED_BEFORE_SEND로 바뀜)→PASS. catch를 `IllegalArgumentException`으로 좁힘 `MSG/platformbridge/PlatformIntegrationEventPublishAdapter.java:62`; 나머지 예외는 전파되어 relay가 실제 원인 타입으로 재시도·보고. 수정 방향 중 "cause를 거부 결과에 싣기"는 하지 않음: 포트가 `OutboxPublishOutcome` enum만 돌려줘 원인을 실을 자리가 없고, 실으려면 application-core 포트·relay 변경(계층 밖)이 필요. 로그로 남기는 것도 예외 메시지를 운영 로그에 쓰지 않는 규칙(`Slf4jOutboxRelayFailureReportAdapter`)과 충돌 | - | catch를 `IllegalArgumentException`으로 좁히고 cause를 `OutboxRelayFailureReport`(또는 거부 예외)로 전달 |
|
||||
| H-9 | Consider | Kafka seam이 `InterruptedException`을 삼켜 종료 중에도 relay가 항목당 최대 30s 계속 처리 | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `KafkaSenderInterruptionTest.anInterruptedAcknowledgementWaitRethrowsWithTheInterruptFlagRestored` FAIL(`[InterruptedException, false]`)→PASS, `OutboundMessagePublisherTest.anInterruptedSendIsSwallowedWithTheInterruptFlagKept`·`OutboxMessagePublishAdapterTest$FailClosedPath.anInterruptedSendKeepsTheRelayThreadInterrupted` FAIL(`Expecting value to be true but was false`)→PASS. `src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/KafkaSenderAutoConfiguration.java:115`, `MSG/core/OutboundMessagePublisher.java:41`, `MSG/outbox/OutboxMessagePublishAdapter.java:100`(삼키는 지점 두 곳 모두 복원) | - | `kafkaSender` 람다에서 `InterruptedException`을 잡아 `Thread.currentThread().interrupt()` 후 재던지기, `OutboundMessagePublisher`는 interrupt 상태를 보존 |
|
||||
| H-10a | Nit | `src/README.md`가 HTTP client 활성화를 `ca-skeleton.capabilities.http-client`·`OutboundHttpSettings.bindLegacy`로 설명(실제 `app.httpclient.enabled`, `OutboundHttpSettings`는 main에 없음) | 남음 | `src/README.md:331-361`. 같은 파일 `:266` 표는 올바름 | W5 | `:331-361` 절을 `app.httpclient.enabled`/`APP_HTTPCLIENT_ENABLED`와 `runtimeOnly` 한 줄 기준으로 다시 쓰고 legacy 문단 삭제 |
|
||||
| H-10b | Nit | Kafka javadoc이 "프로젝트가 `KafkaSender`를 제공해야 한다"고 적음(leaf가 직접 제공) | 남음 | `src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/KafkaSender.java:6-8`, `KafkaAdapterConfig.java:14`. 실제 `KafkaSenderAutoConfiguration.java:95-110`이 제공 | W5 | 두 javadoc을 "이 leaf가 `kafkaSeamProducer` 위 기본 `KafkaSender`를 제공하고 서비스가 bean으로 대체 가능"으로 수정 |
|
||||
| H-10c | Nit | `KafkaAdapterSettings.addresses()` 호출자 0 | 남음 | `src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/KafkaAdapterSettings.java:41-45` | W5 | 메서드 삭제(파싱 검증은 `BrokerAddress`로 유지) |
|
||||
@@ -398,23 +410,23 @@
|
||||
| I-1c | Critical | `WebRequestContext` argument resolver는 등록되지만 `store` 호출이 0이라 선언한 컨트롤러는 항상 예외(500) | 남음 | 등록 `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/autoconfigure/WebMvcPlatformAutoConfiguration.java:64-74`, `WebMvcRequestContextHolder.store`(`.../mvc/context/WebMvcRequestContextHolder.java:34`) 호출처 main·test 0, `WebMvcRequestContextArgumentResolver.java:40`이 `require` → `IllegalStateException`. `WebRequestContext` 소비자 0 | W3 | 소비자가 없으므로 `core/WebRequestContext`·`mvc/context/*`·`webMvcRequestContextConfigurer` bean을 삭제(쓰려면 `WebMvcRequestIdFilter`에서 `store` 호출) |
|
||||
| I-1d | Critical | `WebResourceNotVisibleException`이 기본 envelope 계약에서 catch-all 500 | 해당 없음(코드 삭제) | `208077fd`에만 `web/error/WebResourceNotVisibleException.java` 존재, HEAD grep 0. 제거 표 「WebProblem 어휘」「durable operation HTTP 투영」 | - | - |
|
||||
| I-1e | Critical | 실서버 IT가 `OperationFixtureController`로 합성 context를 넣어 결함을 못 잡음 | 해당 없음(코드 삭제) | 제거 표 「WebProblem·budget·throttle·operation fixture와 lane」(`testkit/operation/`). HEAD에 `OperationFixtureController` 없음 | - | - |
|
||||
| I-2a | Required | 인증 없는 알림 콜백이 `@RequestBody byte[]`로 본문 전체를 읽은 뒤 크기 검사 | 남음 | `src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/NotificationCallbackMvcController.java:78-85`, 같은 경로 `CallbackMvcSecurityConfiguration.java:35` `permitAll` | W1 | 컨트롤러가 `HttpServletRequest`만 받아 `getContentLengthLong() > maxBodyBytes`면 413, 본문은 `getInputStream().readNBytes(maxBodyBytes + 1)`로 읽고 초과 시 413 |
|
||||
| I-2b | Required | 운영 servlet 앱 전체에 요청 본문 크기·JSON 깊이 상한이 없음 | 남음 | budget 필터 삭제 후 대체 없음: `src/adapter/inbound/web/src/main`·`src/app-bootstrap/src/main/resources`에 본문 상한/`StreamReadConstraints` 설정 grep 0. `docs/web/repository-adaptation.md:147-151`이 "application column 미적용"이라 기재 | W1 | web leaf에 Content-Length 초과 413 + 스트림 상한 필터 하나(또는 `JsonMapperBuilderCustomizer`로 `StreamReadConstraints.maxDocumentLength/maxNestingDepth`)를 두고 Envelope `PAYLOAD_TOO_LARGE`로 응답 |
|
||||
| I-2a | Required | 인증 없는 알림 콜백이 `@RequestBody byte[]`로 본문 전체를 읽은 뒤 크기 검사 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): `NotificationCallbackMvcControllerTest.aDeclaredOversizeBodyIsRefusedWithoutReadingIt`, `anUndeclaredOversizeBodyIsRefusedAfterReadingOneByteOverTheCeiling` FAIL(컴파일: `method callback … cannot be applied to given types` — `@RequestBody byte[]` 시그니처)→PASS. 컨트롤러가 `HttpServletRequest`만 받아 Content-Length 초과면 읽지 않고 413, 아니면 `readNBytes(max+1)`(`src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/NotificationCallbackMvcController.java:85,91`) | - | 컨트롤러가 `HttpServletRequest`만 받아 `getContentLengthLong() > maxBodyBytes`면 413, 본문은 `getInputStream().readNBytes(maxBodyBytes + 1)`로 읽고 초과 시 413 |
|
||||
| I-2b | Required | 운영 servlet 앱 전체에 요청 본문 크기·JSON 깊이 상한이 없음 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): `RequestBodyBoundaryTest.jsonBodyOverTheCeilingIsRejectedAsPayloadTooLarge` FAIL(`Response status expected:<413> but was:<200>`)→PASS, `jsonBodyWithinTheCeilingReachesTheController` PASS. 새 `JsonBodyLimitFilter`(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/filter/JsonBodyLimitFilter.java:33`): JSON 본문만(multipart·form·tus·콜백은 각자 상한), 선언 Content-Length 초과는 읽기 전에, chunked/거짓 길이는 스트림 계수로 `MaxUploadSizeExceededException` → 기존 핸들러 413 `PAYLOAD_TOO_LARGE` Envelope. Jackson이 bean 속성 안에서 이 예외를 감싸는 경우도 413(`GlobalExceptionHandler.java:281`), `GlobalExceptionHandlerTest.unreadableBodyCausedByTheSizeCeilingIsPayloadTooLarge` FAIL(`expected: 413 CONTENT_TOO_LARGE but was: 400 BAD_REQUEST`)→PASS, `JsonBodyLimitFilterTest` 2건. 상한은 `backend.web.mvc.max-json-body-size`(기본 1MB, `WebMvcPlatformSettings.java:31`). JSON 깊이는 Jackson 3.1 기본 `StreamReadConstraints`(maxNestingDepth 500, maxNumberLength 1000)가 Boot가 만든 mapper에 이미 적용되어 있어 따로 두지 않음(`MapperBuilder`에 factory 제약을 바꾸는 API가 없어 customizer로는 설정 불가). 문서·문자열 길이는 본문 상한이 막음 | - | web leaf에 Content-Length 초과 413 + 스트림 상한 필터 하나(또는 `JsonMapperBuilderCustomizer`로 `StreamReadConstraints.maxDocumentLength/maxNestingDepth`)를 두고 Envelope `PAYLOAD_TOO_LARGE`로 응답 |
|
||||
| I-2c | Required | 콜백 크기 테스트가 배열을 직접 넘겨 컨버터 버퍼링 경로를 검증 안 함 | 남음 | `src/adapter/inbound/web-notification/src/test/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/NotificationCallbackMvcControllerTest.java:118-124`(`aBodyOverTheTransportCeilingIsRefusedBeforeIngress`) | W4 | MockMvc/실서버로 큰 본문(및 Content-Length 없는 chunked)을 보내 413과 ingress 미호출을 단언 |
|
||||
| I-2d | Required | `backend.web.budgets.enabled=true`면 없는 `BudgetProblemMapper` 빈을 찾아 기동 실패 | 해당 없음(코드 삭제) | 제거 표 「요청 budget 필터 (`WebMvcBudgetFilter`, `BudgetProblemMapper`)」. `WebMvcBudgetExceptionHandler`·`backend.web.budgets` grep 0 | - | - |
|
||||
| I-2e | Required | 문서가 본문 크기·JSON 깊이를 "Application, always"가 막는다고 기재 | 완료 | `docs/web/repository-adaptation.md:147-151` "Removed 2026-09-25 … no longer enforces the application column" 배너. 커밋 `6d27356e` | - | - |
|
||||
| I-3a | Required | Envelope 계약에서 override 안 된 Spring MVC 예외(필수 파라미터·헤더·part 누락 등)가 `application/problem+json`으로 새어 나감 | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/error/GlobalExceptionHandler.java:52`(RESEH 상속, `handleExceptionInternal` override 없음), `.../envelope/EnvelopeBodyAdvice.java:44-46`(비 JSON은 감싸지 않음). 실경로: `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/adapter/inbound/web/controller/PosterImagePublicationController.java:58`(필수 `Idempotency-Key`), `LegacyPosterImageController.java:36`(필수 part) | W3 | 소유자 결정(Envelope 통일)대로 `GlobalExceptionHandler`에서 `handleExceptionInternal` 하나를 override해 status → `OperationalError` 매핑 후 `ErrorResponseFactory.body` 반환 |
|
||||
| I-3b | Required | `@Valid` 클래스 레벨 제약 위반이 `details: []`로 나감 | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/error/GlobalExceptionHandler.java:262-265`(`getFieldErrors()`만) | W2 | `getGlobalErrors()`도 `ClientSafeValidationDetails`로 변환해 details에 합침 |
|
||||
| I-3b | Required | `@Valid` 클래스 레벨 제약 위반이 `details: []`로 나감 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): 커밋 `5c08d3be`(W2). `GlobalExceptionHandlerTest.classLevelConstraintViolationIsReportedAgainstTheRequest` FAIL(`expected: [{code=INVALID, field=request, message=Invalid value}] but was: []`)→PASS. `getAllErrors()`(`GlobalExceptionHandler.java:263`), `ClientSafeValidationDetails.from(ObjectError)`가 global error를 `field=request`로(`ClientSafeValidationDetails.java:56`) | - | `getGlobalErrors()`도 `ClientSafeValidationDetails`로 변환해 details에 합침 |
|
||||
| I-3c | Required | 필수 파라미터/헤더 누락·`HandlerMethodValidationException` 등의 에러 형식 테스트 0건 | 남음 | web·bootstrap·sample 테스트에 `MissingServletRequestParameter`/`MissingRequestHeader`/`HandlerMethodValidation` grep 0 | W4 | web slice 테스트로 필수 파라미터·헤더 누락 시 Envelope 400(`application/json`)을 단언 |
|
||||
| I-4a | Required | `RequestLoggingFilter`가 Spring Security 뒤에서 돌아 401/403 응답 meta id가 null, 접근 로그 누락 | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/filter/RequestLoggingFilter.java:37`(`@Order` 없음 → LOWEST), MDC는 `:65-71`에서만 채움, `.../auth/AuthErrorResponseWriter.java:46,69`가 MDC 기반 meta 사용. 순서 테스트 `src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/runtime/OperationalContractRuntimeTest.java:100-122`는 세 필터끼리만 비교, `src/adapter/inbound/web/src/testFixtures/java/dev/caskeleton/webtestkit/PipelineOrderFixtureApplication.java:46`은 `WebAdapterAutoConfiguration`을 제외 | W2 | MDC(request/correlation/trace id) 채우기를 `WebMvcRequestIdFilter`(HIGHEST+10)로 옮기고 `OperationalContractRuntimeTest`에 "request-id 필터 order < `springSecurityFilterChain` order" 단언 추가 |
|
||||
| I-4b | Required | trace id를 두 필터가 따로 생성해 서로 불일치 | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/filter/RequestLoggingFilter.java:69`(자체 traceparent 생성) vs `.../mvc/filter/WebMvcRequestIdFilter.java:122`(`WebTraceId` 생성, 요청 속성 `:80`) | W2 | `RequestLoggingFilter`는 `WebMvcRequestIdFilter.traceId(request)`만 읽고 생성하지 않음 |
|
||||
| I-5a | Required | `FORWARDED_HEADERS_TRUSTED` 레이트리밋 키가 XFF 맨 왼쪽 값을 peer 검증 없이 사용 → 비인증 레이트리밋 우회 | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/ForwardedHeaderClientIpResolver.java:15`, 테스트가 이 동작을 고정 `src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/ratelimit/RateLimitKeyResolverTest.java:79-86` | W1 | 이 모드를 삭제하고 `server.forward-headers-strategy=native` + `server.tomcat.remoteip.internal-proxies`로 `getRemoteAddr()`를 쓰는 `REMOTE_ADDR_ONLY` 하나로(운영 정본은 `forward-headers-strategy`라는 W3-2b 결정과 일치) |
|
||||
| I-4a | Required | `RequestLoggingFilter`가 Spring Security 뒤에서 돌아 401/403 응답 meta id가 null, 접근 로그 누락 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): request/correlation/trace/span id 발급·MDC·응답 헤더를 `WebMvcRequestIdFilter`(HIGHEST+10, Security 앞) 한 곳으로 이동(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/filter/WebMvcRequestIdFilter.java:95,103`), ERROR/ASYNC 재디스패치에 같은 값 복원. `SecurityModeWebContractTest.anUnauthenticatedRejectionCarriesTheAssignedRequestIdInItsMeta`(실제 JWT security 체인이 쓴 401 Envelope의 `meta.requestId` = `X-Request-Id`) FAIL(`expected: "13499754-…" but was: null`)→PASS. `WebMvcRequestIdFilterTest.assignedIdentifiersAreOnMdcDuringTheChainAndMatchWhatTheResponseCarries`·`inboundCorrelationIdLosesLineBreaksBeforeReachingMdc` FAIL(`No value present` / `expected "fooFAKE LOG" but was null`)→PASS, `mdcIsClearedWhenTheRequestLeavesTheFilter`·`anErrorRedispatchRestoresTheSameIdentifiersOnMdc` PASS. 순서: `OperationalContractRuntimeTest.requestIdFilterIsRegisteredAheadOfSpringSecurity`(`src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/runtime/OperationalContractRuntimeTest.java:135`, 슬라이스에 `SecurityFilterAutoConfiguration`을 넣어 실제 `springSecurityFilterChain` 등록과 비교) PASS. fixture 문제: `PipelineOrderFixtureApplication`은 의미 순서·async 1회 관측만 증명한다고 주석에 적고 실제 순서는 위 두 테스트가 맡음. `RequestLoggingFilter`는 principal을 읽으려고 보안 체인 안쪽에 남음 → 체인이 거절한 요청의 접근 로그 줄은 없고 entry point/access-denied handler의 `security failure` 로그(이제 request_id 포함)가 대신함 | - | MDC(request/correlation/trace id) 채우기를 `WebMvcRequestIdFilter`(HIGHEST+10)로 옮기고 `OperationalContractRuntimeTest`에 "request-id 필터 order < `springSecurityFilterChain` order" 단언 추가 |
|
||||
| I-4b | Required | trace id를 두 필터가 따로 생성해 서로 불일치 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): trace는 `WebMvcRequestIdFilter`만 만든다(`TraceParent.parse` 또는 새 root, WebTraceId·MDC·응답 `traceparent`가 같은 값). `RequestLoggingFilterTest.assignsNoIdentifierOrTraceOfItsOwn` FAIL(`Expecting [X-Request-Id, X-Correlation-Id, traceparent] not to contain …`)→PASS, `WebMvcRequestIdFilterTest.responseTraceparentCarriesTheTraceIdTheFilterAssigned`·`validInboundTraceparentIsAdoptedWithItsSpanAndEchoed` FAIL(`NullPointerException` — 헤더 없음)→PASS. `RequestLoggingFilter`의 id/trace 생성 코드 삭제(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/filter/RequestLoggingFilter.java`), 옮겨진 테스트는 `WebMvcRequestIdFilterTest`로 | - | `RequestLoggingFilter`는 `WebMvcRequestIdFilter.traceId(request)`만 읽고 생성하지 않음 |
|
||||
| I-5a | Required | `FORWARDED_HEADERS_TRUSTED` 레이트리밋 키가 XFF 맨 왼쪽 값을 peer 검증 없이 사용 → 비인증 레이트리밋 우회 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): 커밋 `983cc832`(W1). 결정대로 `FORWARDED_HEADERS_TRUSTED` 모드 삭제. 비인증 키는 `getRemoteAddr()` 하나(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/RateLimitKeyResolver.java:45`). `RateLimitWebConfigTest.spoofedForwardedForDoesNotChangeTheUnauthenticatedKey`(Review Focus 3: 옛 `client-ip-mode=forwarded-headers-trusted`를 남긴 배포에서 위조 XFF 두 개를 보내도 키가 peer 주소 하나) FAIL(`Expecting actual ["9:CLIENT_IP\|12:198.51.100.1\|…", "…198.51.100.2…"] to contain exactly ["9:CLIENT_IP\|11:203.0.113.7\|…" ×2]`)→PASS. `server.forward-headers-strategy=framework`면 rate limit 켤 때 기동 거부(`RateLimitWebConfig.java:38`), `RateLimitWebConfigTest.frameworkForwardHeadersStrategyIsRefusedWhileRateLimiting` FAIL(`context started successfully`)→PASS. env 키 `APP_RATE_LIMIT_CLIENT_IP_MODE`·설정 키 `app.rate-limit.client-ip-mode` 삭제(`env-keys.yaml`, `.env.example`, `cache-redis.yml`, sample `application.yml`, README 2곳). `APP_SERVER_FORWARD_HEADERS_STRATEGY` allowed_values `[none, native]`, `.env.example` 값 `framework`→`native`, `server.yml` 주석에 `native` + `server.tomcat.remoteip.internal-proxies` 명시 | - | 이 모드를 삭제하고 `server.forward-headers-strategy=native` + `server.tomcat.remoteip.internal-proxies`로 `getRemoteAddr()`를 쓰는 `REMOTE_ADDR_ONLY` 하나로(운영 정본은 `forward-headers-strategy`라는 W3-2b 결정과 일치) |
|
||||
| I-5b | Required | forwarded 헤더 신뢰 판단이 여러 곳에 흩어짐 | 남음 | `TrustedProxyPolicy`·reactive 콜백은 삭제됐으나 3곳 남음: `src/app-bootstrap/src/main/resources/config/server.yml:11`(`forward-headers-strategy`), `src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/ExternalRequestUrlResolver.java:31-53`(정확 문자열 집합), I-5a resolver(검증 없음) | W3 | `ExternalRequestUrlResolver`의 forwarded 파싱과 I-5a 모드를 지우고 Tomcat RemoteIpValve(`forward-headers-strategy=native`)가 고친 `getScheme/getServerName/getRemoteAddr`만 사용 |
|
||||
| I-6a | Required | category 생략 시 컨트롤러가 `"transactional"`을 넣어 marketing suppression이 적용되지 않음(HARD-STOP 4 후보) | 남음 | `src/adapter/inbound/web-notification/src/main/java/dev/caskeleton/adapter/inbound/web/notification/platform/submission/NotificationSubmissionController.java:51-52,88-90` | W2 | 결정(2026-09-25): category 필수 — 생략하면 400, 판정은 유스케이스로 이동 |
|
||||
| I-6a | Required | category 생략 시 컨트롤러가 `"transactional"`을 넣어 marketing suppression이 적용되지 않음(HARD-STOP 4 후보) | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): 결정 13. 컨트롤러의 `DEFAULT_CATEGORY="transactional"` 삭제, `request.category()`를 그대로 넘김(`NotificationSubmissionController.java:87`). 판정은 `AcceptNotificationCommand`(application-notification, `AcceptNotificationCommand.java:70`)가 → `IllegalArgumentException` → 400 `BAD_PARAMETER`. `NotificationSubmissionControllerTest.submissionWithoutCategoryIsRejectedBeforeTheUseCaseRuns` FAIL(`[500, 1]` — 유스케이스가 transactional로 호출됨)→PASS(`[400, 0]`), `AcceptNotificationApplicationUseCaseTest.anAcceptanceWithoutCategoryIsRefusedRatherThanDefaulted` PASS(소유자 명시) | - | 결정(2026-09-25): category 필수 — 생략하면 400, 판정은 유스케이스로 이동 |
|
||||
| I-6b | Required | 템플릿 버전 기본값 `1`, locale 기본값 `Locale.getDefault()`(호스트 JVM)를 컨트롤러가 결정 | 남음 | `.../submission/NotificationSubmissionController.java:48-49,82-84,121-123`, `.../submission/NotificationTemplateController.java:75`(경로 prefix는 I-6a와 같음) | W3 | 세 값을 command에서 `Optional`로 받고 기본값은 알림 유스케이스가 설정값으로 적용 |
|
||||
| I-7 | Required | `wire-type-manifest.yaml`이 런타임에 없는 wire 계약(`LONG: INTEGER_STRING`, `BIG_DECIMAL: DECIMAL_STRING`)을 공개 | 남음 | 기본 web의 bean은 삭제(`WebMvcPlatformAutoConfiguration` 3 bean)됐지만 opt-in leaf로 옮겨져 남음: `src/adapter/inbound/web-advanced/src/main/resources/META-INF/web/wire-type-manifest.yaml:3-9,25-30`, `.../web-advanced/src/main/java/dev/caskeleton/adapter/inbound/web/advanced/contract/WebWireTypeManifest.java`. 적용하는 Jackson 설정 없음 | W5 | 소비자 0이므로 yaml과 `advanced/contract/` 4개 타입·테스트를 삭제하고 web-advanced README.md:45 행 정리 |
|
||||
| I-8a | Consider | 운영 소비자 없는 라이브러리 코드가 기본 web leaf에 있고 운영 경로와 중복 | 완료 | 기본 web leaf 패키지는 `auth·authz·conditional·config·controller·core·envelope·error·filter·http·mvc·observability·pagination·ratelimit·settings`만(`security/cache/openapi/idempotency` 없음). 라이브러리는 opt-in `src/adapter/inbound/web-advanced`(README.md:45 목록), 중복 세대는 삭제(제거 표 「forwarded header 라이브러리」「CORS/CSRF 프로필」「cache 정책 카탈로그」「JSON mapper factory」「OpenAPI customizer」). D1 결정, 커밋 `6d27356e` | - | - |
|
||||
| I-8b | Consider | 더 엄격한 CORS 규칙(`WebCorsPolicyValidator`)을 `CorsSettings`에 합치지 않고 삭제만 함 → 기동 시 origin 형식 검증 없음 | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/settings/CorsSettings.java:24-53`(빈 목록·`*`+credentials만 검사, 기본 allowedHeaders `*` `:48-49`), 사용처 `.../auth/SecurityConfig.java:151-154`. 옛 규칙은 `git show 208077fd:.../security/WebCorsPolicyValidator.java`(정확 origin·소문자·와일드카드·credentials+`*` 헤더 거부) | W1 | `CorsSettings` compact constructor에 옛 validator 규칙(origin = scheme://host[:port] 소문자·경로 없음·와일드카드 없음, credentials면 헤더 `*` 거부) 추가 + 거부 테스트 |
|
||||
| I-8b | Consider | 더 엄격한 CORS 규칙(`WebCorsPolicyValidator`)을 `CorsSettings`에 합치지 않고 삭제만 함 → 기동 시 origin 형식 검증 없음 | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): NEW-10b와 같은 수정. `CorsSettingsTest.originThatIsNotExactlySchemeHostPortFailsWithTheEnvKeyName`(10개 입력) FAIL(`Expecting actual not to be null` — 예외 없음)→PASS, `exactOriginWithPortIsAccepted` PASS. `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/settings/CorsSettings.java:44,64`. 옛 validator 규칙 중 둘은 넣지 않음: "소문자만"(Spring `CorsConfiguration.checkOrigin`이 대소문자 무시 비교), "credentials면 allowedHeaders `*` 거부"(Spring은 `*`를 요청 헤더 목록으로 되돌려 주므로 credentials와 함께 동작한다 — 넣으면 지금 동작하는 기본값(`*`)을 깨뜨림) | - | `CorsSettings` compact constructor에 옛 validator 규칙(origin = scheme://host[:port] 소문자·경로 없음·와일드카드 없음, credentials면 헤더 `*` 거부) 추가 + 거부 테스트 |
|
||||
| I-8c | Consider | `observability/WebAuditPublisher` 참조 0 | 해당 없음(코드 삭제) | 제거 표 「2세대 관측 (`WebAccessLog*`, `WebAudit*` …)」, HEAD grep 0 | - | - |
|
||||
| I-8d | Consider | `RateLimitInterceptor.disabled(...)`가 M2 이후 dead | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/RateLimitInterceptor.java:48`, 호출은 `src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/ratelimit/RateLimitInterceptorTest.java:137`뿐 | W3 | `disabled` 팩토리와 그 테스트 삭제 |
|
||||
| I-8e | Consider | `cursor/CursorCodec.withDevKey()` 키 하드코딩 | 해당 없음(코드 삭제) | 제거 표 「서명 커서 코덱 (`CursorCodec`, `CursorException`)」, HEAD grep 0 | - | - |
|
||||
@@ -423,17 +435,17 @@
|
||||
| I-9c | Consider | reactive problem 핸들러가 `spring.mvc.*`로 켜짐 | 해당 없음(코드 삭제) | 제거 표 「web WebFlux 플랫폼」(D4) | - | - |
|
||||
| I-9d | Consider | reactive 스택엔 envelope 핸들러가 없어 스위치 off면 Boot 기본 에러 JSON | 해당 없음(코드 삭제) | 제거 표 「web WebFlux 플랫폼」「알림 콜백 WebFlux 핸들러」(D4) | - | - |
|
||||
| J-1 | Critical | 인가 단계가 fragment를 예산 없이 지수적으로 전개(cost 단계 이전) | 완료 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlDocumentAuthorizationHandler.java:118-155`(fragment 1회 전개 + 방문 예산), `.../cost/GraphQlDocumentShapeAnalyzer.java:221-227`(같음). 테스트 `GraphQlDocumentAuthorizationHandlerTest.exponentialFragmentFanOutIsAuthorizedWithinTheTimeBound`(`doublingFragments(40)`). 커밋 `6d27356e` | - | - |
|
||||
| J-2 | Required | `__typename`을 introspection으로 취급해 introspection off에서 Apollo/urql 쿼리 전부 거부 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/cost/GraphQlDocumentShapeAnalyzer.java:41,212`(`startsWith("__")`), 기본 off `src/adapter/inbound/graphql/src/main/resources/config/graphql.yml:19`. `__typename` 허용 테스트 없음 | W2 | `__schema`/`__type`만 막고 systemTest에 introspection off + `{ _health __typename }` 성공 추가 |
|
||||
| J-3a | Required | 마스킹된 실패가 어디에도 로그되지 않음(executionId가 가리키는 기록 없음) | 남음 | graphql main에 `LoggerFactory/getLogger/System.Logger` 0 파일. 마스킹 분기 `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/error/GraphQlExceptionResolver.java:55`, 요청 단계 `.../runtime/GraphQlPlatformWebInterceptor.java:94-95,161-165`, `.../runtime/GraphQlPlatformInstrumentation.java:84-88` | W2 | 마스킹 분기(unknown → `INTERNAL_ERROR`)에서 executionId와 예외를 ERROR로 한 번 로그 |
|
||||
| J-2 | Required | `__typename`을 introspection으로 취급해 introspection off에서 Apollo/urql 쿼리 전부 거부 | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): `cost/GraphQlFragmentReachabilityTest.typenameIsNotTreatedAsIntrospection`(3건) FAIL(`selectsIntrospection`이 true) → PASS, systemTest `runtime/GraphQlPlatformExecutionPathTest.typenameIsAnsweredWhenTheClientProfileForbidsIntrospection`(introspection 금지 profile + `{ _health __typename }`) FAIL(`GRAPHQL_DOCUMENT_SHAPE_REJECTED`/`INTROSPECTION` 에러) → PASS. `__schema`/`__type`만 차단. `.../cost/GraphQlDocumentShapeAnalyzer.java:50,221`. 커밋 `aa5f4d90` | - | `__schema`/`__type`만 막고 systemTest에 introspection off + `{ _health __typename }` 성공 추가 |
|
||||
| J-3a | Required | 마스킹된 실패가 어디에도 로그되지 않음(executionId가 가리키는 기록 없음) | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): `error/GraphQlExceptionResolverTest.aMaskedFailureIsLoggedOnceAtErrorWithItsExecutionId` FAIL(`Expected size: 1 but was: 0`) → PASS. 마스킹 분기에서 `graphql failure masked as INTERNAL_ERROR (executionId=…)` + 예외를 ERROR 한 번. 모든 경로가 이 분기를 거치게 된 것은 S5-#6a 수정 덕분. `.../error/GraphQlExceptionResolver.java:61`. 커밋 `aa5f4d90` | - | 마스킹 분기(unknown → `INTERNAL_ERROR`)에서 executionId와 예외를 ERROR로 한 번 로그 |
|
||||
| J-3b | Required | Javadoc이 "detail은 로그에 남는다"고 주장 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlWireErrorMapper.java:30-32`, `.../runtime/GraphQlPlatformRejectionMapper.java:26-29` | W5 | J-3a 로그 추가와 함께 문구를 실제 로그 위치에 맞춤 |
|
||||
| J-4a | Required | DataLoader `GraphQlBatchTimeoutException`·`GraphQlMissingKeyException` CODE를 mapper가 몰라 `INTERNAL_ERROR`로 나감 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlPlatformRejectionMapper.java:54-121`에 두 타입 없음. 카탈로그 테스트는 "modelled-only"(`src/adapter/inbound/graphql/src/test/java/dev/caskeleton/adapter/inbound/graphql/error/GraphQlErrorCodeCatalogTest.java:52-55`)인데 `src/adapter/inbound/graphql/CLAUDE.md:161`은 DataLoader `wired` | W2 | `mapKnown`에 두 예외 매핑 추가(batch timeout은 `REQUEST_TIMEOUT`, missing key는 전용 code)하고 `platformCodes()`·카탈로그 테스트 갱신 |
|
||||
| J-4b | Required | blocking bridge 포화가 Reactor `Schedulers.fromExecutor`를 거쳐 `RejectedExecutionException`으로 감싸여 `INTERNAL_ERROR` + 거부마다 ERROR 로그 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlBatchLoaderRegistrar.java:121-125`, `.../runtime/GraphQlBlockingBridge.java:78-85`; mapper에 `GraphQlBlockingBridgeFullException` 없음 | W2 | Reactor scheduler 대신 `Mono.fromFuture(CompletableFuture.supplyAsync(..., bridge executor))`로 거부를 `Mono.error`로 받고, cause chain에서 bridge-full을 찾아 `DEPENDENCY_UNAVAILABLE`로 매핑 |
|
||||
| J-4a | Required | DataLoader `GraphQlBatchTimeoutException`·`GraphQlMissingKeyException` CODE를 mapper가 몰라 `INTERNAL_ERROR`로 나감 | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): `runtime/GraphQlWireErrorMapperTest.dataLoaderFailuresKeepAPlatformCode`(2건) FAIL(`["INTERNAL_ERROR","INTERNAL"]`) → PASS. batch timeout → `REQUEST_TIMEOUT`/TIMEOUT, missing key → 새 platform code `GRAPHQL_BATCH_KEY_MISSING`/BUSINESS. `.../runtime/GraphQlPlatformRejectionMapper.java:106,113`, `.../error/GraphQlErrorCode.java:48,72`, `GraphQlErrorCodeCatalogTest` 갱신. Spring GraphQL `ExceptionResolversExceptionHandler`가 `CompletionException`을 벗겨 넘기는 것 확인(2.0.5 소스). 커밋 `aa5f4d90` | - | `mapKnown`에 두 예외 매핑 추가(batch timeout은 `REQUEST_TIMEOUT`, missing key는 전용 code)하고 `platformCodes()`·카탈로그 테스트 갱신 |
|
||||
| J-4b | Required | blocking bridge 포화가 Reactor `Schedulers.fromExecutor`를 거쳐 `RejectedExecutionException`으로 감싸여 `INTERNAL_ERROR` + 거부마다 ERROR 로그 | 해당 없음(코드 삭제) | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): bridge 포화 경로(`GraphQlBlockingBridge`·`Schedulers.fromExecutor`)는 event loop 전용이라 D4(servlet 단일)에 맞춰 삭제. 남은 경로는 호출 스레드 inline(`Mono.fromCallable`)이라 예외가 그대로 mapper에 도달(J-4a 매핑 적용). 삭제 커밋 `6390bf89` | - | Reactor scheduler 대신 `Mono.fromFuture(CompletableFuture.supplyAsync(..., bridge executor))`로 거부를 `Mono.error`로 받고, cause chain에서 bridge-full을 찾아 `DEPENDENCY_UNAVAILABLE`로 매핑 |
|
||||
| J-4c | Required | DataLoader 실패 테스트가 `getErrors().isNotEmpty()`만 단언 | 남음 | `src/adapter/inbound/graphql/src/test/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlBatchLoaderRegistrationTest.java:137,150,166,202` | W4 | 각 실패의 wire `extensions.code`/`category`를 단언 |
|
||||
| J-5 / X1-#2d | Required | stable extensions allowlist가 아무도 처리하지 않는 `idempotencyKey`를 허용 | 완료 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/http/GraphQlExtensionsPolicy.java:40-42`(`stableDefaults()` → `none()`), 테스트 `GraphQlRequestEnvelopeValidatorTest.stableDefaultsRejectAnIdempotencyKeyExtensionAsUnregistered`. 제거 표 「GraphQL mutation 멱등성」. 커밋 `6d27356e`<br>X1-#2d: `GraphQlExtensionsPolicy.java:29` 기본 allowlist `Set.of()`, mutation 멱등성 타입 삭제(`docs/capability-status.md:231`), 커밋 `6d27356e` | - | - |
|
||||
| J-6 | Required | `GraphQlClientPolicy.persistedOperationOnly`가 아무 동작도 안 함(fail-open) | 해당 없음(코드 삭제) | 제거 표 「`GraphQlClientPolicy`의 `persistedOperationOnly`·`maxResponseNodes`·`maxResponseBytes`」, graphql src grep 0 | - | - |
|
||||
| J-7 | Consider | preparsed 캐시가 조회마다 전역 lock 아래 전체 항목을 순회 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/execution/BoundedPreparsedDocumentProvider.java:167-177`(끝까지 순회). 맵은 이미 access-order(`:57`) | W3 | `expireIdle`에서 첫 미만료 항목을 만나면 `break`(access-order라 뒤는 모두 더 최근) |
|
||||
| J-8 | Consider | 인가 root 타입 이름을 `"Query/Mutation/Subscription"` 리터럴로 고정 → root 이름을 바꾸면 규칙 미적용(allow 규칙 fail-open) | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlDocumentAuthorizationHandler.java:74-84` | W1 | `context.schema().getQueryType()/getMutationType()/getSubscriptionType()`의 이름 사용 |
|
||||
| J-9a | Consider | body-cap 필터 스트리밍 경로에서 `BodyTooLargeException`이 감싸이면 413 대신 500 가능 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/servlet/GraphQlRequestBodyLimitFilter.java:85-91`(예외 타입 직접 catch), `:205`(RuntimeException). 미확인: 실제 wrapping 여부는 실행해 봐야 함 | W2 | catch를 `Exception`으로 넓혀 cause chain에서 `BodyTooLargeException`을 찾으면 413 |
|
||||
| J-8 | Consider | 인가 root 타입 이름을 `"Query/Mutation/Subscription"` 리터럴로 고정 → root 이름을 바꾸면 규칙 미적용(allow 규칙 fail-open) | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): `runtime/GraphQlDocumentAuthorizationHandlerTest.aProtectedFieldOnARenamedRootTypeIsStillDenied`(query·mutation 2건), `aContextWithoutASchemaIsRefusedInsteadOfGuessingRootNames` FAIL(`Expecting actual not to be null` — 거부 없이 통과) → PASS. root 이름을 `context.schema().getQueryType()/getMutationType()/getSubscriptionType()`에서 읽고, schema나 해당 root가 없으면 `IllegalStateException`(→ INTERNAL_ERROR, fail-closed). `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlDocumentAuthorizationHandler.java:68,87`. 커밋 `0392d8c9` | - | `context.schema().getQueryType()/getMutationType()/getSubscriptionType()`의 이름 사용 |
|
||||
| J-9a | Consider | body-cap 필터 스트리밍 경로에서 `BodyTooLargeException`이 감싸이면 413 대신 500 가능 | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): 재현됨. systemTest `runtime/GraphQlPlatformExecutionPathTest.aChunkedBodyOverTheRawCapIsRefusedWith413`(Content-Length 없는 chunked 200KB 본문) FAIL(`expected: 413 but was: 500`) → PASS. 원인: `FrameworkServlet`(spring-webmvc 7.0.9 `FrameworkServlet.java:1006-1008`)이 decoder 안에서 던진 unchecked `BodyTooLargeException`을 `ServletException("Request processing failed")`으로 감쌈. `IOException/ServletException/RuntimeException`을 잡아 cause chain(최대 16단계)에서 찾으면 413, 아니면 그대로 rethrow. `.../runtime/servlet/GraphQlRequestBodyLimitFilter.java:85,98`. 커밋 `aa5f4d90` | - | catch를 `Exception`으로 넓혀 cause chain에서 `BodyTooLargeException`을 찾으면 413 |
|
||||
| J-9b | Consider | body-cap 필터의 chunked(Content-Length 없음) 경로 테스트 없음 | 남음 | graphql test·systemTest에 `chunked`/`Transfer-Encoding`/`BodyTooLarge` grep 0 | W4 | systemTest에 Content-Length 없는 chunked 초과 본문 → 413 케이스 추가 |
|
||||
| J-10a | Consider | `advanced/**` 134파일 도달 불가 | 해당 없음(코드 삭제) | 제거 표 「graphql `advanced/**` 전체」 | - | - |
|
||||
| J-10b | Consider | `compat`·`release`·`moduleboundary`(테스트 데이터가 운영 jar에) 도달 불가 | 해당 없음(코드 삭제) | 제거 표 「graphql 스키마 호환성 비교기 `compat/`」「graphql 릴리스 게이트 `release/`」「graphql 모듈 경계 모델 `moduleboundary/`」 | - | - |
|
||||
@@ -444,7 +456,7 @@
|
||||
| J-10g | Consider | `schema/` 19개 중 16개 도달 불가 | 해당 없음(코드 삭제) | 제거 표 「schema gate·병렬 조립기 … 14개」. 남은 `schema/` 3개(`GraphQlScalar*`)는 자동 설정에서 도달 | - | - |
|
||||
| J-11a | Consider | CLAUDE.md가 Accept negotiation을 `wired`로 표기(`GraphQlMediaTypes` 도달 불가) | 해당 없음(코드 삭제) | 제거 표 「병렬 HTTP 전송 모델(… `GraphQlMediaTypes`, `GraphQlAcceptHeader` …)」, CLAUDE.md 등급 표에서 행 제거됨 | - | - |
|
||||
| J-11b | Consider | README/CLAUDE가 없는 `GraphqlExceptionResolver`와 "비-carrier는 null 반환 → Spring 기본 처리"를 설명(실제는 전부 마스킹) | 남음 | `src/adapter/inbound/graphql/README.md:64-79`, `src/adapter/inbound/graphql/CLAUDE.md:52,125` | W5 | 현재 구조(`GraphQlDataFetcherExceptionResolver` → `GraphQlWireErrorMapper`, unknown은 마스킹)로 해당 절 재작성 |
|
||||
| J-12 / X2-P2-6b | Consider | prod가 익명 principal resolver로 기동한 뒤 모든 요청을 `AUTHENTICATION_REQUIRED`로 거부 | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/autoconfigure/GraphQlPlatformAutoConfiguration.java:266-270`(기본 `anonymous()`), 같은 파일 `:296-309`는 authz policy만 prod에서 요구<br>X2-P2-6b: `AuthorizationPrincipal.java:13` tenant 없음, GraphQL 기본 resolver `GraphQlPrincipalResolver.anonymous()`(`GraphQlPlatformAutoConfiguration.java:269`), gRPC `GrpcAuthenticationPolicy.java:16` boolean, 가명은 `GraphQlIdentityFingerprinter`와 `UserPrincipalPseudonymizerPort`로 갈림 | W2 | `graphQlPrincipalResolver` 기본 bean도 `properties.production()`이면 `GraphQlPlatformConfigurationException`<br>X2-P2-6b: `AuthorizationPrincipal`에 tenant 추가해 모든 inbound가 생성, GraphQL에 Spring Security `Authentication` → principal 기본 resolver, 가명은 `UserPrincipalPseudonymizerPort` 하나로 |
|
||||
| J-12 / X2-P2-6b | Consider | prod가 익명 principal resolver로 기동한 뒤 모든 요청을 `AUTHENTICATION_REQUIRED`로 거부 | 남음 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): `autoconfigure/GraphQlDeploymentModeContractTest.aProductionModeRefusesTheAnonymousPrincipalResolver`(PRODUCTION_INTERNAL·PUBLIC) FAIL(`to have failed but context started successfully`) → PASS, `aProductionModeWithAnExplicitPolicyAndResolverStarts` PASS. 기본 `graphQlPrincipalResolver` bean이 production이면 `GraphQlPlatformConfigurationException`(mode 없으면 REQUIRED_MESSAGE). `.../autoconfigure/GraphQlPlatformAutoConfiguration.java:243`. 커밋 `aa5f4d90`<br>J-12 부분은 완료(production에서 principal resolver가 없으면 기동 거부). X2-P2-6b 나머지(`AuthorizationPrincipal` tenant, gRPC 인증 정책, 가명 포트 통일)는 Wave 3 3-D | W3 | `graphQlPrincipalResolver` 기본 bean도 `properties.production()`이면 `GraphQlPlatformConfigurationException`<br>X2-P2-6b: `AuthorizationPrincipal`에 tenant 추가해 모든 inbound가 생성, GraphQL에 Spring Security `Authentication` → principal 기본 resolver, 가명은 `UserPrincipalPseudonymizerPort` 하나로 |
|
||||
| K-1 | Required | `HandshakeAdmissionPipeline`이 bearer/cookie 헤더 존재만으로 통과, 모든 사용자가 한 actor | 해당 없음(코드 삭제) | 제거 표 「platform catalog·정책 패키지 … `handshake` …」(K#1 명시). 현재 websocket main에 `handshake/` 없음 | - | - |
|
||||
| K-2a | Required | servlet 런타임에서 frame/fragment 상한(`FragmentAssembler`)이 동작하지 않음 | 해당 없음(코드 삭제) | 제거 표 「`inbound/FragmentAssembler`, … `maxFrameBytes`·`maxFragments` …」(K#2 명시) | - | - |
|
||||
| K-2b | Required | 실제 수신 상한이 Tomcat 기본 8 KiB이고 설정한 `maxMessageBytes`와 무관 | 완료 | handler가 whole message의 크기를 직접 검사 `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/servlet/PlatformWebSocketHandler.java:79-86`, 컨테이너 버퍼를 `maxMessageBytes`와 맞추는 조립 예·설명 `src/adapter/inbound/websocket/README.md:108-124`. 커밋 `6d27356e` | - | - |
|
||||
@@ -453,13 +465,13 @@
|
||||
| K-4 | Required | `SerializedOutboundWriter.drain()` 경쟁으로 메시지가 남겨짐 | 완료 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/outbound/SerializedOutboundWriter.java:111-122`(unlock 후 `hasQueued()` 재확인 루프), 테스트 `SerializedOutboundWriterTest.nothingIsStrandedWhenBusy`(수동 drain 제거). 커밋 `6d27356e` | - | - |
|
||||
| K-5a | Required | `PlatformWebSocketHandler.stop()`이 웹 서버 종료 뒤 실행돼 1001을 못 보냄 | 완료 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/servlet/PlatformWebSocketHandler.java:155-161`(`SmartLifecycle.DEFAULT_PHASE`), 테스트 `PlatformWebSocketHandlerTest.stopRunsBeforeTheWebServerGracefulShutdown`. 커밋 `6d27356e` | - | - |
|
||||
| K-5b | Required | 종료 IT가 context를 닫지 않고 `stop()`을 직접 호출 | 남음 | `src/adapter/inbound/websocket/src/systemTest/java/dev/caskeleton/adapter/inbound/websocket/runtime/TomcatWebSocketAbuseIT.java:71`(`handler.stop()`) | W4 | `shutdownClosesLiveConnections`에서 application context를 `close()`해 Spring lifecycle 순서로 1001을 받는지 단언 |
|
||||
| K-6 | Required | gRPC 예외 인터셉터가 정상 close 뒤 `onComplete`·늦은 `onCancel`을 삼켜 스트리밍 정리 hook이 안 돎 | 남음 | `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcExceptionHandlingInterceptor.java:67-80`(모든 콜백이 `closed`면 return), `:95`(OK close에도 `closed=true`). `GrpcExceptionHandlingInterceptorTest`에 onComplete/onCancel 테스트 없음 | W2 | `onComplete`/`onCancel`은 gate 없이 try/catch만으로 위임, gate는 `onMessage`/`onHalfClose`/`onReady`에만; `setOnCloseHandler`가 실행되는 wire 테스트 추가 |
|
||||
| K-6 | Required | gRPC 예외 인터셉터가 정상 close 뒤 `onComplete`·늦은 `onCancel`을 삼켜 스트리밍 정리 hook이 안 돎 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcP1BoundaryWireTest.aSuccessfullyCompletedCallStillRunsTheServiceOnCloseHandler`(실제 Netty, `setOnCloseHandler`) FAIL(`Expecting value to be true but was false`)→PASS, `GrpcExceptionHandlingInterceptorTest.aCancelAfterTheCallClosedStillReachesTheServiceListener` FAIL→PASS. gate는 onMessage/onHalfClose/onReady에만, onCancel/onComplete는 try/catch만 `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcExceptionHandlingInterceptor.java:70,79`. 커밋 `a498ad84` | - | `onComplete`/`onCancel`은 gate 없이 try/catch만으로 위임, gate는 `onMessage`/`onHalfClose`/`onReady`에만; `setOnCloseHandler`가 실행되는 wire 테스트 추가 |
|
||||
| K-7 | Required | `WebSocketSessionRegistry` register/deregister 경쟁으로 actor당 상한 초과 | 해당 없음(코드 삭제) | 제거 표 「platform catalog·정책 패키지 … `session` …」(K#7 명시) | - | - |
|
||||
| K-8 | Consider | conflation 교체가 연결당 상한을 건너뛰고 손실을 `CONFLATED`로 보고 | 완료 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/outbound/OutboundQueue.java:192-210`(로컬·전역 둘 다 검사, 실패 시 `DROPPED`), 테스트 `OutboundQueueTest.conflationThatDoesNotFitTheConnectionBoundIsReportedAsDropped`. 커밋 `6d27356e` | - | - |
|
||||
| K-9 | Consider | `WebSocketCorrelationRegistry.countFor`가 노드 전체 in-flight를 요청마다 순회 | 해당 없음(코드 삭제) | 제거 표 「platform catalog·정책 패키지 … `handler` …」, 현재 websocket main에 `handler/` 없음 | - | - |
|
||||
| K-10a | Consider | gRPC 인증 정책이 yes/no만 반환해 식별자를 `Context`로 넘기지 못함 | 남음 | `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationPolicy.java:16`(`boolean isAuthenticated(Metadata)`) | W3 | `Optional<Principal> authenticate(Metadata)`로 바꾸고 인터셉터가 `Context.Key`에 담아 `Contexts.interceptCall` |
|
||||
| K-10b | Consider | gRPC 인증 정책 예외를 로그 없이 삼킴 | 남음 | `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationInterceptor.java:35-41`(`catch (RuntimeException ignored)`) | W2 | 예외 타입·메서드명만 WARN 로그(자격 증명 제외) 후 UNAUTHENTICATED |
|
||||
| K-11a | Consider | live STOMP inbound/outbound 채널 executor queue가 무제한(`Integer.MAX_VALUE`) | 남음 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/stomp/WebSocketConfig.java:66-69`(interceptor만 등록, `taskExecutor().queueCapacity` 없음), `configureClientOutboundChannel` 없음 | W1 | `registration.taskExecutor().corePoolSize/maxPoolSize/queueCapacity(n)`을 inbound·outbound 둘 다 설정(`WebSocketSettings`에서 값) |
|
||||
| K-10b | Consider | gRPC 인증 정책 예외를 로그 없이 삼킴 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcAuthenticationInterceptorTest.aThrowingPolicyIsLoggedWithItsTypeAndMethodButNotItsMessage` FAIL(출력 `""`)→PASS. 예외 타입·메서드만 WARN, 메시지(자격 증명 가능)는 남기지 않음 `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcAuthenticationInterceptor.java:44`. 커밋 `a498ad84` | - | 예외 타입·메서드명만 WARN 로그(자격 증명 제외) 후 UNAUTHENTICATED |
|
||||
| K-11a | Consider | live STOMP inbound/outbound 채널 executor queue가 무제한(`Integer.MAX_VALUE`) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `WebSocketAutoConfigurationTest.clientChannelExecutorsAreBoundedByTheConfiguredQueueCapacity` FAIL(`[(2147483647, false), (2147483647, false)]` ≠ `[(64, true), (64, true)]`)→PASS. inbound·outbound 둘 다 스레드 CPU×2 고정(core=max), 큐 `app.websocket.channel-queue-capacity`(기본 10000, `@Positive`) `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/stomp/WebSocketConfig.java:74,83`, `.../stomp/WebSocketSettings.java:32`. 새 env 키 `APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY`(`docs/registries/env-keys.yaml`, `src/.env.example`), `verifyEnvKeys` 통과. 커밋 `b39d3de0` | - | `registration.taskExecutor().corePoolSize/maxPoolSize/queueCapacity(n)`을 inbound·outbound 둘 다 설정(`WebSocketSettings`에서 값) |
|
||||
| K-11b | Consider | 동기 `@EventListener` 브로드캐스트가 구독자 수만큼 발행 스레드에서 fan-out | 남음 | `src/adapter/inbound/websocket/src/main/java/dev/caskeleton/adapter/inbound/websocket/stomp/LiveEventStompBroadcaster.java:57-87` | W3 | best-effort(R1) 문서 기준이면 브로커 채널에 executor를 두거나(`configureMessageBroker`의 `brokerChannel` taskExecutor) 리스너를 비동기로 |
|
||||
| K-12a | Nit | `moduleboundary/WebSocketStableModule` `HANDSHAKE` Javadoc 중복 | 해당 없음(코드 삭제) | 제거 표 「websocket main의 검증용 코드(`moduleboundary`, `evidence`, `release`)」 | - | - |
|
||||
| K-12b | Nit | websocket `CLAUDE.md`가 Boot 4.0.0 표기 | 완료 | `src/adapter/inbound/websocket/CLAUDE.md:8` "Spring Boot 4.0.8"(`208077fd`은 4.0.0). 커밋 `6d27356e` | - | - |
|
||||
@@ -476,61 +488,61 @@
|
||||
|---|---|---|---|---|---|---|
|
||||
| M-1 | Critical | outbox relay·DLQ·retry-topic이 이미 인코딩된 payload를 다시 인코딩해 전부 REJECTED (= Critical #7) | 완료 | `src/messaging/messaging-runtime-core/src/main/java/dev/caskeleton/messaging/runtime/DefaultMessagePublisher.java:307-311` (`EncodedMessage` payload는 codec을 거치지 않고 content type만 확인). 테스트 `DefaultMessagePublisherTest.aDeadLetterPublishedThroughThisPublisherReachesTheTransportWithTheOriginalBytes`, `OutboxRelayTest.aRowRelayedThroughTheRealPublisherIsMarkedPublished`·`aRowRelayedThroughTheRealPublisherReachesTheTransportWithItsStoredBytes`(실제 `DefaultMessagePublisher` 사용). 커밋 `6d27356e` | - | - |
|
||||
| M-2a | Critical | `KafkaSecurityConfigurer`를 producer에 적용하지 않아 TLS/SASL 설정이 있어도 PLAINTEXT·무인증으로 연결 (= Critical #8) | 완료 | `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:176,187-236` (security profile을 configurer로 병합, profile·CredentialProvider가 없으면 기동 실패). 테스트 `KafkaProducerSecurityTest.aTlsBrokerWithScramCredentialsConfiguresTheProducerForSaslSsl`·`aBrokerDeclaringTlsWithoutASecurityEntryFailsStartup`·`aSecurityEntryWithoutACredentialProviderFailsStartup`. 커밋 `6d27356e` | - | - |
|
||||
| M-2b | Critical | producer는 `spring.kafka.bootstrap-servers`만 읽고, 필수로 검증하는 `app.messaging.brokers.<b>.bootstrap-servers`는 쓰지 않음(주소를 두 곳에 적어야 함) | 남음 | `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:155-165` vs `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingConfigurationCompiler.java:97-99` | W2 | 결정(2026-09-25): capability 설정 prefix는 하나(AGENTS.md 기준 4) → producer가 `app.messaging.brokers.<b>.bootstrap-servers`를 읽고 `spring.kafka.bootstrap-servers` 의존 제거 |
|
||||
| M-2c | Critical | broker별 `access.publishable` ACL이 compile만 되고 publish 판정에는 쓰이지 않음 | 남음 | `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingConfigurationCompiler.java:235-238`에서 만든 정책을 아무도 안 씀. 판정은 `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingCoreAutoConfiguration.java:414-419` (`DeclaredDestinationAccess.of(destinations.all())`) | W1 | `messagingDestinationAccess` bean이 선언 destination 집합과 compile된 `BrokerSecurityProfile`의 `publishable`을 교집합으로 쓰게 바꾸고, 허용 목록 밖 publish가 REJECTED인 테스트 추가 |
|
||||
| M-2d | Critical | SASL JAAS username에 credential 참조 id가 들어감 | 남음 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaSecurityConfigurer.java:148-151`. 새 테스트가 결함을 고정함: `src/messaging/messaging-spring-boot-starter/src/test/java/dev/caskeleton/messaging/autoconfigure/KafkaProducerSecurityTest.java:84-94` (`username="kafka-producer"` = credential id) | W1 | `CredentialRuntime`(또는 provider 응답)에 username을 넣고 JAAS는 그 값을 쓰게 바꿈. 테스트 기대값도 provider가 준 username으로 교체 |
|
||||
| M-2e | Critical | truststore/keystore 설정 키가 없음. `MutualTls`는 `SSL` + `sasl.mechanism=NONE`만 넣고 keystore를 안 넣음 → 사설 CA·mTLS broker 연결 불가 | 남음 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaSecurityConfigurer.java:85-90,109`. `git grep -i "truststore\|keystore" -- 'src/messaging/*/src/main'` 0건 | W1 | `BrokerSecuritySettings`에 truststore/keystore(경로·유형·비밀번호 credential id) 추가 후 `ssl.truststore.*`/`ssl.keystore.*` 설정. 지원 전까지 `MutualTls`는 기동 거부 |
|
||||
| M-2f | Critical | credential rotation이 producer에 반영 안 됨(기동 때 JAAS 문자열 1회 생성) | 남음 | `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:234-235` (`Instant.now()`로 1회 configure), `:246-250` (generation 1 고정). `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaSecurityConfigurer.java:17-20` javadoc은 rotation이 된다고 적음 | W1 | rotation 시 producer를 새로 만들고 transport generation을 올리는 경로 추가. 당장 안 하면 javadoc을 정정하고 만료 임박 credential은 기동/주기 검사에서 경고 |
|
||||
| M-3 | Required | handler timeout 때 `cancel(true)`가 실행 중 handler를 멈추지 않는데 permit을 바로 반환 → 같은 offset 중복 처리 (H6 회귀) | 남음 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java:316-319` (`!cancel(true) && !isDone()` 분기 도달 불가). 테스트 `src/messaging/messaging-kafka/src/test/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrarTest.java:157,201`은 `isCancelled()`만 확인 | W2 | timeout이면 항상 `handler.whenComplete(...)`에서 permit·work count를 반환. 테스트는 "첫 handler가 끝나기 전 같은 offset 재dispatch 없음"을 단언 |
|
||||
| M-4a | Required | admission 거부(`MessageTooLarge`/`Backpressure`)가 `try` 밖에서 동기 예외로 던져짐 | 남음 | `src/messaging/messaging-runtime-core/src/main/java/dev/caskeleton/messaging/runtime/DefaultMessagePublisher.java:227` | W2 | `admission.admit`을 `try` 안으로 옮겨 크기 초과는 REJECTED(retryable=false), backpressure는 REJECTED(retryable=true)로 반환 |
|
||||
| M-4b | Required | relay에 row별 catch가 없고 CLAIM이 `attempts`를 올리지 않음 → poison row가 매 lease 재claim, 같은 batch 나머지도 lease 만료까지 묶임 | 남음 | `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/OutboxRelay.java:166-168,223-227` (`toEnvelope`·`publish` 예외가 `runOnce` 밖으로), `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/JdbcOutboxRepository.java:113-135` (attempts 미증가), `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/OutboxEnvelopeFactory.java:71` (예약 header row에서 throw) | W2 | `runOnce` 루프에 row별 try/catch → `markFailed(lease, code)`. 테스트: 예약 header row는 FAILED, 같은 batch 나머지 row는 PUBLISHED |
|
||||
| M-4c | Required | 실패한 relay pass를 로그 없이 삼키고 `failedPasses()`를 읽는 곳이 없음 | 남음 | `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/OutboxRelayWorker.java:184-189`, `:155` (main 호출 0) | W2 | catch에서 원인 포함 WARN 로그, `failedPasses`를 meter로 노출 |
|
||||
| M-5a | Required | publish가 deadline 적용 전 caller thread를 최대 약 65초 막음(InFlightLimiter 5초 + `max.block.ms` 기본 60초) | 남음 | `src/messaging/messaging-runtime-core/src/main/java/dev/caskeleton/messaging/runtime/DefaultMessagePublisher.java:227-233`, `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingCoreAutoConfiguration.java:436-437`, `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:162-177` (`MAX_BLOCK_MS` 없음) | W2 | `producerConfig`에 `max.block.ms`를 기본 publish timeout 이하로 설정, limiter 대기도 남은 budget 안으로 제한 |
|
||||
| M-5b | Required | reactive facade가 blocking publish를 subscriber thread에서 실행 | 남음 | `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/DefaultReactiveMessagePublisher.java:37` | W2 | `Mono.fromCompletionStage(...)` 뒤에 `.subscribeOn(Schedulers.boundedElastic())` |
|
||||
| M-6 | Required | outbox/inbox cleanup job이 제한 없는 단일 DELETE (MSG-006 §6 불완전) | 남음 | `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/OutboxCleanupJob.java:50`, `src/messaging/messaging-inbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/inbox/InboxCleanupJob.java:56` (1-인자 purge), `InboxCleanupJob.java:21` `DEFAULT_BATCH_SIZE` 미사용. bounded 버전 `JdbcOutboxRepository.java:485`, `JdbcInboxRepository.java:141`은 main 호출 0 | W2 | 두 job이 `(cutoff, batchSize)` 버전을 삭제 수 < batch가 될 때까지 반복 호출. port의 1-인자 메서드(`src/messaging/messaging-reliability-api/src/main/java/dev/caskeleton/messaging/reliability/OutboxRepository.java:103`, `InboxRepository.java:45`) 삭제 |
|
||||
| M-7 | Required | consumer poison message가 지연 없이 무한 재시도(partition 영구 정지) | 남음 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java:115` (기본 quarantine `unavailable()`), `:607-609` (`enqueueRequeue(Duration.ZERO)`), `src/messaging/messaging-runtime-core/src/main/java/dev/caskeleton/messaging/runtime/DefaultDeliveryProcessor.java:70-97` (시도 한도 없음) | W2 | requeue에 `BackoffCalculator` 지연, 시도 한도 초과 시 DLQ/park. production에서 quarantine이 `unavailable()`이면 기동 거부 |
|
||||
| M-2b | Critical | producer는 `spring.kafka.bootstrap-servers`만 읽고, 필수로 검증하는 `app.messaging.brokers.<b>.bootstrap-servers`는 쓰지 않음(주소를 두 곳에 적어야 함) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): NEW-4c와 같은 결함. 결정대로 `spring.kafka.bootstrap-servers` 의존 제거(NEW-4c의 "spring.kafka fallback + 불일치 시 실패" 추천은 이 결정으로 대체). `KafkaProducerConfigTest.theProducerConnectsToTheBrokerEntryAddressesNotToSpringKafka`·`aBrokerWithoutAnEntryFailsStartupNamingTheKey` FAIL(broker 항목이 있어도 spring.kafka가 없으면 기동 실패 / spring.kafka만으로 기동) → PASS. producer는 type=kafka인 `app.messaging.brokers.<name>` 항목 정확히 하나에서 만든다(`src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:150-205`). 모듈 기본값이 `APP_MESSAGING_KAFKA_BROKERS`를 `app.messaging.brokers.kafka.bootstrap-servers`로 연결(`src/adapter/outbound/messaging-kafka/src/main/resources/config/module-defaults/messaging.yml`), `KafkaCapabilityActivationTest` 2건 PASS. 함께 수정: `docs/registries/env-keys.yaml`(APP_MESSAGING_KAFKA_BROKERS 주석), `src/README.md`, `src/adapter/outbound/messaging-kafka/README.md`, compose 계약(`src/config/runtime/compose-profile-contracts.json`에서 `SPRING_KAFKA_BOOTSTRAP_SERVERS` 3곳 삭제, `scripts/verify-compose-profile-contracts.sh` 18 lane 일치), `docs/messaging/configuration-reference.md`. env 키 이름은 바뀌지 않음(`.env.example` 변경 없음) | - | 결정(2026-09-25): capability 설정 prefix는 하나(AGENTS.md 기준 4) → producer가 `app.messaging.brokers.<b>.bootstrap-servers`를 읽고 `spring.kafka.bootstrap-servers` 의존 제거 |
|
||||
| M-2c | Critical | broker별 `access.publishable` ACL이 compile만 되고 publish 판정에는 쓰이지 않음 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `BrokerAccessListTest.aDeclaredDestinationTheSecurityEntryDoesNotListIsRejectedAsForbidden` FAIL("Expecting Optional[PUBLISH_PREPARATION_FAILED] to contain PUBLISH_FORBIDDEN" — 목록 밖 destination이 접근 검사를 통과) → PASS. `messagingDestinationAccess`가 선언 destination 중 해당 broker security 항목의 `access.publishable`에 있는 것만 허용: `src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingCoreAutoConfiguration.java:422`. security 항목이 없는 broker는 기존대로 선언 destination 전부. 빈 목록이면 publish 불가(문서화: `docs/messaging/configuration-reference.md` 보안 절, `docs/messaging/security.md` ACL 절) | - | `messagingDestinationAccess` bean이 선언 destination 집합과 compile된 `BrokerSecurityProfile`의 `publishable`을 교집합으로 쓰게 바꾸고, 허용 목록 밖 publish가 REJECTED인 테스트 추가 |
|
||||
| M-2d | Critical | SASL JAAS username에 credential 참조 id가 들어감 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `KafkaProducerSecurityTest.theProducerAuthenticatesAsTheUsernameTheProviderReturnsNotAsTheCredentialId` FAIL(JAAS가 `username="kafka-producer"`=credential id, `password=` 고정, callback handler 없음) → PASS. `CredentialProvider.username(credentialId)` 추가(`src/messaging/messaging-security/src/main/java/dev/caskeleton/messaging/security/CredentialProvider.java:43`), `CredentialRuntime.username()`, SASL 사용자 이름이 없으면 기동 실패 `SASL_USERNAME_MISSING`(`KafkaSecurityConfigurerTest.aSaslCredentialWhoseProviderNamesNoUserIsRefused`). 실제 lane: `MessagingSecuredBrokerQualificationTest.aPublishIsConfirmedByAPrivateCaBrokerThatRequiresSaslAsTheProviderUser` PASS, 확인용으로 provider 사용자 이름을 틀리게 바꾸면 REJECTED(broker가 SASL을 실제로 검사함) | - | `CredentialRuntime`(또는 provider 응답)에 username을 넣고 JAAS는 그 값을 쓰게 바꿈. 테스트 기대값도 provider가 준 username으로 교체 |
|
||||
| M-2e | Critical | truststore/keystore 설정 키가 없음. `MutualTls`는 `SSL` + `sasl.mechanism=NONE`만 넣고 keystore를 안 넣음 → 사설 CA·mTLS broker 연결 불가 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): NEW-4b와 같은 결함, 한 번 수정. `KafkaProducerSecurityTest.aPrivateCaTrustStoreReachesTheProducer`·`mutualTlsPresentsTheProducerKeyStoreUnlockedByItsCredential`·`mutualTlsOnABrokerWithoutTlsFailsStartup` FAIL("trust-store.location binds nothing") → PASS, `mutualTlsWithoutAKeyStoreFailsStartupNamingTheKey` PASS, `KafkaSecurityConfigurerTest.aTrustStoreOnABrokerWithoutTlsIsRefused` PASS. 설정: `app.messaging.security.<b>.trust-store.{location,type,password-credential-id}`, `<role>.key-store.{location,type}`(`BrokerSecuritySettings.java`), 모델 `BrokerTrustStore`(신규), `BrokerCredentialProfile.MutualTls(credentialId, keyStoreLocation, keyStoreType)`(`BrokerCredentialProfile.java:58`), Kafka 설정 `ssl.truststore.*`/`ssl.keystore.*`(`KafkaSecurityConfigurer.java:102,129`). key-store 없는 MUTUAL_TLS·TLS 꺼진 MUTUAL_TLS·TLS 꺼진 trust-store는 기동 실패(평문 fallback 없음, `MessagingConfigurationCompiler.java:276`, `KafkaSecurityConfigurer.java:190`). 실제 lane: 테스트 시점에 keytool로 만든 사설 CA로 서명된 broker 두 개 — SASL_SSL, `ssl.client.auth=required` SSL — 로 publish CONFIRMED(`MessagingSecuredBrokerQualificationTest` 2건). trust-store 생략은 JVM 기본 trust store(공인 CA broker용, 문서화) | - | `BrokerSecuritySettings`에 truststore/keystore(경로·유형·비밀번호 credential id) 추가 후 `ssl.truststore.*`/`ssl.keystore.*` 설정. 지원 전까지 `MutualTls`는 기동 거부 |
|
||||
| M-2f | Critical | credential rotation이 producer에 반영 안 됨(기동 때 JAAS 문자열 1회 생성) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): NEW-4d와 같은 결함, NEW-4d 방향(`sasl.client.callback.handler.class`) 채택. `KafkaProducerSecurityTest.aRotatedPasswordReachesTheNextAuthenticationWithoutRebuildingTheProducer` FAIL(callback handler 없음, 비밀번호가 JAAS 문자열에 고정) → PASS. JAAS는 login module 이름만(`... required;`), `KafkaCredentialCallbackHandler`가 인증마다 `CredentialRuntimeRegistry`에서 사용자 이름·비밀번호를 읽음(`src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaCredentialCallbackHandler.java:62`, `KafkaSecurityConfigurer.java:156`). producer를 바꾸지 않으므로 transport generation 1 유지 — 주석 정정(`KafkaMessagingAutoConfiguration.java:277`), Javadoc 정정(`KafkaSecurityConfigurer.java:15-30`), `docs/messaging/security.md` Rotation 절. 한계(문서화): registry는 provider가 만료 시각을 줄 때만 다시 가져옴, key/trust store 비밀번호는 client 재생성(재기동) 필요 | - | rotation 시 producer를 새로 만들고 transport generation을 올리는 경로 추가. 당장 안 하면 javadoc을 정정하고 만료 임박 credential은 기동/주기 검사에서 경고 |
|
||||
| M-3 | Required | handler timeout 때 `cancel(true)`가 실행 중 handler를 멈추지 않는데 permit을 바로 반환 → 같은 offset 중복 처리 (H6 회귀) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `KafkaConsumerRegistrarTest.aTimedOutHandlerStillRunningIsNotDispatchedASecondTime` FAIL("Expected size: 1 but was: 2" — 첫 handler가 도는 중 같은 offset 재dispatch) → PASS, `aTimedOutHandlerIsRedeliveredOnceItFinishesWithoutSettling` PASS. timeout이면 `cancel` 없이 `handler.whenComplete`에서 requeue와 permit·work count 반환(`src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java:374-395`). 방향보다 한 단계 더: requeue도 완료 시점으로 미룸(maxInFlight>1에서도 같은 offset 동시 실행 없음). 결함을 고정하던 기존 테스트 `handlerTimeoutCancelsTheOutstandingHandlerBeforeThePartitionPermitIsReleased`(cancel 여부 단언) 삭제 | - | timeout이면 항상 `handler.whenComplete(...)`에서 permit·work count를 반환. 테스트는 "첫 handler가 끝나기 전 같은 offset 재dispatch 없음"을 단언 |
|
||||
| M-4a | Required | admission 거부(`MessageTooLarge`/`Backpressure`)가 `try` 밖에서 동기 예외로 던져짐 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `DefaultMessagePublisherTest.anOversizedPayloadIsRejectedAsNotRetryableInsteadOfThrown` FAIL(`MessageTooLargeException` 동기 throw) → PASS, `aSaturatedPermitPoolRejectsAsRetryableWithinTheCallersDeadline` FAIL(5초 안에 끝나지 않음) → PASS. admission을 try 안으로, 크기 초과 REJECTED retryable=false, backpressure REJECTED retryable=true(`src/messaging/messaging-runtime-core/src/main/java/dev/caskeleton/messaging/runtime/DefaultMessagePublisher.java:226-236,333`) | - | `admission.admit`을 `try` 안으로 옮겨 크기 초과는 REJECTED(retryable=false), backpressure는 REJECTED(retryable=true)로 반환 |
|
||||
| M-4b | Required | relay에 row별 catch가 없고 CLAIM이 `attempts`를 올리지 않음 → poison row가 매 lease 재claim, 같은 batch 나머지도 lease 만료까지 묶임 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `OutboxRelayTest.aRowThatCannotBecomeAnEnvelopeFailsWhileTheRestOfItsBatchPublishes` FAIL(예약 header row의 예외가 `runOnce` 밖으로) → PASS(`[FAILED, PUBLISHED]`), `aPublisherThatThrowsLeavesTheRowAmbiguousRatherThanStrandingTheBatch` FAIL → PASS. envelope 변환 실패는 `markFailed`, publisher 예외는 결과 불명이라 AMBIGUOUS(같은 id로 재시도, attempt 예산 적용)(`src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/OutboxRelay.java:176-190,254`). CLAIM 시 attempts 증가는 하지 않음: row 단위 처리로 poison row 무한 재claim이 사라짐. relay 프로세스가 row 처리 중 죽는 경우는 lease 만료 재claim으로 남음 | - | `runOnce` 루프에 row별 try/catch → `markFailed(lease, code)`. 테스트: 예약 header row는 FAILED, 같은 batch 나머지 row는 PUBLISHED |
|
||||
| M-4c | Required | 실패한 relay pass를 로그 없이 삼키고 `failedPasses()`를 읽는 곳이 없음 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `MessagingOutboxRelayLifecycleTest.aRelayPassThatFailsIsCountedOnTheMeterRegistry` FAIL(`MeterNotFoundException 'messaging.outbox.relay.failed.passes'`) → PASS. `FunctionCounter messaging.outbox.relay.failed.passes`(`src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/MessagingReliabilityAutoConfiguration.java:124`), 원인 포함 WARNING 로그(`System.Logger`, `OutboxRelayWorker.java:193`). 로그 자체는 자동 테스트 없음. `OutboxRelayWorkerTest.aFailedPassDoesNotEndTheLoop`는 pass 실패를 DB 장애(repository 예외)로 재현하도록 변경(publisher 예외는 이제 row에서 처리됨) | - | catch에서 원인 포함 WARN 로그, `failedPasses`를 meter로 노출 |
|
||||
| M-5a | Required | publish가 deadline 적용 전 caller thread를 최대 약 65초 막음(InFlightLimiter 5초 + `max.block.ms` 기본 60초) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `KafkaProducerConfigTest.theProducerStopsWaitingForMetadataWithinTheDefaultPublishDeadline` FAIL → PASS(`max.block.ms` = `PublishOptions.defaults().timeout()` 5s, `KafkaMessagingAutoConfiguration.java:186`), permit 대기를 남은 budget으로 제한(`InFlightLimiter.java:63`, `MessagingAdmissionController.java:91`, `DefaultMessagePublisher.java:232`), 테스트 `DefaultMessagePublisherTest.aSaturatedPermitPoolRejectsAsRetryableWithinTheCallersDeadline` | - | `producerConfig`에 `max.block.ms`를 기본 publish timeout 이하로 설정, limiter 대기도 남은 budget 안으로 제한 |
|
||||
| M-5b | Required | reactive facade가 blocking publish를 subscriber thread에서 실행 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `ReactiveFacadeTest.theBlockingPublishRunsOffTheSubscribingThread` FAIL("Expected not same: Thread[#1,Test worker]") → PASS. `.subscribeOn(Schedulers.boundedElastic())`(`src/messaging/messaging-spring-boot-starter/src/main/java/dev/caskeleton/messaging/autoconfigure/DefaultReactiveMessagePublisher.java:41`) | - | `Mono.fromCompletionStage(...)` 뒤에 `.subscribeOn(Schedulers.boundedElastic())` |
|
||||
| M-6 | Required | outbox/inbox cleanup job이 제한 없는 단일 DELETE (MSG-006 §6 불완전) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `OutboxOperationsTest`·`InboxOperationsTest.cleanupAsksForBoundedBatchesAndStopsAtTheFirstShortOne` FAIL("Expecting [] to contain exactly [1000, ...]") → PASS. 두 job이 `(cutoff, 1000)`을 짧은 batch가 나올 때까지 반복(`OutboxCleanupJob.java:53`, `InboxCleanupJob.java:56`), port의 1-인자 purge와 JDBC 구현 삭제(`OutboxRepository`, `InboxRepository`, `JdbcOutboxRepository`, `JdbcInboxRepository`). PG lane `OutboxPostgresIT.retentionRemovesOnlyPublishedRows`·`InboxPostgresIT.retentionRemovesOldRows` bounded 호출로 PASS | - | 두 job이 `(cutoff, batchSize)` 버전을 삭제 수 < batch가 될 때까지 반복 호출. port의 1-인자 메서드(`src/messaging/messaging-reliability-api/src/main/java/dev/caskeleton/messaging/reliability/OutboxRepository.java:103`, `InboxRepository.java:45`) 삭제 |
|
||||
| M-7 | Required | consumer poison message가 지연 없이 무한 재시도(partition 영구 정지) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `KafkaConsumerRegistrarTest.aFailedHandlerWaitsOutItsBackoffBeforeThePartitionIsReadAgain` FAIL(즉시 resume) → PASS, `aHandlerThatSpendsItsAttemptBudgetIsQuarantinedAndCommittedPast` FAIL("Expecting Optional to contain 11L but was empty") → PASS, `aProductionDestinationWithoutAQuarantineIsRefused` FAIL(거부 없음) → PASS. offset별 실패 횟수, `BackoffCalculator` 지연(최소 1초), `retry.maxAttempts` 도달 시 quarantine 후 commit, quarantine 없으면 backoff로 계속 재시도, production destination에 quarantine이 없으면 생성자에서 `KAFKA_QUARANTINE_REQUIRED`(`KafkaConsumerRegistrar.java:185,695`), `KafkaQuarantinePublisher.unavailable()`을 단일 인스턴스로. 재시도 시각은 주입 가능한 `InstantSource`. 참고: consumer는 아직 starter가 조립하지 않음(결정 10, Wave 3) | - | requeue에 `BackoffCalculator` 지연, 시도 한도 초과 시 DLQ/park. production에서 quarantine이 `unavailable()`이면 기동 거부 |
|
||||
| M-8a | Consider | 옛 prefix `backend.messaging` 테스트 fixture yml 2개가 남아 있음(어떤 테스트도 로드 안 함) | 남음 | `src/messaging/messaging-spring-boot-starter/src/test/resources/application-valid.yml:2-3`, `src/messaging/messaging-spring-boot-starter/src/test/resources/application-invalid-ordering.yml:7-8`. `git grep "application-valid\|invalid-ordering" -- src/messaging` 0건 | W5 | 두 파일 삭제 |
|
||||
| M-8b | Consider | kafka-share·stream-bridge 오류 메시지가 거부되는 옛 prefix를 안내, `app.messaging.experimental.*`는 바인딩만 | 해당 없음(코드 삭제) | 「제거된 코드」 표의 `messaging-kafka-share-experimental` leaf, `messaging-spring-cloud-stream-bridge` leaf, `MessagingSettings.Experimental`·`Bridge` 행 | - | - |
|
||||
| M-9 | Consider | 구현·사용처 없는 messaging API 타입 7개 (known-open L7/L8) | 남음 | `src/messaging/messaging-core-api/src/main/java/dev/caskeleton/messaging/api/delivery/BatchMessageHandler.java`, `.../api/destination/CapabilityRegistry.java`, `.../api/publish/DelayedMessagePublisher.java`, `.../api/settlement/ManualMessageHandler.java`, `.../api/delivery/PauseResumeController.java`, `.../api/delivery/ProcessingGuarantee.java`, `src/messaging/messaging-transport-spi/src/main/java/dev/caskeleton/messaging/transport/MessagingLifecycle.java` (main 참조 0, `git grep`로 확인) | W3 | 7개 파일 삭제 |
|
||||
| M-10 | Consider | Rabbit publish sequence 예약이 원자적이지 않음 | 해당 없음(코드 삭제) | 「제거된 코드」 표의 `messaging-rabbit` leaf 행 | - | - |
|
||||
| M-11 | Consider | outbox CLAIM이 `ordering_key`를 무시해 같은 key의 뒤 row가 먼저 나갈 수 있음 | 남음 | `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/JdbcOutboxRepository.java:113-128` (`ORDER BY created_at` + `SKIP LOCKED`) | W2 | ordered destination을 outbox로 내보내는 조합을 기동 때 거부(최소 수정). 순서 보장이 필요하면 같은 key의 더 오래된 미완료 row가 있을 때 claim에서 제외 |
|
||||
| M-11 | Consider | outbox CLAIM이 `ordering_key`를 무시해 같은 key의 뒤 row가 먼저 나갈 수 있음 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): `OutboxPostgresIT.aNewerRowWaitsWhileAnOlderRowWithTheSameOrderingKeyIsUnfinished`(실제 PostgreSQL) — 새 조건을 끈 SQL로 FAIL(같은 key의 뒤 row까지 3건 claim) → PASS. 최소 수정(기동 거부) 대신 claim 제외를 택함: relay는 기동 때 어떤 destination이 outbox로 나가는지 알 수 없다. CLAIM에 "같은 destination·ordering_key의 더 오래된 PENDING/AMBIGUOUS/IN_FLIGHT row가 없을 것" 조건과 `(created_at, message_id)` 순서(`src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/JdbcOutboxRepository.java:113-140`), 새 migration `V1005__messaging_outbox_ordering_key_index.sql`(messaging 예약 대역, `md5(ordering_key)` partial index). `twoRelaysClaimingConcurrently...` fixture는 서로 다른 key로 변경. `leaseBatch`(main 호출자 없음)에는 적용 안 함 | - | ordered destination을 outbox로 내보내는 조합을 기동 때 거부(최소 수정). 순서 보장이 필요하면 같은 key의 더 오래된 미완료 row가 있을 때 claim에서 제외 |
|
||||
| N-1 | Critical | FAILED_TERMINAL 뒤 재시도가 claim 없이 PROCEED (= Critical #15) | 완료 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/idempotency/GrpcIdempotencyInterceptor.java:109-117` (`reclaimFailed` 성공 시에만 PROCEED), `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/ledger/GrpcOperationLedger.java:53`, `src/grpc/grpc-operation-ledger-jpa/src/main/java/dev/caskeleton/grpc/ledger/JpaGrpcOperationLedger.java:92-96`. 공통 계약 `src/grpc/grpc-core-api/src/testFixtures/java/dev/caskeleton/grpc/api/ledger/GrpcOperationLedgerContract.java` (`aFailedClaimIsReclaimedByARetryOfTheSameRequest`, `aFailedClaimCannotBeCommittedWithoutBeingReclaimed`)을 fake(`InMemoryOperationLedgerContractTest`)와 JPA(`JpaGrpcOperationLedgerContractIT`)가 상속. 커밋 `6d27356e` | - | - |
|
||||
| N-2 | Required | `GrpcDeadlineBudget`이 생성 시점 Duration만 들고 있어 시간이 지나도 만료되지 않음 | 남음 | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/deadline/GrpcDeadlineBudget.java:13,82-83` | W2 | 절대 시각(`long deadlineNanos` + 주입 `LongSupplier`)을 저장하고 `remaining(now)`/`expired(now)`로 변경, 시간 경과 테스트 추가 |
|
||||
| N-3 | Required | starter `environment` 기본값 LOCAL → 설정 누락 시 TLS·reflection 검사 전부 꺼짐 | 남음 | `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformProperties.java:26`, `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java:87` | W1 | 기본값 제거, `enabled=true`인데 environment가 없으면 startup violation. 누락 케이스 테스트 추가 |
|
||||
| N-4 | Required | resolver service config의 retry/hedging을 검증하지 않고, 정상 `retryThrottling.maxTokens`는 `token` 부분일치로 거부 | 남음 | `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/discovery/GrpcResolverSafetyPolicy.java:56-65,86-91` | W1 | JSON 파싱 + top-level 키 allowlist, `retryPolicy`/`hedgingPolicy`는 `GrpcMethodPolicyCatalog`로 검증하거나 거부, credential 정규식 삭제 |
|
||||
| N-5a | Required | `GrpcAdmissionController.tryAdmit` check-then-act → 동시 호출 수만큼 bound 초과 | 남음 | `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/server/GrpcAdmissionController.java:52-55` | W2 | `synchronized` 또는 `updateAndGet` CAS로 확인과 증가를 하나로, 동시성 테스트 추가 |
|
||||
| N-5b | Required | `GrpcCredentialRotationManager` get/set 경합 → `completeDrain`이 새 generation을 되돌리거나 역방향 rotation 통과 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:89-103,119-120` | W2 | `state.updateAndGet`/`compareAndSet` 루프로 교체, 동시 rotate·completeDrain 테스트 |
|
||||
| N-5c | Required | `GrpcChannelRuntimeRegistry.rotate` get/set 경합으로 replacement가 drain 목록에서 빠져 누수, synchronizedList를 락 없이 순회 | 남음 | `src/grpc/grpc-client/src/main/java/dev/caskeleton/grpc/client/GrpcChannelRuntimeRegistry.java:91-107,127-129` | W2 | `holder.compareAndSet` 또는 profile 단위 `synchronized`, `retireQuiescent`·`draining`은 리스트 락 안에서 순회 |
|
||||
| N-5d | Required | `GrpcServiceHealthRegistry`에서 `draining` 확인과 `put(SERVING)` 사이에 drain 시작 → drain 후 SERVING 복귀 | 남음 | `src/grpc/grpc-admin/src/main/java/dev/caskeleton/grpc/admin/GrpcServiceHealthRegistry.java:50-53` vs `:85` | W2 | `markServing`/`markNotServing`/`beginDraining`을 같은 락으로 묶기 |
|
||||
| N-5e | Required | `GrpcStreamAdmission`이 global bound 검사 전에 `computeIfAbsent` → 포화 시 거부된 caller마다 count 0 엔트리 영구 잔류 (M1(b) 미완) | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamAdmission.java:43-47` | W2 | global 검사를 `computeIfAbsent` 앞으로 옮김 |
|
||||
| N-6a | Required | `GrpcSerializedStreamWriter`의 `LongSupplier` sizer가 실제 payload 크기를 모름 (H3 잔여) | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcSerializedStreamWriter.java:30,48` | W2 | `ToLongFunction<? super T>`로 바꿔 메시지마다 크기 계산 |
|
||||
| N-6b | Required | writer가 `PAUSE`를 `ACCEPTED`로 반환해 백프레셔 신호 소실 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcSerializedStreamWriter.java:100-102` | W2 | `ACCEPTED_PAUSE` 결과를 추가해 PAUSE를 호출자에게 전달 |
|
||||
| N-6c | Required | `flush()`가 `isReady`와 무관하게 큐 전체 전송 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcSerializedStreamWriter.java:126-138` | W2 | `flush(BooleanSupplier ready)`로 바꿔 ready가 false면 중단 |
|
||||
| N-7 | Consider | `GrpcContextBinder.wrap`이 io.grpc `Context`(취소·deadline)를 스레드 경계에서 버림 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/context/GrpcContextBinder.java:86-98` (SNAPSHOT 값만 캡처) | W2 | `Context.current()`를 캡처해 `captured.wrap(...)` 안에서 `runWith` 실행 |
|
||||
| N-8a | Consider | envoy 참조 설정의 `DownstreamTlsContext`에 인증서가 없음 | 남음 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:50-53` | W2 | 인증서 경로 placeholder를 넣고 `envoy --mode validate` 통과 확인 |
|
||||
| N-8b | Consider | CORS header 목록이 실제 gRPC trailer와 다름(`expose_headers`에 `error-code,error-category`, 실제는 `error-reason`·`error-execution-id`·`completion-outcome`, `grpc-status-details-bin` 없음. `allow_headers`에 `x-user-agent`·`grpc-timeout` 없음) | 남음 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:37-38` vs `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/error/GrpcErrorMapper.java:31-39` | W2 | header 목록을 정정하고 `GrpcErrorMapper` 상수와 envoy.yaml을 대조하는 테스트 추가 |
|
||||
| N-8c | Consider | route `timeout: 30s`가 server stream을 30초에 끊음 | 남음 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:32` | W2 | stream route는 `timeout: 0s` + `grpc_timeout_header_max: 0s` |
|
||||
| N-2 | Required | `GrpcDeadlineBudget`이 생성 시점 Duration만 들고 있어 시간이 지나도 만료되지 않음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcDeadlineBudgetTest.aBudgetRunsOutAsTimePassesAfterItWasCreated` FAIL(`Expecting value to be true but was false`, sleep 판)→PASS(주입 시계 판), `aDownstreamDerivedLaterGetsOnlyWhatIsLeftThen` 추가. 단조 시계의 절대 deadline + 주입 `LongSupplier` `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/deadline/GrpcDeadlineBudget.java:44,93`. 방향과 다른 점: `remaining(now)` 대신 시계를 주입해 호출부 시그니처를 유지. budget이 살아 있게 되면서 두 번 읽기 경합이 생기는 곳을 한 번 읽기로 고침 `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/resilience/GrpcRetryCoordinator.java:82`, `.../GrpcWaitForReadyValidator.java:39`. 커밋 `a498ad84` | - | 절대 시각(`long deadlineNanos` + 주입 `LongSupplier`)을 저장하고 `remaining(now)`/`expired(now)`로 변경, 시간 경과 테스트 추가 |
|
||||
| N-3 | Required | starter `environment` 기본값 LOCAL → 설정 누락 시 TLS·reflection 검사 전부 꺼짐 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcPlatformAutoConfigurationContextTest.enabledPlatformWithoutAnEnvironmentRefusesToStartInsteadOfAssumingLocal` FAIL(`Expecting actual not to be null` — LOCAL 가정으로 기동 성공)→PASS. 기본값 제거 `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformProperties.java:30`, 미설정 violation `.../GrpcPlatformStartupValidator.java:80`. 검증 전 생성되는 reflection 정책 bean은 environment가 없으면 PROD 바닥(비활성)으로 만든다 `.../GrpcPlatformAutoConfiguration.java`(reflection bean). 커밋 `b39d3de0` | - | 기본값 제거, `enabled=true`인데 environment가 없으면 startup violation. 누락 케이스 테스트 추가 |
|
||||
| N-4 | Required | resolver service config의 retry/hedging을 검증하지 않고, 정상 `retryThrottling.maxTokens`는 `token` 부분일치로 거부 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcResolverSafetyPolicyTest.aServiceConfigWithRetryThrottlingIsAccepted` FAIL(`credential-shaped field` 위반)→PASS, `aServiceConfigThatTurnsOnRetriesIsRefused` FAIL(`Expected size: 1 but was: 0`)→PASS. 수정 방향과 다른 점: 이 leaf 클래스패스에 JSON 파서가 없고 새로 들이지 않기로 한 leaf라서, service config를 gRPC가 쓰는 파싱된 `Map<String, ?>`로 받게 바꿨다(`NameResolver.Helper.parseServiceConfig`와 같은 형태) `src/grpc-advanced/grpc-advanced-resilience/src/main/java/dev/caskeleton/grpc/advanced/discovery/GrpcResolverUpdate.java:17`. top-level 필드 allowlist `.../GrpcResolverSafetyPolicy.java:25,68`, `methodConfig`의 `retryPolicy`·`hedgingPolicy`는 거부(resolver는 catalog를 모르므로 검증 대신 거부) `:89`, `token` 부분일치 정규식 삭제. 커밋 `b39d3de0` | - | JSON 파싱 + top-level 키 allowlist, `retryPolicy`/`hedgingPolicy`는 `GrpcMethodPolicyCatalog`로 검증하거나 거부, credential 정규식 삭제 |
|
||||
| N-5a | Required | `GrpcAdmissionController.tryAdmit` check-then-act → 동시 호출 수만큼 bound 초과 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcAdmissionControllerTest.racingCallersNeverGetPastTheConcurrencyAndQueueBounds` FAIL(`expected: 2 but was: 4`)→PASS. 두 카운터를 한 락으로(`tryAdmit`·`promoteFromQueue`·`release` 모두 check-then-act였음) `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/server/GrpcAdmissionController.java:52`. 커밋 `a498ad84` | - | `synchronized` 또는 `updateAndGet` CAS로 확인과 증가를 하나로, 동시성 테스트 추가 |
|
||||
| N-5b | Required | `GrpcCredentialRotationManager` get/set 경합 → `completeDrain`이 새 generation을 되돌리거나 역방향 rotation 통과 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcCredentialRotationManagerTest.racingRotationsNeverLeaveAnOlderGenerationCurrent` FAIL(`expected: 4L but was: 3L`)→PASS, `aDrainCompletedDuringARotationNeverRevertsTheNewGeneration` FAIL(`expected: 3L but was: 2L`)→PASS. CAS 루프 `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:108`, `completeDrain`은 `updateAndGet` `:126`. 커밋 `a498ad84` | - | `state.updateAndGet`/`compareAndSet` 루프로 교체, 동시 rotate·completeDrain 테스트 |
|
||||
| N-5c | Required | `GrpcChannelRuntimeRegistry.rotate` get/set 경합으로 replacement가 drain 목록에서 빠져 누수, synchronizedList를 락 없이 순회 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcChannelRuntimeRegistryTest.racingRotationsDrainEveryReplacedRuntimeAndKeepTheNewestCurrent` FAIL(`"2 draining [1, 1]"`, `"3 draining [1, 1]"` 발생)→PASS. install/rotate/draining/retireQuiescent를 registry 락 하나로, drain 목록은 락 안의 `HashMap`/`ArrayList` `src/grpc/grpc-client/src/main/java/dev/caskeleton/grpc/client/GrpcChannelRuntimeRegistry.java:86`. 커밋 `a498ad84` | - | `holder.compareAndSet` 또는 profile 단위 `synchronized`, `retireQuiescent`·`draining`은 리스트 락 안에서 순회 |
|
||||
| N-5d | Required | `GrpcServiceHealthRegistry`에서 `draining` 확인과 `put(SERVING)` 사이에 drain 시작 → drain 후 SERVING 복귀 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcServiceHealthRegistryTest.aServiceMarkedServingWhileDrainBeginsNeverReturnsTheInstanceToServing` FAIL(`[DRAINING/DRAINING, DRAINING/UNKNOWN, SERVING/SERVING]`)→PASS. 쓰기 메서드 전부 같은 락 `src/grpc/grpc-admin/src/main/java/dev/caskeleton/grpc/admin/GrpcServiceHealthRegistry.java:50,86`. 커밋 `a498ad84` | - | `markServing`/`markNotServing`/`beginDraining`을 같은 락으로 묶기 |
|
||||
| N-5e | Required | `GrpcStreamAdmission`이 global bound 검사 전에 `computeIfAbsent` → 포화 시 거부된 caller마다 count 0 엔트리 영구 잔류 (M1(b) 미완) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcStreamAdmissionConcurrencyTest.aCallerRefusedByTheGlobalBoundLeavesNoTrackedEntry` FAIL(`expected: 1 but was: 2`)→PASS. global 검사를 `computeIfAbsent` 앞으로 `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamAdmission.java:42`. 커밋 `a498ad84` | - | global 검사를 `computeIfAbsent` 앞으로 옮김 |
|
||||
| N-6a | Required | `GrpcSerializedStreamWriter`의 `LongSupplier` sizer가 실제 payload 크기를 모름 (H3 잔여) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcSerializedStreamWriterTest.theByteBoundCountsEachPayloadsOwnSize` RED(테스트 컴파일 실패 — `LongSupplier`는 payload를 받지 못함)→PASS. `ToLongFunction<? super T>` `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcSerializedStreamWriter.java:74`. 커밋 `a498ad84` | - | `ToLongFunction<? super T>`로 바꿔 메시지마다 크기 계산 |
|
||||
| N-6b | Required | writer가 `PAUSE`를 `ACCEPTED`로 반환해 백프레셔 신호 소실 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcSerializedStreamWriterTest.aWriteWhileTheTransportIsNotReadyTellsTheProducerToPause` RED(컴파일 실패 — 결과 값 없음)→PASS. `GrpcStreamWriteResult.ACCEPTED_PAUSE`(queued=true) `.../GrpcSerializedStreamWriter.java:103`. 커밋 `a498ad84` | - | `ACCEPTED_PAUSE` 결과를 추가해 PAUSE를 호출자에게 전달 |
|
||||
| N-6c | Required | `flush()`가 `isReady`와 무관하게 큐 전체 전송 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcSerializedStreamWriterTest.flushStopsWhenTheTransportStopsBeingReady` RED(컴파일 실패 — readiness 인자 없음)→PASS. `flush(BooleanSupplier)`가 메시지마다 ready 확인, 남은 바이트 정확히 차감 `.../GrpcSerializedStreamWriter.java:133`. 커밋 `a498ad84` | - | `flush(BooleanSupplier ready)`로 바꿔 ready가 false면 중단 |
|
||||
| N-7 | Consider | `GrpcContextBinder.wrap`이 io.grpc `Context`(취소·deadline)를 스레드 경계에서 버림 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcContextBinderTest.wrappedWorkSeesTheSubmittingCallsCancellationOnAnotherThread` FAIL(`Expecting AtomicBoolean(false) to have value: true`)→PASS. `Context.current()` 전체를 캡처해 `captured.wrap(work)` `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/context/GrpcContextBinder.java:97`. 커밋 `a498ad84` | - | `Context.current()`를 캡처해 `captured.wrap(...)` 안에서 `runWith` 실행 |
|
||||
| N-8a | Consider | envoy 참조 설정의 `DownstreamTlsContext`에 인증서가 없음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 실제 Envoy v1.31 `--mode validate`: 수정 전 `No TLS certificates found for server context`, 수정 후 `configuration ... OK`(임시 자체서명 인증서를 placeholder 경로에 마운트). `GrpcWebCompatibilityTest.theReferenceProxyTerminatesTlsWithACertificate` FAIL→PASS. `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:62`. 커밋 `a498ad84` | - | 인증서 경로 placeholder를 넣고 `envoy --mode validate` 통과 확인 |
|
||||
| N-8b | Consider | CORS header 목록이 실제 gRPC trailer와 다름(`expose_headers`에 `error-code,error-category`, 실제는 `error-reason`·`error-execution-id`·`completion-outcome`, `grpc-status-details-bin` 없음. `allow_headers`에 `x-user-agent`·`grpc-timeout` 없음) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcWebCompatibilityTest.theReferenceProxyExposesEveryTrailerThePlatformSends`(`GrpcErrorMapper`·`GrpcValidationInterceptor` 상수와 대조) FAIL(`error-code,error-category`만 있음)→PASS, `theReferenceProxyLetsTheBrowserSendItsDeadlineAndClientHeaders` FAIL→PASS. `envoy.yaml:41,43` | - | header 목록을 정정하고 `GrpcErrorMapper` 상수와 envoy.yaml을 대조하는 테스트 추가 |
|
||||
| N-8c | Consider | route `timeout: 30s`가 server stream을 30초에 끊음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcWebCompatibilityTest.theReferenceRouteLeavesStreamLengthToTheCallersDeadline` FAIL→PASS. route `timeout: 0s` + `max_stream_duration.grpc_timeout_header_max: 0s` `envoy.yaml:34,36`(Envoy validate 통과) | - | stream route는 `timeout: 0s` + `grpc_timeout_header_max: 0s` |
|
||||
| N-8d | Consider | 참조 설정이 main resources라 jar에 포함, 테스트는 부분 문자열만 확인 | 남음 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml` | W3 | test resources 또는 docs로 이동 |
|
||||
| N-9a | Consider | starter의 `grpc-proto-contract`·`grpc-codegen` 의존이 main에서 안 쓰임 | 남음 | `src/grpc/grpc-spring-boot-starter/build.gradle:21-22` (starter main의 `grpc.contract`·`grpc.codegen` import 0) | W3 | 두 줄과 registry edge 삭제 |
|
||||
| N-9b | Consider | `requireValid(..., Set.of())`로 advanced 격리 검사가 항상 통과 | 남음 | `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformAutoConfiguration.java:129-133`, `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java:58,175` | W3 | 파라미터와 `validateAdvancedIsolation` 삭제(격리는 Gradle 방향 게이트가 담당) |
|
||||
| N-9c | Consider | 문서가 `GrpcStableBuildInvariant`가 runtime에 강제한다고 적지만 호출하는 `requireStableStarterIsClean`의 main 호출자 0 | 남음 | `src/grpc/CLAUDE.md:70`, `src/grpc-advanced/CLAUDE.md:19`, `src/grpc-advanced/grpc-advanced-bootstrap/src/main/java/dev/caskeleton/grpc/advanced/bootstrap/GrpcAdvancedModuleGuard.java:75` (테스트에서만 호출) | W5 | 두 CLAUDE.md에서 "runtime에 강제" 문구 삭제(또는 guard와 함께 삭제) |
|
||||
| N-9b | Consider | `requireValid(..., Set.of())`로 advanced 격리 검사가 항상 통과 | 해당 없음(코드 삭제) | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): P5 목록 밖이지만 D 삭제로 함께 닫힘: `validateAdvancedIsolation`과 `stableModuleDependencies` 파라미터 삭제(`GrpcStableBuildInvariant` 삭제에 따른 것). 커밋 `9b296c7c` | - | 파라미터와 `validateAdvancedIsolation` 삭제(격리는 Gradle 방향 게이트가 담당) |
|
||||
| N-9c | Consider | 문서가 `GrpcStableBuildInvariant`가 runtime에 강제한다고 적지만 호출하는 `requireStableStarterIsClean`의 main 호출자 0 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): P5 목록 밖이지만 D에서 함께 닫힘: runtime 강제를 적던 문장을 build-time만으로 정정 `src/grpc/CLAUDE.md`(Stable 범위 절), `src/grpc-advanced/CLAUDE.md:18-19`. 커밋 `9b296c7c` | - | 두 CLAUDE.md에서 "runtime에 강제" 문구 삭제(또는 guard와 함께 삭제) |
|
||||
| N-10a | Consider | 같은 한계값(1 MiB/8192)이 여러 곳에 따로 정의되고 정합 검사 없음(server profile bean의 리터럴 복사 포함) | 남음 | `src/grpc/grpc-server/src/main/java/dev/caskeleton/grpc/server/GrpcServerProfile.java:70-71`, `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformAutoConfiguration.java:59-60`, `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/policy/GrpcMessageSizeProfile.java:43`, `src/grpc/grpc-client/src/main/java/dev/caskeleton/grpc/client/GrpcNamedChannelProfile.java:80-81,95-96`, `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/context/GrpcMetadataBudget.java:33` | W3 | 상수를 `GrpcTransportLimits` 한 곳으로, starter bean은 `GrpcServerProfile` 팩토리 재사용, validator에 "method profile ≤ server profile" |
|
||||
| N-10b | Consider | `GrpcStreamProfile`은 테스트에서만 쓰이고 `GrpcFlowControlPolicy`의 256/8MiB를 복제 | 남음 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcStreamProfile.java:40,45` (참조는 `GrpcStreamEnvelopeTest`뿐), `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/streaming/GrpcFlowControlPolicy.java:43` | W3 | `GrpcStreamProfile`과 그 테스트 참조 삭제 |
|
||||
| N-11a | Consider | ledger claim에서 insert 0행 + 조회 실패를 소유 획득으로 처리 | 남음 | `src/grpc/grpc-operation-ledger-jpa/src/main/java/dev/caskeleton/grpc/ledger/JpaGrpcOperationLedger.java:46-53` (`findById` 빈 결과 → `Optional.empty()` = 소유) | W2 | 0행인데 조회도 비면 `IllegalStateException` |
|
||||
| N-11b | Consider | `callerFingerprint` 길이 제한이 없어 storageKey가 `VARCHAR(512)`를 넘을 수 있음 | 남음 | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/ledger/GrpcOperationIdentity.java:21,36-37`, `src/grpc/grpc-operation-ledger-jpa/src/main/resources/db/migration/grpc/V001__create_grpc_operation_ledger.sql:12` | W2 | fingerprint ≤256자 검증 또는 storage key를 해시로 고정 길이화 |
|
||||
| N-11a | Consider | ledger claim에서 insert 0행 + 조회 실패를 소유 획득으로 처리 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcOperationLedgerRepositoryTest.aConflictWhoseRowVanishedBeforeTheReadIsNotTakenAsOwnership` FAIL(`Expecting actual not to be null`)→PASS. 0행 + 조회 실패면 `IllegalStateException` `src/grpc/grpc-operation-ledger-jpa/src/main/java/dev/caskeleton/grpc/ledger/JpaGrpcOperationLedger.java:58`. PG lane(`integrationCheck`) 18건 통과. 커밋 `a498ad84` | - | 0행인데 조회도 비면 `IllegalStateException` |
|
||||
| N-11b | Consider | `callerFingerprint` 길이 제한이 없어 storageKey가 `VARCHAR(512)`를 넘을 수 있음 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 리뷰의 "`sha256:` 형식 검증 안 거침"은 틀림(`GrpcOperationIdentity.java:29`가 검사) — 길이만 고침. `GrpcOperationIdentityTest.aCallerFingerprintWiderThanItsLedgerColumnIsRefused`·`anIdentityWhoseStorageKeyWouldNotFitTheLedgerIsRefused` FAIL(`Expecting actual not to be null`)→PASS. V001 컬럼 폭(caller 256, method 256, hash 80, storage key 512)으로 compact constructor에서 거부 `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/api/ledger/GrpcOperationIdentity.java:24,40`. migration 변경 없음. 커밋 `a498ad84` | - | fingerprint ≤256자 검증 또는 storage key를 해시로 고정 길이화 |
|
||||
| N-12a | Nit | `GrpcClientMessageDeduplicator`가 "constant space"라지만 outcome이 세션 내내 누적, `endSession`이 O(N) `removeIf` | 남음 | `src/grpc-advanced/grpc-advanced-streaming/src/main/java/dev/caskeleton/grpc/advanced/streaming/GrpcClientMessageDeduplicator.java:13,110-112` | W5 | outcome을 세션별 map으로 나눠 `endSession`은 한 번에 제거, javadoc 정정 |
|
||||
| N-12b | Nit | `ReactiveGrpcClient.serverStream`은 List를 Flux로 감싸기만 함 | 남음 | `src/grpc-advanced/grpc-advanced-compat/src/main/java/dev/caskeleton/grpc/advanced/reactor/ReactiveGrpcClient.java:50` | W5 | 메서드 삭제 |
|
||||
| O-1 | Critical | root plugin 적용 시 compose overlay가 없으면 설정 단계에서 빌드 전체 실패 (= Critical #1) | 완료 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/bootstrap/DeveloperBootstrapPlugin.java:79-88` (overlay 확인이 task `doFirst`로 이동). 테스트 `DeveloperBootstrapPluginFunctionalTest.configurationDoesNotRequireComposeFiles`. 커밋 `6d27356e` | - | - |
|
||||
| O-2 / BUILD-계획-B1 / BUILD-바로할것-3 | Critical | `redis-sdk` CI job이 항상 실패하고 `release-gate`가 그 성공을 요구 (= Critical #2) | 완료 | `.github/workflows/ci-quality-gates.yml:74-100` (release-gate needs에 redis-sdk·`REDIS_RESULT` 없음), `_reusable-gradle.yml` 삭제됨. 커밋 `6d27356e`<br>BUILD-계획-B1: `_reusable-gradle.yml` 삭제(`6d27356e`), 모든 job이 `./.github/actions/setup-gradle-java` 사용<br>BUILD-바로할것-3: `ci-quality-gates.yml`에 redis-sdk job·release-gate needs 없음(`208077fd` 기준 `:109,225,240`에서 제거) | - | - |
|
||||
| O-3a | Required | `verifyNoIgnoredSourcePackages`가 `src/main/java`·`src/test/java`만 검사(testFixtures·integrationTest·systemTest·architectureTest 미검사, sample 제외) | 남음 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/ArchitecturePlugin.java:193-205` | W2 | 각 project의 모든 source set `java.srcDirs`를 수집 |
|
||||
| O-3b | Required | git 오류(exit 128, 실행 파일 없음)면 검사가 통과(fail-open) | 남음 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/VerifyNoIgnoredSourcePackagesTask.java:70-80` (exit code 미확인), `:117-119` (`IOException` → null → 통과) | W2 | 저장소에 `.git`이 있는데 git이 0/1 외 코드로 끝나거나 실행 불가면 `GradleException` |
|
||||
| O-3c | Required | optional-platforms의 `ci`가 이 검사를 돌리지 않아 gRPC 소스 미검사 | 남음 | `src/optional-platforms/build.gradle:33-38` | W2 | optional build `ci`에 같은 검사 연결 |
|
||||
| O-3a | Required | `verifyNoIgnoredSourcePackages`가 `src/main/java`·`src/test/java`만 검사(testFixtures·integrationTest·systemTest·architectureTest 미검사, sample 제외) | 완료 | Wave 1–2 P13 (fcddab7e·Wave 2 커밋): `VerifyNoIgnoredSourcePackagesFunctionalTest.sourceInAnIgnoredPackageOfAnAuxiliarySourceSetFailsTheGate` FAIL(`UnexpectedBuildSuccess` — integrationTest source set 미검사)→PASS, `...sourceInAnIgnoredPackageOfTheSamplePortfolioFailsTheGate` FAIL(`found no Java sources at all; the gate would pass vacuously.` — sample 제외)→PASS. 수정: `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/ArchitecturePlugin.java:196-215` — 모든 project의 모든 `SourceSet.java.srcDirs`를 모으고 build 디렉터리 아래(생성 코드)만 뺀다. sample도 포함. 실제 저장소: main build 4784개 Java 소스 검사(이전 main/test·sample 제외 약 4117개), optional-platforms 341개, 둘 다 OK. | - | 각 project의 모든 source set `java.srcDirs`를 수집 |
|
||||
| O-3b | Required | git 오류(exit 128, 실행 파일 없음)면 검사가 통과(fail-open) | 완료 | Wave 1–2 P13 (fcddab7e·Wave 2 커밋): `VerifyNoIgnoredSourcePackagesFunctionalTest.gitFailingInsideACheckoutFailsTheGateInsteadOfPassing` FAIL(`UnexpectedBuildSuccess` — 깨진 `.git`에서 git exit 128인데 통과)→PASS. 수정: `VerifyNoIgnoredSourcePackagesTask.java:70,102-150` — checkout 여부를 git 출력이 아니라 상위 디렉터리의 `.git` 존재로 판단(`checkoutRoot`), checkout 안에서 `git check-ignore`가 실행 불가(`IOException`)거나 exit가 0/1이 아니면 `GradleException`. `.git`이 없는 소스 묶음만 기존처럼 이름 규칙만 적용. `rev-parse` 호출과 `GitCommandResult` 삭제. | - | 저장소에 `.git`이 있는데 git이 0/1 외 코드로 끝나거나 실행 불가면 `GradleException` |
|
||||
| O-3c | Required | optional-platforms의 `ci`가 이 검사를 돌리지 않아 gRPC 소스 미검사 | 완료 | Wave 1–2 P13 (fcddab7e·Wave 2 커밋): `src/optional-platforms/build.gradle:38-40` — `ci`가 `verifyCleanArchitectureDependencies` 대신 `architectureCheck`(방향 + purity + `verifyNoIgnoredSourcePackages`)에 의존. 재현: `./gradlew -p optional-platforms ci --dry-run`에서 `verifyNoIgnoredSourcePackages` 0회 → 수정 후 포함. `./gradlew -p optional-platforms ci` BUILD SUCCESSFUL, `verifyNoIgnoredSourcePackages: OK — 341 Java sources`. | - | optional build `ci`에 같은 검사 연결 |
|
||||
| O-3d | Required | 이 검사의 테스트가 0개 | 남음 | `git grep -l IgnoredSource -- src/build-logic/src/test src/app-bootstrap/src src/build-tools/src/test` 0건 | W4 | TestKit 케이스: integrationTest source set에 ignore 대상 패키지 → 실패, git 실패 → 실패 |
|
||||
| O-4a | Required | app-bootstrap `test`가 선언 안 된 저장소 파일(runbook, `.env.example`)을 읽어 UP-TO-DATE 거짓 통과 | 완료 | `src/app-bootstrap/build.gradle:276-294` (`docs/**`, `*.example`, `.env*` 등을 `repositoryContractInputs`로 RELATIVE 선언). 커밋 `6d27356e` | - | - |
|
||||
| O-4b | Required | messaging adapter test가 schema 파일을 sysprop으로 읽으면서 입력 미선언 | 완료 | `src/adapter/outbound/messaging/build.gradle:45-48` (`inputs.file(config/messaging/evidence/build-evidence-manifest-v1.schema.json)`). 커밋 `6d27356e` | - | - |
|
||||
| O-4c | Required | CI에서 커밋마다 jar manifest version이 바뀌어 test·SpotBugs cache가 항상 miss | 남음 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenancePlugin.java:29` (`GITHUB_SHA`), `src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java:65` (`Implementation-Version`), normalization 설정 0건 | W3 | 입력 선언이 끝났으므로(O-4a/b) `JavaConventionsPlugin`에 `normalization.runtimeClasspath.metaInf.ignoreAttribute("Implementation-Version")` 추가 |
|
||||
| O-5a | Consider | 의존성 artifact checksum 검증(`verification-metadata.xml`)이 없음 | 보류 | `src/gradle/`에 `verification-metadata.xml` 없음 | - | 보류: lockfile로 버전은 고정됨, 의존성 갱신마다 metadata 재생성 부담을 지지 않음. 승인자: 저장소 소유자(2026-09-25) |
|
||||
| O-5b | Consider | included build(build-logic/build-tools)의 plugin 의존성이 lock 없이 `gradlePluginPortal`에서 받아짐 | 남음 | `src/build-logic/settings.gradle:6-10`, build-logic·build-tools에 `gradle.lockfile`·`dependencyLocking` 없음 | W1 | `src/build-logic/build.gradle`에 `dependencyLocking { lockAllConfigurations() }` + lockfile 커밋(build-tools는 비울 예정이면 생략) |
|
||||
| O-5b | Consider | included build(build-logic/build-tools)의 plugin 의존성이 lock 없이 `gradlePluginPortal`에서 받아짐 | 완료 | Wave 1–2 P13 (fcddab7e·Wave 2 커밋): W1 `50cb2d9e`. `src/build-logic/build.gradle:9-12`, `src/build-tools/build.gradle:10-13`에 `dependencyLocking { lockAllConfigurations(); lockMode = STRICT }`. lockfile 커밋: `src/build-logic/gradle.lockfile`, `src/build-tools/gradle.lockfile`(+ `--write-locks`가 만든 `settings-gradle.lockfile` 2개, main build와 같은 형태). 재생성: `./gradlew -p build-logic dependencies --write-locks`(build-tools도 같음). 재현(FAIL): lockfile의 `spotless-plugin-gradle:8.6.0`을 `8.5.0`으로 바꾸고 `./gradlew -p build-logic compileJava` → `:compileJava FAILED ... Dependency version enforced by Dependency Locking`. 복원 후 `-p build-logic test` 80/80, `-p build-tools test` 35/35 통과. 범위 한계는 P13-new-1 참고. | - | `src/build-logic/build.gradle`에 `dependencyLocking { lockAllConfigurations() }` + lockfile 커밋(build-tools는 비울 예정이면 생략) |
|
||||
| O-6 | Consider | 프로젝트 좌표 `dev.caskeleton:messaging-kafka` 중복(adapter vs vendored) | 완료 | `src/adapter/outbound/messaging-kafka/build.gradle:14-23` (`group = 'dev.caskeleton.adapter'`, `archivesName = 'adapter-outbound-messaging-kafka'`). 커밋 `6d27356e` | - | - |
|
||||
| O-7 / BUILD-중복-1 / BUILD-바로할것-1 | Consider | runtime membership 검사가 방향 게이트와 중복 | 완료 | `ca.runtime-membership` 삭제: `src/build-logic/README.md:41`, `git ls-files src/build-logic \| grep RuntimeMembership` 0건. 커밋 `6d27356e`<br>BUILD-중복-1: `ca.runtime-membership` id·코드 grep 0건(`src/build-logic/build.gradle`), 삭제 표 `src/build-logic/README.md:41`. 컴파일러·방향 task·ArchUnit은 리뷰대로 유지<br>BUILD-바로할것-1: id·클래스 grep 0건, `src/build.gradle`에 적용 없음 | - | - |
|
||||
| O-8 / BUILD-중복-2 / BUILD-바로할것-6 | Consider | "지정 테스트가 실행됐고 skip 없음" 검사 구현이 5개 | 남음 | 4개(`ca.strict-qualification`, `ca.conditional-transport-qualification`, `ca.graphql-platform`, `ca.evidence`)는 삭제되고 `strictTestLanes` + `RequiredTestExecution`으로 합쳐짐(`src/build-logic/README.md:42-44`). 남은 1개: `src/build-tools/src/main/java/dev/caskeleton/buildtools/junit/JUnitEvidenceReader.java` (사용처 `src/build-tools/src/main/java/dev/caskeleton/buildtools/jpa/JpaEvidenceTestResultLocator.java`뿐)<br>BUILD-중복-2: 3개 남음: `StrictLaneExecutionTracker`(정본), `RedisTopologyExecutionTracker`(`src/build-logic/src/main/java/dev/caskeleton/buildlogic/redis/RedisTopologyLanePlugin.java:81`, 소유자 결정으로 유지), `JUnitEvidenceReader`(`src/build-tools/src/main/java/dev/caskeleton/buildtools/junit/`, `JpaEvidenceTestResultLocator`가 사용). RejectSkippedTestsListener·JUnitEvidence·MongoJUnitXml은 grep 0건<br>BUILD-바로할것-6: `MongoJUnitXml` 삭제. `JUnitEvidenceReader`는 JPA evidence 전용으로 남음(`src/build-tools/src/main/java/dev/caskeleton/buildtools/junit/JUnitEvidenceReader.java`) | W3 | 소유자 결정대로 JPA evidence manifest(`ca.jpa-evidence`, `ca.jpa-qualification`)를 leaf 테스트로 옮길 때 `buildtools/junit/` 패키지를 함께 삭제<br>BUILD-중복-2: JPA evidence를 폐기할 때 `junit` 패키지(138+76줄)도 같이 삭제<br>BUILD-바로할것-6: BUILD-O3-2와 같이 삭제 |
|
||||
@@ -608,7 +620,7 @@
|
||||
| TEST-F-1 | Required | fake가 실제 adapter와 같은 계약으로 묶여 있지 않음 | 남음 | 공통 추상 계약이 있는 포트: DurableOperationStore, GrpcOperationLedger, WorkLogRepository, OutboxLeaseFencing(fake·adapter 양쪽이 상속). 없는 포트: Redis, tus, DeliveryProjection, MessagePublisher, IdempotencyStore, ObjectControlStore(TEST-FAKE 행) | W4 | TEST-FAKE 행마다 계약 추가 |
|
||||
| TEST-F-2a | Required | `claimsAreDeterministicallyOrdered`가 순서를 확인하지 않음 | 남음 | `src/adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/java/dev/caskeleton/adapter/outbound/persistence/platform/PostgreSqlWorkClaimContractTest.java:78-86` `isNotEmpty()`만 | W4 | 두 번 claim해 기대 순서를 `containsExactly`로 단언 |
|
||||
| TEST-F-2b | Required | `batchCreatePersistsEveryItemAtomically`가 원자성을 증명하지 못함 | 완료 | 이름과 단언을 맞춤: `src/sample-portfolio/src/test/java/dev/caskeleton/sample/portfolio/application/worklog/WorkLogUseCasesTest.java:258-264` `savesAllItemsInOneWriteTransaction`이 `tx.committed()`를 단언 | - | - |
|
||||
| TEST-F-2c | Required | PII가 없다는 단언이 항상 통과함 | 남음 | 예외 메시지에 원래 PII가 없음: `src/adapter/outbound/notification/src/test/java/dev/caskeleton/adapter/outbound/notification/core/RoutingNotifierTest.java:131`("provider-failure")→`:174`, `src/adapter/outbound/support/src/test/java/dev/caskeleton/adapter/outbound/support/FailOpenDependencyLoggerTest.java:69`("connection refused")→`:72` | W1 | 예외 메시지에 실제 PII를 넣고, 로그에서 빠지는지 단언 |
|
||||
| TEST-F-2c | Required | PII가 없다는 단언이 항상 통과함 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `RoutingNotifierTest.failingProvider`가 `"POST " + WEBHOOK_URL + " rejected " + n.recipient()`를 던진다(`RoutingNotifierTest.java:54,134`). `failOpenProviderLogsFailureWithProviderIdAndNoPii`·`piiNeverReachesLogOnSendFailure`가 수신자(`alice@example.com`)와 webhook URL이 로그에 없음을 단언한다. 수정 전 둘 다 FAIL(`not to contain: "alice@example.com"`) → PASS. `FailOpenDependencyLoggerTest` 쪽은 A-1b. 같은 결함이 있던 `NotificationAdapterTest.failingProvider`도 수신자를 메시지에 넣게 고쳤다(`NotificationAdapterTest.java:80`, 두 테스트 FAIL→PASS). 커밋 `9a05d686` | - | 예외 메시지에 실제 PII를 넣고, 로그에서 빠지는지 단언 |
|
||||
| TEST-F-2d | Required | "…BeforeIngress" 테스트가 converter 경로를 건너뜀 | 남음 | `src/adapter/inbound/web-notification/src/test/java/dev/caskeleton/adapter/inbound/web/notification/platform/callback/NotificationCallbackMvcControllerTest.java:118-126` 컨트롤러를 직접 호출 | W4 | MockMvc로 HTTP 경로를 거쳐 크기 제한을 단언 |
|
||||
| TEST-F-2e | Required | SLO 버킷 대신 `isNotEmpty()`만 확인 | 남음 | `src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/metrics/MetricsContractConfigTest.java:57-70` | W4 | 기대 SLO 경계값 목록을 `containsExactly`로 단언 |
|
||||
| TEST-F-2f | Required | `assertThat(context).isNotNull()` | 남음 | `SampleApplicationContextTest`는 고쳐짐(`:50-81` 구체 단언). `src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/autoconfigure/tracing/TracingActivationContextTest.java:80-83`은 남음 | W4 | 빈 endpoint로 기동한 뒤 exporter·bean 상태를 단언 |
|
||||
@@ -668,7 +680,7 @@
|
||||
| X1-지도-caller 트랜잭션 guard | 권고 | 9벌 복사 → persistence-jpa helper 1개 (= E-3) | 남음 | persistence-jpa 복사본 4벌 + guard 없는 곳 10개(세부 X1-#4) | W3 | X1-#4 |
|
||||
| X1-지도-Backoff 계산식 | 권고 | 10개, "full jitter" 뜻 3가지 → shared-contract `Backoff` | 남음 | 앱 쪽 3개 남음(`OutboxBackoffPolicy.java:63-68`, `ExponentialFullJitterBackoff.java:78`, `RetryBackoff.java:42`), JPA 2개 삭제 | W3 | X1-#9 |
|
||||
| X1-지도-Rate limit | 권고 | web 전용 병렬 타입 세트 삭제 (= I-8 일부) | 완료 | `WebRateLimiter`·web `RateLimitDecision`·`RateLimitFailurePolicy`·`WebMvcThrottleFilter` 삭제(`docs/capability-status.md:99`); 남은 경로 `RateLimitWebConfig.java:22` → `EdgeRateLimitTransportBridge` → shared `EdgeRateLimitPort`, 커밋 `6d27356e` | - | - |
|
||||
| X1-지도-Admission / in-flight | 권고 | 유지하되 gRPC check-then-increment는 `Semaphore`로 (= N-5) | 남음 | web admission 삭제(`docs/capability-status.md:101`). `grpc/grpc-server/.../GrpcAdmissionController.java:51-60` `get() < max` 후 `incrementAndGet()` 그대로 | W2 | X1-#10a |
|
||||
| X1-지도-Admission / in-flight | 권고 | 유지하되 gRPC check-then-increment는 `Semaphore`로 (= N-5) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): N-5a와 같은 수정. `Semaphore` 대신 한 락: in-flight와 queued 두 카운터를 한 결정에서 함께 봐야 해서 semaphore 두 개로는 원자적으로 안 된다. `GrpcAdmissionController.java:52`, `GrpcAdmissionControllerTest` | - | X1-#10a |
|
||||
| X1-지도-Kafka producer | 권고 | legacy seam·platform 2개, 둘 다 TLS/SASL 없음 → outbox 정리에 포함 | 남음 | platform producer는 Wave 1(1-4)에서 보안 적용. legacy `KafkaSenderAutoConfiguration.java:60-80` `kafkaSeamProducer`에 `security.protocol`·SASL·SSL 설정 없음 | W1 | X1-#1f |
|
||||
| X1-지도-파일 control plane / canonical JSON | 권고 | 소비자 0인 `FilePublicationPort` plane 삭제, parser 3개 → 1개 | 완료 | publication R1/R2 31개·`FilePublicationPort`·`FileExportPort` 삭제(`docs/capability-status.md:76-77`), 남은 직접 파서 `objectstorage/control/CanonicalJsonReader.java` 1개, 커밋 `6d27356e` | - | - |
|
||||
| X1-지도-readiness / evidence / API-surface / moduleboundary | 권고 | 카드 스키마·검증기·API-surface gate·moduleboundary 여러 벌 → 하나로 | 남음 | moduleboundary main 3벌 삭제, API-surface는 `ca.api-surface` 하나. 남은 것: 카드 스키마 3개·검증기 3곳, JPA evidence plugin(build-tools `jpa/` 48파일) | W3 | 결정(2026-09-25): O3 — JPA readiness·evidence는 persistence-jpa 테스트로(manifest 폐기), messaging 카드 검증은 messaging leaf로 |
|
||||
@@ -676,7 +688,7 @@
|
||||
| X1-#1a | Required | Outbox V2 삭제 + v1 claim에 owner+token fencing 이식 | 완료 | `persistence-jpa/.../db/migration/postgresql/V17__outbox_event_lease_fencing.sql`, `OutboxStoreAdapter.java:102-123`(markPublished·markFailed·markDead가 `lease.owner()`·`lease.token()` 조건부 UPDATE), V2 코드·`jpa/outbox-storage`·`jpa/outbox-polling` 삭제(`docs/capability-status.md:175-179`), 커밋 `6d27356e` | - | - |
|
||||
| X1-#1b | Required | append 포트를 `OutboxAppendPort` 하나로, legacy는 cutover 후 삭제 | 남음 | `OutboxAppendPort` main 소비자 0(구현 `CanonicalOutboxAppendAdapter`뿐). `LegacyOutboxAppendPort` 소비자 4곳: `SubmitDurableOperationUseCase.java:56`, sample `PosterEventPublisher.java:25`·`PosterImagePublicationEventPublisher.java:12`·`CreateWorkLogUseCase.java:42`. canonical 경로는 `IntegrationEventEncoderPort` 구현이 필요한데 템플릿은 주지 않음(`src/messaging/CLAUDE.md:83-89`, main 구현 0) | W3 | 결정(2026-09-25): canonical 통일(S1-#2b와 같은 작업) |
|
||||
| X1-#1c | Required | `CanonicalOutboxAppendAdapter`에 caller 트랜잭션 guard 없음 (= E-3) | 남음 | `CanonicalOutboxAppendAdapter.java:36-75` `append`가 트랜잭션 확인 없이 `repository.save` | W3 | X1-#4 helper를 `append` 첫 줄에서 호출(1곳) + 트랜잭션 없이 부르면 거부되는 테스트 |
|
||||
| X1-#1d | Required | canonical 이벤트가 v1 claim을 타며 aggregate 순서·tenant 범위를 잃음 (= E-5) | 남음 | `PostgreSqlOutboxClaimRepository.java:15-29` FIFO gate가 `aggregate_id`·`occurred_at`만 사용, `tenant_scope`·`aggregate_sequence`·`event_index` 미사용 | W2 | X1-#1b에서 canonical 경로를 남기면: canonical row(`contract_id IS NOT NULL`) gate를 `(tenant_scope, aggregate_type, aggregate_id)` + `(aggregate_sequence, event_index)` 순서로, `H2OutboxClaimRepository`도 동일 |
|
||||
| X1-#1d | Required | canonical 이벤트가 v1 claim을 타며 aggregate 순서·tenant 범위를 잃음 (= E-5) | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): E-5a·E-5b와 같은 변경 — canonical row claim 순서를 tenant·type·id + sequence·index로(PostgreSQL·H2 SQL), migration V18 index | - | X1-#1b에서 canonical 경로를 남기면: canonical row(`contract_id IS NOT NULL`) gate를 `(tenant_scope, aggregate_type, aggregate_id)` + `(aggregate_sequence, event_index)` 순서로, `H2OutboxClaimRepository`도 동일 |
|
||||
| X1-#1f | Required | legacy Kafka producer에 TLS/SASL 없음 (Critical #8 = M-2와 같은 문제) | 남음 | `adapter/outbound/messaging-kafka/.../KafkaSenderAutoConfiguration.java:60-80` producer config에 bootstrap·serializer·acks·timeout만 | W1 | `KafkaAdapterSettings`에 security 블록(protocol·SASL·truststore) 추가 후 `kafkaSeamProducer` config에 반영, 또는 X1-#1b 결정으로 seam 자체 삭제 |
|
||||
| X1-#1g | Required | `src/messaging/CLAUDE.md`에 "앱은 `messaging_outbox`를 쓰지 않는다" 명시 | 남음 | `grep -n messaging_outbox src/messaging/CLAUDE.md` → 0건 | W5 | `src/messaging/CLAUDE.md` MSG-015 절(:60-89)에 한 줄 추가 |
|
||||
| X1-#1h | Required | fencing 시나리오를 contract kit로 fake·실제 adapter 양쪽에서 실행 | 완료 | testFixtures `OutboxLeaseFencingContract`를 `InMemoryOutboxStoreLeaseFencingContractTest.java:9`와 `PostgreSqlLegacyOutboxConcurrentRelayIntegrationTest.java:45`가 상속, 커밋 `6d27356e` | - | - |
|
||||
@@ -695,21 +707,21 @@
|
||||
| X1-#6b | Required | lock과 lease 중 하나만 남김 | 남음 | `DistributedLockPort`(구현 `LockRegistryDistributedLockAdapter`, 참조는 `StartupSafetyValidator.java:51` 존재 검사뿐), `DistributedLeasePort`(구현 `RedisDistributedLeaseAdapter`, 소비자 0). `CacheRefreshCoordinationPort`는 삭제(`docs/capability-status.md:152`). `LeaseAttempt`·`IdempotencyClaimAttempt` 같은 구조 그대로 | W4 | 결정(2026-09-25): lock·lease 둘 다 유지(S1-#3b와 같은 작업) |
|
||||
| X1-#6c | Required | app-core inbox 삭제로 `IdempotencyOwner`·`InboxOwner` 중복 record 해소 | 해당 없음(코드 삭제) | `application/inbox/` 삭제(`docs/capability-status.md:155`) | - | - |
|
||||
| X1-#6d | Required | `ClaimFencingContract` kit를 application-core testFixtures에 두고 row lease store마다 실행 | 남음 | outbox 전용 `OutboxLeaseFencingContract`만 있음. durable operation(`claimNext`·`heartbeat`), notification `JpaRecipientLeaseStore`는 공통 fencing kit 없음 | W4 | `OutboxLeaseFencingContract`의 "밀려난 쪽 종결 쓰기는 0건" 시나리오를 범용 `ClaimFencingContract`로 올리고 durable operation·recipient lease store 2곳에 상속 추가 |
|
||||
| X1-#6e | Required | notification `recipients.save`가 lease 확인 없이 씀 (= B-5) | 남음 | `application-notification/.../dispatch/DispatchOutcomeRecorder.java:135` `recipients.save(updated)` | W2 | projection 뒤 recipient를 다시 읽고 recorder 소유 필드만 `saveHeldBy(lease)`로 기록 + late-match 회귀 테스트 |
|
||||
| X1-#6e | Required | notification `recipients.save`가 lease 확인 없이 씀 (= B-5) | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): B-5a·B-5b와 같은 결함. 같은 수정·테스트(`DispatchOutcomeRecorder.java:122,153`) | - | projection 뒤 recipient를 다시 읽고 recorder 소유 필드만 `saveHeldBy(lease)`로 기록 + late-match 회귀 테스트 |
|
||||
| X1-#6f | 권고 | shared-contract `OperationalRecordStorePort`(CAS 저장 포트) 사용처 0 — 리뷰 권고 "미사용분 삭제" 적용 대상 | 남음 | `shared-contract/.../opstore/OperationalRecordStorePort.java:19`, 같은 패키지 `OperationalRecord`·`OperationalRecordConflictException` 포함 구현·호출·테스트·문서 참조 0(`git grep -w OperationalRecordStorePort` → 자기 파일뿐) | W3 | `shared-contract/src/main/java/dev/caskeleton/shared/opstore/` 3개 삭제, `docs/capability-status.md` 제거 표에 한 줄 |
|
||||
| X1-#7a | Required | readiness 카드 스키마 3개·검증기 3개, family별 evidence plugin | 남음 | 카드: `src/config/jpa/readiness-cards.yaml`(kebab JSON), `src/config/messaging/readiness-cards.yaml`(camelCase), `docs/registries/object-storage-readiness.yaml`(snake_case). 검증기: build-tools `JpaReadinessRegistryValidator.java`, app-bootstrap `MessagingCapabilityRegistryContractTest.java`, objectstorage `ObjectStorageReadinessRegistryTest.java`. messaging·notification·mongo evidence plugin은 leaf 테스트로 이동, JPA evidence는 build-tools `jpa/` 48파일에 남음(계획서 진행 기록 Wave 5 "남은 설계 결정") | W3 | 결정(2026-09-25): O3 방향(X1-지도-readiness와 같은 작업) |
|
||||
| X1-#7b | Required | API-surface gate 3개 → `ca.api-surface` 하나 | 완료 | notification·persistence-jpa·persistence-mongo·graphql 모두 `id 'ca.api-surface'`(`adapter/outbound/notification/build.gradle:4`, `persistence-jpa/build.gradle:7`), `ca.notification-api-surface`·`verifyJpaAdopterApiSurface` 삭제. JPA adopter import 검사는 leaf 테스트 `JpaAdopterApiSurfaceTest`, 커밋 `6d27356e` | - | - |
|
||||
| X1-#7c | Required | web·graphql·websocket main의 moduleboundary 3벌 → ArchUnit | 완료 | 3벌 삭제(`docs/capability-status.md:80,93,113`), graphql 규칙 2개는 `GraphQlTransportBoundaryArchitectureTest.java`로, 커밋 `6d27356e` | - | - |
|
||||
| X1-#8a | Consider | 소비자 0인 `FilePublicationPort` plane 삭제, parser 3→1, 경계 결정 문서화 | 완료 | `docs/capability-status.md:76-77`, fileserver `FileserverControlRecordCodec`·`LocalPublicationJournalCodec` 삭제, 남은 파서 `CanonicalJsonReader.java` 1개, `docs/storage-capability-boundary.md` "Decision rule" 절, 커밋 `6d27356e` | - | - |
|
||||
| X1-#9 | Consider | Backoff 계산식 10개, "full jitter" 뜻 3가지 → shared-contract `Backoff` | 남음 | JPA `BackoffCalculator`·`TransactionRetryBackoff`, httpclient `BackoffStrategy` 삭제. 앱 쪽 3개: `OutboxBackoffPolicy.java:63-68`(이름은 full jitter인데 `base·2ⁿ + U(0,base)`, 상한 없음), `ExponentialFullJitterBackoff.java:78`(`U(0,capped]`), notification `RetryBackoff.java:42`. mongo·messaging·grpc는 자체 유지 대상 | W3 | shared-contract에 `Backoff(base, max, Jitter)`(stdlib만) 추가, 사용처 2곳(`OutboxBackoffPolicy`, `ExponentialFullJitterBackoff`) 교체; notification은 application-notification→shared-contract edge를 registry에 추가할 때만 |
|
||||
| X1-#10a | FYI | `GrpcAdmissionController` check-then-increment → `Semaphore.tryAcquire` (= N-5) | 남음 | `grpc/grpc-server/.../GrpcAdmissionController.java:51-60` | W2 | `inFlight`·`queued`를 `Semaphore` 또는 `updateAndGet` CAS로, 동시 호출 수 > 한도 테스트 1개(optional build) |
|
||||
| X1-#10a | FYI | `GrpcAdmissionController` check-then-increment → `Semaphore.tryAcquire` (= N-5) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 위와 같음(동시 호출 수 > 한도 테스트 `GrpcAdmissionControllerTest.racingCallersNeverGetPastTheConcurrencyAndQueueBounds`, optional build) | - | `inFlight`·`queued`를 `Semaphore` 또는 `updateAndGet` CAS로, 동시 호출 수 > 한도 테스트 1개(optional build) |
|
||||
| X1-#10b | FYI | SHA-256 헬퍼 65벌, notification `MessageDigestPort`는 과한 추상화 → 흡수 | 남음 | `application-notification/.../dispatch/MessageDigestPort.java` + `Sha256MessageDigestAdapter.java` 그대로. 헬퍼 수는 X2-P1-5 | W3 | X2-P1-5와 같이. `MessageDigestPort`는 application-notification이 shared-contract edge를 가져야 흡수 가능 → edge 추가 후 포트·adapter 2개 삭제 |
|
||||
| X2-P1-1a | Required | S3 시크릿이 `System::getenv` 고정 → `SecretSourcePort` bridge | 남음 | `objectstorage/.../s3/S3ObjectStorageProviderContribution.java:41` 기본 생성자가 `System::getenv` | W1 | S3 contribution에 `SecretSourcePort`를 주입해 `secretSource::resolve`(Redis `RedisCapabilityConfig.java:66-67` 방식), `System::getenv` 기본값 제거 |
|
||||
| X2-P1-1b | Required | Mongo credential bridge 없음(기본 `unconfigured()`) | 남음 | `persistence-mongo/.../security/MongoCredentialResolver.java:31`; persistence-mongo 밖 `MongoCredentialResolver` bean 0; persistence-mongo는 registry edge 0이라 `SecretSourcePort`를 못 봄 | W1 | modules.json에 persistence-mongo→application-core edge 추가 후 Mongo auto-config에 `MongoCredentialResolver` bridge bean 1개(`secretSource::resolve`) |
|
||||
| X2-P1-1a | Required | S3 시크릿이 `System::getenv` 고정 → `SecretSourcePort` bridge | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): `S3ProviderCompositionTest.capabilityConfigResolvesS3CredentialsThroughTheSecretSourcePort` FAIL(`IllegalArgumentException: S3 provider binding is invalid: credential environment references did not resolve completely`)→PASS. `s3/S3ObjectStorageProviderContribution.java:33`(공개 생성자가 `SecretSourcePort`를 받고 `System::getenv` 제거), `config/ObjectStorageCapabilityConfig.java:47-51`(`ObjectProvider<SecretSourcePort>`를 자격 증명을 실제로 풀 때 조회 — secret backend 없는 local-only 조립도 기동됨). 새 설정·env 키 없음 | - | S3 contribution에 `SecretSourcePort`를 주입해 `secretSource::resolve`(Redis `RedisCapabilityConfig.java:66-67` 방식), `System::getenv` 기본값 제거 |
|
||||
| X2-P1-1b | Required | Mongo credential bridge 없음(기본 `unconfigured()`) | 완료 | Wave 1–2 P12 (fcddab7e·Wave 2 커밋): `MongoProfileClientSettingsAutoConfigurationTest.aTypedProfileResolvesItsUriThroughTheApplicationSecretSource` FAIL(`IllegalStateException: MongoDB typed profiles are configured but no MongoCredentialResolver bean is available`)→PASS, `aSecretSourceWithoutTheReferencedKeyFailsClosed`. `src/config/architecture/modules.json:81-86`(`adapter-outbound-persistence-mongo` → `application-core`), `src/adapter/outbound/persistence-mongo/build.gradle:32`(`implementation project(':application-core')`), bridge bean `client/MongoProfileClientSettingsAutoConfiguration.java:57`(`@ConditionalOnBean(SecretSourcePort)`·`@ConditionalOnMissingBean(MongoCredentialResolver)`, `MongoCredentialResolver.fromSecretSource(secretSource::resolve)`), `security/MongoCredentialResolver.java:42`(key = `secret://<source>/<name>`의 `<name>`, Redis·httpclient와 같은 규칙). `MongoRegistryPermissionParityTest`(app-bootstrap) PASS. 이유는 W1 커밋 메시지에 적음. | - | modules.json에 persistence-mongo→application-core edge 추가 후 Mongo auto-config에 `MongoCredentialResolver` bridge bean 1개(`secretSource::resolve`) |
|
||||
| X2-P1-2a | Required | websocket prod 판정 직접 구현(`Prod`·공백 미인식) (= A-2) | 해당 없음(코드 삭제) | `WebSocketPlatformSafetyConfiguration`·`app.websocket.platform.*` 삭제(`docs/capability-status.md:186`), websocket main에 `"prod"` 문자열 0 | - | - |
|
||||
| X2-P1-2b | Required | httpclient `profile/RuntimeEnvironment`가 정본과 이름이 같음(Nit) | 남음 | `adapter/outbound/httpclient/.../profile/RuntimeEnvironment.java` (httpclient 안 참조 파일 4개 + 정본 import 1개) | W5 | `HttpClientHardening` 등으로 개명, 참조 4파일 수정 |
|
||||
| X2-P1-3a | Required(문서) | capability settings 규칙(strict 바인딩 + compact constructor)을 root 문서에 | 완료 | `AGENTS.md:216` capability 완료 기준 4, 커밋 `6d27356e` | - | - |
|
||||
| X2-P1-3b | Required | gRPC adapter strict prefix `ca-skeleton.grpc`가 벤더 `ca-skeleton.grpc.platform`과 겹침 | 남음 | `adapter/inbound/grpc/.../GrpcServerSettings.java:17`(`ignoreUnknownFields = false`, `platform` 필드 없음) vs `grpc-spring-boot-starter/.../GrpcPlatformProperties.java:19`. 미확인: 두 스택 동시 기동 실패는 실행 안 함 | W2 | adapter prefix를 `ca-skeleton.grpc.server` 등으로 분리(설정 키·env key·README 갱신) |
|
||||
| X2-P1-3b | Required | gRPC adapter strict prefix `ca-skeleton.grpc`가 벤더 `ca-skeleton.grpc.platform`과 겹침 | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): `GrpcSafeActivationTest.theVendorPlatformNamespaceBesideTheAdapterDoesNotFailItsStrictBinding` FAIL(`UnboundConfigurationPropertiesException: The elements [ca-skeleton.grpc.platform.enabled] were left unbound`)→PASS. 어댑터 prefix `ca-skeleton.grpc` → `ca-skeleton.grpc.server` `src/adapter/inbound/grpc/src/main/java/dev/caskeleton/adapter/inbound/grpc/GrpcServerSettings.java:17`, `GrpcServerConfig.java`. 어댑터 키는 env-keys registry에 행이 없었다(추가·수정 없음). 갱신: `src/adapter/inbound/grpc/{CLAUDE,README}.md`, `src/README.md:269`(env `CA_SKELETON_GRPC_SERVER_ALLOW_INSECURE_LOCAL`). **오케스트레이터 할 일:** `docs/capability-status.md:42`의 `ca-skeleton.grpc.enabled`·`ca-skeleton.grpc.allow-insecure-local`을 `.server.` 경로로. Wave 3-B(`app.*`)에서도 `app.grpc.server`처럼 벤더 prefix와 형제로 둬야 같은 충돌이 다시 안 생긴다. 커밋 `a498ad84` | - | adapter prefix를 `ca-skeleton.grpc.server` 등으로 분리(설정 키·env key·README 갱신) |
|
||||
| X2-P1-3c | Required | 오타 키 거부가 일부 capability에만 적용 | 남음 | strict 바인딩 4곳(fileserver·httpclient `StrictSettingsBinder`, `GrpcServerSettings.java:17`, `GrpcPlatformProperties.java:19`) / main `@ConfigurationProperties` 54파일(`git grep -l "@ConfigurationProperties" -- 'src/**/src/main/java/**'`) | W3 | `AGENTS.md:216` 기준대로 capability 모듈(cache-redis, persistence-jpa, persistence-mongo, messaging, notification, objectstorage, graphql, websocket) settings를 `StrictSettingsBinder`로 바인딩 |
|
||||
| X2-P1-4a | Consider | web `cursor/CursorCodec`(dev key 하드코딩) 삭제 | 완료 | `docs/capability-status.md:94`, `HmacWebCursorCodec`도 삭제(`:97`), 커밋 `6d27356e` | - | - |
|
||||
| X2-P1-4b | Consider | 서명 계층 하나(inbound에서 서명, persistence는 typed keyset), 남으면 공용 서명 헬퍼 | 남음 | HMAC codec 7 → 4: graphql `HmacGraphQlCursorCodec`, persistence-jpa `SignedJsonCursorCodec`, persistence-mongo `MongoKeysetCursorCodec`, 벤더 `GrpcResumeTokenCodec`. 앱 쪽 3개 모두 production 생성 0(라이브러리 API) | W3 | 결정(2026-09-25): Wave 3 라이브러리 유지 결정을 따름 — 서명 codec 유지, shared-contract에 sign/verify 헬퍼 하나로 중복 제거 |
|
||||
@@ -730,7 +742,7 @@
|
||||
| X2-P2-5 | Consider | correlation이 HTTP 밖으로 안 이어짐, `MdcKeys`가 web에 갇힘 | 남음 | `adapter/inbound/web/.../observability/MdcKeys.java`(사용 5파일, web-fileserver 포함), `MDC.put`은 `RequestLoggingFilter.java:65-71,147`뿐, `CorrelationIdPort` 구현은 `MdcCorrelationIdPortAdapter` 1개, GraphQL은 `GraphQlPlatformWebInterceptor.java:157` Spring request id | W3 | `MdcKeys`를 shared-contract로(원본 `docs/registries/mdc-keys.yaml`), 사용 5파일 import 변경; websocket STOMP·gRPC interceptor에 MDC 채우는 코드, GraphQL은 `WebRequestId` 사용 |
|
||||
| X2-P2-6a | Required | 같은 이름 `TenantContext` 2개, 허용 문법이 다름 | 남음 | web `core/TenantContext.java:20` `[A-Za-z0-9][A-Za-z0-9_.-]{0,63}` vs graphql `context/TenantContext.java:17,30`(비어있지 않고 128자 이하). 그 밖에 persistence-jpa `experimental/tenant/TenantId`, application-notification `TenantId` | W3 | application-core에 tenant id 값 타입 1개(web 문법) 두고 web·graphql `TenantContext` 2곳이 감쌈, notification·jpa `TenantId`도 같은 타입으로 맞춤 |
|
||||
| X2-P2-7a | Required | 연결 안 된 두 번째 rate-limit stack 삭제 (= I-8 일부) | 완료 | `WebRateLimiter`·`WebMvcThrottleFilter`·`ThrottleProblemWriter` 삭제(`docs/capability-status.md:99-100`), WebFlux throttle은 WebFlux와 함께 삭제(`:88`), 커밋 `6d27356e` | - | - |
|
||||
| X2-P2-7b | Required | client IP 신뢰 규칙이 두 갈래 (= I-5) | 남음 | `web/ratelimit/ForwardedHeaderClientIpResolver.java:11-16` trusted proxy 확인 없이 XFF 첫 hop vs `web-notification/.../ExternalRequestUrlResolver.java:31` trusted proxy일 때만 | W1 | `ForwardedHeaderClientIpResolver`도 `remoteAddr`가 trusted proxy일 때만 XFF 사용(아니면 `remoteAddr`), 규칙은 `ExternalRequestUrlResolver`와 같은 설정 하나로 |
|
||||
| X2-P2-7b | Required | client IP 신뢰 규칙이 두 갈래 (= I-5) | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): I-5a와 같은 결함. client IP 해석 경로가 `getRemoteAddr()` 하나만 남음(XFF를 직접 읽는 main 코드 grep 0건, `ForwardedHeaderClientIpResolver` 삭제). 남은 `web-notification/.../ExternalRequestUrlResolver`는 client IP가 아니라 URL(proto/host) 해석이고 이미 trusted proxy일 때만 읽는다. 그 forwarded 파싱 삭제·설정 통합은 현황표 I-5b(W3)가 소유해서 이번에 건드리지 않음 | - | `ForwardedHeaderClientIpResolver`도 `remoteAddr`가 trusted proxy일 때만 XFF 사용(아니면 `remoteAddr`), 규칙은 `ExternalRequestUrlResolver`와 같은 설정 하나로 |
|
||||
| X2-P2-8 | Consider | Origin 검증기 3개, env key 3개 기본값 다름 | 해당 없음(코드 삭제) | web `WebCorsPolicyValidator` 삭제(`docs/capability-status.md:206`), websocket platform origin 정책·`APP_WEBSOCKET_PLATFORM_*` 삭제(`:186`); 남은 검증은 `WebSocketSettings.java:25`(+`@AssertTrue`) 1개 | - | - |
|
||||
| X2-P2-9a | FYI | 크기 제한 위반 코드 이름이 전송마다 다름 | 남음 | web `PAYLOAD_TOO_LARGE`(`GlobalExceptionHandler.java:342`), graphql `REQUEST_TOO_LARGE`(`GraphQlHttpOutcome.java:32`)·`GRAPHQL_DOCUMENT_SHAPE_REJECTED`, fileserver `FILE_TOO_LARGE`(`FileserverErrorCode.java:36`) | W3 | P2-1 정리 때 body 크기 초과는 `PAYLOAD_TOO_LARGE` 하나로(graphql 1곳), 문서 모양 거부·파일 크기는 별도 코드 유지 |
|
||||
| X2-P2-9b | FYI | STOMP가 모든 실패를 `WEBSOCKET_REQUEST_REJECTED` 하나로 → carrier 코드 소실 | 남음 | `SafeStompSubProtocolErrorHandler.java:12,21-27` | W3 | 원인이 `ApiErrorCarrier`면 그 `code()`를 `error-code` 헤더에(메시지는 고정 유지), 나머지는 현재 값 |
|
||||
@@ -756,7 +768,7 @@
|
||||
| S1-#3a | Required | 호출자 없는 cache executor 20종·`LeaseWatchdog`·`TransactionCompletionResolver`·inbox·filepublication·`EphemeralFanoutPort` | 해당 없음(코드 삭제) | 「제거된 코드」 application-core cache 20종, `LeaseWatchdog`, `TransactionCompletionResolver`, same-store inbox, `FilePublicationPort`, `EphemeralFanoutPort` 행 | - | - |
|
||||
| S1-#3b | Required | `lease/*` 399줄: Redis 구현만 있고 use case 호출자 0 (= X1-#6) | 남음 | `application-core/.../lease/`(13파일 399줄) 참조는 `cache-redis/.../lease/RedisDistributedLeaseAdapter.java`·`RedisLeaseConfig.java`뿐. JDBC `DistributedLockPort`도 비즈니스 소비자 0. cache-redis README가 lease를 제공 capability로 명시 | W4 | 결정(2026-09-25): lock·lease 둘 다 capability로 유지 — 포트별 추상 계약 테스트를 fake와 어댑터가 함께 통과 |
|
||||
| S1-#4 | Required | `NotificationDispatchService` 생성자 15개, record 필드별 재조립·실패 분류가 한 클래스에 (B-5 구조 원인) | 남음 | `application-notification/.../dispatch/NotificationDispatchService.java:72`(인자 15개), `:208`·`:485` record 재조립, `:255-288` catch 분기, `:475`·`:513` 종료 상태 두 번 계산. `DispatchOutcomeRecorder.java:67,110` 재조립 2곳 | W3 | `DeliveryAttemptRecord.completed(result, at)`·`RecipientDeliveryRecord.advancedRoute(now)` 전이 메서드 추가, catch 분기는 `ProviderOutcomeClassifier` 정적 메서드로 분리 |
|
||||
| S1-#5 | Required | fileserver retire 절차 3곳 복사, admin `forceDelete`는 content 없는 레코드를 DELETING에 남김 (C-4 관련) | 남음 | `application-fileserver/.../admin/DefaultFileserverAdminService.java:160-175`(contentKey 없을 때 DELETED 전이 없음) vs `lifecycle/DefaultFileLifecycleService.java:87-100`(있음), `upload/DefaultUploadApplicationService.java:258-269` | W2 | `retire(FileRecord)` 하나로 합치고 content 없으면 DELETING→DELETED 전이를 세 호출부 모두에 적용 |
|
||||
| S1-#5 | Required | fileserver retire 절차 3곳 복사, admin `forceDelete`는 content 없는 레코드를 DELETING에 남김 (C-4 관련) | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `FileserverAdminServiceTest.forceDeletingAFileThatWasNeverPublishedRetiresItCompletely` FAIL(`expected: DELETED but was: DELETING`)→PASS. 세 호출부가 `src/application-fileserver/.../cleanup/FileRetirement.java:40` 하나를 쓴다: `DefaultFileLifecycleService.java:84`, `DefaultFileserverAdminService.java:167`, `DefaultUploadApplicationService.java:265`. `cleanup` 패키지에 둔 이유: 세 호출 패키지가 이미 cleanup을 의존하고 cleanup은 그들을 의존하지 않아 새 패키지 순환이 생기지 않는다 | - | `retire(FileRecord)` 하나로 합치고 content 없으면 DELETING→DELETED 전이를 세 호출부 모두에 적용 |
|
||||
| S1-#6a | Required | fileserver 단일 구현 인터페이스 6개(fake 없음) | 남음 | `CleanupService`, `WriterLeaseCoordinator`, `FileLifecycleService`, `TransferAdmissionController`, `FileReconciliationService`, `FileStateMachine` 모두 구현 1개(`Default*`) | W3 | 인터페이스 6개 삭제, `Default*`를 인터페이스 이름으로 개명 |
|
||||
| S1-#6b | Required | fileserver 인바운드가 use-case 계약 밖(capability gate 미적용) | 남음 | `application-fileserver/src/main/java`에서 `@UseCaseCapability`/`CommandUseCase`/`QueryUseCase` 0건(notification 14파일) | W3 | transport가 부르는 연산을 `*UseCase` + `@UseCaseCapability`로 선언 |
|
||||
| S1-#7 | Consider | 에러 코드마다 예외 서브클래스, 타입 분기는 몇 개뿐 | 남음 | fileserver `api/error/` 예외 23개 그대로(`FileNotFoundException`·`FileAlreadyExistsException`·`InvalidPathException` JDK 이름 충돌 유지). notification은 throw 0인 12개만 삭제(「제거된 코드」 행), 12개 남음 | W3 | base를 구체 클래스 + `of(code, …)`, 서브클래스는 catch로 타입 분기하는 5개만 남김 |
|
||||
@@ -784,7 +796,7 @@
|
||||
| S1-lead-3 | 권고 | 멱등성 executor 조립 위치 (= G-11) | 남음 | adapter 조립은 사라졌으나(`RedisIdempotencyConfig.java:51` store만) 조립이 `app-bootstrap/.../idempotency/IdempotencyProviderSelectionConfig.java:48`에 있음. 소유자 결정은 별도 `composition:*` 모듈 | W3 | `IdempotencyProviderSelectionConfig`·`IdempotencySettings`를 새 `composition:idempotency`(가칭) 모듈로 이동, registry 등록 |
|
||||
| S1-lead-4 | 권고 | `Local*Gateway`가 `LocalBlockingContentStore`로 넘기기만 | 남음 | `adapter/outbound/fileserver/.../platform/local/` gateway 6개 385줄, 이 중 `LocalDownloadContentGateway`(26줄)·`LocalCleanupContentGateway`·`LocalZeroCopyDownloadGateway`는 위임만 | W3 | 위임만 하는 3개는 `LocalBlockingContentStore`가 해당 gateway 인터페이스를 직접 구현, 로직 있는 Copy/Upload는 유지 |
|
||||
| S1-lead-5 | 권고 | persistence-jpa `SpringPolicyTransactionPort` 정리 | 해당 없음(코드 삭제) | 「제거된 코드」 `SpringPolicyTransactionPort`… 행 | - | - |
|
||||
| S1-lead-6 | 권고 | fileserver 전이 규칙이 Java와 SQL 두 곳 | 남음 | `application-fileserver/.../api/DefaultFileStateMachine.java:14` vs `adapter/outbound/persistence-fileserver/.../repository/FileTransitionRepository.java:63-68`(DELETING 진입 가능 상태를 SQL 문자열로 하드코딩) | W2 | SQL의 허용 상태 목록을 `FileState` 전이표에서 파라미터로 넘기거나, 두 목록이 같은지 단언하는 테스트 추가 |
|
||||
| S1-lead-6 | 권고 | fileserver 전이 규칙이 Java와 SQL 두 곳 | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): SQL의 허용 상태 문자열을 없애고 `JpaFileMetadataStore`가 전이표(`FileStateMachine.canTransition(s, DELETING)`)에서 목록을 만들어 파라미터로 넘긴다: `src/adapter/outbound/persistence-fileserver/.../repository/FileTransitionRepository.java:73`, `JpaFileMetadataStore.java:56`. 동작이 바뀐 게 아니라 중복 제거라 FAIL 재현 대상이 없음. PG `aRecordInAStateWithNoDeletingEdgeIsNotMarkedDeleting`(VERIFYING 거부)·기존 `logicalDeleteMovesTheRecordOutOfPublicReadability` PASS | - | SQL의 허용 상태 목록을 `FileState` 전이표에서 파라미터로 넘기거나, 두 목록이 같은지 단언하는 테스트 추가 |
|
||||
| S2-#1a | Required | JPA `notification/crypto` 505줄 테스트 전용 사본 | 해당 없음(코드 삭제) | 「제거된 코드」 "JPA notification crypto 6종과 테스트" 행 | - | - |
|
||||
| S2-#1b | Required | persistence-jpa가 notification persistence를 품음(jpa→application-notification edge) | 남음 | `adapter/outbound/persistence-jpa/build.gradle:38` `implementation project(':application-notification')`, `persistence/notification/**` 6,573줄, `PersistenceJpaConfig.java:40-80` 19개 패키지 목록 ×2, `:88` `OPT_IN_NOTIFICATION_PACKAGE`, `PersistenceEntityScanCoverageTest.java:46`. 계획 W4가 추출을 적었으나 registry에 `persistence-notification` 없음 | W3 | `persistence-fileserver/build.gradle` 방식으로 `adapter:outbound:persistence-notification` leaf 추출, 목록 2개·상수·coverage 테스트 삭제 |
|
||||
| S2-#2a | Required | Mongo: 바인딩 안 되는 `advanced.*.enabled`, 구현 없는 인터페이스 10개, reactive·change stream | 해당 없음(코드 삭제) | 「제거된 코드」 Mongo advanced 바인딩·search/vector·time series·GridFS·`MongoDataKeyResolver` 등·reactive·change stream 행. 인터페이스 9개 grep 0, `MongoTenantMigrationCheckpointStore`는 구현 생김(`MongoTenantMigrationCoordinator.java:96`) | - | - |
|
||||
@@ -814,12 +826,12 @@
|
||||
| S2-lead-4 | 권고 | persistence 실패 예외 계층 3벌 | 남음 | jpa `api/error/JpaPersistenceException.java:14`(RuntimeException 상속, 21개, 라이브러리 `PostgreSqlExceptionTranslator` 결과), mongo `api/error` 24개, shared `shared-contract/.../error/PersistenceFailureException.java`(web·grpc가 매핑) | W3 | `JpaPersistenceException`이 `PersistenceFailureException`을 상속해 inbound가 한 계층만 매핑(mongo는 edge 없어 유지) |
|
||||
| S2-lead-5 | 권고 | sample이 `PostgreSqlPersistenceConfig`의 claim repository bean을 재선언 | 완료 | `sample-portfolio/.../bootstrap/persistence/SamplePostgreSqlPersistenceConfig.java:28-48`은 sample Flyway 전략만 선언, claim repository bean 없음 | - | - |
|
||||
| S2-lead-6 | 권고 | JPA 조립이 leaf와 bootstrap에 나뉨 | 완료 | 「제거된 코드」 `JpaPlatformAutoConfiguration`·`JpaPlatformRuntimeAutoConfiguration` 행, 조립은 `persistence-jpa/src/main/resources/META-INF/spring/...AutoConfiguration.imports`(3개)에만, `app-bootstrap/.../autoconfigure/`에 jpa 없음 | - | - |
|
||||
| S3-#1 | Required | httpclient blocking/reactive 병렬 스택이 이미 갈라짐 (= H-5, H-7) | 남음 | D4는 inbound WebFlux만 삭제. httpclient `webclient/`·`reactor/`·`service/Reactive*` 그대로, `build.gradle:30-37` webflux·reactor 의존. 401 refresh는 blocking만(`restclient/DefaultGenericHttpGateway.java:212-225`), `webclient/ReactiveAttemptExecutor.java:155-172` `false` 고정, `ReactiveClientRuntime.java:39`가 `BlockingExecutionSupport` 사용 | W3 | 결정(2026-09-25): D4를 outbound에도 적용 — httpclient reactive(WebClient·Reactor Netty) 스택과 webflux·reactor 의존 삭제 |
|
||||
| S3-#2a | Required | reactive streaming 요청이 admission·deadline·credential 없이 나감 | 남음 | `adapter/outbound/httpclient/.../webclient/ReactiveStreamingGateway.java:50-107`(prepared header만 전송, credential·admission·deadline 호출 없음) vs `restclient/BlockingStreamingGateway.java`(고쳐짐) | W2 | S3-#1에서 reactive를 지우면 함께 삭제, 유지하면 blocking과 같은 credential·admission·deadline 단계 적용 + 동작 테스트 |
|
||||
| S3-#1 | Required | httpclient blocking/reactive 병렬 스택이 이미 갈라짐 (= H-5, H-7) | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): D 커밋 `06764fcb`에서 reactive 스택(WebClient·Reactor Netty)과 webflux·reactor·reactor-netty·reactor-test·blockhound 의존 삭제. blocking(RestClient) 경로 하나만 남음. `clients[N].api` 설정 키·`ClientApiType`·`TransportType.REACTOR_NETTY` 삭제, env-fields.yaml 행 삭제, lockfile 재생성(httpclient·app-bootstrap). Jetty HTTP/3 실험 transport는 reactive SPI에 묶여 있어 blocking SPI(`JettyClientHttpRequestFactory`)로 옮김(자동 조립 안 됨은 그대로) `HC/http3/JettyHttp3TransportProvider.java:49` | - | 결정(2026-09-25): D4를 outbound에도 적용 — httpclient reactive(WebClient·Reactor Netty) 스택과 webflux·reactor 의존 삭제 |
|
||||
| S3-#2a | Required | reactive streaming 요청이 admission·deadline·credential 없이 나감 | 해당 없음(코드 삭제) | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): D `06764fcb`에서 `webclient/ReactiveStreamingGateway` 삭제. blocking 스트리밍은 deadline·credential·admission 적용 `HC/restclient/BlockingStreamingGateway.java:69,82,106` | - | S3-#1에서 reactive를 지우면 함께 삭제, 유지하면 blocking과 같은 credential·admission·deadline 단계 적용 + 동작 테스트 |
|
||||
| S3-#2b | Required | 진입점 6개가 호출 파이프라인을 각자 조립 | 남음 | `CallSetup` 등 공통 조립 없음(grep 0), `DefaultDynamicTargetGateway`·`DefaultReactiveSseGateway`·`BlockingStreamingGateway`·`ReactiveStreamingGateway`가 각자 조립 | W3 | `CallSetup.prepare(lease, operation)`이 metadata/prepared/deadline/admission/credentials 반환, 진입점은 전송만 다르게 |
|
||||
| S3-#3a | Required | 118개 메서드 `RedisCommandGateway`, runtime이 SDK 개념에 역의존 (= G-7) | 남음 | `redis-runtime/.../lettuce/operations/RedisCommandGateway.java`(1,227줄, 메서드 118), `:1107-1134` `sendApprovedRaw/sendAdminDiagnostic/sendExtension`, `lettuce/connection/RedisConnectionKind.java:25-33` BLOCKING·TRANSACTION·PUBSUB lane, `:64` `forCommand(RedisCommandDescriptor)` | W3 | runtime 계약은 semantic adapter가 쓰는 8개(`SemanticRedisCommands`)로, 나머지는 redis-sdk 확장 인터페이스로 이동(redis-sdk 유지 결정 반영), lane은 REGULAR·SCRIPT만 |
|
||||
| S3-#3b | Required | runtime이 `Sdk` 이름·`...redis.sdk` 패키지를 쓰고 redis-sdk와 split package | 남음 | `redis-runtime/.../sdk/config/RedisSdkSettings.java`(670줄), `RedisSdkAutoConfiguration.java`, redis-runtime·redis-sdk 공유 패키지 9개 | W3 | `RedisRuntimeSettings`로 개명, runtime 패키지를 `...redis.runtime.*`로, SDK 전용 설정 섹션은 redis-sdk로 |
|
||||
| S3-#4a | Required | cache-redis에서 "안 보냄/보냈는지 모름" 구분을 rate-limit만 함 | 남음 | `ambiguousExecution()` 사용은 `cache-redis/.../ratelimit/RedisEdgeRateLimitAdapter.java:130`뿐, 멱등성·lease·cache는 lane 거절도 `Indeterminate`(계획 진행 기록 Wave 1 "남은 것"에도 기재) | W2 | 멱등성·lease·cache의 실패 분류에 `metadata().ambiguousExecution()`로 NOT_SENT/AMBIGUOUS 구분 추가 |
|
||||
| S3-#4a | Required | cache-redis에서 "안 보냄/보냈는지 모름" 구분을 rate-limit만 함 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): 멱등성·lease는 NEW-5c 수정. cache는 현황표 근거("lane 거절도 Indeterminate")가 사실과 다름: cache는 이미 lane 거절을 `DEGRADED_UNAVAILABLE`(=안 보냄)로 돌려준다. 빠진 쪽은 반대 방향이었다 — 보낸 뒤 응답을 잃은 쓰기도 `DEGRADED_UNAVAILABLE`였다. `RedisCacheRegionAdapter.java:241,294,314,328`에 `sent` 플래그를 두어 쓰기 명령을 보낸 뒤의 실패는 `INDETERMINATE`, 그 전(lane 거절·연결·generation 조회)은 `DEGRADED_UNAVAILABLE`. 테스트 `RedisCacheRegionAdapterTest.aWriteWhoseReplyWasLostIsIndeterminate`/`anInvalidationWhoseReplyWasLostIsIndeterminate`/`aRegionInvalidationWhoseReplyWasLostIsIndeterminate` FAIL(`expected: INDETERMINATE but was: DEGRADED_UNAVAILABLE`)→PASS, 가드 `aWriteThatFailedBeforeItsSetWasSentDegrades` PASS | - | 멱등성·lease·cache의 실패 분류에 `metadata().ambiguousExecution()`로 NOT_SENT/AMBIGUOUS 구분 추가 |
|
||||
| S3-#4b | Required | "lease 빌림 → `.get(timeout)` → 예외 처리" 틀 복사, Lua 응답 디코더 3벌 | 남음 | `catch (InterruptedException` 16곳(멱등성 6·lease 4·cache 4·rate-limit 1·probe 1), 디코더 `idempotency/IdempotencyScripts.java:273`, `lease/LeaseScripts.java:162`, `ratelimit/RateLimitScripts.java:280` | W3 | `SemanticRedisCall.run(...)` 공통 틀 + 응답 디코딩을 등록 스크립트 쪽 한 곳으로 |
|
||||
| S3-#5 | Consider | `RedisIdempotencyStoreAdapter.transition` 인자 14~15개, 상태 문자열 switch 반복 | 남음 | `cache-redis/.../idempotency/RedisIdempotencyStoreAdapter.java:164-180`(`transition` 호출 14개 인자), `:137-157` 등 문자열 switch | W3 | `IdempotencyScripts.Reply`에서 `enum ScriptStatus`로 한 번 파싱, 호출부는 `Map<ScriptStatus,O>` |
|
||||
| S3-#6 | Consider | 대체 불가능한 확장 지점(`HttpClientTagPolicy` bean) | 남음 | `httpclient/.../autoconfigure/HttpClientObservationAutoConfiguration.java:23-27` bean 소비처 0, `restclient/BlockingExecutionSupport.java:77`이 `HttpClientTagPolicy.standard()`를 다시 생성, `observation/HttpClientTagPolicy.java:32` private 생성자라 override 자체 불가 | W3 | bean 삭제, `BlockingExecutionSupport`는 `ExecutionSupport`로 개명 |
|
||||
@@ -832,7 +844,7 @@
|
||||
| S3-#12a | Nit | `CacheKeys`가 가변 generation 상태 보유, `KeyDigest`가 설정 패키지에 | 남음 | `cache-redis/.../cache/RedisCacheRegionAdapter.java:375,430`(`CacheKeys.observeGeneration`), `capability/RedisKeys.java:37` `KeyDigest` | W5 | `RegionGeneration` 분리, `KeyDigest`를 keyspace 패키지로 옮기고 `RedisNamespace.prefix()` 사용 |
|
||||
| S3-#12b | Nit | cache-redis CLAUDE.md의 "legacy cache router"는 존재하지 않음 | 남음 | `adapter/outbound/cache-redis/CLAUDE.md:22` | W5 | 해당 줄 삭제 |
|
||||
| S3-#13a | Nit | Jackson 2 사용 main 파일은 하나인데 주석은 "two files" | 남음 | `httpclient/build.gradle:67` vs Jackson 2 import는 `restclient/RemoteProblemDecoder.java`뿐 | W5 | `RemoteProblemDecoder`를 Jackson 3로 옮기고 `jackson-databind`(2) 의존 삭제 |
|
||||
| S3-#13b | Nit | draining·retry 소진을 `HttpRateLimitRejectedException`으로 던짐(텔레메트리 카테고리 오기) | 남음 | `httpclient/.../restclient/DefaultGenericHttpGateway.java:182,280`, `webclient/DefaultReactiveHttpGateway.java:265,351` | W2 | draining·retry 소진 전용 예외(또는 카테고리)로 분리 |
|
||||
| S3-#13b | Nit | draining·retry 소진을 `HttpRateLimitRejectedException`으로 던짐(텔레메트리 카테고리 오기) | 완료 | Wave 1–2 P11 (fcddab7e·Wave 2 커밋): `DefaultGenericHttpGatewayTest.anExhaustedRetryBudgetIsReportedAsItsOwnFailureNotARateLimit`·`aRetryRefusedByADrainingRuntimeIsReportedAsItsOwnFailureNotARateLimit` FAIL(`expected HttpRetryBudgetExhaustedException/HttpRuntimeDrainingException but was HttpRateLimitRejectedException`)→PASS. `HC/restclient/DefaultGenericHttpGateway.java:183,281`, 새 타입 `HC/api/error/HttpRetryBudgetExhaustedException.java`·`HttpRuntimeDrainingException.java`, `docs/httpclient/operations.md` 예외 표 갱신. 두 경로는 재시도 판정과 다음 attempt 사이의 경합에서만 도달하므로 테스트는 `TestGateways.forProfile(profile, transport, eligibility)`로 판정기를 주입해 재현 | - | draining·retry 소진 전용 예외(또는 카테고리)로 분리 |
|
||||
| S3-#13c | Nit | Redis health indicator 둘이 DOWN 값만 다름 | 남음 | `redis-runtime/.../sdk/config/RedisSdkAutoConfiguration.java:257`(DEGRADED)·`:285`(DOWN) | W5 | 상태 값만 인자로 받는 indicator 하나로 |
|
||||
| S3-lead-1 | 권고 | `RedisSecretSource` + `System.getenv` 기본값 vs `SecretSourcePort` (= X2 P1-1) | 완료 | 문제 아님: redis-runtime은 의존 edge가 없어 자체 SPI(`RedisSdkAutoConfiguration.java:168-171,334`)를 두고, cache-redis가 `SecretSourcePort`로 bridge(`cache-redis/.../capability/RedisCapabilityConfig.java:66`). X2 P1-1이 이 구조를 모범 사례로 판정 | - | - |
|
||||
| S3-lead-2 | 권고 | `HttpClientEnvironmentKeys`(리플렉션 env 이름 역산) vs `StrictSettingsBinder` (= X2 P1-3) | 남음 | `httpclient/.../autoconfigure/HttpClientEnvironmentKeys.java`(179줄, `RecordComponent` 순회), `HttpClientPlatformSettingsBinder.java:27`만 사용. 다른 capability는 env 오타 검사 없음 | W3 | env 이름 역산 검사를 support `StrictSettingsBinder` 옵션으로 옮겨 모든 capability가 같은 방식으로 오타 env를 거부 |
|
||||
@@ -859,10 +871,10 @@
|
||||
|---|---|---|---|---|---|---|
|
||||
| S4-#1 | Required | fileserver 루트 publication 제품군(R1+R2, 31파일 8.7k줄) 호출처 없음 (= X1-8) | 완료 | `src/adapter/outbound/fileserver/src/main/java/.../fileserver/` 아래 `platform/`만 남음(main 5,626줄). `FilePublicationPort`·`FileExportPort`·`FileserverActivationValidator`·`app.file-export.*` grep 0건. 「제거된 코드」 표 76–78행, 커밋 `6d27356e` | - | - |
|
||||
| S4-#2 | Required | messaging R1 compiler/encoder 체인·realtime fanout 미연결 | 완료 | `src/adapter/outbound/messaging` main 13파일 765줄(`core`·`outbox`·`platformbridge`·`autoconfigure`만). NetworkNT는 `build.gradle`에 `testImplementation`만. `JsonSchemaIntegrationEventEncoder`·`CompiledMessagingDescriptor`·`MessagingDurableFanoutAdapter` grep 0건. 「제거된 코드」 표 119–122행과 `realtime/` 행, `6d27356e` | - | - |
|
||||
| S4-#3a | Required | notification 미조립 provider 5종(APNs·FCM·Twilio·WebPush·Webhook) | 남음 | `notification/…/platform/provider/{apns,fcm,twilio,webpush,webhook}` 재측정 2,750줄(327+526+681+863+353). 자기 패키지 밖 main 참조 0건. assembler는 `SesProviderRuntimeAssembler.java:28`, `SmtpProviderRuntimeAssembler.java:48` 두 개뿐. `ProviderType.java:22-41`에 7종이 남아 있고, 켜면 `NotificationProviderAssembly.java:144`에서 기동 실패. 계획서 W4 표는 "미조립 provider 5종 삭제"라고 했지만 코드도 「제거된 코드」 표 행도 없음 | W3 | 5개 패키지 삭제. `ProviderType`에서 APNS·FCM·TWILIO·WEB_PUSH·WEBHOOK 제거. `docs/notification/configuration-reference.md:69,106-114` 표 정리. 「제거된 코드」 표에 행 추가 |
|
||||
| S4-#3b | Required | SES callback은 조립되는데 projector 없음 → 모든 callback 이벤트가 `NO_PROJECTOR`로 실패 처리 | 남음 | main에 `ProviderEventProjector` bean이 0개임. `NotificationPlatformRegistriesConfig.java:36-40`는 빈 `List<ProviderEventProjector>`로 registry를 만듦. `NotificationProviderAssembly.java:175`가 모은 `AssembledPlatform.projectors`를 읽는 곳 0건. 그래서 `ProviderEventProjectionService.java:80-82`가 `markFailed(…, "NO_PROJECTOR")` 처리. `SesDeliveryProjector`·`SesSuppressionUpdater` main 참조 0건인데 `SesProviderCallbackAssembler.java:13`은 조립됨 | W2 | SES callback assembler가 `SesDeliveryProjector`를 `AssembledProvider`에 싣고, registry는 `AssembledPlatform.projectors()`로 만든다. suppression을 적용하려면 `SesSuppressionUpdater`도 연결. SES callback이 bounce를 반영하는지 통합 테스트 1개 추가 |
|
||||
| S4-#3a | Required | notification 미조립 provider 5종(APNs·FCM·Twilio·WebPush·Webhook) | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): D 커밋 `38d31b98`. `provider/{apns,fcm,twilio,webpush,webhook}` main·test 삭제, `SesSuppressionUpdater` 삭제. `ProviderType`은 SES·SMTP만(`ntf-adapter/autoconfigure/ProviderType.java:26-30`). 5종만 쓰던 설정 필드 `topic`·`vapid-public-key`·`callback-signing-secret-ref` 삭제(`NotificationPlatformSettings.java` Provider), `SecretPurpose.VAPID_SIGNING`·`vapid-signing-key`·env 키 2개(`APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY`, `_KEY_ID`)를 `notification.yml`·`.env.example`·`env-keys.yaml`·`secrets-classification.yaml`·`scripts/run-compose-runtime-smoke.sh`에서 삭제. 문서: `docs/notification/{configuration-reference,support-matrix,module-mapping,provider-runbooks}.md`, `composition/notification-platform/README.md`. 새 테스트 `NotificationPlatformSettingsTest.aRemovedProviderTypeFailsStartupAsUnknown`(5종 → "unknown provider type"). API surface 416→379 재승인. `verifyEnvKeys` OK | - | 5개 패키지 삭제. `ProviderType`에서 APNS·FCM·TWILIO·WEB_PUSH·WEBHOOK 제거. `docs/notification/configuration-reference.md:69,106-114` 표 정리. 「제거된 코드」 표에 행 추가 |
|
||||
| S4-#3b | Required | SES callback은 조립되는데 projector 없음 → 모든 callback 이벤트가 `NO_PROJECTOR`로 실패 처리 | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): `NotificationProviderAssemblyTest.anSesHardBounceIsProjectedRatherThanFailedForWantOfAProjector` FAIL(컴파일: `providerEventProjectorRegistry(AssembledPlatform, List)` 없음 — registry가 빈 bean 목록으로만 만들어지던 구조)→PASS(hard bounce → `DeliveryOutcome.BOUNCED`). 빈 슬롯 유지·연결: `ProviderCallbackAssembler.projector()` 추가, SES는 `SesDeliveryProjector`(`SesProviderCallbackAssembler.java:34`), assembly가 콜백을 만들 때 projector를 `AssembledPlatform.projectors`에 넣음(`NotificationProviderAssembly.java:134`, INGEST_ONLY 포함), registry는 `platform.projectors()` + 선언된 bean(`NotificationPlatformRegistriesConfig.java:46`). `SesSuppressionUpdater`는 소유자 승인 삭제(D)라 연결하지 않았다 — suppression은 `ProviderEventProjectionService`의 `NotificationSideEffectPort` 경로가 이미 처리 | - | SES callback assembler가 `SesDeliveryProjector`를 `AssembledProvider`에 싣고, registry는 `AssembledPlatform.projectors()`로 만든다. suppression을 적용하려면 `SesSuppressionUpdater`도 연결. SES callback이 bounce를 반영하는지 통합 테스트 1개 추가 |
|
||||
| S4-#3c | Required | reconciliation 슬롯·자격증명 회전 경로에 production 입력 없음 | 남음 | `TwilioReconciliationCapability`·`ProviderRuntimeRotator` main 참조 0건. `RuntimeDrainCoordinator`·`CredentialProbe`는 `ProviderRuntimeRotator`만 참조하고 `CredentialProbe` 구현체는 0개. `NotificationPlatformProviderConfig.java:148`이 항상 빈 `reconciliations`로 gateway를 만듦. 두 assembler 모두 `AssembledProvider.dispatchOnly`(`SesProviderRuntimeAssembler.java:98`, `SmtpProviderRuntimeAssembler.java:112`) | W3 | `ProviderRuntimeRotator`·`RuntimeDrainCoordinator`·`CredentialProbe` 삭제. reconciliation 슬롯은 #3a와 함께 지우거나, 남길 경우 README에 "SES/SMTP는 reconciliation 없음" 한 줄 |
|
||||
| S4-#4a | Required | SMTP capability 값이 두 곳에서 다름 | 남음 | `SmtpProviderRuntimeAssembler.java:126,138-152`: 자기 사본 `25L*1024*1024`(26,214,400), `Duration.ofHours(24)`. `SmtpNotificationProviderAdapter.java:75-76`: 25,000,000, `Duration.ofDays(1)`. SES는 `adapter.capabilities()`를 씀(`SesProviderRuntimeAssembler.java:95`) | W2 | assembler의 `capabilities()` 사본을 지우고 `adapter.capabilities()`를 쓴다. 값 하나로 확정 |
|
||||
| S4-#4a | Required | SMTP capability 값이 두 곳에서 다름 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `SmtpProviderRuntimeAssemblerTest.theAssembledProfileDeclaresTheAdaptersOwnCapabilities` FAIL(`maxPayloadBytes=26214400` vs `25000000`)→PASS. assembler에 있던 capability 사본 `capabilities()`를 지우고, snapshot이 SES처럼 `adapter.capabilities()`를 쓴다: `src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/autoconfigure/SmtpProviderRuntimeAssembler.java:108,115-134`. 값은 어댑터 쪽(25,000,000 B, 1일) 하나로 정했다. P3가 바꾼 테스트 `profile()` 줄은 건드리지 않았다. 커밋 `3a39b6b5` | - | assembler의 `capabilities()` 사본을 지우고 `adapter.capabilities()`를 쓴다. 값 하나로 확정 |
|
||||
| S4-#4b | Required | `ProviderCapabilities` 위치 인자 11개를 8곳에서 `new` | 남음 | `application-notification/…/provider/ProviderCapabilities.java:12-23`(boolean 8개 + int·long·Duration). main에서 `new ProviderCapabilities(` 8곳(SMTP assembler, SMTP·SES·APNs·FCM·Twilio·WebPush·Webhook adapter). #3a를 하면 3곳이 남음 | W3 | #3a 이후 `ProviderCapabilities.dispatchOnly(maxPayloadBytes, maxTtl)` 같은 named factory 하나 추가 |
|
||||
| S4-#5 | Required | `LocalPersistentControlPlane`(1,470줄)이 7가지 일을 함 | 해당 없음(코드 삭제) | S4-#1과 함께 삭제. `LocalPersistentControlPlane` grep 0건. 「제거된 코드」 표 76행 | - | - |
|
||||
| S4-#6 | Required | "attested root 아래 private shard" 구현 3벌 | 해당 없음(코드 삭제) | `LocalPersistentControlPlane`·`LocalPersistentPayloadOperations`·`LocalPersistentRootAttestor`·`LocalPublicationJournal`·`LocalFilePublicationAdapter` 모두 grep 0건. 남은 `forceDirectory`는 `platform/local/ContentPublishVerification.java:106` 하나. 「제거된 코드」 표 76행 | - | - |
|
||||
@@ -874,7 +886,7 @@
|
||||
| S4-#11b | Consider | objectstorage 패키지 위치 불명확(port 구현이 `config/`에, managed publish가 router inline) (≈ D-7, D-8) | 남음 | `config/`에 `Routing{Mutation,Read,ScanMaintenance,DirectGrant}Adapter`. `RoutingObjectMutationAdapter.java` 523줄은 `208077fd` 이후 변경 없음. `RoutingObjectDirectGrantAdapter.java:7-9`는 private 생성자만 있는 빈 클래스 | W3 | `Routing*Adapter`를 `routing/`로 옮기고, managed publish 부분을 `kernel/`로 추출. 빈 `RoutingObjectDirectGrantAdapter` 삭제 |
|
||||
| S4-#12 | Consider | `SelectedObjectStorageProviderFactory`가 type-unsafe service locator (≈ D-7) | 남음 | `config/SelectedObjectStorageProviderFactory.java:14-16`에 `Object` 슬롯 3개, `:20-53`에 생성자 4개, `:71-89`에 `Class<T>.cast`. 슬롯 getter 호출은 test(`S3ProviderCompositionTest.java:132,140`)뿐. direct(1,735줄)·multipart(318줄) 패키지는 남아 있음 | W3 | direct/multipart 슬롯 제거 후 `record ProviderInstance(ObjectStorageProvider, ObjectControlStore, Runnable close)`로 교체. direct/multipart 삭제(1차 D-7)와 같이 진행 |
|
||||
| S4-#13 | Consider | provider 1개인데 fileserver R2 routing 계층 | 해당 없음(코드 삭제) | `RoutingFilePublicationAdapter`·`FilePublicationProvider`·`LocalPersistentPublicationProvider` grep 0건. 「제거된 코드」 표 76행 | - | - |
|
||||
| S4-#14a | Consider | `ProviderRuntime`의 무조건 덮어쓰기가 운영자 결정·인증 실패를 지움 | 남음 | `ProviderRuntime.java:127-132`의 `markAuthenticationFailed`가 무조건 `set`해서 DISABLED·DRAINING을 덮어씀. 반대로 `markDraining`·`markDisabled`(`:221-245`)는 AUTHENTICATION_FAILED를 덮어씀. 그래서 AUTH_FAILED→DISABLED→`resumeHealthy`(`:205`)→HEALTHY 순서로 "인증 실패는 resume 불가" 규칙이 우회됨 | W2 | 전이 규칙을 한 곳에 둔다. AUTH_FAILED는 rotation으로만 벗어나고, DISABLED/DRAINING은 인증 실패로 덮이지 않게. 두 순서에 대한 테스트 추가 |
|
||||
| S4-#14a | Consider | `ProviderRuntime`의 무조건 덮어쓰기가 운영자 결정·인증 실패를 지움 | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): `ProviderRuntimeStateTest.anOperatorStateDoesNotLetResumeClearAnAuthenticationFailure`(DISABLED·DRAINING) FAIL→PASS. `aLateAuthenticationFailureDoesNotOverwriteAnOperatorState`(DISABLED·DRAINING) FAIL(`expected DISABLED but was AUTHENTICATION_FAILED`)→PASS. 전이 규칙은 `ProviderRuntime.moveTo` 한 곳에 있다(`src/adapter/outbound/notification/src/main/java/dev/caskeleton/adapter/outbound/notification/platform/dispatch/ProviderRuntime.java:229-255`). AUTH_FAILED는 rotation(새 runtime)으로만 벗어나고, DISABLED/DRAINING은 인증 실패로 덮이지 않는다. `markAuthenticationFailed`가 이제 적용 여부를 boolean으로 돌려준다. `RegistryProviderRuntimeControl.java:36`은 그 값을 그대로 반환한다(전에는 항상 true). notification API surface(type 목록)는 바뀌지 않았다(`verifyNotificationApiSurface` 통과). 커밋 `3a39b6b5` | - | 전이 규칙을 한 곳에 둔다. AUTH_FAILED는 rotation으로만 벗어나고, DISABLED/DRAINING은 인증 실패로 덮이지 않게. 두 순서에 대한 테스트 추가 |
|
||||
| S4-#14b | Consider | 상태 전이 규칙이 7개 메서드에 흩어짐 | 남음 | `ProviderRuntime.java:127-245`에 `mark*`/`resumeHealthy` 7개가 각자 `updateAndGet` 조건을 가짐. `RegistryProviderRuntimeControl.java:30` switch | W3 | `EnumMap<ProviderRuntimeState, Set<ProviderRuntimeState>>` 전이표 + `transition(target, reason)` 하나로 (#14a와 같이) |
|
||||
| S4-#15 | Consider | Settings가 모든 provider 필드를 한 record에 담음 | 남음 | `NotificationPlatformSettings.java:211-223`의 `Provider`가 `topic`·`vapidPublicKey`·`callbackSigningSecretRef`를 가짐(APNs·WebPush·Twilio 전용). `:288`은 `switch (resolved.name())` 문자열 분기. `:229-258`은 테스트 호환용 11-인자 오버로드 | W3 | #3a와 함께 미조립 provider 필드·분기 삭제, enum switch로 바꾸고 11-인자 오버로드 삭제 |
|
||||
| S4-#16a | Nit | notification·fileserver 이력 서술 주석 | 남음 | 예: `ProviderType.java:10-15`, `:85`("used to bind successfully"), `NotificationProviderAssembly.java:30`, `MapProviderCallbackAdapterRegistry.java:10-11`(BOOT-017). grep 근사로 notification 37줄, fileserver 12줄 | W5 | 주석을 현재 동작만 설명하도록 줄이고, 이력은 commit/ADR로 |
|
||||
@@ -900,7 +912,7 @@
|
||||
| S5-#4e | Required | 로깅 `RequestLoggingFilter` vs `WebAccessLog*`/`WebAudit*` (= I-8) | 완료 | `web/observability/`에 `WebAccessLog*`·`WebAudit*` 없음. 표 95행 | - | - |
|
||||
| S5-#4f | Required | 동시 실행 제한 semaphore 3벌 (= I-8) | 완료 | `SemaphoreAdmissionController`(admission)·`BlockingBridgeBudget` 삭제(표 101행, blocking bridge 행). 남은 건 opt-in `web-advanced/…/virtualthread/VirtualThreadAdmissionGuard.java` 하나 | - | - |
|
||||
| S5-#5 | Required | Retry-After 초 계산 3벌, 결과가 다름 | 해당 없음(코드 삭제) | `ThrottleProblemWriter`·`OperationHttpController`·`ReactiveOperationHttpController` 삭제. Duration→초 계산은 `RateLimitInterceptor.java:107-111`(올림) 하나만 남음 | - | - |
|
||||
| S5-#6a | Required | GraphQL 요청 단계 에러가 `GraphQlWireErrorMapper`를 거치지 않음 → adopter `ApiErrorCarrier`가 요청 단계에서 `INTERNAL_ERROR`로 바뀜 | 남음 | `graphql/…/runtime/GraphQlPlatformWebInterceptor.java:165`, `GraphQlPlatformInstrumentation.java:88`이 `GraphQlPlatformRejectionMapper.map`을 직접 호출. `GraphQlWireErrorMapper.java:23-28` Javadoc도 이 차이를 인정 | W2 | 두 호출부가 `GraphQlWireErrorMapper`의 `map(Throwable, ctx)` 하나(플랫폼 거부 → `ApiErrorCarrier` → application mapping 순서)를 쓰게 한다. principal resolver가 `ApiErrorCarrier`를 던지는 테스트 추가 |
|
||||
| S5-#6a | Required | GraphQL 요청 단계 에러가 `GraphQlWireErrorMapper`를 거치지 않음 → adopter `ApiErrorCarrier`가 요청 단계에서 `INTERNAL_ERROR`로 바뀜 | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): `runtime/GraphQlRequestStageErrorMappingTest.anApiErrorCarrierFromThePrincipalResolverKeepsItsCode`, `anApiErrorCarrierFromAPipelineStageKeepsItsCode` FAIL(`expected "TENANT_SUSPENDED" but was "INTERNAL_ERROR"`) → PASS. 두 테스트 모두 auto-configuration이 만든 bean으로 돌려 "세 곳이 mapper bean을 받는다"를 검증. `GraphQlWireErrorMapper.map(Throwable, ctx)`(플랫폼 거부 → ApiErrorCarrier → application 매핑) + `toGraphQlError`(carrier는 category로 classification) 하나로 interceptor·instrumentation·field resolver가 모두 이것을 씀. `.../runtime/GraphQlWireErrorMapper.java:61,79`, `GraphQlPlatformWebInterceptor.java:168`, `GraphQlPlatformInstrumentation.java:89`, `GraphQlDataFetcherExceptionResolver`, 주입 `GraphQlPlatformAutoConfiguration.java:357,413`. 호출자가 없어진 `GraphQlPlatformRejectionMapper.map` 삭제. 커밋 `aa5f4d90` | - | 두 호출부가 `GraphQlWireErrorMapper`의 `map(Throwable, ctx)` 하나(플랫폼 거부 → `ApiErrorCarrier` → application mapping 순서)를 쓰게 한다. principal resolver가 `ApiErrorCarrier`를 던지는 테스트 추가 |
|
||||
| S5-#6b | Required | 호출처 0인 `mapRequestRejection`과 참조 0인 error 클래스 | 완료 | `mapRequestRejection`·`GraphQlRequestErrorMapper`·`GraphQlSubscriptionExceptionResolver`·`GraphQlNullabilityContract` grep 0건. 표 "`GraphQlWireErrorMapper.mapRequestRejection`" 행과 `error/` 행 | - | - |
|
||||
| S5-#6c | Required | Category switch 3개와 client 문구 중복 | 남음 | `GraphQlWireErrorMapper.java:94`(category), `:104`(clientMessage), `GraphQlWireErrors.java:56`. "요청한 리소스를 찾을 수 없습니다." 3곳(`GraphQlWireErrorMapper.java:108`, `GraphQlPlatformRejectionMapper.java:69`, `security/GraphQlAuthorizationInterceptor.java:50`) | W3 | `EnumMap<Category, Rendering(wireCategory, message, classification)>` 표 하나로 switch 3개를 대체하고 문구 상수를 한 곳에 둔다 |
|
||||
| S5-#6d | Required | 플랫폼 예외 `instanceof` 사슬 9개, 실제 매퍼가 `runtime/`에 있음 | 남음 | `GraphQlPlatformRejectionMapper.java:55-114`에 instanceof 9개. `GraphQlWireErrorMapper`·`GraphQlPlatformRejectionMapper`·`GraphQlWireErrors`가 `runtime/`에 있음(`error/`에는 타입만) | W3 | 플랫폼 예외가 code·category·message 인터페이스를 구현하게 해 instanceof 사슬을 없애고, 매퍼 3개를 `error/`로 옮긴다 |
|
||||
@@ -920,7 +932,7 @@
|
||||
| S5-#14e | Nit | `GraphQlPlatformWebInterceptor` 생성자 인자 9개 | 남음 | `GraphQlPlatformWebInterceptor.java:66-75`. anonymous 관련 3개(`anonymousProfile`, `anonymousTenant`, `anonymousProfileProtected`) | W5 | anonymous 3값을 record 하나로 묶는다 |
|
||||
| S5-lead-1 | 권고 | client 에러 문구 언어가 전송마다 다름(web 영어, graphql 한국어) (= X2-P2-1) | 남음 | web `error/ClientSafeErrorMessages.java:44-50` 영어, graphql `GraphQlWireErrorMapper.java:104-113` 한국어. gRPC `GrpcStatusMapper.java:33`은 status만 매핑(문구 없음). status/분류 매핑은 전송마다 달라서 공유할 수 없음 | W3 | 결정(2026-09-25): client 에러 문구는 한국어 — `Category`별 문구 표 하나를 shared-contract에 두고 모든 전송이 사용 |
|
||||
| S5-lead-2 | 권고 | moduleboundary 세 번째 사본(websocket) | 해당 없음(코드 삭제) | `WebSocketStableModule`·`WebSocketBuildModel` 0건. 표 80행 | - | - |
|
||||
| S5-lead-3 | 권고 | request/tenant context 타입이 전송마다 따로 있음 (= X2-P2-6) | 남음 | 이름이 같은 `TenantContext` 두 개의 모양·검증이 다름. web `core/TenantContext.java:17,20`은 `(String tenantId)`, `[A-Za-z0-9][A-Za-z0-9_.-]{0,63}`. graphql `context/TenantContext.java:15,17,30`은 `(value, source)`, 비어 있지 않고 128자 이하면 모두 허용. 같은 tenant가 한 전송은 통과하고 다른 전송은 거부됨 | W2 | tenant 값 타입 하나(검증 규칙 하나)를 application-core/shared-contract에 두고, 두 전송 context가 그것을 담게 한다 |
|
||||
| S5-lead-3 | 권고 | request/tenant context 타입이 전송마다 따로 있음 (= X2-P2-6) | 남음 | 이름이 같은 `TenantContext` 두 개의 모양·검증이 다름. web `core/TenantContext.java:17,20`은 `(String tenantId)`, `[A-Za-z0-9][A-Za-z0-9_.-]{0,63}`. graphql `context/TenantContext.java:15,17,30`은 `(value, source)`, 비어 있지 않고 128자 이하면 모두 허용. 같은 tenant가 한 전송은 통과하고 다른 전송은 거부됨<br>Wave 1–2 P8: 미완 — 이유: 공통 tenant 값 타입(shared-contract/application-core)을 만들고 web·graphql(그리고 messaging·persistence·notification의 tenant 타입)이 담게 하는 일은 계획서 Wave 3 3-D 「tenant 값 타입」 공통 작업이고 web은 P10 범위. 이번에는 증상만 막음: GraphQL `TenantContext` 검증을 web과 같은 문법 `[A-Za-z0-9][A-Za-z0-9_.-]{0,63}`으로 맞춰 "한 전송만 통과하는 tenant"를 없앰. `context/GraphQlRequestContextTest.aTenantTheWebTransportRefusesIsRefusedHereToo`(4건) FAIL(`Expecting actual not to be null`) → PASS. `.../context/TenantContext.java:38`. 커밋 `aa5f4d90` | W2 | tenant 값 타입 하나(검증 규칙 하나)를 application-core/shared-contract에 두고, 두 전송 context가 그것을 담게 한다 |
|
||||
| S5-lead-4 | 권고 | release/promotion gate가 websocket/grpc에도 반복되는지 | 남음 | web·graphql·websocket gate는 삭제(표 80·114·115행, web Advanced release 행). grpc에 남음: `grpc/grpc-testkit/…/release/GrpcStableReleaseGate.java`, `grpc-advanced/grpc-advanced-bootstrap/…/release/GrpcAdvancedPromotionGate.java`. 둘 다 main 참조 0건(test만) | W3 | 두 gate와 테스트를 삭제하거나 test source set으로 옮긴다(S6/S7 grpc 항목과 같이) |
|
||||
| S5-lead-5 | 권고 | bulkhead: graphql·fileserver·httpclient가 겹치는지 | 해당 없음(코드 삭제) | 겹치던 web `BlockingBridgeBudget`·`SemaphoreAdmissionController`는 삭제. 남은 3개는 방식이 다름: `GraphQlBlockingBridge.java:45-57`(bounded `ThreadPoolExecutor`+AbortPolicy), `BlockingTransferExecutor.java:26`(Spring `ThreadPoolTaskExecutor`), `BlockingAttemptBulkhead.java:39`(`Semaphore`). 각 100줄 이하 | - | - |
|
||||
|
||||
@@ -941,11 +953,11 @@
|
||||
| S6-#1b | Required | websocket main의 gate·moduleboundary·evidence·release, 거짓 주석 `WebSocketAdvancedCapability` | 해당 없음(코드 삭제) | `CS:80`, `CS:185` | - | - |
|
||||
| S6-#1c | Required | 조립되지 않는 websocket 플랫폼 라이브러리 약 9.7k줄 | 완료 | main 12,954 → 1,557줄(`stomp/` 491, `servlet`·`outbound`·`budget`·`core`·`protocol` 1,066). 나머지 패키지 삭제(`CS:185,187`). 남긴 라이브러리는 Wave 3 결정대로 README에 라이브러리 API로 명시(`src/adapter/inbound/websocket/README.md:6-13,56`), `6d27356e` | - | - |
|
||||
| S6-#2a | Required | capability 의존 규칙이 6곳(CDV, DSR, `RedisActivationValidator`, ORBRV, `MasterSwitch`, endpoint)에 흩어짐 (= L-6) | 해당 없음(코드 삭제) | `CS:237`(DSR), `CS:241`(ORBRV), `CS:248`(`MasterSwitch`), `CS:249`(CDV·endpoint), `CS:252`(RAV). capability 의존은 build 줄로 표현(`src/app-bootstrap/build.gradle:139-153`) | - | - |
|
||||
| S6-#2b | Required | `ca-skeleton.outbox.relay-enabled` 없을 때 기본값 해석이 여전히 갈림 | 남음 | 모듈 yml `false`(`src/adapter/outbound/persistence-jpa/src/main/resources/config/module-defaults/persistence-jpa.yml:189`) vs `matchIfMissing = true`(`BS/autoconfigure/outbox/OutboxConfig.java:69-72`) vs null이면 `true`(`BS/autoconfigure/outbox/OutboxSettings.java:34-36`). yml이 항상 먼저 채워 실제 동작은 false | W2 | relay 조립을 `composition:*` 모듈로 옮길 때(소유자 결정) 기본값을 `false` 하나로: `matchIfMissing` 삭제, `OutboxSettings` null 기본값을 `false`로 |
|
||||
| S6-#2b | Required | `ca-skeleton.outbox.relay-enabled` 없을 때 기본값 해석이 여전히 갈림 | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): 기본값 불일치만 수정(조립 위치 이동은 X1-#1i, Wave 3 3-C). `OutboxSettingsTest.bindsAllSixDefaultsWhenFieldsAreNull` FAIL("Expecting value to be false but was true") → PASS, `OutboxConfigTest.withoutTheRelayKeyTheRelaySchedulerIsNotAssembled` FAIL(scheduler 조립됨) → PASS. `matchIfMissing` 삭제(`src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/outbox/OutboxConfig.java:69`), null 기본값 false(`OutboxSettings.java:37`), `src/app-bootstrap/README.md` 문구 | - | relay 조립을 `composition:*` 모듈로 옮길 때(소유자 결정) 기본값을 `false` 하나로: `matchIfMissing` 삭제, `OutboxSettings` null 기본값을 `false`로 |
|
||||
| S6-#2c | Required | Redis 역할 표 2벌, bootstrap이 Redis 역할별 prod secret 규칙을 앎 | 남음 | `RedisCorrectnessRoles.java:32-37`(redis-runtime) vs `BS/runtime/SecretSourceValidator.java:137-158`(prefix 분기) + 모듈 키 사본 `REDIS_ENABLED_PROPERTY`(`:31`), secret 목록 `:38-48` | W3 | Redis secret 요구 판정을 cache-redis 모듈로 옮기고 `RedisCorrectnessRoles` 표에서 파생; `SecretSourceValidator`는 모듈이 기여한 필요 secret 목록만 검사 |
|
||||
| S6-#2d | Required | `capabilities.idempotency.provider` 기본값이 `disabled`/`jdbc`로 갈림 | 완료 | 모두 `disabled`: `BS/runtime/SecretSourceValidator.java:151`, `BS/autoconfigure/idempotency/IdempotencyProviderSelectionConfig.java:34`, `SP/bootstrap/idempotency/SampleIdempotencyConfig.java:34`; `jdbc` 값 main 0건, `6d27356e` | - | - |
|
||||
| S6-#3a | Required | startup validator가 3 lifecycle·여러 패키지에 흩어짐, `StartupRule` 목록 없음 | 남음 | 19 → 16개: bootstrap 7(`BS/runtime/*Validator` 5, `OutboxCanonicalTransportRequirementValidator`, `TracingSamplingEnvironmentPostProcessor`), persistence-jpa 8(`JS/*Validator` 7, `JpaActivationEnvironmentPostProcessor`), cache-redis 1(`RedisReadinessGroupPostProcessor`). EPP 4, `InitializingBean` 1, `SmartInitializingSingleton` 11. `StartupRule` 타입 없음 | W3 | 모듈마다 `StartupRule { List<String> violations(Environment) }` 목록 + runner 1개; bean이 필요한 검사만 bean으로 |
|
||||
| S6-#3b | Required | OSIV 검사 2벌, 뒤 검사의 local 예외는 죽은 코드 | 남음 | `JS/OpenInViewSafetyValidator.java:26-38`(모든 profile 거부) vs `JS/JpaDangerousConfigurationGuard.java:51-52`(local-convenience 허용). 둘 다 무조건 등록(`JS/JpaStartupAutoConfiguration.java:71-74,117-127`) | W2 | 하나로: local 예외를 정책으로 쓸지 정해 `OpenInViewSafetyValidator`를 삭제하거나 guard의 OSIV 분기를 삭제 |
|
||||
| S6-#3b | Required | OSIV 검사 2벌, 뒤 검사의 local 예외는 죽은 코드 | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 행동 보존 정리(FAIL→PASS 대상 아님): `OpenInViewSafetyValidator`(모든 profile 거부)를 정본으로 두고 `JpaDangerousConfigurationGuard`의 OSIV 분기·`OPEN_IN_VIEW_KEY` 삭제(`.../startup/JpaDangerousConfigurationGuard.java`), `JpaPlatformReport`는 validator 상수 사용. `OpenInViewSafetyValidatorTest.openInViewTrueFailsStartupUnderALocalConvenienceProfileToo` 추가(수정 전후 모두 PASS = guard의 local 예외가 죽은 코드였다는 증거). guard 테스트는 ddl-auto만 검사하도록 재작성. 학습 문서 `docs/study/postgresql-jpa-walkthrough.ko.md` 표 갱신 | - | 하나로: local 예외를 정책으로 쓸지 정해 `OpenInViewSafetyValidator`를 삭제하거나 guard의 OSIV 분기를 삭제 |
|
||||
| S6-#3c | Required | ddl-auto 검사 2벌 | 남음 | `JS/JpaSchemaSafetyValidator.java:28-50`(prod) vs `JS/JpaDangerousConfigurationGuard.java:62-65`(non-local, prod 포함) | W3 | guard 한 곳으로 합치고 `JpaSchemaSafetyValidator` 삭제 |
|
||||
| S6-#3d | Required | `isProdActive()` 5곳 복사 | 남음 | `JS/FlywayProdSafetyValidator.java:57`, `JS/JpaSchemaSafetyValidator.java:51`, `JS/PersistenceVendorProdSafetyValidator.java:81`, `JS/PostgreSqlTransportSecurityValidator.java:86`, `BS/runtime/SecretSourceValidator.java:175`. 본문은 모두 `RuntimeProfileSnapshot.isProduction()` 1줄 위임 | W3 | 1줄 wrapper 삭제하고 호출부에서 직접 호출(S6-#3a와 함께) |
|
||||
| S6-#3e | Required | vocabulary 패키지 `runtime/startup/`에 guard 3개 | 완료 | bootstrap `BS/runtime/startup/`에는 `StartupFailureExceptionReporter`만. 어휘는 `SST/`, Flyway·RequiredEnvironment 검사는 `JS/`로 이동, `6d27356e` | - | - |
|
||||
@@ -953,7 +965,7 @@
|
||||
| S6-#4 | Required | root가 넓게 scan한 뒤 다른 leaf 패키지를 regex로 제외 | 완료 | `BS/CaSkeletonApplication.java` 전체가 `@SpringBootApplication` + bootstrap 패키지 5개 `@ConfigurationPropertiesScan`. regex 삭제(`CS:250`), web은 자기 imports로 공개(`src/adapter/inbound/web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:1`), `6d27356e` | - | - |
|
||||
| S6-#5 | Required | fileserver가 build에서 빠졌는데 스위치·설정이 root에 남음 | 완료 | `dependencyPolicy` 없음, 한 줄 선택(`src/app-bootstrap/build.gradle:152`), 설정은 모듈 소유(`CS:37`, `CS:234`), `MasterSwitch.FILESERVER*` 삭제(`CS:78`), composition 자체 imports(`src/composition/fileserver-platform/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`), `6d27356e` | - | - |
|
||||
| S6-#6a | Required | 멱등성 설정 binder 3개·yml 2개, PG provider 하드코딩 (= X1-#2) | 완료 | settings record 하나 `IdempotencySettings`(`BS/autoconfigure/idempotency/IdempotencySettings.java:24-34`, prefix `ca-skeleton.capabilities.idempotency`), `config/idempotency.yml`·`IdempotencyProviderSettings`·`PostgreSqlIdempotencyProviderConfig` 삭제(`CS:228`), `APP_IDEMPOTENCY_TTL` 한 키(`src/app-bootstrap/src/main/resources/config/capabilities.yml:14`) | - | - |
|
||||
| S6-#6b | Required | `APP_RATE_LIMIT_DEFAULT_POLICY_ID`가 두 키에 바인딩 | 남음 | `src/adapter/outbound/cache-redis/src/main/resources/config/module-defaults/cache-redis.yml:18`(`app.rate-limit.default-policy-id`)와 `:65`(`ca-skeleton.capabilities.rate-limit.default-policy-id`) | W2 | 읽는 쪽 하나만 남기고 다른 키 삭제(sample의 `ca-skeleton.rate-limit.*`는 1차 L-11) |
|
||||
| S6-#6b | Required | `APP_RATE_LIMIT_DEFAULT_POLICY_ID`가 두 키에 바인딩 | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): 두 키 모두 읽히고 있었다(web `EdgeRateLimitTransportSettings`가 `app.rate-limit.*`, cache-redis `RedisRateLimitConfig`가 `ca-skeleton.capabilities.rate-limit.default-policy-id`). 소유자 결정 16(`app.*` 통일)에 맞춰 `app.rate-limit.default-policy-id` 하나만 남김: `cache-redis.yml:65` 줄과 `RedisCapabilitySettings.RateLimit.defaultPolicyId` 삭제, `RedisRateLimitConfig.java:34,60`이 `app.rate-limit.default-policy-id`로 검증. env 키 `APP_RATE_LIMIT_DEFAULT_POLICY_ID`는 그대로(`env-keys.yaml`·`.env.example` 변경 없음). `RedisCapabilityCompositionTest.aDefaultPolicyTheLimiterDoesNotHaveIsRefusedAtStartup` FAIL(`Expecting actual not to be null`)→PASS | - | 읽는 쪽 하나만 남기고 다른 키 삭제(sample의 `ca-skeleton.rate-limit.*`는 1차 L-11) |
|
||||
| S6-#7 | Required | sample이 bootstrap 인프라를 복사, 이미 갈라짐 | 남음 | `SP/bootstrap/{tracing,idempotency,settings,logging,metrics,context,management}` 525줄. `SampleTracingSampleRateResolver.java:23` `"staging" -> 0.10`, `SampleIdempotencyConfig.java:15` "stand-in", `SamplePseudonymizationConfig.java:12` "Sample-local copy" | W3 | 소유자 결정대로 멱등성 executor·outbox relay 조립을 `composition:*` 모듈로 옮겨 두 root가 함께 쓰고, tracing·logging·metrics·context·management는 공용 library leaf로(registry edge 추가), staging 분기 삭제 |
|
||||
| S6-#8 | Required | sample root가 다른 leaf 패키지를 넓게 scan | 남음 | `SP/SamplePortfolioApplication.java:31-60`: `@ComponentScan`·`@ConfigurationPropertiesScan`에 `adapter.inbound.web`, `adapter.outbound.identifier`, `adapter.outbound.objectstorage`, `application`, `domain`, `shared`. JPA만 auto-config로 바뀜 | W3 | scan을 `dev.caskeleton.sample`로 좁히고 web·identifier·objectstorage는 각 leaf auto-config로 받기(보안 설정 2개는 exclude/property로 끔) |
|
||||
| S6-#9 | Required | sample `application.yml` 중 읽는 코드 없는 블록 | 남음 | 326줄 중 약 101줄: `src/sample-portfolio/src/main/resources/application.yml:150-177`(capabilities.cache), `:180-181`(bootstrap), `:210-226`(logging), `:255-279`(app.cache.redis), `:280-283`(messaging), `:284-288`(notification), `:289-308`(outbound.http). sample classpath에 해당 binder 없음(`src/sample-portfolio/build.gradle:48-83`) | W5 | 해당 블록 삭제 |
|
||||
@@ -963,7 +975,7 @@
|
||||
| S6-#10d | Consider | `WorkLogSortField`(domain)가 HTTP 이름과 persistence 이름을 같이 앎 | 남음 | `SP/domain/worklog/WorkLogSortField.java:11-23`(`property` 하나로 `fromRequest` 매칭) | W3 | 요청 이름 매핑은 web mapper로, persistence 이름은 persistence mapper로; domain enum은 논리 필드만 |
|
||||
| S6-#10e | Consider | sample `CLAUDE.md` 경로 틀림, WorkLog만 설명 | 남음 | `src/sample-portfolio/CLAUDE.md:17-22`: `adapter/web`, `adapter/persistence`, `adapter/identifier`(실제 `adapter/inbound/web`, `adapter/outbound/persistence`, `adapter/outbound/identifier`) | W5 | 경로 수정, poster-image 슬라이스 한 줄 추가 |
|
||||
| S6-#11a | Consider | 컨트롤러 `toId()` 4벌, sort 파싱 2벌 | 남음 | `toId`: `WorkLogController.java:239`, `PosterController.java:161`, `LegacyPosterImageController.java:49`, `PosterImagePublicationController.java:110`; sort: `WorkLogController.java:99-113`, `PosterController.java:91-105` (모두 `SP/adapter/inbound/web/controller/`) | W3 | web 어댑터 helper 하나(id 파싱, `SortParam` + enum `fromRequest` 공통 처리) |
|
||||
| S6-#11b | Consider | If-Match를 컨트롤러가 update 전에 get use case로 읽어 비교(트랜잭션 밖) | 남음 | `SP/adapter/inbound/web/controller/WorkLogController.java:162,209-218`; `SP/application/command/UpdateWorkLogCommand.java`에 `expectedVersion` 없음 | W2 | `UpdateWorkLogCommand.expectedVersion` 추가, 비교를 update use case 트랜잭션 안으로 |
|
||||
| S6-#11b | Consider | If-Match를 컨트롤러가 update 전에 get use case로 읽어 비교(트랜잭션 밖) | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): `UpdateWorkLogCommand.expectedVersion`(`OptionalLong`, `sample-portfolio/.../application/command/UpdateWorkLogCommand.java:25`), 비교는 `UpdateWorkLogUseCase` 쓰기 트랜잭션 안(`UpdateWorkLogUseCase.java:43`, 불일치 → 새 `WorkLogVersionMismatchException` → `DomainExceptionHandler`가 412 `PRECONDITION_FAILED`). 컨트롤러는 헤더만 해석(`WorkLogController.java:211`). `WorkLogControllerWireTest.patchWithIfMatchDoesNotReadTheWorkLogOutsideTheUpdate` FAIL(`NoInteractionsWanted … GetWorkLogUseCase`)→PASS, `WorkLogUseCasesTest.staleExpectedVersionIsRefusedInsideTheUpdate`·`currentExpectedVersionAppliesTheUpdate`, `patchHandsTheIfMatchVersionToTheUpdateUseCase`, `patchWithStaleIfMatchReturns412`(유스케이스 예외 경로로 변경) PASS. 동작 변화: 여러 태그를 나열한 `If-Match`(예: `W/"1", W/"2"`)는 이제 읽지 않고 412(`patchWithAListIfMatchIsRefusedAs412`) — 이 리소스는 validator 하나만 내보냄 | - | `UpdateWorkLogCommand.expectedVersion` 추가, 비교를 update use case 트랜잭션 안으로 |
|
||||
| S6-#11c | Consider | sample 테스트가 `TransactionPort` fake를 각자 작성 (= X1-#3 일부) | 완료 | application-core testFixtures `DirectTransactionPort`(`src/application-core/src/testFixtures/java/dev/caskeleton/application/transaction/testkit/DirectTransactionPort.java`), sample 테스트의 인라인 fake 0건, `6d27356e` | - | - |
|
||||
| S6-#12 | Consider | JPA 정책 클래스 겸용, 주입처 없는 bean, 테스트만 쓰는 플래그 | 완료 | `JpaPlatformAutoConfiguration` 삭제·`JpaStartupAutoConfiguration`으로 합침(`CS:238`), `app.jpa-platform.addons-enabled` 삭제(`CS:193`), `jpaDataSourceProfileValidator`가 `jpaResolvedDataSourceCheck`에 주입됨(`JS/JpaStartupAutoConfiguration.java:100,109-110`), `6d27356e` | - | - |
|
||||
| S6-#13 | Consider | 역할 없는 startup 예외 subclass 4개 | 남음 | `SST/{MigrationFailed,ProfileMismatch,RequiredAdapterDisabled,StartupValidation}Exception.java` — bootstrap에서 support로 옮기기만 했고 본문은 `StartupErrorCode`를 부모에 넘기기만 | W3 | `StartupFailureException` 하나 + 테스트는 `errorCode()` 단언; 생성은 `StartupFailures` factory만 |
|
||||
@@ -980,7 +992,7 @@
|
||||
| S6-G3 | 권고 | capability 하나 켜는 표면이 큼(outbox 스위치 5개, yml 19개) | 완료 | bootstrap yml 19개 1,388줄 → 9개 655줄. Outbox+relay = build 줄 2개 + `APP_OUTBOX_ENABLED`·`APP_OUTBOX_RELAY_ENABLED`(`CS:35`), 검증 클래스 1개(`OutboxCanonicalTransportRequirementValidator`); Redis 연결 env는 `src/adapter/outbound/cache-redis/README.md:50`에 문서화 | - | - |
|
||||
| S6-lead-1 | 권고 | gRPC 서버 스택 2개, 둘 다 조립 안 됨 (= X1-#10) | 완료 | `adapter:inbound:grpc`는 자기 imports(`GrpcServerConfig`)로 한 줄 선택(`CS:42`), 플랫폼 `grpc:*`는 별도 build `src/optional-platforms`(`CS:41`). 두 스택 공존은 X1-#10에서 의도로 수용 | - | - |
|
||||
| S6-lead-2 | 권고 | 인라인 `TransactionPort` fake가 저장소 전체에 (= X1-#3) | 남음 | 인라인 fake 24 → 10개 파일: application-core 4(`TransactionPortTest` 포함), application-notification 4, `application-fileserver/.../testkit/DirectTransactions.java`, `composition/fileserver-platform/.../FileserverAssemblyFixture.java`. `DirectTransactionPort` 사용 12개 파일 | W4 | 계약 자체를 검증하는 `TransactionPortTest` 외 9개를 `DirectTransactionPort`로 교체 |
|
||||
| S6-lead-3 | 권고 | 복사용 예제 `CreateWorkLogUseCase`가 `LegacyOutboxAppendPort` 사용 (= X1-#1 append 포트) | 남음 | `SP/application/worklog/CreateWorkLogUseCase.java:7`; canonical `OutboxAppendPort`(`src/application-core/src/main/java/dev/caskeleton/application/outbox/OutboxAppendPort.java:13`) 존재, legacy 포트 Javadoc은 "cutover 창 동안만"(`LegacyOutboxAppendPort.java:3-9`) | W2 | 예제를 `OutboxAppendPort` + `ValidatedIntegrationEvent`로 옮기고 MSG-015 cutover 후 legacy 포트 삭제 |
|
||||
| S6-lead-3 | 권고 | 복사용 예제 `CreateWorkLogUseCase`가 `LegacyOutboxAppendPort` 사용 (= X1-#1 append 포트) | 남음 | `SP/application/worklog/CreateWorkLogUseCase.java:7`; canonical `OutboxAppendPort`(`src/application-core/src/main/java/dev/caskeleton/application/outbox/OutboxAppendPort.java:13`) 존재, legacy 포트 Javadoc은 "cutover 창 동안만"(`LegacyOutboxAppendPort.java:3-9`)<br>Wave 1–2 P1: 미완 — 이유: sample을 `OutboxAppendPort`로 옮기려면 `ValidatedIntegrationEvent`를 만들 encoder가 있어야 하는데 템플릿에 없다(`IntegrationEventEncoderPort` 구현 0). 결정 7(템플릿 JSON encoder 제공 + legacy 포트 삭제)이 Wave 3 3-C 작업. sample의 legacy 포트 사용처 3곳(`CreateWorkLogUseCase`, `PosterEventPublisher`, `PosterImagePublicationEventPublisher`) | W2 | 예제를 `OutboxAppendPort` + `ValidatedIntegrationEvent`로 옮기고 MSG-015 cutover 후 legacy 포트 삭제 |
|
||||
| S6-lead-4 | 권고 | `CS` WIRED=yes vs `dependencyPolicy` 모순, `MasterSwitch`가 없는 capability 나열 | 해당 없음(코드 삭제) | `dependencyPolicy`·`MasterSwitch` 삭제(`CS:248`), WIRED 정의를 "선택하면 조립됨"으로 재정의(`CS:11`, `CS:37`) | - | - |
|
||||
| S6-lead-5 | 권고 | `DefaultUploadApplicationService` 생성자 14개 | 남음 | `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultUploadApplicationService.java` 생성자 인자 14개, 조립 `FileserverUploadServiceConfiguration.java:88` | W3 | 정책 3개(access·filename·upload)와 저장소 2개를 record로 묶거나 업로드 단계별 서비스로 분해 |
|
||||
| S7-#1a | Required | 선택 불가·SDK 없는 messaging leaf(experimental 4, rabbit 2)와 Debezium | 해당 없음(코드 삭제) | `CS:124-130` | - | - |
|
||||
@@ -988,7 +1000,7 @@
|
||||
| S7-#1c | Required | starter가 쓰지 않는 cloudevents·claim-check edge, 바인딩만 되는 `Experimental`·`Bridge` 설정 | 완료 | `CS:131`, `CS:133`; `src/messaging/messaging-spring-boot-starter/build.gradle:20-37`에 두 leaf 없음, `6d27356e` | - | - |
|
||||
| S7-#2 | Required | consume 계약 3개, 조립 0 | 남음 | `MessageHandler.java:14`(main 참조 0), `DefaultDeliveryProcessor.java:40-47`(참조 0), `IdempotentMessageHandler.java:21`; `KafkaConsumerRegistrar`(645줄)·`KafkaBatchConsumerRegistrar`(146줄) main 참조 0, 자동 조립 transport는 발행 전용(`KafkaMessagingTransport.java:89` `KAFKA_CONSUMER_NOT_CONFIGURED`) | W3 | 결정(2026-09-25): Kafka 소비 지원 — `MessageHandler<T>` 하나, starter-kafka가 handler bean이 있으면 consumer 조립, 실제 Kafka lane 테스트 |
|
||||
| S7-#3 | Required | grpc 18 leaf를 9 leaf로 | 남음 | `MJ`에 grpc leaf 18개 그대로. io.grpc import main 파일은 `grpc-policy` 4 + `grpc-server` 1(+testkit 6); `src/grpc/grpc-client/build.gradle:12-13` io.grpc api인데 import 0; 미사용 edge `src/grpc/grpc-codegen/build.gradle:13`, `src/grpc-advanced/grpc-advanced-edition/build.gradle:9-11` | W3 | policy+server+client+discovery+admin → `grpc-runtime`, proto-contract+codegen → `grpc-contract`, advanced 5개 → `grpc-advanced`, 미사용 edge 삭제 |
|
||||
| S7-#4 | Required | gate·guard·catalog 같은 governance를 운영 코드로 (≈ N-9) | 남음 | 전부 존재: `GrpcStableModuleCatalog.java`(79), `GrpcStableBuildInvariant.java`(53), 상수 반환 gate 7종(`GrpcKotlinCompatibilityGate`, `GrpcWebCompatibilityGate`, `GrpcServletStartupValidator`, `GrpcEdition2026Guard`, `GrpcEdition2024Gate`, `GrpcResolverSafetyPolicy`의 상수 메서드, `GrpcXdsStartupGuard`), `GrpcRawApiImportRule`(108)·`GrpcApplicationBoundaryRules`(92), `GrpcAdvancedInfrastructureTestkit`(87). `git diff 208077fd 6d27356e --stat -- src/grpc*`은 Wave 1 1-10 파일만 | W3 | 상수 gate·catalog·invariant·testkit 삭제, import 규칙은 ArchUnit 테스트로 |
|
||||
| S7-#4 | Required | gate·guard·catalog 같은 governance를 운영 코드로 (≈ N-9) | 완료 | Wave 1–2 P5 (fcddab7e·Wave 2 커밋): 삭제 커밋 `9b296c7c`(P5 D). 상수 gate·guard·catalog·invariant·testkit·문자열 ArchUnit 흉내 삭제(아래 「제거된 코드」). 전부 main 호출자 0이었다. `GrpcRawApiImportRule`·`GrpcApplicationBoundaryRules`는 자기 테스트의 합성 입력만 검사하고 저장소 코드를 검사하지 않아서 테스트로 옮기지 않고 삭제했다(inbound→outbound 규칙은 app-bootstrap ArchUnit `INBOUND_ADAPTERS_DO_NOT_DEPEND_ON_OUTBOUND_ADAPTERS`가 이미 검사). `GrpcResolverSafetyPolicy`는 상수 메서드 2개만 삭제. starter의 항상 통과하던 advanced 격리 검사도 함께 제거 `src/grpc/grpc-spring-boot-starter/src/main/java/dev/caskeleton/grpc/boot/GrpcPlatformStartupValidator.java:41`. 문서 갱신: `src/grpc/CLAUDE.md`, `src/grpc-advanced/CLAUDE.md`, `docs/runbooks/grpc-advanced-capabilities.md`, `docs/compatibility/grpc-advanced-support-matrix.md` | - | 상수 gate·catalog·invariant·testkit 삭제, import 규칙은 ArchUnit 테스트로 |
|
||||
| S7-#5a | Required | `messaging-outbox-jdbc-postgresql`의 Debezium 4개 | 해당 없음(코드 삭제) | `CS:130` | - | - |
|
||||
| S7-#5b | Required | 한 leaf가 relay 로직·PG repository·admin journal을 함께 가짐 | 남음 | `src/messaging/messaging-outbox-jdbc-postgresql/src/main/java/dev/caskeleton/messaging/outbox/`: relay 7클래스 877줄, `JdbcOutboxRepository` 721줄, `JdbcAdminOperationJournal` 326줄; Spring JDBC import 파일 2개. inbox는 6개 중 5개가 stdlib | W3 | `messaging-reliability`(stdlib relay·inbox 로직) + `messaging-reliability-jdbc-postgresql`(Jdbc 3종)으로 재분할 |
|
||||
| S7-#6a | Required | `PublishResult` 7인자 생성자 직접 호출 | 남음 | 11파일 28회 → 5파일 8회(`KafkaMessagingTransport` 1, `KafkaPublishFailureClassifier` 2, `KafkaPublishMapper` 1, `DefaultMessagePublisher` 2, `MS/PublishResults.java` 2). `PublishResult.java:30`에 정적 factory 없음 | W3 | `PublishResult.rejected/ambiguous/confirmed` 정적 factory 추가 후 8곳 교체 |
|
||||
@@ -1011,7 +1023,7 @@
|
||||
| S7-#16c | Nit | `KafkaConsumerRegistrar.dispatch` 긴 메서드 | 남음 | `KafkaConsumerRegistrar.java:264-354`(약 90줄) | W5 | S7-#2 결정 후: 유지면 분해, 삭제면 소멸 |
|
||||
| S7-lead-1 | 권고 | outbox relay 3개 (= X1-#1) | 완료 | V2 relay 삭제(`CS:175`), 앱 relay는 `PublishPendingOutboxEventsUseCase` 하나(`BS/autoconfigure/outbox/OutboxConfig.java:86`). messaging `OutboxRelay`는 vendored 제품 기능으로 `@ConditionalOnBean(OutboxRepository)`(`MS/MessagingReliabilityAutoConfiguration.java:81`)이고 main에 `JdbcOutboxRepository` 생성 0이라 앱 조립에 들어오지 않음, `6d27356e` | - | - |
|
||||
| S7-lead-2 | 권고 | 멱등성 저장소 3개(앱, grpc ledger, messaging inbox) (= X1-#2) | 남음 | 셋 다 존재. messaging inbox는 소비자 dedup이고 family 규칙상 앱 계약 사용 불가(`CLAUDE.md:65`); grpc ledger도 앱 edge 없음(`MJ:606`, allowed `grpc-core-api`만) → 분리는 구조상 의도. 그러나 root `CLAUDE.md:59-67` family 표에 `grpc:*`·`grpc-advanced:*` 행이 없어 이 예외가 문서에 없음 | W5 | family 표에 gRPC 플랫폼을 messaging과 같은 vendored 예외(자체 ledger, optional build)로 한 줄 추가 |
|
||||
| S7-lead-3 | 권고 | Kafka producer 경로 2개 (= X1 표 Kafka producer) | 남음 | R0 `LegacyKafkaMessagingRootAutoConfiguration`·`KafkaSender`·`KafkaSenderAutoConfiguration`(`src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/`) vs 플랫폼 `KafkaMessagingTransport`; `CS:32` "legacy `KafkaSender` seam and the vendored platform" | W2 | MSG-015 cutover(S6-lead-3과 함께) 후 R0 `KafkaSender` 경로 삭제 |
|
||||
| S7-lead-3 | 권고 | Kafka producer 경로 2개 (= X1 표 Kafka producer) | 남음 | R0 `LegacyKafkaMessagingRootAutoConfiguration`·`KafkaSender`·`KafkaSenderAutoConfiguration`(`src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/`) vs 플랫폼 `KafkaMessagingTransport`; `CS:32` "legacy `KafkaSender` seam and the vendored platform"<br>Wave 1–2 P1: 미완 — 이유: = X1 표 Kafka producer(legacy `KafkaSender` R0 경로). 결정 7로 Wave 3 3-C에서 경로째 삭제. 이번 묶음 지시대로 legacy seam은 손대지 않음 | W2 | MSG-015 cutover(S6-lead-3과 함께) 후 R0 `KafkaSender` 경로 삭제 |
|
||||
| S7-lead-4 | 권고 | lease/claimBatch 구현 여러 벌 (= X1-#6) | 남음 | persistence-jpa 안에 owner+token lease 2벌: outbox(`OutboxStoreAdapter.java:79-90`, `OutboxEventJpaRepository.java:34,47`)와 알림(`RecipientDeliveryJpaRepository.java:85-175`, `JpaRecipientLeaseStore`). outbox는 계약 kit `OutboxLeaseFencingContract`(application-core testFixtures)가 있으나 `RecipientLeaseStorePort`는 PG 통합 테스트 1개뿐. messaging `OutboxRepository.claimBatch`는 vendored라 별개 | W4 | SQL은 테이블별 유지(X1-#6), application-notification testFixtures에 `RecipientLeaseFencingContract`를 만들어 fake와 JPA store가 함께 상속 |
|
||||
| S7-lead-5 | 권고 | messaging 기본 off 처리 두 곳(sentinel vs starter switch) | 해당 없음(코드 삭제) | `DisabledMessagingSentinelAutoConfiguration` 삭제(`CS:240`), 끄는 키는 모듈 `app.messaging.enabled` 하나(`CS:32`) | - | - |
|
||||
|
||||
@@ -1029,30 +1041,30 @@
|
||||
|
||||
| ID | 심각도 | 요약 | 상태 | 근거 | Wave | 수정 방향 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| NEW-1a | Consider | compose smoke가 lane이 실제로 켠 기능·DB 벤더를 확인하지 않는다. `expectedSwitchesOn`·`expectedPersistenceVendor`를 읽는 코드가 없다(스크립트·정적 검사기 모두). | 남음 | `scripts/run-compose-runtime-smoke.sh:414-427`은 `/actuator/health`만 폴링한다. 예전 버전은 `/actuator/adapteractivation`의 `switches`·`persistenceVendor`를 비교했는데, 그 endpoint(`AdapterActivationEndpoint`·`AdapterActivationReport`·`MasterSwitchEnvironmentPostProcessor`)가 6d27356e에서 삭제됐다(`git diff 208077fd 6d27356e -- scripts/run-compose-runtime-smoke.sh`). `scripts/verify-compose-profile-contracts.sh:43-56`도 이 두 필드를 읽지 않는다. 필드 값은 아직 유효한 property 키다: `ca-skeleton.persistence-jpa.enabled`(`PersistenceJpaAutoConfiguration.java:17`), `app.messaging.enabled`(`MessagingPlatformRootAutoConfiguration.java:23`), `backend.graphql.enabled`(`GraphQlRootAutoConfiguration.java:12`) 등 8개 모두 main 코드에 있다. 하지만 이제 이 키를 "앱이 보고한 값"으로 노출하는 곳이 없어서 필드는 읽히지 않는 문서다. `src/config/runtime/compose-profile-contracts.json:741`의 `$activationComment`는 "Redis·fileserver·httpclient는 app-bootstrap에 포함"이라고 적혀 있는데, capability 포장 이후로는 틀린 설명이다. actuator 노출 목록은 `health,prometheus,info,loggers`다(`src/app-bootstrap/src/main/resources/config/observability.yml:34`). | W2 | 결정(2026-09-25): smoke가 lane이 켠 capability·DB 벤더를 health component(또는 info)로 확인, 계약 필드를 그 값에 맞춰 재정의 |
|
||||
| NEW-1a | Consider | compose smoke가 lane이 실제로 켠 기능·DB 벤더를 확인하지 않는다. `expectedSwitchesOn`·`expectedPersistenceVendor`를 읽는 코드가 없다(스크립트·정적 검사기 모두). | 완료 | Wave 1–2 P13 (fcddab7e·Wave 2 커밋): 방식: Spring Boot `management.info.env.enabled=true`(`src/app-bootstrap/src/main/resources/config/observability.yml:86-94`, `info.*` 트리만 노출, env 전체 아님)와, 각 capability 모듈이 자기 설정 파일에 `info.capabilities.<name>.enabled: ${<스위치 키>:<auto-config의 matchIfMissing과 같은 기본값>}`을 싣는다. JPA는 `vendor: ${ca-skeleton.persistence.vendor:postgresql}`도 싣는다(vendor=postgresql이면 `JpaDataSourceProfileValidator`가 실제 DB가 PostgreSQL인지 기동 때 확인하므로 선택자=실제 DB). Java 코드 추가 없음, capability 모듈 8개의 yml만 추가: `persistence-jpa.yml`, `persistence-mongo/config/mongo.yml`, `messaging-kafka/.../messaging.yml`, `notification-platform/.../notification.yml`, `graphql/config/graphql.yml`, `cache-redis.yml`, `fileserver-platform/.../fileserver.yml`, `httpclient.yml`. 계약 재정의: `expectedSwitchesOn`(property 키) → `expectedCapabilitiesOn`(info 이름), 최상위 `capabilities` 카탈로그(8개) 추가, `$activationComment`/`$vendorComment` 갱신(`src/config/runtime/compose-profile-contracts.json:741-752`). smoke: `scripts/run-compose-runtime-smoke.sh:434-468` — health 응답 뒤 `/actuator/info`를 받아 ①보고된 capability 이름 집합 = 카탈로그(모듈 누락·info 꺼짐 검출, all-off lane이 빈 목록끼리 비교하는 헛검사가 안 되게) ②enabled=true 집합 = `expectedCapabilitiesOn` ③JPA가 켜졌으면 `vendor`, 아니면 `none` = `expectedPersistenceVendor`. 정적 검사 `scripts/verify-compose-profile-contracts.sh:133-146`(check 6): 카탈로그 밖 이름, JPA 켜짐/꺼짐과 맞지 않는 vendor를 거부. 실제 실행(Docker, qualification 이미지): 재현 — off-local이 persistence-jpa를 기대하도록 바꾼 계약에서 HEAD의 smoke는 `all 1 blocking lanes passed`(결함), 새 smoke는 `off-local: the application reports [] on, the contract expects [persistence-jpa]`로 FAIL. 실제 계약: `--lane off-local` passed(8개 모두 `enabled:"false"`), `--lane local-jpa` passed(`persistence-jpa {enabled:"true",vendor:"postgresql"}`), `--lane off-prod` passed. `--lane local-redis`는 info 검사(`redis enabled:"true"`)를 통과한 뒤 기존 3c 기동 로그 검사에서 실패(P13-new-2). 정적 검사: 실제 계약 18 lane 전부 match, 깨진 사본(카탈로그 밖 이름·JPA 켜짐+vendor none)은 두 lane FAIL. 한계: objectstorage·websocket·gRPC는 모든 lane에서 꺼지고 info에 보고하지 않는다(예전 activation endpoint도 보고하지 않던 셋). `ConfigurationNamespaceContractTest`의 허용 root에 프레임워크 namespace `info` 추가(`app-bootstrap/src/test/.../ConfigurationNamespaceContractTest.java:57-74`). | - | 결정(2026-09-25): smoke가 lane이 켠 capability·DB 벤더를 health component(또는 info)로 확인, 계약 필드를 그 값에 맞춰 재정의 |
|
||||
| NEW-1b | Required | 새 CI 잡이 GitHub에서 한 번도 돌지 않았다. 18개 lane을 실제로 돌린 증거가 없다. | 남음 | 브랜치에 upstream이 없고(`git status -sb` → `## refactor/review-followup`), `6d27356e`를 포함한 원격 브랜치도 없다(`git branch -r --contains` 결과 비어 있음). 새로 추가된 잡은 `.github/workflows/build-logic.yml:30-41`(included build 테스트), `.github/workflows/integration-main.yml:64`(`main-check`), `:85`(`configuration-cache`), `:130`(`jpa-candidate-evidence`)이다. compose 잡은 `integration-main.yml:374-387`에 있고 `push: main`·nightly·dispatch에서만 돈다(`:33-40`). 계약 lane은 18개다(`jq '.lanes\|length'`). lane은 `COMPOSITION=qualification` 이미지로 돈다(`run-compose-runtime-smoke.sh:34`, `src/Dockerfile:70-77`). | W4 | 로컬에서 돌리려면 docker, docker compose 2.24.4 이상(`compose-profile-contracts.json`의 `minimumComposeVersion`), jq, openssl(TLS lane의 인증서 생성, `:183-211`)이 필요하다. 명령은 `bash scripts/run-compose-runtime-smoke.sh --matrix src/config/runtime/compose-profile-contracts.json`이고, 이미지는 스크립트가 `docker compose build app`으로 만든다(`:366`). 스크립트의 도구 사전 검사(`:75-77`)에 `openssl`을 추가한다. 브랜치를 push해서 `workflow_dispatch`로 `integration-main`·`build-logic`을 한 번 돌리고 그 결과를 증거로 남긴다. |
|
||||
| NEW-2a | Consider | outbox relay 조립이 app-bootstrap에 있다. | 남음 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/outbox/OutboxConfig.java:44-120`. 조건: `@AutoConfiguration(afterName=PersistenceJpaAutoConfiguration, MessagingBridgeRootAutoConfiguration)`, `@ConditionalOnProperty(ca-skeleton.outbox.enabled=true)`, `@ConditionalOnBean(OutboxStorePort)`, `@EnableScheduling`. 빈: `outboxCanonicalTransportRequirementValidator`, `outboxRelayScheduler`(`relay-enabled` 기본 true + `@ConditionalOnBean(OutboxMessagePublishPort)`), `outboxRandomGenerator`, `outboxLeaderElection`, `outboxMetrics`. 같은 패키지에 `OutboxSettings`·`OutboxMetrics`·`OutboxRelayScheduler`·`OutboxLeaderElectionToken`·`OutboxCanonicalTransportRequirementValidator`가 있다. 등록은 `src/app-bootstrap/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:2`. persistence-jpa로 옮기지 못하는 이유는 `AdapterBoundaryArchitectureTest.java:207-227` 때문이다. 이 규칙은 `adapter.outbound.persistence..` 패키지가 `*UseCase`를 참조하는 것을 막는데, `OutboxConfig`는 `PublishPendingOutboxEventsUseCase`를 직접 만든다(:85). | W3 | 새 leaf `:composition:outbox-relay`(패키지 `dev.caskeleton.composition.outbox`)를 만들고 위 6개 클래스와 테스트(`OutboxConfigTest`·`OutboxSettingsTest`·`OutboxRelaySchedulerLoggingTest`·`OutboxCanonicalTransport*Test`)를 옮긴다. 자세한 내용은 아래 메모. |
|
||||
| NEW-2b | Consider | 멱등성 executor 조립이 app-bootstrap에 있고, sample이 검증 없는 복사본을 따로 가진다. | 남음 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/autoconfigure/idempotency/IdempotencyProviderSelectionConfig.java:28-56`: `@AutoConfiguration`, 빈은 `idempotencyExecutor` 하나다(`@ConditionalOnExpression(provider != disabled)`). store가 정확히 1개가 아니면 기동 실패한다(:39-47). 설정은 `IdempotencySettings.java:24-67`에 있고 lease·TTL 상한과 codec·revision을 검증한다. sample 복사본 `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/bootstrap/idempotency/SampleIdempotencyConfig.java:21-47`과의 차이는 셋이다. ① `Binder`로 직접 읽어서 상한·양수 검증이 없다(:38-45). ② store를 1개로 가정한다(`IdempotencyStorePort store` 직접 주입). ③ `Clock` 빈과 `@EnableScheduling`을 함께 들고 있다(:22,:27-30). | W3 | 새 leaf `:composition:idempotency`로 `IdempotencyProviderSelectionConfig`·`IdempotencySettings`와 테스트(`IdempotencyProviderCompositionTest`·`IdempotencySettingsTest`)를 옮긴다. sample은 `runtimeOnly project(':composition:idempotency')`를 쓰고 `SampleIdempotencyConfig`에서는 executor 빈을 지운다(Clock·scheduling만 남긴다). modules.json의 `sample-portfolio.allowed_dependencies`에 `composition-idempotency`를 추가한다. |
|
||||
| NEW-3 | Required | fileserver 보상 트랜잭션의 30초 타임아웃이 사라졌다. 지금은 `inNew` 경로 전체에 타임아웃이 없다. | 남음 | 예전 코드는 `git show 208077fd:src/application-fileserver/.../upload/FileserverCompensationTransaction.java:16`에 `BUDGET = Duration.ofSeconds(30)`을 두고 `:27` `MAINTENANCE_NEW` 정책으로 `SpringPolicyTransactionPort`에 넘겼다. 그 포트가 `definition.setTimeout(...)`을 걸었다(208077fd `SpringPolicyTransactionPort.java:184`, 상한 `persistence.yml` `transaction-timeout: 30s`). 지금은 `src/application-fileserver/src/main/java/dev/caskeleton/application/fileserver/upload/DefaultUploadApplicationService.java:155`와 `DefaultFinalizeUploadService.java:321`이 `transactions.inNew(...)`를 그대로 호출한다. `TransactionPort.java:23-78`에는 timeout 옵션이 없다. `SpringTransactionPort.java:83-93` `template()`은 `setTimeout`을 호출하지 않는다. `spring.transaction.default-timeout`도 어디에도 없다(grep 0건). | W2 | 가장 작은 변경은 `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/transaction/SpringTransactionPort.java`의 `requiresNewTemplate`에 `setTimeout(30)`을 거는 것이다(상수 1개). 이러면 보상·outbox·audit용 REQUIRES_NEW의 옛 동작이 돌아온다. 전 트랜잭션에 상한을 원하면 대신 `persistence-jpa.yml` module-defaults에 `spring.transaction.default-timeout: 30s`를 둔다. 테스트는 `SpringTransactionPort` 단위 테스트에서 inNew template의 timeout 값을 단언한다. |
|
||||
| NEW-3 | Required | fileserver 보상 트랜잭션의 30초 타임아웃이 사라졌다. 지금은 `inNew` 경로 전체에 타임아웃이 없다. | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): C-3d와 같은 수정·테스트. `SpringTransactionPort.java:62` | - | 가장 작은 변경은 `src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/transaction/SpringTransactionPort.java`의 `requiresNewTemplate`에 `setTimeout(30)`을 거는 것이다(상수 1개). 이러면 보상·outbox·audit용 REQUIRES_NEW의 옛 동작이 돌아온다. 전 트랜잭션에 상한을 원하면 대신 `persistence-jpa.yml` module-defaults에 `spring.transaction.default-timeout: 30s`를 둔다. 테스트는 `SpringTransactionPort` 단위 테스트에서 inNew template의 timeout 값을 단언한다. |
|
||||
| NEW-4a | Required | Kafka legacy seam producer에 보안 설정이 전혀 없다(항상 PLAINTEXT). | 남음 | `src/adapter/outbound/messaging-kafka/src/main/java/dev/caskeleton/adapter/outbound/messaging/kafka/KafkaSenderAutoConfiguration.java:62-80`: bootstrap·serializer·acks·timeout만 넣는다. `security.protocol`·SASL·SSL 키가 없다. messaging-kafka 모듈을 고르면 `LegacyKafkaMessagingRootAutoConfiguration`(imports 1행)로 항상 켜진다. 반면 platform producer는 `KafkaSecurityConfigurer`를 적용한다(`KafkaMessagingAutoConfiguration.java:234-235`). | W1 | seam producer도 같은 보안 profile을 쓰게 한다. `KafkaMessagingAutoConfiguration.producerSecurity(...)`를 재사용 가능한 static으로 빼거나 `KafkaSecurityConfigurer` 결과를 주입받아 `config.putAll(...)`한다. 보안 profile이 없고 broker가 TLS·auth를 요구하면 기동을 실패시킨다(platform 쪽 `:200-211`과 같은 규칙). 장기적으로는 seam을 platform transport로 합쳐 producer를 하나로 줄인다. |
|
||||
| NEW-4b | Required | Kafka TLS 자료(truststore/keystore) 설정 키가 없다. `MUTUAL_TLS`를 설정 값으로는 받지만 실제로 동작하지 않는다. | 남음 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaSecurityConfigurer.java:85-90`은 TLS일 때 `ssl.enabled.protocols`·`ssl.endpoint.identification.algorithm`만 넣는다. `:109` `MutualTls`는 `sasl.mechanism=NONE`만 넣고 `ssl.keystore.*`는 넣지 않는다. 그래서 `security.protocol=SSL`인데 client 인증서가 없는 상태가 되어 연결할 때 실패한다. `src/messaging` main에서 `truststore\|keystore` grep 결과는 0건이다. 설정 컴파일러는 `MUTUAL_TLS`를 받는다(`MessagingConfigurationCompiler.java:258`). 동작하지 않는 옵션을 받는 것은 완료 기준 3 위반이다. | W1 | `BrokerSettings`(messaging-spring-boot-starter)에 `trust-store-location/password/type`, `key-store-location/password/type`을 추가하거나 Spring Boot SSL bundle 이름(`ssl-bundle`)을 받는다. `KafkaSecurityConfigurer`가 `ssl.truststore.*`·`ssl.keystore.*`(또는 PEM `ssl.*.certificates`)를 채운다. keystore가 없는 `MUTUAL_TLS`는 컴파일 단계에서 거부한다. 구현하지 않을 거면 `MessagingConfigurationCompiler.java:258`에서 `MUTUAL_TLS`를 뺀다. |
|
||||
| NEW-4c | Consider | platform producer가 broker 주소를 `spring.kafka.bootstrap-servers`에서만 읽고, 선언된 broker의 `bootstrap-servers`는 검증만 한 뒤 쓰지 않는다. | 남음 | `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:155-165`는 `environment.getProperty("spring.kafka.bootstrap-servers")`만 읽는다. `MessagingConfigurationCompiler.java:97-99`는 `app.messaging.brokers.<name>.bootstrap-servers`가 비어 있으면 거부하지만, producer는 그 값을 쓰지 않는다. 두 경로를 이어 주는 것은 module-defaults 한 줄뿐이다: `src/adapter/outbound/messaging-kafka/src/main/resources/config/module-defaults/messaging.yml:17,23`에서 둘 다 `${APP_MESSAGING_KAFKA_BROKERS:}`. | W2 | 주소 출처를 하나로 정한다. 추천은 compiled broker(`CompiledMessagingConfiguration`의 kafka broker `bootstrapServers()`)를 쓰고, 없을 때만 `spring.kafka.bootstrap-servers`로 fallback하는 것이다. 둘 다 있는데 값이 다르면 기동을 실패시킨다. 테스트는 `producerConfig(...)`에 두 값을 다르게 주고 결과를 단언한다. |
|
||||
| NEW-4d | Required | credential rotation이 Kafka producer에 반영되지 않는다. | 남음 | `KafkaMessagingAutoConfiguration.java:140-146`: producer를 기동 때 한 번 만든다. `:234-235`: `Instant.now()` 시점의 credential로 JAAS 문자열을 고정한다. `:250`: transport generation이 `1L`로 고정이다. `KafkaSecurityConfigurer.java:17-21` Javadoc은 "rotation을 가능하게 한다"고 적혀 있지만, 회전 뒤 producer를 다시 만드는 코드가 없다(`messaging-kafka` main에서 rotate grep 0건). 회전 소스는 `MessagingCoreAutoConfiguration.java:184`(runtime registry)다. | W1 | Kafka 방식으로 해결한다. `sasl.client.callback.handler.class`에 `CredentialRuntimeRegistry`를 조회하는 handler를 넣고 JAAS에는 username만 둔다. 이러면 재인증(broker `connections.max.reauth.ms`) 때마다 새 비밀번호를 쓴다. 다른 방법은 registry의 generation 변화에 맞춰 producer를 교체하고 transport generation을 올리는 것이다. Javadoc(:17-21)은 실제 동작에 맞춘다. |
|
||||
| NEW-5a | Required | Redis ACL 템플릿의 script 계정에 `TIME` 권한이 없다. rate-limit·멱등성 script가 NOPERM으로 실패한다(실제 lane 실패 4건의 주원인). | 남음 | `infra/redis-sdk/acl/application-advanced.acl:1`, `infra/redis-sdk/acl/all-accounts.acl:3`: `-@all` 뒤에 `+time`이 없다(`TIME`은 `@read`·`@write`에 속하지 않는다). script 안에서 `redis.call('TIME')`을 쓰는 곳은 `RateLimitScripts.java:48,76,108`, `IdempotencyScripts.java:41,127`이다. `infra/redis-sdk/acl/README.md`는 `all-accounts.acl`을 "deployment가 로드하는 파일"이라고 적고 있어서, 운영 템플릿도 같이 깨져 있다. 기동 probe도 이 문제를 잡지 못한다. `RedisSemanticScriptAclProbe.java:20`은 `return {1}`만 실행한다. | W1 | 두 ACL 파일의 advanced 계정에 `+time`을 추가한다. `admin-readonly.acl:1`에는 이미 `+time`이 있다. probe script를 `redis.call('TIME')`을 실제로 수행하는 스크립트로 바꿔서 권한이 없으면 기동 때 실패하게 한다. 검증은 `redis-sdk-topology.yml` standalone lane에서 `LiveRedisSemanticPortsTest`로 한다. |
|
||||
| NEW-5b | Consider | `LiveRedisSemanticPortsTest`의 token-bucket 테스트가 +1h 시계 때문에 항상 거부 결과를 받는다(테스트 버그). | 남음 | `src/adapter/outbound/cache-redis/src/test/java/dev/caskeleton/adapter/outbound/cache/redis/LiveRedisSemanticPortsTest.java:230`: adapter 시계가 `Clock.offset(systemUTC, +1h)`다. `:252`: 요청 deadline은 `Instant.now().plusSeconds(5)`다. `RedisEdgeRateLimitAdapter.java:99-106`은 `callerDeadline`이 adapter 시각보다 앞이면 `Unavailable(ADMISSION_REJECTED)`를 돌려준다. 그런데 테스트는 `Evaluated`를 기대한다(:236-238). 원인 추정: "Redis TIME을 쓴다"를 보이려고 넣은 offset이 deadline 검사와 충돌했다. | W4 | `:230`을 `Clock.systemUTC()`로 되돌린다. skew 검증은 이미 `idempotencyLeaseExpiryUsesRedisTimeAcrossSkewedCallers`(:317-)가 한다. offset을 꼭 유지하려면 `request()`가 같은 clock으로 deadline을 만들게 한다. |
|
||||
| NEW-5c | Required | 멱등성·lease adapter가 "보내기 전 거부"(script lane 없음, lane 포화)도 `Indeterminate`로 분류한다. | 남음 | `src/adapter/outbound/cache-redis/src/main/java/dev/caskeleton/adapter/outbound/cache/redis/idempotency/RedisIdempotencyStoreAdapter.java:109-131`, `lease/RedisDistributedLeaseAdapter.java:145-172`(acquire), `:197-227`(inspect), `:316-346`(renew), `:352-375`(release): `catch (Exception)` 하나로 모두 `Indeterminate`를 돌려준다. 거부는 `RedisRuntimeOwner.borrow`가 `RedisCommandRejectedException`(`RedisOperationException`의 하위 클래스)으로 던진다(`RedisRuntimeOwner.java:136-160`). rate-limit adapter는 이미 이 둘을 구분한다(`RedisEdgeRateLimitAdapter.java:123-132`, `metadata().ambiguousExecution()`). 포트에는 결정적 실패 variant가 있다: `IdempotencyClaimOutcome.Unavailable`(:71), `LeaseAcquireOutcome.Unavailable(LeaseUnavailableCategory.UNAVAILABLE_BEFORE_SEND)`(:34). | W2 | 두 adapter에 `catch (RedisOperationException failure)`를 `catch (Exception)` 앞에 추가한다. `!failure.metadata().ambiguousExecution()`이면 `Unavailable`(lease는 `UNAVAILABLE_BEFORE_SEND`)을 돌려주고, 나머지만 `Indeterminate`로 둔다. 모양은 rate-limit과 같다. 테스트는 script lane이 없는 `runtime(false)`로 claim/acquire를 호출하고 `Unavailable`을 단언한다. |
|
||||
| NEW-6 | Nit | `S3AsyncResponseBodyBridgeTest`가 벽시계 예산 5초에 의존해 부하가 걸리면 실패할 수 있다. | 남음 | `src/adapter/outbound/objectstorage/src/test/java/dev/caskeleton/adapter/outbound/objectstorage/s3/S3AsyncResponseBodyBridgeTest.java:45,101`: `CallBudget.fromNow(Duration.ofSeconds(5))`을 테스트 시작 시점에 만든다. `:80,119,127`: `result.get(5, SECONDS)`. bridge는 50ms마다 poll하면서 예산 만료를 `System.nanoTime()`으로 확인한다(`S3AsyncResponseBodyBridge.java:231,261-262`). 두 번째 테스트는 예산 하나(`read`)를 bridge 2개가 차례로 나눠 쓴다(:94-128). 큐 용량 2(chunk 1 + END)는 경합 원인이 아니다(`:164`). 미확인: 실패 로그가 없어서 실제 실패 지점은 확정하지 못했다. | W4 | 예산과 `get` timeout을 30초로 올린다(실패 경로 테스트는 즉시 끝나므로 느려지지 않는다). 두 번째 테스트는 bridge마다 새 `ReadOperation`(새 예산)을 만든다. |
|
||||
| NEW-7a | Required | durable operation을 같은 operationId로 재시도하면 outbox append가 다시 실행된다. | 남음 | `src/application-core/src/main/java/dev/caskeleton/application/operation/SubmitDurableOperationUseCase.java:100`: `alreadyAccepted = !operation.operationId().equals(command.operationId())`. 같은 id로 재시도하면 store가 기존 행을 돌려주고(`DurableOperationStoreAdapter.java:49-` `submitIfAbsent` 후 조회), id가 같아서 `alreadyAccepted=false`가 되어 `:107` append가 다시 돈다. `eventId=operationId`이고 `outbox_event` PK가 `event_id`다(`V3__outbox_event.sql:14`). `OutboxStoreAdapter.java:71`은 `repository.save(entity)`인데 `OutboxEventEntity.java:20-22`에 `@Version`도 `Persistable`도 없다. 그래서 (추정, Spring Data `isNew` 기본 규칙) merge로 기존 행을 PENDING·attempt 0으로 덮어써서 다시 발행할 수 있다. 기존 테스트는 다른 id로 재제출하는 경우만 본다(`SubmitDurableOperationUseCaseTest.java:92-105`). | W2 | `DurableOperationJpaRepository.submitIfAbsent`(:51)의 반환형을 `int`(삽입 행 수)로 바꾼다. `DurableOperationStorePort.submit`은 `created` 여부를 돌려주게 하고(예: `DurableOperationSubmitResult(operation, created)`), use case는 `created`일 때만 append한다. `OutboxEventEntity`는 `Persistable<String>`(`isNew=true`)을 구현해서 중복 append가 PK 위반으로 드러나게 한다. 테스트: 같은 id로 두 번 submit → `outbox.appended` 1건, `alreadyAccepted=true`. |
|
||||
| NEW-7b | Consider | `Submit/Get/CancelDurableOperationUseCase`를 쓰는 HTTP 어댑터와 운영 조립이 없다. | 남음 | 이 use case들을 참조하는 main 코드는 `application-core` 자신뿐이다(grep: `new SubmitDurableOperationUseCase` 등 test 밖 0건). 저장소만 `@Repository`로 있다(`DurableOperationStoreAdapter.java:28`). 인바운드 어댑터와 bean 조립이 없다. | W2 | 결정(2026-09-25): HTTP 어댑터 추가 — `POST /operations`(202)·`GET`·`DELETE /operations/{id}`, JPA 조립에 use case bean |
|
||||
| NEW-8a | Required | 알림 reconcile이 `Unsupported`면 attempt·수신자 상태를 바꾸지 않는다. 행이 영구히 남고 매 recovery 주기마다 다시 조회된다. | 남음 | `src/application-notification/src/main/java/dev/caskeleton/application/notification/platform/dispatch/ReconciliationService.java:77-84`(gateway 미지원)과 `:126-129`(gateway가 Unsupported 반환)는 metric만 올린다. `:72-74`(snapshot 없음)도 같다. | W2 | `Unsupported`일 때 수신자를 운영자가 확인하는 종단 상태로 옮긴다. 예: `RECONCILIATION_REQUIRED`에 `nextCheckAt=null`, 또는 전용 `MANUAL_REVIEW` 상태. `ambiguousAttemptExists=true`를 유지하고 lease를 해제한다. 전이는 `recipients.transition(...)`을 `transactions.inWrite`로 감싸 `StillUnknown` 분기(:119-125)와 같은 모양으로 한다. |
|
||||
| NEW-8b | Required | attempt가 모두 완료된 수신자가 `DISPATCHING`에 남는다(1차 리뷰 B-4). | 남음 | `DispatchOutcomeRecorder.java:118-121`: 모호하지 않은 결과면 수신자를 `DISPATCHING`으로 저장한다(callback 대기). `LeaseRecoveryService.java:113`: `expiredDispatching`로 다시 조회한다. `:123-138`: attempt가 모두 `completedAt` 있음이면 아무것도 하지 않는다. 결과적으로 같은 행이 매 batch를 차지해서 다른 행의 복구를 굶길 수 있다. | W2 | `LeaseRecoveryService.recoverOnce`에서 attempt가 모두 완료인 경우를 명시적으로 처리한다. callback 대기 기한(`staleAfter`)이 지났으면 마지막 attempt로 `reconciliation.reconcile(...)`을 호출하고, 그래도 확정이 안 되면 NEW-8a의 종단 상태로 전이한다. 테스트는 attempt가 모두 완료된 DISPATCHING 행 1개로 `recoverOnce`를 두 번 부르고 상태가 바뀌는지 단언한다. |
|
||||
| NEW-9a | Required | GraphQL 요청 단계 에러가 `GraphQlWireErrorMapper`를 거치지 않는다. adopter의 `ApiErrorCarrier`가 요청 단계에서는 `INTERNAL_ERROR`로 나간다. | 남음 | `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/runtime/GraphQlPlatformWebInterceptor.java:161-168`(`reject`, 호출은 `:95`)과 `GraphQlPlatformInstrumentation.java:81-88`이 `GraphQlPlatformRejectionMapper.map`(:41)을 직접 호출한다. 이 mapper는 platform 예외 9종만 instanceof로 매핑한다(:54-121). 필드 단계만 `GraphQlWireErrorMapper.mapFieldFailure`(:60)를 거친다(`GraphQlDataFetcherExceptionResolver.java:22-44`). 원 지적은 `docs/reviews/2026-09-24-src-maintainability-review.md:912-915`. | W2 | `GraphQlWireErrorMapper`에 `map(Throwable, GraphQlErrorContext)` 진입점 하나를 둔다. platform rejection을 먼저 보고, 그다음 application mapping(`ApiErrorCarrier`), 마지막에 internal로 처리한다. interceptor·instrumentation·field resolver 세 곳이 모두 이 mapper bean을 받는다(`GraphQlPlatformAutoConfiguration.java:388-396`에서 주입). category switch 3개(`GraphQlWireErrorMapper.java:94`, `GraphQlWireErrors.java:56`, `clientMessage`)는 `EnumMap` 표 하나로 합친다. |
|
||||
| NEW-4b | Required | Kafka TLS 자료(truststore/keystore) 설정 키가 없다. `MUTUAL_TLS`를 설정 값으로는 받지만 실제로 동작하지 않는다. | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): M-2e 행과 같은 수정·테스트 | - | `BrokerSettings`(messaging-spring-boot-starter)에 `trust-store-location/password/type`, `key-store-location/password/type`을 추가하거나 Spring Boot SSL bundle 이름(`ssl-bundle`)을 받는다. `KafkaSecurityConfigurer`가 `ssl.truststore.*`·`ssl.keystore.*`(또는 PEM `ssl.*.certificates`)를 채운다. keystore가 없는 `MUTUAL_TLS`는 컴파일 단계에서 거부한다. 구현하지 않을 거면 `MessagingConfigurationCompiler.java:258`에서 `MUTUAL_TLS`를 뺀다. |
|
||||
| NEW-4c | Consider | platform producer가 broker 주소를 `spring.kafka.bootstrap-servers`에서만 읽고, 선언된 broker의 `bootstrap-servers`는 검증만 한 뒤 쓰지 않는다. | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): M-2b 행과 같은 수정·테스트 | - | 주소 출처를 하나로 정한다. 추천은 compiled broker(`CompiledMessagingConfiguration`의 kafka broker `bootstrapServers()`)를 쓰고, 없을 때만 `spring.kafka.bootstrap-servers`로 fallback하는 것이다. 둘 다 있는데 값이 다르면 기동을 실패시킨다. 테스트는 `producerConfig(...)`에 두 값을 다르게 주고 결과를 단언한다. |
|
||||
| NEW-4d | Required | credential rotation이 Kafka producer에 반영되지 않는다. | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): M-2f 행과 같은 수정·테스트 | - | Kafka 방식으로 해결한다. `sasl.client.callback.handler.class`에 `CredentialRuntimeRegistry`를 조회하는 handler를 넣고 JAAS에는 username만 둔다. 이러면 재인증(broker `connections.max.reauth.ms`) 때마다 새 비밀번호를 쓴다. 다른 방법은 registry의 generation 변화에 맞춰 producer를 교체하고 transport generation을 올리는 것이다. Javadoc(:17-21)은 실제 동작에 맞춘다. |
|
||||
| NEW-5a | Required | Redis ACL 템플릿의 script 계정에 `TIME` 권한이 없다. rate-limit·멱등성 script가 NOPERM으로 실패한다(실제 lane 실패 4건의 주원인). | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): W1 `22f28a3e`. `infra/redis-sdk/acl/application-advanced.acl:1`, `infra/redis-sdk/acl/all-accounts.acl:3`에 `+time` 추가(`admin-readonly`는 이미 있음). probe가 `redis.call('TIME')`을 실제 실행: `cache-redis/.../capability/RedisSemanticScriptAclProbe.java:29-38`. 단위 `RedisSemanticScriptAclProbeTest.anAccountDeniedACommandTheScriptsCallFailsStartup[TIME]` FAIL(`Expecting actual not to be null`)→PASS. 실제 Redis `LiveRedisSemanticScriptAclProbeTest.theAdvancedAccountPassesTheStartupProbe`: 새 probe + 옛 ACL에서 FAIL(`ERR ACL failure in script: User ca-skeleton-application-advanced has no permissions to run the 'time' command`) → ACL 수정 후 PASS. 이 클래스를 `cache-redis/build.gradle` `redisTopologyLane` standalone·cluster 필수 클래스에 등록. `infra/redis-sdk/acl/README.md`에 `+time` 이유 기록 | - | 두 ACL 파일의 advanced 계정에 `+time`을 추가한다. `admin-readonly.acl:1`에는 이미 `+time`이 있다. probe script를 `redis.call('TIME')`을 실제로 수행하는 스크립트로 바꿔서 권한이 없으면 기동 때 실패하게 한다. 검증은 `redis-sdk-topology.yml` standalone lane에서 `LiveRedisSemanticPortsTest`로 한다. |
|
||||
| NEW-5b | Consider | `LiveRedisSemanticPortsTest`의 token-bucket 테스트가 +1h 시계 때문에 항상 거부 결과를 받는다(테스트 버그). | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): `LiveRedisSemanticPortsTest.java:193`: token-bucket adapter 시계 `Clock.offset(+1h)` → `Clock.systemUTC()`. `tokenBucketWithNonDivisibleRefillUsesIntegerExpiry` FAIL(W1 후에도 `AssertionError at :194`)→PASS. 기존 실패 4건(`theIdempotencyStoreClaimsOnceUnderTheAdvancedAccount`, `idempotencyLeaseExpiryUsesRedisTimeAcrossSkewedCallers`, `theRateLimiterEnforcesUnderTheAdvancedAccount`, `tokenBucketWithNonDivisibleRefillUsesIntegerExpiry`) 모두 PASS: 앞의 3건은 NEW-5a ACL, 마지막은 NEW-5b | - | `:230`을 `Clock.systemUTC()`로 되돌린다. skew 검증은 이미 `idempotencyLeaseExpiryUsesRedisTimeAcrossSkewedCallers`(:317-)가 한다. offset을 꼭 유지하려면 `request()`가 같은 clock으로 deadline을 만들게 한다. |
|
||||
| NEW-5c | Required | 멱등성·lease adapter가 "보내기 전 거부"(script lane 없음, lane 포화)도 `Indeterminate`로 분류한다. | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): 멱등성 `RedisIdempotencyStoreAdapter.java:132,258,319,356,505`, lease `RedisDistributedLeaseAdapter.java:175,239,368,409`에 `catch (RedisOperationException)` + `!metadata().ambiguousExecution()` → `Unavailable`/`UNAVAILABLE`(lease는 `UNAVAILABLE_BEFORE_SEND`, renew/release는 handle을 ACTIVE로 유지). 테스트: `RedisIdempotencyStoreAdapterTest.aSaturatedScriptLaneRefusesTheClaimAsUnavailable`(FAIL `Indeterminate[...] to be an instance of Unavailable`→PASS), `aSaturatedScriptLaneRefusesOwnerTransitionsAsUnavailable`[markExecutionStarted/renew/complete/markFailed/releaseBeforeExecution](FAIL `expected: UNAVAILABLE but was: INDETERMINATE`→PASS), `RedisDistributedLeaseAdapterTest.aSaturatedScriptLaneRefusesAcquireBeforeSend`/`aSaturatedScriptLaneRefusesInspectBeforeSend`/`aRenewRefusedBeforeSendLeavesTheHandleActive`/`aReleaseRefusedBeforeSendLeavesTheHandleActive`(FAIL `expected: Unavailable[category=UNAVAILABLE_BEFORE_SEND] but was: Indeterminate`→PASS). 현황표 수정 방향의 테스트 제안(`runtime(false)`)은 틀렸다: 그 경우 EVALSHA가 서버까지 가서 NOPERM으로 거부되므로 not-sent가 아니다. 대신 SCRIPT lane을 포화시킨 owner(`RedisRuntimeOwner.borrow`가 `RedisCommandRejectedException`)로 재현했다. openLane 실패 같은 타입 없는 예외는 기존대로 Indeterminate(기존 `anUnreachableRedisIsIndeterminate` 유지) | - | 두 adapter에 `catch (RedisOperationException failure)`를 `catch (Exception)` 앞에 추가한다. `!failure.metadata().ambiguousExecution()`이면 `Unavailable`(lease는 `UNAVAILABLE_BEFORE_SEND`)을 돌려주고, 나머지만 `Indeterminate`로 둔다. 모양은 rate-limit과 같다. 테스트는 script lane이 없는 `runtime(false)`로 claim/acquire를 호출하고 `Unavailable`을 단언한다. |
|
||||
| NEW-6 | Nit | `S3AsyncResponseBodyBridgeTest`가 벽시계 예산 5초에 의존해 부하가 걸리면 실패할 수 있다. | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): 결정적 FAIL 재현은 못 했다(부하 의존 간헐 실패, 실패 로그 없음). 원인인 벽시계 예산을 없앴다: 예산 `CallBudget.fromNow(365일)`, `get` 타임아웃은 1분 hang guard로만, bridge마다 새 `ReadOperation`, truncated/oversized 두 테스트로 분리. `adapter/outbound/objectstorage/src/test/.../s3/S3AsyncResponseBodyBridgeTest.java` 3/3 PASS | - | 예산과 `get` timeout을 30초로 올린다(실패 경로 테스트는 즉시 끝나므로 느려지지 않는다). 두 번째 테스트는 bridge마다 새 `ReadOperation`(새 예산)을 만든다. |
|
||||
| NEW-7a | Required | durable operation을 같은 operationId로 재시도하면 outbox append가 다시 실행된다. | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): application: `SubmitDurableOperationUseCaseTest.retryUnderTheSameOperationIdAppendsTheOutboxEventOnlyOnce` FAIL(`[false, 2]` ≠ `[true, 1]`)→PASS. 실제 PG 재현: `DurableOperationSubmissionOutboxIntegrationTest.retryUnderTheSameOperationIdLeavesThePublishedOutboxRowAlone` FAIL(`[false, [PENDING]]` — 재시도가 PUBLISHED row를 merge로 PENDING으로 되돌림 = 재발행)→PASS, `aSecondAppendOfTheSameEventIdIsRefusedByThePrimaryKeyInsteadOfOverwritingTheRow` FAIL(예외 없이 덮어씀)→PASS(`PersistenceFailureException` SQLState 23505). 수정: `submitIfAbsent`가 삽입 행 수 반환(`.../operation/DurableOperationJpaRepository.java:52`), `DurableOperationStorePort.submit` → `DurableOperationSubmitResult(operation, created)`(새 파일 `application-core/.../operation/DurableOperationSubmitResult.java`), use case는 `created`일 때만 append(`SubmitDurableOperationUseCase.java:99-104`), `OutboxEventEntity implements Persistable<String>`(`isNew`, `@PostLoad/@PostPersist`). `DurableOperationStoreContract`에 `retryUnderTheSameOperationIdReturnsTheOperationAsNotCreated` 추가 — fake와 PG adapter(`DurableOperationStoreAdapterContractTest`, jpa-contract) 모두 통과 | - | `DurableOperationJpaRepository.submitIfAbsent`(:51)의 반환형을 `int`(삽입 행 수)로 바꾼다. `DurableOperationStorePort.submit`은 `created` 여부를 돌려주게 하고(예: `DurableOperationSubmitResult(operation, created)`), use case는 `created`일 때만 append한다. `OutboxEventEntity`는 `Persistable<String>`(`isNew=true`)을 구현해서 중복 append가 PK 위반으로 드러나게 한다. 테스트: 같은 id로 두 번 submit → `outbox.appended` 1건, `alreadyAccepted=true`. |
|
||||
| NEW-7b | Consider | `Submit/Get/CancelDurableOperationUseCase`를 쓰는 HTTP 어댑터와 운영 조립이 없다. | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 소유자 결정 15. `adapter:inbound:web` `operation/DurableOperationController`: `POST /operations`(202 + Location, Envelope), `GET /operations/{id}`, `DELETE /operations/{id}`(202). 컨트롤러는 Submit/Get/Cancel 유스케이스만 호출, 인가는 유스케이스 `@RequiresPermission`, owner·tenant 판정은 유스케이스의 `DurableOperationAccessPolicy`(남의 것 = 없는 것 = 404 `OPERATION_NOT_FOUND`). 조립은 `app-bootstrap/.../autoconfigure/operation/DurableOperationConfig`(기존 `OutboxConfig` 패턴, operation store·outbox append·TransactionPort bean이 있을 때만 켜짐, `AutoConfiguration.imports` 등록). 테스트: web slice `DurableOperationControllerTest` 10건, 실제 PG 왕복 `DurableOperationCompositionIntegrationTest` 5건(프록시된 `@RequiresPermission` 403 포함, `integrationTest` lane `requires`에 추가). 새 경로는 인증 필요 경로라 공개 경로 스냅숏은 바뀌지 않음(`verifyPublicPathSnapshot` 통과). `security.yml`에 `operation-submit: operation:submit,operation:cancel`, dev Keycloak realm에 같은 client role 추가. 설계 선택(결정 필요 시 뒤집을 수 있음): id는 서버가 UUID로 발급, 재제출은 payload fingerprint로 dedupe, outbox event type은 `OperationCommand.SUBMITTED_EVENT_TYPE` 하나(클라이언트가 임의 event type을 broker에 싣지 못하게), TTL `OperationCommand.DEFAULT_TIME_TO_LIVE`(1일), tenant는 null(웹 운영 경로에 tenant 해석이 없음) | - | 결정(2026-09-25): HTTP 어댑터 추가 — `POST /operations`(202)·`GET`·`DELETE /operations/{id}`, JPA 조립에 use case bean |
|
||||
| NEW-8a | Required | 알림 reconcile이 `Unsupported`면 attempt·수신자 상태를 바꾸지 않는다. 행이 영구히 남고 매 recovery 주기마다 다시 조회된다. | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): B-4b와 같은 결함. 같은 수정·테스트(`ReconciliationService.java:148`). 수정 방향대로 `ambiguousAttemptExists`·attempt는 건드리지 않아 redrive는 계속 duplicate-risk 승인을 요구 | - | `Unsupported`일 때 수신자를 운영자가 확인하는 종단 상태로 옮긴다. 예: `RECONCILIATION_REQUIRED`에 `nextCheckAt=null`, 또는 전용 `MANUAL_REVIEW` 상태. `ambiguousAttemptExists=true`를 유지하고 lease를 해제한다. 전이는 `recipients.transition(...)`을 `transactions.inWrite`로 감싸 `StillUnknown` 분기(:119-125)와 같은 모양으로 한다. |
|
||||
| NEW-8b | Required | attempt가 모두 완료된 수신자가 `DISPATCHING`에 남는다(1차 리뷰 B-4). | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): B-4a와 같은 결함. 같은 수정·테스트(`LeaseRecoveryService.java:123`). 방향의 "staleAfter 지나면 reconcile 호출" 대신 requeue: 모든 attempt가 완료라 provider에 물을 것이 없고, dispatch 라우팅이 기록된 결과로 다음 단계를 정한다. `expiredDispatching`이 이미 staleAfter로 거른다 | - | `LeaseRecoveryService.recoverOnce`에서 attempt가 모두 완료인 경우를 명시적으로 처리한다. callback 대기 기한(`staleAfter`)이 지났으면 마지막 attempt로 `reconciliation.reconcile(...)`을 호출하고, 그래도 확정이 안 되면 NEW-8a의 종단 상태로 전이한다. 테스트는 attempt가 모두 완료된 DISPATCHING 행 1개로 `recoverOnce`를 두 번 부르고 상태가 바뀌는지 단언한다. |
|
||||
| NEW-9a | Required | GraphQL 요청 단계 에러가 `GraphQlWireErrorMapper`를 거치지 않는다. adopter의 `ApiErrorCarrier`가 요청 단계에서는 `INTERNAL_ERROR`로 나간다. | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): S5-#6a와 같은 결함, 같은 수정·같은 테스트. 수정 방향 중 category switch 3개(`GraphQlWireErrorMapper.category`·`clientMessage`, `GraphQlWireErrors.classificationOf`)를 EnumMap 표 하나로 합치는 일은 지시대로 하지 않음 — Wave 3 3-A(Category별 한국어 문구 표를 shared-contract에)에서 `clientMessage`가 그 표로 대체되므로 그때 함께. 커밋 `aa5f4d90` | - | `GraphQlWireErrorMapper`에 `map(Throwable, GraphQlErrorContext)` 진입점 하나를 둔다. platform rejection을 먼저 보고, 그다음 application mapping(`ApiErrorCarrier`), 마지막에 internal로 처리한다. interceptor·instrumentation·field resolver 세 곳이 모두 이 mapper bean을 받는다(`GraphQlPlatformAutoConfiguration.java:388-396`에서 주입). category switch 3개(`GraphQlWireErrorMapper.java:94`, `GraphQlWireErrors.java:56`, `clientMessage`)는 `EnumMap` 표 하나로 합친다. |
|
||||
| NEW-9b | Nit | `shared-contract`의 `OperationalRecordStorePort` 패키지는 사용처가 0이다. | 남음 | `src/shared-contract/src/main/java/dev/caskeleton/shared/opstore/`(3개 파일). 이 패키지 밖에서 `shared.opstore`를 참조하는 곳은 main·test 모두 0건이다. 유일한 소비자였던 graphql `advanced/**`는 삭제됐다(`docs/capability-status.md:211`). | W3 | `shared/opstore/` 3개 파일을 삭제한다. `src/shared-contract/CLAUDE.md` 책임 목록에 있으면 그 줄도 지운다. `docs/study/graphql-walkthrough.ko.md:125,2064,2133`의 언급은 NEW-14에서 함께 고친다. |
|
||||
| NEW-10a | Consider | web 운영 경로에 JSON 중복 키 거부가 없다. | 남음 | `src/app-bootstrap/src/main/resources/application.yml:64-80`에는 `fail-on-unknown/null-for-primitives/ignored-properties`만 있다. 중복 키 감지는 web·bootstrap main 어디에도 없다(`STRICT_DUPLICATE_DETECTION` grep 0건). web-advanced에도 없다. JSON mapper factory(`WebObjectMapperFactory`·`BoundedJsonFactory`)는 web-advanced로 옮긴 뒤 삭제됐다(`docs/capability-status.md:208`). | W1 | `adapter:inbound:web`에 `JsonMapperBuilderCustomizer` 빈 하나를 두고 `StreamReadFeature.STRICT_DUPLICATE_DETECTION`을 켠다(Jackson 3, `tools.jackson.core`). 위치는 `WebAdapterAutoConfiguration` import 목록이다. contract test는 `{"a":1,"a":2}` → 400을 단언한다. |
|
||||
| NEW-10b | Consider | CORS origin의 형식을 기동 때 검증하지 않는다(scheme/host/port 형태, path·trailing slash·`null` origin). | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/settings/CorsSettings.java:24-53`은 "enabled면 비어 있지 않음"과 "`*`+credentials 금지" 두 가지만 검사한다. 예전 `WebCorsPolicyValidator`는 web-advanced로 옮긴 뒤 삭제됐다(`docs/capability-status.md:206`). | W1 | `CorsSettings` compact constructor에 origin마다 `URI` 파싱을 추가한다. `http`·`https` scheme과 host가 있어야 하고, path·query·fragment·trailing `/`와 `"null"`은 금지한다. `*`는 credentials가 없을 때만 허용한다. 실패하면 env 키 이름을 담은 메시지로 기동을 실패시킨다(기존 메시지 형식을 따른다). |
|
||||
| NEW-10c | Required | 신뢰하지 않는 forwarded 헤더를 거부하는 장치가 없다. rate-limit의 `FORWARDED_HEADERS_TRUSTED`는 XFF의 맨 왼쪽 값(클라이언트가 조작 가능)을 쓴다. | 남음 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/ratelimit/ForwardedHeaderClientIpResolver.java:10-17`은 `split(",")[0]`을 쓰고 remoteAddr가 proxy인지 확인하지 않는다. `server.forward-headers-strategy` 기본값은 `none`(`src/app-bootstrap/src/main/resources/config/server.yml:11`)이지만, `framework`로 바꾸면 모든 요청의 헤더를 신뢰한다. 예전 `ForwardedHeaderSanitizer`·`TrustedProxyPolicy`는 web-advanced로 옮긴 뒤 삭제됐다(`docs/capability-status.md:204`). | W1 | `EdgeRateLimitTransportSettings`에 `trusted-proxies`(CIDR 목록)를 추가한다. resolver는 remoteAddr가 trusted일 때만 XFF를 오른쪽에서부터 읽어 첫 번째 untrusted 주소를 쓰고, 아니면 remoteAddr를 쓴다. `FORWARDED_HEADERS_TRUSTED`인데 `trusted-proxies`가 비어 있으면 기동을 거부한다. `server.yml` 주석에는 `native` + `server.tomcat.remoteip.internal-proxies`를 명시하라고 적는다. |
|
||||
| NEW-10a | Consider | web 운영 경로에 JSON 중복 키 거부가 없다. | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): `RequestBodyBoundaryTest.duplicateJsonKeyIsRejectedAsValidationFailure`(`{"role":"user","role":"admin"}` → 400 `VALIDATION_FAILED`) FAIL(`Status expected:<400> but was:<200>`)→PASS. `JsonMapperBuilderCustomizer`로 `StreamReadFeature.STRICT_DUPLICATE_DETECTION`(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/autoconfigure/WebMvcPlatformAutoConfiguration.java:84`). 위치는 현황표의 `WebAdapterAutoConfiguration` 대신 같은 leaf의 `WebMvcPlatformAutoConfiguration`(요청 경계 필터와 같이 servlet 앱 조건·`backend.web.mvc.enabled`에 묶이고, 테스트가 무거운 security 조립 없이 이 루트 하나로 검증됨) | - | `adapter:inbound:web`에 `JsonMapperBuilderCustomizer` 빈 하나를 두고 `StreamReadFeature.STRICT_DUPLICATE_DETECTION`을 켠다(Jackson 3, `tools.jackson.core`). 위치는 `WebAdapterAutoConfiguration` import 목록이다. contract test는 `{"a":1,"a":2}` → 400을 단언한다. |
|
||||
| NEW-10b | Consider | CORS origin의 형식을 기동 때 검증하지 않는다(scheme/host/port 형태, path·trailing slash·`null` origin). | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): `CorsSettings` compact constructor가 origin마다 `URI` 파싱: `http`/`https`, host 필수, path(끝 `/` 포함)·query·fragment·user info·와일드카드 호스트·`"null"` 거부, `*`는 기존대로 credentials 없을 때만. 메시지에 `APP_SECURITY_CORS_ORIGINS (ca-skeleton.cors.allowed-origins)`. 테스트는 I-8b 행 | - | `CorsSettings` compact constructor에 origin마다 `URI` 파싱을 추가한다. `http`·`https` scheme과 host가 있어야 하고, path·query·fragment·trailing `/`와 `"null"`은 금지한다. `*`는 credentials가 없을 때만 허용한다. 실패하면 env 키 이름을 담은 메시지로 기동을 실패시킨다(기존 메시지 형식을 따른다). |
|
||||
| NEW-10c | Required | 신뢰하지 않는 forwarded 헤더를 거부하는 장치가 없다. rate-limit의 `FORWARDED_HEADERS_TRUSTED`는 XFF의 맨 왼쪽 값(클라이언트가 조작 가능)을 쓴다. | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): I-5a와 같은 수정(같은 커밋·테스트). 현황표 수정 방향(`trusted-proxies` CIDR 설정 추가)은 오케스트레이터 결정(모드 삭제 + native/internal-proxies)으로 대체. `.env.example`이 `framework`(모든 peer의 XFF를 믿음)를 기본으로 권하던 것도 이 행의 원인이라 `native`로 바꾸고 `framework`는 rate limit 기동 거부로 막음 | - | `EdgeRateLimitTransportSettings`에 `trusted-proxies`(CIDR 목록)를 추가한다. resolver는 remoteAddr가 trusted일 때만 XFF를 오른쪽에서부터 읽어 첫 번째 untrusted 주소를 쓰고, 아니면 remoteAddr를 쓴다. `FORWARDED_HEADERS_TRUSTED`인데 `trusted-proxies`가 비어 있으면 기동을 거부한다. `server.yml` 주석에는 `native` + `server.tomcat.remoteip.internal-proxies`를 명시하라고 적는다. |
|
||||
| NEW-10d | Nit | web fixture 앱 2개와 sample이 `WebAdapterAutoConfiguration` 전체를 제외한다. sample webSystemTest 4곳은 문자열 이름으로 제외한다. | 남음 | 클래스로 제외: `src/adapter/inbound/web/src/testFixtures/java/dev/caskeleton/webtestkit/ContractFixtureApplication.java:38`, `PipelineOrderFixtureApplication.java:46`, `src/sample-portfolio/src/main/java/dev/caskeleton/sample/portfolio/SamplePortfolioApplication.java:30,49`. 문자열로 제외: `OpenApiDriftContractTest.java:172`, `OpenApiSnapshotTest.java:103`, `DateHeaderContractTest.java:69`, `VirtualThreadMdcE2ETest.java:152`(모두 `src/sample-portfolio/src/webSystemTest/...`). 제외하는 이유는 production security chain을 빼기 위해서다(`ContractFixtureApplication.java:27-30`). | W3 | `src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/autoconfigure/WebAdapterAutoConfiguration.java`의 `@Import` 목록을 `WebAdapterAutoConfiguration`(core)과 `WebSecurityAutoConfiguration`(`JwtDecoderConfig`·`SecurityConfig`·`MethodSecurityConfig`·`RedisSessionWebConfig`·`JwtToAuthenticatedPrincipalConverter`·`AuthorizationAdapter`)으로 나눈다. fixture·sample은 security root만 클래스로 제외하고, sample은 `dev.caskeleton.adapter.inbound.web` component scan(`SamplePortfolioApplication.java:31-40`)을 지운다. 문자열 제외는 클래스 참조로 바꾼다. |
|
||||
| NEW-11 | Consider | fileserver를 JPA 줄 없이 고르면 Boot 관계형 자동 설정이 켜지고, 원인을 알기 어려운 오류로 기동에 실패한다. | 남음 | `src/adapter/outbound/persistence-fileserver/build.gradle`이 `implementation 'org.springframework.boot:spring-boot-starter-data-jpa'`를 가져서 runtime classpath에 Hibernate·Hikari가 들어온다. `src/composition/fileserver-platform/build.gradle`은 persistence-jpa를 의존하지 않는다. JPA를 끄는 쪽(`JpaActivationEnvironmentPostProcessor`)은 persistence-jpa에 있어서 이 경우 존재하지 않는다. 결과 추정: URL도 embedded DB도 없으면 `DataSourceAutoConfiguration`이 "Failed to configure a DataSource"로 실패한다. URL을 주면 `TransactionPort` 빈이 없어서 `FileserverUploadServiceConfiguration.java:86,116`·`FileserverMaintenanceServiceConfiguration.java:43`에서 NoSuchBean으로 실패한다. Flyway 핵심 stream과 `capability_schema_registry`도 없다(`FileserverSchemaActivation.java:22-30`). "JPA 필요"는 문서에만 있다(`src/README.md:270`, `src/composition/fileserver-platform/README.md:27`). notification도 같은 구조다(`docs/capability-status.md:36`). | W2 | 결정(2026-09-25): 한 줄 원칙 — fileserver·notification composition이 persistence-jpa를 `runtimeOnly`로 함께 가져옴 |
|
||||
| NEW-11 | Consider | fileserver를 JPA 줄 없이 고르면 Boot 관계형 자동 설정이 켜지고, 원인을 알기 어려운 오류로 기동에 실패한다. | 완료 | Wave 1–2 P4 (fcddab7e·Wave 2 커밋): `src/composition/fileserver-platform/build.gradle`에 `runtimeOnly project(':adapter:outbound:persistence-jpa')`, `src/config/architecture/modules.json` edge 추가, README 갱신(`src/composition/fileserver-platform/README.md` 저장소 줄, `src/README.md:270` 표). `architectureCheck`·`verifyDependencyLocks` 통과. JPA 줄 없이 fileserver만 고른 조립의 기동 테스트는 추가하지 않았다: 모든 테스트 classpath(app-bootstrap integrationTest 포함)에 persistence-jpa가 이미 있어 "없는 조립"을 만들 수 없다. 대신 조립 lane `:app-bootstrap:integrationTest`(fileserver PG 왕복 포함 4건) 통과 | - | 결정(2026-09-25): 한 줄 원칙 — fileserver·notification composition이 persistence-jpa를 `runtimeOnly`로 함께 가져옴 |
|
||||
| NEW-12 | Nit | `bootstrap.autoconfigure` 패키지가 component scan 범위 안에 있다. | 남음 | `src/app-bootstrap/src/main/java/dev/caskeleton/bootstrap/CaSkeletonApplication.java:19`: `@SpringBootApplication`이 `dev.caskeleton.bootstrap..` 전체를 scan한다. 지금 `autoconfigure/` 아래 4개 root는 imports에 있어서 Boot의 `AutoConfigurationExcludeFilter`가 걸러낸다. 그 외 stereotype은 `@ConfigurationProperties` record 3개뿐이다(grep: `@Configuration`·`@Component` 0건). 지금 당장 문제는 없고, 나중에 root가 아닌 `@Configuration`을 추가하면 조건 없이 등록되는 잠재 위험이다. | W3 | NEW-2 이동 뒤에 남는 `common`·`tracing` root를 scan 밖 패키지(예: `dev.caskeleton.autoconfigure.bootstrap`)로 옮긴다. 옮기지 않을 거면 architectureTest에 "`bootstrap.autoconfigure..`의 `@Configuration`은 `@AutoConfiguration`이어야 한다" 규칙을 추가한다. |
|
||||
| NEW-13a | Consider | `verifyEnvKeys`는 bootstrap에 유지하기로 결정됐는데, 문서는 아직 "옮기지 않은 검사"라고 적고 있다. | 남음 | 태스크는 `src/app-bootstrap/build.gradle:5`(`ca.config-contract`), 루트 `src/build.gradle:78`(`configContractCheck`)에 있다. 구현은 `src/build-tools/src/main/java/dev/caskeleton/buildtools/config/`(6개 파일)에 있다. 문구는 `CLAUDE.md:32`, `AGENTS.md:68`에 있다. | W3 | JPA evidence를 삭제하면(NEW-13b) build-tools에는 `ca.config-contract` 하나만 남는다. 그 plugin을 `src/build-logic/`으로 옮기고 `src/settings.gradle:6` `includeBuild('build-tools')`와 `build-logic.yml`의 build-tools 단계를 지운다. `CLAUDE.md:32`·`AGENTS.md:68`은 "verifyEnvKeys = app-bootstrap 유지"로 고친다. |
|
||||
| NEW-13b | Consider | JPA evidence manifest(`ca.jpa-evidence`, `ca.jpa-qualification`)를 폐기하고 leaf 테스트로 옮기기로 결정됐다. 아직 코드에 남아 있다. | 남음 | plugin: `src/build-tools/build.gradle:18-27`, 구현은 `src/build-tools/src/main/java/dev/caskeleton/buildtools/jpa/`(45개 파일, 2,701줄). 적용 위치: `src/build.gradle:20`, `src/adapter/outbound/persistence-jpa/build.gradle:5,141-178,216,261-264`. 입력: `src/config/jpa/readiness-cards.yaml`, `src/config/jpa/release-registry.json`. CI: `.github/workflows/jpa-r2-evidence.yml` 전체, `integration-main.yml:130-143`(`jpa-candidate-evidence`), `jpa-release.yml:121-122`. 다른 사용처: `MessagingCapabilityRegistryContractTest.java:128,140,225`가 `readiness-cards.yaml`을 읽고, `JpaReleaseManifest.java:46`(persistence-jpa testFixtures)가 `release-registry.json`을 읽는다. | W3 | build-tools의 `jpa/` 패키지와 두 plugin id를 삭제한다. evidence가 확인하던 사실(마이그레이션 순서, PG 버전 매트릭스, lane 존재)은 persistence-jpa `postgresqlIntegrationTest`의 JUnit 테스트로 옮긴다. yaml·json 입력과 `jpa-r2-evidence.yml`, integration-main의 `jpa-candidate-evidence` 잡, jpa-release의 두 태스크를 지운다. `MessagingCapabilityRegistryContractTest`에서 readiness-cards 의존을 뺀다. |
|
||||
@@ -1097,3 +1109,56 @@
|
||||
- 208077fd와 HEAD 사이에 삭제된 클래스만 셌다. 그 전에 삭제됐거나 처음부터 구현되지 않은 이름은 세지 않았으므로 실제 불일치는 더 많다.
|
||||
- 모듈 이름 언급은 세지 않았다.
|
||||
|
||||
## 후속 작업 중 발견한 결함 (2026-09-25 ~ 09-28)
|
||||
|
||||
Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검증에서 드러난 문제. 상세는 각 묶음 결과 파일 「새로 발견한 결함」 절.
|
||||
|
||||
| ID | 심각도 | 요약 | 상태 | 근거 | Wave | 수정 방향 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| P1-new-1 | 발견 | `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java` — broker 항목의 `acks`, `enable-idempotence`, `max-in-flight-requests-per-connection`, `del… | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P1.md` | - | - |
|
||||
| P1-new-2 | 발견 | `src/messaging/messaging-kafka/src/main/java/dev/caskeleton/messaging/kafka/KafkaConsumerRegistrar.java` — in-flight 천장·drain·pool 거부로 pause한 partition을 다시 resume하는 코드가 없음. ordered partition은 한 poll에 두 record를 받으면 첫 record 뒤 영구 정지… | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P1.md` | - | - |
|
||||
| P1-new-3 | 발견 | 같은 파일 — requeue 재개 시각을 `Instant.now()`로, poll은 호출자가 준 `now`로 비교해 두 시계가 섞임(테스트에서 재시도가 영원히 안 풀리거나 즉시 풀림). `InstantSource` 하나로 통일(M-7 수정에 포함) | 완료 | Wave 1–2 P1 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P1.md` | - | - |
|
||||
| P2-new-1 | 발견 | managed `publish`가 SCAN_CLEAN destination에서 scan 없이 게시한다 — `RoutingObjectMutationAdapter.publish`가 INTEGRITY_VERIFIED에서 곧바로 REFERENCE_PUBLISH_IN_PROGRESS로 가고 `requirePolicy`는 요구 수준이 같은지만 봤다. 이제 scan-gated destination이면 거부한다(`confi… | 완료 | Wave 1–2 P2 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P2.md` | - | - |
|
||||
| P2-new-2 | 발견 | sample abort와 reconcile의 경합에서 intent가 멈춘다 — `AbortPosterImageUploadUseCase`(`sample-portfolio/.../poster/AbortPosterImageUploadUseCase.java:63-81,91`)는 DB에 ABORT_AUTHORIZED를 먼저 커밋한 뒤 저장소에 `authorizeAbort`를 부른다. 그 사이 reconcile이 fin… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P2.md` | W2 | 결정 22: 먼저 끝난 쪽이 이긴다 — 이미 게시됐으면 abort는 409, 게시된 객체를 붙인다 |
|
||||
| P2-new-3 | 발견 | S3 managed provider `retire`가 항상 UNSUPPORTED를 던진다(`s3/S3ManagedObjectProvider.java:121-125`). S3 profile은 `CONDITIONAL_RETIREMENT`를 주장할 수 있어 destination 컴파일은 통과한다. D-1a 순서에서 S3 abort는 ABORTED를 기록한 뒤 retire에서 실패한다(바이트 잔존, 재시도도 같은 실… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P2.md` | W2 | S3 `retire` 구현 또는 S3 profile이 `CONDITIONAL_RETIREMENT`를 주장하지 못하게 |
|
||||
| P3-new-1 | 발견 | `ntf-app/admin/AdminAuthorizationGuard.java` `requireTenant`가 어떤 작업이든 거부 시 `AdminAccessDeniedException(SUPPRESS)`를 던졌다 — redrive·reconcile 거부가 SUPPRESS 권한 부족으로 보고됨. 실제 권한을 인자로 받게 고침(`:41`). | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | - | - |
|
||||
| P3-new-2 | 발견 | SNS 서명 인증서의 유효기간을 확인하지 않았다(`NotificationCallbackProviderConfig.java:80` `checkValidity()` 추가, B-2e와 함께). | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | - | - |
|
||||
| P3-new-3 | 발견 | JDK HttpClient의 요청 timeout은 응답 body 읽기를 덮지 않는다. B-6 재현 테스트의 FAIL이 증거다(요청 timeout 10초가 지나도 body 대기가 끝나지 않아 JUnit 20초 timeout). 상한 전까지 body를 조금씩 흘리는 provider(또는 SNS 인증서 host)는 dispatch 스레드를 무기한 잡을 수 있다. 위치 `ntf-adapter/provider/http… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | W2 | 응답 body 읽기에 별도 deadline |
|
||||
| P3-new-4 | 발견 | SES adapter도 B-9a와 같은 결함(비 email 연락처·reveal 실패가 ambiguous로 기록). 공용 `EmailRecipients`로 SMTP와 함께 고침. | 완료 | Wave 1–2 P3 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | - | - |
|
||||
| P3-new-5 | 발견 | 라우트의 profile runtime이 사라진 경우 `gateway.profile()`이 `IllegalStateException`(`ntf-adapter/dispatch/ProviderRuntimeRegistry.java:50`)을 던져 B-3과 같은 경로(attempt row 전, lease 미해제 → requeue 반복)를 탄다. 설정 drift라 "고쳐질 때까지 재시도"로 볼 수도 있어 FAILED로 … | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | W2 | 결정 21: 일반 재시도 정책(backoff·최대 횟수) 적용 후 FAILED + 사유 코드 |
|
||||
| P3-new-6 | 발견 | dispatch의 guard `Blocked` 전이와 routing stop 전이(`ntf-app/dispatch/NotificationDispatchService.java:138-142`, `applyRoutingStop`)는 lease fencing 없는 `transition`을 쓴다(B-5b와 같은 계열). provider 호출 전 짧은 구간이라 위험은 낮다. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P3.md` | W2 | guard `Blocked`·routing stop 전이를 lease fencing 있는 전이로 |
|
||||
| P4-new-1 | 발견 | fileserver migration(`src/adapter/outbound/persistence-fileserver/src/main/resources/db/migration/jpa/fileserver/V1..V5`)은 불변성 테스트가 없다. `AppliedMigrationImmutabilityTest`는 persistence-jpa의 `src/main/resources/db/migration`만 읽는다(`s… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W4 | fileserver migration에도 적용 파일 해시 고정 테스트 |
|
||||
| P4-new-2 | 발견 | 재조정이 READY를 복원할 때 quota를 commit하지 않는다. `src/application-fileserver/.../recovery/DefaultFileReconciliationService.java` `reconcilePrePublishWithKey`는 VERIFYING→READY 전이만 하고 `QuotaCommitGateway.commit`이 없다. C-3a·C-3b로 이 경로가 실제로 실행되므… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W2 | 재조정 READY 복원 때 quota commit |
|
||||
| P4-new-3 | 발견 | `DefaultFinalizeUploadService.advanceToVerifying`의 CREATED 분기가 CREATED→UPLOADED를 시도하지만 전이표에는 CREATED→UPLOADING뿐이라 `IllegalStateException`이 난다(`.../upload/DefaultFinalizeUploadService.java` `advanceToVerifying` 첫 if). | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W2 | CREATED 분기 전이를 전이표에 맞게 |
|
||||
| P4-new-4 | 발견 | lifecycle delete(`DefaultFileLifecycleService.delete`)로 진행 중 upload(UPLOADING)를 지우면 레코드는 DELETED가 되지만 세션은 ACTIVE로 남고 staging 정리가 예약되지 않는다. 이후 만료 sweep도 레코드가 DELETED라 staging을 예약하지 않아 staged bytes가 남는다. `FileRetirement`에 upload를 찾는… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P4.md` | W2 | 진행 중 upload 삭제 시 세션 종료·staging 정리 예약 |
|
||||
| P5-new-1 | 발견 | `src/grpc-advanced/grpc-advanced-compat/src/main/resources/envoy/envoy.yaml:37`(virtual host `cors`): Envoy v1.31 validate가 `VirtualHost.cors`를 deprecated("will be removed soon")로 경고한다. per-filter `typed_per_filter_config`의 `CorsP… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W5 | envoy CORS를 per-filter 설정으로 |
|
||||
| P5-new-2 | 발견 | `src/grpc/grpc-core-api/src/main/java/dev/caskeleton/grpc/core/GrpcMethodName.java`: `parse`는 전체 이름을 256자로 제한하지만 생성자는 service·method를 각각 256자로만 제한해 canonical이 최대 513자가 된다. ledger 쪽은 N-11b에서 막았지만 타입 자체의 두 경로가 다르다. 안 고침. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W2 | `GrpcMethodName` 두 생성 경로의 길이 제한 통일 |
|
||||
| P5-new-3 | 발견 | `src/grpc/grpc-policy/src/main/java/dev/caskeleton/grpc/security/GrpcCredentialRotationManager.java:125` `completeDrain()`이 인자 없이 "지금 draining인 것"을 지워서, 그 사이 새 rotation이 시작한 drain(방금 교체된 세대)을 일찍 끝낼 수 있다. 경합 자체(현재 세대 되돌림)는 N-5b로 고쳤… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W2 | `completeDrain`이 대상 rotation을 인자로 받게 |
|
||||
| P5-new-4 | 발견 | `src/grpc-advanced/grpc-advanced-{resilience,compat,edition,streaming}/build.gradle`: `api project(':grpc-advanced:grpc-advanced-bootstrap')`를 main이 쓰지 않는다(resilience는 `GrpcXdsStartupGuard` 삭제로 새로 0, 나머지 셋은 원래 0). build 줄과 registr… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P5.md` | W3 | 쓰지 않는 bootstrap 의존 제거 |
|
||||
| P6-new-1 | 발견 | `src/adapter/outbound/cache-redis/README.md` 「Useful focused checks」가 `./gradlew :app-bootstrap:test --tests '*RedisSemanticScriptAclProbeTest'`를 안내했지만 그 테스트는 cache-redis leaf에 있다. `:adapter:outbound:cache-redis:test`로 수정. 같은 READ… | 완료 | Wave 1–2 P6 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P6.md` | - | - |
|
||||
| P6-new-2 | 발견 | `IdempotencyExecutor`(application-core)는 `complete`가 `UNAVAILABLE`이면 곧바로 `IdempotencyUnavailableException`을 던진다(`IdempotencyExecutor.java:228`). 이번 수정으로 SCRIPT lane 포화 시 complete가 `INDETERMINATE`(재조정 경로) 대신 `UNAVAILABLE`을 받으므로, 효과… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P6.md` | W5 | 결정 24: 현재 동작 유지, README·Javadoc에 복구 경로 명시 |
|
||||
| P7-new-1 | 발견 | `src/adapter/outbound/notification/src/test/java/dev/caskeleton/adapter/outbound/notification/core/NotificationAdapterTest.java:65-82`: `RoutingNotifierTest`와 같은, 절대 실패하지 않는 PII 단언이 있었다(`"provider-failure"`). 고쳤다(W1 `9a05d686`). | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | - | - |
|
||||
| P7-new-2 | 발견 | `IdempotencyExecutor`의 `RetryableNoEffect` 경로도 `markFailed`가 예외를 던지면 원래 action 예외를 잃었다. A-8b와 함께 고쳤다(W2 `3a39b6b5`). | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | - | - |
|
||||
| P7-new-3 | 발견 | `src/sample-portfolio/src/main/resources/db/sample-migration/V2__work_log.sql:26-27`의 주석은 "local dev relies on ddl-auto=update"라고 적혀 있다. 실제로는 `SamplePostgreSqlPersistenceConfig.sampleMigrationStrategy`가 sample schema를 migrate한다. 이… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | W5 | 적용된 migration은 못 바꾸므로 sample README에 실제 경로 명시 |
|
||||
| P7-new-4 | 발견 | L-7a로 `show-details: never`가 되면 `show-components`도 따라서 never가 된다. 그러면 `/actuator/health` 응답에 component가 나오지 않는다. P13 `NEW-1a`(compose smoke가 켜진 capability를 확인)는 health component 대신 `info` 경로를 써야 한다. | 완료 | Wave 1–2 P7 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P7.md` | - | - |
|
||||
| P8-new-1 | 발견 | `GraphQlBatchLoadException`(per-key 실패, adopter가 준 `errorCode`)을 mapper가 모른다 → `INTERNAL_ERROR`로 가려지고 adopter code가 사라짐. `src/adapter/inbound/graphql/src/main/java/dev/caskeleton/adapter/inbound/graphql/dataloader/GraphQlBatchResu… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | W3 | 결정 25: 등록된 `ApiErrorCode`만 노출(3-A와 함께) |
|
||||
| P8-new-2 | 발견 | instrumentation 이 platform context 없이 온 요청(= interceptor 미배선 설정 오류)을 `INTERNAL_ERROR`+`PLATFORM_CONTEXT`로 거부하지만 로그를 남기지 않아, 잘못 조립된 배포가 모든 요청을 조용히 실패시킨다. `.../runtime/GraphQlPlatformInstrumentation.java:65-70`. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | W2 | platform context 없는 요청 거부 시 WARN 로그 |
|
||||
| P8-new-3 | 발견 | graphql `CLAUDE.md` 「Error mapping」 절이 없는 클래스 `GraphqlExceptionResolver`와 "비-carrier 예외는 null 반환"을 설명하고 있었음. 현재 경로(한 mapper, 마스킹+로그)로 고침. 커밋 `aa5f4d90`. | 완료 | Wave 1–2 P8 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | - | - |
|
||||
| P8-new-4 | 발견 | 이번 D 삭제 대상(`GraphQlRuntimeTransport`, `GraphQlExecutionProfile`, `GraphQlBlockingBridge`)을 설명하는 학습 문서가 남아 있음 — `docs/study/graphql-walkthrough.ko.md:157,461,871,1078`(결정 6 대상), `docs/graphql-superpowers-package/`. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P8.md` | W5 | 학습 문서 갱신(결정 6) |
|
||||
| P9-new-1 | 발견 | `InboxItemEntity.archive()`가 EXPIRED·DELETED 항목도 ARCHIVED로 바꾼다(`src/adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/notification/platform/inbox/InboxItemEntity.java` `archive`). terminal … | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W2 | `archive()`가 EXPIRED·DELETED를 거부 |
|
||||
| P9-new-2 | 발견 | `PostgreSqlInboxCutoffIntegrationTest`가 repository의 SQL이 아니라 테스트 안의 사본을 실행하고 있어 E-4a가 PG lane에서 보이지 않았다. 고침(repository `@Query`를 읽어 실행). | 완료 | Wave 1–2 P9 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | - | - |
|
||||
| P9-new-3 | 발견 | 같은 operationId를 다른 요청(다른 scope)으로 재사용하면 fake(`InMemoryDurableOperationStore`)는 조용히 덮어쓰고 PG adapter는 PK 위반으로 실패한다 — fake/adapter 불일치. HTTP 경로는 id를 서버가 발급해 영향 없음. 고치지 않음. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W4 | durable operation store 계약 테스트에 id 재사용 경우 추가, fake를 adapter와 맞춤 |
|
||||
| P9-new-4 | 발견 | `WebMvcRequestContextHolder.store(...)`를 부르는 운영 코드가 없어 `WebRequestContext`를 파라미터로 받는 컨트롤러는 항상 `IllegalStateException`으로 실패한다(`src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/mvc/context/WebMvcRequestContex… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W2 | 운영 경로에서 `WebRequestContext`를 채우거나 파라미터 사용처 제거 |
|
||||
| P9-new-5 | 발견 | 웹 운영 경로에 tenant 해석이 없다(`TenantContext.resolved` 호출자 없음). durable operation HTTP는 tenant를 null로 넘긴다. 결함이라기보다 미구현 — 기록만. | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P9.md` | W3 | tenant 해석(3-D tenant 값 타입과 함께) |
|
||||
| P10-new-1 | 발견 | `src/.env.example:25`가 `APP_SERVER_FORWARD_HEADERS_STRATEGY=framework`를 권했다. `framework`는 Spring `ForwardedHeaderFilter`가 모든 peer의 `X-Forwarded-For`를 믿어 `getRemoteAddr()` 자체를 호출자가 고르게 하므로, rate-limit 모드와 상관없이 비인증 키를 우회할 수 있었다. `na… | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P10.md` | - | - |
|
||||
| P10-new-2 | 발견 | `WebMvcRequestIdFilter`의 traceparent 정규식은 all-zero trace id 등을 받아들였고 `RequestLoggingFilter`의 `TraceParent.parse`는 거부해서, 같은 요청에서 두 필터가 다른 trace id를 가질 수 있었다(I-4b의 한 원인). 이제 `TraceParent.parse` 하나만 쓴다. | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P10.md` | - | - |
|
||||
| P10-new-3 | 발견 | 옛 콜백 컨트롤러의 `@RequestBody byte[]`는 form POST(`application/x-www-form-urlencoded`, query string 없음)에서 Spring 7 `ServletServerHttpRequest.getBody()`가 요청 파라미터로 다시 만든 본문을 준다(`getBodyFromServletRequestParameters`, spring-web 7.0.9 bytec… | 완료 | Wave 1–2 P10 (fcddab7e·Wave 2 커밋): 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P10.md` | - | - |
|
||||
| P11-new-1 | 발견 | `app.httpclient.clients[N].timeout.streaming-idle`(`APP_HTTPCLIENT_CLIENTS_N_TIMEOUT_STREAMING_IDLE`)은 바인딩만 되고 main 코드 어디서도 읽지 않음(reactive 삭제 전에도 그랬음). `HC/profile/TimeoutSettings.java:25`, `docs/httpclient/configuration-reference… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W3 | 읽지 않는 `timeout.streaming-idle` 키·env 키 삭제 |
|
||||
| P11-new-2 | 발견 | `scripts/verify-httpclient-docs.py:22`가 없는 경로 `src/app-bootstrap/.../autoconfigure/httpclient/HttpClientStartupValidator.java`를 읽어 `FileNotFoundError`로 실패함. 경로를 `.../httpclient/autoconfigure`로 바꿔 돌리면 `rotation-drain-timeout`이 `doc… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W5 | `scripts/verify-httpclient-docs.py` 경로 수정, `rotation-drain-timeout` 문서 추가 |
|
||||
| P11-new-3 | 발견 | `httpClientFailureInjectionTest`의 `FailureInjectionContractTest.disabledProxyFailsBeforeARequestCanBeSent`가 이 머신에서 실패(`expected: NOT_SENT but was: SENT_NO_RESPONSE`). Docker userland proxy(`docker-proxy` 동작 중)가 꺼진 Toxiproxy 리스너의 p… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W4 | Docker userland proxy에 의존하지 않는 방식으로 lane 수정(기준 커밋에서도 실패 — 기존 결함) |
|
||||
| P11-new-4 | 발견 | Dynamic Target cross-origin hop은 `SensitiveHeaderStripper` 표준 이름(`authorization`·`cookie`·`x-api-key`·`api-key` 등)만 제거하므로, 호출자가 `HeaderPolicy`로 넘긴 관례 밖 이름의 자격증명 헤더(예: `X-Client-Key`)는 다음 origin으로 따라감 `HC/dynamic/DefaultDynamicTarg… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P11.md` | W1 | 결정 23: cross-origin hop에서 호출자 헤더 전부 제거, 안전한 헤더만 유지 |
|
||||
| P12-new-1 | 발견 | bulk 경로가 `access.rawOperations().getCollection(...)`의 raw collection에 `bulkWrite`를 해서, `MongoConsistencyBinder`가 profile별 template에 `setWriteConcern`으로 건 write concern이 적용되지 않는다(Spring `MongoTemplate.getCollection`은 template write… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P12.md` | W2 | bulk 경로에 profile write concern 적용 |
|
||||
| P13-new-1 | 발견 | included build lock은 build-logic·build-tools 자신의 configuration(compile/test)만 잠근다. main build가 plugin을 쓸 때의 settings·root buildscript classpath는 main build에서 따로 해석되고 잠기지 않는다. 증거: `./gradlew buildEnvironment`에서 `project :build-tool… | 보류 | 사유: 잠그면 Spring Boot plugin을 올릴 때마다 lock 갱신 필요, included build 자체는 잠갔다. 승인자: 저장소 소유자(2026-09-28, 결정 27) | - | - |
|
||||
| P13-new-2 | 발견 | `local-redis` lane은 기동 로그 무음 검사(스크립트 3c)를 통과할 수 없다. lane 자신이 주는 `APP_REDIS_AUTHENTICATION_ANONYMOUS_ACCESS_ACCEPTED=true`와 advanced credential 미설정 때문에 `RedisSdkAutoConfiguration`이 기동 중 WARN 2줄(`Redis is running without credentials… | 남음 | 결과 파일 `docs/reviews/2026-09-25-review-followup-results/P13.md` | W4 | `local-redis` lane 설정 또는 smoke 무음 검사 기준 정리(NEW-1b와 함께) |
|
||||
| NEW-15 | 발견 | gRPC proto 조직 이름이 템플릿 이름이 아니라 `hyeonworks`로 고정 — `GrpcProtoStyleManifest.caSkeleton()` `organization`, 기본 proto 패키지 `hyeonworks.grpc.common.v1`, `GrpcCodegenManifest`, 테스트 38개 파일. 재사용 체크리스트에도 없음 | 남음 | `src/grpc/grpc-proto-contract/src/main/java/dev/caskeleton/grpc/contract/GrpcProtoStyleManifest.java:62`, `src/grpc/grpc-proto-contract/src/main/resources/proto/hyeonworks/`, `src/grpc/grpc-codegen/.../GrpcCodegenManifest.java:63` | W3 | 결정 18(protobuf 플러그인 전환)과 함께 `caskeleton`으로 바꾸고 `AGENTS.md` 재사용 체크리스트에 한 줄 |
|
||||
| NEW-16 | 발견 | `integrationCheck`가 로컬에서 통과할 수 없는 lane을 묶음 — Redis topology 3개는 `-Predis.topology.mode` 없이 fail-closed, AWS 보호 lane은 보호 자격 증명 env가 없으면 실패. 그래서 집계 태스크가 항상 실패 | 남음 | Wave 1·2 검증 로그: `redisTopologyTest was selected with redis.topology.mode='unset'`, `AwsS3QualificationPreconditionsTest` | W3 | 매개변수·자격 증명이 필요한 lane은 `integrationCheck`에서 빼고 전용 워크플로에서만(또는 입력이 있을 때만 포함) |
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
# 재개 프롬프트 — 리뷰 후속 Wave 3–5 (desktop에서 이어 하기)
|
||||
|
||||
> 사용법: desktop에서 이 저장소(`/home/donghyeon/workspace/chat-gpt-container/codebase/clean-architecture-backend-template`, 브랜치 `refactor/review-followup`)를 연 Claude Code 세션에
|
||||
> `docs/reviews/2026-09-28-review-followup-resume-prompt.md 를 읽고 그대로 진행하자` 한 줄로 시작한다.
|
||||
|
||||
---
|
||||
|
||||
## 프롬프트 본문
|
||||
|
||||
### 0. 지금까지 (2026-09-25 ~ 09-28, 노트북에서 진행)
|
||||
|
||||
- 입력: 1차 리뷰 `docs/reviews/2026-09-24-src-module-code-review.md`(그룹 A–O), 2차 리뷰 `docs/reviews/2026-09-24-src-maintainability-review.md`(BUILD·TEST·X1·X2·S1–S7). 원래 지시는 `docs/reviews/2026-09-25-review-followup-prompt.md`.
|
||||
- 현황표 `docs/reviews/2026-09-25-review-followup-status.md`: 두 리뷰의 모든 항목을 행으로 만들고 현재 코드 기준으로 판정했다. 지금 859행(리뷰 812 + 작업 중 새로 찾은 결함 47) 중 **완료 370 · 해당 없음 112 · 보류 2 · 남음 375**(W1 4 · W2 17 · W3 196 · W4 57 · W5 101).
|
||||
- 계획 `docs/superpowers/plans/2026-09-25-review-followup.md`: Wave 1(보안·데이터)·Wave 2(정합성)는 끝났다. 13개 작업 묶음(P1–P13)을 worktree 에이전트로 병렬 구현하고 main 작업 트리에 합쳐 전체 게이트로 검증했다. 기록은 맨 아래 「진행 기록」.
|
||||
- 묶음별 결과(행 결과·제거된 코드·새 결함): `docs/reviews/2026-09-25-review-followup-results/P*.md`.
|
||||
- 에이전트 공통 지시·스크립트: `docs/superpowers/plans/2026-09-25-review-followup-tools/`(`agent-brief.md`, `apply_results.py` = 결과 파일로 현황표 갱신, `by_area.py` = 남은 행을 영역·Wave별로 나열. 둘 다 저장소 루트에서 실행).
|
||||
- **소유자 결정 27건**이 현황표 「소유자 결정」 절에 있다. 전부 따른다. 다시 묻지 않는다. 특히: 에러 응답은 Envelope 하나 + client 문구 한국어(Draft-12 offset 문서만 프로토콜 예외), outbox는 canonical(`OutboxAppendPort`)로 통일하고 legacy 포트·legacy Kafka seam 삭제, outbox relay·멱등성 executor 조립은 별도 `composition:*` 모듈, 설정 prefix는 `app.*`, SES는 AWS SDK(sesv2), gRPC `.proto`는 protobuf Gradle 플러그인 + Buf(CI), Kafka 소비 지원(`MessageHandler<T>` 하나), `@DisplayName`은 한국어, 삭제된 코드를 설명하는 학습 문서는 현재 코드에 맞게 갱신.
|
||||
|
||||
### 1. 목표
|
||||
|
||||
현황표의 남은 행 375개를 전부 `완료` / `해당 없음` / `보류(사유·승인자)`로 닫는다. 완료 조건은 원래 지시 8절과 같다: 모든 행이 닫히고, 계획서 「진행 기록」에 Wave별 검증 결과가 있고, 검증 명령이 작업 브랜치에서 전부 통과(기존 환경 의존 실패는 사유와 함께 기록).
|
||||
|
||||
### 2. 먼저 읽을 것
|
||||
|
||||
1. `AGENTS.md`(HARD-STOP 7개, capability 모듈 규칙, 테스트 작성 규칙 6개 — 단 `@DisplayName`은 한국어), `CLAUDE.md`
|
||||
2. 현황표의 「소유자 결정」 절과 「후속 작업 중 발견한 결함」 절
|
||||
3. 계획서 전체(특히 「Global Constraints」, 「실행 방식」, 「Wave 3/4/5」 개요, 「진행 기록」)
|
||||
4. `docs/superpowers/plans/2026-09-25-review-followup-tools/agent-brief.md`
|
||||
|
||||
### 3. 할 일 (순서)
|
||||
|
||||
0. **환경 확인:** `git pull` 뒤 `git log --oneline -3`으로 이 문서를 추가한 커밋이 HEAD인지 본다. `nproc`, `free -g`, `docker ps`로 자원을 보고 동시 에이전트 수를 정한다(노트북은 여유 메모리 5GB라 3개였다). `cd src && ./gradlew check --continue`로 기준선을 확인한다.
|
||||
1. **남은 W1·W2 먼저 (Wave 2.5):** `python3 docs/superpowers/plans/2026-09-25-review-followup-tools/by_area.py --list W1 <영역>`·`--list W2 <영역>`으로 나열. W1 4행 중 3행(`X1-지도-Kafka producer`, `X1-#1f`, `NEW-4a`)은 legacy Kafka seam 삭제(아래 3-C)로 닫히니 3-C에서 처리. `P11-new-4`(결정 23)와 W2 17행(대부분 `P*-new-*`)은 영역별 묶음으로.
|
||||
2. **Wave 3 — 구조 (196행):** 계획서 「Wave 3」에 상세 Task를 먼저 추가한다(rolling-wave). 여러 leaf를 한 번에 바꾸는 공통 작업은 **순차**로:
|
||||
- 3-A 에러 어휘: Envelope 하나, `ApiErrorCode` 하나, shared 예외 `ApiErrorCarrier`, `Category`별 한국어 문구 표(shared-contract), IAE는 모든 전송 400, GraphQL은 등록된 코드만 노출(결정 25).
|
||||
- 3-B 설정 prefix `app.*`(gRPC 어댑터는 벤더 설정과 나란히 `app.grpc.server`처럼 — 부모 prefix를 쓰면 기동 실패가 다시 생긴다, P5 메모).
|
||||
- 3-C outbox canonical 통일(JSON encoder 제공, sample 3곳 + durable operation 이전) + legacy 포트·legacy Kafka seam 삭제 + outbox relay·멱등성 executor를 `composition:*` 모듈로(NEW-2) + sample `SampleIdempotencyConfig` 복사본 제거.
|
||||
- 3-D 공통 유틸(`Sha256`, `Backoff`, traceparent 파싱, 서명 헬퍼), tenant 값 타입과 운영 web 경로의 tenant 해석(P9-new-5, X2-P2-6b), caller 트랜잭션 guard 하나.
|
||||
그다음 영역별 묶음: Kafka 소비(결정 10), SES → AWS SDK(결정 17), gRPC protobuf 플러그인 + Buf(결정 18, 이때 proto 조직 이름 `hyeonworks` → `caskeleton`, NEW-15), `persistence-notification` leaf 추출, sample이 web leaf를 통째로 scan하는 구조 정리(NEW-10d), `integrationCheck` 구성 정리(NEW-16), SRP 분해·구현 1개 인터페이스 정리·이름 규칙, 빌드 게이트 이동(JPA evidence manifest 폐기, API surface → PR `check`).
|
||||
3. **Wave 4 — 테스트 규칙 (57행):** `AGENTS.md` 규칙 2를 한국어로, 포트별 추상 계약 테스트(lock·lease 포함), 약한 단언, 계층별 모범 모듈, 18개 compose lane 실제 실행(NEW-1b).
|
||||
4. **Wave 5 — 문서 (101행):** W5 행 전부 + 학습 문서(`docs/study/*.ko.md`, `docs/*-superpowers-package/`)를 현재 코드 기준으로 갱신(결정 6). 마지막에 현황표 요약 수치를 다시 센다.
|
||||
|
||||
### 4. 실행 방식 (지난 Wave에서 검증된 방법)
|
||||
|
||||
- 묶음 하나 = 구현 에이전트 하나, `isolation: worktree`. 프롬프트는 짧게: "공통 지시 `docs/superpowers/plans/2026-09-25-review-followup-tools/agent-brief.md`를 읽고 따른다 + 묶음 ID 목록 + 묶음별 주의사항 + 결과 파일 절대 경로(`<원본 작업 트리>/docs/reviews/2026-09-25-review-followup-results/<Wave>-P<번호>.md`) + 원본 작업 트리 경로".
|
||||
- 에이전트는 자기 worktree 브랜치에 `D`→`W<n>` 순서로 커밋한다. 오케스트레이터는 `git cherry-pick -n <해시>`로 main 작업 트리에 모은다. **충돌·실패는 멈추고 해결한다.** 끝난 worktree는 깨끗한지 확인 후 `git worktree remove`(브랜치는 남김). 잠겨 있으면 살아 있는 프로세스가 없는지 보고 `git worktree unlock`.
|
||||
- **묶음끼리의 의미 충돌을 예상한다.** 각 묶음이 자기 worktree에서 통과해도 합치면 깨진 사례가 이번에 3건 있었다: (1) 한 묶음이 저장값 검증을 추가 → 다른 묶음 테스트 fixture의 가짜 hash가 거부됨, (2) 새 `@RestController`를 sample의 component scan이 주워 감, (3) 같은 테스트를 두 묶음이 다른 기대값으로 고침. 그래서 **합친 뒤 전체 게이트를 반드시 돌린다.**
|
||||
- `docs/capability-status.md`, 현황표, 계획서, lockfile은 에이전트가 아니라 오케스트레이터가 고친다(결과 파일의 「제거된 코드」 행은 `docs/capability-status.md` 표 끝에 붙인다 — `CapabilityStatusDocumentTest`가 이 파일을 읽으니 Gradle이 도는 중에는 고치지 않는다).
|
||||
- 에이전트가 셸 heredoc으로 파일을 쓰다 멈춘 적이 있다. 파일은 파일 도구로. 긴 Gradle에는 `timeout`. 같은 작업 트리에서 Gradle은 동시에 하나.
|
||||
- migration: 적용됐을 수 있는 versioned migration은 수정 금지, 새 버전 + `src/adapter/outbound/persistence-jpa/src/test/resources/db/applied-migrations.sha256`. 현재 최신: persistence-jpa `V18`, fileserver `V5`, messaging `V1005`.
|
||||
|
||||
### 5. Wave 종료 검증
|
||||
|
||||
```bash
|
||||
cd src
|
||||
./gradlew check --continue
|
||||
./gradlew ci verifyDependencyLocks --warning-mode=fail
|
||||
./gradlew mainCheck --continue
|
||||
./gradlew architectureCheck verifyPublicPathSnapshot :app-bootstrap:verifyEnvKeys configContractCheck
|
||||
./gradlew :app-bootstrap:integrationTest :sample-portfolio:integrationTest :sample-portfolio:systemTest
|
||||
./gradlew integrationCheck --continue
|
||||
./gradlew -p build-logic test && ./gradlew -p build-tools test && ./gradlew -p optional-platforms ci
|
||||
./gradlew :app-bootstrap:qualificationBootJar
|
||||
# Redis topology lane (integrationCheck에서는 모드가 없어 실패한다 — NEW-16):
|
||||
# REDIS_VERSION=7.4 docker compose -f ../infra/redis-sdk/standalone/compose.yml up -d --wait
|
||||
# ./gradlew :adapter:outbound:redis-runtime:redisTopologyTest :adapter:outbound:redis-sdk:redisTopologyTest \
|
||||
# :adapter:outbound:cache-redis:redisTopologyTest --continue \
|
||||
# -Predis.topology.host=localhost -Predis.topology.port=6379 -Predis.topology.mode=standalone
|
||||
# docker compose -f ../infra/redis-sdk/standalone/compose.yml down -v
|
||||
```
|
||||
|
||||
`integrationCheck`의 기존 실패(이번 작업 전에도 실패, 고치는 것은 NEW-16·P11-new-3 행): Redis topology 3개(모드 인자 없음), `httpClientFailureInjectionTest.disabledProxyFailsBeforeARequestCanBeSent`(Docker userland proxy 의존), `objectStorageAwsQualificationTest`(보호 자격 증명 env 필요). 이 셋 말고 새 실패가 나오면 멈추고 원인을 찾는다. 로컬 SpotBugs가 "missing analysis class … .jar.jar"로 실패하던 문제는 `QualityConventionsPlugin`에서 고쳤다.
|
||||
|
||||
### 6. 커밋·보고
|
||||
|
||||
- 브랜치 `refactor/review-followup`에 Wave마다 커밋(소유자 결정 1). `main` 병합과 push는 사용자가 요청할 때만.
|
||||
- 커밋 메시지 끝: `Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>`
|
||||
- 보고는 짧게: 변경 / 확인(실행한 명령과 결과 수치) / 남은 문제. Wave마다 Slack `#clean-architecture-전체`(channel_id `C0BCN9H9ABH`)에 작업 브리핑(`:memo: *[작업] …*` 템플릿, 둘째 줄에 `repo`·`branch`·시각).
|
||||
- 사용자는 작은 증분마다 확인받는 것보다 검증까지 끝낸 큰 덩어리를 선호한다. 진짜로 사용자 몫인 결정만 묻는다(여러 개면 한 번에 모아서, 기본값 추천과 함께). 사용량 한도가 있으니 에이전트는 묶음을 크게 잡아 수를 줄인다(지난번 구현 에이전트는 묶음당 약 36만~72만 토큰).
|
||||
@@ -2762,7 +2762,8 @@ scan 대상 6개: `audit`, `failure`, `idempotency`, `lock`, `outbox`, `transact
|
||||
|
||||
| 가드 | 하는 일 |
|
||||
|---|---|
|
||||
| `JpaDangerousConfigurationGuard` | `spring.jpa.open-in-view=true` (local convenience 프로필 외), 스키마 변경 `ddl-auto` 거부 |
|
||||
| `JpaDangerousConfigurationGuard` | 스키마 변경 `ddl-auto` 거부 (local convenience 프로필 외) |
|
||||
| `OpenInViewSafetyValidator` | `spring.jpa.open-in-view=true` 거부 — local 포함 모든 프로필 (guard에 있던 local 예외는 이 검사 때문에 도달할 수 없어 2026-09-25 삭제) |
|
||||
| `JpaDataSourceProfileValidator` | resolved `DataSource`를 열어서 product/version 확인 |
|
||||
| `PostgreSqlVersionPolicy` | PostgreSQL 16/17/18만 허용 |
|
||||
| `PersistenceVendorProdSafetyValidator` | prod에서 H2 거부 |
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# 구현 에이전트 공통 지시 (리뷰 후속)
|
||||
|
||||
당신은 구현 에이전트다. 프롬프트가 지정한 묶음(`P<번호>`)을 끝까지 구현·검증·커밋한다.
|
||||
|
||||
## 작업 환경
|
||||
- 당신의 현재 작업 디렉터리는 이 저장소(Java 21 + Spring Boot 4.0.8 Gradle 멀티모듈 Clean Architecture 템플릿)의 **격리된 git worktree**다. `git rev-parse --show-toplevel`로 루트를 확인하고, 모든 편집·Gradle 실행은 이 worktree 안에서만 한다. 원본 작업 트리(오케스트레이터가 프롬프트에 적은 경로)는 절대 건드리지 않는다(읽기도 worktree 쪽 파일로).
|
||||
- Gradle: `cd src && timeout 2400 ./gradlew <gradle-path>:check --max-workers=2 --console=plain`. 이 worktree에서 Gradle은 한 번에 하나만. 다른 에이전트 2개가 동시에 돌고 있어 메모리가 빠듯하다(`--max-workers=2` 필수). Docker는 사용 가능(Testcontainers lane).
|
||||
- 파일은 Read/Edit/Write 도구로 쓴다. 셸 heredoc·`echo >`로 소스 파일을 쓰지 않는다.
|
||||
|
||||
## 먼저 읽을 것
|
||||
1. `AGENTS.md` — HARD-STOP 7개, 「부가 기능(capability) 모듈 규칙」, 「테스트 전략」의 테스트 작성 규칙 6개. **단 `@DisplayName` 언어는 한국어**(소유자 결정, AGENTS.md 문구는 나중 Wave에서 고침).
|
||||
2. `CLAUDE.md`, 작업할 leaf의 가장 가까운 `src/**/CLAUDE.md`, leaf 경로·gradle_path·허용 edge는 `src/config/architecture/modules.json`.
|
||||
3. 계획 `docs/superpowers/plans/2026-09-25-review-followup.md`의 「Global Constraints」, 「실행 방식」, 그리고 당신 묶음 절.
|
||||
4. 현황표 `docs/reviews/2026-09-25-review-followup-status.md`에서 당신 ID들의 행(`grep -n '^| <ID> ' …`). 「수정 방향」 열이 행별 수정 지시이고 「근거」 열에 현재 `file:line`이 있다. 소유자 결정 20건은 현황표 「소유자 결정」 절. 배경이 더 필요하면 원 리뷰 `docs/reviews/2026-09-24-src-module-code-review.md`(1차, 그룹 A–O), `docs/reviews/2026-09-24-src-maintainability-review.md`(2차, BUILD/TEST/X1/X2/S1–S7)를 본다.
|
||||
|
||||
## 규칙
|
||||
- 순서: D(결정된 삭제, 있으면) → 커밋 → W1 → 커밋 → W2 → 커밋. 커밋 메시지 `review-followup P<번호> <D|W1|W2>: <한국어 요약>` + 빈 줄 + `Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>`. 당신 worktree 브랜치에서만 커밋하고 push하지 않는다. 다른 브랜치를 건드리지 않는다.
|
||||
- 결함 수정은 TDD: 재현 테스트를 먼저 쓰고 실행해 FAIL을 확인(실패 메시지 한 줄을 결과 파일에 기록)한 뒤 고치고 PASS를 확인한다. 테스트 규칙 6개를 따른다(이름은 lowerCamelCase 행동 문장, 본문 3문장 이상이면 `// given // when // then`, `// when` 하나, 예외는 `catchThrowable`로 분리해 타입+메시지 단언, 포트 대역은 fake). fake가 결함을 숨기는 포트면 추상 계약 테스트로 fake와 어댑터를 함께 돌린다. DB·브로커 동작은 실제 벤더 lane으로 확인한다.
|
||||
- 현황표의 수정 방향이 코드를 읽어 보니 틀렸으면, 더 작고 올바른 수정을 하고 결과 파일 근거에 이유를 적는다. 소유자 결정이 필요한 새 질문이 생기면 추측하지 말고 `보류`(사유: 결정 필요 …)로 둔다.
|
||||
- DB 스키마가 바뀌면 이미 적용됐을 수 있는 migration은 수정하지 말고 새 버전을 추가한 뒤 `src/adapter/outbound/persistence-jpa/src/test/resources/db/applied-migrations.sha256`에 한 줄 추가한다(`AppliedMigrationImmutabilityTest`). 다른 묶음도 새 migration을 추가할 수 있으니, 버전 번호 충돌은 통합 때 오케스트레이터가 조정한다(결과 파일에 추가한 버전을 적는다).
|
||||
- 모듈 edge는 `modules.json` 밖으로 만들지 않는다. 꼭 필요하면 registry에 추가하고 이유를 커밋 메시지에 적는다. 설정 키·env 키를 바꾸면 `docs/registries/env-keys.yaml`과 `src/.env.example`도 고치고 `./gradlew :app-bootstrap:verifyEnvKeys`를 돌린다. 공개 타입이 바뀌어 API surface 검사가 실패하면 해당 `update*ApiSurface -Papprove*` 태스크로 재승인한다(notification은 `-PapproveNotificationApiSurfaceChange`). 공개 HTTP 경로가 바뀌면 `verifyPublicPathSnapshot`의 승인 절차(build 파일에서 확인)를 따른다. 의존성이 바뀌면 `./gradlew <path>:resolveAndLockAll --write-locks`.
|
||||
- **고치지 말 파일:** `docs/capability-status.md`, 현황표, 계획서. 대신 결과 파일에 적는다.
|
||||
- 끝나기 전 검증: 건드린 모든 leaf의 `check`, 묶음에 적힌 실제 벤더 lane, `./gradlew architectureCheck --max-workers=2`, env/의존성 변경 시 `:app-bootstrap:verifyEnvKeys`·`verifyDependencyLocks`. 실패를 남긴 채 끝내지 않는다. 못 고친 것은 그대로 보고한다. `git status`가 깨끗해야 한다(전부 커밋).
|
||||
|
||||
## 결과 파일
|
||||
`docs/reviews/2026-09-25-review-followup-results/<Wave>-P<번호>.md`(원본 작업 트리 쪽 절대 경로는 오케스트레이터가 프롬프트에 적는다) 에 Write 도구로 아래 세 절을 쓴다:
|
||||
|
||||
```
|
||||
## 행 결과
|
||||
| ID | 결과 | 근거 |
|
||||
|---|---|---|
|
||||
(당신 묶음의 모든 ID 한 행씩. 결과는 `완료` / `해당 없음(코드 삭제)` / `보류` / `남음`. 완료면 테스트 클래스·메서드 이름과 FAIL→PASS, 현재 `file:line`. 해당 없음이면 삭제 커밋. 보류면 사유와 "승인자: 저장소 소유자 결정 필요". 남음이면 이유.)
|
||||
|
||||
## 제거된 코드
|
||||
| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 |
|
||||
|---|---|---|---|
|
||||
(삭제한 것마다 한 행. 마지막으로 존재한 커밋은 `6d27356e`.)
|
||||
|
||||
## 새로 발견한 결함
|
||||
(현황표에 없는 결함만. ID `P<번호>-new-1`…, 위치와 한 줄 설명. 고쳤으면 그렇다고.)
|
||||
```
|
||||
|
||||
## 최종 응답 (짧게)
|
||||
- worktree 경로와 브랜치 이름, 커밋 목록(해시 + 메시지)
|
||||
- 행 결과 집계(완료/해당 없음/보류/남음 수)
|
||||
- 실행한 검증 명령과 결과(통과/실패 수치)
|
||||
- 남은 문제
|
||||
@@ -0,0 +1,87 @@
|
||||
"""Run from the repository root.
|
||||
Apply package result files to the status document.
|
||||
|
||||
Usage: python3 apply_results.py <wave-label> <commit-label> results/P1.md [results/P2.md ...]
|
||||
Updates 상태·근거 of each listed ID; `남음` results keep the row open with the reason appended.
|
||||
Prints IDs it could not find and a new status summary. Refuses unknown result values.
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
|
||||
STATUS = Path("docs/reviews/2026-09-25-review-followup-status.md")
|
||||
SPLIT = re.compile(r"(?<!\\)\|")
|
||||
RESULTS = ("완료", "해당 없음", "보류", "남음")
|
||||
|
||||
|
||||
def parse_results(path):
|
||||
section, out = None, []
|
||||
for line in Path(path).read_text(encoding="utf-8").splitlines():
|
||||
if line.startswith("## "):
|
||||
section = line[3:].strip()
|
||||
continue
|
||||
if section != "행 결과" or not line.startswith("| ") or line.startswith(("| ID ", "|---")):
|
||||
continue
|
||||
cells = [c.strip() for c in SPLIT.split(line)[1:-1]]
|
||||
if len(cells) < 3:
|
||||
continue
|
||||
rid, result, evidence = cells[0].strip("`"), cells[1], " ".join(cells[2:])
|
||||
if not result.startswith(RESULTS):
|
||||
sys.exit(f"{path}: {rid}: unknown result {result!r}")
|
||||
out.append((rid, result, evidence))
|
||||
return out
|
||||
|
||||
|
||||
def main():
|
||||
only = None
|
||||
args = sys.argv[1:]
|
||||
if args[0] == "--only-waves":
|
||||
only, args = set(args[1].split(",")), args[2:]
|
||||
wave, commit, files = args[0], args[1], args[2:]
|
||||
updates = {}
|
||||
for f in files:
|
||||
for rid, result, evidence in parse_results(f):
|
||||
for part in rid.split(" / "):
|
||||
updates[part.strip()] = (result, evidence, Path(f).stem)
|
||||
lines = STATUS.read_text(encoding="utf-8").splitlines()
|
||||
seen = set()
|
||||
for i, line in enumerate(lines):
|
||||
if not line.startswith("| ") or line.startswith("| ID "):
|
||||
continue
|
||||
cells = [c.strip() for c in SPLIT.split(line)[1:-1]]
|
||||
if len(cells) != 7:
|
||||
continue
|
||||
ids = [p.strip() for p in cells[0].split(" / ")]
|
||||
hit = next((p for p in ids if p in updates), None)
|
||||
if hit is None:
|
||||
continue
|
||||
result, evidence, package = updates[hit]
|
||||
if only is not None and cells[5] not in only and not result.startswith("해당 없음"):
|
||||
continue
|
||||
seen.update(p for p in ids if p in updates)
|
||||
evidence = evidence.replace("|", "\\|") if "\\|" not in evidence else evidence
|
||||
if result.startswith("남음"):
|
||||
cells[4] = f"{cells[4]}<br>{wave} {package}: 미완 — {evidence}"
|
||||
else:
|
||||
cells[3] = result
|
||||
cells[4] = f"{wave} {package} ({commit}): {evidence}"
|
||||
if not result.startswith("보류"):
|
||||
cells[5] = "-"
|
||||
lines[i] = "| " + " | ".join(cells) + " |"
|
||||
STATUS.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
missing = sorted(set(updates) - seen)
|
||||
if missing:
|
||||
print("NOT FOUND:", ", ".join(missing))
|
||||
counts = Counter()
|
||||
for line in lines:
|
||||
cells = [c.strip() for c in SPLIT.split(line)[1:-1]]
|
||||
if len(cells) == 7 and cells[0] != "ID":
|
||||
for key in RESULTS:
|
||||
if cells[3].startswith(key):
|
||||
counts[key] += 1
|
||||
print(dict(counts))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,92 @@
|
||||
"""Run from the repository root.
|
||||
Assign open status rows to work areas. Usage: python3 by_area.py [--list WAVE AREA] [--ids WAVE AREA]"""
|
||||
import re
|
||||
import sys
|
||||
from collections import Counter, defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
STATUS = Path("docs/reviews/2026-09-25-review-followup-status.md")
|
||||
SPLIT = re.compile(r"(?<!\\)\|")
|
||||
|
||||
GROUP_AREA = {
|
||||
"A": "core", "B": "notification", "C": "fileserver", "D": "objectstorage", "E": "jpa",
|
||||
"F": "mongo", "G": "redis", "H": "httpclient", "I": "web", "J": "graphql", "K": "realtime-grpc",
|
||||
"L": "bootstrap-sample", "M": "messaging", "N": "realtime-grpc", "O": "build",
|
||||
}
|
||||
# Keyword order matters: first match wins.
|
||||
NEW_AREA = {1: "build", 2: "messaging", 3: "fileserver", 4: "messaging", 5: "redis", 6: "objectstorage",
|
||||
7: "jpa", 8: "notification", 9: "graphql", 10: "web", 11: "fileserver", 12: "bootstrap-sample",
|
||||
13: "build", 14: "docs"}
|
||||
KEYWORDS = [
|
||||
("messaging", r"messaging|kafka|outbox|MessageHandler|PublishResult|MSG-"),
|
||||
("notification", r"notification|알림|\bSES\b|provider 5종|SesSuppression"),
|
||||
("fileserver", r"fileserver|\btus\b|Draft-12|upload|FileRecord"),
|
||||
("objectstorage", r"objectstorage|object storage|\bS3\b|MinIO"),
|
||||
("graphql", r"graphql|GraphQl"),
|
||||
("realtime-grpc", r"grpc|gRPC|websocket|WebSocket|STOMP|\.proto"),
|
||||
("mongo", r"mongo|Mongo"),
|
||||
("redis", r"redis|Redis|lease"),
|
||||
("httpclient", r"httpclient|HttpClient|WebClient|OAuth2"),
|
||||
("jpa", r"persistence-jpa|\bJPA\b|Jpa|Flyway|migration|durable operation|DurableOperation|lock"),
|
||||
("web", r"adapter/inbound/web|web-advanced|\bweb\b|Envelope|WebProblem|CORS|forwarded"),
|
||||
("bootstrap-sample", r"app-bootstrap|bootstrap|sample"),
|
||||
("build", r"build-logic|build-tools|gradle|Gradle|CI|workflow|compose|lane|ArchUnit|API surface"),
|
||||
("core", r"application-core|shared-contract|domain-core|support|identifier|Sha256|Backoff|tenant|traceparent"),
|
||||
("docs", r"docs/|README|CLAUDE\.md|AGENTS"),
|
||||
]
|
||||
|
||||
|
||||
def area(rid, text):
|
||||
head = rid.split(" / ")[0]
|
||||
group = re.match(r"([A-O])-\d", head)
|
||||
if group:
|
||||
return GROUP_AREA[group.group(1)]
|
||||
new = re.match(r"NEW-(\d+)", head)
|
||||
if new:
|
||||
return NEW_AREA[int(new.group(1))]
|
||||
if head.startswith("S3-"):
|
||||
return "httpclient" if re.search(r"httpclient|HttpClient|WebClient|OAuth2|reactive|redirect|Dynamic", text) else "redis"
|
||||
if head.startswith("TEST"):
|
||||
return "tests"
|
||||
if head.startswith("BUILD"):
|
||||
return "build"
|
||||
for name, pattern in KEYWORDS:
|
||||
if re.search(pattern, text):
|
||||
return name
|
||||
return "core"
|
||||
|
||||
|
||||
def rows():
|
||||
for line in STATUS.read_text().splitlines():
|
||||
if not line.startswith("| ") or line.startswith(("| ID ", "| 상태", "| Wave", "| #")):
|
||||
continue
|
||||
cells = [c.strip() for c in SPLIT.split(line)[1:-1]]
|
||||
if len(cells) == 7 and cells[3].startswith("남음"):
|
||||
yield cells[5], area(cells[0], " ".join(cells[1:])), cells
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) == 4 and sys.argv[1] in ("--list", "--ids"):
|
||||
wave, name = sys.argv[2], sys.argv[3]
|
||||
for w, a, cells in rows():
|
||||
if w == wave and a == name:
|
||||
if sys.argv[1] == "--ids":
|
||||
print(cells[0])
|
||||
else:
|
||||
print(f"{cells[0]} | {cells[2][:150]} | FIX: {cells[6][:220]}")
|
||||
return
|
||||
table = defaultdict(Counter)
|
||||
for w, a, _ in rows():
|
||||
table[a][w] += 1
|
||||
waves = ["W1", "W2", "W3", "W4", "W5"]
|
||||
print("area".ljust(18), *[w.rjust(4) for w in waves], "total".rjust(6))
|
||||
for a, c in sorted(table.items(), key=lambda kv: -sum(kv[1].values())):
|
||||
print(a.ljust(18), *[str(c[w]).rjust(4) for w in waves], str(sum(c.values())).rjust(6))
|
||||
total = Counter()
|
||||
for c in table.values():
|
||||
total.update(c)
|
||||
print("TOTAL".ljust(18), *[str(total[w]).rjust(4) for w in waves], str(sum(total.values())).rjust(6))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -220,45 +220,11 @@ W5 행 전부, `docs/study/*.ko.md`·`docs/*-superpowers-package/`를 현재 코
|
||||
| Wave | 상태 | 검증 | 커밋 | 비고 |
|
||||
|---|---|---|---|---|
|
||||
| 준비 | 완료 (2026-09-25) | 기준 `./gradlew check --continue` 통과(481 task) | `fe80bb3f` | 현황표 812행(완료 161 / 해당 없음 106 / 남음 544 / 보류 1), 소유자 결정 20건 |
|
||||
| 1–2 | 진행 중 — 사용량 한도로 일시 중단 (2026-09-25) | 묶음별 leaf `check`·벤더 lane은 각 worktree에서 통과. main 통합 검증은 아직 | - | 아래 「중단 시점 상태」 |
|
||||
| 1 | 완료 (2026-09-28) | `check` · `ci verifyDependencyLocks` · `mainCheck` · architecture/public path/env keys/config contract · bootstrap·sample integration/system · build-logic 83 · build-tools 35 · optional-platforms `ci` · `qualificationBootJar` 통과. `integrationCheck`는 기존 결함만 실패(아래) | `fcddab7e`(사용자 커밋, 13개 묶음 `D`·`W1`) | 도구 출력물 추적 제외 `700d89fd` |
|
||||
| 2 | 완료 (2026-09-28) | Wave 1과 같은 게이트 전부 통과(`ci` 7m17s). 통합 때 드러난 3건 수정: PG outbox claim 테스트 fixture의 가짜 envelope hash(P7 A-7a × P9), sample이 web leaf를 scan해 새 operation controller를 등록(P9 × NEW-10d — sample에서 제외), SpotBugs aux classpath 파일 미truncate(`QualityConventionsPlugin`에서 실행 전 삭제) | 이 커밋 | W2 cherry-pick 충돌 3건 수동 병합(README gRPC·파일서버 행, `OutboxStoreAdapterTest`, `messaging.yml`) |
|
||||
|
||||
### 중단 시점 상태 (재개용)
|
||||
`integrationCheck`의 기존 실패(이번 작업 전 `6d27356e`에서도 같음, 현황표 `NEW-16`·`P11-new-3`): Redis topology 3개 lane은 `-Predis.topology.mode` 없이 fail-closed(standalone으로 직접 돌리면 통과 — W1 시점 cache-redis 10/11, 남은 1건 NEW-5b는 W2에서 수정, W2 이후 재실행은 안 함), httpclient `disabledProxyFailsBeforeARequestCanBeSent`는 Docker userland proxy 의존, AWS 보호 lane은 보호 자격 증명 env 필요.
|
||||
|
||||
- 브랜치 `refactor/review-followup` @ `fe80bb3f`. **main 작업 트리에 커밋 안 된 변경이 있다**: 아래 표의 `D`·`W1` 커밋을 `git cherry-pick -n`으로 적용한 상태(충돌 0). 이 상태를 버리지 않는다.
|
||||
- 묶음별 결과 파일·공통 지시·스크립트 사본: `.claude/review-followup/`(gitignore 대상, 디스크에 남음). `results/P*.md` = 행 결과·제거된 코드·새 결함, `agent-brief.md` = 구현 에이전트 공통 지시, `apply_results.py` = 결과 파일로 현황표 갱신(`--only-waves W1`), `by_area.py` = 남은 행을 영역·Wave별로 나열.
|
||||
- 각 묶음의 커밋은 브랜치 `worktree-agent-*`(13개)에 있다. worktree 폴더는 모두 깨끗한 상태에서 정리했다(`git worktree remove`) — W2 커밋은 브랜치에서 `git cherry-pick -n <해시>`로 가져온다.
|
||||
현황표: 859행(812 + 후속 발견 47) 중 완료 370 · 해당 없음 112 · 보류 2 · 남음 375(W1 4 · W2 17 · W3 196 · W4 57 · W5 101). 묶음별 결과 파일은 `docs/reviews/2026-09-25-review-followup-results/P*.md`, 에이전트 지시·스크립트는 `docs/superpowers/plans/2026-09-25-review-followup-tools/`.
|
||||
|
||||
| 묶음 | 브랜치 | D·W1 커밋 (main에 적용됨) | W2 커밋 (Wave 2에서 적용) | 행 결과 |
|
||||
|---|---|---|---|---|
|
||||
| P1 messaging | `worktree-agent-ac82c0859f4fb76da` | `3ecef978` | `2ae3c960` | 완료 18, 남음 2(Wave 3 3-C) |
|
||||
| P2 object storage | `worktree-agent-a0383097e74acaf1e` | `2c7b3d25` `69ca6565` `f8bf7b6d` | `11eac0c7` | 완료 20 |
|
||||
| P3 notification | `worktree-agent-a9bbc66a423c4d1fa` | `38d31b98` `12adea6e` | `6db6214c` | 완료 17, 남음 1(X2-P2-7b → P10에서 완료) |
|
||||
| P4 file server | `worktree-agent-a4be05fc0e42cb70c` | `433bacdb` | `ed2c0929` | 완료 24 |
|
||||
| P5 realtime·gRPC | `worktree-agent-ab8fb70ea2e85b04c` | `9b296c7c` `b39d3de0` | `a498ad84` | 완료 24(+N-9c 완료, N-9b 해당 없음) |
|
||||
| P6 Redis | `worktree-agent-a6ab0657d876ae6b9` | `22f28a3e` | `5761314d` | 완료 14 |
|
||||
| P7 core·bootstrap | `worktree-agent-a50ffe5361b9ddd73` | `9a05d686` | `3a39b6b5` | 완료 11, 남음 1(X1-#1d = P9 E-5) |
|
||||
| P8 GraphQL | `worktree-agent-ab74dd57027acdc42` | `6390bf89` `0392d8c9` | `aa5f4d90` | 완료 8, 해당 없음 1, 남음 2(Wave 3 3-D) |
|
||||
| P9 JPA·durable op | `worktree-agent-adbb19427d5d1740b` | `21bcba8d` | `3152e50b` | 완료 14 |
|
||||
| P10 web | `worktree-agent-afae86287ba980dfb` | `983cc832` | `5c08d3be` | 완료 13 |
|
||||
| P11 httpclient | `worktree-agent-afdf5842812e13046` | `06764fcb` `c44030e8` | `52511391` | 완료 12, 해당 없음 4 |
|
||||
| P12 Mongo | `worktree-agent-aa2a445bdd99d8bd7` | `ceddd6d1` | `3dc06bba` | 완료 11(+F-1c W5 사실상 해결) |
|
||||
| P13 build/CI | `worktree-agent-a93a684bfe0982466` | `50cb2d9e` | `6b1cddc6` | 완료 5 |
|
||||
|
||||
13개 묶음 전부 끝남. 모든 `D`·`W1` 커밋이 main 작업 트리에 적용돼 있다(충돌 0, 커밋 전).
|
||||
|
||||
재개 순서:
|
||||
|
||||
1. (완료) 13개 묶음의 `D`·`W1` 커밋 적용.
|
||||
2. migration 버전 충돌 확인: P9가 persistence-jpa `V18`, P4가 fileserver `V5`, P1이 messaging `V1005`를 추가했다.
|
||||
3. lockfile 재생성(`resolveAndLockAll --write-locks`) → Wave 종료 검증 전체 → `apply_results.py --only-waves W1` → 「제거된 코드」 표에 결과 파일 행 추가 → 커밋 `review-followup Wave 1` → Slack 브리핑.
|
||||
4. W2 커밋 적용 → 같은 검증 → 커밋 `review-followup Wave 2`.
|
||||
5. 새로 발견한 결함(`P*-new-*`)을 현황표 행으로 추가하고 Wave 3 이후에 배정.
|
||||
|
||||
소유자에게 물을 것(모아 둔 것):
|
||||
- P3-new-5: 알림 profile runtime이 사라진 경우 무한 재시도할지, FAILED로 닫을지.
|
||||
- P2-new-2: sample poster 업로드에서 abort와 reconcile이 경합하면 게시된 객체가 붙지 않은 채 남는다. 어떻게 정리할지.
|
||||
- P11-new-4: Dynamic Target이 cross-origin redirect될 때 호출자가 넣은 관례 밖 헤더(`X-Client-Key` 등)도 전부 버릴지.
|
||||
- P6-new-2: 멱등성 `complete`가 연결 풀 포화로 `UNAVAILABLE`이면 executor가 재시도할지, 복구 경로에 맡길지.
|
||||
- P8: DataLoader 키 실패 때 adopter가 준 에러 code를 client에 그대로 내보낼지.
|
||||
- P9: durable operation 설계 선택 4개(서버 생성 id, payload fingerprint로 재제출 판정, 고정 outbox event type, 보존 1일) 승인 여부.
|
||||
- P13-new-1: build-logic·build-tools를 main build가 plugin으로 불러올 때의 의존성도 잠글지(잠그면 Spring Boot plugin을 올릴 때마다 lock 갱신 필요).
|
||||
작업 환경 이동(2026-09-28): 노트북 부하로 이후 작업은 desktop(`ssh desktop`, `/home/donghyeon/workspace/chat-gpt-container/codebase/clean-architecture-backend-template`)에서 이어 한다. 재개 프롬프트: `docs/reviews/2026-09-28-review-followup-resume-prompt.md`.
|
||||
|
||||
@@ -132,8 +132,17 @@ for idempotency, where `IdempotencyStorePort` lives in `application-core` and
|
||||
|
||||
The split is not only a registry workaround; it puts each half where its invariants belong. A
|
||||
problem document is an HTTP concept and has no business being persisted, so the stored failure is a
|
||||
code plus a safe message. An HTTP surface for operations, if one is added again, maps it onto the
|
||||
`Envelope` error contract.
|
||||
code plus a safe message.
|
||||
|
||||
The HTTP surface was added back on 2026-09-25 (owner decision 15) as a thin transport over the
|
||||
application use cases: `adapter:inbound:web` `operation/DurableOperationController` —
|
||||
`POST /operations` (202 + `Location`), `GET /operations/{id}`, `DELETE /operations/{id}` (202),
|
||||
answers in the `Envelope` contract, and a caller's operation that is not theirs is the same 404
|
||||
(`OPERATION_NOT_FOUND`) as one that does not exist. The controller and the three use cases are
|
||||
assembled by `app-bootstrap` `autoconfigure/operation/DurableOperationConfig`, which turns on only
|
||||
when the operation store and the outbox append port exist (the JPA module with
|
||||
`ca-skeleton.outbox.enabled=true`). Submit and cancel need `operation:submit` / `operation:cancel`
|
||||
(`security.yml` grants both to the `operation-submit` role).
|
||||
|
||||
The state machine is enforced three times on purpose: in `DurableOperation`'s constructor, in the
|
||||
`CHECK` constraints of `V11__durable_operation.sql`, and in the `WHERE` clause of every statement
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
"description": "Publish a notification template version. Separate from submit: publishing changes what every future submission renders.",
|
||||
"composite": false,
|
||||
"clientRole": true
|
||||
},
|
||||
{
|
||||
"name": "operation-submit",
|
||||
"description": "Submit a durable operation and cancel one's own.",
|
||||
"composite": false,
|
||||
"clientRole": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -96,7 +102,8 @@
|
||||
"ca-skeleton-api": [
|
||||
"graphql-query",
|
||||
"notification-submit",
|
||||
"notification-template-publish"
|
||||
"notification-template-publish",
|
||||
"operation-submit"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
# and a stale directory cannot be mistaken for this run's;
|
||||
# 2. the static contract, then `config`, then `create` — a stack that cannot render has no partial
|
||||
# failure mode, and finding that out after `up` costs a teardown;
|
||||
# 3. `up --wait` for long-running services only, then the application's own health answer;
|
||||
# 3. `up --wait` for long-running services only, then the application's own health answer and
|
||||
# its /actuator/info report of which capabilities are on and which database vendor it resolved,
|
||||
# compared with the lane's expectedCapabilitiesOn and expectedPersistenceVendor;
|
||||
# 4. every one-shot the lane declares, each of which must exit zero — a missing or skipped
|
||||
# required client is a lane failure, not a lane that had nothing to check;
|
||||
# 5. sanitized evidence;
|
||||
@@ -413,18 +415,57 @@ run_lane() {
|
||||
management_port="${management_port:-9001}"
|
||||
# Poll rather than trust `up --wait`. Not every overlay defines a healthcheck — the dev one does
|
||||
# not — and where there is none `--wait` returns as soon as the container is created.
|
||||
local attempt
|
||||
local attempt answered=""
|
||||
for attempt in $(seq 1 60); do
|
||||
if docker compose -p "${PROJECT}" "${LANE_ARGS[@]}" exec -T app \
|
||||
wget -qO- "http://localhost:${management_port}/actuator/health" \
|
||||
>"${LANE_EVIDENCE}/health.json" 2>/dev/null \
|
||||
&& [[ -s "${LANE_EVIDENCE}/health.json" ]]; then
|
||||
return 0
|
||||
answered=yes
|
||||
break
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
echo "${id}: the application never answered /actuator/health on port ${management_port}" >&2
|
||||
return 1
|
||||
if [[ -z "${answered}" ]]; then
|
||||
echo "${id}: the application never answered /actuator/health on port ${management_port}" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Which capabilities the application turned on, and the relational vendor it resolved. Without
|
||||
# this a lane called local-jpa that ran with JPA off would render the right services, start
|
||||
# cleanly, and prove nothing. Each capability module ships info.capabilities.<name> beside its
|
||||
# switch (management.info.env), so the application must name every capability the contract
|
||||
# catalogues — true or false — and a name that is missing is a module that is missing.
|
||||
if ! docker compose -p "${PROJECT}" "${LANE_ARGS[@]}" exec -T app \
|
||||
wget -qO- "http://localhost:${management_port}/actuator/info" \
|
||||
>"${LANE_EVIDENCE}/info.json" 2>/dev/null \
|
||||
|| ! jq -e 'type == "object"' "${LANE_EVIDENCE}/info.json" >/dev/null 2>&1; then
|
||||
echo "${id}: the application did not answer /actuator/info with a JSON object" >&2
|
||||
return 1
|
||||
fi
|
||||
local catalogued reported
|
||||
catalogued="$(jq -r '.capabilities | sort | join(",")' "${CONTRACTS}")"
|
||||
reported="$(jq -r '.capabilities // {} | keys | sort | join(",")' "${LANE_EVIDENCE}/info.json")"
|
||||
if [[ "${catalogued}" != "${reported}" ]]; then
|
||||
echo "${id}: the application reports capabilities [${reported}], the contract catalogues [${catalogued}]" >&2
|
||||
return 1
|
||||
fi
|
||||
local expected_on actual_on
|
||||
expected_on="$(jq -r '.expectedCapabilitiesOn | sort | join(",")' <<<"${lane_json}")"
|
||||
actual_on="$(jq -r '[.capabilities | to_entries[] | select((.value.enabled | tostring) == "true") | .key] | sort | join(",")' \
|
||||
"${LANE_EVIDENCE}/info.json")"
|
||||
if [[ "${expected_on}" != "${actual_on}" ]]; then
|
||||
echo "${id}: the application reports [${actual_on}] on, the contract expects [${expected_on}]" >&2
|
||||
return 1
|
||||
fi
|
||||
local expected_vendor actual_vendor
|
||||
expected_vendor="$(jq -r '.expectedPersistenceVendor' <<<"${lane_json}")"
|
||||
actual_vendor="$(jq -r '.capabilities["persistence-jpa"] | if (.enabled | tostring) == "true" then .vendor else "none" end' \
|
||||
"${LANE_EVIDENCE}/info.json")"
|
||||
if [[ "${expected_vendor}" != "${actual_vendor}" ]]; then
|
||||
echo "${id}: the application resolved vendor '${actual_vendor}', the contract expects '${expected_vendor}'" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
await_application_report || return 1
|
||||
|
||||
@@ -449,6 +490,7 @@ run_lane() {
|
||||
fi
|
||||
redact_in_place "${LANE_EVIDENCE}/notification-smoke-phase1.log"
|
||||
cp "${LANE_EVIDENCE}/health.json" "${LANE_EVIDENCE}/health-phase1.json"
|
||||
cp "${LANE_EVIDENCE}/info.json" "${LANE_EVIDENCE}/info-phase1.json"
|
||||
|
||||
# The application only. The database and its volume stay up, which is the whole point.
|
||||
echo "-- ${id}: restarting the application into the second phase"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# The static half of the Compose contract: every lane renders, and renders exactly what it claims.
|
||||
#
|
||||
# Five things are checked, and each exists because assuming it cost something:
|
||||
# Six things are checked, and each exists because assuming it cost something:
|
||||
#
|
||||
# 1. the Compose version, because `!override` is what stops the dev overlay's tmpfs merging with
|
||||
# the base's and colliding with a bind mount, and it needs 2.24.4;
|
||||
@@ -14,7 +14,10 @@
|
||||
# distinct";
|
||||
# 5. the service-role partition, because a service the lane renders and files under no role is
|
||||
# started by nothing and checked by nothing, and a one-shot filed as a --wait target hangs the
|
||||
# lane for its full timeout on a container that was built to exit.
|
||||
# lane for its full timeout on a container that was built to exit;
|
||||
# 6. the expected application report (expectedCapabilitiesOn, expectedPersistenceVendor) names
|
||||
# only catalogued capabilities and a vendor that agrees with persistence-jpa, because an
|
||||
# expectation the application cannot report fails every run of the lane.
|
||||
#
|
||||
# Static only. Nothing starts here; scripts/run-compose-runtime-smoke.sh owns that.
|
||||
set -euo pipefail
|
||||
@@ -127,10 +130,25 @@ for index in $(seq 0 $((lane_count - 1))); do
|
||||
| select(length > 0) | join(",")' "${CONTRACTS}")"
|
||||
[[ -n "${uncatalogued}" ]] && fail "${id}: [${uncatalogued}] are run with \`run --rm\` but are in neither top-level catalogue"
|
||||
|
||||
# 6. what the lane expects the application to report is something it can report. The wrapper
|
||||
# compares expectedCapabilitiesOn with the names under info.capabilities whose enabled is true, and
|
||||
# the whole reported set with the top-level `capabilities` catalogue; a name outside the catalogue
|
||||
# can never match. The vendor is reported only while persistence-jpa is on, so a vendor expected
|
||||
# with JPA off, or none expected with it on, is a contract that fails every run.
|
||||
expectation="$(jq -r --argjson lane "${lane}" '
|
||||
( ($lane.expectedCapabilitiesOn // []) - (.capabilities // []) ) as $unknown
|
||||
| ( ($lane.expectedCapabilitiesOn // []) | index("persistence-jpa") != null ) as $jpa
|
||||
| [ (if ($unknown | length) > 0 then "uncatalogued=[\($unknown | join(","))]" else empty end),
|
||||
(if $jpa == ($lane.expectedPersistenceVendor == "none")
|
||||
then "vendor \($lane.expectedPersistenceVendor) with persistence-jpa \(if $jpa then "on" else "off" end)"
|
||||
else empty end) ]
|
||||
| join(" ")' "${CONTRACTS}")"
|
||||
[[ -n "${expectation}" ]] && fail "${id}: the expected application report is unreachable — ${expectation}"
|
||||
|
||||
[[ ${FAILURES} -eq 0 ]] && echo "${id}: ${expected} @ ${runtime}"
|
||||
done
|
||||
|
||||
# 6. the Keycloak realm artifact deserializes into Keycloak's own representation.
|
||||
# 7. the Keycloak realm artifact deserializes into Keycloak's own representation.
|
||||
#
|
||||
# Keycloak rejects unknown fields rather than ignoring them, so one annotation key anywhere in the
|
||||
# tree fails the whole import, the container exits 1, and every lane that needs an identity provider
|
||||
|
||||
+5
-4
@@ -266,8 +266,8 @@ Kafka 없이 기동합니다. 나머지 기능은 `app-bootstrap/build.gradle`
|
||||
| 외부 HTTP 호출 | `runtimeOnly project(':adapter:outbound:httpclient')` | client 하나 이상: `APP_HTTPCLIENT_CLIENTS_0_*` (`docs/httpclient/env-fields.yaml`) | `APP_HTTPCLIENT_ENABLED` |
|
||||
| 객체 저장소 (S3/로컬) | `runtimeOnly project(':adapter:outbound:objectstorage')` | 전용 env 없음. `app.object-storage.*`의 provider·destination을 `application-*.yml`에 적음 | `app.object-storage.enabled` |
|
||||
| WebSocket (STOMP push) | `runtimeOnly project(':adapter:inbound:websocket')` | 없음(기본값으로 동작). origin은 `APP_WEBSOCKET_ALLOWED_ORIGINS` | `APP_WEBSOCKET_ENABLED` |
|
||||
| gRPC 서버 | `runtimeOnly project(':adapter:inbound:grpc')` | `CA_SKELETON_GRPC_ALLOW_INSECURE_LOCAL=true` (지금 받는 listener가 loopback plaintext뿐) | `ca-skeleton.grpc.enabled` |
|
||||
| 파일 서버 (JPA 줄도 필요) | `runtimeOnly project(':composition:fileserver-platform')` | `APP_FILESERVER_PLATFORM_STORAGE_ROOT`, `APP_FILESERVER_PLATFORM_OBSERVABILITY_FINGERPRINT_KEY`, 그리고 `FileAccessPolicy` bean 또는 `APP_FILESERVER_PLATFORM_SECURITY_ACCESS_POLICY=role-based` | `APP_FILESERVER_PLATFORM_ENABLED` |
|
||||
| gRPC 서버 | `runtimeOnly project(':adapter:inbound:grpc')` | `CA_SKELETON_GRPC_SERVER_ALLOW_INSECURE_LOCAL=true` (지금 받는 listener가 loopback plaintext뿐) | `ca-skeleton.grpc.server.enabled` |
|
||||
| 파일 서버 (JPA를 함께 가져옴) | `runtimeOnly project(':composition:fileserver-platform')` | `APP_FILESERVER_PLATFORM_STORAGE_ROOT`, `APP_FILESERVER_PLATFORM_OBSERVABILITY_FINGERPRINT_KEY`, 그리고 `FileAccessPolicy` bean 또는 `APP_FILESERVER_PLATFORM_SECURITY_ACCESS_POLICY=role-based` | `APP_FILESERVER_PLATFORM_ENABLED` |
|
||||
| 알림 (SMTP/SES, JPA 줄도 필요) | `runtimeOnly project(':composition:notification-platform')` | 키 8종과 각 `_ID`(`APP_NOTIFICATION_PLATFORM_*_KEY`, `*_KEY_ID`), 쓰는 provider 설정(`APP_NOTIFICATION_PLATFORM_SMTP_*` 또는 `_SES_*`) | `APP_NOTIFICATION_PLATFORM_ENABLED` |
|
||||
|
||||
전체 목록과 타입·기본값은 `docs/registries/env-keys.yaml`, 각 모듈이 제공하는 것은 그 모듈 README의
|
||||
@@ -323,7 +323,8 @@ Kafka·Redis는 위 "기능 추가 = 한 줄 + env" 표의 한 줄로 고릅니
|
||||
broker)라 보통 비워 두지 않습니다. 빈 값을 주면 기동이 거부되면서 이 키 이름을 지목합니다. 이 키를 비워도 메시징이 꺼지지는
|
||||
않습니다 — 끄는 것은 `APP_MESSAGING_ENABLED=false`입니다.
|
||||
- **`APP_MESSAGING_KAFKA_BROKERS`** — `host:port` CSV. Kafka 모듈을 고르면 필수. legacy seam과
|
||||
messaging platform의 Kafka transport(`spring.kafka.bootstrap-servers`)가 같은 값을 씁니다.
|
||||
messaging platform의 Kafka transport(`app.messaging.brokers.kafka.bootstrap-servers`)가 같은 값을
|
||||
씁니다. `spring.kafka.bootstrap-servers`는 읽지 않습니다.
|
||||
- **`APP_NOTIFICATION_SLACK_WEBHOOK_ENABLED`** — Slack webhook R0 provider enable flag. notification 플랫폼이
|
||||
켜졌을 때 어떤 provider를 쓸지 고르는 값입니다.
|
||||
- **`APP_NOTIFICATION_GOOGLE_EMAIL_ENABLED`** — Google Email R0 provider enable flag. 위와 같습니다.
|
||||
@@ -405,7 +406,7 @@ ca-skeleton:
|
||||
- **`OTEL_EXPORTER_OTLP_ENDPOINT`** — OTLP exporter endpoint. 빈 값 = exporter off(스켈레톤에서 OTel
|
||||
SEAM 미활성). 값이 있으면 유효한 URL 이어야 하며 기동 시 `TracingProperties` 가 검증합니다.
|
||||
- **`APP_TRACING_ENABLED`** — `false` 면 tracing seam 은 꺼지지만, `meta.traceId` 는
|
||||
`RequestLoggingFilter` 가 W3C `traceparent` 로 여전히 생성합니다(D4 disabled-fallback 보장).
|
||||
`WebMvcRequestIdFilter` 가 W3C `traceparent` 로 여전히 생성합니다(D4 disabled-fallback 보장).
|
||||
- **`APP_TRACING_SAMPLE_RATE`** — per-profile 기본값을 덮어쓰는 샘플 비율. [0.0, 1.0] float.
|
||||
- per-profile 기본값(D6): prod = `0.01`, staging = `0.10`, dev/local = `1.0`.
|
||||
- **결정 — 빈 값으로 두는 이유(D-1 ISSUE-1 fix).** 빈 값이어야 per-profile resolver 의 기본값이
|
||||
|
||||
@@ -117,9 +117,11 @@ application/platform namespace split.
|
||||
|
||||
## Error mapping (`Category → ErrorType`)
|
||||
|
||||
feature 는 `ApiErrorCarrier` 를 구현한 예외(자신의 `ApiErrorCode` 를 실어)를 던지면
|
||||
`GraphqlExceptionResolver` 가 `GraphQLError`(ErrorType + `extensions{code, category}`)로 매핑한다.
|
||||
비-`ApiErrorCarrier` 예외는 `null` 반환 → 다른 resolver / Spring 기본 처리. 표는 [README.md](README.md).
|
||||
모든 client 에러는 `runtime/GraphQlWireErrorMapper` 하나를 거친다 — 전송 interceptor, 실행 전
|
||||
pipeline(instrumentation), data fetcher resolver 세 곳이 같은 bean 을 받는다. 순서는 플랫폼 거부
|
||||
(`GraphQlPlatformRejectionMapper.mapKnown`) → `ApiErrorCarrier`(자기 `ApiErrorCode`) → 등록된
|
||||
application 매핑(`GraphQlExceptionResolver`). 어디에도 안 걸린 예외는 `INTERNAL_ERROR` 로 가려지고,
|
||||
같은 executionId 로 ERROR 로그 한 줄이 남는다. 표는 [README.md](README.md).
|
||||
|
||||
## 향후 adopter 의 feature 기여 방법
|
||||
|
||||
@@ -169,9 +171,6 @@ health 스키마만 소유한다.
|
||||
replay 등)는 바인딩되지 않는 feature flag gate 뒤의 모델뿐이어서 2026-09-25 에 삭제했다
|
||||
(`docs/capability-status.md` 제거 표). 다시 필요하면 Spring GraphQL/graphql-java SPI 를 구현하는
|
||||
형태로 새로 만든다.
|
||||
- 요청 단계 거부(`GraphQlPlatformWebInterceptor`, `GraphQlPlatformInstrumentation`)는
|
||||
`GraphQlWireErrorMapper` 를 거치지 않고 `GraphQlPlatformRejectionMapper.map` 을 직접 부른다.
|
||||
그래서 요청 단계의 `ApiErrorCarrier` 는 `INTERNAL_ERROR` 가 된다(리뷰 S5 #6, 미해결).
|
||||
|
||||
## Test
|
||||
|
||||
|
||||
+28
-8
@@ -229,13 +229,30 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
/**
|
||||
* How a request is authenticated.
|
||||
*
|
||||
* <p>Anonymous by default, because authentication belongs to the composition root. This is not a
|
||||
* permissive default in itself: what an anonymous caller may do is decided by the authorization
|
||||
* policy and the client profile, both of which are checked on every request.
|
||||
* <p>Anonymous by default in a development mode, because authentication belongs to the
|
||||
* composition root. What an anonymous caller may do is decided by the authorization policy and
|
||||
* the client profile, both of which are checked on every request.
|
||||
*
|
||||
* <p>A production mode refuses anonymous callers outright, so the anonymous default there started
|
||||
* an endpoint that answered every request with {@code AUTHENTICATION_REQUIRED}. That is the same
|
||||
* missing composition decision as a missing authorization policy, and it fails the same way: at
|
||||
* startup, by name.
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public GraphQlPrincipalResolver graphQlPrincipalResolver() {
|
||||
public GraphQlPrincipalResolver graphQlPrincipalResolver(GraphQlPlatformSettings properties) {
|
||||
if (properties.deploymentMode() == null) {
|
||||
throw new GraphQlPlatformConfigurationException(
|
||||
List.of(GraphQlDeploymentMode.REQUIRED_MESSAGE));
|
||||
}
|
||||
if (properties.production()) {
|
||||
throw new GraphQlPlatformConfigurationException(
|
||||
List.of(
|
||||
"backend.graphql.deployment-mode="
|
||||
+ properties.deploymentMode()
|
||||
+ " requires an explicit GraphQlPrincipalResolver bean; production refuses "
|
||||
+ "anonymous callers, so the anonymous default would reject every request"));
|
||||
}
|
||||
return GraphQlPrincipalResolver.anonymous();
|
||||
}
|
||||
|
||||
@@ -336,8 +353,9 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(GraphQlPlatformInstrumentation.class)
|
||||
public Instrumentation graphQlPlatformInstrumentation(GraphQlExecutionChain chain) {
|
||||
return new GraphQlPlatformInstrumentation(chain);
|
||||
public Instrumentation graphQlPlatformInstrumentation(
|
||||
GraphQlExecutionChain chain, GraphQlWireErrorMapper errors) {
|
||||
return new GraphQlPlatformInstrumentation(chain, errors);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -391,7 +409,8 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
GraphQlJsonStructurePolicy structurePolicy,
|
||||
GraphQlExtensionsPolicy extensionsPolicy,
|
||||
GraphQlPlatformSettings properties,
|
||||
Clock graphQlPlatformClock) {
|
||||
Clock graphQlPlatformClock,
|
||||
GraphQlWireErrorMapper errors) {
|
||||
return new GraphQlPlatformWebInterceptor(
|
||||
principalResolver,
|
||||
contextFactory,
|
||||
@@ -401,7 +420,8 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
new GraphQlClientProfile(DEFAULT_ANONYMOUS_PROFILE),
|
||||
TenantContext.system(DEFAULT_ANONYMOUS_TENANT),
|
||||
properties.production(),
|
||||
graphQlPlatformClock);
|
||||
graphQlPlatformClock,
|
||||
errors);
|
||||
}
|
||||
|
||||
/** The approved scalar set; the wiring configurer refuses to wire anything absent from it. */
|
||||
|
||||
+11
-3
@@ -1,5 +1,7 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.context;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* The tenant a request executes in, together with where that decision came from.
|
||||
*
|
||||
@@ -14,7 +16,13 @@ package dev.caskeleton.adapter.inbound.graphql.context;
|
||||
*/
|
||||
public record TenantContext(String value, TenantSource source) {
|
||||
|
||||
private static final int MAXIMUM_LENGTH = 128;
|
||||
/**
|
||||
* The web transport's tenant grammar ({@code adapter.inbound.web.core.TenantContext}).
|
||||
*
|
||||
* <p>Duplicated on purpose until the shared tenant value type exists (review S5-lead-3, Wave 3):
|
||||
* while the two transports disagreed, the same tenant passed one and was refused by the other.
|
||||
*/
|
||||
private static final Pattern GRAMMAR = Pattern.compile("[A-Za-z0-9][A-Za-z0-9_.-]{0,63}");
|
||||
|
||||
/** Trusted inputs a tenant may be derived from. */
|
||||
public enum TenantSource {
|
||||
@@ -27,8 +35,8 @@ public record TenantContext(String value, TenantSource source) {
|
||||
}
|
||||
|
||||
public TenantContext {
|
||||
if (value == null || value.isBlank() || value.length() > MAXIMUM_LENGTH) {
|
||||
throw new IllegalArgumentException("tenant identity is required and bounded");
|
||||
if (value == null || !GRAMMAR.matcher(value).matches()) {
|
||||
throw new IllegalArgumentException("tenant identity must match " + GRAMMAR.pattern());
|
||||
}
|
||||
if (source == null) {
|
||||
throw new IllegalArgumentException("tenant source is required");
|
||||
|
||||
+11
-2
@@ -37,9 +37,18 @@ import java.util.Set;
|
||||
*/
|
||||
public final class GraphQlDocumentShapeAnalyzer {
|
||||
|
||||
/** Prefix that marks an introspection field. */
|
||||
/** Prefix that marks a meta field ({@code __schema}, {@code __type}, {@code __typename}). */
|
||||
public static final String INTROSPECTION_FIELD_PREFIX = "__";
|
||||
|
||||
/**
|
||||
* The meta fields that disclose the schema.
|
||||
*
|
||||
* <p>{@code __typename} is not one of them: it names the type of an object the caller already
|
||||
* received, and Apollo and urql add it to every selection set. Gating it with the schema fields
|
||||
* refused every query those clients send once introspection was off.
|
||||
*/
|
||||
private static final Set<String> SCHEMA_DISCLOSING_FIELDS = Set.of("__schema", "__type");
|
||||
|
||||
private final int maximumVisitedNodes;
|
||||
|
||||
/** Creates an analyzer with the default traversal budget. */
|
||||
@@ -209,7 +218,7 @@ public final class GraphQlDocumentShapeAnalyzer {
|
||||
counters.visit(maximumVisitedNodes);
|
||||
|
||||
if (selection instanceof Field field) {
|
||||
if (field.getName().startsWith(INTROSPECTION_FIELD_PREFIX)
|
||||
if (SCHEMA_DISCLOSING_FIELDS.contains(field.getName())
|
||||
|| selectsIntrospection(field.getSelectionSet(), fragments, expanded, counters)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+5
-1
@@ -44,6 +44,9 @@ public record GraphQlErrorCode(String value) {
|
||||
/** Stable operation-name rejection. */
|
||||
public static final String GRAPHQL_OPERATION_NAME_REQUIRED = "GRAPHQL_OPERATION_NAME_REQUIRED";
|
||||
|
||||
/** A DataLoader key declared always resolvable had no row. */
|
||||
public static final String GRAPHQL_BATCH_KEY_MISSING = "GRAPHQL_BATCH_KEY_MISSING";
|
||||
|
||||
private static final Set<String> LEGACY_UNPREFIXED_PLATFORM_CODES =
|
||||
Set.of(
|
||||
INTERNAL_ERROR,
|
||||
@@ -65,7 +68,8 @@ public record GraphQlErrorCode(String value) {
|
||||
DEPENDENCY_UNAVAILABLE,
|
||||
GRAPHQL_DOCUMENT_SHAPE_REJECTED,
|
||||
GRAPHQL_COMPLEXITY_EXCEEDED,
|
||||
GRAPHQL_OPERATION_NAME_REQUIRED);
|
||||
GRAPHQL_OPERATION_NAME_REQUIRED,
|
||||
GRAPHQL_BATCH_KEY_MISSING);
|
||||
|
||||
private static final Pattern PATTERN = Pattern.compile("[A-Z][A-Z0-9_]{2,63}");
|
||||
|
||||
|
||||
+11
@@ -2,6 +2,8 @@ package dev.caskeleton.adapter.inbound.graphql.error;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Maps a resolver failure onto the wire (design §16, Stable plan Task 25).
|
||||
@@ -16,6 +18,8 @@ import java.util.Map;
|
||||
*/
|
||||
public final class GraphQlExceptionResolver {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GraphQlExceptionResolver.class);
|
||||
|
||||
private final Map<Class<? extends Throwable>, Mapping> mappings;
|
||||
|
||||
private GraphQlExceptionResolver(Map<Class<? extends Throwable>, Mapping> mappings) {
|
||||
@@ -52,6 +56,13 @@ public final class GraphQlExceptionResolver {
|
||||
context);
|
||||
}
|
||||
}
|
||||
// The client gets an opaque error and this execution id; the log line under the same id is the
|
||||
// only place the cause survives. Without it the id pointed at nothing.
|
||||
LOG.error(
|
||||
"graphql failure masked as {} (executionId={})",
|
||||
GraphQlErrorCode.INTERNAL_ERROR,
|
||||
context.executionId(),
|
||||
failure);
|
||||
return GraphQlInternalErrorMasker.mask(context);
|
||||
}
|
||||
|
||||
|
||||
+1
-9
@@ -1,7 +1,6 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlErrorContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlWireError;
|
||||
import graphql.GraphQLError;
|
||||
import graphql.schema.DataFetchingEnvironment;
|
||||
import java.util.List;
|
||||
@@ -34,14 +33,7 @@ public final class GraphQlDataFetcherExceptionResolver extends DataFetcherExcept
|
||||
|
||||
@Override
|
||||
protected GraphQLError resolveToSingleError(Throwable failure, DataFetchingEnvironment env) {
|
||||
GraphQlWireError wireError = mapper.mapFieldFailure(failure, errorContext(env));
|
||||
// A carrier still knows its operational category, which is finer than the six wire categories.
|
||||
// Classifying from it keeps `NOT_FOUND` distinguishable from any other business outcome.
|
||||
if (failure instanceof dev.caskeleton.shared.error.ApiErrorCarrier carrier) {
|
||||
return GraphQlWireErrors.toGraphQlError(
|
||||
wireError, GraphQlWireErrors.classificationOf(carrier.errorCode().category()));
|
||||
}
|
||||
return GraphQlWireErrors.toGraphQlError(wireError);
|
||||
return mapper.toGraphQlError(failure, errorContext(env));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
-5
@@ -33,14 +33,18 @@ public final class GraphQlPlatformInstrumentation extends SimplePerformantInstru
|
||||
public static final String MISSING_CONTEXT_CONSTRAINT = "PLATFORM_CONTEXT";
|
||||
|
||||
private final GraphQlExecutionChain chain;
|
||||
private final GraphQlWireErrorMapper errors;
|
||||
|
||||
/**
|
||||
* Creates the instrumentation.
|
||||
*
|
||||
* @param chain the executable policy chain
|
||||
* @param errors the mapper every client-visible error goes through
|
||||
*/
|
||||
public GraphQlPlatformInstrumentation(GraphQlExecutionChain chain) {
|
||||
public GraphQlPlatformInstrumentation(
|
||||
GraphQlExecutionChain chain, GraphQlWireErrorMapper errors) {
|
||||
this.chain = Objects.requireNonNull(chain, "execution chain is required");
|
||||
this.errors = Objects.requireNonNull(errors, "wire error mapper is required");
|
||||
}
|
||||
|
||||
/** The pipeline this instrumentation enforces, derived from the chain. */
|
||||
@@ -82,10 +86,7 @@ public final class GraphQlPlatformInstrumentation extends SimplePerformantInstru
|
||||
GraphQlExecutionContext.starting(
|
||||
request, requestContext, execution.getGraphQLSchema(), execution.getDocument()));
|
||||
} catch (RuntimeException rejection) {
|
||||
throw new AbortExecutionException(
|
||||
List.of(
|
||||
GraphQlWireErrors.toGraphQlError(
|
||||
GraphQlPlatformRejectionMapper.map(rejection, errorContext))));
|
||||
throw new AbortExecutionException(List.of(errors.toGraphQlError(rejection, errorContext)));
|
||||
}
|
||||
|
||||
// Publish the context the pipeline actually settled on. The transport could only build a
|
||||
|
||||
+17
-16
@@ -2,6 +2,8 @@ package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.cost.GraphQlComplexityRejectedException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.cost.GraphQlStructuralLimitException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlBatchTimeoutException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlMissingKeyException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlErrorCategory;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlErrorCode;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlErrorContext;
|
||||
@@ -23,26 +25,13 @@ import dev.caskeleton.adapter.inbound.graphql.security.GraphQlTenantIsolationExc
|
||||
* code, a bounded category and no internal detail. Doing that per stage would produce as many error
|
||||
* vocabularies as there are stages, and the one that forgot would leak an exception message.
|
||||
*
|
||||
* <p>An unrecognised exception maps to the opaque internal error rather than to its own message.
|
||||
* That is the fail-closed direction: a new rejection type that nobody mapped shows up as {@code
|
||||
* INTERNAL_ERROR} in the client's response and in full in the logs, instead of publishing whatever
|
||||
* the exception happened to say.
|
||||
* <p>This is the platform's catalogue only. {@link GraphQlWireErrorMapper} consults it first and
|
||||
* falls back to the application's mappings, which mask and log anything unrecognised.
|
||||
*/
|
||||
public final class GraphQlPlatformRejectionMapper {
|
||||
|
||||
private GraphQlPlatformRejectionMapper() {}
|
||||
|
||||
/**
|
||||
* Maps a rejection thrown by a pipeline stage.
|
||||
*
|
||||
* @param failure the exception a handler threw
|
||||
* @param context correlation identity for the response
|
||||
*/
|
||||
public static GraphQlWireError map(Throwable failure, GraphQlErrorContext context) {
|
||||
GraphQlWireError known = mapKnown(failure, context);
|
||||
return known != null ? known : GraphQlWireError.internal(context.executionId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps a rejection this platform raised, or {@code null} when it did not raise it.
|
||||
*
|
||||
@@ -111,13 +100,25 @@ public final class GraphQlPlatformRejectionMapper {
|
||||
GraphQlErrorCategory.REQUEST,
|
||||
context);
|
||||
}
|
||||
if (failure instanceof GraphQlRequestCancelledException) {
|
||||
// A batch that ran out of budget is the request running out of budget, one level down: the
|
||||
// client can retry the same request and should be told so, not handed an opaque failure.
|
||||
if (failure instanceof GraphQlRequestCancelledException
|
||||
|| failure instanceof GraphQlBatchTimeoutException) {
|
||||
return GraphQlWireError.of(
|
||||
"요청 처리 시간이 초과되었습니다.",
|
||||
GraphQlErrorCode.platform(GraphQlErrorCode.REQUEST_TIMEOUT),
|
||||
GraphQlErrorCategory.TIMEOUT,
|
||||
context);
|
||||
}
|
||||
if (failure instanceof GraphQlMissingKeyException) {
|
||||
// The loader declared this relation always resolvable and it did not resolve. The key is an
|
||||
// object identifier, so the message names neither it nor the loader.
|
||||
return GraphQlWireError.of(
|
||||
"요청한 리소스를 찾을 수 없습니다.",
|
||||
GraphQlErrorCode.platform(GraphQlMissingKeyException.CODE),
|
||||
GraphQlErrorCategory.BUSINESS,
|
||||
context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -5,7 +5,6 @@ import dev.caskeleton.adapter.inbound.graphql.context.GraphQlDeadline;
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.GraphQlRequestContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.TenantContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlErrorContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlWireError;
|
||||
import dev.caskeleton.adapter.inbound.graphql.http.GraphQlExtensionsPolicy;
|
||||
import dev.caskeleton.adapter.inbound.graphql.http.GraphQlJsonStructurePolicy;
|
||||
import dev.caskeleton.adapter.inbound.graphql.http.GraphQlRequestSize;
|
||||
@@ -51,6 +50,7 @@ public final class GraphQlPlatformWebInterceptor implements WebGraphQlIntercepto
|
||||
private final TenantContext anonymousTenant;
|
||||
private final boolean anonymousProfileProtected;
|
||||
private final Clock clock;
|
||||
private final GraphQlWireErrorMapper errors;
|
||||
|
||||
/**
|
||||
* Creates the interceptor.
|
||||
@@ -62,6 +62,7 @@ public final class GraphQlPlatformWebInterceptor implements WebGraphQlIntercepto
|
||||
* @param anonymousTenant tenant used when no credential is present
|
||||
* @param anonymousProfileProtected whether an anonymous request is refused outright
|
||||
* @param clock clock used for the request deadline
|
||||
* @param errors the mapper every client-visible error goes through
|
||||
*/
|
||||
public GraphQlPlatformWebInterceptor(
|
||||
GraphQlPrincipalResolver principalResolver,
|
||||
@@ -72,7 +73,8 @@ public final class GraphQlPlatformWebInterceptor implements WebGraphQlIntercepto
|
||||
GraphQlClientProfile anonymousProfile,
|
||||
TenantContext anonymousTenant,
|
||||
boolean anonymousProfileProtected,
|
||||
Clock clock) {
|
||||
Clock clock,
|
||||
GraphQlWireErrorMapper errors) {
|
||||
this.principalResolver = Objects.requireNonNull(principalResolver, "principal resolver");
|
||||
this.contextFactory = Objects.requireNonNull(contextFactory, "context factory is required");
|
||||
this.policy = Objects.requireNonNull(policy, "client policy is required");
|
||||
@@ -83,6 +85,7 @@ public final class GraphQlPlatformWebInterceptor implements WebGraphQlIntercepto
|
||||
this.anonymousTenant = Objects.requireNonNull(anonymousTenant, "anonymous tenant");
|
||||
this.anonymousProfileProtected = anonymousProfileProtected;
|
||||
this.clock = Objects.requireNonNull(clock, "clock is required");
|
||||
this.errors = Objects.requireNonNull(errors, "wire error mapper is required");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,12 +163,9 @@ public final class GraphQlPlatformWebInterceptor implements WebGraphQlIntercepto
|
||||
|
||||
private WebGraphQlResponse reject(WebGraphQlRequest request, RuntimeException rejection) {
|
||||
ExecutionInput input = request.toExecutionInput();
|
||||
String executionId = traceId(request);
|
||||
GraphQlWireError wireError =
|
||||
GraphQlPlatformRejectionMapper.map(rejection, GraphQlErrorContext.of(executionId));
|
||||
ExecutionResult result =
|
||||
ExecutionResult.newExecutionResult()
|
||||
.addError(GraphQlWireErrors.toGraphQlError(wireError))
|
||||
.addError(errors.toGraphQlError(rejection, GraphQlErrorContext.of(traceId(request))))
|
||||
.build();
|
||||
ExecutionGraphQlResponse response = new DefaultExecutionGraphQlResponse(input, result);
|
||||
return new WebGraphQlResponse(response);
|
||||
|
||||
+29
-14
@@ -8,6 +8,7 @@ import dev.caskeleton.adapter.inbound.graphql.error.GraphQlWireError;
|
||||
import dev.caskeleton.shared.error.ApiErrorCarrier;
|
||||
import dev.caskeleton.shared.error.ApiErrorCode;
|
||||
import dev.caskeleton.shared.error.Category;
|
||||
import graphql.GraphQLError;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -20,16 +21,15 @@ import java.util.Objects;
|
||||
* the failure happened to take — and the two resolver classes differed only in the case of one
|
||||
* letter, so importing the wrong one compiled.
|
||||
*
|
||||
* <p>Field-level failures route through here. Request-stage rejections do not yet: {@code
|
||||
* GraphQlPlatformWebInterceptor} and {@code GraphQlPlatformInstrumentation} call {@link
|
||||
* GraphQlPlatformRejectionMapper#map} directly, so an {@link ApiErrorCarrier} thrown before
|
||||
* execution (for example by an adopter's {@code GraphQlPrincipalResolver}) becomes {@code
|
||||
* INTERNAL_ERROR} there while the same exception from a resolver keeps its code. Both paths share
|
||||
* the platform catalogue in {@link GraphQlPlatformRejectionMapper#mapKnown}.
|
||||
* <p>Every stage routes through here: the transport interceptor, the pre-execution pipeline and the
|
||||
* data-fetcher resolver all receive this bean. While the first two called the platform catalogue
|
||||
* directly, an {@link ApiErrorCarrier} thrown before execution (for example by an adopter's {@code
|
||||
* GraphQlPrincipalResolver}) became {@code INTERNAL_ERROR} while the same exception from a resolver
|
||||
* kept its code.
|
||||
*
|
||||
* <p>An unrecognised failure never contributes its own message. That is the fail-closed direction:
|
||||
* a new exception type nobody mapped becomes an opaque internal error with a correlation id, and
|
||||
* the detail stays in the logs.
|
||||
* the detail goes to the log under that id ({@link GraphQlExceptionResolver}).
|
||||
*/
|
||||
public final class GraphQlWireErrorMapper {
|
||||
|
||||
@@ -51,25 +51,40 @@ public final class GraphQlWireErrorMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps a failure thrown by a data fetcher.
|
||||
* Maps a failure from any stage: platform rejection first, then {@link ApiErrorCarrier}, then the
|
||||
* registered application mappings, which mask anything they do not recognise.
|
||||
*
|
||||
* <p>Platform rejections are consulted first: an authorization denial raised from inside a
|
||||
* resolver means the same thing to a client as one raised before execution, and giving it a
|
||||
* different code because of where it was thrown would be an implementation detail on the wire.
|
||||
*/
|
||||
public GraphQlWireError mapFieldFailure(Throwable failure, GraphQlErrorContext context) {
|
||||
public GraphQlWireError map(Throwable failure, GraphQlErrorContext context) {
|
||||
GraphQlWireError platform = GraphQlPlatformRejectionMapper.mapKnown(failure, context);
|
||||
return platform != null ? platform : mapCommon(failure, context);
|
||||
}
|
||||
|
||||
private GraphQlWireError mapCommon(Throwable failure, GraphQlErrorContext context) {
|
||||
if (platform != null) {
|
||||
return platform;
|
||||
}
|
||||
if (failure instanceof ApiErrorCarrier carrier) {
|
||||
return fromApiError(carrier.errorCode(), context);
|
||||
}
|
||||
// The registered application mappings, which mask anything they do not recognise.
|
||||
return applicationMappings.resolve(failure, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps a failure and renders it as the engine's error type.
|
||||
*
|
||||
* <p>A carrier still knows its operational category, which is finer than the six wire categories.
|
||||
* Classifying from it keeps {@code NOT_FOUND} distinguishable from any other business outcome,
|
||||
* and does so the same way whichever stage threw.
|
||||
*/
|
||||
public GraphQLError toGraphQlError(Throwable failure, GraphQlErrorContext context) {
|
||||
GraphQlWireError wireError = map(failure, context);
|
||||
if (failure instanceof ApiErrorCarrier carrier) {
|
||||
return GraphQlWireErrors.toGraphQlError(
|
||||
wireError, GraphQlWireErrors.classificationOf(carrier.errorCode().category()));
|
||||
}
|
||||
return GraphQlWireErrors.toGraphQlError(wireError);
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the shared operational error code onto the GraphQL wire vocabulary.
|
||||
*
|
||||
|
||||
+18
-1
@@ -82,13 +82,30 @@ public final class GraphQlRequestBodyLimitFilter implements Filter {
|
||||
|
||||
try {
|
||||
chain.doFilter(new BoundedBodyRequest(httpRequest, maxBodyBytes), response);
|
||||
} catch (BodyTooLargeException tooLarge) {
|
||||
} catch (IOException | ServletException | RuntimeException failure) {
|
||||
// The overflow is thrown inside the decoder, and it does not come back as itself: Spring's
|
||||
// FrameworkServlet wraps an unchecked handler failure in a ServletException, which a catch of
|
||||
// the exact type let through as a 500.
|
||||
if (!causedByOverflow(failure)) {
|
||||
throw failure;
|
||||
}
|
||||
if (!httpResponse.isCommitted()) {
|
||||
reject(httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean causedByOverflow(Throwable failure) {
|
||||
// Bounded, because a cause chain can loop and this runs on every failed request.
|
||||
int depth = 0;
|
||||
for (Throwable cause = failure; cause != null && depth++ < 16; cause = cause.getCause()) {
|
||||
if (cause instanceof BodyTooLargeException) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean guards(HttpServletRequest request) {
|
||||
String path = request.getRequestURI();
|
||||
return path != null && path.equals(request.getContextPath() + graphQlPath);
|
||||
|
||||
@@ -22,3 +22,11 @@ backend:
|
||||
preparsed-cache-entries: ${APP_GRAPHQL_PREPARSED_CACHE_ENTRIES:1000}
|
||||
preparsed-cache-weight: ${APP_GRAPHQL_PREPARSED_CACHE_WEIGHT:10000000}
|
||||
preparsed-cache-expire-after-access: ${APP_GRAPHQL_PREPARSED_CACHE_EXPIRE_AFTER_ACCESS:30m}
|
||||
|
||||
# /actuator/info 에 싣는 이 모듈의 상태(management.info.env). compose smoke 가 lane 이 실제로 켠
|
||||
# capability 를 이 값으로 확인한다. 위 스위치를 해석한 값이고, 기본값은 GraphQlRootAutoConfiguration 의
|
||||
# matchIfMissing 과 같다.
|
||||
info:
|
||||
capabilities:
|
||||
graphql:
|
||||
enabled: ${backend.graphql.enabled:true}
|
||||
|
||||
+42
@@ -10,11 +10,17 @@ import dev.caskeleton.adapter.inbound.graphql.context.GraphQlRequestContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.BoundedPreparsedDocumentProvider;
|
||||
import dev.caskeleton.adapter.inbound.graphql.policy.GraphQlClientPolicy;
|
||||
import dev.caskeleton.adapter.inbound.graphql.security.GraphQlAuthorizationPolicy;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -153,6 +159,17 @@ class GraphQlPlatformExecutionPathTest {
|
||||
assertThat(response.getBody()).contains("INTROSPECTION");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("introspection 을 막은 profile 에서도 Apollo·urql 이 붙이는 __typename 은 통과한다")
|
||||
void typenameIsAnsweredWhenTheClientProfileForbidsIntrospection() {
|
||||
// when
|
||||
ResponseEntity<String> response = post("{ _health __typename }");
|
||||
|
||||
// then
|
||||
assertThat(response.getBody())
|
||||
.isEqualTo("{\"data\":{\"_health\":\"UP\",\"__typename\":\"Query\"}}");
|
||||
}
|
||||
|
||||
@Test
|
||||
void introspectionHiddenBehindANamedFragmentIsStillRejected() {
|
||||
ResponseEntity<String> response =
|
||||
@@ -241,6 +258,31 @@ class GraphQlPlatformExecutionPathTest {
|
||||
assertThat(RESOLVER_INVOCATIONS).as("an oversize body must never reach a resolver").hasValue(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Content-Length 없이 chunked 로 보낸 상한 초과 본문도 decoder 안에서 413 으로 거부된다")
|
||||
void aChunkedBodyOverTheRawCapIsRefusedWith413() throws Exception {
|
||||
// given
|
||||
byte[] body =
|
||||
("{\"query\":\"{ platformStamp }\",\"padding\":\"" + "x".repeat(200_000) + "\"}")
|
||||
.getBytes(StandardCharsets.UTF_8);
|
||||
// An input-stream publisher has no length, so the request goes out chunked and only the
|
||||
// counting stream — not the Content-Length check — can refuse it.
|
||||
HttpRequest request =
|
||||
HttpRequest.newBuilder(URI.create("http://localhost:" + port + "/graphql"))
|
||||
.header("Content-Type", "application/json")
|
||||
.POST(HttpRequest.BodyPublishers.ofInputStream(() -> new ByteArrayInputStream(body)))
|
||||
.build();
|
||||
|
||||
// when
|
||||
HttpResponse<String> response;
|
||||
try (HttpClient client = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build()) {
|
||||
response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
}
|
||||
|
||||
// then
|
||||
assertThat(response.statusCode()).isEqualTo(413);
|
||||
}
|
||||
|
||||
@Test
|
||||
void theSecondIdenticalDocumentIsServedFromThePlatformParseCache() {
|
||||
long hitsBefore = preparsedCache.metrics().hits();
|
||||
|
||||
+30
@@ -4,12 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlPlatformWebInterceptor;
|
||||
import dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlPrincipalResolver;
|
||||
import dev.caskeleton.adapter.inbound.graphql.security.GraphQlAuthorizationPolicy;
|
||||
import dev.caskeleton.shared.runtime.RuntimeEnvironment;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
@@ -224,6 +226,34 @@ class GraphQlDeploymentModeContractTest {
|
||||
.hasMessageContaining("requires an explicit GraphQlAuthorizationPolicy"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"PRODUCTION_INTERNAL", "PRODUCTION_PUBLIC"})
|
||||
@DisplayName("production 은 익명 principal resolver 로 떠서 모든 요청을 거부하는 대신 기동을 거부한다")
|
||||
void aProductionModeRefusesTheAnonymousPrincipalResolver(String mode) {
|
||||
runner
|
||||
.withPropertyValues("backend.graphql.deployment-mode=" + mode)
|
||||
.withBean(
|
||||
GraphQlAuthorizationPolicy.class, () -> GraphQlAuthorizationPolicy.builder().build())
|
||||
.run(
|
||||
context ->
|
||||
assertThat(context)
|
||||
.hasFailed()
|
||||
.getFailure()
|
||||
.rootCause()
|
||||
.hasMessageContaining("requires an explicit GraphQlPrincipalResolver"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("production 은 인가 정책과 principal resolver 를 둘 다 주면 기동한다")
|
||||
void aProductionModeWithAnExplicitPolicyAndResolverStarts() {
|
||||
runner
|
||||
.withPropertyValues("backend.graphql.deployment-mode=PRODUCTION_INTERNAL")
|
||||
.withBean(
|
||||
GraphQlAuthorizationPolicy.class, () -> GraphQlAuthorizationPolicy.builder().build())
|
||||
.withBean(GraphQlPrincipalResolver.class, () -> request -> Optional.empty())
|
||||
.run(context -> assertThat(context).hasNotFailed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("the mode reaches the interceptor that decides what an anonymous caller may do")
|
||||
void theModeReachesTheRequestPath() {
|
||||
|
||||
+22
@@ -2,6 +2,7 @@ package dev.caskeleton.adapter.inbound.graphql.context;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.api.GraphQlClientProfile;
|
||||
import dev.caskeleton.adapter.inbound.graphql.api.GraphQlOperationId;
|
||||
@@ -10,7 +11,11 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
/** Immutable request context and layered deadline contract (Stable plan Task 3). */
|
||||
class GraphQlRequestContextTest {
|
||||
@@ -47,6 +52,23 @@ class GraphQlRequestContextTest {
|
||||
TenantContext.TenantSource.SYSTEM);
|
||||
}
|
||||
|
||||
static Stream<String> tenantsTheWebTransportRefuses() {
|
||||
return Stream.of("tenant a", "tenant/a", "-tenant", "a".repeat(65));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("tenantsTheWebTransportRefuses")
|
||||
@DisplayName("web 전송이 거부하는 tenant 는 GraphQL 도 거부한다 — 한 전송만 통과하는 tenant 가 없다")
|
||||
void aTenantTheWebTransportRefusesIsRefusedHereToo(String tenant) {
|
||||
// when
|
||||
Throwable thrown = catchThrowable(() -> TenantContext.fromAuthenticatedCredential(tenant));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessage("tenant identity must match [A-Za-z0-9][A-Za-z0-9_.-]{0,63}");
|
||||
}
|
||||
|
||||
@Test
|
||||
void actorAndTenantExposePartitionTokensInsteadOfRawIdentifiers() {
|
||||
ActorRef actor = ActorRef.authenticated("user-42");
|
||||
|
||||
+22
@@ -8,7 +8,10 @@ import graphql.language.Definition;
|
||||
import graphql.language.Document;
|
||||
import graphql.language.OperationDefinition;
|
||||
import graphql.parser.Parser;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
/**
|
||||
* The gate has to see what the request can reach, not what it wrote inline.
|
||||
@@ -47,6 +50,25 @@ class GraphQlFragmentReachabilityTest {
|
||||
assertThat(analyzer.selectsIntrospection(document)).isTrue();
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(
|
||||
strings = {
|
||||
"{ _health __typename }",
|
||||
"query Q { node { __typename id } }",
|
||||
"query Q { ...N } fragment N on Query { node { __typename } }"
|
||||
})
|
||||
@DisplayName("__typename 은 introspection 이 아니라서 introspection 을 끈 client 도 쓸 수 있다")
|
||||
void typenameIsNotTreatedAsIntrospection(String query) {
|
||||
// given
|
||||
Document document = Parser.parse(query);
|
||||
|
||||
// when
|
||||
boolean selectsIntrospection = analyzer.selectsIntrospection(document);
|
||||
|
||||
// then
|
||||
assertThat(selectsIntrospection).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aFragmentCycleTerminatesRatherThanRecursingForever() {
|
||||
Document document =
|
||||
|
||||
+7
-1
@@ -6,6 +6,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import dev.caskeleton.adapter.inbound.graphql.cost.GraphQlComplexityRejectedException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.cost.GraphQlStructuralLimitException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlBatchTimeoutException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlMissingKeyException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlAnonymousOperationException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.pagination.GraphQlCursorException;
|
||||
import java.util.Set;
|
||||
@@ -26,8 +27,11 @@ class GraphQlErrorCodeCatalogTest {
|
||||
GraphQlErrorCode.DEPENDENCY_UNAVAILABLE,
|
||||
GraphQlErrorCode.GRAPHQL_DOCUMENT_SHAPE_REJECTED,
|
||||
GraphQlErrorCode.GRAPHQL_COMPLEXITY_EXCEEDED,
|
||||
GraphQlErrorCode.GRAPHQL_OPERATION_NAME_REQUIRED);
|
||||
GraphQlErrorCode.GRAPHQL_OPERATION_NAME_REQUIRED,
|
||||
GraphQlErrorCode.GRAPHQL_BATCH_KEY_MISSING);
|
||||
|
||||
assertThat(GraphQlMissingKeyException.CODE)
|
||||
.isEqualTo(GraphQlErrorCode.GRAPHQL_BATCH_KEY_MISSING);
|
||||
assertThat(GraphQlStructuralLimitException.CODE)
|
||||
.isEqualTo(GraphQlErrorCode.GRAPHQL_DOCUMENT_SHAPE_REJECTED);
|
||||
assertThat(GraphQlComplexityRejectedException.CODE)
|
||||
@@ -48,6 +52,8 @@ class GraphQlErrorCodeCatalogTest {
|
||||
.isTrue());
|
||||
}
|
||||
|
||||
// A batch timeout is wired, but it reaches the wire as REQUEST_TIMEOUT: its own code names the
|
||||
// loader-level cause for logs, not a separate thing a client should branch on.
|
||||
@Test
|
||||
void modelledOnlyCapabilityCodesDoNotPretendToBeShippedWireCodes() {
|
||||
assertThat(GraphQlErrorCode.platformCodes())
|
||||
|
||||
+37
@@ -3,7 +3,13 @@ package dev.caskeleton.adapter.inbound.graphql.error;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.read.ListAppender;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/** Exception resolution, masking and partial data (Stable plan Task 25). */
|
||||
class GraphQlExceptionResolverTest {
|
||||
@@ -30,6 +36,37 @@ class GraphQlExceptionResolverTest {
|
||||
.containsEntry("code", GraphQlErrorCode.INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("가려진 실패는 client 가 받은 executionId 와 예외로 ERROR 로그 한 줄을 남긴다")
|
||||
void aMaskedFailureIsLoggedOnceAtErrorWithItsExecutionId() {
|
||||
// given
|
||||
Logger logger = (Logger) LoggerFactory.getLogger(GraphQlExceptionResolver.class);
|
||||
ListAppender<ILoggingEvent> appender = new ListAppender<>();
|
||||
appender.start();
|
||||
logger.addAppender(appender);
|
||||
|
||||
// when
|
||||
try {
|
||||
GraphQlExceptionResolver.defaults()
|
||||
.resolve(new IllegalStateException("pool exhausted"), GraphQlErrorContext.of("exec-9"));
|
||||
} finally {
|
||||
logger.detachAppender(appender);
|
||||
appender.stop();
|
||||
}
|
||||
|
||||
// then
|
||||
assertThat(appender.list)
|
||||
.singleElement()
|
||||
.extracting(
|
||||
ILoggingEvent::getLevel,
|
||||
ILoggingEvent::getFormattedMessage,
|
||||
event -> event.getThrowableProxy().getClassName())
|
||||
.containsExactly(
|
||||
Level.ERROR,
|
||||
"graphql failure masked as INTERNAL_ERROR (executionId=exec-9)",
|
||||
IllegalStateException.class.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
void deliberatelyModelledFailuresKeepTheirCodeAndCategory() {
|
||||
GraphQlExceptionResolver resolver =
|
||||
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.autoconfigure.GraphQlRootAutoConfiguration;
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.GraphQlRequestContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionStage;
|
||||
import dev.caskeleton.adapter.inbound.graphql.testkit.GraphQlRequestContexts;
|
||||
import dev.caskeleton.shared.error.ApiErrorCarrier;
|
||||
import dev.caskeleton.shared.error.ApiErrorCode;
|
||||
import dev.caskeleton.shared.error.Category;
|
||||
import graphql.ExecutionInput;
|
||||
import graphql.ExecutionResult;
|
||||
import graphql.GraphQL;
|
||||
import graphql.schema.idl.SchemaParser;
|
||||
import graphql.schema.idl.UnExecutableSchemaGenerator;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.graphql.server.WebGraphQlInterceptor;
|
||||
import org.springframework.graphql.server.WebGraphQlRequest;
|
||||
import org.springframework.graphql.server.WebGraphQlResponse;
|
||||
import org.springframework.graphql.support.DefaultGraphQlRequest;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* A failure raised before execution meets the same mapper as one raised by a resolver.
|
||||
*
|
||||
* <p>The request stage — the transport interceptor and the pre-execution pipeline — used to map
|
||||
* through the platform's own catalogue only, so an adopter's {@link ApiErrorCarrier} thrown there
|
||||
* became {@code INTERNAL_ERROR} while the same exception from a resolver kept its code. Both cases
|
||||
* go through the auto-configured beans, because "every path receives the mapper bean" is the
|
||||
* property under test.
|
||||
*/
|
||||
class GraphQlRequestStageErrorMappingTest {
|
||||
|
||||
private final ApplicationContextRunner runner =
|
||||
new ApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL");
|
||||
|
||||
@Test
|
||||
@DisplayName("principal resolver 가 던진 ApiErrorCarrier 는 요청 단계에서도 자기 code 로 나간다")
|
||||
void anApiErrorCarrierFromThePrincipalResolverKeepsItsCode() {
|
||||
runner
|
||||
.withBean(
|
||||
GraphQlPrincipalResolver.class,
|
||||
() ->
|
||||
request -> {
|
||||
throw new TenantSuspendedException();
|
||||
})
|
||||
.run(
|
||||
context -> {
|
||||
// given
|
||||
WebGraphQlInterceptor interceptor =
|
||||
context.getBean(GraphQlPlatformWebInterceptor.class);
|
||||
|
||||
// when
|
||||
WebGraphQlResponse response =
|
||||
interceptor
|
||||
.intercept(
|
||||
request("{ _health }"),
|
||||
next -> Mono.error(new AssertionError("a rejected request ran")))
|
||||
.block();
|
||||
|
||||
// then
|
||||
assertThat(response.getErrors())
|
||||
.singleElement()
|
||||
.extracting(error -> error.getExtensions().get("code"))
|
||||
.isEqualTo("TENANT_SUSPENDED");
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("실행 전 pipeline 단계가 던진 ApiErrorCarrier 도 자기 code 로 나간다")
|
||||
void anApiErrorCarrierFromAPipelineStageKeepsItsCode() {
|
||||
runner
|
||||
.withBean(
|
||||
GraphQlExecutionChain.class,
|
||||
() ->
|
||||
new GraphQlExecutionChain(
|
||||
List.of(
|
||||
new Stage(GraphQlExecutionStage.PARSE_VALIDATE, false),
|
||||
new Stage(GraphQlExecutionStage.AUTHORIZATION, true),
|
||||
new Stage(GraphQlExecutionStage.COST, false))))
|
||||
.run(
|
||||
context -> {
|
||||
// given
|
||||
GraphQL graphQl =
|
||||
GraphQL.newGraphQL(
|
||||
UnExecutableSchemaGenerator.makeUnExecutableSchema(
|
||||
new SchemaParser().parse("type Query { _health: String }")))
|
||||
.instrumentation(context.getBean(GraphQlPlatformInstrumentation.class))
|
||||
.build();
|
||||
ExecutionInput input =
|
||||
ExecutionInput.newExecutionInput("{ _health }")
|
||||
.graphQLContext(
|
||||
Map.of(
|
||||
GraphQlRequestContext.CONTEXT_KEY,
|
||||
GraphQlRequestContexts.testContext("tenant-a")))
|
||||
.build();
|
||||
|
||||
// when
|
||||
ExecutionResult result = graphQl.execute(input);
|
||||
|
||||
// then
|
||||
assertThat(result.getErrors())
|
||||
.singleElement()
|
||||
.extracting(error -> error.getExtensions().get("code"))
|
||||
.isEqualTo("TENANT_SUSPENDED");
|
||||
});
|
||||
}
|
||||
|
||||
private static WebGraphQlRequest request(String document) {
|
||||
return new WebGraphQlRequest(
|
||||
URI.create("http://localhost/graphql"),
|
||||
new HttpHeaders(),
|
||||
new LinkedMultiValueMap<>(),
|
||||
null,
|
||||
Map.of(),
|
||||
new DefaultGraphQlRequest(document),
|
||||
"request-1",
|
||||
Locale.ROOT);
|
||||
}
|
||||
|
||||
/** A pipeline stage that passes the state through, or rejects with an adopter's carrier. */
|
||||
private record Stage(GraphQlExecutionStage stage, boolean rejects)
|
||||
implements GraphQlExecutionHandler {
|
||||
|
||||
@Override
|
||||
public GraphQlExecutionContext handle(GraphQlExecutionContext context) {
|
||||
if (rejects) {
|
||||
throw new TenantSuspendedException();
|
||||
}
|
||||
return context;
|
||||
}
|
||||
}
|
||||
|
||||
/** An adopter's modelled failure, carrying its own stable code. */
|
||||
private static final class TenantSuspendedException extends RuntimeException
|
||||
implements ApiErrorCarrier {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
TenantSuspendedException() {
|
||||
super("tenant t-1 suspended by billing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiErrorCode errorCode() {
|
||||
return AdopterErrorCode.TENANT_SUSPENDED;
|
||||
}
|
||||
}
|
||||
|
||||
private enum AdopterErrorCode implements ApiErrorCode {
|
||||
TENANT_SUSPENDED;
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Category category() {
|
||||
return Category.AUTHZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int httpStatus() {
|
||||
return 403;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retryable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlBatchTimeoutException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlMissingKeyException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlErrorContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.error.GraphQlWireError;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
class GraphQlWireErrorMapperTest {
|
||||
|
||||
static Stream<Arguments> dataLoaderFailures() {
|
||||
return Stream.of(
|
||||
Arguments.of(
|
||||
new GraphQlBatchTimeoutException("customer-by-id"), "REQUEST_TIMEOUT", "TIMEOUT"),
|
||||
Arguments.of(new GraphQlMissingKeyException(), "GRAPHQL_BATCH_KEY_MISSING", "BUSINESS"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("dataLoaderFailures")
|
||||
@DisplayName("DataLoader 의 timeout·missing key 는 INTERNAL_ERROR 로 가려지지 않고 플랫폼 code 로 나간다")
|
||||
void dataLoaderFailuresKeepAPlatformCode(
|
||||
RuntimeException failure, String expectedCode, String expectedCategory) {
|
||||
// given
|
||||
GraphQlWireErrorMapper mapper = GraphQlWireErrorMapper.masking();
|
||||
|
||||
// when
|
||||
GraphQlWireError error = mapper.map(failure, GraphQlErrorContext.test());
|
||||
|
||||
// then
|
||||
assertThat(error.extensions())
|
||||
.extracting(extensions -> extensions.get("code"), extensions -> extensions.get("category"))
|
||||
.containsExactly(expectedCode, expectedCategory);
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,12 @@ Package root: `dev.caskeleton.adapter.inbound.grpc`.
|
||||
- 프로덕션 feature RPC 를 스켈레톤에 두는 것 — health/reflection 표면만 (web 의
|
||||
`HealthcheckController` 와 동일 원칙).
|
||||
|
||||
## Config knobs (`ca-skeleton.grpc.*`)
|
||||
## Config knobs (`ca-skeleton.grpc.server.*`)
|
||||
|
||||
타입드 `@ConfigurationProperties` 만 두고, 값은 composition-root `application.yml` 에 산다
|
||||
(모듈별 `yml` 없음).
|
||||
(모듈별 `yml` 없음). prefix가 `ca-skeleton.grpc`가 아니라 `.server`까지인 이유: 바인딩이
|
||||
`ignoreUnknownFields = false`라서, 부모 prefix를 쓰면 벤더 starter의 `ca-skeleton.grpc.platform.*`
|
||||
키가 들어오는 순간 기동이 실패한다(`GrpcSafeActivationTest`).
|
||||
|
||||
| key | default | 의미 |
|
||||
|---|---|---|
|
||||
@@ -81,7 +83,8 @@ credential path and a separately qualified non-loopback bind.
|
||||
때는 `.proto`/generated stub/`BindableService`를 해당 feature가 소유하고, 서비스 빈과 정확히 한
|
||||
개의 caller-supplied `GrpcAuthenticationPolicy` 빈을 함께 제공한다. 정책이 없거나 여러 개면
|
||||
listener 시작이 실패한다. 정책이 `false`를 반환하거나 예외를 던진 요청은 feature handler에 닿지
|
||||
않고 안정적인 `UNAUTHENTICATED` status/code/category로 종료된다.
|
||||
않고 안정적인 `UNAUTHENTICATED` status/code/category로 종료된다. 정책 예외는 예외 타입과 메서드
|
||||
이름만 WARN으로 남긴다(메시지는 자격 증명을 담을 수 있어 남기지 않는다).
|
||||
|
||||
## P1 증거와 한계
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
```
|
||||
|
||||
이 줄을 지우면 서버, 포트, 설정 바인딩이 모두 함께 빠진다.
|
||||
- 켜기와 끄기: 모듈이 있으면 켜진다. `ca-skeleton.grpc.enabled=false`로만 끈다.
|
||||
- 켜기와 끄기: 모듈이 있으면 켜진다. `ca-skeleton.grpc.server.enabled=false`로만 끈다.
|
||||
- 필요한 설정: 전용 `APP_*` env 키는 registry에 없다. 켜진 상태에서 지금 구현이 받는 listener는
|
||||
loopback plaintext뿐이라 `ca-skeleton.grpc.allow-insecure-local=true`(env
|
||||
`CA_SKELETON_GRPC_ALLOW_INSECURE_LOCAL=true`)를 명시해야 기동한다. 선택: `ca-skeleton.grpc.port`
|
||||
loopback plaintext뿐이라 `ca-skeleton.grpc.server.allow-insecure-local=true`(env
|
||||
`CA_SKELETON_GRPC_SERVER_ALLOW_INSECURE_LOCAL=true`)를 명시해야 기동한다. 선택: `ca-skeleton.grpc.server.port`
|
||||
(기본 9090), `.bind-address`(기본 127.0.0.1), `.reflection-enabled`, `.shutdown-grace-seconds`.
|
||||
|
||||
## 왜 self-managed Netty 인가
|
||||
|
||||
+12
-3
@@ -6,10 +6,14 @@ import io.grpc.ServerCall;
|
||||
import io.grpc.ServerCallHandler;
|
||||
import io.grpc.ServerInterceptor;
|
||||
import io.grpc.Status;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/** Applies the caller-supplied authentication policy before a feature RPC can reach its handler. */
|
||||
final class GrpcAuthenticationInterceptor implements ServerInterceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GrpcAuthenticationInterceptor.class);
|
||||
|
||||
private final GrpcAuthenticationPolicy authenticationPolicy;
|
||||
private final GrpcStatusMapper statusMapper;
|
||||
|
||||
@@ -22,7 +26,7 @@ final class GrpcAuthenticationInterceptor implements ServerInterceptor {
|
||||
@Override
|
||||
public <REQT, RESPT> ServerCall.Listener<REQT> interceptCall(
|
||||
ServerCall<REQT, RESPT> call, Metadata headers, ServerCallHandler<REQT, RESPT> next) {
|
||||
if (isAuthenticated(headers)) {
|
||||
if (isAuthenticated(headers, call.getMethodDescriptor().getFullMethodName())) {
|
||||
return next.startCall(call, headers);
|
||||
}
|
||||
|
||||
@@ -32,10 +36,15 @@ final class GrpcAuthenticationInterceptor implements ServerInterceptor {
|
||||
return new ServerCall.Listener<>() {};
|
||||
}
|
||||
|
||||
private boolean isAuthenticated(Metadata headers) {
|
||||
private boolean isAuthenticated(Metadata headers, String method) {
|
||||
try {
|
||||
return authenticationPolicy.isAuthenticated(headers);
|
||||
} catch (RuntimeException ignored) {
|
||||
} catch (RuntimeException failure) {
|
||||
// Type and method only: the message of a failing credential check may echo the credential.
|
||||
log.warn(
|
||||
"gRPC authentication policy threw {} for {}; the call is rejected as UNAUTHENTICATED",
|
||||
failure.getClass().getName(),
|
||||
method);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-6
@@ -51,19 +51,21 @@ public class GrpcExceptionHandlingInterceptor implements ServerInterceptor {
|
||||
return new SimpleForwardingServerCallListener<>(delegate) {
|
||||
@Override
|
||||
public void onMessage(REQT message) {
|
||||
runGuarded(() -> super.onMessage(message));
|
||||
runWhileOpen(() -> super.onMessage(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHalfClose() {
|
||||
runGuarded(super::onHalfClose);
|
||||
runWhileOpen(super::onHalfClose);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady() {
|
||||
runGuarded(super::onReady);
|
||||
runWhileOpen(super::onReady);
|
||||
}
|
||||
|
||||
// onCancel/onComplete arrive after close by design; they run the service's cancel and close
|
||||
// handlers, so they are never skipped.
|
||||
@Override
|
||||
public void onCancel() {
|
||||
runGuarded(super::onCancel);
|
||||
@@ -74,10 +76,13 @@ public class GrpcExceptionHandlingInterceptor implements ServerInterceptor {
|
||||
runGuarded(super::onComplete);
|
||||
}
|
||||
|
||||
private void runGuarded(Runnable action) {
|
||||
if (closed.get()) {
|
||||
return;
|
||||
private void runWhileOpen(Runnable action) {
|
||||
if (!closed.get()) {
|
||||
runGuarded(action);
|
||||
}
|
||||
}
|
||||
|
||||
private void runGuarded(Runnable action) {
|
||||
try {
|
||||
action.run();
|
||||
} catch (RuntimeException e) {
|
||||
|
||||
+3
-3
@@ -11,8 +11,8 @@ import org.springframework.context.annotation.Bean;
|
||||
/**
|
||||
* Wires the gRPC transport machinery. Registered through this module's own {@code
|
||||
* AutoConfiguration.imports}: on when the module is present, off with {@code
|
||||
* ca-skeleton.grpc.enabled=false}. The plaintext listener still refuses to start unless {@code
|
||||
* ca-skeleton.grpc.allow-insecure-local=true} is explicit.
|
||||
* ca-skeleton.grpc.server.enabled=false}. The plaintext listener still refuses to start unless
|
||||
* {@code ca-skeleton.grpc.server.allow-insecure-local=true} is explicit.
|
||||
*
|
||||
* <p>All collaborators are plain objects composed here, mirroring the clean DI style used across
|
||||
* the skeleton. A feature service is exposed only when its {@link BindableService} bean carries
|
||||
@@ -20,7 +20,7 @@ import org.springframework.context.annotation.Bean;
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(
|
||||
prefix = "ca-skeleton.grpc",
|
||||
prefix = "ca-skeleton.grpc.server",
|
||||
name = "enabled",
|
||||
havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
|
||||
+2
-2
@@ -10,11 +10,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* gRPC server settings bound from {@code ca-skeleton.grpc.*}. Typed configuration only (no
|
||||
* gRPC server settings bound from {@code ca-skeleton.grpc.server.*}. Typed configuration only (no
|
||||
* per-module {@code yml}); values live in the composition-root {@code application.yml}, matching
|
||||
* the ca-skeleton config convention. See README for the self-managed-Netty rationale.
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "ca-skeleton.grpc", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "ca-skeleton.grpc.server", ignoreUnknownFields = false)
|
||||
@Validated
|
||||
public class GrpcServerSettings {
|
||||
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package dev.caskeleton.adapter.inbound.grpc;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import io.grpc.Metadata;
|
||||
import io.grpc.MethodDescriptor;
|
||||
import io.grpc.ServerCall;
|
||||
import io.grpc.Status;
|
||||
import java.io.InputStream;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.boot.test.system.CapturedOutput;
|
||||
import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||
|
||||
@ExtendWith(OutputCaptureExtension.class)
|
||||
class GrpcAuthenticationInterceptorTest {
|
||||
|
||||
private static final String CREDENTIAL_SENTINEL = "credential-secret-sentinel";
|
||||
|
||||
@Test
|
||||
void aThrowingPolicyIsLoggedWithItsTypeAndMethodButNotItsMessage(CapturedOutput output) {
|
||||
// given
|
||||
GrpcAuthenticationInterceptor interceptor =
|
||||
new GrpcAuthenticationInterceptor(
|
||||
metadata -> {
|
||||
throw new IllegalStateException(CREDENTIAL_SENTINEL);
|
||||
},
|
||||
new GrpcStatusMapper());
|
||||
|
||||
// when
|
||||
interceptor.interceptCall(
|
||||
new MethodCall(), new Metadata(), (call, headers) -> new ServerCall.Listener<>() {});
|
||||
|
||||
// then
|
||||
assertThat(output.getAll())
|
||||
.contains("IllegalStateException", "test.auth.Feature/Check")
|
||||
.doesNotContain(CREDENTIAL_SENTINEL);
|
||||
}
|
||||
|
||||
/** A server call that only knows its method; the interceptor closes it as unauthenticated. */
|
||||
private static final class MethodCall extends ServerCall<String, String> {
|
||||
|
||||
private static final MethodDescriptor.Marshaller<String> UNUSED =
|
||||
new MethodDescriptor.Marshaller<>() {
|
||||
@Override
|
||||
public InputStream stream(String value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String parse(InputStream stream) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void request(int numMessages) {}
|
||||
|
||||
@Override
|
||||
public void sendHeaders(Metadata headers) {}
|
||||
|
||||
@Override
|
||||
public void sendMessage(String message) {}
|
||||
|
||||
@Override
|
||||
public void close(Status status, Metadata trailers) {}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodDescriptor<String, String> getMethodDescriptor() {
|
||||
return MethodDescriptor.<String, String>newBuilder()
|
||||
.setType(MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName("test.auth.Feature/Check")
|
||||
.setRequestMarshaller(UNUSED)
|
||||
.setResponseMarshaller(UNUSED)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -11,6 +11,7 @@ import io.grpc.MethodDescriptor;
|
||||
import io.grpc.ServerCall;
|
||||
import io.grpc.ServerCallHandler;
|
||||
import io.grpc.Status;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
@@ -66,6 +67,30 @@ class GrpcExceptionHandlingInterceptorTest {
|
||||
assertThat(call.trailers.get(GrpcStatusMapper.CATEGORY_KEY)).isEqualTo("INTERNAL");
|
||||
}
|
||||
|
||||
@Test
|
||||
void aCancelAfterTheCallClosedStillReachesTheServiceListener() {
|
||||
// given
|
||||
AtomicBoolean cancelled = new AtomicBoolean();
|
||||
ServerCallHandler<String, String> handler =
|
||||
(serverCall, headers) -> {
|
||||
serverCall.close(Status.OK, new Metadata());
|
||||
return new ServerCall.Listener<>() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
cancelled.set(true);
|
||||
}
|
||||
};
|
||||
};
|
||||
ServerCall.Listener<String> listener =
|
||||
interceptor.interceptCall(new CapturingServerCall(), new Metadata(), handler);
|
||||
|
||||
// when
|
||||
listener.onCancel();
|
||||
|
||||
// then
|
||||
assertThat(cancelled).isTrue();
|
||||
}
|
||||
|
||||
private CapturingServerCall closeAfterThrowing(RuntimeException thrown) {
|
||||
CapturingServerCall call = new CapturingServerCall();
|
||||
ServerCallHandler<String, String> handler =
|
||||
|
||||
+39
-5
@@ -22,6 +22,7 @@ import io.grpc.reflection.v1.ServerReflectionRequest;
|
||||
import io.grpc.reflection.v1.ServerReflectionResponse;
|
||||
import io.grpc.stub.ClientCalls;
|
||||
import io.grpc.stub.MetadataUtils;
|
||||
import io.grpc.stub.ServerCallStreamObserver;
|
||||
import io.grpc.stub.ServerCalls;
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -55,16 +56,19 @@ class GrpcP1BoundaryWireTest {
|
||||
unaryMethod("HandlerThrow");
|
||||
private static final MethodDescriptor<String, String> LISTENER_THROW_METHOD =
|
||||
unaryMethod("ListenerThrow");
|
||||
private static final MethodDescriptor<String, String> CLOSE_HANDLER_METHOD =
|
||||
unaryMethod("CloseHandler");
|
||||
private static final CountDownLatch CLOSE_HANDLER_RAN = new CountDownLatch(1);
|
||||
|
||||
private final ApplicationContextRunner contextRunner =
|
||||
new ApplicationContextRunner()
|
||||
.withUserConfiguration(GrpcServerConfig.class, FeatureConfiguration.class)
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.enabled=true",
|
||||
"ca-skeleton.grpc.port=0",
|
||||
"ca-skeleton.grpc.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.reflection-enabled=false");
|
||||
"ca-skeleton.grpc.server.enabled=true",
|
||||
"ca-skeleton.grpc.server.port=0",
|
||||
"ca-skeleton.grpc.server.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.server.reflection-enabled=false");
|
||||
|
||||
@Test
|
||||
void missingAuthenticationMetadataIsRejectedWithAStableContract() {
|
||||
@@ -172,6 +176,27 @@ class GrpcP1BoundaryWireTest {
|
||||
RAW_STATUS_SENTINEL));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aSuccessfullyCompletedCallStillRunsTheServiceOnCloseHandler() {
|
||||
withChannel(
|
||||
channel -> {
|
||||
// when
|
||||
unary(authenticated(channel), CLOSE_HANDLER_METHOD, "ok");
|
||||
|
||||
// then
|
||||
assertThat(await(CLOSE_HANDLER_RAN)).isTrue();
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean await(CountDownLatch latch) {
|
||||
try {
|
||||
return latch.await(5, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new IllegalStateException("interrupted while waiting for the close handler", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void withChannel(Consumer<ManagedChannel> assertion) {
|
||||
contextRunner.run(
|
||||
context -> {
|
||||
@@ -312,6 +337,15 @@ class GrpcP1BoundaryWireTest {
|
||||
observer.onNext("authorized-" + request);
|
||||
observer.onCompleted();
|
||||
}))
|
||||
.addMethod(
|
||||
CLOSE_HANDLER_METHOD,
|
||||
ServerCalls.asyncUnaryCall(
|
||||
(String request, StreamObserver<String> observer) -> {
|
||||
((ServerCallStreamObserver<String>) observer)
|
||||
.setOnCloseHandler(CLOSE_HANDLER_RAN::countDown);
|
||||
observer.onNext(request);
|
||||
observer.onCompleted();
|
||||
}))
|
||||
.addMethod(
|
||||
HANDLER_THROW_METHOD,
|
||||
(ServerCallHandler<String, String>)
|
||||
|
||||
+32
-20
@@ -42,14 +42,15 @@ class GrpcSafeActivationTest {
|
||||
@Test
|
||||
void presentWithoutTheSwitchIsOnAndStillRefusesAnImplicitPlaintextListener() {
|
||||
contextRunner
|
||||
.withPropertyValues("ca-skeleton.grpc.port=0")
|
||||
.withPropertyValues("ca-skeleton.grpc.server.port=0")
|
||||
.run(context -> assertRootCauseContains(context.getStartupFailure(), "insecure"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void switchedOffCreatesNoGrpcRuntimeBeansOrListener() {
|
||||
contextRunner
|
||||
.withPropertyValues("ca-skeleton.grpc.enabled=false", "ca-skeleton.grpc.port=0")
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.server.enabled=false", "ca-skeleton.grpc.server.port=0")
|
||||
.run(
|
||||
context -> {
|
||||
assertThat(context).doesNotHaveBean(GrpcServerSettings.class);
|
||||
@@ -62,7 +63,8 @@ class GrpcSafeActivationTest {
|
||||
@Test
|
||||
void enabledTransportRequiresAnExplicitLocalInsecureOverride() {
|
||||
contextRunner
|
||||
.withPropertyValues("ca-skeleton.grpc.enabled=true", "ca-skeleton.grpc.port=0")
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.server.enabled=true", "ca-skeleton.grpc.server.port=0")
|
||||
.run(context -> assertRootCauseContains(context.getStartupFailure(), "insecure"));
|
||||
}
|
||||
|
||||
@@ -70,10 +72,10 @@ class GrpcSafeActivationTest {
|
||||
void insecureTransportRejectsANonLoopbackBindAddress() {
|
||||
contextRunner
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.enabled=true",
|
||||
"ca-skeleton.grpc.port=0",
|
||||
"ca-skeleton.grpc.bind-address=0.0.0.0",
|
||||
"ca-skeleton.grpc.allow-insecure-local=true")
|
||||
"ca-skeleton.grpc.server.enabled=true",
|
||||
"ca-skeleton.grpc.server.port=0",
|
||||
"ca-skeleton.grpc.server.bind-address=0.0.0.0",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true")
|
||||
.run(context -> assertRootCauseContains(context.getStartupFailure(), "loopback"));
|
||||
}
|
||||
|
||||
@@ -81,10 +83,10 @@ class GrpcSafeActivationTest {
|
||||
void enabledTransportRejectsAPortOutsideTheTcpRange() {
|
||||
contextRunner
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.enabled=true",
|
||||
"ca-skeleton.grpc.port=65536",
|
||||
"ca-skeleton.grpc.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.allow-insecure-local=true")
|
||||
"ca-skeleton.grpc.server.enabled=true",
|
||||
"ca-skeleton.grpc.server.port=65536",
|
||||
"ca-skeleton.grpc.server.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true")
|
||||
.run(context -> assertRootCauseContains(context.getStartupFailure(), "port"));
|
||||
}
|
||||
|
||||
@@ -92,11 +94,11 @@ class GrpcSafeActivationTest {
|
||||
void enabledTransportRejectsANegativeShutdownGrace() {
|
||||
contextRunner
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.enabled=true",
|
||||
"ca-skeleton.grpc.port=0",
|
||||
"ca-skeleton.grpc.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.shutdown-grace-seconds=-1")
|
||||
"ca-skeleton.grpc.server.enabled=true",
|
||||
"ca-skeleton.grpc.server.port=0",
|
||||
"ca-skeleton.grpc.server.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.server.shutdown-grace-seconds=-1")
|
||||
.run(
|
||||
context ->
|
||||
assertRootCauseContains(context.getStartupFailure(), "shutdownGraceSeconds"));
|
||||
@@ -107,13 +109,23 @@ class GrpcSafeActivationTest {
|
||||
contextRunner
|
||||
.withUserConfiguration(FeatureServiceConfiguration.class)
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.enabled=true",
|
||||
"ca-skeleton.grpc.port=0",
|
||||
"ca-skeleton.grpc.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.allow-insecure-local=true")
|
||||
"ca-skeleton.grpc.server.enabled=true",
|
||||
"ca-skeleton.grpc.server.port=0",
|
||||
"ca-skeleton.grpc.server.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true")
|
||||
.run(context -> assertRootCauseContains(context.getStartupFailure(), "authentication"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void theVendorPlatformNamespaceBesideTheAdapterDoesNotFailItsStrictBinding() {
|
||||
contextRunner
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.server.port=0",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.platform.enabled=true")
|
||||
.run(context -> assertThat(context).hasNotFailed());
|
||||
}
|
||||
|
||||
private static void assertRootCauseContains(Throwable failure, String expected) {
|
||||
assertThat(failure).isNotNull();
|
||||
Throwable rootCause = failure;
|
||||
|
||||
+9
-9
@@ -27,10 +27,10 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Boots the skeleton gRPC machinery in a real Spring context on an ephemeral port ({@code
|
||||
* ca-skeleton.grpc.port=0}) with ZERO feature services and proves it stands up a working surface:
|
||||
* the {@link GrpcServerRunner} SmartLifecycle starts, the standard {@code grpc.health.v1} health
|
||||
* service reports SERVING, and v1 server reflection lists the built-in services. A real Netty
|
||||
* channel exercises the wire, so this is a genuine transport smoke test, not a wiring mock.
|
||||
* ca-skeleton.grpc.server.port=0}) with ZERO feature services and proves it stands up a working
|
||||
* surface: the {@link GrpcServerRunner} SmartLifecycle starts, the standard {@code grpc.health.v1}
|
||||
* health service reports SERVING, and v1 server reflection lists the built-in services. A real
|
||||
* Netty channel exercises the wire, so this is a genuine transport smoke test, not a wiring mock.
|
||||
*/
|
||||
class GrpcServerRunnerBootTest {
|
||||
|
||||
@@ -38,11 +38,11 @@ class GrpcServerRunnerBootTest {
|
||||
new ApplicationContextRunner()
|
||||
.withUserConfiguration(GrpcServerConfig.class)
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.grpc.enabled=true",
|
||||
"ca-skeleton.grpc.port=0",
|
||||
"ca-skeleton.grpc.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.reflection-enabled=true");
|
||||
"ca-skeleton.grpc.server.enabled=true",
|
||||
"ca-skeleton.grpc.server.port=0",
|
||||
"ca-skeleton.grpc.server.bind-address=127.0.0.1",
|
||||
"ca-skeleton.grpc.server.allow-insecure-local=true",
|
||||
"ca-skeleton.grpc.server.reflection-enabled=true");
|
||||
|
||||
@Test
|
||||
void skeletonServerStartsAndServesHealthAndReflectionWithNoFeatures() {
|
||||
|
||||
+1
@@ -10,6 +10,7 @@ package dev.caskeleton.adapter.inbound.web.fileserver.draft12;
|
||||
public final class Draft12Headers {
|
||||
|
||||
public static final String UPLOAD_OFFSET = "Upload-Offset";
|
||||
public static final String UPLOAD_LENGTH = "Upload-Length";
|
||||
public static final String UPLOAD_COMPLETE = "Upload-Complete";
|
||||
public static final String UPLOAD_LIMIT = "Upload-Limit";
|
||||
|
||||
|
||||
+50
-6
@@ -79,8 +79,19 @@ public class Draft12UploadController {
|
||||
this.clock = clock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the upload and stores the creation request's body as its first part.
|
||||
*
|
||||
* <p>The body is part of the representation, not a preamble: the draft lets a client send all or
|
||||
* some of the bytes with the creation request, so dropping them loses data the client will not
|
||||
* resend. For the same reason the body's length is never the upload's length — that is {@code
|
||||
* Upload-Length}, when the client knows it.
|
||||
*/
|
||||
// The channel wraps the servlet request body, which the container owns; see append.
|
||||
@SuppressWarnings("resource")
|
||||
@PostMapping(DRAFT_PATH)
|
||||
public ResponseEntity<Void> create(HttpServletRequest request) {
|
||||
public ResponseEntity<Void> create(HttpServletRequest request) throws IOException {
|
||||
RequestContext context = contextFactory.current();
|
||||
UploadSessionView created =
|
||||
uploadService.create(
|
||||
new CreateUploadRequest(
|
||||
@@ -91,10 +102,28 @@ public class Draft12UploadController {
|
||||
Optional.empty(),
|
||||
UploadMode.EXPERIMENTAL_RESUMABLE,
|
||||
clock.instant().plus(draftProperties.uploadTtl())),
|
||||
contextFactory.current());
|
||||
context);
|
||||
|
||||
long offset = 0;
|
||||
long bodyLength = request.getContentLengthLong();
|
||||
if (bodyLength > 0) {
|
||||
InputStream body = request.getInputStream();
|
||||
offset =
|
||||
transferExecutor
|
||||
.call(
|
||||
() ->
|
||||
uploadService.append(
|
||||
created.uploadId(), 0, Channels.newChannel(body), bodyLength, context))
|
||||
.committedOffset();
|
||||
}
|
||||
if (isComplete(request)) {
|
||||
transferExecutor.call(
|
||||
() ->
|
||||
finalizeService.finalizeUpload(
|
||||
created.uploadId(), FinalizeUploadRequest.synchronousWithoutDigest(), context));
|
||||
}
|
||||
return ResponseEntity.created(URI.create(DRAFT_PATH + "/" + created.uploadId().canonicalText()))
|
||||
.header(Draft12Headers.UPLOAD_OFFSET, "0")
|
||||
.header(Draft12Headers.UPLOAD_OFFSET, String.valueOf(offset))
|
||||
.header(Draft12Headers.UPLOAD_LIMIT, "max-size=" + draftProperties.maxSize())
|
||||
.build();
|
||||
}
|
||||
@@ -119,7 +148,10 @@ public class Draft12UploadController {
|
||||
uploadService.append(
|
||||
id, expectedOffset, Channels.newChannel(body), declared, context));
|
||||
if (complete) {
|
||||
finalizeService.finalizeUpload(id, FinalizeUploadRequest.synchronousWithoutDigest(), context);
|
||||
transferExecutor.call(
|
||||
() ->
|
||||
finalizeService.finalizeUpload(
|
||||
id, FinalizeUploadRequest.synchronousWithoutDigest(), context));
|
||||
}
|
||||
return ResponseEntity.noContent()
|
||||
.header(Draft12Headers.UPLOAD_OFFSET, String.valueOf(appended.committedOffset()))
|
||||
@@ -168,9 +200,21 @@ public class Draft12UploadController {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@code Upload-Length} when the client declared it; otherwise unknown until completion. */
|
||||
private static OptionalLong declaredLength(HttpServletRequest request) {
|
||||
long length = request.getContentLengthLong();
|
||||
return length < 0 ? OptionalLong.empty() : OptionalLong.of(length);
|
||||
String header = request.getHeader(Draft12Headers.UPLOAD_LENGTH);
|
||||
if (header == null || header.isBlank()) {
|
||||
return OptionalLong.empty();
|
||||
}
|
||||
try {
|
||||
long length = Long.parseLong(header.trim());
|
||||
if (length < 0) {
|
||||
throw new NumberFormatException("negative");
|
||||
}
|
||||
return OptionalLong.of(length);
|
||||
} catch (NumberFormatException malformed) {
|
||||
throw MalformedRequestException.of("Upload-Length is not a non-negative integer");
|
||||
}
|
||||
}
|
||||
|
||||
private static String filename(HttpServletRequest request) {
|
||||
|
||||
+6
-1
@@ -175,7 +175,12 @@ public class TusController {
|
||||
|
||||
UploadSessionView session = uploadService.status(id, context);
|
||||
if (isComplete(session, appended)) {
|
||||
finalizeService.finalizeUpload(id, FinalizeUploadRequest.synchronousWithoutDigest(), context);
|
||||
// Finalize reads the whole object back and moves it: transfer work, bounded by the same
|
||||
// executor as the append rather than holding a servlet thread for it.
|
||||
transferExecutor.call(
|
||||
() ->
|
||||
finalizeService.finalizeUpload(
|
||||
id, FinalizeUploadRequest.synchronousWithoutDigest(), context));
|
||||
}
|
||||
return ResponseEntity.noContent()
|
||||
.header(TusHeaders.RESUMABLE, tusProperties.version())
|
||||
|
||||
+40
@@ -53,6 +53,46 @@ class Draft12ProtocolTest {
|
||||
.andExpect(header().string(Draft12Headers.UPLOAD_LIMIT, "max-size=" + DRAFT.maxSize()));
|
||||
}
|
||||
|
||||
/** A creation request carries the first part of the representation; dropping it loses bytes. */
|
||||
@Test
|
||||
void aCreationBodyIsStoredAsTheFirstPartOfTheUpload() throws Exception {
|
||||
// when
|
||||
String location =
|
||||
mvc.perform(
|
||||
post("/v1/experimental/draft12/uploads")
|
||||
.header(Draft12Headers.UPLOAD_LENGTH, "6")
|
||||
.contentType("application/octet-stream")
|
||||
.content("abc"))
|
||||
.andReturn()
|
||||
.getResponse()
|
||||
.getHeader("Location");
|
||||
|
||||
// then
|
||||
assertThat(uploads.content(uploadIdOf(location))).isEqualTo("abc");
|
||||
}
|
||||
|
||||
/** The body's own length is the size of one part, never the size of the whole upload. */
|
||||
@Test
|
||||
void theFinalLengthComesFromUploadLengthRatherThanTheCreationBody() throws Exception {
|
||||
// when
|
||||
String location =
|
||||
mvc.perform(
|
||||
post("/v1/experimental/draft12/uploads")
|
||||
.header(Draft12Headers.UPLOAD_LENGTH, "6")
|
||||
.contentType("application/octet-stream")
|
||||
.content("abc"))
|
||||
.andReturn()
|
||||
.getResponse()
|
||||
.getHeader("Location");
|
||||
|
||||
// then
|
||||
assertThat(
|
||||
uploads
|
||||
.status(uploadIdOf(location), FileserverWebFixtures.requestContext())
|
||||
.expectedLength())
|
||||
.hasValue(6);
|
||||
}
|
||||
|
||||
@Test
|
||||
void anAppendAdvancesTheOffsetAndReportsIncompleteness() throws Exception {
|
||||
String location = create();
|
||||
|
||||
+9
-2
@@ -10,20 +10,26 @@ import dev.caskeleton.application.fileserver.api.security.RequestContext;
|
||||
import dev.caskeleton.application.fileserver.upload.FileView;
|
||||
import dev.caskeleton.application.fileserver.upload.FinalizeUploadRequest;
|
||||
import dev.caskeleton.application.fileserver.upload.FinalizeUploadService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/** Records which uploads a protocol adapter decided to finalize. */
|
||||
public final class RecordingFinalizeService implements FinalizeUploadService {
|
||||
|
||||
private final List<UploadId> finalized = new ArrayList<>();
|
||||
private final List<UploadId> finalized = new CopyOnWriteArrayList<>();
|
||||
private final List<String> threads = new CopyOnWriteArrayList<>();
|
||||
|
||||
public List<UploadId> finalized() {
|
||||
return List.copyOf(finalized);
|
||||
}
|
||||
|
||||
/** Names of the threads each finalize ran on. */
|
||||
public List<String> threads() {
|
||||
return List.copyOf(threads);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileView finalizeUpload(
|
||||
UploadSession session, FinalizeUploadRequest request, RequestContext context) {
|
||||
@@ -34,6 +40,7 @@ public final class RecordingFinalizeService implements FinalizeUploadService {
|
||||
public FileView finalizeUpload(
|
||||
UploadId uploadId, FinalizeUploadRequest request, RequestContext context) {
|
||||
finalized.add(uploadId);
|
||||
threads.add(Thread.currentThread().getName());
|
||||
return FileView.of(
|
||||
new FileDescriptor(
|
||||
FileId.of(UUID.randomUUID()),
|
||||
|
||||
+13
@@ -145,6 +145,19 @@ class TusProtocolContractTest {
|
||||
created.andExpect(status().isBadRequest());
|
||||
}
|
||||
|
||||
/** Finalize rereads and moves the whole object; that is transfer work, not servlet work. */
|
||||
@Test
|
||||
void theCompletingPatchFinalizesOnTheTransferExecutor() throws Exception {
|
||||
// given
|
||||
String location = create(3);
|
||||
|
||||
// when
|
||||
appendAt(location, 0, "abc");
|
||||
|
||||
// then
|
||||
assertThat(finalizeService.threads()).singleElement().asString().startsWith("fs-transfer-");
|
||||
}
|
||||
|
||||
@Test
|
||||
void chunksCarryingTheirOwnCorrectChecksumAreAllAccepted() throws Exception {
|
||||
// given
|
||||
|
||||
+3
-6
@@ -48,9 +48,6 @@ public class NotificationSubmissionController {
|
||||
/** What a caller gets when it names no version; the first published version of a template. */
|
||||
private static final long DEFAULT_TEMPLATE_VERSION = 1L;
|
||||
|
||||
/** What a caller gets when it names no category. */
|
||||
private static final String DEFAULT_CATEGORY = "transactional";
|
||||
|
||||
private final AcceptNotificationUseCase accept;
|
||||
|
||||
/**
|
||||
@@ -85,9 +82,9 @@ public class NotificationSubmissionController {
|
||||
locale(request.locale()),
|
||||
NotificationVariableCoercion.coerceAll(request.variables()),
|
||||
Optional.ofNullable(request.idempotencyKey()).filter(key -> !key.isBlank()),
|
||||
request.category() == null || request.category().isBlank()
|
||||
? DEFAULT_CATEGORY
|
||||
: request.category());
|
||||
// Passed as sent. Category decides marketing suppression, so the application refuses a
|
||||
// missing one (400) rather than this transport choosing "transactional" for the caller.
|
||||
request.category());
|
||||
|
||||
return ResponseEntity.status(HttpStatus.ACCEPTED)
|
||||
.body(
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@ import java.util.Map;
|
||||
* @param locale the BCP 47 language tag to render in; the platform default when omitted
|
||||
* @param variables template variables, as JSON scalars, lists and objects
|
||||
* @param idempotencyKey the caller's key; derived from the request when omitted
|
||||
* @param category the routing and reporting category; {@code transactional} when omitted
|
||||
* @param category the routing and reporting category; required — the application refuses a
|
||||
* submission without one (400) instead of guessing, since it decides marketing suppression
|
||||
*/
|
||||
public record SubmitNotificationHttpRequest(
|
||||
@NotBlank @Size(max = 200) String recipientRef,
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package dev.caskeleton.adapter.inbound.web.notification.platform.submission;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.error.GlobalExceptionHandler;
|
||||
import dev.caskeleton.application.notification.platform.port.in.AcceptNotificationCommand;
|
||||
import dev.caskeleton.shared.tracing.SpanErrorRecorder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
|
||||
class NotificationSubmissionControllerTest {
|
||||
|
||||
private final List<AcceptNotificationCommand> accepted = new ArrayList<>();
|
||||
|
||||
private final MockMvc mvc =
|
||||
MockMvcBuilders.standaloneSetup(
|
||||
new NotificationSubmissionController(
|
||||
command -> {
|
||||
accepted.add(command);
|
||||
throw new IllegalStateException("the probe stops after recording");
|
||||
}))
|
||||
.setControllerAdvice(new GlobalExceptionHandler(SpanErrorRecorder.NOOP))
|
||||
.build();
|
||||
|
||||
@Test
|
||||
void submissionWithoutCategoryIsRejectedBeforeTheUseCaseRuns() throws Exception {
|
||||
// given
|
||||
String withoutCategory =
|
||||
"{\"recipientRef\":\"r-1\",\"channel\":\"EMAIL\",\"address\":\"a@example.com\","
|
||||
+ "\"template\":\"welcome\"}";
|
||||
|
||||
// when
|
||||
int status =
|
||||
mvc.perform(
|
||||
post("/notifications")
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.content(withoutCategory))
|
||||
.andReturn()
|
||||
.getResponse()
|
||||
.getStatus();
|
||||
|
||||
// then
|
||||
assertThat(List.of(status, accepted.size())).containsExactly(400, 0);
|
||||
}
|
||||
}
|
||||
@@ -242,10 +242,16 @@ commit-aware response wrapper 계약을 구현한다. 또한 이 모듈은 HTML
|
||||
- 단일 소유권: Spring Security 기본 `Cache-Control` 은 `SecurityConfig` 에서 비활성화 → 실행 앱에서 이 필터가
|
||||
헤더 단일 소유자. 독립 MockMvc(보안 체인 없음)에서도 이 필터가 유일 writer.
|
||||
|
||||
### RequestLoggingFilter
|
||||
### WebMvcRequestIdFilter / RequestLoggingFilter
|
||||
- **id 는 한 곳에서 만든다.** request/correlation/trace/span id 발급, MDC 기록, 응답 헤더(`X-Request-Id`,
|
||||
`X-Correlation-Id`, `traceparent`)는 `WebMvcRequestIdFilter`(HIGHEST+10, Spring Security 앞)가 한다. 그래서
|
||||
보안 체인이 쓰는 401/403 Envelope 의 `meta` 도 id 를 가진다. `RequestLoggingFilter` 는 id 를 만들지 않고
|
||||
접근 로그 한 줄과 `user_principal` 만 담당한다(principal 을 읽으려고 보안 체인 안쪽에서 돈다). 보안 체인이
|
||||
거절한 요청의 로그는 entry point / access-denied handler 가 남긴다. 아래 traceparent 규칙은
|
||||
`WebMvcRequestIdFilter` 의 것이다.
|
||||
- **MDC 키 정책(D11/D19).** `MdcKeys` 의 snake_case 키 사용.
|
||||
- **인바운드 id 헤더(D14/D15).** `X-Request-Id` / `X-Correlation-Id` 는 사용 전 sanitize(CR/LF + control 제거)
|
||||
및 길이 제한. 부재/공백은 서버 생성.
|
||||
- **인바운드 id 헤더(D14/D15).** `X-Request-Id` 는 기본적으로 받지 않고 서버가 만든다(신뢰 설정 시 안전 문자만).
|
||||
`X-Correlation-Id` 는 사용 전 sanitize(CR/LF + control 제거) 및 길이 제한. 부재/공백은 서버 생성.
|
||||
- **W3C `traceparent`(D5/D7/D4).** 유효한 인바운드 traceparent 가 있으면 채택해 그 `traceId`→MDC `trace_id`,
|
||||
`spanId`→`span_id`. 부재/공백/무효면 fresh ROOT traceparent 생성(32-hex traceId, 16-hex spanId,
|
||||
sampled=false)하여 MDC `trace_id` 가 **항상** 의미 있는 W3C id 이고 절대 null 이 아니게 한다(D4: 추적 비활성
|
||||
@@ -373,7 +379,7 @@ commit-aware response wrapper 계약을 구현한다. 또한 이 모듈은 HTML
|
||||
변환 단일 지점은 `ResponseMetaFactory`.
|
||||
|
||||
### MdcCorrelationIdPortAdapter
|
||||
- `RequestLoggingFilter`가 무해화하고 MDC `correlation_id`에 넣은 값을 application-core의
|
||||
- `WebMvcRequestIdFilter`가 무해화하고 MDC `correlation_id`에 넣은 값을 application-core의
|
||||
`CorrelationIdPort`로 투영한다.
|
||||
- absent/blank는 `Optional.empty()`로 반환한다. application/sample 계층은 SLF4J/MDC를 직접
|
||||
참조하지 않고 event-id fallback 정책만 소유한다.
|
||||
|
||||
@@ -36,6 +36,9 @@ dependencies {
|
||||
// owned by feature-contract-verification-test-suite (planned).
|
||||
implementation libs.springdoc.openapi.starter.webmvc.api
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
// The operation controller's contract test drives the real use cases over the port owners'
|
||||
// fakes (operation store, outbox, transaction port).
|
||||
testImplementation testFixtures(project(':application-core'))
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
|
||||
+8
-2
@@ -7,6 +7,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.validation.ObjectError;
|
||||
|
||||
/**
|
||||
* Builds bounded validation details without reflecting rejected values or interpolated messages.
|
||||
@@ -49,8 +50,13 @@ final class ClientSafeValidationDetails {
|
||||
return detail(normalize(violation.getPropertyPath()), rule);
|
||||
}
|
||||
|
||||
static Map<String, Object> from(FieldError fieldError) {
|
||||
return detail(normalize(fieldError.getField()), ruleFor(fieldError.getCode()));
|
||||
/**
|
||||
* A field error names its field; a class-level (global) error is reported against the request.
|
||||
*/
|
||||
static Map<String, Object> from(ObjectError error) {
|
||||
String field =
|
||||
error instanceof FieldError fieldError ? normalize(fieldError.getField()) : "request";
|
||||
return detail(field, ruleFor(error.getCode()));
|
||||
}
|
||||
|
||||
private static Map<String, Object> detail(String field, Rule rule) {
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
|
||||
HttpStatusCode status,
|
||||
WebRequest request) {
|
||||
List<Map<String, Object>> fields =
|
||||
ex.getBindingResult().getFieldErrors().stream()
|
||||
ex.getBindingResult().getAllErrors().stream()
|
||||
.map(ClientSafeValidationDetails::from)
|
||||
.toList();
|
||||
return new ResponseEntity<>(
|
||||
|
||||
+8
-74
@@ -1,17 +1,13 @@
|
||||
package dev.caskeleton.adapter.inbound.web.filter;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.auth.AuthenticatedPrincipal;
|
||||
import dev.caskeleton.adapter.inbound.web.core.WebRequestId;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.HeaderSanitizer;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.MdcKeys;
|
||||
import dev.caskeleton.application.observability.UserPrincipalPseudonymizerPort;
|
||||
import dev.caskeleton.shared.tracing.TraceParent;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MDC;
|
||||
@@ -22,28 +18,21 @@ import org.springframework.web.filter.OncePerRequestFilter;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
/**
|
||||
* Logs one structured line per HTTP request and threads the correlation ids onto MDC using the
|
||||
* snake_case keys of {@link MdcKeys}. The request id is assigned by the transport's request-id
|
||||
* filter and stored as a {@link WebRequestId}; this filter never makes a second trust decision from
|
||||
* {@code X-Request-Id}. Inbound {@code X-Correlation-Id} is sanitized and length-capped before use;
|
||||
* absent/blank values are server-generated. A valid inbound W3C {@code traceparent} is adopted onto
|
||||
* MDC ({@code trace_id} / {@code span_id}), otherwise a fresh ROOT traceparent is generated; the
|
||||
* resolved value is set on the response header. {@code user_principal} is pseudonymized via {@link
|
||||
* UserPrincipalPseudonymizerPort} before being placed on MDC.
|
||||
* Logs one structured line per HTTP request. The correlation ids on MDC ({@code request_id}, {@code
|
||||
* correlation_id}, {@code trace_id}, {@code span_id}) are the ones the request-id filter assigned
|
||||
* before Spring Security ran; this filter neither makes nor replaces any of them. {@code
|
||||
* user_principal} is pseudonymized via {@link UserPrincipalPseudonymizerPort} before being placed
|
||||
* on MDC.
|
||||
*
|
||||
* <p>See README for the design rationale, including the fork landmine around the generated {@code
|
||||
* trace_id} when a real tracer is later wired in.
|
||||
* <p>It runs inside the security chain on purpose: the authenticated principal is readable only
|
||||
* there. A request the chain rejects is logged by the entry point / access-denied handler instead.
|
||||
* See README for the design rationale.
|
||||
*/
|
||||
@Component
|
||||
public class RequestLoggingFilter extends OncePerRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RequestLoggingFilter.class);
|
||||
|
||||
private static final String HEADER_REQUEST_ID = "X-Request-Id";
|
||||
private static final String HEADER_CORRELATION_ID = "X-Correlation-Id";
|
||||
private static final String HEADER_TRACEPARENT = "traceparent";
|
||||
private static final int MAX_ID_LENGTH = 200;
|
||||
|
||||
private final UserPrincipalPseudonymizerPort pseudonymizer;
|
||||
|
||||
public RequestLoggingFilter(UserPrincipalPseudonymizerPort pseudonymizer) {
|
||||
@@ -54,23 +43,6 @@ public class RequestLoggingFilter extends OncePerRequestFilter {
|
||||
protected void doFilterInternal(
|
||||
HttpServletRequest req, HttpServletResponse res, FilterChain chain)
|
||||
throws ServletException, IOException {
|
||||
|
||||
Object assignedRequestId = req.getAttribute(WebRequestId.REQUEST_ATTRIBUTE);
|
||||
String requestId =
|
||||
assignedRequestId instanceof WebRequestId id ? id.value() : UUID.randomUUID().toString();
|
||||
String correlationId = resolveOrGenerate(req.getHeader(HEADER_CORRELATION_ID));
|
||||
res.setHeader(HEADER_REQUEST_ID, requestId);
|
||||
res.setHeader(HEADER_CORRELATION_ID, correlationId);
|
||||
|
||||
MDC.put(MdcKeys.REQUEST_ID, requestId);
|
||||
MDC.put(MdcKeys.CORRELATION_ID, correlationId);
|
||||
|
||||
// W3C traceparent: adopt inbound if valid, otherwise generate a fresh ROOT.
|
||||
TraceParent traceParent = resolveOrGenerateTraceParent(req.getHeader(HEADER_TRACEPARENT));
|
||||
MDC.put(MdcKeys.TRACE_ID, traceParent.traceId());
|
||||
MDC.put(MdcKeys.SPAN_ID, traceParent.spanId());
|
||||
res.setHeader(HEADER_TRACEPARENT, traceParent.toHeader());
|
||||
|
||||
long start = System.nanoTime();
|
||||
try {
|
||||
chain.doFilter(req, res);
|
||||
@@ -83,48 +55,10 @@ public class RequestLoggingFilter extends OncePerRequestFilter {
|
||||
resolveUriTemplate(req),
|
||||
res.getStatus(),
|
||||
durationMs);
|
||||
MDC.remove(MdcKeys.REQUEST_ID);
|
||||
MDC.remove(MdcKeys.CORRELATION_ID);
|
||||
MDC.remove(MdcKeys.TRACE_ID);
|
||||
MDC.remove(MdcKeys.SPAN_ID);
|
||||
MDC.remove(MdcKeys.USER_PRINCIPAL);
|
||||
}
|
||||
}
|
||||
|
||||
/** Sanitize an inbound id header; generate a fresh one when absent/blank. */
|
||||
private static String resolveOrGenerate(String inbound) {
|
||||
String clean = HeaderSanitizer.sanitize(inbound, MAX_ID_LENGTH);
|
||||
return (clean == null || clean.isBlank()) ? UUID.randomUUID().toString() : clean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves a W3C {@code traceparent} for this request: adopts a present, valid inbound header
|
||||
* unchanged, otherwise generates a fresh ROOT traceparent (32-hex {@code traceId}, 16-hex {@code
|
||||
* spanId}, {@code sampled=false}).
|
||||
*/
|
||||
private static TraceParent resolveOrGenerateTraceParent(String header) {
|
||||
return TraceParent.parse(header)
|
||||
.orElseGet(
|
||||
() -> {
|
||||
String traceId = freshHex32();
|
||||
String spanId = freshHex16();
|
||||
return TraceParent.of(traceId, spanId, false);
|
||||
});
|
||||
}
|
||||
|
||||
/** Returns a 32-char lowercase hex string from a random UUID (dashes stripped). */
|
||||
private static String freshHex32() {
|
||||
return UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a 16-char lowercase hex span id (64 random bits), derived from a fresh UUID's
|
||||
* least-significant bits and zero-padded. See README for the design rationale.
|
||||
*/
|
||||
private static String freshHex16() {
|
||||
return String.format("%016x", UUID.randomUUID().getLeastSignificantBits());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the low-cardinality matched route template ({@code BEST_MATCHING_PATTERN_ATTRIBUTE}),
|
||||
* falling back to the raw request URI for unmatched requests (e.g. 404s).
|
||||
|
||||
+63
-21
@@ -2,14 +2,19 @@ package dev.caskeleton.adapter.inbound.web.mvc.filter;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.core.WebRequestId;
|
||||
import dev.caskeleton.adapter.inbound.web.core.WebTraceId;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.HeaderSanitizer;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.MdcKeys;
|
||||
import dev.caskeleton.shared.tracing.TraceParent;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
@@ -27,6 +32,11 @@ import org.springframework.web.filter.OncePerRequestFilter;
|
||||
*
|
||||
* <p>The trace id is different: propagating an inbound {@code traceparent} is the entire point of
|
||||
* distributed tracing, so it is honoured when it parses, and replaced when it does not.
|
||||
*
|
||||
* <p>This is the one place the identifiers are made. It puts them on MDC and on the response before
|
||||
* anything else runs — Spring Security included, so a {@code 401}/{@code 403} written inside the
|
||||
* security chain carries the same {@code meta} ids as any other response — and the access log
|
||||
* ({@code RequestLoggingFilter}) only reads them.
|
||||
*/
|
||||
public final class WebMvcRequestIdFilter extends OncePerRequestFilter implements Ordered {
|
||||
|
||||
@@ -39,15 +49,19 @@ public final class WebMvcRequestIdFilter extends OncePerRequestFilter implements
|
||||
/** The header a client may propose a request id in. */
|
||||
public static final String REQUEST_ID_HEADER = "X-Request-Id";
|
||||
|
||||
/** The header a caller correlates its own requests by; sanitized, never trusted as an id. */
|
||||
public static final String CORRELATION_ID_HEADER = "X-Correlation-Id";
|
||||
|
||||
/** The W3C trace context header. */
|
||||
public static final String TRACEPARENT_HEADER = "traceparent";
|
||||
|
||||
/** The MDC entries of a request, kept so an ERROR or ASYNC redispatch restores the same ones. */
|
||||
private static final String MDC_ATTRIBUTE = WebMvcRequestIdFilter.class.getName() + ".mdc";
|
||||
|
||||
/** Printable, bounded, no separators a log parser would act on. */
|
||||
private static final Pattern SAFE_IDENTIFIER = Pattern.compile("[A-Za-z0-9._-]{1,128}");
|
||||
|
||||
/** {@code version-traceid-spanid-flags}; only the trace id is taken. */
|
||||
private static final Pattern TRACEPARENT =
|
||||
Pattern.compile("[0-9a-f]{2}-([0-9a-f]{32})-[0-9a-f]{16}-[0-9a-f]{2}");
|
||||
private static final int MAX_CORRELATION_ID_LENGTH = 200;
|
||||
|
||||
private final boolean trustInboundRequestId;
|
||||
private final int order;
|
||||
@@ -73,16 +87,38 @@ public final class WebMvcRequestIdFilter extends OncePerRequestFilter implements
|
||||
protected void doFilterInternal(
|
||||
HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
if (request.getAttribute(REQUEST_ID_ATTRIBUTE) == null) {
|
||||
WebRequestId requestId = resolveRequestId(request);
|
||||
WebTraceId traceId = resolveTraceId(request);
|
||||
request.setAttribute(REQUEST_ID_ATTRIBUTE, requestId);
|
||||
request.setAttribute(TRACE_ID_ATTRIBUTE, traceId);
|
||||
// Echoed so a client can quote it in a support ticket. Safe to publish: it names a log entry
|
||||
// rather than a person, and it is this platform's value, not the caller's.
|
||||
response.setHeader(REQUEST_ID_HEADER, requestId.value());
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> mdc = (Map<String, String>) request.getAttribute(MDC_ATTRIBUTE);
|
||||
if (mdc == null) {
|
||||
mdc = assign(request, response);
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
mdc.forEach(MDC::put);
|
||||
try {
|
||||
chain.doFilter(request, response);
|
||||
} finally {
|
||||
mdc.keySet().forEach(MDC::remove);
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, String> assign(HttpServletRequest request, HttpServletResponse response) {
|
||||
WebRequestId requestId = resolveRequestId(request);
|
||||
TraceParent trace = resolveTrace(request);
|
||||
String correlationId = resolveCorrelationId(request);
|
||||
request.setAttribute(REQUEST_ID_ATTRIBUTE, requestId);
|
||||
request.setAttribute(TRACE_ID_ATTRIBUTE, new WebTraceId(trace.traceId()));
|
||||
// Echoed so a client can quote them in a support ticket. Safe to publish: they name a log
|
||||
// entry rather than a person, and they are this platform's values, not the caller's.
|
||||
response.setHeader(REQUEST_ID_HEADER, requestId.value());
|
||||
response.setHeader(CORRELATION_ID_HEADER, correlationId);
|
||||
response.setHeader(TRACEPARENT_HEADER, trace.toHeader());
|
||||
Map<String, String> mdc =
|
||||
Map.of(
|
||||
MdcKeys.REQUEST_ID, requestId.value(),
|
||||
MdcKeys.CORRELATION_ID, correlationId,
|
||||
MdcKeys.TRACE_ID, trace.traceId(),
|
||||
MdcKeys.SPAN_ID, trace.spanId());
|
||||
request.setAttribute(MDC_ATTRIBUTE, mdc);
|
||||
return mdc;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,17 +145,23 @@ public final class WebMvcRequestIdFilter extends OncePerRequestFilter implements
|
||||
.orElseGet(() -> new WebRequestId(UUID.randomUUID().toString()));
|
||||
}
|
||||
|
||||
private WebTraceId resolveTraceId(HttpServletRequest request) {
|
||||
String traceparent = request.getHeader(TRACEPARENT_HEADER);
|
||||
if (traceparent != null) {
|
||||
var matcher = TRACEPARENT.matcher(traceparent.trim());
|
||||
if (matcher.matches()) {
|
||||
return new WebTraceId(matcher.group(1));
|
||||
}
|
||||
}
|
||||
private static TraceParent resolveTrace(HttpServletRequest request) {
|
||||
// A malformed traceparent is replaced rather than rejected: refusing the request would let an
|
||||
// upstream misconfiguration take an API down, and the platform still needs a correlation id.
|
||||
return new WebTraceId(UUID.randomUUID().toString().replace("-", ""));
|
||||
return TraceParent.parse(request.getHeader(TRACEPARENT_HEADER))
|
||||
.orElseGet(
|
||||
() ->
|
||||
TraceParent.of(
|
||||
UUID.randomUUID().toString().replace("-", ""),
|
||||
String.format("%016x", UUID.randomUUID().getLeastSignificantBits()),
|
||||
false));
|
||||
}
|
||||
|
||||
private static String resolveCorrelationId(HttpServletRequest request) {
|
||||
String clean =
|
||||
HeaderSanitizer.sanitize(
|
||||
request.getHeader(CORRELATION_ID_HEADER), MAX_CORRELATION_ID_LENGTH);
|
||||
return clean == null || clean.isBlank() ? UUID.randomUUID().toString() : clean;
|
||||
}
|
||||
|
||||
private static Optional<String> sanitized(String candidate) {
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.auth.AuthenticatedPrincipal;
|
||||
import dev.caskeleton.adapter.inbound.web.error.ErrorResponseFactory;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.ResponseMetaFactory;
|
||||
import dev.caskeleton.application.idempotency.RequestFingerprint;
|
||||
import dev.caskeleton.application.operation.CancelDurableOperationCommand;
|
||||
import dev.caskeleton.application.operation.CancelDurableOperationUseCase;
|
||||
import dev.caskeleton.application.operation.DurableOperationId;
|
||||
import dev.caskeleton.application.operation.GetDurableOperationQuery;
|
||||
import dev.caskeleton.application.operation.GetDurableOperationUseCase;
|
||||
import dev.caskeleton.application.operation.OperationAcceptance;
|
||||
import dev.caskeleton.application.operation.OperationCommand;
|
||||
import dev.caskeleton.application.operation.SubmitDurableOperationUseCase;
|
||||
import dev.caskeleton.shared.response.Envelope;
|
||||
import jakarta.validation.Valid;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||
|
||||
/**
|
||||
* Durable operations over HTTP: submit, poll, cancel.
|
||||
*
|
||||
* <p>A transport only. Who may submit or cancel is the use cases' {@code @RequiresPermission}; who
|
||||
* may see an operation is their owner and tenant check, which answers "absent" for someone else's
|
||||
* operation exactly as for one that does not exist — so both are the same 404 here. Registered by
|
||||
* the composition that assembles those use cases, which exists only when a store is selected.
|
||||
*
|
||||
* <p>No tenant is passed: nothing on this transport resolves one yet, and an operation submitted
|
||||
* without a tenant is visible only to calls made without one.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/operations")
|
||||
public class DurableOperationController {
|
||||
|
||||
private final SubmitDurableOperationUseCase submit;
|
||||
private final GetDurableOperationUseCase get;
|
||||
private final CancelDurableOperationUseCase cancel;
|
||||
|
||||
/**
|
||||
* A controller over the three operation use cases.
|
||||
*
|
||||
* @param submit accepts work
|
||||
* @param get reads one operation
|
||||
* @param cancel requests cancellation
|
||||
*/
|
||||
public DurableOperationController(
|
||||
SubmitDurableOperationUseCase submit,
|
||||
GetDurableOperationUseCase get,
|
||||
CancelDurableOperationUseCase cancel) {
|
||||
this.submit = Objects.requireNonNull(submit, "submit");
|
||||
this.get = Objects.requireNonNull(get, "get");
|
||||
this.cancel = Objects.requireNonNull(cancel, "cancel");
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts an operation.
|
||||
*
|
||||
* <p>{@code 202} with the operation's {@code Location}. The id is minted here; a resubmission of
|
||||
* the same work by the same caller is recognised by its payload fingerprint and answered with the
|
||||
* operation that already exists, {@code alreadyAccepted} true and the same {@code Location}.
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<Envelope<OperationAcceptedHttpResponse>> submit(
|
||||
@Valid @RequestBody SubmitOperationHttpRequest request,
|
||||
@AuthenticationPrincipal AuthenticatedPrincipal principal) {
|
||||
String payload = request.payload().toString();
|
||||
OperationAcceptance acceptance =
|
||||
submit.submit(
|
||||
new OperationCommand(
|
||||
new DurableOperationId(UUID.randomUUID().toString()),
|
||||
request.operationName(),
|
||||
principalId(principal),
|
||||
null,
|
||||
RequestFingerprint.ofSha256(payload.getBytes(StandardCharsets.UTF_8)),
|
||||
payload,
|
||||
OperationCommand.SUBMITTED_EVENT_TYPE,
|
||||
OperationCommand.DEFAULT_TIME_TO_LIVE));
|
||||
URI location =
|
||||
ServletUriComponentsBuilder.fromCurrentRequestUri()
|
||||
.path("/{operationId}")
|
||||
.buildAndExpand(acceptance.operationId().value())
|
||||
.toUri();
|
||||
return ResponseEntity.accepted()
|
||||
.location(location)
|
||||
.body(
|
||||
Envelope.ok(
|
||||
OperationAcceptedHttpResponse.from(acceptance), ResponseMetaFactory.fromMdc()));
|
||||
}
|
||||
|
||||
/** Reads one operation; {@code 404} when it does not exist or is not the caller's. */
|
||||
@GetMapping("/{operationId}")
|
||||
public ResponseEntity<Envelope<?>> get(
|
||||
@PathVariable String operationId, @AuthenticationPrincipal AuthenticatedPrincipal principal) {
|
||||
return get.handle(
|
||||
new GetDurableOperationQuery(
|
||||
new DurableOperationId(operationId), principalId(principal), null))
|
||||
.<ResponseEntity<Envelope<?>>>map(
|
||||
operation ->
|
||||
ResponseEntity.ok(
|
||||
Envelope.ok(
|
||||
OperationHttpResponse.from(operation), ResponseMetaFactory.fromMdc())))
|
||||
.orElseGet(DurableOperationController::notFound);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests cancellation; {@code 404} when the operation does not exist or is not the caller's.
|
||||
*
|
||||
* <p>{@code 202}, not {@code 204}: a worker mid-flight may still finish. {@code canceled} says
|
||||
* whether this call moved it to CANCELED; a repeat, or a cancel of finished work, is {@code
|
||||
* false} rather than an error.
|
||||
*/
|
||||
@DeleteMapping("/{operationId}")
|
||||
public ResponseEntity<Envelope<?>> cancel(
|
||||
@PathVariable String operationId, @AuthenticationPrincipal AuthenticatedPrincipal principal) {
|
||||
DurableOperationId id = new DurableOperationId(operationId);
|
||||
return cancel
|
||||
.handle(new CancelDurableOperationCommand(id, principalId(principal), null))
|
||||
.<ResponseEntity<Envelope<?>>>map(
|
||||
canceled ->
|
||||
ResponseEntity.accepted()
|
||||
.location(ServletUriComponentsBuilder.fromCurrentRequestUri().build().toUri())
|
||||
.body(
|
||||
Envelope.ok(
|
||||
new OperationCanceledHttpResponse(id.value(), canceled),
|
||||
ResponseMetaFactory.fromMdc())))
|
||||
.orElseGet(DurableOperationController::notFound);
|
||||
}
|
||||
|
||||
// Unreachable through the shipped security chain, which authenticates every non-public path;
|
||||
// a request that reaches here without our principal is refused rather than treated as anonymous.
|
||||
private static String principalId(AuthenticatedPrincipal principal) {
|
||||
if (principal == null || principal.idpUserId() == null || principal.idpUserId().isBlank()) {
|
||||
throw new AuthenticationCredentialsNotFoundException("no authenticated principal");
|
||||
}
|
||||
return principal.idpUserId();
|
||||
}
|
||||
|
||||
private static ResponseEntity<Envelope<?>> notFound() {
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND)
|
||||
.body(
|
||||
ErrorResponseFactory.body(
|
||||
OperationErrorCode.OPERATION_NOT_FOUND, "Operation was not found", null));
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
import dev.caskeleton.application.operation.OperationAcceptance;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* The receipt for a submission.
|
||||
*
|
||||
* @param operationId the identity to poll
|
||||
* @param acceptedAt when the operation was first accepted
|
||||
* @param alreadyAccepted whether an identical earlier submission had already created it
|
||||
*/
|
||||
public record OperationAcceptedHttpResponse(
|
||||
String operationId, Instant acceptedAt, boolean alreadyAccepted) {
|
||||
|
||||
static OperationAcceptedHttpResponse from(OperationAcceptance acceptance) {
|
||||
return new OperationAcceptedHttpResponse(
|
||||
acceptance.operationId().value(), acceptance.acceptedAt(), acceptance.alreadyAccepted());
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
/**
|
||||
* The answer to a cancel request.
|
||||
*
|
||||
* @param operationId the operation asked about
|
||||
* @param canceled whether this request moved it to CANCELED
|
||||
*/
|
||||
public record OperationCanceledHttpResponse(String operationId, boolean canceled) {}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
import dev.caskeleton.shared.error.ApiErrorCode;
|
||||
import dev.caskeleton.shared.error.Category;
|
||||
|
||||
/** The operation endpoint's own error code, beside the skeleton-wide {@code OperationalError}. */
|
||||
enum OperationErrorCode implements ApiErrorCode {
|
||||
|
||||
/** The operation does not exist, or belongs to another caller; the two are not told apart. */
|
||||
OPERATION_NOT_FOUND;
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Category category() {
|
||||
return Category.NOT_FOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int httpStatus() {
|
||||
return 404;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retryable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
import dev.caskeleton.application.operation.DurableOperation;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* One operation as a poller sees it.
|
||||
*
|
||||
* <p>The lease and the submitted payload are left out: which worker holds the operation is not the
|
||||
* caller's business, and the payload is what the caller sent.
|
||||
*
|
||||
* @param operationId the identity
|
||||
* @param operationName what work this is
|
||||
* @param state where in the lifecycle it is
|
||||
* @param submittedAt when it was accepted
|
||||
* @param startedAt when a worker first picked it up, or null
|
||||
* @param completedAt when it reached a terminal state, or null
|
||||
* @param progress how far it has got, or null
|
||||
* @param resultReference where a successful result can be read, or null
|
||||
* @param failure why it failed, or null
|
||||
* @param expiresAt when this record stops being available
|
||||
*/
|
||||
public record OperationHttpResponse(
|
||||
String operationId,
|
||||
String operationName,
|
||||
String state,
|
||||
Instant submittedAt,
|
||||
Instant startedAt,
|
||||
Instant completedAt,
|
||||
Progress progress,
|
||||
String resultReference,
|
||||
Failure failure,
|
||||
Instant expiresAt) {
|
||||
|
||||
/**
|
||||
* Progress of a running operation.
|
||||
*
|
||||
* @param completedUnits work finished so far
|
||||
* @param totalUnits work expected in total, or null when unknown
|
||||
* @param phase the current stage, or null
|
||||
*/
|
||||
public record Progress(long completedUnits, Long totalUnits, String phase) {}
|
||||
|
||||
/**
|
||||
* Why an operation failed.
|
||||
*
|
||||
* @param code the stable failure code
|
||||
* @param detail a message safe to publish
|
||||
* @param retryable whether resubmitting the same work could succeed
|
||||
*/
|
||||
public record Failure(String code, String detail, boolean retryable) {}
|
||||
|
||||
static OperationHttpResponse from(DurableOperation operation) {
|
||||
return new OperationHttpResponse(
|
||||
operation.operationId().value(),
|
||||
operation.operationName(),
|
||||
operation.state().name(),
|
||||
operation.submittedAt(),
|
||||
operation.startedAt().orElse(null),
|
||||
operation.completedAt().orElse(null),
|
||||
operation
|
||||
.progress()
|
||||
.map(
|
||||
progress ->
|
||||
new Progress(
|
||||
progress.completedUnits(),
|
||||
progress.totalUnits().orElse(null),
|
||||
progress.phase().orElse(null)))
|
||||
.orElse(null),
|
||||
operation.resultReference().orElse(null),
|
||||
operation
|
||||
.failure()
|
||||
.map(failure -> new Failure(failure.code(), failure.detail(), failure.retryable()))
|
||||
.orElse(null),
|
||||
operation.expiresAt());
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import tools.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* A request to run work asynchronously.
|
||||
*
|
||||
* @param operationName what work this is, as the worker that runs it names it
|
||||
* @param payload the request the worker will execute, any JSON value
|
||||
*/
|
||||
public record SubmitOperationHttpRequest(
|
||||
@NotBlank @Size(max = 256) @Pattern(regexp = "[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*")
|
||||
String operationName,
|
||||
@NotNull JsonNode payload) {}
|
||||
+28
@@ -6,6 +6,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import dev.caskeleton.adapter.inbound.web.mvc.filter.WebMvcRequestIdFilter;
|
||||
import dev.caskeleton.adapter.inbound.web.settings.CorsSettings;
|
||||
import dev.caskeleton.adapter.inbound.web.settings.SecuritySettings;
|
||||
import jakarta.servlet.Filter;
|
||||
@@ -169,6 +171,32 @@ class SecurityModeWebContractTest {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void anUnauthenticatedRejectionCarriesTheAssignedRequestIdInItsMeta() {
|
||||
runner
|
||||
.withPropertyValues(
|
||||
"ca-skeleton.security.auth-mode=jwt",
|
||||
"ca-skeleton.security.issuer-uri=https://issuer.example",
|
||||
"ca-skeleton.cors.enabled=false")
|
||||
.run(
|
||||
context -> {
|
||||
// given: the request-id filter sits in front of Spring Security, as registered
|
||||
MockMvc mvc =
|
||||
MockMvcBuilders.standaloneSetup(new ProbeController())
|
||||
.addFilters(
|
||||
new WebMvcRequestIdFilter(),
|
||||
context.getBean("springSecurityFilterChain", Filter.class))
|
||||
.build();
|
||||
|
||||
// when
|
||||
var response = mvc.perform(get("/whoami")).andReturn().getResponse();
|
||||
|
||||
// then
|
||||
assertThat(JsonPath.<String>read(response.getContentAsString(), "$.meta.requestId"))
|
||||
.isEqualTo(response.getHeader(WebMvcRequestIdFilter.REQUEST_ID_HEADER));
|
||||
});
|
||||
}
|
||||
|
||||
private static MockMvc mvc(Filter springSecurityFilterChain) {
|
||||
return MockMvcBuilders.standaloneSetup(new ProbeController())
|
||||
.addFilters(springSecurityFilterChain)
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.error.GlobalExceptionHandler;
|
||||
import dev.caskeleton.adapter.inbound.web.filter.RequestLoggingFilter;
|
||||
import dev.caskeleton.adapter.inbound.web.mvc.filter.WebMvcRequestIdFilter;
|
||||
import dev.caskeleton.shared.tracing.SpanErrorRecorder;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* End-to-end pin of the foundation envelope contract across the adapter-web chain: {@link
|
||||
* RequestLoggingFilter} sets the SNAKE_CASE MDC ids, {@link EnvelopeBodyAdvice} (success) and
|
||||
* WebMvcRequestIdFilter} sets the SNAKE_CASE MDC ids, {@link EnvelopeBodyAdvice} (success) and
|
||||
* {@link GlobalExceptionHandler} (5xx) project them onto a camelCase {@code meta} object.
|
||||
* Standalone MockMvc — no Spring context, so it neither needs the production {@code
|
||||
* application.yml} placeholders nor a security filter chain.
|
||||
@@ -30,7 +30,7 @@ class EnvelopeMetaIntegrationTest {
|
||||
void setUp() {
|
||||
mvc =
|
||||
MockMvcBuilders.standaloneSetup(new Probe())
|
||||
.addFilter(new RequestLoggingFilter(rawPrincipal -> rawPrincipal))
|
||||
.addFilter(new WebMvcRequestIdFilter())
|
||||
.setControllerAdvice(
|
||||
new EnvelopeBodyAdvice(), new GlobalExceptionHandler(SpanErrorRecorder.NOOP))
|
||||
.build();
|
||||
|
||||
+29
@@ -42,6 +42,7 @@ import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.oauth2.server.resource.InvalidBearerTokenException;
|
||||
import org.springframework.validation.BeanPropertyBindingResult;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.validation.ObjectError;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.context.request.ServletWebRequest;
|
||||
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
|
||||
@@ -198,6 +199,34 @@ class GlobalExceptionHandlerTest {
|
||||
.doesNotContain(secret, "rejectedValue", "rejected interpolated value", "[7]");
|
||||
}
|
||||
|
||||
@Test
|
||||
void classLevelConstraintViolationIsReportedAgainstTheRequest() {
|
||||
// given
|
||||
BeanPropertyBindingResult bindingResult =
|
||||
new BeanPropertyBindingResult(new Object(), "request");
|
||||
bindingResult.addError(
|
||||
new ObjectError(
|
||||
"request",
|
||||
new String[] {"ValidPeriod.request", "ValidPeriod"},
|
||||
null,
|
||||
"end must not precede start"));
|
||||
MethodArgumentNotValidException exception =
|
||||
new MethodArgumentNotValidException(validationProbeParameter(), bindingResult);
|
||||
|
||||
// when
|
||||
ResponseEntity<Object> response =
|
||||
handler.handleMethodArgumentNotValid(
|
||||
exception,
|
||||
new HttpHeaders(),
|
||||
HttpStatus.BAD_REQUEST,
|
||||
new ServletWebRequest(new MockHttpServletRequest()));
|
||||
|
||||
// then
|
||||
assertThat(((Envelope<?>) response.getBody()).error().details())
|
||||
.isEqualTo(
|
||||
List.of(Map.of("field", "request", "code", "INVALID", "message", "Invalid value")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void unreadableBodyCausedByTheSizeCeilingIsPayloadTooLarge() {
|
||||
// given: the parser wraps the ceiling's exception when it fires inside a bean property
|
||||
|
||||
+61
-240
@@ -7,8 +7,7 @@ import ch.qos.logback.core.read.ListAppender;
|
||||
import dev.caskeleton.adapter.inbound.web.auth.AuthenticatedPrincipal;
|
||||
import dev.caskeleton.adapter.inbound.web.mvc.filter.WebMvcRequestIdFilter;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.MdcKeys;
|
||||
import dev.caskeleton.adapter.inbound.web.observability.ResponseMetaFactory;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
@@ -22,6 +21,9 @@ import org.springframework.security.authentication.TestingAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
/**
|
||||
* The access log. Identifiers are {@link WebMvcRequestIdFilter}'s; its tests own their assignment.
|
||||
*/
|
||||
class RequestLoggingFilterTest {
|
||||
|
||||
private final RequestLoggingFilter filter = new RequestLoggingFilter(raw -> "pseudo-" + raw);
|
||||
@@ -33,79 +35,43 @@ class RequestLoggingFilterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void generatesSnakeCaseRequestIdAndEchoesHeaderWhenAbsent() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/x");
|
||||
void assignsNoIdentifierOrTraceOfItsOwn() throws Exception {
|
||||
// given
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
AtomicReference<String> seen = new AtomicReference<>();
|
||||
FilterChain chain = (rq, rs) -> seen.set(MDC.get(MdcKeys.REQUEST_ID));
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
// when
|
||||
filter.doFilter(new MockHttpServletRequest("GET", "/x"), res, (rq, rs) -> {});
|
||||
|
||||
assertThat(seen.get()).as("request_id present on MDC during the chain").isNotBlank();
|
||||
assertThat(res.getHeader("X-Request-Id")).isEqualTo(seen.get());
|
||||
assertThat(MDC.get(MdcKeys.REQUEST_ID)).as("MDC cleared after request").isNull();
|
||||
// then
|
||||
assertThat(res.getHeaderNames())
|
||||
.doesNotContain("X-Request-Id", "X-Correlation-Id", "traceparent");
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsClientRequestIdByDefaultButHonoursCorrelationId() throws Exception {
|
||||
void accessLogLineCarriesTheRequestIdTheRequestIdFilterAssigned() throws Exception {
|
||||
// given
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/x");
|
||||
req.addHeader("X-Request-Id", "client-req-1");
|
||||
req.addHeader("X-Correlation-Id", "client-corr-1");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
AtomicReference<String> reqId = new AtomicReference<>();
|
||||
AtomicReference<String> corrId = new AtomicReference<>();
|
||||
FilterChain chain =
|
||||
(rq, rs) -> {
|
||||
reqId.set(MDC.get(MdcKeys.REQUEST_ID));
|
||||
corrId.set(MDC.get(MdcKeys.CORRELATION_ID));
|
||||
};
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
|
||||
assertThat(reqId.get()).isNotEqualTo("client-req-1");
|
||||
assertThat(res.getHeader("X-Request-Id")).isEqualTo(reqId.get());
|
||||
assertThat(corrId.get()).isEqualTo("client-corr-1");
|
||||
assertThat(res.getHeader("X-Correlation-Id")).isEqualTo("client-corr-1");
|
||||
}
|
||||
|
||||
@Test
|
||||
void usesTheRequestIdAlreadyAssignedByTheMvcRequestIdFilter() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/x");
|
||||
req.addHeader("X-Request-Id", "chosen-by-caller");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
AtomicReference<String> assigned = new AtomicReference<>();
|
||||
AtomicReference<String> logged = new AtomicReference<>();
|
||||
WebMvcRequestIdFilter requestIds = new WebMvcRequestIdFilter();
|
||||
ListAppender<ILoggingEvent> accessLog = attachAppender();
|
||||
|
||||
requestIds.doFilter(
|
||||
req,
|
||||
res,
|
||||
(rq, rs) -> {
|
||||
assigned.set(
|
||||
WebMvcRequestIdFilter.requestId((jakarta.servlet.http.HttpServletRequest) rq)
|
||||
.orElseThrow()
|
||||
.value());
|
||||
filter.doFilter(
|
||||
rq, rs, (innerRequest, innerResponse) -> logged.set(MDC.get(MdcKeys.REQUEST_ID)));
|
||||
});
|
||||
// when
|
||||
try {
|
||||
new WebMvcRequestIdFilter()
|
||||
.doFilter(
|
||||
req,
|
||||
new MockHttpServletResponse(),
|
||||
(rq, rs) -> {
|
||||
assigned.set(
|
||||
WebMvcRequestIdFilter.requestId((HttpServletRequest) rq).orElseThrow().value());
|
||||
filter.doFilter(rq, rs, (innerRequest, innerResponse) -> {});
|
||||
});
|
||||
} finally {
|
||||
detach(accessLog);
|
||||
}
|
||||
|
||||
assertThat(assigned.get()).isNotEqualTo("chosen-by-caller");
|
||||
assertThat(logged.get()).isEqualTo(assigned.get());
|
||||
assertThat(res.getHeader("X-Request-Id")).isEqualTo(assigned.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
void sanitizesCrlfInjectionInInboundCorrelationId() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/x");
|
||||
req.addHeader("X-Correlation-Id", "foo\r\nFAKE LOG");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
AtomicReference<String> correlationId = new AtomicReference<>();
|
||||
FilterChain chain = (rq, rs) -> correlationId.set(MDC.get(MdcKeys.CORRELATION_ID));
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
|
||||
assertThat(correlationId.get()).isEqualTo("fooFAKE LOG");
|
||||
assertThat(correlationId.get()).doesNotContain("\r").doesNotContain("\n");
|
||||
// then
|
||||
assertThat(httpRequestEvent(accessLog).getMDCPropertyMap().get(MdcKeys.REQUEST_ID))
|
||||
.isEqualTo(assigned.get());
|
||||
}
|
||||
|
||||
// DRIFT-3: logs the route template, not the raw concrete path
|
||||
@@ -114,175 +80,19 @@ class RequestLoggingFilterTest {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/v1/worklogs/123");
|
||||
req.setAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "/v1/worklogs/{id}");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
ch.qos.logback.classic.Logger logger =
|
||||
(ch.qos.logback.classic.Logger) LoggerFactory.getLogger(RequestLoggingFilter.class);
|
||||
ListAppender<ILoggingEvent> listAppender = new ListAppender<>();
|
||||
listAppender.start();
|
||||
logger.addAppender(listAppender);
|
||||
ListAppender<ILoggingEvent> listAppender = attachAppender();
|
||||
|
||||
try {
|
||||
filter.doFilter(req, res, (rq, rs) -> {});
|
||||
|
||||
List<ILoggingEvent> events = listAppender.list;
|
||||
assertThat(events).isNotEmpty();
|
||||
ILoggingEvent event =
|
||||
events.stream()
|
||||
.filter(e -> e.getFormattedMessage().contains("http_request"))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new AssertionError("No http_request log event found"));
|
||||
|
||||
String msg = event.getFormattedMessage();
|
||||
String msg = httpRequestEvent(listAppender).getFormattedMessage();
|
||||
assertThat(msg).contains("uri_template=/v1/worklogs/{id}");
|
||||
assertThat(msg).doesNotContain("uri_template=/v1/worklogs/123");
|
||||
} finally {
|
||||
logger.detachAppender(listAppender);
|
||||
detach(listAppender);
|
||||
}
|
||||
}
|
||||
|
||||
// feature-distributed-tracing-contract D5/D7/D4: W3C traceparent handling
|
||||
|
||||
/**
|
||||
* D5/D7: a valid inbound {@code traceparent} header is adopted — its traceId and spanId are
|
||||
* placed on MDC and the same traceparent value is echoed on the response. D4: {@link
|
||||
* ResponseMetaFactory#fromMdc()} returns a non-null traceId.
|
||||
*/
|
||||
@Test
|
||||
void validInboundTraceparentIsAdoptedIntoMdcAndEchoedOnResponse() throws Exception {
|
||||
String validTraceparent = "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01";
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/x");
|
||||
req.addHeader("traceparent", validTraceparent);
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
AtomicReference<String> capturedTraceId = new AtomicReference<>();
|
||||
AtomicReference<String> capturedSpanId = new AtomicReference<>();
|
||||
AtomicReference<String> capturedMetaTraceId = new AtomicReference<>();
|
||||
FilterChain chain =
|
||||
(rq, rs) -> {
|
||||
capturedTraceId.set(MDC.get(MdcKeys.TRACE_ID));
|
||||
capturedSpanId.set(MDC.get(MdcKeys.SPAN_ID));
|
||||
capturedMetaTraceId.set(ResponseMetaFactory.fromMdc().traceId());
|
||||
};
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
|
||||
assertThat(capturedTraceId.get())
|
||||
.as("MDC trace_id must be adopted from traceparent traceId")
|
||||
.isEqualTo("4bf92f3577b34da6a3ce929d0e0e4736");
|
||||
assertThat(capturedSpanId.get())
|
||||
.as("MDC span_id must be adopted from traceparent spanId")
|
||||
.isEqualTo("00f067aa0ba902b7");
|
||||
assertThat(res.getHeader("traceparent"))
|
||||
.as("response traceparent must echo the resolved value")
|
||||
.isEqualTo(validTraceparent);
|
||||
assertThat(capturedMetaTraceId.get())
|
||||
.as("D4: ResponseMetaFactory.fromMdc().traceId() must be non-null when traceparent adopted")
|
||||
.isEqualTo("4bf92f3577b34da6a3ce929d0e0e4736");
|
||||
// MDC must be cleaned up after filter
|
||||
assertThat(MDC.get(MdcKeys.TRACE_ID)).isNull();
|
||||
assertThat(MDC.get(MdcKeys.SPAN_ID)).isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* D4 / disabled-tracing fallback: when no inbound {@code traceparent} header is present, the
|
||||
* filter generates a fresh ROOT traceparent — 32-hex traceId (non-null, non-all-zeros), so {@link
|
||||
* ResponseMetaFactory#fromMdc()} keeps {@code meta.traceId} non-null even when no tracer/exporter
|
||||
* is wired.
|
||||
*/
|
||||
@Test
|
||||
void absentTraceparentGeneratesFreshW3cRootAndMetaTraceIdIsNonNull() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/y");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
AtomicReference<String> capturedTraceId = new AtomicReference<>();
|
||||
AtomicReference<String> capturedSpanId = new AtomicReference<>();
|
||||
AtomicReference<String> capturedMetaTraceId = new AtomicReference<>();
|
||||
FilterChain chain =
|
||||
(rq, rs) -> {
|
||||
capturedTraceId.set(MDC.get(MdcKeys.TRACE_ID));
|
||||
capturedSpanId.set(MDC.get(MdcKeys.SPAN_ID));
|
||||
capturedMetaTraceId.set(ResponseMetaFactory.fromMdc().traceId());
|
||||
};
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
|
||||
assertThat(capturedTraceId.get())
|
||||
.as("generated trace_id must be non-null, 32 hex chars")
|
||||
.isNotNull()
|
||||
.hasSize(32)
|
||||
.matches("[0-9a-f]{32}");
|
||||
assertThat(capturedTraceId.get())
|
||||
.as("generated trace_id must not be all zeros")
|
||||
.isNotEqualTo("00000000000000000000000000000000");
|
||||
assertThat(capturedSpanId.get())
|
||||
.as("generated span_id must be non-null, 16 hex chars")
|
||||
.isNotNull()
|
||||
.hasSize(16)
|
||||
.matches("[0-9a-f]{16}");
|
||||
assertThat(res.getHeader("traceparent"))
|
||||
.as("response traceparent header must be set")
|
||||
.isNotNull()
|
||||
.startsWith("00-");
|
||||
assertThat(capturedMetaTraceId.get())
|
||||
.as("D4: meta.traceId must be non-null even with no tracer (disabled-tracing fallback)")
|
||||
.isNotNull()
|
||||
.hasSize(32);
|
||||
}
|
||||
|
||||
/**
|
||||
* D4 fallback: an INVALID inbound {@code traceparent} header (malformed) yields the same
|
||||
* generated-root behavior — traceId is a fresh 32-hex value.
|
||||
*/
|
||||
@Test
|
||||
void invalidTraceparentGeneratesFreshRootTraceId() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/z");
|
||||
req.addHeader("traceparent", "NOT-A-VALID-TRACEPARENT");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
AtomicReference<String> capturedTraceId = new AtomicReference<>();
|
||||
FilterChain chain = (rq, rs) -> capturedTraceId.set(MDC.get(MdcKeys.TRACE_ID));
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
|
||||
assertThat(capturedTraceId.get())
|
||||
.as("invalid traceparent must yield a fresh generated 32-hex traceId")
|
||||
.isNotNull()
|
||||
.hasSize(32)
|
||||
.matches("[0-9a-f]{32}");
|
||||
}
|
||||
|
||||
/**
|
||||
* §테스트계약: request_id and correlation_id MDC keys are still set regardless of traceparent
|
||||
* handling, keeping existing observability contracts intact.
|
||||
*/
|
||||
@Test
|
||||
void requestIdAndCorrelationIdMdcStillSetAlongsideTraceparent() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/w");
|
||||
req.addHeader("X-Request-Id", "my-req-id");
|
||||
req.addHeader("X-Correlation-Id", "my-corr-id");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
AtomicReference<String> capturedReqId = new AtomicReference<>();
|
||||
AtomicReference<String> capturedCorrId = new AtomicReference<>();
|
||||
AtomicReference<String> capturedTraceId = new AtomicReference<>();
|
||||
FilterChain chain =
|
||||
(rq, rs) -> {
|
||||
capturedReqId.set(MDC.get(MdcKeys.REQUEST_ID));
|
||||
capturedCorrId.set(MDC.get(MdcKeys.CORRELATION_ID));
|
||||
capturedTraceId.set(MDC.get(MdcKeys.TRACE_ID));
|
||||
};
|
||||
|
||||
filter.doFilter(req, res, chain);
|
||||
|
||||
assertThat(capturedReqId.get()).isNotEqualTo("my-req-id");
|
||||
assertThat(capturedCorrId.get()).isEqualTo("my-corr-id");
|
||||
assertThat(capturedTraceId.get())
|
||||
.as("trace_id must be set (W3C generated root since no traceparent header)")
|
||||
.isNotNull()
|
||||
.hasSize(32)
|
||||
.matches("[0-9a-f]{32}");
|
||||
}
|
||||
|
||||
// DRIFT-6: user_principal on MDC must be pseudonymized, never raw
|
||||
@Test
|
||||
void putsPseudonymizedUserPrincipalOnMdcNotRawId() throws Exception {
|
||||
@@ -294,31 +104,42 @@ class RequestLoggingFilterTest {
|
||||
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/v1/test");
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
ch.qos.logback.classic.Logger logger =
|
||||
(ch.qos.logback.classic.Logger) LoggerFactory.getLogger(RequestLoggingFilter.class);
|
||||
ListAppender<ILoggingEvent> listAppender = new ListAppender<>();
|
||||
listAppender.start();
|
||||
logger.addAppender(listAppender);
|
||||
ListAppender<ILoggingEvent> listAppender = attachAppender();
|
||||
|
||||
try {
|
||||
// user_principal is set in the filter's finally block (after chain.doFilter) and is
|
||||
// captured on the http_request log event's MDC snapshot, asserted below.
|
||||
filter.doFilter(req, res, (rq, rs) -> {});
|
||||
|
||||
// Capture the MDC value from the http_request log event (which fires after putUserPrincipal)
|
||||
List<ILoggingEvent> events = listAppender.list;
|
||||
ILoggingEvent event =
|
||||
events.stream()
|
||||
.filter(e -> e.getFormattedMessage().contains("http_request"))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new AssertionError("No http_request log event found"));
|
||||
|
||||
String userPrincipalOnMdc = event.getMDCPropertyMap().get("user_principal");
|
||||
String userPrincipalOnMdc =
|
||||
httpRequestEvent(listAppender).getMDCPropertyMap().get("user_principal");
|
||||
assertThat(userPrincipalOnMdc).isEqualTo("pseudo-raw-user-1");
|
||||
assertThat(userPrincipalOnMdc).isNotEqualTo("raw-user-1");
|
||||
} finally {
|
||||
logger.detachAppender(listAppender);
|
||||
detach(listAppender);
|
||||
}
|
||||
}
|
||||
|
||||
private static ListAppender<ILoggingEvent> attachAppender() {
|
||||
ListAppender<ILoggingEvent> appender = new ListAppender<>();
|
||||
appender.start();
|
||||
logger().addAppender(appender);
|
||||
return appender;
|
||||
}
|
||||
|
||||
private static void detach(ListAppender<ILoggingEvent> appender) {
|
||||
logger().detachAppender(appender);
|
||||
}
|
||||
|
||||
private static ch.qos.logback.classic.Logger logger() {
|
||||
return (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(RequestLoggingFilter.class);
|
||||
}
|
||||
|
||||
private static ILoggingEvent httpRequestEvent(ListAppender<ILoggingEvent> appender) {
|
||||
List<ILoggingEvent> events = appender.list;
|
||||
return events.stream()
|
||||
.filter(e -> e.getFormattedMessage().contains("http_request"))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new AssertionError("No http_request log event found"));
|
||||
}
|
||||
}
|
||||
|
||||
+122
@@ -2,8 +2,15 @@ package dev.caskeleton.adapter.inbound.web.mvc.filter;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.observability.MdcKeys;
|
||||
import dev.caskeleton.shared.tracing.TraceParent;
|
||||
import jakarta.servlet.DispatcherType;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.mock.web.MockFilterChain;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
@@ -67,5 +74,120 @@ class WebMvcRequestIdFilterTest {
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
@Test
|
||||
void assignedIdentifiersAreOnMdcDuringTheChainAndMatchWhatTheResponseCarries() throws Exception {
|
||||
// given
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.addHeader(CORRELATION_ID_HEADER, "corr-1");
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
Map<String, String> duringChain = new HashMap<>();
|
||||
|
||||
// when
|
||||
new WebMvcRequestIdFilter().doFilter(request, response, (rq, rs) -> duringChain.putAll(mdc()));
|
||||
|
||||
// then
|
||||
TraceParent echoed =
|
||||
TraceParent.parse(response.getHeader(WebMvcRequestIdFilter.TRACEPARENT_HEADER))
|
||||
.orElseThrow();
|
||||
assertThat(duringChain)
|
||||
.containsExactlyInAnyOrderEntriesOf(
|
||||
Map.of(
|
||||
MdcKeys.REQUEST_ID, response.getHeader(WebMvcRequestIdFilter.REQUEST_ID_HEADER),
|
||||
MdcKeys.CORRELATION_ID, "corr-1",
|
||||
MdcKeys.TRACE_ID, WebMvcRequestIdFilter.traceId(request).orElseThrow().value(),
|
||||
MdcKeys.SPAN_ID, echoed.spanId()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void responseTraceparentCarriesTheTraceIdTheFilterAssigned() throws Exception {
|
||||
// given
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
// when
|
||||
new WebMvcRequestIdFilter().doFilter(request, response, new MockFilterChain());
|
||||
|
||||
// then
|
||||
assertThat(response.getHeader(WebMvcRequestIdFilter.TRACEPARENT_HEADER))
|
||||
.startsWith("00-" + WebMvcRequestIdFilter.traceId(request).orElseThrow().value() + "-");
|
||||
}
|
||||
|
||||
@Test
|
||||
void validInboundTraceparentIsAdoptedWithItsSpanAndEchoed() throws Exception {
|
||||
// given
|
||||
String inbound = "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01";
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.addHeader(WebMvcRequestIdFilter.TRACEPARENT_HEADER, inbound);
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
Map<String, String> duringChain = new HashMap<>();
|
||||
|
||||
// when
|
||||
new WebMvcRequestIdFilter().doFilter(request, response, (rq, rs) -> duringChain.putAll(mdc()));
|
||||
|
||||
// then
|
||||
assertThat(
|
||||
List.of(
|
||||
duringChain.get(MdcKeys.TRACE_ID),
|
||||
duringChain.get(MdcKeys.SPAN_ID),
|
||||
response.getHeader(WebMvcRequestIdFilter.TRACEPARENT_HEADER)))
|
||||
.containsExactly("4bf92f3577b34da6a3ce929d0e0e4736", "00f067aa0ba902b7", inbound);
|
||||
}
|
||||
|
||||
@Test
|
||||
void inboundCorrelationIdLosesLineBreaksBeforeReachingMdc() throws Exception {
|
||||
// given
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.addHeader(CORRELATION_ID_HEADER, "foo\r\nFAKE LOG");
|
||||
Map<String, String> duringChain = new HashMap<>();
|
||||
|
||||
// when
|
||||
new WebMvcRequestIdFilter()
|
||||
.doFilter(request, new MockHttpServletResponse(), (rq, rs) -> duringChain.putAll(mdc()));
|
||||
|
||||
// then
|
||||
assertThat(duringChain.get(MdcKeys.CORRELATION_ID)).isEqualTo("fooFAKE LOG");
|
||||
}
|
||||
|
||||
@Test
|
||||
void mdcIsClearedWhenTheRequestLeavesTheFilter() throws Exception {
|
||||
// when
|
||||
new WebMvcRequestIdFilter()
|
||||
.doFilter(
|
||||
new MockHttpServletRequest(), new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
// then
|
||||
assertThat(mdc()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void anErrorRedispatchRestoresTheSameIdentifiersOnMdc() throws Exception {
|
||||
// given
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
WebMvcRequestIdFilter filter = new WebMvcRequestIdFilter();
|
||||
Map<String, String> firstPass = new HashMap<>();
|
||||
filter.doFilter(request, new MockHttpServletResponse(), (rq, rs) -> firstPass.putAll(mdc()));
|
||||
request.setDispatcherType(DispatcherType.ERROR);
|
||||
Map<String, String> errorPass = new HashMap<>();
|
||||
|
||||
// when
|
||||
filter.doFilter(request, new MockHttpServletResponse(), (rq, rs) -> errorPass.putAll(mdc()));
|
||||
|
||||
// then
|
||||
assertThat(errorPass).isEqualTo(firstPass);
|
||||
}
|
||||
|
||||
private static Map<String, String> mdc() {
|
||||
Map<String, String> copy = new HashMap<>();
|
||||
for (String key :
|
||||
List.of(MdcKeys.REQUEST_ID, MdcKeys.CORRELATION_ID, MdcKeys.TRACE_ID, MdcKeys.SPAN_ID)) {
|
||||
String value = MDC.get(key);
|
||||
if (value != null) {
|
||||
copy.put(key, value);
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
private static final String NEWLINE = "\n";
|
||||
private static final String CORRELATION_ID_HEADER = "X-Correlation-Id";
|
||||
}
|
||||
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
package dev.caskeleton.adapter.inbound.web.operation;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import dev.caskeleton.adapter.inbound.web.auth.AuthenticatedPrincipal;
|
||||
import dev.caskeleton.adapter.inbound.web.envelope.EnvelopeBodyAdvice;
|
||||
import dev.caskeleton.adapter.inbound.web.error.GlobalExceptionHandler;
|
||||
import dev.caskeleton.application.operation.CancelDurableOperationUseCase;
|
||||
import dev.caskeleton.application.operation.GetDurableOperationUseCase;
|
||||
import dev.caskeleton.application.operation.OperationCommand;
|
||||
import dev.caskeleton.application.operation.SubmitDurableOperationUseCase;
|
||||
import dev.caskeleton.application.operation.testkit.InMemoryDurableOperationStore;
|
||||
import dev.caskeleton.application.outbox.testkit.InMemoryOutboxStore;
|
||||
import dev.caskeleton.application.transaction.testkit.DirectTransactionPort;
|
||||
import dev.caskeleton.shared.tracing.SpanErrorRecorder;
|
||||
import java.time.Clock;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.authentication.TestingAuthenticationToken;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.web.method.annotation.AuthenticationPrincipalArgumentResolver;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.MvcResult;
|
||||
import org.springframework.test.web.servlet.ResultActions;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
|
||||
/**
|
||||
* The HTTP contract of the operation endpoints over the real use cases and the port owners' fakes.
|
||||
*
|
||||
* <p>Standalone MockMvc: no security filter chain and no method-security proxy, so the permission
|
||||
* gate on submit and cancel is not exercised here — the composition test in app-bootstrap is where
|
||||
* the assembled beans are proxied.
|
||||
*/
|
||||
class DurableOperationControllerTest {
|
||||
|
||||
private static final String REPORT =
|
||||
"{\"operationName\":\"reports.generate\",\"payload\":{\"range\":\"2026-08\"}}";
|
||||
|
||||
private final InMemoryDurableOperationStore operations = new InMemoryDurableOperationStore();
|
||||
private final InMemoryOutboxStore outbox = new InMemoryOutboxStore();
|
||||
private final DirectTransactionPort transactions = new DirectTransactionPort();
|
||||
private final Clock clock = Clock.fixed(Instant.parse("2026-09-25T00:00:00Z"), ZoneOffset.UTC);
|
||||
|
||||
private MockMvc mvc;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
DurableOperationController controller =
|
||||
new DurableOperationController(
|
||||
new SubmitDurableOperationUseCase(operations, outbox, transactions, clock),
|
||||
new GetDurableOperationUseCase(operations, transactions, clock),
|
||||
new CancelDurableOperationUseCase(operations, transactions, clock));
|
||||
mvc =
|
||||
MockMvcBuilders.standaloneSetup(controller)
|
||||
.setControllerAdvice(
|
||||
new GlobalExceptionHandler(SpanErrorRecorder.NOOP), new EnvelopeBodyAdvice())
|
||||
.setCustomArgumentResolvers(new AuthenticationPrincipalArgumentResolver())
|
||||
.build();
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void signOut() {
|
||||
SecurityContextHolder.clearContext();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aSubmissionIsAcceptedWith202AndTheOperationsLocationInAnEnvelope() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
|
||||
// when
|
||||
ResultActions response = submit(REPORT);
|
||||
|
||||
// then
|
||||
String operationId = operationIdOf(response.andReturn());
|
||||
response
|
||||
.andExpect(status().isAccepted())
|
||||
.andExpect(header().string("Location", "http://localhost/operations/" + operationId))
|
||||
.andExpect(jsonPath("$.success").value(true))
|
||||
.andExpect(jsonPath("$.data.alreadyAccepted").value(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
void anIdenticalResubmissionPointsAtTheFirstOperation() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
String first = submit(REPORT).andReturn().getResponse().getHeader("Location");
|
||||
|
||||
// when
|
||||
MvcResult again = submit(REPORT).andReturn();
|
||||
|
||||
// then
|
||||
assertThat(
|
||||
List.<Object>of(
|
||||
again.getResponse().getHeader("Location"),
|
||||
JsonPath.read(again.getResponse().getContentAsString(), "$.data.alreadyAccepted")))
|
||||
.containsExactly(first, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aSubmissionAppendsItsOutboxEventUnderTheSubmittedEventTypeNotOneTheCallerChose()
|
||||
throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
|
||||
// when
|
||||
submit(REPORT);
|
||||
|
||||
// then
|
||||
assertThat(outbox.oldestUnpublishedAgeSecondsByEventType(clock.instant()))
|
||||
.containsOnlyKeys(OperationCommand.SUBMITTED_EVENT_TYPE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void theSubmitterReadsTheirOperation() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
String operationId = operationIdOf(submit(REPORT).andReturn());
|
||||
|
||||
// when
|
||||
ResultActions response = mvc.perform(get("/operations/" + operationId));
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.data.operationId").value(operationId))
|
||||
.andExpect(jsonPath("$.data.operationName").value("reports.generate"))
|
||||
.andExpect(jsonPath("$.data.state").value("PENDING"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void anotherCallerReadingTheOperationGetsTheSame404AsForAnUnknownOne() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
String operationId = operationIdOf(submit(REPORT).andReturn());
|
||||
signIn("bob");
|
||||
|
||||
// when
|
||||
ResultActions response = mvc.perform(get("/operations/" + operationId));
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isNotFound())
|
||||
.andExpect(jsonPath("$.success").value(false))
|
||||
.andExpect(jsonPath("$.error.code").value("OPERATION_NOT_FOUND"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void anUnknownOperationIs404() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
|
||||
// when
|
||||
ResultActions response = mvc.perform(get("/operations/no-such-operation"));
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isNotFound())
|
||||
.andExpect(jsonPath("$.error.code").value("OPERATION_NOT_FOUND"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void theSubmitterCancelsTheirOperationWith202() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
String operationId = operationIdOf(submit(REPORT).andReturn());
|
||||
|
||||
// when
|
||||
ResultActions response = mvc.perform(delete("/operations/" + operationId));
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isAccepted())
|
||||
.andExpect(header().string("Location", "http://localhost/operations/" + operationId))
|
||||
.andExpect(jsonPath("$.data.canceled").value(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
void anotherCallerCancelingTheOperationGets404() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
String operationId = operationIdOf(submit(REPORT).andReturn());
|
||||
signIn("bob");
|
||||
|
||||
// when
|
||||
ResultActions response = mvc.perform(delete("/operations/" + operationId));
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isNotFound())
|
||||
.andExpect(jsonPath("$.error.code").value("OPERATION_NOT_FOUND"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aSubmissionWithoutAnOperationNameIsAValidationFailure() throws Exception {
|
||||
// given
|
||||
signIn("alice");
|
||||
|
||||
// when
|
||||
ResultActions response = submit("{\"payload\":{}}");
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isBadRequest())
|
||||
.andExpect(jsonPath("$.error.code").value("VALIDATION_FAILED"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aRequestWithoutAnAuthenticatedPrincipalIs401() throws Exception {
|
||||
// when
|
||||
ResultActions response = submit(REPORT);
|
||||
|
||||
// then
|
||||
response
|
||||
.andExpect(status().isUnauthorized())
|
||||
.andExpect(jsonPath("$.error.code").value("UNAUTHENTICATED"));
|
||||
}
|
||||
|
||||
private ResultActions submit(String body) throws Exception {
|
||||
return mvc.perform(post("/operations").contentType(MediaType.APPLICATION_JSON).content(body));
|
||||
}
|
||||
|
||||
private static String operationIdOf(MvcResult result) throws Exception {
|
||||
return JsonPath.read(result.getResponse().getContentAsString(), "$.data.operationId");
|
||||
}
|
||||
|
||||
private static void signIn(String subject) {
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(
|
||||
new TestingAuthenticationToken(
|
||||
new AuthenticatedPrincipal(subject, subject + "@example.test", Set.of()), "n/a"));
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -42,7 +42,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
// @SpringBootTest(classes = ...), so the package is what keeps it out.
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
// Not the adapter's own root: its security chain and filters would be stages this fixture did not
|
||||
// declare, and the recorded order would be about them rather than the semantic pipeline.
|
||||
// declare, and the recorded order would be about them rather than the semantic pipeline. So this
|
||||
// fixture proves the semantic order and the async single-observation, not where the real filters
|
||||
// sit: the registered order of the request-id filter against springSecurityFilterChain is asserted
|
||||
// on the real auto-configuration by app-bootstrap's OperationalContractRuntimeTest, and the
|
||||
// consequence (a 401 envelope carrying the assigned request id) by SecurityModeWebContractTest.
|
||||
@EnableAutoConfiguration(exclude = WebAdapterAutoConfiguration.class)
|
||||
@Import(PipelineOrderFixtureController.class)
|
||||
public class PipelineOrderFixtureApplication implements WebMvcConfigurer {
|
||||
|
||||
@@ -109,12 +109,20 @@ sent.
|
||||
Rate limiting, distributed leases and Redis idempotency execute Lua programs. If any of those roles
|
||||
select Redis, the composition root runs a startup probe on the SCRIPT lane:
|
||||
|
||||
1. `SCRIPT LOAD` a mutation-free `return {1}` program;
|
||||
1. `SCRIPT LOAD` a program that calls the commands the semantic scripts depend on — `TIME`, then
|
||||
`HSET`/`PEXPIRE`/`HGET`/`DEL` on its own probe key, which it deletes;
|
||||
2. execute it through `EVALSHA`;
|
||||
3. require the expected reply.
|
||||
3. require the expected reply (the value it wrote reads back).
|
||||
|
||||
A deployment whose effective Redis account lacks script permissions fails during startup rather
|
||||
than at the first request. Cache-only deployments do not run this probe.
|
||||
Redis checks a script's inner commands against the ACL only when they run, so a probe that ran
|
||||
nothing proved `EVALSHA` and nothing else: an account granted by category (`@read`/`@write`) lacks
|
||||
`TIME` and failed every rate-limit and idempotency request after a clean start. A deployment whose
|
||||
effective Redis account lacks script permissions fails during startup rather than at the first
|
||||
request. Cache-only deployments do not run this probe.
|
||||
|
||||
At runtime, `redisRequired` (redis-runtime) probes the SCRIPT lane too when a script role is
|
||||
selected, so a broken advanced-account credential makes the pod unready instead of leaving the
|
||||
regular-lane PING to report UP.
|
||||
|
||||
## Cache semantics
|
||||
|
||||
@@ -217,7 +225,7 @@ Useful focused checks:
|
||||
```bash
|
||||
./gradlew :adapter:outbound:cache-redis:check
|
||||
./gradlew :adapter:outbound:redis-runtime:check
|
||||
./gradlew :app-bootstrap:test --tests '*RedisSemanticScriptAclProbeTest'
|
||||
./gradlew :adapter:outbound:cache-redis:test --tests '*RedisSemanticScriptAclProbeTest'
|
||||
./gradlew :app-bootstrap:verifyEnvKeys
|
||||
./gradlew architectureCheck
|
||||
```
|
||||
|
||||
+44
-6
@@ -1,7 +1,10 @@
|
||||
package dev.caskeleton.adapter.outbound.cache.redis;
|
||||
|
||||
import java.util.Set;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -10,20 +13,32 @@ import org.slf4j.LoggerFactory;
|
||||
* degraded/indeterminate outcomes.
|
||||
*
|
||||
* <p>Never logs exception messages, Redis keys, values, command arguments or credential material.
|
||||
* One warning per capability/operation/failure type makes a fail-open/fail-closed transition
|
||||
* visible without turning a Redis outage into a log-flood outage; repeats stay at debug.
|
||||
* One warning per capability/operation/failure type per {@link #WARN_INTERVAL} makes a
|
||||
* fail-open/fail-closed transition visible without turning a Redis outage into a log-flood outage;
|
||||
* repeats inside the interval stay at debug. Once per JVM was too few: an outage that started an
|
||||
* hour after the first one was invisible at WARN.
|
||||
*/
|
||||
public final class RedisSemanticFailureLogger {
|
||||
|
||||
static final Duration WARN_INTERVAL = Duration.ofMinutes(1);
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RedisSemanticFailureLogger.class);
|
||||
private static final Set<String> WARNED = ConcurrentHashMap.newKeySet();
|
||||
|
||||
// Bounded by the code: capability x operation x the exception types a driver can raise.
|
||||
private static final Map<String, Long> LAST_WARNED = new ConcurrentHashMap<>();
|
||||
|
||||
private RedisSemanticFailureLogger() {}
|
||||
|
||||
public static void report(String capability, String operation, Throwable failure) {
|
||||
String failureType = failure.getClass().getSimpleName();
|
||||
report(capability, operation, failure, System.nanoTime());
|
||||
}
|
||||
|
||||
static void report(String capability, String operation, Throwable failure, long nowNanos) {
|
||||
// The cause, not the future's wrapper: every failure read through `.get()` is an
|
||||
// ExecutionException, which says nothing about what went wrong.
|
||||
String failureType = causeOf(failure).getClass().getSimpleName();
|
||||
String key = capability + ":" + operation + ":" + failureType;
|
||||
if (WARNED.add(key)) {
|
||||
if (claimWarning(key, nowNanos)) {
|
||||
LOG.warn(
|
||||
"Redis semantic operation degraded; capability={} operation={} failureType={}",
|
||||
capability,
|
||||
@@ -37,4 +52,27 @@ public final class RedisSemanticFailureLogger {
|
||||
failureType);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean claimWarning(String key, long nowNanos) {
|
||||
boolean[] claimed = {false};
|
||||
LAST_WARNED.compute(
|
||||
key,
|
||||
(ignored, last) -> {
|
||||
if (last == null || nowNanos - last >= WARN_INTERVAL.toNanos()) {
|
||||
claimed[0] = true;
|
||||
return nowNanos;
|
||||
}
|
||||
return last;
|
||||
});
|
||||
return claimed[0];
|
||||
}
|
||||
|
||||
private static Throwable causeOf(Throwable failure) {
|
||||
Throwable current = failure;
|
||||
while ((current instanceof ExecutionException || current instanceof CompletionException)
|
||||
&& current.getCause() != null) {
|
||||
current = current.getCause();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
}
|
||||
|
||||
+27
-9
@@ -27,8 +27,10 @@ import java.util.function.Function;
|
||||
*
|
||||
* <p>The only port in this leaf that may degrade rather than fail. A cache exists to make things
|
||||
* faster, so an unreachable cache means slower, not broken — every failure path returns a miss or
|
||||
* {@code DEGRADED_UNAVAILABLE} and the caller falls back to the source. That licence is specific to
|
||||
* this port and must never be copied to session, idempotency, rate limit, or lease, where the same
|
||||
* {@code DEGRADED_UNAVAILABLE} and the caller falls back to the source. A write whose command was
|
||||
* sent and whose reply was lost says {@code INDETERMINATE} instead, because it may have landed;
|
||||
* {@code DEGRADED_UNAVAILABLE} is kept for writes that never left. That licence is specific to this
|
||||
* port and must never be copied to session, idempotency, rate limit, or lease, where the same
|
||||
* behaviour would mean serving without the guarantee the caller asked for.
|
||||
*
|
||||
* <p>Three things this adapter refuses to treat as an ordinary miss, because each of them means the
|
||||
@@ -221,6 +223,9 @@ public final class RedisCacheRegionAdapter<K, V> implements CacheRegionPort<K, V
|
||||
Instant now = clock.instant();
|
||||
Duration effectiveSoft = softTtl.compareTo(ttl) > 0 ? ttl : softTtl;
|
||||
byte[] physicalKey = keys.entryKey(keyDigest.apply(key));
|
||||
// Whether the write command itself was handed to the driver. A failure before that point —
|
||||
// lane refusal, connection, the generation read — wrote nothing.
|
||||
boolean sent = false;
|
||||
try (RedisLease lease = owner.borrow(RedisConnectionKind.REGULAR)) {
|
||||
resolveGeneration(lease, now);
|
||||
CacheEnvelope envelope =
|
||||
@@ -233,6 +238,7 @@ public final class RedisCacheRegionAdapter<K, V> implements CacheRegionPort<K, V
|
||||
absence,
|
||||
payload);
|
||||
Boolean applied;
|
||||
sent = true;
|
||||
if (metadata.intent() == CacheRecordIntent.ONLY_IF_OBSERVED) {
|
||||
// Compare and replacement are one server-side execution. A GET followed by SET would let a
|
||||
// concurrent writer land between them and then be overwritten by this stale source load.
|
||||
@@ -265,10 +271,10 @@ public final class RedisCacheRegionAdapter<K, V> implements CacheRegionPort<K, V
|
||||
: CacheRecordOutcome.NOT_RECORDED_CONDITION;
|
||||
} catch (InterruptedException interrupted) {
|
||||
Thread.currentThread().interrupt();
|
||||
return CacheRecordOutcome.DEGRADED_UNAVAILABLE;
|
||||
return sent ? CacheRecordOutcome.INDETERMINATE : CacheRecordOutcome.DEGRADED_UNAVAILABLE;
|
||||
} catch (Exception failure) {
|
||||
RedisSemanticFailureLogger.report("cache", "record", failure);
|
||||
return CacheRecordOutcome.DEGRADED_UNAVAILABLE;
|
||||
return sent ? CacheRecordOutcome.INDETERMINATE : CacheRecordOutcome.DEGRADED_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,11 +288,14 @@ public final class RedisCacheRegionAdapter<K, V> implements CacheRegionPort<K, V
|
||||
@Override
|
||||
public CacheInvalidationOutcome invalidate(K key) {
|
||||
Objects.requireNonNull(key, "key must be non-null");
|
||||
boolean sent = false;
|
||||
try (RedisLease lease = owner.borrow(RedisConnectionKind.REGULAR)) {
|
||||
byte[] physicalKey = keys.entryKey(keyDigest.apply(key));
|
||||
sent = true;
|
||||
byte[] removed =
|
||||
lease
|
||||
.gateway()
|
||||
.getAndDelete(keys.entryKey(keyDigest.apply(key)))
|
||||
.getAndDelete(physicalKey)
|
||||
.toCompletableFuture()
|
||||
.get(commandTimeout.toNanos(), TimeUnit.NANOSECONDS);
|
||||
return removed == null
|
||||
@@ -294,20 +303,29 @@ public final class RedisCacheRegionAdapter<K, V> implements CacheRegionPort<K, V
|
||||
: CacheInvalidationOutcome.INVALIDATED;
|
||||
} catch (InterruptedException interrupted) {
|
||||
Thread.currentThread().interrupt();
|
||||
return CacheInvalidationOutcome.DEGRADED_UNAVAILABLE;
|
||||
return invalidationFailure(sent);
|
||||
} catch (Exception failure) {
|
||||
RedisSemanticFailureLogger.report("cache", "invalidate", failure);
|
||||
return CacheInvalidationOutcome.DEGRADED_UNAVAILABLE;
|
||||
return invalidationFailure(sent);
|
||||
}
|
||||
}
|
||||
|
||||
// A lost reply to a sent delete or generation bump may have applied it.
|
||||
private static CacheInvalidationOutcome invalidationFailure(boolean sent) {
|
||||
return sent
|
||||
? CacheInvalidationOutcome.INDETERMINATE
|
||||
: CacheInvalidationOutcome.DEGRADED_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheInvalidationOutcome invalidateRegion() {
|
||||
// A generation bump, not a key scan. Scanning a keyspace to delete a region is O(keyspace) on
|
||||
// a server that is answering everything else at the same time, and the SDK blocks KEYS for
|
||||
// exactly that reason. Bumping the generation makes every older entry fail the generation
|
||||
// check on read and expire on its own schedule.
|
||||
boolean sent = false;
|
||||
try (RedisLease lease = owner.borrow(RedisConnectionKind.REGULAR)) {
|
||||
sent = true;
|
||||
Long generation =
|
||||
lease
|
||||
.gateway()
|
||||
@@ -318,10 +336,10 @@ public final class RedisCacheRegionAdapter<K, V> implements CacheRegionPort<K, V
|
||||
return CacheInvalidationOutcome.INVALIDATED;
|
||||
} catch (InterruptedException interrupted) {
|
||||
Thread.currentThread().interrupt();
|
||||
return CacheInvalidationOutcome.DEGRADED_UNAVAILABLE;
|
||||
return invalidationFailure(sent);
|
||||
} catch (Exception failure) {
|
||||
RedisSemanticFailureLogger.report("cache", "invalidate-region", failure);
|
||||
return CacheInvalidationOutcome.DEGRADED_UNAVAILABLE;
|
||||
return invalidationFailure(sent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-9
@@ -171,7 +171,6 @@ public class RedisCapabilitySettings {
|
||||
|
||||
private String provider = "disabled";
|
||||
private String failurePolicy = "fail-closed";
|
||||
private String defaultPolicyId = "api-default";
|
||||
private Duration failureRetryAfter = Duration.ofMillis(100);
|
||||
private Duration commandTimeout = Duration.ofMillis(200);
|
||||
private int keyVersion = 1;
|
||||
@@ -197,14 +196,6 @@ public class RedisCapabilitySettings {
|
||||
this.failurePolicy = failurePolicy;
|
||||
}
|
||||
|
||||
public String getDefaultPolicyId() {
|
||||
return defaultPolicyId;
|
||||
}
|
||||
|
||||
public void setDefaultPolicyId(String defaultPolicyId) {
|
||||
this.defaultPolicyId = defaultPolicyId;
|
||||
}
|
||||
|
||||
public Duration getFailureRetryAfter() {
|
||||
return failureRetryAfter;
|
||||
}
|
||||
|
||||
+14
-5
@@ -19,6 +19,7 @@ import java.util.Map;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
/**
|
||||
* The Redis-backed edge rate limiter, and the policy compilation it needs.
|
||||
@@ -30,6 +31,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
class RedisRateLimitConfig {
|
||||
|
||||
private static final String DEFAULT_POLICY_ID = "app.rate-limit.default-policy-id";
|
||||
|
||||
/**
|
||||
* The provider-neutral edge rate limiter, backed by Redis.
|
||||
*
|
||||
@@ -37,6 +40,7 @@ class RedisRateLimitConfig {
|
||||
* @param sdk the Redis SDK settings, which own the namespace
|
||||
* @param capabilities the capability settings
|
||||
* @param clock the local clock used for caller deadlines and response reset instants
|
||||
* @param environment where the HTTP boundary's default policy id is read from
|
||||
* @return the rate limit port
|
||||
*/
|
||||
@Bean
|
||||
@@ -47,12 +51,17 @@ class RedisRateLimitConfig {
|
||||
RedisRuntimeOwner owner,
|
||||
RedisSdkSettings sdk,
|
||||
RedisCapabilitySettings capabilities,
|
||||
Clock clock) {
|
||||
Clock clock,
|
||||
Environment environment) {
|
||||
RedisCapabilitySettings.RateLimit rateLimit = capabilities.getRateLimit();
|
||||
// The id the HTTP boundary sends when a route names none. One key, app.rate-limit.*, read by
|
||||
// both sides: a second copy under ca-skeleton.capabilities bound to the same env var could be
|
||||
// overridden alone, and this check would then approve a policy nobody requests.
|
||||
String defaultPolicyId = environment.getProperty(DEFAULT_POLICY_ID, "api-default");
|
||||
return new RedisEdgeRateLimitAdapter(
|
||||
owner,
|
||||
new RateLimitKeys(RedisKeys.namespaceOf(sdk), rateLimit.getKeyVersion()),
|
||||
policiesOf(rateLimit),
|
||||
policiesOf(rateLimit, defaultPolicyId),
|
||||
new RateLimitScripts(),
|
||||
clock,
|
||||
rateLimit.getCommandTimeout(),
|
||||
@@ -60,7 +69,7 @@ class RedisRateLimitConfig {
|
||||
}
|
||||
|
||||
private static Map<String, RateLimitPolicy> policiesOf(
|
||||
RedisCapabilitySettings.RateLimit rateLimit) {
|
||||
RedisCapabilitySettings.RateLimit rateLimit, String defaultPolicyId) {
|
||||
if (rateLimit.getPolicies().isEmpty()) {
|
||||
// An enabled limiter with no policy would answer every request "unknown policy", which the
|
||||
// port reports as a deployment error on every call rather than once at startup.
|
||||
@@ -72,10 +81,10 @@ class RedisRateLimitConfig {
|
||||
rateLimit
|
||||
.getPolicies()
|
||||
.forEach((id, policy) -> policies.put(id, policyOf(id, policy, rateLimit)));
|
||||
if (!policies.containsKey(rateLimit.getDefaultPolicyId())) {
|
||||
if (!policies.containsKey(defaultPolicyId)) {
|
||||
throw new CapabilityStartupValidationException(
|
||||
"the default rate-limit policy '"
|
||||
+ rateLimit.getDefaultPolicyId()
|
||||
+ defaultPolicyId
|
||||
+ "' is not among the configured policies "
|
||||
+ policies.keySet());
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user