Files
document-haness/docs/clean-architecture-backend-template/final/evidence/raw/328-grpc-boundary-rules-never-see-real-source.txt
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

76 lines
4.8 KiB
Plaintext

# 주제: gRPC 경계 규칙 두 개가 완성되어 있고 테스트되며, 실제 저장소 소스를 한 번도 보지 않는다
# revision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
# severity: P2
# ---- 선언 ----
# grpc-server/build.gradle:2-3
# "Server boundary: the ArchUnit-shaped application boundary rules, the typed service adapter SPI,
# the interceptor order contract, and the Netty server/executor/admission profiles."
# src/grpc/CLAUDE.md:93
# "…이고 GrpcApplicationBoundaryRules·GrpcRawApiImportRule·GrpcServiceAdapter가 그 경계를…"
# ---- 두 규칙의 실체 ----
# GrpcApplicationBoundaryRules (92줄)
# violations(String adapterName, Set<String> referencedTypes) -> List<String>
# forbiddenTypes() -> Set<String> (java.sql.Connection, javax.sql.DataSource, ...)
# 금지 대상: 퍼시스턴스·메시징·HTTP 직접 참조, 인바운드→아웃바운드 어댑터 참조
#
# GrpcRawApiImportRule (108줄)
# RAW_API_TYPES 14종: io.grpc.ManagedChannelBuilder, ManagedChannel, ServerBuilder, Server,
# ClientCall, ClientCalls, MethodDescriptor, CallCredentials,
# io.grpc.netty[.shaded].NettyChannelBuilder/NettyServerBuilder,
# io.grpc.inprocess.InProcessChannelBuilder/InProcessServerBuilder
# Pattern IMPORT = "^\s*import\s+(?:static\s+)?([\w.]+)\s*;" <- **소스 파일을 스캔하도록 만들어졌다**
# Pattern PACKAGE = ...
# 패키지 허용목록을 받아 플랫폼·생성코드는 통과시킨다
# javadoc:9-16 "Every one of them bypasses a Stable guarantee: a hand-built ManagedChannel has no
# named profile, no deadline policy and no credential rotation; a hand-built
# ClientCall skips the interceptor chain entirely."
# ---- 측정: 실제 소스를 넘기는 호출부가 없다 ----
# command: git grep -n "GrpcRawApiImportRule|GrpcApplicationBoundaryRules|GrpcServiceAdapterMarker" -- src
# (자기 패키지 파일 제외)
# src/grpc/CLAUDE.md:93 <- 문서 언급 1건. 그게 전부다.
# => 프로덕션 호출부 0, 테스트 호출부도 자기 테스트뿐.
#
# GrpcApplicationBoundaryRulesTest (142줄)가 넘기는 것:
# violations("DocumentServiceAdapter",
# Set.of("dev.caskeleton.application.document.CreateDocumentUseCase",
# "jakarta.persistence.EntityManager",
# "org.springframework.data.jpa.repository.JpaRepository",
# "org.apache.kafka.clients.producer.KafkaProducer",
# "java.net.http.HttpClient"))
# => "DocumentServiceAdapter" 는 저장소에 존재하지 않는 이름이고,
# 참조 집합은 손으로 쓴 문자열이다. 실제 파일을 읽지 않는다.
#
# GrpcRawApiImportRule 은 IMPORT/PACKAGE 정규식을 갖는 **소스 스캐너**인데,
# 어떤 파일 경로도 이 클래스에 전달되지 않는다.
# ---- 대조: 이 저장소에는 실제로 소스를 보는 경계 테스트가 있다 ----
# src/adapter/outbound/persistence-jpa/src/test/.../JpaModuleBoundaryTest.java
# javadoc:26 "verifyCleanArchitectureDependencies does not cover this. It governs edges *between*…"
# src/app-bootstrap/src/test/.../MongoRegistryPermissionParityTest.java
# javadoc:22 "verifyCleanArchitectureDependencies checks that the edges Gradle resolved are a subset…"
# => 같은 저장소가 "Gradle 게이트가 못 보는 것을 테스트가 본다" 는 패턴을 이미 갖고 있다.
# gRPC 쪽 두 규칙은 그 패턴의 재료만 있고 적용이 없다.
# ---- 판정 ----
# 규칙 엔진이 완성되어 있고(200줄), 테스트되며(142줄), **입력이 없다.**
# 저장소의 어떤 소스 파일도 이 규칙을 통과한 적이 없다.
# grpc 블록 전체가 배포되지 않으므로(EVD-325) 현재 실제 피해는 없다.
# 그러나 이 규칙들의 목적은 "애플리케이션 코드가 raw API 를 쓰지 못하게" 인데,
# 그 애플리케이션 코드가 생기는 시점에 규칙이 자동으로 적용되지는 않는다.
# ---- 부수: server/client 주요 타입 도달성 ----
GrpcAdmissionController 다른리프=3 src/main생성=1
GrpcServiceAdapter 다른리프=1 src/main생성=0
GrpcServerProfile 다른리프=1 src/main생성=1
GrpcServerInterceptorChain 다른리프=0 src/main생성=1
GrpcTypedStubFactory 다른리프=0 src/main생성=1
GrpcNettyVariantSelector 다른리프=0 src/main생성=0
GrpcChannelRuntimeRegistry 다른리프=0 src/main생성=0
GrpcClientMetadataPolicy 다른리프=0 src/main생성=0
GrpcStubPolicyApplier 다른리프=0 src/main생성=0
# => grpc-policy 와 같은 패턴: 경계/프로필 타입은 다른 리프가 참조하고,
# 런타임 조정자(채널 레지스트리, 메타데이터 정책, 스텁 정책 적용기)는 자기 테스트에서만 산다.