Skip to content

type = improvement: Wire Gameplay setup orchestration into Terminal app #142

Description

@bartul

Parent issue: #51
Depends on: #141
Related foundation PR: #140
Status: proposed

Context/problem:
After Gameplay setup orchestration is implemented in the core domain, the terminal app should start new games through Gameplay instead of directly initializing Rondel. Gameplay should become the orchestrator for setup: it accepts the StartGame intent, commits its own state/effects, dispatches the Rondel setup command, handles Rondel setup completion, and publishes SetupCompleted when setup is complete.

Decision/proposed change:
Wire Gameplay into the terminal app using the same interface-first and red-green-next process preferred for domain work. Each behavior should be introduced with one failing test, followed by the smallest general-purpose implementation that passes it, before moving to the next behavior.

Suggested behavior sequence:

  • Add terminal Gameplay store behavior for load/save of GameplayState.
  • Add GameplayHost command execution test that routes a GameplayCommand to the Gameplay facade.
  • Implement GameplayHost using the existing MailboxProcessor and SupervisedMailbox patterns.
  • Commit Gameplay effects in the host: save state, publish Gameplay integration events, and dispatch outbound commands.
  • Dispatch SetRondelToStartingPositions outbound commands to the Rondel host.
  • Subscribe to or otherwise route Rondel PositionedAtStart events into Gameplay.handle.
  • Change the shell New Game flow to send StartGame to Gameplay instead of directly setting up Rondel.
  • Surface Gameplay setup failures through SystemNotification with source GameplayHost.
  • Reflect SetupCompleted or InPlay state in the terminal event log where appropriate.

Acceptance criteria:

  • Terminal app setup flow goes through Gameplay for new games.
  • GameplayHost follows the existing host, mailbox, bus, and supervision patterns used by RondelHost and AccountingHost.
  • Tests are added one behavior at a time using red-green-next.
  • Direct shell-to-Rondel setup is removed or no longer used for new-game startup once Gameplay wiring is complete.
  • Existing terminal and core tests remain green.
  • dotnet fantomas ., dotnet build, and dotnet test pass before the PR is considered ready.

Out of scope:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions