fix(build-logic): registry 행의 build 칸을 거절하고 남은 두 빌드 문장을 고친다

구조 리뷰(arch-reviewer, 이 브랜치)가 찾은 권고 다섯을 고친다.

1. ModuleRegistry가 행의 `build` 칸을 아직 읽었다. 두 번째 빌드가 없어진
   뒤로 main이 아닌 값(오타 포함)을 적은 leaf는 settings가 include하지
   않고, 방향 검사도, 등록 안 된 build 스크립트 검사도 보지 않는데 ci는
   초록으로 남는다(08-05가 막으려던 모양). 칸이 있으면(빈 값 포함) read에서
   그 id와 'build'를 이름 대고 실패한다.
2. gates.md·defect-patterns.md의 「두 빌드의 verifyStrictLaneStages」.
3. shared-contract AGENTS.md의 「optional gRPC 빌드는 자기 사본을 둔다」를
   별도 repo 라이브러리로.
4. QualityConventionsPlugin 주석의 현재형 「optional-platforms 빌드가 같은
   제외 파일을 읽는다」를 이력으로.
5. StrictLaneStagesExtension 주석의 optional-build 경로에 그 빌드가 옮겨
   갔다는 말을 붙였다.

버린 대안: `build` 칸과 modulesForBuild를 통째로 지우기. settings 설치기와
ArchitecturePlugin의 시그니처까지 바뀌고, 막는 효과는 같다.

검증(desktop ~/x2-template-wt, --no-build-cache):
- RED: 새 시험 aBuildFieldIsRejected… 고치기 전 실패(9 tests, 1 failed)
- GREEN: ModuleRegistryTest 통과. 옛 blankBuildOwnershipIsRefused는 새
  문구로 바꿨다(빈 값도 같은 이유로 거절)
- -p build-logic check javadoc rc=0(172 tests), :ci :verifyDependencyLocks
  rc=0(7389 tests, 실패 0), verifyStrictLaneStages --dry-run, check-docs,
  check-work-docs(--links 포함), check-repo-layout 모두 rc=0
