Practical debugging, step by step

From challenge to progress: XP, skills and achievements

The progression pipeline stays explainable when each stage has one job and XP is awarded once.

DoesItHold Editorial · · reviewed · progression-pipeline-001

Direct answer

Infer the relevant skills, award the difficulty value once to each, update its level curve, then evaluate adaptive difficulty, the daily streak and reachable achievements as separate effects.

A difficulty-3 challenge awards 140 XP. A level-1 skill needs 100 XP, so it moves to level 2 with 40 XP carried toward the next threshold of round(100 × 2^1.5) = 283.

The same result may advance the first valid local-day streak event and unlock a milestone. Neither action adds the 140 XP again, and achievement xpReward remains a legacy unapplied field.

Trace the failure
  1. 01
    Solveone accepted challenge result
  2. 02
    Inferidentify the relevant skills
  3. 03
    Awardapply the difficulty XP once
  4. 04
    Adaptchoose the next difficulty separately
One accepted solution produces one XP award per inferred skill; adaptation selects the next difficulty without awarding XP again.

Minimal example

Scrollable code region

Buggy
awardXp(skill, 140)
adjustDifficulty(skill, xpGained: 140)
Corrected
awardXpOnce(skill, 140)
adjustDifficulty(skill, solved: true)

What changes: A difficulty-3 solution adds 140 XP to each inferred skill exactly once; streak and achievements observe the result but do not duplicate it.

Debugging method

Trace a single solution identifier through skill inference, one idempotent award, level carry, difficulty choice and milestone checks.

  1. Verify difficulty 1–5 maps to 60/100/140/180/220.
  2. Submit one solution and confirm each inferred skill changes once.
  3. Reach skill level 5 and confirm progress displays 100%.
  4. Confirm the weekly board is ordered only by server-finalized solved_count.
  5. Verify changing client-side progress cannot alter public position.

Common wrong fix

Awarding XP inside adaptive difficulty duplicates the main skill. Treating weekly solved_count as XP similarly gives one stored number two incompatible meanings.

Limits and edge cases

Skill inference is a product classification, not a complete analysis of everything learned. Sync is best-effort, and a pending local update may take time to appear on another device.

Sources