Skip to main content
← Back to list
01Issue
BugTriagedSwamp CLI
Assigneeskeeb

Relationships

#635 Tier-up announcements never fire for direct score contributions (badge awards, feed credits)

Opened by keeb · 6/11/2026

Tier promotions caused by direct score contributions are never announced in Discord, and the missed announcement is permanently lost — no later process catches it.

Observed case: the author of issue #633 was awarded Quality Initiate (+50,000 pts) when their issue shipped, jumping Sludge Whelp (1,271 pts) → Murk Lurker (~51,271 pts). The badge announcement posted; the tier-up announcement never did. As a knock-on, the instant Discord role sync (driven by the tier_up event) never fired either — the role only arrives via the periodic reconciler sweep.

Root cause: tier-up detection lives in exactly one place — lib/app/process-score-batch.ts — which compares the persisted totalScore read before refresh (priorTier) against the recomputed total. But UserScore.contribute() recomputes totalScore synchronously, so any path that applies a contribution and saves (outside the batch) persists the post-crossing total immediately:

  • lib/app/process-quality-badge-awards.ts — applies award📛<id> points, announces the badge only, never compares tiers, and doesn't even enqueue a score-refresh nudge.
  • lib/app/process-feed-post-score-event.ts — applies content:feed-post:<id> credit, then nudges the batch — but by the time the batch runs, priorScore already includes the contribution, so the ordinal delta is zero.

In both cases the crossing window closes at save time. The batch's prior-vs-new comparison only detects crossings caused by telemetry-metric recomputation inside the batch itself.

Suggested fix shape: make the UserScore aggregate report the tier crossing — contribute() (or the save path) knows both the before and after totals, so it can surface "ordinal changed X → Y". Every caller (badge awards, feed credits, batch refresh) then routes that through announceTierUp, making announcements independent of which path moved the score. The tier_up event also restores instant Discord role sync for these paths.

Environment: observed on swamp-club production, 2026-06-11, app at commit 9ebcd8d.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW

Triaged

6/11/2026, 11:05:52 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
keeb assigned keeb6/11/2026, 11:04:40 PM

Sign in to post a ripple.