[Budget] commit/release lifecycle와 actual reconciliation 구현 - #66
Closed
Rigu1 wants to merge 12 commits into
Closed
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
구현 내용
RESERVED,IN_FLIGHT,RECONCILIATION_REQUIRED,COMMITTED,RELEASED,WRITTEN_OFF상태 전이와 구조화된 transition 결과를 추가했습니다.ReservationAccounting단일 진입점으로 제공합니다.PricingSnapshot으로 한 번만 계산합니다.activeReserved -= estimate,committed += actual을 같은 bucket 임계 구역에서 처리합니다.pendingReconciliationLiability로 이동하고, late actual 도착 시 pending을 제거한 뒤 actual을 확정합니다.REUSED하며, 다른 callback은 비용이 같아도CONFLICT로 처리합니다.framework-independent accounting event를 한 번 전달합니다.best-effort at-most-once로 호출합니다.listener 실패는 완료된 정산을 되돌리지 않고 다음 listener의 event 수신도 막지 않습니다.검증
./gradlew :token-pilot-budget:test --rerun-tasks./gradlew testgit diff --check범위 외
체크리스트
필수 테스트
RECONCILIATION_REQUIRED이며 pending liability에 estimate가 한 번 반영된다.COMMITTED로 전이된다.RESERVED또는 미과금이 확인된IN_FLIGHT에서만 liability를 제거한다.IN_FLIGHT만료로 liability가 조용히 사라지지 않는다.CONFLICT다.COMMITTED인 경우만 cost/accounting event가 한 번 생성된다.Acceptance Criteria
RECONCILIATION_REQUIRED가 late actual로 해결될 수 있다.ReservationAccounting경로에서 한 번만 계산·정산된다.AGENTS.md에 기록된다.Closes #37