Skip to content

Commit b3a0193

Browse files
committed
Updates to rename AI to AI Engineering
1 parent a31e35c commit b3a0193

32 files changed

Lines changed: 5172 additions & 516 deletions

ReadMe.md

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ The following parameters can be set in config files or in env variables:
113113
- MISC_SECURE_FIELDS: Misc identifiable info fields, only admin, M2M, or member himself can fetch these fields
114114
- STATISTICS_SECURE_FIELDS: Member Statistics identifiable info fields, only admin, M2M, or member himself can fetch these fields
115115
- STATS_READ_SOURCE: Controls stats read backend, `unified` (default, new tables) or `legacy` (pre-refactor tables)
116-
- RATING_PATHS: JSON array of tag- and skill-based Development Challenge and Marathon Match rating paths. Each entry has `name`, optional `tags`, optional `skillIds`, and optional `track` (`DATA_SCIENCE`, `DEVELOP`, or `DEVELOPMENT`); at least one of `tags` or `skillIds` is required. Tags match any listed challenge tag, while skill IDs require every listed challenge skill. Defaults to `[{"name":"AI","track":"DATA_SCIENCE","tags":["AI","AI Exponential League"]}]`. Re-rate a path by passing `ratingName` to `POST /members/{handle}/stats/rerate`; rows are stored under `{track} / {name}` in unified stats.
116+
- RATING_PATHS: JSON array of tag- and skill-based Development Challenge and Marathon Match rating paths. Each entry has `name`, optional `tags`, optional `skillIds`, and optional `track` (`DATA_SCIENCE`, `DEVELOP`, or `DEVELOPMENT`); at least one of `tags` or `skillIds` is required. Tags match any listed challenge tag, while skill IDs require every listed challenge skill. Defaults to `[{"name":"AI Engineering","track":"DATA_SCIENCE","tags":["AI","AI Exponential League"]}]`. Re-rate a path by passing `ratingName` to `POST /members/{handle}/stats/rerate`; rows are stored under `{track} / {name}` in unified stats.
117117
- HEALTH_CHECK_TIMEOUT: health check timeout in milliseconds
118118

119119
Set the following environment variables used by bus API to get TC M2M token (use 'set' insted of 'export' for Windows OS):
@@ -138,21 +138,59 @@ The following test parameters can be set in config file or in env variables:
138138
- M2M_UPDATE_ACCESS_TOKEN: M2M update (including 'delete') access token
139139
- S3_ENDPOINT: endpoint of AWS S3 API, for unit and e2e test only; default to `localhost:9000`
140140

141+
## Challenge Point Profile Data
142+
143+
Point-based challenge prizes are mirrored into member-api so profile pages can show totals and a per-challenge breakdown without reading tc-finance-api.
144+
145+
Autopilot replaces the rows for one challenge with:
146+
147+
```http
148+
PUT /v6/members/challenge-points/{challengeId}
149+
Content-Type: application/json
150+
151+
{
152+
"challengeName": "AI Points Challenge",
153+
"points": [
154+
{ "userId": 123456, "placement": 1, "points": 500 }
155+
]
156+
}
157+
```
158+
159+
`GET /v6/members/{handle}` includes a public `challengePoints` object by default:
160+
161+
```json
162+
{
163+
"challengePoints": {
164+
"total": 2847,
165+
"challenges": 14,
166+
"details": [
167+
{
168+
"challengeId": "challenge-uuid",
169+
"challengeName": "AI Points Challenge",
170+
"userId": 123456,
171+
"placement": 1,
172+
"points": 500
173+
}
174+
]
175+
}
176+
}
177+
```
178+
141179
## Rating Path Operations
142180

143181
Historical rating paths are configured with `RATING_PATHS`. The default AI path is:
144182

145183
```json
146184
[
147185
{
148-
"name": "AI",
186+
"name": "AI Engineering",
149187
"track": "DATA_SCIENCE",
150188
"tags": ["AI", "AI Exponential League"]
151189
}
152190
]
153191
```
154192

