Skip to content

[HT-69]: Coach signals (card-death, feed-risk) + opponents-ladder extension #117

Description

@Maiz27

Parent

PRD-05: Game History & Replay — #111

What to build

Add two table-reading signals and fold them into the CPU opponents ladder so live play gets stronger (this slice has no dependency on the history feature and ships value to live games on its own):

  • Card-death detection — a needed card is dead when all of its copies are accounted for across the discard pile, the table melds, and the holder's own hand, relative to the deck's copy count. This is a per-seat-perspective computation that needs table melds and the seat's own hand, so it is computed on the controller/review surface, not on the seat-scoped CPU observation (which sees the discard pile only).
  • Feed risk — the danger of discarding a card the next anti-clockwise seat (the seat that acts after and can pick up the discard) is collecting. This is genuinely public information and is shared as-is.

Wire these into the Skilled and Expert policies (per the opponents-ladder contract), with per-tier degradation for lower tiers: gating by tier, limited discard memory (via the existing last-N discard query), and probabilistic application, so easier CPUs still make believable human mistakes. Update the opponents-ladder design doc to record the new rows/columns.

These same signal computations are later consumed by the analysis coach (HT-70), so they are designed as the shared source of truth.

Acceptance criteria

  • Card-death detection correctly identifies a dead card from discards + table melds + own hand against deck copy count, and stays quiet for merely-unseen cards.
  • Feed-risk identifies when a discard would hand the next anti-clockwise seat a card it is collecting.
  • Skilled and Expert policies use the signals; lower tiers degrade as specified (tier gating / limited memory / probabilistic), preserving believable mistakes.
  • The opponents-ladder design doc is updated to reflect the new behavior.
  • Existing CPU difficulty/regression coverage still passes; live-play behavior change is validated on device before the slice is settled.
  • Signals are pure domain/CPU-layer computations, testable in isolation via the existing fake-observation surface.
  • Unit tests cover both signals' positive and negative cases and the per-tier degradation.

Blocked by

  • None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✅ readyWell-scoped, unblocked, and ready for implementation or review work to begin.📏 rulesClassic Hareeg rule-engine behavior, validation, turn state, scoring, or rule presets.🔥 fiftyFifty/Khamsin claim flow, timer, validation, scoring, penalties, or visual treatment.🔹 p2Normal-priority work that matters but does not block the immediate critical path.🙋 hitlRequires human-in-the-loop judgment for rules, naming, design, tone, or product behavior.🧠 aiCPU move selection, difficulty, personality, reaction timing, or strategy evaluation.🧩 featureA vertical slice that delivers user-visible behavior or playable product capability.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions