Repository navigation
Issue #46: round completion境界でseat-relative RoundEvidenceをdeliveryする - #47
Merged
Merged
Conversation
局を`FINISHED`にした最後のtransactionが`RoundProgressFact`を生じない場合、 既存`on_delivery`は呼ばれず、次のloopの`settle_active_round()`でactive `RoundState`が失われるため、`ResponseEpochClosedEvidence` / `RoundEndedEvidence`まで含むcomplete evidenceを取得できなかった。 `round_evidence_completion.py`へ、viewerごとのseat-relative projectionを viewer identity付きで束ねるimmutable value(`SeatRoundEvidence` / `RoundEvidenceCompletion`)と、終局済みactive roundからそれを構築する `build_round_evidence_completion()`を追加する。evidenceは既存 `build_round_evidence()`をそのまま再利用し、新しいevent interpretationを driverへ複製しない。round identityは`MatchState.position`由来の player-safeな位置情報だけを持つ。 `run_hanchan()`へoptionalな`on_round_evidence_complete`を追加し、 `RoundPhase.FINISHED`確定後・`settle_active_round()`前に局ごとちょうど 1回だけ同期deliveryする。callback例外はfail-fastで伝播し、精算・次局へ 進まない。既存`on_delivery`のobservable semanticsと`RoundEvidence` / `RoundProgressFact` / `RoundCompletionFact`は変更しない。 Closes #46 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pgnw2xnX4TC7VMAjsDPsVS
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.
Closes #46
目的
局を
FINISHEDにした最後のsuccessful transactionがRoundProgressFactを生じない場合(terminal ron等)、既存on_deliveryは呼ばれないまま次のloopでsettle_active_round()がactiveRoundStateをclearする。そのため、ResponseEpochClosedEvidence/RoundEndedEvidenceまで含むcomplete final evidenceをconsumerが取得する境界が存在しなかった。この欠落だけを埋める。採用したAPI shape
SeatRoundEvidenceでviewer identityを明示し、docstringで「bundle全体はsingle-player safeなglobal-public objectではない」ことを明記した。build_round_evidence(round_state, viewer_seat)の再利用だけで、新しいevent interpretationをdriverへ複製していない。MatchState.positionのplayer-safeな位置情報のみ。round_ordinal/ seed / random provenanceは持たない。build_round_evidence_completion()はactive roundがFINISHEDでなければfail closedで拒否する。Delivery timing
callbackはsettlementより前に呼ばれるため、例外時は精算前の状態で停止する(retry / silent skipなし、成功済みtransactionのrollbackなし)。既存
on_deliveryのbatch内容・順序・timingは変更していない。変更ファイル
src/lisjong_engine/round_evidence_completion.py(新規): value contractとbuild_round_evidence_completion()src/lisjong_engine/driver.py:on_round_evidence_completeoptional callbackと_deliver_round_evidence()tests/test_round_evidence_completion.py(新規): 27 testsdocs/architecture.md: 本境界のsectionを追加Tests
Issue記載のacceptance criteriaを固定した。
on_deliverybatchの同一性RoundStateへのbuild_round_evidence()と一致ResponseEpochClosedEvidence(RON)+RoundEndedEvidence)/ tsumo / exhaustive draw / abortive draw(九種九牌)でterminal evidenceを欠落しないReactionResolutionの非漏洩)RoundState/MatchState/RoundEvent/ReactionResolution/Tile/ provenance field名が現れない再帰check品質確認
Non-goals
外部runtime dependency、generic transaction observer / event bus、
RoundEvidence/RoundProgressFact/RoundCompletionFactのsemantic変更、on_deliveryへのempty batch追加、Arena / HandBelief / dataset依存はいずれも導入していない。Generated by Claude Code