Skip to content

Commit 1c5c5ac

Browse files
committed
Stats fixes and member challenge points backfill script
1 parent b3a0193 commit 1c5c5ac

9 files changed

Lines changed: 904 additions & 55 deletions

CUTOVER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Recommended rollout:
8383
| D1 | `POST /members/:handle/stats/rerate` | `{ "challengeId": "<earliest-dev-challenge-uuid>", "trackId": "DEVELOP", "typeId": "Challenge" }` | Use the earliest Development/Challenge `challengeId` for a full-history rerate |
8484
| D2 | `POST /members/:handle/stats/rerate` | `{ "challengeId": "<starting-dev-challenge-uuid>", "trackId": "DEVELOP", "typeId": "Challenge" }` | Re-rates Development/Challenge data from a specific challenge forward |
8585
| D3 | `POST /members/:handle/stats/rerate` | `{ "challengeId": "<starting-mm-challenge-uuid>", "trackId": "DATA_SCIENCE", "typeId": "MARATHON_MATCH" }` | Use the earliest Marathon Match `challengeId` for full history, or a later one for a partial rerate |
86-
| D4 | `node src/scripts/rerateMarathonMatches.js --dry-run` then `node src/scripts/rerateMarathonMatches.js --concurrency 5` | n/a | Bulk rerates native Marathon Match ratings for every discovered competitor from the beginning. Challenge discovery uses only the Marathon Match `ChallengeType` id, so Data Science and Development-track MM imports are replayed together into `DATA_SCIENCE / MARATHON_MATCH`; no `MM_DB_URL` or marathon-match-api schema is required |
86+
| D4 | `node src/scripts/rerateMarathonMatches.js --dry-run` then `node src/scripts/rerateMarathonMatches.js --concurrency 5` | n/a | Bulk rerates native Marathon Match ratings for every discovered competitor from the beginning. Challenge discovery uses only the Marathon Match `ChallengeType` id, so Data Science and Development-track MM imports are replayed together into `DATA_SCIENCE / MARATHON_MATCH`; migrated numeric rows are de-duplicated against canonical UUID rows by MM round number; no `MM_DB_URL` or marathon-match-api schema is required |
8787

8888
- Auth: Bearer token with `rerate:member_stats` scope, or admin JWT
8989
- `challengeId` is required for rerates; use the earliest applicable challenge when you need a full-history rerate.

ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pnpm rerate-marathon-matches -- --dry-run
234234
pnpm rerate-marathon-matches -- --concurrency 5
235235
```
236236

237-
The script discovers completed Marathon Match challenges by `ChallengeType` id and also merges distinct challenge IDs already present in `DATA_SCIENCE / MARATHON_MATCH` `memberStatsHistory`, so migrated legacy MM rows that predate ChallengeType classification are scanned too. It discovers competitors from final review summations using both canonical challenge UUIDs and legacy numeric challenge IDs, filters out user IDs that do not exist in member storage, and calls the native MM rerate engine with no starting challenge so each member is replayed from their first MM event. Current MM ranks are recalculated once after the batch rather than once per member. Historical MM replay does not require `MM_DB_URL` or the marathon-match-api schema.
237+
The script discovers completed Marathon Match challenges by `ChallengeType` id and also merges distinct challenge IDs already present in `DATA_SCIENCE / MARATHON_MATCH` `memberStatsHistory`, so migrated legacy MM rows that predate ChallengeType classification are scanned too. Migrated numeric rows such as `MM 145` are merged with canonical Challenge API rows such as `Marathon Match 145` by MM round number before participant discovery, and rerate seeding prefers complete canonical UUID checkpoints over duplicate legacy rows. The script discovers competitors from final review summations using both canonical challenge UUIDs and legacy numeric challenge IDs, filters out user IDs that do not exist in member storage, and calls the native MM rerate engine with no starting challenge so each member is replayed from their first MM event. Current MM ranks are recalculated once after the batch rather than once per member. Historical MM replay does not require `MM_DB_URL` or the marathon-match-api schema.
238238

239239
To re-run a configured rating path for every member who participated in the configured challenge set, use the bulk script instead of the member-scoped API:
240240

0 commit comments

Comments
 (0)