Repository navigation
fix(backend): hint hunt hints reach the station on time (BAC-206) - #378
Merged
hycursion merged 3 commits intoNov 16, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-206) Review fixes on the station alarms: - A step already due when its round's transaction commits still gets its wake, since the request may end before anything else advances the round. - Each wake is the step's time plus 250 ms, so a small clock difference between Cloudflare and Cloud Run can't bring the callback before the step, when it would do nothing. - send() and wake() share one bounded POST to the GeekyKey Service. - Station messages and wakes share the unknown-station check, and its 400 issues carry Zod's code, as section 2 says. - The GeekyKey Service README says what the station's object stores. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 tasks
Keeps both 16 Nov changelog rows in the agreement, BAC-208's first, and applies the formatter to the hint hunt files from BAC-208. Co-Authored-By: Claude Opus 5.5 <[email protected]>
hycursion
deleted the
adam/bac-206-stretch-hint-hunt-hints-reach-the-station-on
branch
November 16, 2026 23:27
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.
Summary
On production the hint hunt's hints arrived late or not at all when no map was open (HAR-55, 16 Nov). Cloud Run gives the Event Service a processor only while a request is in progress, so the timer that sends hints 2 to 4 and the round's end didn't fire between requests. In one round the first message the station got was hint 3, 25 seconds late.
The fix: each station's Durable Object on the GeekyKey Service, which already holds the station's socket, now also keeps the times the hint hunt's steps are due and sets an alarm for the earliest. When the alarm fires, the object calls the Event Service, and that request has a processor while it does the step and sends the message.
station_wake_abandoned, drops the due wakes and keeps the later ones.wrangler.jsonc.apps/event-service/src/ ├── event/handoff-routes.ts # + POST /geekykey/v1/wake ├── event/station-messages.ts # + wake(); send() and wake() share one bounded POST └── games/hint-hunt/hint-hunt.ts # every scheduled step requests a wake apps/geekykey-service/src/ +├── station-wake-routes.ts # POST /api/v1/station-wakes ├── station-message-routes.ts # Event Service auth and the station check, shared with wakes └── station-sockets.ts # wake times in storage, alarm() calls the Event Service packages/handoff/ # wake schemas and their JSON Schema filesAgreement 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-206)":POST /api/v1/station-wakeson the GeekyKey Service,{ station_id, at }, answered202 { scheduled: true }.atmay be at most 1 minute past or 10 minutes ahead.POST /geekykey/v1/wakeon the Event Service,{ station_id }, answered204.invalid_event_service_keyand the Event Service key also cover station wakes.The unknown-station
400on station messages now carries Zod'scode: "custom"in its issue, as section 2 says issues follow Zod's format. It was missing before.ADR 0009 still says the object stores nothing. BAC-207 updates it. The GeekyKey Service README is updated here.
Evidence
wrangler deploy --dry-runpass.Deploying
Merging deploys both services: the Event Service through the Deploy workflow and the Worker through Workers Builds. Until both are live the wake requests fail and are logged as
station_wake_failed. The hint hunt then behaves as it does today.🤖 Generated with Claude Code