Skip to content

시뮬레이션 tail window와 manifest anchor 노출 보정#128

Open
seoJing wants to merge 2 commits into
developfrom
fix/sim-log-anchor-tail-window
Open

시뮬레이션 tail window와 manifest anchor 노출 보정#128
seoJing wants to merge 2 commits into
developfrom
fix/sim-log-anchor-tail-window

Conversation

@seoJing

@seoJing seoJing commented Jun 11, 2026

Copy link
Copy Markdown
Member

작업 내용

  • manifest 응답의 max_projected_tick을 DB의 lifecycle/movement 실제 최대 tick까지 포함하도록 보정했습니다.
  • projection_tail_ticks도 실제 projected max 기준으로 재계산해 tail 데이터가 잘리지 않게 했습니다.
  • simulation_place.map_anchor_json을 추가하고 manifest places[].map_anchor로 노출합니다.
  • demo manifest resource의 max_projected_tick을 256, projection_tail_ticks를 81로 갱신하고 lifecycle anchor를 place manifest에도 반영했습니다.

확인

  • JSON parse 검증: demo_run_001.manifest/lifecycle/movements.json
  • git diff --check

미확인

  • 로컬 머신에 Java Runtime이 없어 ./gradlew test는 실행하지 못했습니다. /usr/libexec/java_home -V가 Java Runtime 없음으로 실패했습니다.

배포 주의

  • 기존 populated DB에는 새 manifest/resource가 자동 재시드되지 않을 수 있으므로 demo_run_001 재시드 또는 migration/import 절차가 필요합니다.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seoJing, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 10 seconds. Learn how PR review limits work.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7c246dc-4fb4-492f-81ed-6cf9d852ecda

📥 Commits

Reviewing files that changed from the base of the PR and between cff8499 and 70a97b8.

📒 Files selected for processing (9)
  • capstone-api/src/main/java/backend/simulation/dto/SimManifestResponse.java
  • capstone-api/src/main/java/backend/simulation/initializer/SimulationDataInitializer.java
  • capstone-api/src/main/java/backend/simulation/service/SimulationService.java
  • capstone-api/src/main/resources/simulation/demo_run_001.lifecycle.json
  • capstone-api/src/main/resources/simulation/demo_run_001.manifest.json
  • capstone-domain/src/main/java/backend/simulation/entity/SimulationPlace.java
  • capstone-domain/src/main/java/backend/simulation/repository/SimulationLifecycleEventRepository.java
  • capstone-domain/src/main/java/backend/simulation/repository/SimulationMovementRepository.java
  • docs/migrations/2026-06-11_simulation_place_map_anchor.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sim-log-anchor-tail-window

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ca5tlechan ca5tlechan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approve

기능 로직과 실제 데이터(매니페스트/라이프사이클/무브먼트) 정합성을 직접 교차검증했고, 블로킹 이슈 없습니다.

검증한 내용

  • maxProjectedTick 재계산: declaredMax(256) vs DB max lifecycle tick(254) / movement arrive_tick(256) → max=256, manifest의 max_projected_tick=256과 일치
  • projectionTailTicks 재계산: 256 - 176 + 1 = 81, manifest의 projection_tail_ticks=81과 일치
  • place.map_anchorlifecycle(SPOT_CREATED).map_anchor 1:1 정합성: 38건 전수 비교, 불일치/누락 0건
  • docs/migrations/2026-06-11_simulation_place_map_anchor.sql 포함, ADD COLUMN IF NOT EXISTS로 멱등성 확보
  • import 순서(java. → org.springframework. → backend.* catch-all) checkstyle 컨벤션 준수 확인
  • SimulationPlacemapAnchorJson 필드 추가 — 생성 지점이 SimulationDataInitializer의 builder 호출 1곳뿐이라 @AllArgsConstructor 변경에 따른 부작용 없음
  • PR 설명에 기존 DB 재시드 필요성과 로컬 ./gradlew test 미실행 사실을 솔직하게 명시

🟡 Non-blocking 후속 제안

  1. projectionTailTicks(run) (선언/fallback 값) vs projectionTailTicks(run, maxProjectedTick) (재계산된 effective 값) — 동명 오버로드라 의미가 다름. declaredProjectionTailTicks / effectiveProjectionTailTicks 등으로 이름 분리 권장
  2. findMaxArriveTickByRunId가 기존 idx_movement_runid_depart (runId, departTick) 인덱스 커버 범위 밖 (arriveTick 미포함). 데모 규모(492 rows)에선 문제 없으나, 데이터 증가 시 (runId, arriveTick) 인덱스 추가 고려
  3. 신규 재계산 로직에 대한 서비스 레벨 테스트 없음 — 다만 simulation 모듈 전체에 기존 테스트가 0건이라 이번 PR만의 회귀는 아님

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants