--- kind: CONCEPT slug: messaging-admin-api-c06 title: 실행 코드가 없어서 동시성 계약이 전부 문서다 topic: state-machines-and-ownership project: clean-architecture-backend-template status: 게시 전 sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 rootTreeNode: concept:messaging-admin-api-c06 evidenceCapturedOn: 2026-09-01 assets: - key: messaging-admin-api-c06 file: ../../../final/evidence/rendered/messaging-admin-api-c06.svg - key: messaging-admin-api-c06-diagram file: ../../../final/assets/diagrams/messaging-admin-api-c06.svg evidence: - ../../../final/evidence/raw/messaging-admin-api-c06.txt source: - 원본 분석 절은 final/document.md#a19-messaging-admin-api#L588 이다. module: messaging-admin-api --- # 실행 코드가 없어서 동시성 계약이 전부 문서다 이 리프에 실행 코드가 없으므로 동시성 계약은 전부 인터페이스 문서로 표현되어 있고, 강제는 구현 리프의 몫이다. ## 본문 이 리프에 실행 코드가 없으므로 동시성 계약은 전부 **인터페이스 문서로 표현**되어 있고, 강제는 구현 리프의 몫이다. ## 타입이 지는 것과 구현이 지는 것 :::evidence key="messaging-admin-api-c06-diagram" alt="리프 경계 안에 불변 타입과 펜싱 토큰 하한이 들어 있고 오래된 토큰 거절이 경계 밖 점선 상자로 놓인 구조" caption="타입이 지는 것과 구현이 지는 것" zoom="false" ::: 펜싱 토큰의 하한이 타입으로 강제된다. `begin`/`checkpoint` 의 javadoc 이 각각 던져야 할 조건을 명시한다 — `begin` 은 "already completed, or another runtime holds a live lease", `checkpoint` 는 "the lease has been taken over by a newer token". 즉 **오래된 토큰의 쓰기를 거절하는 것이 구현 의무**로 문서화되어 있다. ## DestructiveOperationGuard 참조 위치 :::evidence key="messaging-admin-api-c06" alt="코드베이스에서 DestructiveOperationGuard 를 검색한 출력 19줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="DestructiveOperationGuard 코드베이스 검색 — 19줄 · exit 0" zoom="true" ::: ## 공유해도 안전한 이유와 수명주기 훅 이 리프의 모든 타입은 record 이거나 불변 final 클래스다. `DestructiveOperationGuard` 는 `final boolean` 하나만 갖고, `HmacApprovalVerifier` 는 키를 clone 해 보관한다. 수명주기 훅은 없다 — `MessagingAdminDurabilityValidator`(스타터, `InitializingBean`)가 유일한 기동 시점 훅이며 이 리프 밖이다.