This commit is contained in:
DongHyeonka
2026-11-08 13:49:48 +09:00
parent 91804ec182
commit 57988c2e48
7 changed files with 36 additions and 16 deletions
+1 -1
View File
@@ -51,7 +51,7 @@
- **모양**: 어떤 단계도 돌리지 않는 lane·검사, 캐시가 옛 결과로 통과, 실패를 막지 못하는 workflow 명령을 실행으로 셈, 시간 단언을 끈 채 돈 performance lane.
- **막는 기준**: [gates.md](gates.md) 6절. 게이트 장치를 바꾸면 일부러 망가뜨린 입력으로 실패하는 것을 본다.
- **장치**: `verifyStrictLaneStages --dry-run`(두 빌드), lane 정책 값의 캐시 입력 선언, `testQualityCheck`, 성능 lane 단언 강제(strict lane convention이 `performance.assertions.enabled=true`를 넣고 다른 값·skip은 실패). 캐시에서 가져온 결과는 현재 통과의 증거가 아니다(필요하면 `--rerun`).
- **장치**: `verifyStrictLaneStages --dry-run`, lane 정책 값의 캐시 입력 선언, `testQualityCheck`, 성능 lane 단언 강제(strict lane convention이 `performance.assertions.enabled=true`를 넣고 다른 값·skip은 실패). 캐시에서 가져온 결과는 현재 통과의 증거가 아니다(필요하면 `--rerun`).
### A8. 로그로 새는 입력값·원인
+1 -1
View File
@@ -51,7 +51,7 @@
| 파일·폴더·Gradle 프로젝트를 지우거나 옮김 | `python3 scripts/check-docs.py`(문서가 가리키던 경로가 사라진다) |
| `docs/work/`, 루트 `AGENTS.md`·`CLAUDE.md`, `src/**/AGENTS.md`, `.claude/` 아래 문서 | `python3 scripts/check-work-docs.py` |
| 다른 매뉴얼에서 이력 ID를 걷어냄 | `python3 scripts/check-work-docs.py --history <파일 또는 폴더>` |
| build-logic·workflow | `-p build-logic check javadoc`, 두 빌드의 `verifyStrictLaneStages --dry-run` |
| build-logic·workflow | `-p build-logic check javadoc`, `verifyStrictLaneStages --dry-run` |
| 패키지 규칙, 생성 명령 템플릿 | `verifyFeatureScaffold`(`mainCheck` 안) |
| 마이그레이션 | persistence-jpa `check`, 잠금 대기 lane(`postgresqlMigrationLockWaitIntegrationTest`), 마이그레이션 lane |
| 테스트 코드(ArchUnit fixture 포함) | 그 leaf `testQualityCheck` |
@@ -108,7 +108,17 @@ public record ModuleRegistry(List<Module> modules, File source) {
String id = requireNonBlankText(module, "id", index);
String gradlePath = requireNonBlankText(module, "gradle_path", index);
String sourcePath = requireNonBlankText(module, "source_path", index);
String buildName = module.has("build") ? requireNonBlankText(module, "build", id) : "main";
// Every module belongs to the main build. The only other build (the optional gRPC platform
// build) moved to the grpc-library repository on 2026-11-08, and a row naming any build but
// this one would be included by no settings and checked by no direction gate while ci stays
// green, so the field is refused rather than read.
if (module.has("build")) {
throw new IllegalStateException(
"Module registry entry '"
+ id
+ "' has a 'build' field; every module belongs to the main build, so remove it.");
}
String buildName = "main";
List<String> allowedDependencies =
requireStringList(module.get("allowed_dependencies"), id, "allowed_dependencies");
@@ -83,7 +83,8 @@ public final class QualityConventionsPlugin implements Plugin<Project> {
// total 307 46 261
//
// Found afterwards and judged the same way (review 15절, r3-L): the optional-platforms (gRPC)
// build reads this same exclude file and had not been analysed at MEDIUM (13), and the
// build, which read this same exclude file until it moved to the grpc-library repository on
// 2026-11-08 (its rows below left with it), had not been analysed at MEDIUM (13), and the
// httpclient retry jitter source r3-J added (1).
// USO_UNSAFE_METHOD_SYNCHRONIZATION 6 6 -
// GrpcAdmissionController: private lock object
@@ -18,7 +18,8 @@ public abstract class StrictLaneStagesExtension {
* command executes this build's stages only when it starts in this build's directory from there
* — its step's {@code working-directory} joined with its {@code -p}. The directory is read from
* where the build is, so no build states it (review 2026-11-04 RR2-04-04: a {@code -p} value
* alone missed {@code working-directory: src/platforms/optional-build} with {@code ../gradlew}).
* alone missed {@code working-directory: src/platforms/optional-build} with {@code ../gradlew}, in
* the optional gRPC build that has since moved to its own repository).
*/
public abstract DirectoryProperty getWorkflowDirectory();
@@ -87,7 +87,17 @@ class ModuleRegistryTest {
}
@Test
void buildOwnershipDefaultsToMainAndCanSelectOptionalModules() throws Exception {
void everyModuleBelongsToTheMainBuild() throws Exception {
ModuleRegistry parsed = read(registry(entry("app-bootstrap", ":app-bootstrap", "src/alpha")));
assertEquals("main", parsed.byId("app-bootstrap").buildName());
assertEquals(List.of("app-bootstrap"), parsed.modulesForBuild("main").stream().map(ModuleRegistry.Module::id).toList());
}
@Test
void aBuildFieldIsRejectedBecauseNoOtherBuildIncludesOrChecksTheModule() throws Exception {
// The optional gRPC build was the only other build; it moved to its own repository on
// 2026-11-08. A row naming any other build (a typo included) would be included by no settings
// and checked by no direction gate, while ci stays green.
Files.createDirectories(root.resolve("src/grpc/grpc-client"));
String json =
registry(
@@ -96,15 +106,13 @@ class ModuleRegistryTest {
{"id":"grpc-client","gradle_path":":grpc:grpc-client","source_path":"src/grpc/grpc-client",
"allowed_dependencies":[],"build":"optional-grpc"}
""");
ModuleRegistry parsed = read(json);
assertEquals("main", parsed.byId("app-bootstrap").buildName());
assertEquals("optional-grpc", parsed.byId("grpc-client").buildName());
assertEquals(List.of("app-bootstrap"), parsed.modulesForBuild("main").stream().map(ModuleRegistry.Module::id).toList());
assertEquals(List.of("grpc-client"), parsed.modulesForBuild("optional-grpc").stream().map(ModuleRegistry.Module::id).toList());
IllegalStateException failure = assertThrows(IllegalStateException.class, () -> read(json));
assertTrue(failure.getMessage().contains("'grpc-client'"), failure.getMessage());
assertTrue(failure.getMessage().contains("'build'"), failure.getMessage());
}
@Test
void blankBuildOwnershipIsRefused() {
void aBlankBuildFieldIsRefusedToo() {
String json =
"""
{"modules":[
@@ -112,7 +120,7 @@ class ModuleRegistryTest {
"allowed_dependencies":[],"build":" "}]}
""";
IllegalStateException failure = assertThrows(IllegalStateException.class, () -> read(json));
assertTrue(failure.getMessage().contains("nonblank string 'build'"), failure.getMessage());
assertTrue(failure.getMessage().contains("'build' field"), failure.getMessage());
}
@Test
+3 -3
View File
@@ -27,9 +27,9 @@ tracing 이음매, domain-context 전파)은 [README.md](README.md)에 있다.
- 모든 leaf가 복사해 쓰던 표준 라이브러리 도우미(2026-09-25 리뷰 후속으로 여기로 옮겼다):
`digest/Sha256`(SHA-256 digest 값과 유일한 `MessageDigest.getInstance("SHA-256")`),
`digest/HmacSha256`(서명과 상수 시간 검증), `retry/Backoff`(상한 있는 지수 ceiling. "full jitter"는
`U[0, ceiling]`이고 다른 뜻이 아니다). 들여온 `messaging:*`와 optional gRPC 빌드는 이 모듈에
의존하지 않고 자기 사본을 둔다. 각 제품의 AGENTS.md가 이유를 적는다(다른 제품이다. 2026-08-14 메시징
모듈 리뷰 뒤에 정했다). 이 도우미가 필요한 템플릿 leaf는 모두 `shared-contract` edge를 두고 복사하지
`U[0, ceiling]`이고 다른 뜻이 아니다). 들여온 `messaging:*`와 별도 repo 라이브러리(grpc-library)는 이 모듈에
의존하지 않고 자기 사본을 둔다. 각 제품의 AGENTS.md(라이브러리는 그 repo)가 이유를 적는다(다른 제품이다.
2026-08-14 메시징 모듈 리뷰 뒤에 정했다). 이 도우미가 필요한 템플릿 leaf는 모두 `shared-contract` edge를 두고 복사하지
않고 쓴다. identifier, persistence-mongo, application-objectstorage, redis-sdk가 바로 이 때문에
edge를 받았고(2026-11-03에 정함), 각각 JVM 밖에서 계산한 벡터로 출력을 고정하는 시험이 있다.
- `observability/MdcKeys`: 모든 전송 계층(web, GraphQL, STOMP, gRPC)이 요청의 correlation을 넣는