• Stefy Lanza (nextime / spora )'s avatar
    township: pack + price + upload matches to townshipcombatleague.com · c84c6208
    Stefy Lanza (nextime / spora ) authored
    Add ZIP packing, anti-arbitrage odds generation, and chunked upload of a
    rendered match to the Township Combat League server (mbetterd 3-step API).
    
    - New tools/township_upload.py: generate_odds (constraint-aware, retries up
      to 10x, verified with the server's exact sure-bet checks), check_arbitrage,
      build_match_zip (OVER/UNDER/WIN1-2/KO1-2/RET1-2/DRAW, best enhanced variant),
      upload_match (create -> chunked zip -> finalize, proxy-safe, progress_cb),
      and a content signature for upload-state invalidation.
    - Run page: server endpoint/token/fixture-id, "upload after render" checkbox,
      and configurable odds ranges; persisted via /save-config + load_config.
    - Match page: generate/regenerate odds & ZIP, upload with a progress bar
      (polls /job/<id>), and an "Uploaded" badge that clears when the match is
      re-rendered, enhanced, edited or deleted.
    - Auto-upload after a full render when configured; skips (keeps local) any
      match whose odds fail the arbitrage check after 10 tries.
    
    KO/RET odds are coupled to wins by the product cap, so high maxima are not
    reachable in a no-arbitrage book; the generator samples wins first then bounds
    KO/RET accordingly.
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    c84c6208
township_upload.py 17.6 KB