Skip to content

Project player-safe round completion scoring details - #49

Merged
lisbun merged 1 commit into
mainfrom
issue-48-round-completion-details
Aug 29, 2026
Merged

lisbun merged 1 commit into
mainfrom
issue-48-round-completion-details

Conversation

@lisbun

@lisbun lisbun commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • extend RoundCompletionWinner with player-safe winning tile, concealed tiles, declared melds, and all maximum-score candidates
  • project yaku identity/Japanese name, han or yakuman units, total han, rounded fu, five-way dora counts, score limit, and ron/tsumo payments
  • expose ordered visible/kan indicators and disclose ura/kan-ura only when at least one riichi or double-riichi winner exists
  • project settlement transfers and riichi-stick awards while preserving TransferReason distinctions
  • preserve existing round/match completion fields and delivery timing

Public contract

New immutable values:

  • RoundCompletionYaku
  • RoundCompletionDoraCount
  • RoundCompletionScoreCandidate
  • RoundCompletionDoraIndicators
  • RoundCompletionSettlementTransfer
  • RoundCompletionRiichiStickAward

RoundCompletionWinner.seat and .win_method remain compatible; projected winners additionally carry the detailed fields. Legacy two-argument construction remains valid.

Candidate and disclosure semantics

  • every WinningScoreSelection.max_score_candidates value is projected
  • consumer-facing candidates and yaku are normalized by stable semantic keys; no arbitrary representative is selected
  • explicit yakuman keeps han/fu/dora absent and preserves yakuman units
  • counted yakuman keeps its normal han/fu/dora semantics
  • visible and kan indicator order is preserved
  • ura and kan-ura remain empty for non-riichi wins
  • in multiple ron, one riichi winner makes the revealed ura snapshot table-public while each winner retains their own evaluated dora count

Architecture

  • whitelist projection from CompletedRound, WinResult, and RoundSettlement
  • tiles and melds use PublicTile / PublicMeld; no physical tile identity is exposed
  • no non-winner concealed hand is exposed
  • no internal WinningContext, score candidate, dora indicator, settlement, round state, or provenance object crosses the public contract
  • score, yaku, fu, dora, and settlement calculations are unchanged; projection only copies and validates confirmed values
  • no dependency on lisjong-play, lisjong, or lisjong-arena

Verification

  • .venv\Scripts\python.exe -m unittest discover -s tests -v: 1449 tests passed in 321.839s
  • .venv\Scripts\python.exe -m ruff format --check .: 118 files formatted
  • .venv\Scripts\python.exe -m ruff check .: passed
  • git diff --check: passed

Focused coverage includes ron/tsumo, winning hand/meld/red projection, mangan through counted yakuman, single/double yakuman, all dora categories, ura disclosure safety, indicator order, mixed-riichi multiple ron, tied maximum candidates, settlement reasons, honba, riichi-stick awards, and recursive internal/physical-type exclusion.

Migration reference

Used the following python-study commits only as UX and regression references; no legacy schema or runtime API was copied:

  • 35fde67e754d6f9b0d60219e359159cac592220d
  • 05cc40ca4176d8a253142565a67e939924941e6a

Closes #48

@lisbun lisbun left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review result

blocking findingなし。merge可能です。

Issue #48のscope / acceptance criteriaとcurrent engine contractに照らして確認しました。

  • winner-specific detailはWinningPlayerResult / WinningContext / WinningScoreSelectionからwhitelist projectionされ、non-winner concealed handやphysical tile IDは公開されていません。
  • max_score_candidatesは任意のrepresentativeへ潰さず全件をprojectionし、consumer-facing orderもdeterministicです。
  • normal hand / explicit yakuman / counted yakumanのhan・fu・yakuman units・dora semanticsは既存ScoreCalculation / HandValueEvaluationと整合しています。
  • ura / kan-ura indicatorは、少なくとも1人のwinnerがRIICHI / DOUBLE_RIICHIの場合だけtable-publicとして公開され、非立直和了ではhidden snapshotを落としています。multiple ronでwinnerごとのura countが異なる場合もindicator公開とcandidate countを混同していません。
  • settlement transfer / riichi-stick awardは既存確定値のprojectionで、TransferReason semanticsを維持しています。
  • legacy RoundCompletionWinner(seat, win_method) constructionとexisting RoundCompletionFact fieldsも維持されています。
  • CLI layout、fu component breakdown、scoring / settlement calculation変更はscope外のままです。

PR head 9de1714d0aa87ea238ebd16da7cfd9e4fee62d46 のCI successも確認しました。

追加修正を必須とするfindingはありません。

@lisbun
lisbun merged commit 8735e89 into main Aug 29, 2026
1 check passed
@lisbun
lisbun deleted the issue-48-round-completion-details branch August 29, 2026 08:56
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.

player-safe RoundCompletionFactへ和了詳細・精算内訳を射影する

1 participant