refactor: enforce package boundaries
This commit is contained in:
@@ -33,12 +33,14 @@ core2026/
|
||||
| turn daemon | `app/game-engine/src/turn/turnDaemon.ts` | lifecycle, loader, handler, flush |
|
||||
| daemon lease | `app/game-engine/src/lifecycle/databaseTurnDaemonLease.ts` | `TurnDaemonLease` |
|
||||
| world load·flush | `worldLoader.ts`, `databaseHooks.ts` | `EngineStateManager`, game Prisma |
|
||||
| package 경계 | `tools/check-package-boundaries.mjs` | source import, manifest dependency |
|
||||
| 장수·국가 명령 | `packages/logic/src/actions/turn` | constraint, command module, engine handler |
|
||||
| 전투 | `packages/logic/src/war` | action module, crew type, item, trait |
|
||||
| 지도 거리 계산 | `packages/logic/src/world/distance.ts` | AI·명령이 공유하는 순수 BFS |
|
||||
| 월간 처리 | `app/game-engine/src/turn/monthly*.ts` | scenario event, world dirty state |
|
||||
| frontend route | `app/*-frontend/src/router/index.ts` | view, store, tRPC client |
|
||||
| schema | `packages/infra/prisma/*.prisma` | migration, client, loader |
|
||||
| resource | `resources/` | scenario/map/unit-set loader |
|
||||
| resource | `resources/` | `app/game-engine/src/scenario/*Loader.ts` |
|
||||
|
||||
## 변경 단위
|
||||
|
||||
@@ -53,6 +55,9 @@ Router의 input schema, procedure, actor 해석, transaction과 error를 먼저
|
||||
ref entry point, SQL, RNG, log와 mutation 순서를 조사합니다. 순수 계산은
|
||||
`packages/logic`, 실행 context와 persistence는 `app/game-engine`에 둡니다.
|
||||
Fixed-seed unit, 실제 DB integration과 ref 차등 fixture를 함께 갱신합니다.
|
||||
새 package import나 파일 이동은
|
||||
[패키지 경계 문서](../architecture/package-boundaries.md)와
|
||||
`pnpm check:architecture`로 확인합니다.
|
||||
|
||||
### DB
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
| process·worker·daemon | [런타임 아키텍처](../architecture/runtime.md) | app server와 CLI |
|
||||
| profile·Gateway 배포 | [릴리스 운영 매뉴얼](../release-operations.md) | Admin GUI와 release-controller |
|
||||
| 파일 위치 | [파일 지도](./code-map.md) | router, handler, schema |
|
||||
| package 의존 방향 | [패키지와 파일 경계](../architecture/package-boundaries.md) | `packages/*`, `app/*` |
|
||||
| 명령·전투·효과 | [도메인과 조립](./domain-and-classes.md) | `packages/logic` |
|
||||
| mutation·flush | [요청·턴·저장](./request-turn-persistence.md) | game API, game engine |
|
||||
| action module | [행동 모듈 프로토콜](../architecture/action-module-protocol.md) | `actionModules/` |
|
||||
@@ -16,6 +17,7 @@
|
||||
## 경계
|
||||
|
||||
- `packages/logic`은 계산과 규칙을 소유합니다.
|
||||
- runtime I/O는 logic의 port를 app/infra adapter가 구현해 주입합니다.
|
||||
- `app/game-engine`은 clock, queue, AI, 월간 순서, transaction과 flush를
|
||||
소유합니다.
|
||||
- `app/game-api`는 transport, 인증, input validation과 request acceptance를
|
||||
|
||||
Reference in New Issue
Block a user