Problem
scoreCrack(ch, -5) returns 150, beating the first-try score of 100; NaN attempts yield NaN scores. Negative attempts should be impossible.
Where
lib/scoring.ts (efficiency = Math.max(0.4, 1 - priorAttempts * 0.1), no floor on attempts).
Acceptance
Add a failing test first asserting scoreCrack(ch, -1) clamps to the first-try value and scoreCrack(ch, NaN) never returns NaN. Then fix.
Problem
scoreCrack(ch, -5)returns 150, beating the first-try score of 100;NaNattempts yieldNaNscores. Negative attempts should be impossible.Where
lib/scoring.ts(efficiency = Math.max(0.4, 1 - priorAttempts * 0.1), no floor on attempts).Acceptance
Add a failing test first asserting
scoreCrack(ch, -1)clamps to the first-try value andscoreCrack(ch, NaN)never returnsNaN. Then fix.