Skip to content

feat: Werewolf / Resistance / Avalon role presets + customcards persistence#28

Open
taleodor-claude wants to merge 1 commit into
mainfrom
2026-05-game-presets
Open

feat: Werewolf / Resistance / Avalon role presets + customcards persistence#28
taleodor-claude wants to merge 1 commit into
mainfrom
2026-05-game-presets

Conversation

@taleodor-claude

Copy link
Copy Markdown

Summary

Feature-complete port of upstream relizaio/card-shuffle PR #13 (identical content to PR #12, just re-opened). PR #13 alone assumed a customcards-persistence prereq that wasn't on this fork's main, so this PR carries both layers.

Server (mafia-express/index.js)

  • New socket events: addcustomcard, setgametype
  • Per-room state: customCards: {}, gameType: 'classic-mafia'
  • On requestroom, replay gametype + customcards to the rejoining socket so a refresh / reconnect repaints the right preset
  • setgametype clears customCards on a preset switch and broadcasts both new states

Client (mafia-vue/src/components/CardShuffle.vue)

  • PRESETS const + clonePresetCards helper covering four presets (classic-mafia, werewolf, resistance, avalon)
  • Game-type selector in the admin Card-distribution panel
  • gametype + customcards socket handlers (server is source of truth; merge custom roles on top)
  • addRoleSubmit now emits addcustomcard so the role persists per room

Tests (test-harness/smoke.mjs)

  • 5 new Puppeteer checks: default preset, switch to Werewolf, switch to Avalon, persistence across reload, and the "switching clears custom roles" contract

ReARM session

  • session: 7b5d89f6-03ad-4d79-9733-24f3476bed8e
  • clientSessionId: game-presets-1779459983
  • Orientation BLOCK → PASSED

Test plan

  • mafia-vue + mafia-express releases land ASSEMBLED + no POLICY_GATE rejection
  • Switch card-shuffle.psclaude.rearmhq.com FS to this branch; smoke that the preset selector exists in the served bundle and the server broadcasts work end-to-end

…stence

Feature-complete port of upstream relizaio/card-shuffle PR #13 (same
content as #12). The fork was missing the customcards-persistence
prereq that PR #13 builds on, so this PR carries both.

Server (mafia-express/index.js):
  - new socket events: addcustomcard, setgametype
  - new per-room state fields: customCards (already implicit, now
    initialized) and gameType (default 'classic-mafia')
  - on requestroom, replay gametype + customcards to the rejoining
    socket so a refresh / reconnect repaints the right preset
  - setgametype clears customCards on a preset switch (custom roles
    were preset-specific) and broadcasts both new states

Client (mafia-vue/src/components/CardShuffle.vue):
  - PRESETS const + clonePresetCards helper covering four presets
    (classic-mafia, werewolf, resistance, avalon) — each role mapped
    to one of the four CloudFront image themes (sheriff / godfather
    / mafia / villager) since no other artwork exists
  - Game-type selector in the admin panel
  - gametype + customcards socket handlers (server is source of
    truth; merge custom roles on top of the preset base)
  - addRoleSubmit now emits addcustomcard so the role survives
    reload / propagates to other admins
  - .preset-control CSS rule for the selector

Tests (test-harness/smoke.mjs):
  - 5 new Puppeteer checks: default preset, switch to Werewolf,
    switch to Avalon, persistence across reload, and the
    'switching clears custom roles' contract

ReARM-Agentic-Session: game-presets-1779459983
ReARM-Agent: 324b2ca3-403e-4126-b353-4787140daa65
@psclaude-pr-validate-and-webhook

Copy link
Copy Markdown

ReARM: card-shuffle-claude-mafia-express — 2026-05-game-presets.0

Release details

Lifecycle: ASSEMBLED

Vulnerabilities (0)

Severity Count
Critical 0
High 0
Medium 0
Low 0
Unassigned 0

Policy Violations (0)

Type Count
Security 0
License 0
Operational 0

Last scanned: 2026-05-22T14:31:50.261429Z

PR Conditions

Reject on Disapproval → ✅ PASS
(release.lifecycle in ["DRAFT", "ASSEMBLED", "READY_TO_SHIP"] && release.anyDisapproved)
Ready to Ship on All Approvals → ⚪ NOT MET
release.lifecycle in ["DRAFT", "ASSEMBLED"] && approvals.all(k, approvals[k] == "APPROVED")
Any agent session has FAILED policy → ✅ PASS
release.agentSessions.exists(s, s.hasFailedPolicy)

@psclaude-pr-validate-and-webhook

Copy link
Copy Markdown

ReARM: card-shuffle-claude-mafia-vue — 2026-05-game-presets.0

Release details

Lifecycle: ASSEMBLED

Vulnerabilities (0)

Severity Count
Critical 0
High 0
Medium 0
Low 0
Unassigned 0

Policy Violations (0)

Type Count
Security 0
License 0
Operational 0

Last scanned: 2026-05-22T14:32:50.683565400Z

PR Conditions

Reject on Disapproval → ✅ PASS
(release.lifecycle in ["DRAFT", "ASSEMBLED", "READY_TO_SHIP"] && release.anyDisapproved)
Ready to Ship on All Approvals → ⚪ NOT MET
release.lifecycle in ["DRAFT", "ASSEMBLED"] && approvals.all(k, approvals[k] == "APPROVED")
Any agent session has FAILED policy → ✅ PASS
release.agentSessions.exists(s, s.hasFailedPolicy)

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.

1 participant