155-
The `track` value controls where the rating is stored in unified stats. Use `DATA_SCIENCE` to store rows under `DATA_SCIENCE / AI`, or `DEVELOP` / `DEVELOPMENT` to store rows under `DEVELOP / AI`. The rating engine includes both Marathon Match results and `challenge` type Development Challenge results when the challenges match the configured tags or skill IDs. When a configured rating name does not already exist as a `ChallengeType`, rerate creates a deterministic custom type row so unified `memberStats` foreign keys remain valid.
193+
The `track` value controls where the rating is stored in unified stats. Use `DATA_SCIENCE` to store rows under `DATA_SCIENCE / AI Engineering`, or `DEVELOP` / `DEVELOPMENT` to store rows under `DEVELOP / AI Engineering`. The rating engine includes both Marathon Match results and `challenge` type Development Challenge results when the challenges match the configured tags or skill IDs. When a configured rating name does not already exist as a `ChallengeType`, rerate creates a deterministic custom type row so unified `memberStats` foreign keys remain valid.
156194

157195
### Rating Calculation Details
158196

@@ -170,7 +208,7 @@ Content-Type: application/json
170208
171209
{
172210
"challengeId": "earliest-tagged-challenge-id-for-that-member",
173-
"ratingName": "AI"
211+
"ratingName": "AI Engineering"
174212
}
175213
```
176214

@@ -201,33 +239,33 @@ The script discovers completed Marathon Match challenges by `ChallengeType` id a
201239
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:
202240

203241
```bash
204-
pnpm rerate-rating-path -- --rating-name AI --dry-run
205-
pnpm rerate-rating-path -- --rating-name AI --concurrency 5
242+
pnpm rerate-rating-path -- --rating-name "AI Engineering" --dry-run
243+
pnpm rerate-rating-path -- --rating-name "AI Engineering" --concurrency 5
206244
```
207245

208246
The script discovers distinct user IDs from all rated challenges matching the configured path, then rerates each user from the start of the path so complete history is written without requiring individual handles or challenge IDs. It writes successfully processed user IDs to `rerateRatingPath.processedUserIds.json` by default. Marathon Match path events are also read from review summations and do not require `MM_DB_URL`.
209247

210248
Useful script options:
211249

212250
```bash
213-
pnpm rerate-rating-path -- --rating-name AI --limit 100
214-
pnpm rerate-rating-path -- --rating-name AI --user-id 12345
215-
pnpm rerate-rating-path -- --rating-name AI --user-ids 12345,67890
216-
pnpm rerate-rating-path -- --rating-name AI --processed-user-ids-path /tmp/ai-rerated-users.json
251+
pnpm rerate-rating-path -- --rating-name "AI Engineering" --limit 100
252+
pnpm rerate-rating-path -- --rating-name "AI Engineering" --user-id 12345
253+
pnpm rerate-rating-path -- --rating-name "AI Engineering" --user-ids 12345,67890
254+
pnpm rerate-rating-path -- --rating-name "AI Engineering" --processed-user-ids-path /tmp/ai-rerated-users.json
217255
```
218256

219257
To view one member's rating and history for a `DATA_SCIENCE` path:
220258

221259
```http
222-
GET /v6/members/{handle}/stats?trackId=DATA_SCIENCE&typeId=AI
223-
GET /v6/members/{handle}/stats/history?trackId=DATA_SCIENCE&typeId=AI
260+
GET /v6/members/{handle}/stats?trackId=DATA_SCIENCE&typeId=AI%20Engineering
261+
GET /v6/members/{handle}/stats/history?trackId=DATA_SCIENCE&typeId=AI%20Engineering
224262
```
225263

226264
To view one member's rating and history for a `DEVELOPMENT` path, use the canonical unified track name:
227265

228266
```http
229-
GET /v6/members/{handle}/stats?trackId=DEVELOP&typeId=AI
230-
GET /v6/members/{handle}/stats/history?trackId=DEVELOP&typeId=AI
267+
GET /v6/members/{handle}/stats?trackId=DEVELOP&typeId=AI%20Engineering
268+
GET /v6/members/{handle}/stats/history?trackId=DEVELOP&typeId=AI%20Engineering
231269
```
232270

233271
To view aggregate rating distribution data:

docs/swagger.yaml

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,49 @@ paths:
170170
description: Internal server error
171171
schema:
172172
$ref: '#/definitions/ErrorModel'
173+
'/members/challenge-points/{challengeId}':
174+
put:
175+
tags:
176+
- Basic
177+
description: |-
178+
Replace the stored point awards for one challenge. This endpoint mirrors point-based challenge prize payouts into member-api so member profiles can return challenge point totals and per-challenge details.
179+
180+
Authorization:
181+
- M2M scopes: `update:user_profiles` or `all:user_profiles`.
182+
security:
183+
- bearer: []
184+
parameters:
185+
- in: path
186+
name: challengeId
187+
required: true
188+
type: string
189+
description: Challenge identifier whose point rows should be replaced.
190+
- in: body
191+
name: body
192+
required: true
193+
schema:
194+
$ref: '#/definitions/ChallengePointsUpdateRequest'
195+
responses:
196+
'200':
197+
description: OK
198+
schema:
199+
$ref: '#/definitions/ChallengePointsUpdateResult'
200+
'400':
201+
description: Bad request data
202+
schema:
203+
$ref: '#/definitions/ErrorModel'
204+
'401':
205+
description: Miss or wrong authentication credentials
206+
schema:
207+
$ref: '#/definitions/ErrorModel'
208+
'403':
209+
description: No permission
210+
schema:
211+
$ref: '#/definitions/ErrorModel'
212+
'500':
213+
description: Internal server error
214+
schema:
215+
$ref: '#/definitions/ErrorModel'
173216
'/members/{handle}':
174217
get:
175218
tags:
@@ -1857,7 +1900,7 @@ paths:
18571900
description: UUID or legacy numeric challenge identifier that starts the rerate request.
18581901
ratingName:
18591902
type: string
1860-
description: Optional configured rating path name, for example `AI` or `Java MySQL`.
1903+
description: Optional configured rating path name, for example `AI Engineering` or `Java MySQL`.
18611904
trackId:
18621905
type: string
18631906
enum:
@@ -2232,6 +2275,68 @@ definitions:
22322275
description: 'ISO-8601 formatted date times (YYYY-MM-DDTHH:mm:ss.sssZ)'
22332276
updatedBy:
22342277
type: string
2278+
challengePoints:
2279+
$ref: '#/definitions/MemberChallengePointsSummary'
2280+
MemberChallengePointsSummary:
2281+
type: object
2282+
properties:
2283+
total:
2284+
type: integer
2285+
description: Total challenge points earned by the member.
2286+
challenges:
2287+
type: integer
2288+
description: Number of challenge point award rows returned for the member.
2289+
details:
2290+
type: array
2291+
items:
2292+
$ref: '#/definitions/MemberChallengePointsDetail'
2293+
MemberChallengePointsDetail:
2294+
type: object
2295+
properties:
2296+
challengeId:
2297+
type: string
2298+
challengeName:
2299+
type: string
2300+
userId:
2301+
type: integer
2302+
placement:
2303+
type: integer
2304+
points:
2305+
type: integer
2306+
ChallengePointsUpdateRequest:
2307+
type: object
2308+
required:
2309+
- challengeName
2310+
- points
2311+
properties:
2312+
challengeName:
2313+
type: string
2314+
points:
2315+
type: array
2316+
items:
2317+
$ref: '#/definitions/ChallengePointAward'
2318+
ChallengePointAward:
2319+
type: object
2320+
required:
2321+
- userId
2322+
- placement
2323+
- points
2324+
properties:
2325+
userId:
2326+
type: integer
2327+
placement:
2328+
type: integer
2329+
points:
2330+
type: integer
2331+
ChallengePointsUpdateResult:
2332+
type: object
2333+
properties:
2334+
challengeId:
2335+
type: string
2336+
challengeName:
2337+
type: string
2338+
updated:
2339+
type: integer
22352340
MemberHandleUpdate:
22362341
type: object
22372342
required:

0 commit comments

Comments
 (0)