Skip to content

feat(backend): a station can run the hint hunt (BAC-203) - #376

Merged
hycursion merged 1 commit into
mainfrom
adam/bac-203-stretch-a-station-gives-hints-from-one-players
Nov 16, 2026
Merged

hycursion merged 1 commit into
mainfrom
adam/bac-203-stretch-a-station-gives-hints-from-one-players

Conversation

@hycursion

Copy link
Copy Markdown
Collaborator

Summary

A fifth station game, hint_hunt ("Hint hunt"), on the Event Service. Players tap in, the station shows hints from one player's answers, and people from every group ask each other until someone who matches taps.

tap at a hint hunt station
  no open round            -> open one: 30 s of tapping in        (accepted)
  tapping in               -> join, or "Already in"               (accepted / cooldown)
  round running, not in it -> "Round running", no try taken       (cooldown)
  round running, player
    matches every shown hint -> "Found a match!", complete        (accepted)
    doesn't match            -> one of 3 tries, third ends it     (cooldown)

when tapping in ends
  fewer than 3 players or 2 groups -> "Need 3 players"
  no player with fixed answers     -> "No answers yet"
  else pick the target at random, store up to 4 hints (greedy narrowing), never the target
hint 1 at the start, one more every 10 s; lost 10 s after the last

Hints 2 to 4 reach the station as station messages (11.12). Cloud Run throttles the processor between requests, so a timer alone can't be trusted:

advance()   sends each due hint or ending once (compare-and-set on hints_announced)
  called by GET /api/v1/map/hint-hunt   (9.22, own 90 a minute)
  called by a best-effort setTimeout after commit
taps send no messages: one would show over the tap's own answer, such as a win
which hints count, and when a round is lost, go by the clock alone
 apps/event-service/src/
 ├── event/
+│   └── hint-hunt.ts          # the interface the base and the map see
 ├── games/
+│   └── hint-hunt/            # game, schema, screen wording, tests
 └── showcase/games.ts         # + Hint hunt, last in the list
+drizzle/0034_hint_hunt_rounds_keep_hints_and_tries.sql

The ticket's two open points went as it suggested: a player whose answers aren't fixed can tap in, is never the target, and their guess is a miss; a miss shows only the tries left.

Agreement additions for the next version, after 0.14

All in this PR's apps/API-AGREEMENT.md, marked "for the next version, after 0.14 (BAC-203)":

  • Section 4, Games: the hint hunt bullet, id hint_hunt, name "Hint hunt"
  • 6.1: the hint hunt's lines, countdowns and station messages
  • 6.2: the idle lines Hint hunt / Tap to join (and the open seat's, which were missing there)
  • 9.22: GET /api/v1/map/hint-hunt
  • Rate limits: its own 90 a minute
  • Section 5: the index row, and a changelog row

CONTEXT.md defines hint hunt, target and hint. The updates site has a changelog line.

Evidence

  • Before: PUT /api/v1/admin/stations/{id}/game with hint_hunt answers validation_failed.
    After: 27 hint hunt tests through the hand-off and map routes, and the full Event Service suite: 785 passed in 52 files. Typecheck, lint, format, migration and dash checks pass, and the updates site builds.
  • Three review findings each got a test that fails without its fix:
a tap received before a poll started the round costs no try and wins nothing
  before: a player who doesn't match won, against zero hints shown
a winning tap that brings a hint due sends no message to show over its win
  before: a hint countdown ending "Time's up" was sent after "Found a match!"
a tap at a hint's time leaves its message and beep to the next poll
  before: the tap used up the hint's message and it was never sent
  • The map's answer, the station lines and the station messages are checked for every player's user ID and display name, and contain none.

Merge Danger

Door: two-way

Migration 0034 only adds two tables (hint_hunt_rounds, hint_hunt_players). It needs applying on staging and production before a deploy that includes this.

Blast Radius: small

Only stations set to hint_hunt run it. Shared code touched: GameDeps gains db, now and answers, and AnswersGame gains fixedAnswersOf(). The station board lists one more game, last.

Not in this PR:

  • The screens: the station board's choice, the hints on the map, the map answer's screens schema (FRO-190)
  • The real station check on production (HAR-55). Hints arrive on time only while the map, or the timer, triggers them
  • 9.21 (showcase mode, BAC-202) is cited in code but still missing from the agreement

🤖 Generated with Claude Code

… (BAC-203)

A fifth station game, `hint_hunt`. A tap opens 30 seconds of tapping in, and
a round needs 3 players from 2 groups. The target is picked at random from the
players who tapped in with fixed answers, and the station shows one of their
answers as a hint at the start and every 10 seconds, up to four. Any player
who matches every hint shown wins; a miss costs one of 3 tries; nobody winning
within 10 seconds of the last hint loses the round. The target is never
stored, shown or sent.

Hints reach the station as station messages, sent once by a poll of
GET /api/v1/map/hint-hunt (own limit of 90 a minute) or a best-effort timer,
since Cloud Run throttles the processor between requests. Shown hints and
the timeout go by the clock alone.

The agreement's next version gets section 4's bullet, 6.1's lines, 6.2's
idle lines, 9.22 and its rate limit; CONTEXT.md defines hint hunt, target
and hint. Migration 0034 adds the two tables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@hycursion
hycursion merged commit bec2e2f into main Nov 16, 2026
8 checks passed
@hycursion
hycursion deleted the adam/bac-203-stretch-a-station-gives-hints-from-one-players branch November 16, 2026 14:08
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