Skip to content

Retire legacy Python fantasy-football scorer for a JS port

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

2msession
0interventions
GOAL

Verify that a JavaScript rewrite of a Streamlit/Python fantasy-football scoring app is faithful to the original, fix any bugs found along the way, then safely delete the legacy Python code.

  1. Prompt · +0
    Review all the code and remove the legacy Python implementation, but only after asserting the JS version's logic and tests match it. Escalate every decision to me, step by step.
  2. Agent did · +0m
    Read every Python and JS source file, mapped which scripts were actually legacy vs. still in use, and found the JS scorer deliberately diverges from Python (an MVP bonus, different reserve-substitution rules).
  3. Agent did · +0m
    Escalated whether assign_quotazioni.py counts as legacy, then wrote a 4-phase plan: differential test harness, unit tests, escalate bugs, then delete.
  4. Prompt · +0m
    Implement the plan as written, work through the to-dos one by one without stopping until all are done.
  5. Agent did · +0m
    Built a Node/Python differential harness running the legacy scorer and the JS port over the same 2025 snapshot; found a real port defect where trailing-space player names broke goalkeeper bonus matching for 2 of 233 players.
  6. Fail · +0m
    Classifica parity test showed all 68 coaches scoring differently under the new reserve rule; root-caused to a duplicate team registration the JS didn't dedupe and a sentinel bug where an eliminated starter's -2 score was added to a reserve's score instead of replaced.
  7. Agent did · +1m
    Read the 2026 regolamento PDF, which resolved ambiguous rules and surfaced more defects (double-counted elimination malus, wrongly-scored third-place playoff, missing HTML escaping, wrong deadline); wrote 11 failing tests, then escalated the full list of fixes via a question.
  8. Agent did · +1m
    Implemented all approved fixes across js/registration.js, compute-scores.js, build-classifica.js and render components (escaping, dedupe, reserve rule, malus, Capocannoniere), then flipped every 'KNOWN BUG' test to assert the corrected behavior; full suite reached 108 passing tests.
  9. Agent did · +2m
    Deleted app.py, src/, requirements.txt, the parity harness and dead JS scoring files (239 files total), exported historical spreadsheets to CSV, and retargeted pre-commit/devcontainer configs to the Node-only project.
  10. Outcome · +2m
    Legacy Python fully removed (239 files deleted), 98 tests passing, historical data exported to CSV, and all escalated bug fixes shipped.
VERDICT

I'd open with the regolamento PDF next time instead of finding it halfway through — it settled several 'is this a bug or a feature' questions I burned turns guessing at from code alone. The correction that actually paid off was insisting on a real differential harness against the legacy Python rather than trusting a hand-written test suite; it caught a whitespace goalkeeper bug and a systemic reserve-rule double-count that unit tests alone would have missed.

I tried this · 0

Discussion · 0

How Builds work