diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a90384d4..5f0cc963 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -375,10 +375,15 @@ jobs: - fileserver-pvc-certification - fileserver-sensitive-telemetry-scan # Job-level, because a job that declares `permissions:` replaces the workflow set entirely: this - # is the only job that writes anything anywhere, and `packages: write` stops at its boundary. + # job and app-image-signing are the only ones that write anything anywhere, and + # `packages: write` stops at their boundary. No OIDC token here: this job runs the repository's + # Gradle build inside the Dockerfile, and the signing identity stays out of that. permissions: contents: read packages: write + # The signing job below reads the digest from here. It is the digest, not a tag, that is signed. + outputs: + pinned_reference: ${{ steps.push.outputs.pinned_reference }} runs-on: ubuntu-latest timeout-minutes: 90 steps: @@ -575,6 +580,7 @@ jobs: # digest recorded below is immutable by construction, and it is the field the GitOps repository # pins — the tags exist so a person can find the digest, not so a cluster can resolve one. - name: Push the release and revision tags + id: push run: | set -euo pipefail docker push "${IMAGE_REPOSITORY}:${IMAGE_VERSION_TAG}" @@ -595,6 +601,7 @@ jobs: exit 1 fi printf 'PINNED_REFERENCE=%s\n' "${pinned_reference}" >> "${GITHUB_ENV}" + printf 'pinned_reference=%s\n' "${pinned_reference}" >> "${GITHUB_OUTPUT}" printf 'container-release: pushed %s\n' "${pinned_reference}" # The handoff to the GitOps repository, in a form a person and a script can both read. It is # written to the job summary as well as to an artifact because the summary is where somebody @@ -628,3 +635,108 @@ jobs: path: image-release.txt if-no-files-found: error retention-days: 90 + + # Keyless signature of the pushed digest (owner decision 31). A job of its own so that + # `id-token: write` — the GitHub OIDC token Fulcio turns into a short-lived signing certificate + # naming this workflow and tag — exists only here, in a job that checks nothing out and builds + # nothing. The signature goes to the registry beside the image (hence `packages: write`) and the + # transparency-log entry to Rekor; there is no key to store or rotate. + # + # The digest is signed, never a tag: a tag can be moved to other content, a digest cannot. + # Verification runs right after signing with the identity a deployment should require, so a + # release whose signature a cluster would reject fails here instead of at admission. + # + # Local limit: signing needs the tag run's OIDC token and a pushed GHCR image, so it is exercised + # only by a real release. DeveloperExperienceContractTest pins the structure of this job. + app-image-signing: + needs: + - app-image-release + permissions: + contents: read + packages: write + id-token: write + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + PINNED_REFERENCE: ${{ needs.app-image-release.outputs.pinned_reference }} + steps: + # Same policy as Trivy above: a pinned release binary with an asserted SHA-256, no action. + # The two hashes are the cosign-linux-{amd64,arm64} lines of the official v3.1.3 + # cosign_checksums.txt, which was itself verified against its Sigstore bundle + # (identity keyless@projectsigstore.iam.gserviceaccount.com, issuer https://accounts.google.com) + # when they were pinned. The checksum file is fetched again here and must still carry the + # pinned line, so a re-published release asset fails the job instead of passing silently. + - name: Install pinned cosign under RUNNER_TEMP + run: | + set -euo pipefail + readonly COSIGN_VERSION='3.1.3' + readonly COSIGN_SHA256_AMD64='4629c757b7618056f8ddd7e2625ae9fdd94c0372a65049520bc7d9df9efc7f71' + readonly COSIGN_SHA256_ARM64='c5d324e091826b0d7a78eb16fef316450b4eb9aaec045611c08ba06f5e73220a' + readonly DOWNLOAD_BASE_URL="https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}" + case "${RUNNER_ARCH:-X64}" in + X64) + asset='cosign-linux-amd64' + expected_sha256="${COSIGN_SHA256_AMD64}" + ;; + ARM64) + asset='cosign-linux-arm64' + expected_sha256="${COSIGN_SHA256_ARM64}" + ;; + *) + echo "::error::unsupported runner architecture: ${RUNNER_ARCH:-unknown}" + exit 1 + ;; + esac + install_dir="${RUNNER_TEMP}/cosign-${COSIGN_VERSION}" + mkdir -p "${install_dir}" + curl --fail --show-error --silent --location --retry 3 \ + --proto '=https' --tlsv1.2 \ + "${DOWNLOAD_BASE_URL}/cosign_checksums.txt" \ + --output "${RUNNER_TEMP}/cosign_checksums.txt" + if ! grep -qxF "${expected_sha256} ${asset}" "${RUNNER_TEMP}/cosign_checksums.txt"; then + echo "::error::cosign_checksums.txt no longer lists the pinned ${asset} hash" + exit 1 + fi + curl --fail --show-error --silent --location --retry 3 \ + --proto '=https' --tlsv1.2 \ + "${DOWNLOAD_BASE_URL}/${asset}" \ + --output "${install_dir}/cosign" + printf '%s %s\n' "${expected_sha256}" "${install_dir}/cosign" | sha256sum -c - + chmod 0755 "${install_dir}/cosign" + printf '%s\n' "${install_dir}" >> "${GITHUB_PATH}" + - name: Check the reference to sign + run: | + set -euo pipefail + if [[ ! "${PINNED_REFERENCE}" =~ ^ghcr\.io/[a-z0-9._/-]+@sha256:[0-9a-f]{64}$ ]]; then + echo "::error::app-image-release handed over no digest reference; got '${PINNED_REFERENCE}'" + exit 1 + fi + printf 'CERTIFICATE_IDENTITY=%s/%s\n' "${GITHUB_SERVER_URL}" "${GITHUB_WORKFLOW_REF}" \ + >> "${GITHUB_ENV}" + - name: Sign in to the container registry + env: + REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + printf '%s' "${REGISTRY_TOKEN}" \ + | docker login ghcr.io --username "${GITHUB_ACTOR}" --password-stdin + - name: Sign the image digest (keyless) + run: | + set -euo pipefail + cosign sign --yes "${PINNED_REFERENCE}" + # The identity a deployment admission policy should require: this workflow file at this tag, + # issued by GitHub's OIDC provider. Anything else — another workflow, another repository, a + # branch run — does not verify. + - name: Verify the signature with the release identity + run: | + set -euo pipefail + cosign verify \ + --certificate-identity "${CERTIFICATE_IDENTITY}" \ + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ + "${PINNED_REFERENCE}" > cosign-verify.json + { + printf '### container-release signature\n\n' + printf -- '- signed: `%s`\n' "${PINNED_REFERENCE}" + printf -- '- certificate identity: `%s`\n' "${CERTIFICATE_IDENTITY}" + printf -- '- issuer: `https://token.actions.githubusercontent.com`\n' + } >> "${GITHUB_STEP_SUMMARY}" diff --git a/docs/architecture/persistence-fileserver-adopter-api-surface.txt b/docs/architecture/persistence-fileserver-adopter-api-surface.txt new file mode 100644 index 00000000..28b9a9d1 --- /dev/null +++ b/docs/architecture/persistence-fileserver-adopter-api-surface.txt @@ -0,0 +1,6 @@ +# Supported production adopter surface for the fileserver persistence leaf. +# Language-level public implementation types are not compatibility promises. +# Adding an import outside this list requires an explicit review of the adopter contract. +# Checked by verifyPersistenceFileserverApiSurface (ca.api-surface adopterBaseline); every entry must +# be in persistence-fileserver-api-surface.txt. +dev.caskeleton.adapter.outbound.persistence.fileserver.FileserverSchemaActivation diff --git a/docs/architecture/persistence-fileserver-api-surface.txt b/docs/architecture/persistence-fileserver-api-surface.txt new file mode 100644 index 00000000..bbb98130 --- /dev/null +++ b/docs/architecture/persistence-fileserver-api-surface.txt @@ -0,0 +1,30 @@ +# Fileserver persistence leaf public API surface — every public top-level type in src/main/java. +# Entities, Spring Data repositories and store adapters are implementation; +# the adopter baseline lists the subset other leaves' production code may import. +# Update only after review with: +# ./gradlew :adapter:outbound:persistence-fileserver:updatePersistenceFileserverApiSurface -PapprovePersistenceFileserverApiSurfaceChange +# types: 24 +dev.caskeleton.adapter.outbound.persistence.fileserver.FileserverJpaPersistenceConfig +dev.caskeleton.adapter.outbound.persistence.fileserver.FileserverSchemaActivation +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaCleanupQueue +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaContentReferenceLedger +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaFileMetadataStore +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaFileQuotaService +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaQuotaCommitGateway +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaQuotaReclaimGateway +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaRecoveryQueue +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaStagingUploadLocator +dev.caskeleton.adapter.outbound.persistence.fileserver.JpaUploadSessionStore +dev.caskeleton.adapter.outbound.persistence.fileserver.entity.CleanupItemEntity +dev.caskeleton.adapter.outbound.persistence.fileserver.entity.FileEntity +dev.caskeleton.adapter.outbound.persistence.fileserver.entity.QuotaReservationEntity +dev.caskeleton.adapter.outbound.persistence.fileserver.entity.RecoveryItemEntity +dev.caskeleton.adapter.outbound.persistence.fileserver.entity.UploadSessionEntity +dev.caskeleton.adapter.outbound.persistence.fileserver.entity.VerificationResultEntity +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.FileTransitionRepository +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.FileserverCleanupRepository +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.FileserverQuotaRepository +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.FileserverRecoveryRepository +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.JpaFileRepository +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.JpaUploadSessionRepository +dev.caskeleton.adapter.outbound.persistence.fileserver.repository.UploadLeaseRepository diff --git a/docs/capability-status.md b/docs/capability-status.md index 3656c0b2..e00a2a3f 100644 --- a/docs/capability-status.md +++ b/docs/capability-status.md @@ -467,3 +467,5 @@ web 경로의 `W/`는 `src/adapter/inbound/web/src/main/java/dev/caskeleton/adap | `JdkNotificationHttpGatewaySecurityTest` | `.../test/.../provider/http/JdkNotificationHttpGatewaySecurityTest.java` | `bff135d6` | 대상 gateway 삭제 | | `PersistenceJpaConfig.OPT_IN_NOTIFICATION_PACKAGE`, coverage 테스트 opt-in 표 | `src/adapter/outbound/persistence-jpa/.../config/PersistenceJpaConfig.java`, `PersistenceEntityScanCoverageTest.java` | `90fcc8ba` | S2-#1b: 알림 패키지가 leaf 밖으로 | | `PostgreSqlNotificationBackgroundPassIntegrationTest.replayMarksAnEventWithNoProjectorFailed` | `src/adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/.../readiness/` | `ce863643` | S1-#9: `NO_PROJECTOR` 분기 삭제 | +| `ca.release-provenance` 플러그인 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/` | `64a83918` | BUILD-O3-5: sourceRevision은 `ca.java-conventions`, provenance 검증은 루트 태스크 하나 | +| app-bootstrap의 `MessagingCapabilityRegistryContractTest` 위치 | `src/app-bootstrap/src/test/java/.../MessagingCapabilityRegistryContractTest.java` | `64a83918` | 결정 29: messaging leaf 테스트로 이동 | diff --git a/docs/registries/error-codes.yaml b/docs/registries/error-codes.yaml index 811f892f..39d76e7b 100644 --- a/docs/registries/error-codes.yaml +++ b/docs/registries/error-codes.yaml @@ -865,7 +865,7 @@ errors: - code: INTERNAL_ERROR category: INTERNAL http_status: 500 - retryable: true + retryable: false retry_after_seconds: null owner_branch: 2026-09-21-core-web-review-remediation owner_layer: crosscut diff --git a/docs/reviews/2026-09-25-review-followup-results/W3-P27.md b/docs/reviews/2026-09-25-review-followup-results/W3-P27.md new file mode 100644 index 00000000..bb6c450b --- /dev/null +++ b/docs/reviews/2026-09-25-review-followup-results/W3-P27.md @@ -0,0 +1,25 @@ +# W3-P27 — 빌드 잔여 + 소유자 결정 28·29·31 + +구현 에이전트가 커밋 5개를 남긴 뒤 세션 재시작으로 중단됐다(결과 파일 미작성). 이 파일은 오케스트레이터가 커밋 내용과 +통합 검증으로 작성했다. 중단 시점의 미커밋 변경(auxiliary 레인 → `jvm-test-suite`, 14 leaf build 파일)은 +scratchpad `p27-jvm-test-suite-wip.patch`로 보관했고 후속 묶음에서 이어 간다. + +## 행 결과 +| ID | 결과 | 근거 | +|---|---|---| +| P15-new-3 | 완료 | 결정 28, `7e7d0a59`: `OperationalError.INTERNAL_ERROR` retryable=false — 레지스트리·shared-contract README·web 기대값 함께. INTERNAL category 코드는 모두 retryable=false | +| X1-#7a | 완료 | 결정 29, `09d9189d`: `MessagingCapabilityRegistryContractTest`를 app-bootstrap에서 `adapter:outbound:messaging` 테스트로(Jackson 3), snakeyaml은 test* configuration에서만 허용(main exclude·reject 유지), test inputs = `config/messaging` 전체. JPA 쪽은 P16(`de075afe`)에서 완료 | +| X1-지도-readiness / evidence / API-surface / moduleboundary | 완료 | JPA readiness·evidence → persistence-jpa 테스트(P16), API surface 구현 하나(P16), messaging 카드 검증 → messaging leaf 테스트(`09d9189d`) | +| BUILD-계획-C | 완료 | 결정 31, `09e739d6`: `release.yml` `app-image-signing` job — 공식 cosign v3.1.3 `cosign_checksums.txt`(Sigstore 번들 검증)의 sha256으로 고정한 바이너리 설치, `app-image-release`가 넘긴 digest를 keyless 서명 후 이 workflow·tag identity로 검증, `id-token: write`는 이 job만. `DeveloperExperienceContractTest`가 구조 고정. 실제 서명은 tag 실행에서만 가능(로컬 미검증) | +| P16-new-6 | 완료 | `976c175f`: persistence-fileserver에 `ca.api-surface`, 공개 타입 24개 기준선과 adopter 목록(`FileserverSchemaActivation`) 승인 — 목록에서 빼면 composition import로 `verifyPersistenceFileserverApiSurface` 실패 | +| BUILD-O3-5 | 남음 | 완료분: `302ba915` `ca.release-provenance` 제거(leaf version·sourceRevision은 `ca.java-conventions`의 `JavaConventionsPlugin.sourceRevision`, 루트 `verifyReleaseProvenance`는 같은 함수를 부르는 build.gradle 태스크, TestKit 테스트는 `PlatformModuleConventionTest`로). 남은 것: auxiliary 레인 → `jvm-test-suite`(중단된 WIP 패치) | +| BUILD-결론-1 | 남음 | O3-5 나머지 뒤 build-logic Java 줄 수로 판정 | + +## 제거된 코드 +| 대상 | 경로 | 마지막으로 존재한 커밋 | 이유 | +|---|---|---|---| +| `ca.release-provenance` 플러그인 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/` | `64a83918` | BUILD-O3-5: sourceRevision은 `ca.java-conventions`, provenance 검증은 루트 태스크 하나 | +| app-bootstrap의 `MessagingCapabilityRegistryContractTest` 위치 | `src/app-bootstrap/src/test/java/.../MessagingCapabilityRegistryContractTest.java` | `64a83918` | 결정 29: messaging leaf 테스트로 이동 | + +## 새로 발견한 결함 +(에이전트 보고 없음) diff --git a/docs/reviews/2026-09-25-review-followup-status.md b/docs/reviews/2026-09-25-review-followup-status.md index d72f12c8..3b6508f9 100644 --- a/docs/reviews/2026-09-25-review-followup-status.md +++ b/docs/reviews/2026-09-25-review-followup-status.md @@ -580,7 +580,7 @@ Wave 3 라운드 1 결과로 받은 4건(2026-09-28, desktop): | ID | 심각도 | 요약 | 상태 | 근거 | Wave | 수정 방향 | |---|---|---|---|---|---|---| -| BUILD-결론-1 | 권고 | 빌드 코드가 목적에 비해 너무 큼(16,768줄 중 아키텍처 검사 13%) | 남음 | 현재 Java(main+test) build-logic 6,184 + build-tools 4,320 = 10,504줄. O3 목표는 3.5–4k줄
Wave 3 W3-P16: 미완 — build-logic+build-tools Java 10,504줄 → build-logic 6,185줄(main 4,184 + test 2,001; build-tools 0). 목표 3.5–4k에는 BUILD-O3-5 나머지(auxiliary → jvm-test-suite, release-provenance 제거)가 필요 | W3 | BUILD-O3-2·5·6 진행으로 줄인다 | +| BUILD-결론-1 | 권고 | 빌드 코드가 목적에 비해 너무 큼(16,768줄 중 아키텍처 검사 13%) | 남음 | 현재 Java(main+test) build-logic 6,184 + build-tools 4,320 = 10,504줄. O3 목표는 3.5–4k줄
Wave 3 W3-P16: 미완 — build-logic+build-tools Java 10,504줄 → build-logic 6,185줄(main 4,184 + test 2,001; build-tools 0). 목표 3.5–4k에는 BUILD-O3-5 나머지(auxiliary → jvm-test-suite, release-provenance 제거)가 필요
Wave 3 W3-P27: 미완 — O3-5 나머지 뒤 build-logic Java 줄 수로 판정 | W3 | BUILD-O3-2·5·6 진행으로 줄인다 | | BUILD-결론-2 | 권고 | 기능별 증거 검사(E)가 46%로 가장 큰 덩어리 | 완료 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): 기능별 evidence 검사 중 JPA(`jpa/` 2,701+706줄, `junit/` 138+76줄) 삭제. 남은 E는 redis topology(소유자 결정 4로 유지) | - | JPA evidence 폐기(BUILD-O3-2) | | BUILD-결론-3 | 권고 | 아키텍처 게이트(방향 task·ArchUnit)는 크기가 적정하니 유지 | 완료 | `src/build-logic/src/main/java/dev/caskeleton/buildlogic/architecture/ArchitecturePlugin.java:58-223` 방향·순수성·ignored-source 유지, `src/app-bootstrap/build.gradle:45-52` architectureTest 레인 유지 | - | - | | BUILD-결론-4 | 권고 | 09-16 단계 분리 계획이 절반만 이행됨(2단계 게이트가 PR에서 돎) | 완료 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): 하위 행으로 추적: B2·B4-17·B4-27·B4-28·B4-30·중복-6 완료, B3의 "변경 모듈만 실행"과 C는 보류(각 행) | - | 해당 행 참고 | @@ -605,12 +605,12 @@ Wave 3 라운드 1 결과로 받은 4건(2026-09-28, desktop): | BUILD-계획-B4-34 | 권고 | qualificationCheck/systemTestCheck를 PR에서 main으로 | 완료 | `ci`에서 빠지고 `mainCheck`(`src/build.gradle:140`)로 이동. 참고: `src/app-bootstrap/build.gradle:71-73`의 `check`→`systemTestLaneCheck`(기본 조립 기동 `DefaultCompositionBootTest` 등 4개 클래스)는 `208077fd`에도 있었고 지금도 PR에서 돎 | - | - | | BUILD-계획-B4-35 | 권고 | sampleWebContractCheck·configContractCheck를 PR에서 main으로 | 완료 | `src/build.gradle:139,141` mainCheck. `ci`(`:127-132`)에는 없음 | - | - | | BUILD-계획-B5 | 권고 | gate matrix가 release 차단을 실제로 강제하도록 연결 | 해당 없음(코드 삭제) | matrix 파일 삭제(`.github/ci-gate-matrix.yml` 없음, `ci-quality-gates.yml:5-10` 주석) | - | - | -| BUILD-계획-C | 권고 | 컨테이너 이미지 서명 | 남음 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): 서명 대상(GHCR push)과 keyless OIDC 토큰은 tag 실행에서만 있어 로컬 검증 불가. 이 workflow는 제3자 action 대신 체크섬 고정 바이너리를 설치하는 정책인데, 이 환경에서 cosign 릴리스 체크섬을 확인할 수 없어 확인하지 않은 체크섬·action SHA를 넣지 않음. 결정할 것: cosign 버전·설치 방식(체크섬 고정 vs `sigstore/cosign-installer` SHA 고정), image job에 `id-token: write` 부여. 승인자: 저장소 소유자 결정 필요
결정 29·31(2026-09-28): 보류 해제 → 남음, 빌드 잔여 묶음 P27 | W3 | release.yml의 push 다음에 cosign keyless 서명 step 추가(`id-token: write`) | +| BUILD-계획-C | 권고 | 컨테이너 이미지 서명 | 완료 | Wave 3 W3-P27 (Wave 3 라운드 3 커밋): 결정 31, `09e739d6`: `release.yml` `app-image-signing` job — 공식 cosign v3.1.3 `cosign_checksums.txt`(Sigstore 번들 검증)의 sha256으로 고정한 바이너리 설치, `app-image-release`가 넘긴 digest를 keyless 서명 후 이 workflow·tag identity로 검증, `id-token: write`는 이 job만. `DeveloperExperienceContractTest`가 구조 고정. 실제 서명은 tag 실행에서만 가능(로컬 미검증) | - | release.yml의 push 다음에 cosign keyless 서명 step 추가(`id-token: write`) | | BUILD-O3-1 | 권고 | O3: 기능 검사를 소유 leaf 테스트로(notification·messaging·mongo·graphql) | 완료 | build-tools id 6개 삭제(`src/build-tools/build.gradle`에 jpa-evidence·config-contract·jpa-qualification만 남음). leaf 테스트 추가(`6d27356e`): `NotificationEvidenceVerifierTest`, `NotificationEnvironmentRegistryTest`, `MessagingEvidenceSchemaValidatorTest`, `MongoTestLaneContractTest`, `GraphQlProductionClassesTest`. 읽는 파일은 `test` inputs로 선언됨. 실행 단계 문제는 B4-27·28·30 | - | - | | BUILD-O3-2 | 권고 | O3: JPA evidence manifest(`ca.jpa-evidence`, `ca.jpa-qualification`) 폐기, leaf 테스트로 | 완료 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): build-tools `jpa/`·`junit/`, `ca.jpa-evidence`·`ca.jpa-qualification` 삭제. readiness 카드 검사 → `JpaReadinessRegistryTest`(persistence-jpa `test`, 입력 `readiness-cards.yaml`·`src/postgresqlIntegrationTest/java` 선언). `everyImplementedCardNamesTasksThisLeafDeclares` FAIL(삭제된 `verifyJpaPrimaryFoundationEvidence`를 가리키던 카드, AssertionError at :106) → 카드를 `integrationTestLaneCheck`로 고쳐 PASS. 카드가 인용한 scenario는 readiness 레인의 `requires` + `rejectSkipped`로(manifest가 JUnit XML로 확인하던 것). `jpaReleaseQualification`은 leaf 집계 태스크(registry의 blocking gate를 dependsOn). workflow: `jpa-r2-evidence.yml`, integration-main `jpa-candidate-evidence` 삭제 | - | 두 플러그인과 `junit` 패키지를 삭제하고, readiness/release registry 검사만 persistence-jpa 테스트(inputs 선언)로 옮김. workflow의 evidence task 호출도 정리 | | BUILD-O3-3 | 권고 | O3: verifyEnvKeys 위치 | 완료 | 소유자 결정은 bootstrap에 유지. 현재 `src/app-bootstrap/build.gradle:5`(`ca.config-contract`), `src/build.gradle:75-79`→mainCheck | - | - | | BUILD-O3-4 | 권고 | O3: redis topology lane을 strict lane으로 흡수 | 완료 | 소유자 결정은 유지. `src/build-logic/src/main/java/dev/caskeleton/buildlogic/redis/` 유지, `.github/workflows/redis-sdk-topology.yml` 경로 필터 PR | - | - | -| BUILD-O3-5 | 권고 | O3: build-logic에는 코어·컨벤션·레인 하나만 남김(인벤토리 #11·#18·#19·#20·#31) | 남음 | 남은 비핵심 플러그인(main+test 줄 수): publicpath 288+37, archive 216+46, release 138+71, bootstrap(developer-bootstrap·bootrun-dotenv) 328+203, auxiliary 151+145. leaf 버전은 아직 SHA 버전(`src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java:36-39`)
Wave 3 W3-P16: 미완 — 완료: public-path → app-bootstrap `PublicPathSnapshotTest`(main 단계 레인 `publicPathSnapshotTest`, 루트 별칭 `verifyPublicPathSnapshot`, 승인 `-PapprovePublicPathChange`; 기준선은 헤더의 명령만 바뀜), developer-bootstrap → `scripts/bootstrap-local.sh`, leaf version에서 revision 제거 후 archive-hygiene 삭제, app-bootstrap `springBoot.buildInfo`(`build.revision`, `time` 제외). 남음: (1) `ca.release-provenance` 플러그인 제거 — `src/optional-platforms/build.gradle`이 적용하고 있어 이번 Wave에서 건드리지 않기로 한 gRPC build 파일 수정이 필요, (2) auxiliary → `jvm-test-suite` — grpc·messaging 포함 14개 leaf build 파일을 바꾸는 작업이라 동시 묶음과 충돌. 둘 다 다음 순차 작업으로 | W3 | public-path는 app-bootstrap approval test로, release-provenance는 `springBoot { buildInfo() }`로 바꾸고, leaf 버전 고정 후 archive-hygiene 삭제. developer-bootstrap은 `scripts/`로, auxiliary는 `jvm-test-suite`로 | +| BUILD-O3-5 | 권고 | O3: build-logic에는 코어·컨벤션·레인 하나만 남김(인벤토리 #11·#18·#19·#20·#31) | 남음 | 남은 비핵심 플러그인(main+test 줄 수): publicpath 288+37, archive 216+46, release 138+71, bootstrap(developer-bootstrap·bootrun-dotenv) 328+203, auxiliary 151+145. leaf 버전은 아직 SHA 버전(`src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java:36-39`)
Wave 3 W3-P16: 미완 — 완료: public-path → app-bootstrap `PublicPathSnapshotTest`(main 단계 레인 `publicPathSnapshotTest`, 루트 별칭 `verifyPublicPathSnapshot`, 승인 `-PapprovePublicPathChange`; 기준선은 헤더의 명령만 바뀜), developer-bootstrap → `scripts/bootstrap-local.sh`, leaf version에서 revision 제거 후 archive-hygiene 삭제, app-bootstrap `springBoot.buildInfo`(`build.revision`, `time` 제외). 남음: (1) `ca.release-provenance` 플러그인 제거 — `src/optional-platforms/build.gradle`이 적용하고 있어 이번 Wave에서 건드리지 않기로 한 gRPC build 파일 수정이 필요, (2) auxiliary → `jvm-test-suite` — grpc·messaging 포함 14개 leaf build 파일을 바꾸는 작업이라 동시 묶음과 충돌. 둘 다 다음 순차 작업으로
Wave 3 W3-P27: 미완 — 완료분: `302ba915` `ca.release-provenance` 제거(leaf version·sourceRevision은 `ca.java-conventions`의 `JavaConventionsPlugin.sourceRevision`, 루트 `verifyReleaseProvenance`는 같은 함수를 부르는 build.gradle 태스크, TestKit 테스트는 `PlatformModuleConventionTest`로). 남은 것: auxiliary 레인 → `jvm-test-suite`(중단된 WIP 패치) | W3 | public-path는 app-bootstrap approval test로, release-provenance는 `springBoot { buildInfo() }`로 바꾸고, leaf 버전 고정 후 archive-hygiene 삭제. developer-bootstrap은 `scripts/`로, auxiliary는 `jvm-test-suite`로 | | BUILD-O3-6 | 권고 | O3: build-tools를 비움 | 완료 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): `config` 패키지를 `dev.caskeleton.buildlogic.config`로 이동(테스트 2개 포함), `includeBuild('build-tools')`·Dockerfile `COPY build-tools/`·build-logic.yml step 삭제, `src/build-tools` 삭제. 태스크는 `:app-bootstrap:verifyEnvKeys` 그대로(PASS) | - | JPA 폐기 후 `ConfigContractPlugin`을 build-logic으로 옮기고 `includeBuild('build-tools')` 삭제. task는 계속 `:app-bootstrap:verifyEnvKeys` | | BUILD-바로할것-1b | Nit | runtime-membership 삭제 후 남은 주석 문구 | 남음 | `src/sample-portfolio/build.gradle:175`, `.github/workflows/ci-quality-gates.yml:55` "runtime-membership policy" | W5 | 두 주석에서 해당 문구 삭제 | | BUILD-바로할것-4 | 권고 | `ca.strict-qualification`을 `strictTestLanes` requires + rejectSkipped로 (= O-8) | 완료 | `strictQualification` grep 0건, id 없음. 예: `src/app-bootstrap/build.gradle:61-68` 레인 `requires`+`rejectSkipped` | - | - | @@ -693,7 +693,7 @@ Wave 3 라운드 1 결과로 받은 4건(2026-09-28, desktop): | 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 정리에 포함 | 해당 없음(코드 삭제) | Wave 3 W3-P18 (Wave 3 라운드 2 커밋): **삭제:** legacy seam producer(`KafkaSenderAutoConfiguration`·`KafkaSender`·`LegacyKafkaMessagingRootAutoConfiguration`)를 `6268c494`에서 지웠다.
**남은 producer:** platform 하나다. `KafkaSecurityConfigurer`로 TLS/SASL을 적용한다: `src/messaging/messaging-spring-boot-starter-kafka/src/main/java/dev/caskeleton/messaging/autoconfigure/KafkaMessagingAutoConfiguration.java:188` `config.putAll(producerSecurity(...))`, `:216`.
**같은 결함 없음:** `MessagingSecuredBrokerQualificationTest`가 PASS다 — `aPublishIsConfirmedByAPrivateCaBrokerThatRequiresSaslAsTheProviderUser`, `aPublishIsConfirmedByAPrivateCaBrokerThatRequiresAClientCertificate`, `:messaging:messaging-spring-boot-starter:integrationTest` 3/3. | - | 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 여러 벌 → 하나로 | 남음 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): 완료: JPA readiness·evidence → persistence-jpa 테스트(manifest 폐기), API surface 구현 하나. 남은 "messaging 카드 검증은 messaging leaf로": `MessagingCapabilityRegistryContractTest`는 `config/messaging/*.yaml`을 snakeyaml로 읽는데 `adapter:outbound:messaging`은 모든 configuration(테스트 포함)에서 YAML·Jackson 2를 exclude+reject한다("Jackson 3 only and YAML-free"). 옮기려면 카드 파일을 JSON으로 바꾸거나 test 설정만 예외로 둘지 정해야 함. 승인자: 저장소 소유자 결정 필요
결정 29·31(2026-09-28): 보류 해제 → 남음, 빌드 잔여 묶음 P27 | W3 | 결정(2026-09-25): O3 — JPA readiness·evidence는 persistence-jpa 테스트로(manifest 폐기), messaging 카드 검증은 messaging leaf로 | +| X1-지도-readiness / evidence / API-surface / moduleboundary | 권고 | 카드 스키마·검증기·API-surface gate·moduleboundary 여러 벌 → 하나로 | 완료 | Wave 3 W3-P27 (Wave 3 라운드 3 커밋): JPA readiness·evidence → persistence-jpa 테스트(P16), API surface 구현 하나(P16), messaging 카드 검증 → messaging leaf 테스트(`09d9189d`) | - | 결정(2026-09-25): O3 — JPA readiness·evidence는 persistence-jpa 테스트로(manifest 폐기), messaging 카드 검증은 messaging leaf로 | | X1-지도-테스트 fake / contract kit | 권고 | 같은 포트 fake가 모듈마다 따로 → 포트 소유 leaf testFixtures에 contract kit | 남음 | `TransactionPort` fake 21 → 10, kit 4개(DurableOperation·OutboxLeaseFencing·GrpcOperationLedger·sample WorkLogRepository) | W4 | X1-#3a~#3d | | 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 후 삭제 | 완료 | Wave 3 W3-P18 (Wave 3 라운드 2 커밋): **소비자 4곳 이전:** `SubmitDurableOperationUseCase`(`src/application-core/src/main/java/dev/caskeleton/application/operation/SubmitDurableOperationUseCase.java:72`, 계약 `DurableOperationSubmittedContract`)와 sample 3곳이 `OutboxAppendPort`를 쓴다.
**encoder:** 템플릿 encoder `JsonIntegrationEventEncoder`(`src/adapter/outbound/support/src/main/java/dev/caskeleton/adapter/outbound/support/messaging/JsonIntegrationEventEncoder.java:47`)와 `IntegrationEventEncoderAutoConfiguration`.
**테스트:** `JsonIntegrationEventEncoderTest`, `IntegrationEventEncoderAutoConfigurationTest`, `DurableOperationSubmissionOutboxIntegrationTest`(실제 encoder) PASS. | - | 결정(2026-09-25): canonical 통일(S1-#2b와 같은 작업) | @@ -719,7 +719,7 @@ Wave 3 라운드 1 결과로 받은 4건(2026-09-28, desktop): | 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) | 완료 | 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 — 리뷰 권고 "미사용분 삭제" 적용 대상 | 해당 없음(코드 삭제) | Wave 3 W3-P25 (Wave 3 라운드 2 커밋): `d54909c4`: `shared/opstore/` 3개 삭제 | - | `shared-contract/src/main/java/dev/caskeleton/shared/opstore/` 3개 삭제, `docs/capability-status.md` 제거 표에 한 줄 | -| X1-#7a | Required | readiness 카드 스키마 3개·검증기 3개, family별 evidence plugin | 남음 | Wave 3 W3-P16 (Wave 3 라운드 1 커밋): 위 행과 같은 작업. JPA 검증기는 leaf 테스트로 옮김, messaging 검증기 이동은 같은 사유로 결정 필요. 승인자: 저장소 소유자 결정 필요
결정 29·31(2026-09-28): 보류 해제 → 남음, 빌드 잔여 묶음 P27 | W3 | 결정(2026-09-25): O3 방향(X1-지도-readiness와 같은 작업) | +| X1-#7a | Required | readiness 카드 스키마 3개·검증기 3개, family별 evidence plugin | 완료 | Wave 3 W3-P27 (Wave 3 라운드 3 커밋): 결정 29, `09d9189d`: `MessagingCapabilityRegistryContractTest`를 app-bootstrap에서 `adapter:outbound:messaging` 테스트로(Jackson 3), snakeyaml은 test* configuration에서만 허용(main exclude·reject 유지), test inputs = `config/messaging` 전체. JPA 쪽은 P16(`de075afe`)에서 완료 | - | 결정(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` | - | - | @@ -1183,7 +1183,7 @@ Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검 | ORCH-new-1 | 발견 | `messaging-policy` `MessagingAdmissionControllerTest.aWaitingCallerIsAdmittedOnceAPermitIsReturned`가 에이전트 4개 부하 중 실패, 단독 재실행 통과(타이밍 의존). | 남음 | desktop 기준선 `check`(2026-09-28, `016597ac`) | W4 | 대기 확인을 sleep/시간이 아닌 결정적 신호로 | | P15-new-1 | 발견 | web `GlobalExceptionHandler`에 일반 `ApiErrorCarrier` 분기가 없어 adopter carrier가 `INTERNAL_ERROR` 500으로 나갔다. | 완료 | Wave 3 P15: `GlobalExceptionHandler.java:151` `handleCarrier` | - | - | | P15-new-2 | 발견 | GraphQL body-limit 필터가 mapper를 거치지 않고 하드코딩 JSON(`REQUEST_ERROR`)을 썼다. | 완료 | Wave 3 P15: `PAYLOAD_TOO_LARGE` + 공용 문구 + `retryable:false` | - | - | -| P15-new-3 | 발견 | `OperationalError.INTERNAL_ERROR`가 레지스트리에서 `retryable: true` — SCHEMA_MISMATCH·DATA_CORRUPTION 같은 결정적 내부 실패도 재시도를 권한다. | 남음 | Wave 3 P15 결과 파일 | W3 | 결정 28: `INTERNAL_ERROR` retryable=false. 빌드 잔여 묶음 P27 | +| P15-new-3 | 발견 | `OperationalError.INTERNAL_ERROR`가 레지스트리에서 `retryable: true` — SCHEMA_MISMATCH·DATA_CORRUPTION 같은 결정적 내부 실패도 재시도를 권한다. | 완료 | Wave 3 W3-P27 (Wave 3 라운드 3 커밋): 결정 28, `7e7d0a59`: `OperationalError.INTERNAL_ERROR` retryable=false — 레지스트리·shared-contract README·web 기대값 함께. INTERNAL category 코드는 모두 retryable=false | - | 결정 28: `INTERNAL_ERROR` retryable=false. 빌드 잔여 묶음 P27 | | P15-new-4 | 발견 | gRPC status description이 코드 문자열에서 한국어 공용 문구로 바뀜(결정 11) — description을 코드로 파싱하던 클라이언트는 `error-code` trailer를 봐야 한다. | 남음 | Wave 3 P15 결과 파일 | W5 | 이행 안내를 gRPC adapter README·에러 계약 문서에 | | P26-new-1 | 발견 | Dynamic Target 호출이 deadline 검사와 admission permit을 거치지 않았다(만료 deadline에도 hop 전송). | 완료 | Wave 3 P26: `CallSetup` 공유, 재현 테스트 FAIL→PASS | - | - | | P26-new-2 | 발견 | prod의 schema 변경 `ddl-auto` 거부가 문서의 `PROFILE_MISMATCH`가 아니라 `IllegalStateException`이었다. | 완료 | Wave 3 P26: 검사 하나로 합치며 수정 | - | - | @@ -1193,7 +1193,7 @@ Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검 | P16-new-3 | 발견 | sample `PublishPosterImageUseCase.handle`이 `UUID.randomUUID()`로 attempt id 생성(ArchUnit 밖이라 안 보였음). | 완료 | Wave 3 P16: `ids.allocate()`, sample을 ArchUnit 대상에 포함 | - | - | | P16-new-4 | 발견 | `S3AsyncResponseBodyBridgeTest.oversizedSdkChunkFailsClosed` 간헐 실패(소비 스레드와 chunk 크기 검사 경합). | 완료 | Wave 3 P24 (라운드 2 커밋): P24-new-1 — bridge 순서 경합(결과 게시 전 source 무효화, 취소 전 원인 기록) 수정, bridge 테스트 40회 반복 통과 | - | P14-new-2와 함께 결정적 테스트로 | | P16-new-5 | 발견 | S1-#16 나머지: `NotificationIdGeneratorPort`·`UploadIdentifierFactory`를 domain `IdFactory` 기반으로. | 남음 | Wave 3 P16 결과 파일 | W3 | 3-D(P19) | -| P16-new-6 | 발견 | persistence-fileserver 공개 타입의 adopter import를 보는 검사가 없어짐(예전 정규식 테스트가 접두어 전체를 봤음). | 남음 | Wave 3 P16 결과 파일 | W3 | persistence-fileserver에 `ca.api-surface` 적용 — 빌드 잔여 묶음 | +| P16-new-6 | 발견 | persistence-fileserver 공개 타입의 adopter import를 보는 검사가 없어짐(예전 정규식 테스트가 접두어 전체를 봤음). | 완료 | Wave 3 W3-P27 (Wave 3 라운드 3 커밋): `976c175f`: persistence-fileserver에 `ca.api-surface`, 공개 타입 24개 기준선과 adopter 목록(`FileserverSchemaActivation`) 승인 — 목록에서 빼면 composition import로 `verifyPersistenceFileserverApiSurface` 실패 | - | persistence-fileserver에 `ca.api-surface` 적용 — 빌드 잔여 묶음 | | P16-new-7 | 발견 | `docs/study/postgresql-jpa-walkthrough.ko.md` §15.6 등이 삭제된 JPA evidence manifest를 설명. | 남음 | Wave 3 P16 결과 파일 | W5 | 결정 6: 현재 코드 기준으로 갱신 | | P24-new-1 | 발견 | S3 응답 bridge가 source 무효화 전에 결과를 게시하고, 실패 원인 기록 전에 취소해 테스트가 간헐 실패(P14-new-2·P16-new-4의 원인). | 완료 | Wave 3 P24: 순서 수정, bridge 테스트 40회 반복 통과 | - | - | | P24-new-2 | 발견 | legacy upload 삭제 뒤 `PosterEventPublisher.publishImageAttached`·`PosterImageAttached` 호출자 0. | 남음 | Wave 3 P24 결과 파일 | W3 | P18 통합 뒤 삭제(같은 파일) | @@ -1208,3 +1208,4 @@ Wave 1–2 구현 묶음(`P1`–`P13`)이 작업 중 찾은 결함과 통합 검 | P23-new-2 | 발견 | profile마다 만드는 SES SDK client를 닫지 않는다(기동 때 한 번이라 유한). | 남음 | Wave 3 P23 결과 파일 | W3 | provider 종료 시 close. P28 | | P23-new-3 | 발견 | `app-bootstrap/build.gradle` 알림 선택 줄 주석이 persistence-jpa 줄을 함께 풀라고 함(composition이 직접 가져옴). | 완료 | Wave 3 라운드 3 통합: 주석 수정 | - | - | | ORCH-new-2 | 발견 | `NotificationPayloadAtRestContractTest`가 저장소 소스·migration을 읽지만 test inputs를 선언하지 않아(`notification/build.gradle:98`이 필요 없다고 주장) 파일이 옮겨져도 up-to-date로 건너뜀. P23 worktree에서 통과, main 통합에서 실패(옛 `persistence-jpa` 경로·`build/` 경합 walk). | 남음 | 경로와 walk 범위는 통합 때 수정(`src/main/java`만) | W4 | 읽는 파일을 test `inputs`로 선언(CLAUDE.md build-logic 규칙) | +| ORCH-new-3 | 발견 | `web-advanced` `WebStreamingSoakIT.concurrent arrivals never exceed the node's ceiling`가 부하 중 `expected: 1000 but was: 1001`로 실패, 단독 3회 통과 — 상한을 1 넘는 실제 경합일 수 있다. | 남음 | Wave 3 라운드 3 P27 통합 `ci`(2026-09-29) | W2 | 재현(반복·부하)으로 경합 여부 판정, 경합이면 admission 카운터 수정. P19 | diff --git a/src/README.md b/src/README.md index d4d0f743..2f7dbfc9 100644 --- a/src/README.md +++ b/src/README.md @@ -60,8 +60,9 @@ env 계약이고 `src/.env`는 로컬 실행 입력입니다. `verifyEnvKeys`는 `META-INF/build-info.properties`(`build.revision`)에 남깁니다. 예전에는 version이 `..+`라 커밋마다 새 jar 이름이 생겼고 그 잔여물을 `ca.archive-hygiene`이 치웠는데, 둘 다 없앴습니다(리뷰 BUILD-O3-5). -- `releaseCheck`가 실행하는 `verifyReleaseProvenance`는 source revision이 없으면 실패하므로 추적 - 불가능한 산출물을 release로 취급할 수 없습니다. +- `releaseCheck`가 실행하는 `verifyReleaseProvenance`(루트 `build.gradle`, revision 판정은 + `ca.java-conventions`와 같은 함수)는 source revision이 없으면 실패하므로 추적 불가능한 산출물을 + release로 취급할 수 없습니다. 예전 `ca.release-provenance` 플러그인은 없앴습니다(리뷰 BUILD-O3-5). - 모든 subproject가 `lockAllConfigurations()` + `LockMode.STRICT`를 사용하고, lock state는 Gradle 기본 `/gradle.lockfile`에 둡니다. 이 경로는 Renovate Gradle manager 기본 인식 경로와 같습니다. diff --git a/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/envelope/EnvelopeMetaIntegrationTest.java b/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/envelope/EnvelopeMetaIntegrationTest.java index 363d4eda..a1fa9546 100644 --- a/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/envelope/EnvelopeMetaIntegrationTest.java +++ b/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/envelope/EnvelopeMetaIntegrationTest.java @@ -54,7 +54,7 @@ class EnvelopeMetaIntegrationTest { .andExpect(jsonPath("$.success").value(false)) .andExpect(jsonPath("$.error.category").value("INTERNAL")) .andExpect(jsonPath("$.error.message").value(ClientErrorMessages.OPAQUE)) - .andExpect(jsonPath("$.error.retryable").value(true)) + .andExpect(jsonPath("$.error.retryable").value(false)) .andExpect(jsonPath("$.meta.traceId").isNotEmpty()); } diff --git a/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/error/GlobalExceptionHandlerTest.java b/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/error/GlobalExceptionHandlerTest.java index 025da762..1642cd72 100644 --- a/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/error/GlobalExceptionHandlerTest.java +++ b/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/error/GlobalExceptionHandlerTest.java @@ -333,7 +333,7 @@ class GlobalExceptionHandlerTest { } @Test - void internalErrorIsRetryableAndHidesMessage() { + void internalErrorIsNotRetryableAndHidesMessage() { ResponseEntity> response = handler.handleUnknown( new RuntimeException("boom"), @@ -341,7 +341,7 @@ class GlobalExceptionHandlerTest { assertThat(response.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); assertThat(response.getBody()).isNotNull(); - assertThat(response.getBody().error().retryable()).isTrue(); + assertThat(response.getBody().error().retryable()).isFalse(); assertThat(response.getBody().error().message()).isEqualTo(ClientErrorMessages.OPAQUE); } diff --git a/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/observability/RetryAfterAdvisorTest.java b/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/observability/RetryAfterAdvisorTest.java index 9d8bfb0c..2d6ce109 100644 --- a/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/observability/RetryAfterAdvisorTest.java +++ b/src/adapter/inbound/web/src/test/java/dev/caskeleton/adapter/inbound/web/observability/RetryAfterAdvisorTest.java @@ -14,9 +14,15 @@ class RetryAfterAdvisorTest { @Test void retryableCodeAdvisesRetryAfter() { - // INTERNAL_ERROR is retryable per-code; the seam keys off retryable(), the + // DB_UNAVAILABLE is retryable per-code; the seam keys off retryable(), the // owner branch decides the concrete seconds + 429/503 specifics. - assertThat(RetryAfterAdvisor.shouldAdvise(OperationalError.INTERNAL_ERROR)).isTrue(); + assertThat(RetryAfterAdvisor.shouldAdvise(OperationalError.DB_UNAVAILABLE)).isTrue(); + } + + @Test + void internalErrorAdvisesNoRetryAfter() { + // decision 28: an unclassified failure is not retryable; transient ones have their own codes. + assertThat(RetryAfterAdvisor.shouldAdvise(OperationalError.INTERNAL_ERROR)).isFalse(); } @Test diff --git a/src/adapter/outbound/messaging/CLAUDE.md b/src/adapter/outbound/messaging/CLAUDE.md index f7f0bba6..5bd7540d 100644 --- a/src/adapter/outbound/messaging/CLAUDE.md +++ b/src/adapter/outbound/messaging/CLAUDE.md @@ -37,8 +37,9 @@ Package root: `dev.caskeleton.adapter.outbound.messaging`. `adapter:outbound:support`, not here: a use case encodes before it appends, in compositions that may not carry this module. The R1 contract/binding compilers and JSON Schema envelope encoder were removed on 2026-09-25 (see `docs/capability-status.md`). -- No JSON Schema engine (NetworkNT) here. The evidence manifest schema check moved to build-tools - (`VerifyMessagingEvidenceTask`). +- No JSON Schema engine (NetworkNT) on the main classpath. The evidence manifest schema check and the + capability card check (`config/messaging`) are this leaf's tests (`evidence/`); snakeyaml is + test-only (owner decision 29). - Do not hide use-case sequencing or business routing policy in broker adapters. - `OutboxMessagePublishAdapter` is delegate-only and emits no dependency log. The confirmed FAILED/DEAD transition owns the one canonical ERROR. diff --git a/src/adapter/outbound/messaging/build.gradle b/src/adapter/outbound/messaging/build.gradle index a1fa876e..c5cc2ed0 100644 --- a/src/adapter/outbound/messaging/build.gradle +++ b/src/adapter/outbound/messaging/build.gradle @@ -16,28 +16,47 @@ dependencies { // Test-only: MessagingEvidenceSchemaValidatorTest holds the common evidence schema to Draft 2020-12. testImplementation libs.json.schema.validator + // Test-only (owner decision 29): MessagingCapabilityRegistryContractTest reads the capability + // cards in config/messaging/*.yaml. The rules below keep snakeyaml out of every main + // configuration; only the `test*` ones may resolve it. + testImplementation 'org.yaml:snakeyaml' } -configurations.configureEach { +// A `test*` configuration may carry snakeyaml; nothing else may. The exclude goes on resolvable and +// consumable configurations only, never on the `implementation`/`runtimeOnly` buckets: the test +// classpaths extend those, and an exclude there would reach them too. +boolean yamlAllowedIn(Configuration configuration) { + configuration.name.startsWith('test') +} + +configurations.configureEach { configuration -> exclude group: 'tools.jackson.dataformat', module: 'jackson-dataformat-yaml' - exclude group: 'org.yaml', module: 'snakeyaml' exclude group: 'org.snakeyaml', module: 'snakeyaml-engine' + if (!yamlAllowedIn(configuration) && (configuration.canBeResolved || configuration.canBeConsumed)) { + exclude group: 'org.yaml', module: 'snakeyaml' + } } // The messaging runtime is Jackson 3 only and YAML-free. The excludes above remove the YAML parsers // the graph carries today (Spring Boot's snakeyaml included); this rule fails resolution if anything -// brings Jackson 2 or any YAML module back. A `rejectAll()` constraint would not: Spring's dependency -// management overrides the version it rejects. -configurations.configureEach { +// brings Jackson 2 or any YAML module back — in a test configuration, any YAML module other than +// snakeyaml itself. A `rejectAll()` constraint would not: Spring's dependency management overrides +// the version it rejects. +configurations.configureEach { configuration -> + boolean snakeyamlAllowed = yamlAllowedIn(configuration) resolutionStrategy.componentSelection.all { selection -> String id = selection.candidate.group + ':' + selection.candidate.module + if (snakeyamlAllowed && id == 'org.yaml:snakeyaml') { + return + } if (id ==~ /(?i).*yaml.*/ || id ==~ /com\.fasterxml\.jackson\.core:jackson-(core|databind)/) { selection.reject('the messaging runtime is Jackson 3 only and YAML-free') } } } +// The card check reads the whole config/messaging tree (cards, profiles, the evidence schema). tasks.named('test') { - inputs.file(rootProject.file('config/messaging/evidence/build-evidence-manifest-v1.schema.json')) + inputs.dir(rootProject.file('config/messaging')) .withPathSensitivity(PathSensitivity.RELATIVE) } diff --git a/src/adapter/outbound/messaging/gradle.lockfile b/src/adapter/outbound/messaging/gradle.lockfile index de2704ed..d5e49531 100644 --- a/src/adapter/outbound/messaging/gradle.lockfile +++ b/src/adapter/outbound/messaging/gradle.lockfile @@ -146,6 +146,7 @@ org.springframework:spring-web:7.0.9=testCompileClasspath,testRuntimeClasspath org.springframework:spring-webmvc:7.0.9=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=checkstyle,spotbugs org.xmlunit:xmlunit-core:2.10.4=testCompileClasspath,testRuntimeClasspath +org.yaml:snakeyaml:2.5=testCompileClasspath,testRuntimeClasspath tools.jackson.core:jackson-core:3.1.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath tools.jackson.core:jackson-databind:3.1.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath tools.jackson:jackson-bom:3.1.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/messaging/MessagingCapabilityRegistryContractTest.java b/src/adapter/outbound/messaging/src/test/java/dev/caskeleton/adapter/outbound/messaging/evidence/MessagingCapabilityRegistryContractTest.java similarity index 96% rename from src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/messaging/MessagingCapabilityRegistryContractTest.java rename to src/adapter/outbound/messaging/src/test/java/dev/caskeleton/adapter/outbound/messaging/evidence/MessagingCapabilityRegistryContractTest.java index d36b4035..97b5c182 100644 --- a/src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/messaging/MessagingCapabilityRegistryContractTest.java +++ b/src/adapter/outbound/messaging/src/test/java/dev/caskeleton/adapter/outbound/messaging/evidence/MessagingCapabilityRegistryContractTest.java @@ -1,10 +1,8 @@ -package dev.caskeleton.bootstrap.contract.messaging; +package dev.caskeleton.adapter.outbound.messaging.evidence; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; @@ -21,7 +19,17 @@ import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.error.YAMLException; +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.json.JsonMapper; +/** + * The messaging capability cards under {@code config/messaging} (readiness cards, compatibility and + * release profiles, the common evidence manifest schema) stay closed and fail-safe. + * + *

Owner decision 29: the card check lives in this leaf's tests, and snakeyaml is on this leaf's + * test classpath only — main stays YAML-free (build.gradle). The files it reads are declared as + * {@code test} inputs so a card edit re-runs it. + */ class MessagingCapabilityRegistryContractTest { private static final Set FIRST_TUPLE_CARD_IDS = @@ -254,7 +262,7 @@ class MessagingCapabilityRegistryContractTest { void commonEvidenceSchemaIsPayloadFreeAndKeepsAllFailClosedFields() throws Exception { Path schema = requiredConfig("evidence/build-evidence-manifest-v1.schema.json"); Map root = - new ObjectMapper().readValue(schema.toFile(), new TypeReference>() {}); + new JsonMapper().readValue(schema.toFile(), new TypeReference>() {}); assertThat(root.get("$schema")).isEqualTo("https://json-schema.org/draft/2020-12/schema"); assertThat(root).containsEntry("type", "object").containsEntry("additionalProperties", false); @@ -387,8 +395,7 @@ class MessagingCapabilityRegistryContractTest { private static Map readJsonSchema() throws Exception { Path schema = requiredConfig("evidence/build-evidence-manifest-v1.schema.json"); - return new ObjectMapper() - .readValue(schema.toFile(), new TypeReference>() {}); + return new JsonMapper().readValue(schema.toFile(), new TypeReference>() {}); } @SuppressWarnings("unchecked") diff --git a/src/adapter/outbound/persistence-fileserver/build.gradle b/src/adapter/outbound/persistence-fileserver/build.gradle index 7c6cf1f6..89e027c9 100644 --- a/src/adapter/outbound/persistence-fileserver/build.gradle +++ b/src/adapter/outbound/persistence-fileserver/build.gradle @@ -1,5 +1,6 @@ plugins { id 'ca.spring-library' + id 'ca.api-surface' } // The Fileserver capability's relational persistence. @@ -23,3 +24,22 @@ dependencies { implementation 'org.springframework:spring-jdbc' implementation 'org.springframework:spring-context' } + +// Every public type here is reachable from any leaf that puts this jar on its classpath; the one +// other production source that imports it is the fileserver composition. The regex scan that used +// to watch `…outbound.persistence.` imports went with JpaAdopterApiSurfaceTest and covered nothing +// here after the extraction (review P16-new-6). +apiSurface { + label = 'PersistenceFileserver' + baseline = rootProject.file('../docs/architecture/persistence-fileserver-api-surface.txt') + description = 'Fileserver persistence leaf public API surface — every public top-level type in src/main/java.' + rationale = [ + 'Entities, Spring Data repositories and store adapters are implementation;', + 'the adopter baseline lists the subset other leaves\' production code may import.', + ] + adopterBaseline = rootProject.file('../docs/architecture/persistence-fileserver-adopter-api-surface.txt') + adopterSources = fileTree(rootProject.projectDir) { + include '*/**/src/main/java/**/*.java' + exclude '**/build/**', 'adapter/outbound/persistence-fileserver/**', 'build-logic/**', 'optional-platforms/**' + } +} diff --git a/src/app-bootstrap/README.md b/src/app-bootstrap/README.md index a5128b66..a8815dc5 100644 --- a/src/app-bootstrap/README.md +++ b/src/app-bootstrap/README.md @@ -432,10 +432,9 @@ app-bootstrap 은 합성 루트라 "왜 이 의존성이, 왜 이 scope 로" 결 BOM 이 관리. - **`spring-security-test`** — `@WithMockUser`로 actuator 보안 인가(permit-all 프로브 / 인증 필요한 링크 / 노출 안 한 loggers)를 검증한다. -- **`snakeyaml`** — `config/messaging/*.yaml`의 first polling-producer tuple, closed maturity, - wildcard-free compatibility, evidence task/scenario/runbook 선언을 - `MessagingCapabilityRegistryContractTest`가 읽어 검증한다. 이 레지스트리는 런타임 설정이 아니며 - 모든 card가 `not-implemented`인 동안 R2나 release-ready를 뜻하지 않는다. +- **`snakeyaml`** — `docs/registries/*.yaml` 같은 checked-in YAML 레지스트리를 contract 테스트가 + 읽는다. `config/messaging/*.yaml` 카드 검증(`MessagingCapabilityRegistryContractTest`)은 소유자 + 결정 29로 `adapter:outbound:messaging` 테스트로 옮겼다. ### Messaging qualification scaffold diff --git a/src/app-bootstrap/build.gradle b/src/app-bootstrap/build.gradle index 4b08eb28..d2d91f34 100644 --- a/src/app-bootstrap/build.gradle +++ b/src/app-bootstrap/build.gradle @@ -250,7 +250,7 @@ dependencies { testImplementation libs.archunit.junit5 // test-only: jackson-databind for the deserialization-policy boundary test. See README. testImplementation 'org.springframework.boot:spring-boot-starter-json' - // test-only: parses checked-in Messaging capability registries for the fail-closed drift gate. + // test-only: parses the checked-in YAML registries (error codes and the like) in contract tests. testImplementation 'org.yaml:snakeyaml' // test-only: ArchUnit violation fixtures intentionally import forbidden types. See README. testCompileOnly 'org.springframework:spring-tx' @@ -342,7 +342,7 @@ springBoot { buildInfo { excludes = ['time'] properties { - additional = ['revision': rootProject.releaseProvenance.sourceRevision] + additional = ['revision': project.sourceRevision] // set by ca.java-conventions } } } diff --git a/src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java b/src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java index 5ab35d84..129fb127 100644 --- a/src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java +++ b/src/app-bootstrap/src/test/java/dev/caskeleton/bootstrap/contract/DeveloperExperienceContractTest.java @@ -284,6 +284,48 @@ class DeveloperExperienceContractTest { "./gradlew :app-bootstrap:test --tests 'dev.caskeleton.bootstrap.architecture.*'"); } + @Test + @DisplayName("릴리스 이미지는 서명 job 하나만 OIDC 토큰을 받아 digest를 keyless 서명하고 검증한다") + void onlyTheSigningJobHoldsAnOidcTokenAndItSignsAndVerifiesTheDigest() throws IOException { + // given + Map workflow = parseYamlMap(read(".github/workflows/release.yml")); + Map jobs = requireMap(workflow, "jobs"); + + // when + List jobsWithIdToken = + jobs.entrySet().stream() + .filter( + job -> + job.getValue() instanceof Map body + && body.get("permissions") instanceof Map permissions + && permissions.containsKey("id-token")) + .map(job -> String.valueOf(job.getKey())) + .toList(); + + // then + assertThat(requireMap(workflow, "permissions").containsKey("id-token")).isFalse(); + assertThat(jobsWithIdToken).containsExactly("app-image-signing"); + Map signing = requireMap(jobs, "app-image-signing"); + assertThat(requireMap(signing, "permissions").get("id-token")).isEqualTo("write"); + assertThat(requireStringList(signing, "needs")).containsExactly("app-image-release"); + String script = + String.join( + "\n", + requireList(signing, "steps").stream() + .map(Map.class::cast) + .map(step -> String.valueOf(step.get("run"))) + .toList()); + assertThat(script) + .contains("cosign_checksums.txt") + .contains("sha256sum -c -") + .contains("cosign sign --yes") + .contains("cosign verify") + .contains("--certificate-oidc-issuer https://token.actions.githubusercontent.com"); + assertThat(requireList(signing, "steps")) + .as("the signing job installs a checksum-pinned binary, not a third-party action") + .noneMatch(step -> step instanceof Map map && map.containsKey("uses")); + } + @Test void everyOptionalPlatformIntegrationLaneHasAnExecutingWorkflowCaller() throws IOException { // `grpc-operation-ledger-jpa` declares a Testcontainers PostgreSQL lane that certifies the diff --git a/src/build-logic/README.md b/src/build-logic/README.md index 5cb13bff..a7ca7e3b 100644 --- a/src/build-logic/README.md +++ b/src/build-logic/README.md @@ -11,7 +11,7 @@ capability, and the files it reads are declared as that test task's inputs. | --- | --- | | `ca.architecture-registry` (settings) | project inclusion, directory mapping, and the parsed registry every other reader shares | | `ca.architecture` | `verifyCleanArchitectureDependencies` (per-module direction), `verifyApplicationCoreDependencyPurity` (domain-core, shared-contract, application-*), `verifyNoIgnoredSourcePackages`, `architectureCheck` | -| `ca.java-conventions` | Java toolchain/compiler baseline, dependency locking, the Mockito test agent, the per-leaf `mainCheck` lifecycle | +| `ca.java-conventions` | Java toolchain/compiler baseline, dependency locking, the Mockito test agent, the per-leaf `mainCheck` lifecycle, the leaf version (release version only) and `sourceRevision` (`JavaConventionsPlugin.sourceRevision`, also what the root `verifyReleaseProvenance` checks) | | `ca.quality-conventions` | Spotless, Checkstyle, Error Prone, SpotBugs/FindSecBugs wiring shared by Java leaves | | `ca.java-library` / `ca.spring-library` / `ca.spring-config` | leaf-level composition of the Java/quality conventions for plain and Spring libraries | | `ca.platform-module` / `ca.grpc-platform-module` | what a vendored platform leaf (`messaging:*`, `grpc:*`, `grpc-advanced:*`) is: `java-library`, plus the gRPC BOM for the leaves that had it | @@ -19,7 +19,6 @@ capability, and the files it reads are declared as that test task's inputs. | `ca.redis-topology-lane` | the Redis topology lane (mode selection, `-P` property validation, per-mode required classes) the redis-sdk-topology workflow drives | | `ca.auxiliary-source-set` | extra test source sets | | `ca.api-surface` | read-only public API surface verification with a separate update task, wired into the leaf's `check` (owner decision 20); optionally holds other leaves' imports to a reviewed adopter subset (`adopterBaseline`) | -| `ca.release-provenance` | release version and revision (`verifyReleaseProvenance`); leaf versions carry the release version only | | `ca.config-contract` | app-bootstrap's `verifyEnvKeys` (moved from the deleted build-tools included build; owner decision 4 keeps the task in app-bootstrap) | | `ca.bootrun-dotenv` | `bootRun`'s `.env` | diff --git a/src/build-logic/build.gradle b/src/build-logic/build.gradle index 2acc0e31..49d64267 100644 --- a/src/build-logic/build.gradle +++ b/src/build-logic/build.gradle @@ -39,10 +39,6 @@ gradlePlugin { id = 'ca.auxiliary-source-set' implementationClass = 'dev.caskeleton.buildlogic.auxiliary.AuxiliarySourceSetPlugin' } - releaseProvenance { - id = 'ca.release-provenance' - implementationClass = 'dev.caskeleton.buildlogic.release.ReleaseProvenancePlugin' - } apiSurface { id = 'ca.api-surface' implementationClass = 'dev.caskeleton.buildlogic.apisurface.ApiSurfacePlugin' diff --git a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java b/src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java index 898fdf95..79667132 100644 --- a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java +++ b/src/build-logic/src/main/java/dev/caskeleton/buildlogic/java/JavaConventionsPlugin.java @@ -1,15 +1,17 @@ package dev.caskeleton.buildlogic.java; -import dev.caskeleton.buildlogic.release.ReleaseProvenanceExtension; import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension; import java.util.ArrayList; import java.util.List; +import java.util.Locale; +import org.gradle.api.GradleException; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.VersionCatalogsExtension; import org.gradle.api.artifacts.dsl.LockMode; import org.gradle.api.plugins.JavaPluginExtension; +import org.gradle.api.provider.ProviderFactory; import org.gradle.api.tasks.bundling.AbstractArchiveTask; import org.gradle.api.tasks.bundling.Jar; import org.gradle.api.tasks.compile.JavaCompile; @@ -20,6 +22,26 @@ public final class JavaConventionsPlugin implements Plugin { private static final List COMPILER_ARGS = List.of("-parameters", "-Werror", "-Xlint:deprecation", "-Xlint:unchecked"); + /** What {@link #sourceRevision} returns when the build was given no commit id. */ + public static final String UNKNOWN_REVISION = "unknown"; + + /** + * The commit this build names: {@code -PgitRevision}, {@code GIT_SHA} or {@code GITHUB_SHA}, cut + * to twelve lowercase hex characters, or {@link #UNKNOWN_REVISION} when none of them is a commit + * id. The root {@code verifyReleaseProvenance} fails on the latter. + */ + public static String sourceRevision(ProviderFactory providers) { + String declared = + providers + .gradleProperty("gitRevision") + .orElse(providers.environmentVariable("GIT_SHA")) + .orElse(providers.environmentVariable("GITHUB_SHA")) + .getOrElse(""); + return declared.matches("(?i)[0-9a-f]{7,40}") + ? declared.toLowerCase(Locale.ROOT).substring(0, Math.min(12, declared.length())) + : UNKNOWN_REVISION; + } + @Override public void apply(Project project) { project.getPluginManager().apply("java"); @@ -33,17 +55,27 @@ public final class JavaConventionsPlugin implements Plugin { String springBootVersion = catalog.findVersion("springBoot").orElseThrow().getRequiredVersion(); project.setGroup("dev.caskeleton"); - ReleaseProvenanceExtension provenance = - project.getRootProject().getExtensions().findByType(ReleaseProvenanceExtension.class); + ProviderFactory providers = project.getProviders(); + String releaseVersion = + providers + .gradleProperty("releaseVersion") + .orElse(providers.environmentVariable("RELEASE_VERSION")) + .getOrElse("0.0.1"); + if (!releaseVersion.matches("\\d+\\.\\d+\\.\\d+")) { + throw new GradleException( + "releaseVersion must be MAJOR.MINOR.PATCH without a leading 'v', pre-release or build" + + " metadata; got '" + + releaseVersion + + "'."); + } // The release version alone, never the revision: a revision in the version put a new jar name in // every leaf's build/libs on every commit, which is what the deleted archive-hygiene plugin // existed to clean up (review BUILD-O3-5). The revision stays in each jar's manifest - // (Build-Revision) and in app-bootstrap's build-info.properties. - project.setVersion( - provenance == null - ? "0.0.1-SNAPSHOT" - : provenance.getReleaseVersion() + (provenance.isComplete() ? "" : "-SNAPSHOT")); - String buildRevision = provenance == null ? "unknown" : provenance.getSourceRevision(); + // (Build-Revision) and in app-bootstrap's build-info.properties, which reads the `sourceRevision` + // extra property set here. This replaced the root `ca.release-provenance` plugin. + String buildRevision = sourceRevision(providers); + project.setVersion(releaseVersion + (buildRevision.equals(UNKNOWN_REVISION) ? "-SNAPSHOT" : "")); + project.getExtensions().getExtraProperties().set("sourceRevision", buildRevision); JavaPluginExtension javaExtension = project.getExtensions().getByType(JavaPluginExtension.class); javaExtension.getToolchain().getLanguageVersion().set(JavaLanguageVersion.of(21)); diff --git a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenance.java b/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenance.java deleted file mode 100644 index f50aeb0f..00000000 --- a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenance.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.caskeleton.buildlogic.release; - -import java.util.Objects; - -public record ReleaseProvenance( - String releaseVersion, - String sourceRevision, - String traceableVersion, - boolean complete) { - public ReleaseProvenance { - Objects.requireNonNull(releaseVersion, "releaseVersion"); - Objects.requireNonNull(sourceRevision, "sourceRevision"); - Objects.requireNonNull(traceableVersion, "traceableVersion"); - } -} diff --git a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenanceExtension.java b/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenanceExtension.java deleted file mode 100644 index b0ffd84d..00000000 --- a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenanceExtension.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.caskeleton.buildlogic.release; - -import java.util.Objects; - -public class ReleaseProvenanceExtension { - private final ReleaseProvenance value; - - public ReleaseProvenanceExtension(ReleaseProvenance value) { - this.value = Objects.requireNonNull(value, "value"); - } - - public ReleaseProvenance getValue() { - return value; - } - - public String getReleaseVersion() { - return value.releaseVersion(); - } - - public String getSourceRevision() { - return value.sourceRevision(); - } - - public String getTraceableVersion() { - return value.traceableVersion(); - } - - public boolean isComplete() { - return value.complete(); - } -} diff --git a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenancePlugin.java b/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenancePlugin.java deleted file mode 100644 index fed72770..00000000 --- a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/ReleaseProvenancePlugin.java +++ /dev/null @@ -1,65 +0,0 @@ -package dev.caskeleton.buildlogic.release; - -import java.util.Locale; -import org.gradle.api.GradleException; -import org.gradle.api.Plugin; -import org.gradle.api.Project; - -public final class ReleaseProvenancePlugin implements Plugin { - @Override - public void apply(Project project) { - String releaseVersion = - project - .getProviders() - .gradleProperty("releaseVersion") - .orElse(project.getProviders().environmentVariable("RELEASE_VERSION")) - .getOrElse("0.0.1"); - if (!releaseVersion.matches("\\d+\\.\\d+\\.\\d+")) { - throw new GradleException( - "releaseVersion must be MAJOR.MINOR.PATCH without a leading 'v', pre-release, or build metadata; got '" - + releaseVersion - + "'."); - } - - String declaredRevision = - project - .getProviders() - .gradleProperty("gitRevision") - .orElse(project.getProviders().environmentVariable("GIT_SHA")) - .orElse(project.getProviders().environmentVariable("GITHUB_SHA")) - .getOrElse(""); - boolean traceable = declaredRevision.matches("(?i)[0-9a-f]{7,40}"); - String sourceRevision = - traceable - ? declaredRevision.toLowerCase(Locale.ROOT).substring(0, Math.min(12, declaredRevision.length())) - : "unknown"; - String traceableVersion = - traceable ? releaseVersion + "+" + sourceRevision : releaseVersion + "-SNAPSHOT"; - ReleaseProvenance provenance = - new ReleaseProvenance(releaseVersion, sourceRevision, traceableVersion, traceable); - - project - .getExtensions() - .create("releaseProvenance", ReleaseProvenanceExtension.class, provenance); - // Temporary compatibility bridge while remaining conventions move to the typed extension. - project.getExtensions().getExtraProperties().set("releaseVersion", releaseVersion); - project.getExtensions().getExtraProperties().set("sourceRevision", sourceRevision); - project.getExtensions().getExtraProperties().set("traceableVersion", traceableVersion); - project.getExtensions().getExtraProperties().set("releaseProvenanceComplete", traceable); - project.setVersion(traceableVersion); - - project - .getTasks() - .register( - "verifyReleaseProvenance", - VerifyReleaseProvenanceTask.class, - task -> { - task.setGroup("verification"); - task.setDescription( - "Fails when the build cannot name the source revision it was produced from."); - task.getComplete().set(traceable); - task.getTraceableVersion().set(traceableVersion); - task.getOutputs().upToDateWhen(ignored -> false); - }); - } -} diff --git a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/VerifyReleaseProvenanceTask.java b/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/VerifyReleaseProvenanceTask.java deleted file mode 100644 index 8d1da40a..00000000 --- a/src/build-logic/src/main/java/dev/caskeleton/buildlogic/release/VerifyReleaseProvenanceTask.java +++ /dev/null @@ -1,27 +0,0 @@ -package dev.caskeleton.buildlogic.release; - -import org.gradle.api.DefaultTask; -import org.gradle.api.GradleException; -import org.gradle.api.provider.Property; -import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.TaskAction; -import org.gradle.work.DisableCachingByDefault; - -@DisableCachingByDefault(because = "Verification task has no reusable outputs") -public abstract class VerifyReleaseProvenanceTask extends DefaultTask { - @Input - public abstract Property getComplete(); - - @Input - public abstract Property getTraceableVersion(); - - @TaskAction - public void verifyProvenance() { - if (!getComplete().get()) { - throw new GradleException( - "verifyReleaseProvenance: no source revision. A release archive has to name the commit " - + "that produced it; supply -PgitRevision=, GIT_SHA or GITHUB_SHA."); - } - getLogger().lifecycle("verifyReleaseProvenance: OK — {}", getTraceableVersion().get()); - } -} diff --git a/src/build-logic/src/test/java/dev/caskeleton/buildlogic/convention/PlatformModuleConventionTest.java b/src/build-logic/src/test/java/dev/caskeleton/buildlogic/convention/PlatformModuleConventionTest.java index ad134057..5be623ae 100644 --- a/src/build-logic/src/test/java/dev/caskeleton/buildlogic/convention/PlatformModuleConventionTest.java +++ b/src/build-logic/src/test/java/dev/caskeleton/buildlogic/convention/PlatformModuleConventionTest.java @@ -39,6 +39,66 @@ class PlatformModuleConventionTest { assertTrue(result.getOutput().contains("api-configuration-present=true"), result.getOutput()); } + @Test + void aLeafCarriesTheReleaseVersionAndNamesTheRevisionSeparately() throws Exception { + // given + buildFile( + """ + plugins { id 'ca.platform-module' } + tasks.register('reportRelease') { + String version = project.version.toString() + String revision = project.sourceRevision + doLast { logger.lifecycle("version=" + version + " revision=" + revision) } + } + """); + + // when + BuildResult result = + runner( + "reportRelease", + "-PreleaseVersion=1.2.3", + "-PgitRevision=0123456789ABCDEF0123456789abcdef01234567") + .build(); + + // then + assertTrue( + result.getOutput().contains("version=1.2.3 revision=0123456789ab"), result.getOutput()); + } + + @Test + void aLeafWithoutACommitIdIsASnapshotOfAnUnknownRevision() throws Exception { + // given + buildFile( + """ + plugins { id 'ca.platform-module' } + tasks.register('reportRelease') { + String version = project.version.toString() + String revision = project.sourceRevision + doLast { logger.lifecycle("version=" + version + " revision=" + revision) } + } + """); + + // when + BuildResult result = runner("reportRelease", "-PgitRevision=not-a-commit").build(); + + // then + assertTrue( + result.getOutput().contains("version=0.0.1-SNAPSHOT revision=unknown"), result.getOutput()); + } + + @Test + void aReleaseVersionWithASuffixIsRefused() throws Exception { + // given + buildFile("plugins { id 'ca.platform-module' }\n"); + + // when + BuildResult result = runner("tasks", "-PreleaseVersion=v1.2.3-rc1").buildAndFail(); + + // then + assertTrue( + result.getOutput().contains("releaseVersion must be MAJOR.MINOR.PATCH"), result.getOutput()); + } + @Test void grpcConventionImportsBom() throws Exception { buildFile( diff --git a/src/build-logic/src/test/java/dev/caskeleton/buildlogic/release/ReleaseProvenanceConventionTest.java b/src/build-logic/src/test/java/dev/caskeleton/buildlogic/release/ReleaseProvenanceConventionTest.java deleted file mode 100644 index 050f1b42..00000000 --- a/src/build-logic/src/test/java/dev/caskeleton/buildlogic/release/ReleaseProvenanceConventionTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package dev.caskeleton.buildlogic.release; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.nio.file.Files; -import java.nio.file.Path; -import org.gradle.testkit.runner.BuildResult; -import org.gradle.testkit.runner.GradleRunner; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -class ReleaseProvenanceConventionTest { - @TempDir Path projectDir; - - @BeforeEach - void setUp() throws Exception { - Files.writeString(projectDir.resolve("settings.gradle"), "rootProject.name='fixture'\n"); - Files.writeString( - projectDir.resolve("build.gradle"), - """ - plugins { id 'ca.release-provenance' } - tasks.register('reportRelease') { - doLast { - logger.lifecycle("release-version=${releaseProvenance.releaseVersion}") - logger.lifecycle("source-revision=${releaseProvenance.sourceRevision}") - logger.lifecycle("traceable-version=${releaseProvenance.traceableVersion}") - logger.lifecycle("release-complete=${releaseProvenance.complete}") - logger.lifecycle("project-version=${project.version}") - } - } - """); - } - - @Test - void missingRevisionConfiguresAsSnapshotButReleaseGateFails() { - BuildResult configured = runner("reportRelease", "--console=plain").build(); - assertTrue(configured.getOutput().contains("release-version=0.0.1")); - assertTrue(configured.getOutput().contains("source-revision=unknown")); - assertTrue(configured.getOutput().contains("traceable-version=0.0.1-SNAPSHOT")); - assertTrue(configured.getOutput().contains("release-complete=false")); - assertTrue(configured.getOutput().contains("project-version=0.0.1-SNAPSHOT")); - - BuildResult failed = runner("verifyReleaseProvenance", "--console=plain").buildAndFail(); - assertTrue(failed.getOutput().contains("verifyReleaseProvenance: no source revision")); - } - - @Test - void attestedRevisionProducesTraceableVersionAndPassesReleaseGate() { - BuildResult result = - runner( - "reportRelease", - "verifyReleaseProvenance", - "-PreleaseVersion=1.2.3", - "-PgitRevision=0123456789abcdef0123456789abcdef01234567", - "--console=plain") - .build(); - assertTrue(result.getOutput().contains("source-revision=0123456789ab")); - assertTrue(result.getOutput().contains("traceable-version=1.2.3+0123456789ab")); - assertTrue(result.getOutput().contains("release-complete=true")); - assertTrue(result.getOutput().contains("project-version=1.2.3+0123456789ab")); - assertTrue(result.getOutput().contains("verifyReleaseProvenance: OK")); - } - - private GradleRunner runner(String... args) { - return GradleRunner.create() - .withProjectDir(projectDir.toFile()) - .withPluginClasspath() - .withArguments(args); - } -} diff --git a/src/build.gradle b/src/build.gradle index 2fa9ba58..47114ede 100644 --- a/src/build.gradle +++ b/src/build.gradle @@ -11,20 +11,35 @@ plugins { // JMH benchmarks in three leaves (`./gradlew ::jmh`); never part of a gate. alias(libs.plugins.jmh) apply false - // Convention plugins from the included build, applied to the ROOT because the rules they own are - // about the repository: the architecture gates and the release version/revision. The public-path + // Convention plugin from the included build, applied to the ROOT because the rules it owns are + // about the repository: the architecture gates. The release version/revision is each leaf's + // `ca.java-conventions` (ca.release-provenance was removed, BUILD-O3-5). The public-path // baseline is app-bootstrap's approval test, the local start-up is scripts/bootstrap-local.sh, // and archive hygiene is gone with the revision it cleaned out of every leaf's jar name (review // 2026-09-24 BUILD-O3-5). - id 'ca.release-provenance' id 'ca.architecture' } -// feature-build-release-supply-chain-contract D1/D9 — release provenance/version semantics live in -// ca.release-provenance so they can be tested in a minimal TestKit fixture instead of configuring -// this entire repository. The root still owns the repository group; the convention owns version. group = 'dev.caskeleton' +// A release archive has to name the commit that produced it. The revision rule is the one every +// leaf's version uses (JavaConventionsPlugin.sourceRevision, tested in build-logic), read here so +// the tag-only gate and the jars cannot disagree about what counts as a commit id. +tasks.register('verifyReleaseProvenance') { + group = 'verification' + description = 'Fails when the build cannot name the source revision it was produced from.' + String revision = dev.caskeleton.buildlogic.java.JavaConventionsPlugin.sourceRevision(providers) + boolean traceable = revision != dev.caskeleton.buildlogic.java.JavaConventionsPlugin.UNKNOWN_REVISION + outputs.upToDateWhen { false } + doLast { task -> + if (!traceable) { + throw new GradleException('verifyReleaseProvenance: no source revision. A release archive has to name the ' + + 'commit that produced it; supply -PgitRevision=, GIT_SHA or GITHUB_SHA.') + } + task.logger.lifecycle("verifyReleaseProvenance: OK — revision ${revision}") + } +} + // One explicit command regenerates every module's Gradle-default lockfile. tasks.register('resolveAndLockAll') { group = 'build setup' diff --git a/src/optional-platforms/build.gradle b/src/optional-platforms/build.gradle index e91af3c5..59808a93 100644 --- a/src/optional-platforms/build.gradle +++ b/src/optional-platforms/build.gradle @@ -1,16 +1,10 @@ plugins { id 'ca.architecture' - // Without it every gRPC leaf's jar is versioned 0.0.1-SNAPSHOT, because JavaConventionsPlugin - // falls back to that when the root has no ReleaseProvenanceExtension — so one commit produced - // two artifact sets under two different version schemes, and only one of them could be traced - // back to a revision. - id 'ca.release-provenance' } -ext.sourceRevision = providers.gradleProperty('gitRevision') - .orElse(providers.environmentVariable('GIT_SHA')) - .orElse(providers.environmentVariable('GITHUB_SHA')) - .getOrElse('unknown') +// No `ca.release-provenance` any more: each gRPC leaf's `ca.java-conventions` derives its version +// and `sourceRevision` from the same -PreleaseVersion/-PgitRevision (GIT_SHA, GITHUB_SHA) inputs the +// main build reads, so one commit produces one version scheme in both builds (review BUILD-O3-5). tasks.register('resolveAndLockAll') { group = 'build setup' diff --git a/src/shared-contract/README.md b/src/shared-contract/README.md index 244bcd2e..3da4fec4 100644 --- a/src/shared-contract/README.md +++ b/src/shared-contract/README.md @@ -86,6 +86,10 @@ Spring/Lettuce 타입을 노출하지 않는다. - **출처/SSOT:** 모든 코드의 status/category/`retryable` 값은 레지스트리 `docs/registries/error-codes.yaml` 를 그대로 미러링한다. 코드 추가/변경은 레지스트리가 먼저다. +- **`INTERNAL_ERROR` 는 `retryable=false`(소유자 결정 28).** 분류되지 않은 실패에는 스키마 불일치· + 데이터 손상처럼 다시 해도 풀리지 않는 결정적 실패가 섞여 있다. 일시적 실패는 전용 코드 + (`DB_UNAVAILABLE`, `DEPENDENCY_*`, `JOB_TIMEOUT`, `OUTBOX_PUBLISH_FAILED` 등)가 `retryable=true` 를 + 가진다. **전송 형태(transport-shape) 코드의 분류 — 프로젝트 선택** - `METHOD_NOT_ALLOWED`(405), `UNSUPPORTED_MEDIA_TYPE`(415), `NOT_ACCEPTABLE`(406), @@ -107,8 +111,7 @@ Spring/Lettuce 타입을 노출하지 않는다. - `AUTH_JWKS_UNAVAILABLE` 은 JWKS 엔드포인트 장애 = 일시적 의존성 실패 → 503, retryable. - `INTERNAL_AUTH_MISCONFIGURATION` 은 `retryable=false`: 보호돼야 할 엔드포인트가 public 으로 새어 나가는 것은 **배포 시점 설정 버그**이지 일시적 장애가 아니다. 같은 요청을 다시 보내도 (재배포 - 전까지) 절대 풀리지 않으므로, "INTERNAL 은 retryable" 이라는 일반 휴리스틱에서 의도적으로 벗어나 - false 로 둔다. + 전까지) 절대 풀리지 않으므로 false 다(`INTERNAL` category 코드는 모두 `retryable=false`). **rate-limit / idempotency** - `RATE_LIMIT_EXCEEDED` 는 `retryable=true` 이며 Retry-After 헤더와 짝을 이룬다. diff --git a/src/shared-contract/src/main/java/dev/caskeleton/shared/error/OperationalError.java b/src/shared-contract/src/main/java/dev/caskeleton/shared/error/OperationalError.java index 66e15de1..b6c359d3 100644 --- a/src/shared-contract/src/main/java/dev/caskeleton/shared/error/OperationalError.java +++ b/src/shared-contract/src/main/java/dev/caskeleton/shared/error/OperationalError.java @@ -16,7 +16,7 @@ public enum OperationalError implements ApiErrorCode { BAD_PARAMETER(Category.VALIDATION, 400, false), MAPPING_FAILED(Category.VALIDATION, 400, false), BATCH_PARTIAL_FAILURE(Category.VALIDATION, 200, false), - INTERNAL_ERROR(Category.INTERNAL, 500, true), + INTERNAL_ERROR(Category.INTERNAL, 500, false), // security — coarse fallbacks for non-filter paths UNAUTHENTICATED(Category.AUTH, 401, false), INVALID_TOKEN(Category.AUTH, 401, false), diff --git a/src/shared-contract/src/test/java/dev/caskeleton/shared/error/OperationalErrorTest.java b/src/shared-contract/src/test/java/dev/caskeleton/shared/error/OperationalErrorTest.java index a971083e..a1c15667 100644 --- a/src/shared-contract/src/test/java/dev/caskeleton/shared/error/OperationalErrorTest.java +++ b/src/shared-contract/src/test/java/dev/caskeleton/shared/error/OperationalErrorTest.java @@ -20,9 +20,11 @@ class OperationalErrorTest { } @Test - void internalErrorIs500Retryable() { + void internalErrorIsANonRetryable500() { + // decision 28: an unclassified failure may be deterministic (schema mismatch, corrupt data); + // transient failures carry their own retryable code. assertThat(OperationalError.INTERNAL_ERROR.httpStatus()).isEqualTo(500); - assertThat(OperationalError.INTERNAL_ERROR.retryable()).isTrue(); + assertThat(OperationalError.INTERNAL_ERROR.retryable()).isFalse(); } @Test @@ -107,22 +109,17 @@ class OperationalErrorTest { } @Test - void internalCategoryCodesAreRetryable() { - // Claim 5: a *transient* INTERNAL failure is a server-side fault the same input may - // clear on retry. INTERNAL_AUTH_MISCONFIGURATION is the documented exception: a - // protected endpoint leaking through as public is a deploy-time config bug, not a - // transient fault — the same request keeps hitting the misconfiguration until a - // redeploy, so retrying never helps (registry SSOT pins it retryable=false). + void internalCategoryCodesAreNeverRetryable() { + // Decision 28: an INTERNAL code names a failure nobody classified, and an unclassified failure + // may be deterministic (schema mismatch, corrupt data) — retrying it is a busy loop. A + // transient + // failure has its own code (DB_UNAVAILABLE, DEPENDENCY_*, JOB_TIMEOUT, OUTBOX_PUBLISH_FAILED …) + // in a TRANSIENT_DEPENDENCY/CONFLICT category, and that code carries retryable=true. for (OperationalError e : OperationalError.values()) { - if (e.category() == Category.INTERNAL - && e != OperationalError.INTERNAL_AUTH_MISCONFIGURATION - && e != OperationalError.ADAPTER_DISABLED - && e != OperationalError.OUTBOX_DEAD_LETTER - && e != OperationalError.JOB_DEAD_LETTER - && e != OperationalError.JVM_OOM) { + if (e.category() == Category.INTERNAL) { assertThat(e.retryable()) - .as("%s is a transient INTERNAL fault and must be retryable=true (C5)", e.name()) - .isTrue(); + .as("%s is an INTERNAL code → retryable=false", e.name()) + .isFalse(); } } assertThat(OperationalError.INTERNAL_AUTH_MISCONFIGURATION.retryable())