문제: platform-kernel-is-product-neutral의 from.pathNot이
^src/platform/routing/ 폴더 전체라, routing 아래 어느 파일이든
features·contexts·apps·adapters·bootstrap·presentation·application
일곱 곳을 모두 import할 수 있다. 실제 쓰임은 context-route-module.ts가
apps/deployable-app-module.ts와 contexts/bounded-context-module.ts를
타입으로 읽는 둘뿐이다. presentation(app-router.tsx)이 routing을
import하므로, routing 파일 하나가 adapter 배럴을 재수출하면
presentation이 adapter에 닿는데 check:architecture가 통과한다.
고른 방법: 기존 규칙의 예외를 context-route-module.ts 한 파일로 좁히고,
그 파일이 읽을 수 있는 곳을 descriptor 파일 둘로 묶는 규칙
platform-route-module-reads-only-descriptors를 더한다. cross-boundary
fixture에 routing 재수출 파일과, adapter 배럴과 descriptor가 아닌 app
모듈을 재수출하는 route module을 두고 check-architecture.ts의 fixture
회귀 목록에 거절 셋·허용 하나를 더한다. 판정 로직(규칙 해석)은 바꾸지 않았다. layers.md 규칙 표와 예외
목록, src/platform/AGENTS.md의 예외 문장을 같은 내용으로 고치고,
CHANGELOG 먼저 할 일에 옮기는 법을 적는다. 규칙은 import가 타입
전용인지 보지 않으므로 문서와 comment에 「타입만」이라고 쓰지 않는다.
버린 안: check-architecture에 type-only 판정을 더하는 것. 다른 규칙
전체의 의미가 바뀐다.
위험: 좁히는 쪽이라 지금 트리에서 새로 걸리는 import는 없다(아래 a).
routing에 두 번째 파일을 둔 다운스트림은 동기화 뒤 FE-GATE-010에서
실패한다(CHANGELOG에 옮기는 법).
routing에 다른 descriptor가 필요해지면 그 파일 이름을 새 규칙의
to.pathNot에 적어야 한다(규칙 comment에 적었다).
tests/architecture/observability-boundaries.test.ts는 아직 routing 폴더
전체를 건너뛴다. 이 항목 범위 밖이라 두었다.
검증(desktop, red4.sh):
- a 최종 트리 check:architecture rc=0, graph fixture 35개 PASS.
- b main 규칙(.dependency-cruiser.json만 8d115d02로) + 새 fixture:
rc=1, 새 거절 assertion 셋만 실패(routing 재수출, route module의
adapter import, descriptor가 아닌 app import). 허용 assertion은 통과.
- c 정확히 main(8d115d02) + 실제 트리 탐침(src/platform/routing/
http-reexport.ts가 adapters/http 배럴 재수출, context-route-module.ts에
adapters/telemetry 재수출 한 줄): rc=0. 빈틈이 성립한다.
- d 최종 규칙 + 같은 탐침: rc=1. http-reexport.ts는
platform-kernel-is-product-neutral, context-route-module.ts는
platform-route-module-reads-only-descriptors로 거절된다.
- m1 새 규칙 to.pathNot을 ^src/(apps|contexts)/로 넓힘: rc=1, 「non-
descriptor app module」 assertion 실패. m2 to.path를 ^src/adapters/로
좁힘: rc=1, 같은 assertion 실패.
- e 규칙을 읽는 시험 셋(observability-boundaries, feature-adapter-reach,
architecture-violation-message) 9개 통과.
Refs: REV-FE-0035
4 lines
162 B
TypeScript
4 lines
162 B
TypeScript
// REV-FE-0035: an app module that is not a route descriptor. The route
|
|
// module must not read it even though it sits in src/apps/.
|
|
export const appRuntime = 1;
|