Draft
Conversation
Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement hint system and UI integration for MarketPhase
feat(main-street): Hint System (M3 US-3)
Mar 15, 2026
Member
|
This PR is not ready to merge yet because a critical test-environment failure blocks full verification in the Ampa review container.
Critical/Blocking issues
Non-blocking issues
|
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.
Implements the per-turn Hint button for Main Street's MarketPhase: pressing it queries
GreedyStrategyfor the recommended action, highlights the target card/slot, and displays a one-line rationale. Limited to one use per turn.New:
MainStreetHint.tsgenerateHint(state)— delegates toGreedyStrategy.chooseAction()(same priority chain as AI auto-play) then scores the result viascoreAction(). Advancesstate.rng. ReturnsnulloutsideMarketPhase.buildRationale(action, score, state)— maps action type to a one-line template per PRD §4.4:buy-business→"Buy Cafe at slot 2 for +2 synergy bonus"buy-upgrade→"Upgrade Bakery at slot 0 for +1/turn income"buy-event→"Buy Trade Fair for +5 coins"play-event→"Play Trade Fair now for immediate benefit"end-turn→"No good buys available -- end your turn"MainStreetScenechangeshintUsedThisTurn,hintedCardId,hintedSlotIndex— reset increate()andstartDayPhase().refreshActionButtons(); shows as disabled"Hint ✓"after use.drawMarketCard,drawHeldEventCard) and target slot (drawEmptySlot,drawBusinessSlot) on hint activation.instructionText.Tests (
tests/main-street/hint.test.ts)18 tests: null guard outside
MarketPhase, action matches independentGreedyStrategyevaluation (separate state instances to avoid RNG contamination), score equality, all five rationale templates, multi-seed integration.Original prompt
This section details on the original issue you should resolve
<issue_title>Main Street M3: Hint System</issue_title>
<issue_description>
Implement the hint generator and UI integration that lets players request a Greedy AI recommendation during MarketPhase.
User Story
As a player, I want to press a Hint button during my turn to see a suggested move highlighted with a brief explanation, so I can learn effective strategies.
Deliverables
Acceptance Criteria
Dependencies
References
Related work (automated report)
CG-0MMN8UTLC12Q1U2R — Main Street M3: Greedy AI Strategy and Scoring Heuristics (status: completed).
This work implements
GreedyStrategyand the helpersscoreAction()andenumerateAndScoreActions()that the hint generator should reuse to evaluate and rank candidate actions. GreedyStrategy's implementation is the primary source of truth for recommended moves.CG-0MMN8V9UU0MF2GHK — Main Street M3: Monte Carlo Harness Extension for AI Strategies (status: completed).
Extends the Monte Carlo harness to run AI strategies (including Greedy). Useful for validation of hint quality and to generate sample scenarios for testing hint behavior across seeds.
CG-0MMN8WCCD1AXQ2EU — Main Street M3: Transcript Extension for AI, Hint, and Undo Events (status: blocked).
Specifies transcript schema additions required to record hint requests and undo/redo events. The hint implementation must record the hint request and rationale as a transcript event; this work item is the canonical reference.
CG-0MM4REQ4C01X8C08 — Main Street: PRD Milestone 3 -- AI, Hints, and Undo System (status: in-progress, parent).
The PRD contains detailed design, acceptance tests, and API sketches for hints (see section 4.4 and 5.5). Implementations should follow the API sketches (
HintGenerator,HintResult) and acceptance criteria listed there.docs/main-street/prd-milestone-3.md (file)
Design doc for Milestone 3 describing goals, success criteria, and a detailed hint architecture sketch. Useful for matching acceptance criteria and for tests referenced in the PRD.
docs/main-street/ai-strategy.md (file)
GDD section describing AI strategy tiers and hint-system design. Provides rationale and move-evaluation heuristics that inform
buildRationale()templates.Notes and conservative guidance:
GreedyStrategy's scoring helpers rather than duplicating heuristics; this keeps hints consistent with AI behaviour.docs/main-street/prd-milestone-3.mdacceptance tests (Appendix B) as the basis for unit tests listed in the Deliverables.(Automated report generated by find_related skill)</issue_description>
Comments on the Issue (you are @copilot in this section)
@SorraTheOrcMap
Intake draft created at .opencode/tmp/intake-draft-Main-Street-Hint-System-CG-0MMN8VNCH0C6XKC4.md; transcript recording left to CG-0MMN8WCCD1AXQ2EU; one-line rationale; non-blocking UI. Review requested.</comment_new>
<comment_new>@SorraTheOrc
Map
find_related report appended; coordinated decisions: transcript left to CG-0MMN8WCCD1AXQ2EU, one-line rationale, non-blocking UI. Intake brief saved to .opencode/tmp/intake-draft-Main-Street-Hint-System-CG-0MMN8VNCH0C6XKC4.md</comment_new>
<comment_new>@SorraTheOrc
Map
Intake brief approved by user. Proceeding to effort and risk estimation and final sync.</comment_new>
<comment_new>@SorraTheOrc
Map
Effort & risk estimate posted: expected ~30.7h (recommended 31h), Low-Medium risk. S...
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.