Skip to content

Debug -1 score bug in fantasy league scoring app

Session from merchantscroll-traces on Hugging Face by vedalken · MIT · condensed by Coders Talk

13ssession
0interventions
GOAL

Investigate why a specific player (Valentina Perghem) shows a score of -1 in the fantasy football (fantacalcio) standings and find the root cause in the scoring logic.

  1. Prompt · +0
    Why does Valentina Perghem have -1 as score?
  2. Agent did · +0m
    Searched for Valentina Perghem across data files, standings, and scoring scripts (groups.json, classifica.json, squadre.json, punteggi.json, compute-scores.js, build-classifica.js) to trace where the -1 originates.
  3. Agent did · +0m
    Read app.js, constants.js, team and fixtures JSON files to understand how the UI/scoring pipeline computes points and applies penalties for missed rounds.
  4. Agent did · +0m
    Checked Cursor terminal transcripts and agent history for prior context, and searched fixtures.json for the players in Valentina's lineup.
  5. Agent did · +0m
    Wrote and ran a temporary Node script (tmp-match.mjs) to fuzzy-match player names via normalization and Levenshtein distance, checked git history of classifica.json for when the -1 appeared, then deleted the scratch script.
  6. Outcome · +0m
    Root cause found: the -1 was a scorer bug treating unplayed starters as eliminated and applying a -2 missed-round penalty per player instead of substituting the reserve correctly; after the malus fix her score is 0, the correct value while the girone is ongoing.
VERDICT

I'd start next time by pointing straight at the scoring script and the malus/reserve substitution rule instead of letting the agent search broadly across all the JSON files first. The deep dive into git history and the fuzzy-match script were what actually surfaced the real bug: the scorer was misapplying a -2 penalty to unplayed starters instead of substituting the reserve.

I tried this · 0

Discussion · 0

How Builds work