fix(engine): prompt Food/Treasure choice on Tireless Provisioner landfall - #2804
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Review: PR #2804 — Tireless Provisioner Food/Treasure landfall choiceVerdict: Approve with comments. The change correctly reuses the existing Correct seam / reuse (good)The primitive ( Findings[MED] The manual [MED] The new engine integration tests largely re-assert behavior that already held on [LOW] Frontend re-derives the branch label from raw effect data with a hardcoded English string — display-only + i18n violation (currently dead code). Evidence: Notes / refuted concerns
|
|
Review (review-impl lenses) — second pass, building on @matthewevans. The engine fix itself is at the correct seam and idiomatic: it reuses the existing Findings[MED] [MED] The [MED] Wrong CR annotation on the priority line — confirmed. Evidence: [LOW] Frontend re-derives the branch label with a hardcoded English string, bypassing Notes / confirmed-and-refuted
VERDICT: request-changes |
# Conflicts: # crates/engine/tests/fixtures/integration_cards.json
…erated from current export
The #[serde(alias = "SourceIsRenowned")] + default-subject shim existed
only to deserialize a test fixture that had been regenerated from a stale
card-data export. The merge of origin/main re-ran
scripts/gen-test-fixture.py against the current canonical export, which
emits IsRenowned { subject } exclusively (0 legacy tags, metadata intact,
Tireless Provisioner included), so the deserializer hardening is dead
scope at the wrong seam. Remove the alias, the default fn, and its test.
…Of prompt
The manual state.priority_player assignment in prompt_next duplicated the
centralized post-apply sync: apply() always runs sync_waiting_for and
finalize_public_state, both of which route waiting_for.acting_player()
(which has a ChooseOneOfBranch { player, .. } arm) through the same
turn_control::authorized_submitter_for_player helper. Its CR 117.3d
citation was also wrong (priority passing, not at-resolution choice
routing — CR 608.2d is the applicable rule, cited at the function top).
Delete the line and document the centralized ownership.
…neOfBranchModal tokenNameFromBranch re-derived display text from raw effect wire data and returned an untranslated English string, duplicating engine display logic in the display layer (the engine now always populates branch_descriptions 1:1, so the path was unreachable). Fall back only to the translated optionFallback key, and correct the inaccurate comment about description casing (first-letter capitalization is pure display formatting).
Empirically verified: all six integration tests pass against the pre-fix origin/main engine (parse, prompt, and branch routing already held on base). The discriminating coverage for this PR's engine deltas — the empty-chooser fail-loud guard and the token-name branch-label fallback — lives in the choose_one_of.rs unit tests, which were verified to fail against the base logic. Document that so the suite reads honestly.
|
Maintainer note — I merged
Verification: |
matthewevans
left a comment
There was a problem hiding this comment.
Maintainer sign-off: ChooseOneOfBranch hardening + token-label fixes + fixture regeneration (659 cards, legacy serde shim removed); discriminating unit pair revert-verified; FE fallback i18n-correct; type-check/lint green. Caveat on record: #927's no-prompt symptom is not reproducible on current main + data (stale-shipped-card-data hypothesis documented on the PR) — if it recurs post-redeploy, reopen for FE/data investigation.
|
Maintainer note: rebased-by-merge to resolve the conflict with current |
|
@matthewevans Can this be merged? |
|
@jsdevninja It would be helpful to include screenshots so we can see the before/after when it comes to frontend changes. |
Summary
Fixes #927: Tireless Provisioner's landfall trigger fires but the player was not prompted to choose Food or Treasure.
SourceIsRenownedinTriggerConditionvia serde alias →IsRenowned { subject: Source }, soCardDatabase::from_export/ WASM rehydrate works with current exports.priority_playerto the authorized chooser when pausing onChooseOneOfBranch; fail loudly if no eligible chooser; derive token branch labels ("Create a Food token", etc.) when descriptions are absent.ChooseOneOfBranchModallabels (description capitalization, token-name fallback from branch wire data, binary-choice subtitle, focus styles).Test plan
cargo test -p engine choose_one_ofcargo test -p engine --test integration issue_927cargo test -p engine legacy_source_is_renowned