diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d9726c4a..117c1067 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -190,8 +190,28 @@ jobs: # that hardcodes one environment's tables and would silently hit # prod during a dev deploy. Quote the table name for the suffix to # match, e.g. "Picks-", or use the __ENV__ placeholder. - if grep -nE '"[^"]*-(dev|prod)"' "$file"; then - echo "::error file=$file::Hardcoded dev/prod table-name suffix. Write the suffix as the __ENV__ placeholder so CI scopes the migration to $ENV." + # + # Exception: a file carrying the BACKTRACK-PROD-PINNED marker. The + # dev backtracking tables were deleted Oct 2026 (rows removed + # 2026-10-24; docs/backtrack_dev_deleted.md) and the standing + # migrate job must never recreate them, so their migrations target + # the '-prod' tables literally instead of via __ENV__ - otherwise a + # PR deploy with ENV=dev would re-CREATE the retired -dev shells. + if grep -q 'BACKTRACK-PROD-PINNED' "$file"; then + pinned=1 + else + pinned=0 + fi + if grep -nE '"[^"]*-dev"' "$file"; then + echo "::error file=$file::Hardcoded dev table-name suffix. Write the suffix as the __ENV__ placeholder so CI scopes the migration to $ENV (dev backtracking tables are deleted and must never be recreated)." + status=1 + fi + if grep -nE '"[^"]*backtrack-__ENV__' "$file"; then + echo "::error file=$file::A backtrack table is scoped via __ENV__: a PR deploy (ENV=dev) would recreate the deleted -dev backtracking shell. Pin the statement to the -prod table literally and mark the file BACKTRACK-PROD-PINNED (see docs/backtrack_dev_deleted.md)." + status=1 + fi + if [ "$pinned" -eq 0 ] && grep -nE '"[^"]*-prod"' "$file"; then + echo "::error file=$file::Hardcoded dev/prod table-name suffix. Write the suffix as the __ENV__ placeholder so CI scopes the migration to $ENV (only BACKTRACK-PROD-PINNED files may hardcode -prod: dev backtracking is deleted)." status=1 fi done @@ -284,14 +304,22 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 + - name: Run deploy script run: | chmod +x build_scripts/deploy.sh + export GITHUB_DISPATCH_TOKEN="${MLPICKS_DISPATCH_TOKEN:-}" ./build_scripts/deploy.sh env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} + # Forwarded by deploy.sh's CFN_PARAM_OVERRIDES when set; unset is + # allowed (MLPicksKick relays fail loudly per kick instead). + # Repo secret is MLPICKS_DISPATCH_TOKEN (Actions forbids secret + # names starting with GITHUB_); deploy.sh keeps its script-env + # name GITHUB_DISPATCH_TOKEN, which maps to the Lambda env var. + MLPICKS_DISPATCH_TOKEN: ${{ secrets.MLPICKS_DISPATCH_TOKEN }} dev-integration: needs: deploy diff --git a/.github/workflows/ml-picks.yml b/.github/workflows/ml-picks.yml index b577424e..6ce29f21 100644 --- a/.github/workflows/ml-picks.yml +++ b/.github/workflows/ml-picks.yml @@ -1,45 +1,274 @@ name: ML Daily Picks -# STARTER SCAFFOLD - REGISTRATION ONLY, NOT THE REAL PIPELINE. -# -# GitHub only registers (and only allows manual dispatch of) workflows that -# live on the default branch. Until PR #146 merges, this placeholder is that -# registration for .github/workflows/ml-picks.yml: once this lands on main, -# the Actions page shows the workflow and its "Run workflow" branch selector -# can dispatch ANY branch. Choose feat/final-clean to run the REAL pipeline: -# workflow_dispatch executes the workflow file AS IT EXISTS ON THE SELECTED -# REF (main -> this placeholder; feat/final-clean -> the real pipeline, with -# the repo secrets the owner configured). -# -# It deliberately does NOT run the inference here: main has no Supabase -# secrets/credentials yet, and this placeholder exists only so the workflow -# is registered and dispatch-able. PR #146 replaces this file's content with -# the full real pipeline (schedule + repository_dispatch + the picks job); -# the `name:` matches the real workflow so the registration carries over as -# ONE workflow, not a rename. docs/ml-picks-runbook.md (S3 note). +# Predict-only daily ML picks (Picks-{ENV}) - the replacement for the retired +# MLPicks Lambda/image surface. SAME inference path (the artifact -> Supabase +# read -> build_frame/add_derived -> ensemble rank-mean -> daily_picks) with +# the ONE write mode stat_update in +# smartscore/scripts/backtrack/run_daily_picks.py: fill ONLY the stat column +# on the site's OWN full-slate Picks-{ENV} rows (no wipe, no insert; the +# top-3 challenge picks are log/summary output). The script's CLI is exactly +# three knobs - --date, --dry, --env (dev|prod; unset = the step-level ENV +# below): source is HARD-PINNED to prod and history is the ONE shared +# -prod ledger (the Picks table is NEVER wiped by the ML path); $0.00 infra. +# docs/ml-picks-runbook.md. on: + schedule: + # 05:30 ET-equivalent to the retired EventBridge trigger's cron 30 9. + # DST caveat: GitHub cron is a FIXED UTC clock while the pipeline's + # "today" is America/Toronto - 09:30 UTC is 05:30 EDT but 04:30 EST, + # so the local wall-clock anchor shifts one hour across clock changes + # (same accepted behaviour the template documented for its crons). + - cron: '30 9 * * *' workflow_dispatch: inputs: date: description: 'Slate date YYYY-MM-DD (default: ET-today)' required: false default: '' - type: string dry: - description: 'Smoke run: skip the Picks write (starter default true)' + description: 'Smoke run: assemble the picks, skip the Picks write' type: boolean required: false - default: true + default: false + # Manual-dispatch override of the job-level ENV (below) - the fail-safe + # default 'prod' means a dispatch that forgets the input still lands on + # Picks-prod, never on a silent fallback. Scheduled and + # repository_dispatch runs DO NOT read this input at all: they resolve + # ONLY the job-level ENV: prod (the "Resolve the picks ENV" step), so a + # cron run can never drift to dev. docs/ml-picks-runbook.md §1 (env matrix). + environment: + description: 'Picks table to stat-fill (dev|prod). Source (prod) and the shared history ledger are hard-pinned, not knobs' + type: string + required: false + default: prod + # Per-game kicks (race-fixed): each TriggerStateMachineAt_* rule + # (utility.py schedule_run, game_start + PIPELINE_RESTART_OFFSET_MIN) + # restarts the pipeline state machine, whose final KickMLPicks state + # invokes the MLPicksKick Lambda - which repository_dispatches here, only + # AFTER the run's SaveToDb/PublishToDb writes completed (so the pass never + # reads stale groups). The nightly cron remains the default full-day + # fallback pass, and this path is ADDITIVE. + repository_dispatch: + types: [ml-picks-game] permissions: contents: read +# Picks writes are per-day upserts; serialize reruns rather than racing them. +concurrency: + group: ml-picks + cancel-in-progress: false + jobs: - ml-picks: + picks: runs-on: ubuntu-latest + # The picks pass is now narrow: one bounded gap-fill (a couple of NHL API + # requests per missing completed day - rarely more than yesterday's slate) + # + one artifact download + inference over published history. 45 min keeps + # a pathological NHL API lag (a long missing-days gap, capped at 14) from + # hanging the job; typical runs finish well under 10. + timeout-minutes: 45 + env: + # Scheduled + repository_dispatch runs resolve ONLY this job-level + # default (schedule has no `inputs` path): prod, i.e. Picks-prod / + # Player-Snapshots-prod / *-backtrack-prod. Manual workflow_dispatch + # overrides it per-run via the `environment` input (WRITE side only) + # at the "Resolve the picks ENV" step (ENV: + # steps.picks_env.outputs.picks_env on the script steps). The + # LIVE-READ source and the history are NOT env knobs at all: the + # script hard-pins source=prod and reads the ONE shared -prod ledger + # (run_daily_picks' SOURCE_ENV/HISTORY_ENV constants + the + # shared-ledger routing, 027ef47). GitHub Actions sets job/step env + # in the PROCESS env before `python` starts, so config.py's + # import-time read (config.ENV = + # os.environ.get("ENV", "dev"), config.py:12) resolves it + # unambiguously - the step-level ENV IS the bind point. + # docs/ml-picks-runbook.md §1. + ENV: prod + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }} + SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} + # Artifact-fact convention: whatever the last owner refresh pushed, under + # the dated prefix read at run time (prefix predict/ml = both S3's + # ML_ARTIFACT_PREFIX and Storage's ML_ARTIFACT_STORAGE_PREFIX). + # DEFAULT source is SUPABASE STORAGE (ML_STORAGE_BUCKET bucket + # `ml-artifacts`, PRIVATE bucket, read with the SUPABASE_* secrets the + # job already needs - NO extra owner secret). The S3 read (ML_S3_BUCKET) + # stays OPTIONAL for owner-side AWS setups. docs/ml-picks-runbook.md §2/§3 + ML_STORAGE_BUCKET: ${{ secrets.ML_STORAGE_BUCKET || 'ml-artifacts' }} + ML_ARTIFACT_STORAGE_PREFIX: predict/ml + ML_S3_BUCKET: ${{ secrets.ML_S3_BUCKET }} steps: - - name: Placeholder registration scaffold + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.12' + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Cache uv + uses: actions/cache@v4 + with: + path: ${{ runner.temp }}/setup-uv-cache + key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} + restore-keys: | + uv-${{ runner.os }}- + + # Mirror of deploy.yml's deploy-job install (uv sync --no-dev, pinned + # by uv.lock) - runtime deps only; lint/dev groups are not needed here. + - name: Install dependencies + run: uv sync --frozen --no-dev + + # ---------------- Stage-2 gap-fill (published per-game raw columns) ---- + # The 14 shot/TOI features are recomputed EXACTLY at inference time from + # the published per-game record in Supabase (run_daily_picks. + # shot_block_from_history -> model.shot_features_from_games over the + # stage-2 raw columns game_goals/game_shots/game_toi_min). This FIRST + # step tops up any completed game days the nightly publish has not + # covered yet - bounded: the schedule endpoint once per missing DAY + # (typically exactly one: yesterday) plus one boxscore request per + # FINAL game that day; NO season sweeps, no local store, no dumps. + # Games in a non-terminal state (LIVE/FUT) are skipped - the + # fetch_boxscore cache-hostage guard (backfill_missing_days. + # TERMINAL_GAME_STATES) - and replayed on a later pass once final. + # dry=true: the step runs READ-ONLY (fetch + log, no upserts) and the + # inference pass below also skips its Picks write. + # NOTE: this step needs the stage-2 DDL to have landed on + # Player-Snapshots-backtrack-{env}; run_daily_picks fails loudly naming + # 20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql if + # the columns are missing. + - name: Resolve the slate date (ET) + id: slate + run: | + D="${DISPATCH_DATE:-$(TZ=America/Toronto date +%F)}" + echo "et_date=${D}" >> "$GITHUB_OUTPUT" + env: + DISPATCH_DATE: ${{ inputs.date || github.event.client_payload.date }} + # ENV resolution - the safety-critical, fail-closed form: + # * scheduled + repository_dispatch runs (no dispatch input) resolve + # ONLY the job-level env: ENV: prod -> Picks-prod; no silent env + # default can land them on the wrong Picks table; + # * workflow_dispatch overrides via the `environment` input (default + # prod; set dev to stat-fill Picks-dev). The WRITE env decides + # NOTHING else: the LIVE read is PLAYER-Snapshots-prod (hard-pinned, + # source=prod: prod is the source of truth for feature reads; the + # -dev backtrack/live shells are gone as tables-of-record) and the + # history is the ONE shared -prod ledger. + # `inputs.environment` is NOT referenced unconditionally: on a + # schedule event it resolves EMPTY, and an empty step-level ENV + # would override the job-level prod -> config.ENV's 'dev' fallback. + # Gated the other way round (empty -> job ENV), that cannot happen. + # * the resolved value is whitelisted dev|prod (uncommented, this is + # the ONLY whitelist left) and echoed so the resolved write target + # is visible in the job log ("env: prod") - hard-fail otherwise. + # The step-level ENV below binds the SAME resolved value to both script + # steps (GitHub Actions puts it in the process env before python + # starts, so config.py's import-time read is unambiguous). + - name: 'Resolve the picks ENV (write side)' + id: picks_env + env: + DISPATCH_ENV: ${{ inputs.environment }} + run: | + RESOLVED="${DISPATCH_ENV}" + if [ -z "${RESOLVED}" ]; then + RESOLVED="${ENV}" + fi + case "${RESOLVED}" in + dev|prod) ;; + *) + echo "::error::environment must be dev or prod (got '${RESOLVED}')" + exit 1 ;; + esac + echo "env: ${RESOLVED}" + echo "picks_env=${RESOLVED}" >> "$GITHUB_OUTPUT" + - name: Backfill the last published date's missing completed game days (NHL API, bounded) + env: + DISPATCH_DRY: ${{ inputs.dry || github.event.client_payload.dry }} + ENV: ${{ steps.picks_env.outputs.picks_env }} + run: | + # through YESTERDAY (ET): the picks pass's own first step re-invokes + # the helper (backfill_missing_days.backfill) with the same window; + # the per-date markers make the second call a no-op skip. Games on + # the slate date itself are never backfilled here - they are not + # final when the morning run fires. + echo "env: ${ENV}" + ARGS="--env ${ENV} --through-date $(TZ=America/Toronto date -d yesterday +%F)" + if [ "${DISPATCH_DRY:-false}" == "true" ]; then + ARGS="${ARGS} --dry" + echo "dry=true: the backfill step runs READ-ONLY (no upserts)" + fi + uv run --frozen python smartscore/scripts/backtrack/backfill_missing_days.py ${ARGS} + # Prior stages this replaced (both REMOVED from the picks path): + # * `dump_store.py --load` (rebuild data/raw_nhl.sqlite from the + # committed data/dumps/ dumps) and `refresh_store.py --skip-load` + # (incremental NHL crawl of the current season, incl. the + # data/cache crawl-cache step). The runner no longer holds or + # rebuilds the raw store at all: Supabase IS the live data plane, + # the dumps stay the committed backup, and refresh_store.py + # survives ONLY as an owner-side offline utility (make + # backtrack-refresh) for store maintenance. + + # Artifact source step: the script resolves the artifact in this order + # (docs/ml-picks-runbook.md §2): --artifact PATH (local file, always + # wins) -> S3 bucket/prefix (only when ML_S3_BUCKET is configured AND + # AWS credentials exist) -> Supabase Storage ML_STORAGE_BUCKET/prefix + # (the DEFAULT here: same SUPABASE_* secrets this job already needs - + # no AWS at all). If S3 is configured but its secrets are absent, the + # run falls through to Storage automatically. + # Steps 3+4: run_daily_picks fetches the artifact (Storage dated-prefix + # latest by default) then performs inference via model.py + its + # stat-only Picks PATCH (stat_update) - the same inference path the + # handler ran. + + # Trigger-source resolution, workflow_dispatch semantics preserved: + # explicit inputs.date/inputs.dry win; repository_dispatch (the + # per-game kick, fired from the state machine's KickMLPicks state) + # supplies client_payload {date, dry, context: 'post-game-start'}. + # Multiple kicks per date are fine and expected (one per state-machine + # run): each is one extra idempotent pass - the write is stat_update + # (the ONLY mode): a read-modify-write per-row PATCH of ONLY the stat + # column, so a repeat pass for a date re-fills the CURRENT slate + # (never wipes, never inserts). The live read is Player-Snapshots-prod + # and the history is the shared -prod ledger regardless of ENV + # (hard-pinned in run_daily_picks). + # docs/ml-picks-runbook.md ("Per-game kick"). + - name: Run the daily ML picks pass + env: + DISPATCH_DATE: ${{ inputs.date || github.event.client_payload.date }} + DISPATCH_DRY: ${{ inputs.dry || github.event.client_payload.dry }} + # WRITE side: the resolved picks env -> Picks-{ENV} (config.ENV). + ENV: ${{ steps.picks_env.outputs.picks_env }} + run: | + echo "env: ${ENV}" + # The write env stays ENV (unset --env = config.ENV's process-env + # import read; the step-level env IS the bind); --env is passed + # explicitly only to keep the target visible - it carries the SAME + # resolved value. NO --write-mode/--source-env/--history-env: + # those CLI knobs are removed - the mode is stat_update and the + # source/history are hard pins inside the script. + ARGS="--env ${ENV}" + if [ -n "${DISPATCH_DATE}" ]; then + ARGS="${ARGS} --date ${DISPATCH_DATE}" + fi + if [ "${DISPATCH_DRY}" == "true" ]; then + ARGS="${ARGS} --dry" + fi + echo "Trigger context: ${{ github.event_name }} (date:'${DISPATCH_DATE}' dry:'${DISPATCH_DRY}')" + uv run --with lightgbm==4.7.0 python smartscore/scripts/backtrack/run_daily_picks.py ${ARGS} + + # Step 5: the script prints the single structured SMARTSCORE_ML_PICKS + # log line and appends the headline to $GITHUB_STEP_SUMMARY; this step + # surfaces the run verdict in the job log as well. + - name: Job summary + if: always() run: | - echo "starter scaffold: real pipeline lives on PR #146" - exit 0 + if [ -n "${GITHUB_STEP_SUMMARY:-}" ] && [ -s "${GITHUB_STEP_SUMMARY:-}" ]; then + echo "ML picks run complete - see the job summary for the headline." + else + echo "ML picks run finished (no summary written: the pass did not reach job_summary)." + fi diff --git a/.gitignore b/.gitignore index 03fef81b..254da391 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,16 @@ data/*.err # HTTP crawl cache - large, rebuilt from any crawl; never shipped anywhere. data/cache/ + +# Model training caches, re-fetched from Supabase (see model.py). +data/ml/ + +# V16 experiment run residue (deleted in chore/clean-tree; the record lives +# in MODEL_NOTES.md + git history). Never re-track the pick dumps or per-fold +# scraps if they are regenerated. +smartscore/scripts/backtrack/exp_v16_pick*.pkl +smartscore/scripts/backtrack/exp_v16_perfold*.csv + +# Mis-named MoneyPuck-derived own-xG cache: no code reads it (V7-shots and +# V8-own-xG were both rejected) and it is raw re-fetchable data. +data/moneypuck/ diff --git a/Makefile b/Makefile index 78c67c6a..a7d8fb7b 100644 --- a/Makefile +++ b/Makefile @@ -105,3 +105,43 @@ backtrack-publish: @ENV=$(ENV) uv run python $(BACKTRACK)/local_store.py --publish $(SEASON) @ENV=$(ENV) uv run python $(BACKTRACK)/local_store.py --publish-team $(SEASON) @ENV=$(ENV) uv run python $(BACKTRACK)/local_store.py --publish-goalies $(SEASON) + +# Owner-run ONE-SHOT top-up (stage-2 RAW per-game columns, migration 20261027): +# fills game_shots/game_goals/game_points/game_toi_min for ALL historical rows +# of Player-Snapshots-backtrack-$(ENV) from the local raw store +# (data/raw_nhl.sqlite player_games). Preconditions: the migration landed on +# the target tables (deploy.yml's migrate job, or owner psql) AND the local +# store is loaded/derived (make backtrack-load SEASON=... first). Idempotent +# (PK upserts on (date, player_id)); no DDL is performed here. +# make topup-raw-game-cols ENV=dev # dev first, spot-check, then ENV=prod +# make topup-raw-game-cols ENV=prod SPOT_CHECK=1 # verify-and-exit +# Runbook: docs/ml-picks-runbook.md (stage-2 apply paths). +topup-raw-game-cols: + @uv run python $(BACKTRACK)/topup_raw_game_cols.py --env $(if $(ENV),$(ENV),dev) $(if $(SPOT_CHECK),--spot-check,) $(if $(SKIP_SPOT_CHECK),--skip-spot-check,) +.PHONY: topup-raw-game-cols + +# Owner-side OFFLINE store utility (no ML-picks role anymore): since the +# stage-2 raw-column change the picks path reads Supabase alone (the daily +# gap-fill is backfill_missing_days.py), but the local store still feeds +# train_export/publish_shot_cols. This target is the old refresh chain, kept +# for local store maintenance only: dump load + current-season crawl. +backtrack-refresh: + @echo "Refreshing the local raw store (dumps + current season crawl) - owner-side only" + @uv run python $(BACKTRACK)/refresh_store.py $(if $(THROUGH),--through $(THROUGH),) + +# ---------------- On-demand ML artifact refresh -------------------------- +# Owner-run, on-demand only: training NEVER happens on AWS or in CI, and no +# target here is scheduled. The workflow (.github/workflows/ml-picks.yml) is +# predict-only and reads the artifact this target's upload produces. +# docs: docs/ml-picks-runbook.md +MLS3_BUCKET ?= $(if $(ML_S3_BUCKET),$(ML_S3_BUCKET),smartscore-ml-artifacts) + +# Local dry training + export + upload (the on-demand artifact refresh): the +# artifact-fact convention is s3://$(MLS3_BUCKET)/predict/ml/artifact__.joblib +# (names sort by vintage; the daily workflow reads the lexically latest .joblib). +# make train-ml-export ENV=prod SEASON=2023 THROUGH=2026-06-14 SEED=0 +train-ml-export: + ENV=$(ENV) uv run --with lightgbm==4.7.0 python $(BACKTRACK)/train_export.py \ + --env $(ENV) $(if $(SEASON),--season $(SEASON),) $(if $(THROUGH),--through-date $(THROUGH),) \ + --seed $(if $(SEED),$(SEED),0) --upload --s3-bucket $(MLS3_BUCKET) +.PHONY: train-ml-export backtrack-refresh diff --git a/build_scripts/deploy.sh b/build_scripts/deploy.sh index b02bcc19..bba8d31c 100755 --- a/build_scripts/deploy.sh +++ b/build_scripts/deploy.sh @@ -31,6 +31,7 @@ LAMBDA_FUNCTIONS=( "GetGoalies-$ENV" "GetLineups-$ENV" "SendEmails-$ENV" + "MLPicksKick-$ENV" ) @@ -59,7 +60,33 @@ generate_smartscore_stack() { exit 1 fi + # (The retired ML pick-pass parameter overrides (MLS3Bucket/MLEcrImageUri) + # are gone with the MLPicks Lambda; the Model pass now runs as the + # scheduled .github/workflows/ml-picks.yml workflow instead.) + + # GITHUB_DISPATCH_TOKEN (optional): the fine-grained PAT (Actions: write, + # this repo only) used by the MLPicksKick Lambda to repository_dispatch + # 'ml-picks-game' into ml-picks.yml. Forwarded from the environment when + # set; when unset, create-stack falls back to the template's empty + # default and update-stack keeps the previously stored NoEcho value. The + # relay fails loudly per kick if it ends up empty. + CFN_PARAM_OVERRIDES=(ParameterKey=PosthogApiKey,ParameterValue="$POSTHOG_FEATURE_FLAG_KEY") + if [ -n "${GITHUB_DISPATCH_TOKEN:-}" ]; then + CFN_PARAM_OVERRIDES+=("ParameterKey=GithubDispatchToken,ParameterValue=${GITHUB_DISPATCH_TOKEN}") + fi + if aws cloudformation describe-stacks --stack-name "$STACK_NAME" &>/dev/null; then + # Fail fast with an actionable message when the stack is stuck in a + # (rollback) failed state: UpdateStack (and waiter) cannot recover that + # and every attempt just fails cryptically until the rollback is + # completed with continue-update-rollback (or the stack is deleted). + PRE_STATUS=$(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --query "Stacks[0].StackStatus" --output text) + case "$PRE_STATUS" in + CREATE_FAILED|DELETE_FAILED|ROLLBACK_FAILED|UPDATE_ROLLBACK_FAILED) + echo "Error: stack $STACK_NAME is stuck in $PRE_STATUS; it cannot be updated." + echo "Recover first: aws cloudformation continue-update-rollback --stack-name $STACK_NAME" + exit 1 ;; + esac echo "Updating CloudFormation stack $STACK_NAME..." UPDATE_OUTPUT=$(aws cloudformation update-stack \ --stack-name "$STACK_NAME" \ @@ -72,12 +99,16 @@ generate_smartscore_stack() { ParameterKey=BrevoSmtpKey,ParameterValue="$BREVO_SMTP_KEY" \ ParameterKey=BrevoFromEmail,ParameterValue="$BREVO_FROM_EMAIL" \ ParameterKey=FeatureSendEmails,ParameterValue="$FEATURE_SEND_EMAILS" \ - ParameterKey=PosthogApiKey,ParameterValue="$POSTHOG_FEATURE_FLAG_KEY" \ + "${CFN_PARAM_OVERRIDES[@]}" \ --capabilities CAPABILITY_NAMED_IAM 2>&1) if echo "$UPDATE_OUTPUT" | grep -q "No updates are to be performed."; then echo "No updates needed. Skipping wait." else + # Surface the raw UpdateStack response. Its ValidationError text is the + # only place that names an offending resource for template/parameter + # problems; swallowing it made past rollbacks undiagnosable from CI. + echo "$UPDATE_OUTPUT" echo "Waiting for CloudFormation stack update to complete..." aws cloudformation wait stack-update-complete --stack-name "$STACK_NAME" fi @@ -94,7 +125,7 @@ generate_smartscore_stack() { ParameterKey=BrevoSmtpKey,ParameterValue="$BREVO_SMTP_KEY" \ ParameterKey=BrevoFromEmail,ParameterValue="$BREVO_FROM_EMAIL" \ ParameterKey=FeatureSendEmails,ParameterValue="$FEATURE_SEND_EMAILS" \ - ParameterKey=PosthogApiKey,ParameterValue="$POSTHOG_FEATURE_FLAG_KEY" \ + "${CFN_PARAM_OVERRIDES[@]}" \ --capabilities CAPABILITY_NAMED_IAM echo "Waiting for CloudFormation stack creation to complete..." @@ -106,6 +137,17 @@ generate_smartscore_stack() { if [[ "$STACK_STATUS" != "CREATE_COMPLETE" && "$STACK_STATUS" != "UPDATE_COMPLETE" ]]; then echo "CloudFormation stack operation failed with status: $STACK_STATUS." + # Print the most recent failed-resource events so the failing resource + # + its ResourceStatusReason are visible directly in CI logs. + aws cloudformation describe-stack-events --stack-name "$STACK_NAME" --max-items 60 \ + --query "StackEvents[?ResourceStatus=='UPDATE_FAILED'].[LogicalResourceId,ResourceType,ResourceStatusReason]" \ + --output table &>/dev/null \ + && echo "(failed-resource events printed above if any)" \ + || echo "(describe-stack-events failed; run it manually with ResourceStatus=='UPDATE_FAILED')" + if [[ "$STACK_STATUS" == *ROLLBACK* || "$STACK_STATUS" == *FAILED* ]]; then + echo "Recovery: aws cloudformation continue-update-rollback --stack-name $STACK_NAME" + echo "Then inspect: aws cloudformation describe-stack-events --stack-name $STACK_NAME --max-items 40 --query 'StackEvents[?ResourceStatus==\`UPDATE_FAILED\`].[LogicalResourceId,ResourceType,ResourceStatusReason]' --output text" + fi exit 1 # Exit with error fi diff --git a/data/dumps/20132014.sql.gz b/data/dumps/20132014.sql.gz new file mode 100644 index 00000000..3b24356e Binary files /dev/null and b/data/dumps/20132014.sql.gz differ diff --git a/data/dumps/20142015.sql.gz b/data/dumps/20142015.sql.gz new file mode 100644 index 00000000..4764d296 Binary files /dev/null and b/data/dumps/20142015.sql.gz differ diff --git a/data/dumps/20152016.sql.gz b/data/dumps/20152016.sql.gz new file mode 100644 index 00000000..ad552765 Binary files /dev/null and b/data/dumps/20152016.sql.gz differ diff --git a/data/dumps/20162017.sql.gz b/data/dumps/20162017.sql.gz new file mode 100644 index 00000000..4f864de0 Binary files /dev/null and b/data/dumps/20162017.sql.gz differ diff --git a/docs/backtrack_dev_deleted.md b/docs/backtrack_dev_deleted.md new file mode 100644 index 00000000..b0d4ddc0 --- /dev/null +++ b/docs/backtrack_dev_deleted.md @@ -0,0 +1,85 @@ +# dev backtracking snapshots deleted (2026-10-24) + +All three dev backtrack tables are now deleted (row-deleted; the Postgres +shells remain until a manual DROP). Any script that used to read a dev +backtrack table (language default `ENV=dev` in `config.py`) must be run with +`ENV=prod` / `--env prod` instead. Code resolving a deleted dev table name now +fails loudly via `smartscore/scripts/backtrack/deleted_env_tables.py`. + + +## What was verified before deletion (all read-only) + +- Row counts: dev 617,310; prod 623,358. +- The delta is exactly the 6,048 rows with `date > 2026-06-14` + (2026-09-29..2026-10-24, the 2026-27 season dev never received). No publish + cadence gap inside the dev range. +- Distinct `(date, player_id)` key sets over the FULL dev range + (2013-10-01..2026-06-14): identical — 0 dev-only keys, 0 prod-only keys in + the overlap, no duplicate keys on either side, 0 date-level count diffs. +- 2,000 random overlapping keys: full-row value equality across all 37 columns + (including the 16 backfilled shot/TOI+identity columns) — 0 mismatches + (floats <= 1e-9 rel), 0 NULL-parity diffs. +- Column lists: dev and prod identical (37 = 37) — no dev-only column remained + to migrate. + +## Team-Stats / Goalie-Snapshots dev deletions (2026-10-24, second pass) + +- `Team-Stats-backtrack-prod` was published from the local store + (`local_store.py --publish-team`, `ENV=prod`, all 14 seasons incl. 2026-27): + 34,636 rows, 2013-10-01..2026-10-24. +- `Goalie-Snapshots-backtrack-prod` was published the same way + (`--publish-goalies`): 37,044 rows, 2013-10-01..2026-10-22 (goalies carry no + 2026-10-23/24 rows yet because those games had no box scores at publish time + — un-played, the known partially-filled-today source pattern). +- Random 500-key spot-checks per table (value-compare against freshly computed + local values, floats <=1e-9 rel / ints+text exact / NULL-parity): 0 + mismatches. Full key-set check: prod is a strict superset of dev — 0 + dev-only keys; prod-only keys are exactly the 336 team / 348 goalie 2026-27 + rows. The Player-table precedent (6,048 extra 2026-27 rows) replicates. +- After verification, `Team-Stats-backtrack-dev` (34,300 rows) and + `Goalie-Snapshots-backtrack-dev` (36,696 rows) were row-deleted (year-chunked + PostgREST deletes, per-table backup SHA256 verified first); prod counts were + re-checked stable (34,636 / 37,044). Pre-delete gzip backups live in + `data/backups/` with SHA256s in `MANIFEST.md`. + +## Remaining manual steps (shell DROP — owner-side, PostgREST cannot DDL) + +PostgREST cannot DROP TABLE, so the three empty shells still exist in the +Supabase project (re-verified 0 rows on 2026-11-03). In the dashboard SQL +editor (or psql via SUPABASE_DB_URL) run the DROP SQL verbatim from +**docs/ml-picks-runbook.md, section 11, "Deleting the -dev backtrack table +shells"** (added 2026-11-03): + +1. `DROP TABLE IF EXISTS "Player-Snapshots-backtrack-dev";` +2. `DROP TABLE IF EXISTS "Team-Stats-backtrack-dev";` +3. `DROP TABLE IF EXISTS "Goalie-Snapshots-backtrack-dev";` + +The standing `migrate` CI job can no longer recreate them: every backtrack +migration in `supabase/migrations/` is hard-pinned to the `-prod` literal +suffix (`BACKTRACK-PROD-PINNED` marker per file), and the deploy.yml +"Guard migration files" step fails any migration that scopes a backtrack +table through `__ENV__` (a PR-deploy `ENV=dev` run used to re-CREATE the +retired `-dev` shells — that is the trap these edits close). + +Then, to also reclaim the disk, run `VACUUM FULL` on the (now smaller) +remaining backtrack prod tables, or pause/restore the project (a brief +outage — scheduled maintenance, not a data path blocker). + +## Restore / re-derivation paths + +- Backups: `data/backups/backtrack-dev-Player-Snapshots-backtrack-dev.csv.gz` + (528 MB gz? see MANIFEST.md for row count + SHA256) plus the other two dev + backtrack tables as separate gzips. Restorable per table by re-upserting the + CSV batches (`on_conflict=date,player_id`). +- Everything the tables were derived from also lives in + `data/raw_nhl.sqlite` (692,514 player_games, 13.4M shifts), so a full + re-derivation is possible with `local_store.py --build --derive --publish`. + +## Shrinking the Supabase disk + +Postgres only reclaims disk after a VACUUM: +run `VACUUM FULL "Player-Snapshots-backtrack-dev";` (or delete+recreate the +table) in the dashboard SQL editor, or pause/restore the project. Without that, +the freed 617k rows show as dead tuples and the dashboard size will not drop. +Also drop the empty-named table if it should disappear from the dashboard +listing (PostgREST cannot DROP). diff --git a/docs/ml-picks-runbook.md b/docs/ml-picks-runbook.md index 0b947c97..4a79d53c 100644 --- a/docs/ml-picks-runbook.md +++ b/docs/ml-picks-runbook.md @@ -1,25 +1,902 @@ -# ML picks runbook (STARTER STUB on main — the full runbook ships with PR #146) - -> This file on `main` is a placeholder so the ml-picks workflow starter -> (`.github/workflows/ml-picks.yml`, same PR) has a docs anchor. PR #146 -> replaces this stub with the full runbook; merge this starter FIRST. - -## 3. First-time setup (pre-merge dispatch gating) - -**Pre-merge manual-dispatch gating (until PR #146 merges):** GitHub only -registers workflows that live on the default branch, and no workflow can be -manually dispatched before it is registered. This starter workflow on `main` -is that registration: after merging it, the workflow page -(Actions -> "ML Daily Picks") exists, and its "Run workflow" branch selector -can dispatch the PR branch — GitHub executes the workflow file from the -SELECTED ref, so `main` runs this starter's placeholder step, while -`feat/final-clean` runs the REAL pipeline from that branch's copy of the -file, using the repo secrets the owner set. A run with `dry: true` -assembles the picks and skips the Picks write, so no rows are written. -Merge order: (1) merge this starter PR, (2) set the Supabase/S3 secrets and -test-dispatch `feat/final-clean` from the workflow page, (3) merge PR #146, -which replaces this starter's content with the full scheduled / -repository_dispatch-complete workflow. - -The full first-time setup steps (Supabase + S3 secrets, artifact refresh, -first `dry: true` smoke run) ship with PR #146's full runbook §3. +# ML picks runbook (scheduled GitHub Actions; MLPicks Lambda retired) + +Replaces the retired `docs/aws-predict-lambda-runbook.md`. Authored against +`branch feat/final-clean` and verified against +`smartscore/scripts/backtrack/run_daily_picks.py` (the former Lambda +handler's logic, unchanged), +`.github/workflows/ml-picks.yml`, `smartscore/utility.py` (save_to_db via +publish_public_db), `smartscore/scripts/backtrack/train_export.py`, and +`smartscore/scripts/backtrack/MODEL_NOTES.md`. Owner rules, binding: + + * training NEVER runs in CI or on AWS — it is owner-invoked, local, and + on-demand (`train_export.py`, unchanged); + * the scheduled workflow is PREDICT-ONLY: artifact + today's Supabase + snapshot rows -> Picks-{ENV}; + * the inference path is the SAME code the Lambda handler ran, lifted + verbatim into `run_daily_picks.py` — nothing was reimplemented. + +## 1. Daily flow + +The workflow `.github/workflows/ml-picks.yml` runs on a GitHub-hosted +runner: + +1. **Scheduled:** `cron '30 9 * * *'` UTC daily (= 05:30 ET in DST, 04:30 + EST — the same fixed-UTC anchor the retired EventBridge + `MLPicksDailyTrigger` used; GitHub cron does not track DST, so the local + wall-clock time shifts one hour across clock changes. Accepted, as it + was then). +2. **Manual:** `Actions -> ML Daily Picks -> Run workflow`, with optional + inputs — the workflow exposes EXACTLY THREE knobs (`date`/`dry`/ + `environment`), matching the script's exactly-three-knob CLI + (`--date`/`--dry`/`--env`): + * `date` — slate date `YYYY-MM-DD` (default: ET-today); + * `dry` — smoke run: assembles + validates the 3 picks and prints the + SMARTSCORE_ML_PICKS log line, but **skips the Picks write** (the whole + pass is read-only end to end); + * `environment` — the WRITE side: which Picks table's slate rows the run + stat-fills (`dev|prod`, default: `prod` — the env matrix below). + + Everything else about the run is a HARD PIN, not a knob: the write mode + is `stat_update` ONLY (the legacy wipe+3-picks mode is removed + entirely), the LIVE read is `Player-Snapshots-prod` ALWAYS (source=prod) + and the history is ALWAYS the ONE shared `-prod` ledger. There is no + `source` dispatch input and no `--write-mode`/`--source-env`/ + `--history-env` CLI flag anymore. + +### Environment matrix — what stat-fills WHICH Picks table (ml-picks.yml ENV) + +There is ONE env knob left — the WRITE env (`Picks-{ENV}`) — and then two +hard pins. The knob resolves as: module-global config.ENV, read +import-time from the process env (the workflow binds job/step `ENV` before +`python` starts) overridable ONLY by the script's `--env dev|prod` flag +(one of the three CLI knobs). The LIVE-read source is hard-pinned +`SOURCE_ENV = "prod"` in `run_daily_picks.py` (the owner rule: prod is the +source of truth for feature reads; the dev live-snapshot shell is empty), +and the history is hard-pinned to the ONE shared `-prod` ledger +(`HISTORY_ENV = "prod"` + 027ef47's shared-ledger routing). No +`--write-mode`/`--source-env`/`--history-env` knobs exist. + +The workflow's resolution is EXPLICIT and fail-closed for the ONE knob so +no run can silently land on the wrong table (the mechanism: the job-level +default `env: ENV: prod` in `jobs.picks.env`, overridden per-run at the +"Resolve the picks ENV (write side)" step, which echoes `env: ` +into the job log, whitelists `dev|prod` — uncommented, the ONLY whitelist +left — and hard-fails on anything else, then re-binds the resolved value as +a step-level `ENV` on BOTH script steps; GitHub Actions sets job/step env +in the PROCESS environment before `python` starts, so `config.ENV`'s +import-time read (`config.py:12`, `ENV = os.environ.get("ENV", "dev")`) is +unambiguous. The picks step additionally passes the explicit +`--env ${ENV}` flag carrying the SAME resolved value, so the write target +is visible in the script's own argv/log): + +| How the run starts | Resolved ENV (write) / source (live read) | Tables written / read | +| --- | --- | --- | +| **Scheduled** (`cron '30 9 * * *'`) | **prod** — the job-level default ONLY (a scheduled run has no `inputs`; they resolve empty and are never referenced unconditionally, so a cron run keeps Picks-prod) | `Picks-prod` stat-fill + the read surfaces: LIVE `Player-Snapshots-prod` (pinned) + the SHARED history ledger `Player-Snapshots-backtrack-prod` | +| **Per-game kick** (`repository_dispatch`, ML Picks Restart) | **prod** — same job-level default | prod tables | +| **Manual dispatch** | the `environment` input (default **prod**) is the ONLY dispatch knob — the WRITE table; the source is PINNED prod regardless | `Picks-{environment}` stat-fill + LIVE `Player-Snapshots-prod` (pinned); historical reads and the backfill go to the SHARED ledger `Player-Snapshots-backtrack-prod` regardless (§10) | +| **Manual dispatch — PRE-DEPLOYMENT VALIDATION** | `environment=dev`: real prod reads | **stat-fills ONLY `Picks-dev`** (Picks-prod untouched; the write is a stat-column PATCH on the rows the table already holds — no wipe, no insert) while TODAY's rows are read from `Player-Snapshots-prod` (the real LIVE prod snapshot, the PIN) and history stays the SHARED `Player-Snapshots-backtrack-prod` — the owner validates end-to-end picks against real live data without touching Picks-prod. Verified live 2026-11-03: dev dry --date 2026-10-23 (3 picks, mean 0.9232, no write) and, pre-consolidation, non-dry --date 2026-10-19 + the 495-row prod full-slate stat fill. | + +**SOURCE/HISTORY hard-pins (2026-11-03, the owner's "prod is the source of +truth for feature reads"; consolidated 2026-11-03):** the source axis is +NOT selectable at all anymore — `run_daily_picks.py` carries the constants +`SOURCE_ENV = "prod"` and `HISTORY_ENV = "prod"`, and every history read +routes to the ONE shared `-prod` ledger whatever the picks env is +(027ef47). A dispatch with `environment=dev` reads the REAL prod slate and +stat-fills only `Picks-dev`. History: the pre-consolidation default chain +(CLI `--source-env`/`--history-env` flags, `SOURCE_ENV`/`HISTORY_ENV` env +vars, followed by the pinned `prod`) is deleted — `prod` was already the +default on every axis, so the removal is behavior-preserving (the +git history retains the deleted resolution tests). + +The ARTIFACT selection is INDEPENDENT of all three axes — the same +relative-key select on every profile (S3 `ML_S3_BUCKET`/prefix or Supabase +Storage `ML_STORAGE_BUCKET` bucket `ml-artifacts`, prefix `predict/ml`, +lexically latest `.joblib`; §2): no key change is needed when switching +between prod and hybrid runs. + +WRITE-SURFACE FAIL-SAFETY (stat_update, the only mode): the Picks write is +a per-row PATCH and CANNOT delete or insert anything, so the wipe/restore +scaffolding the removed legacy writer (`save_picks_db`) carried is gone +with the legacy mode. A single failed PATCH is LOUD (one line with the +failing id, the row keeps the site's stat) and the fill continues; an +all-patches-failed run raises (never green-on-zero). + +Either way the job does: checkout -> `uv sync --frozen --no-dev` (the same +runtime dependency surface `deploy.yml`'s deploy job installs) -> artifact +fetch (default: Supabase Storage dated-prefix-latest; see section 3) -> +`run_daily_picks.py`, whose FIRST data step is the daily gap-fill +(`backfill_missing_days.backfill`, section 1.2 — the workflow also runs it +as its own step; the per-date markers make the second invocation a no-op +skip), then assembles the day's frame from THREE read-only sources +(docs/ml-picks-runbook.md §1.1 below): + +* **today's rows** — the LIVE snapshot table + `Player-Snapshots-prod` (the daily snapshot the pipeline's snapshot + build publishes each morning; the read is HARD-PINNED to prod — + `SOURCE_ENV = "prod"` — independent of the write env, the owner's + source-of-truth rule; there is no dev-side live read anymore); +* **history** — the backtrack history, which is ONE SHARED LEDGER: + `Player-Snapshots-backtrack-prod` (plus the team/goalie rates at publish + cadence from `Team-Stats-backtrack-prod` / `Goalie-Snapshots-backtrack- + prod`) — read on EVERY run, dev or prod, because the dev backtrack tables + were deleted (docs/backtrack_dev_deleted.md) and history is the single + training source; STRICTLY before the pick date, + fetched FULL-history (career_* are expanding career sums; a bounded + window mis-states every veteran's block) via `model.fetch_table`'s + month-window pagination; +* **the 14 shot/TOI features** for today's rows — recomputed EXACTLY by the + SAME pandas core `model.shot_features()` runs + (`shot_features_from_games`, imported, never forked) over the PUBLISHED + per-game record: the stage-2 raw columns + (`game_goals` / `game_shots` / `game_points` / `game_toi_min`, + 20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql) turn + every published backtrack row into one per-player-game line, and the + career_* cells are exact expanding sums over the FULL fetched history. + Published rows with no raw stat (pre-top-up lateness) are DROPPED from + the ledger — the recompute then runs over the available raw rows (a + partial-prefix recompute, LOUD-warned; train/run parity degrades from + exact equality to a tolerance until the top-up closes the gap). + Supabase IS the live data plane — no local sqlite, no dumps, no NHL-API + sweep on the runner; the older stage-1 "last published row" carry-forward + attach and the runner-side store refresh are both RETIRED from the + primary path (the carry-forward survives ONLY as + `run_daily_picks.carry_forward_shot_block`, the clearly-marked last-resort + fallback when the exact recompute itself raises). The only inputs not on + the player table are the team/goalie rates, read at publish cadence from + Team-Stats / Goalie-Snapshots-backtrack-prod (the shared ledgers, §10; a + lagging one prints a staleness warning, never an exit). + +### 1.2 The daily gap-fill (first task of the day; run_daily_picks step 1 + ml-picks.yml first step) + +The completed game days the nightly publish has not covered yet are topped +up BEFORE any history is read — typically exactly ONE day (yesterday), +0-1 on a normal day: + +1. Reads the table's latest published date (one query). +2. For every completed-game date after it — usually exactly ONE day + (yesterday) — it makes ONE schedule request per missing day + (`nhl_client.fetch_schedule`) plus ONE boxscore request per game the + schedule reports FINAL/OFF; games in any other state (LIVE/FUT) are + SKIPPED — the FINAL-only guard keeps an in-flight box score out of + nhl_client's HTTP cache (the cache-hostage bug) — and replayed on a + later pass once final. Typical run: 2-5 NHL API requests total; a + longer gap is capped at 14 days (`MAX_MISSING_DAYS`): anything larger + needs the owner-side dump/local-store top-up (`publish_shot_cols.py`), + never a runner sweep. +3. It upserts ONLY the per-game raw columns on (date, player_id) + merge-duplicates, in two lanes so no published column is ever clobbered: + a row the nightly publish already wrote gets ONLY the raw block + (`game_shots`/`game_goals`/`game_points`/`game_toi_min`) — the 16 + precomputed rolling columns are untouched; a row that is missing is + CREATED as a minimal snapshot shape (identity columns: date, player_id, + season, name, team_abbrev, opponent_abbrev, scored + the raw block), + with the rolling cells left NULL for the nightly publish to fill + forward. It does NOT recompute the 16 rolling columns: those stay the + training-side history the publish's attach carries. +4. It writes a per-date MARKER row (`Player-Game-Raw-Markers-prod`, the + shared ledger's marker shelf — the SAME marker table both dev and prod + run consult, §10; the table ships in the same + migration) AFTER the date's upserts land. A date whose games were not + all final, or whose writes failed, stays UNMARKED and is retried by a + later pass; a MARKED date costs every later run NOTHING — no schedule + request, no writes — so the first run of the day does the work once and + every same-day re-run (the per-game kick fires ~15 runs per slate date; + `run_daily_picks.run` re-invokes the helper each time) is a pure skip. + Re-runs are idempotent by construction: 0 writes. +5. Every boxscore fetch is a FRESH GET: the helper deletes any existing + `data/cache/boxscore-.json` before fetching, so a boxscore file + cached while the game was still LIVE (an earlier crawl that raced the + final horn) can never be served as if final (nhl_client itself is + unmodified; the override lives in the helper). + +`dry=true` (the workflow's smoke input) makes the whole pass read-only: the +gap-fill is SKIPPED entirely (no upserts, no marker rows, no cache +unlinks) and `run_daily_picks` only LISTS the missing game days (one +Supabase read, one warning line). + +Ordering note: the step needs the stage-2 DDL. `run_daily_picks` fails +LOUDLY naming the migration file when the columns are missing — apply +`20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql` +(deploy.yml's migrate job does it automatically on merge to main; label a +`deploy` PR to apply it to dev first) and run the one-shot history top-up +BEFORE the first post-merge picks run. + +### 1.2.1 Getting the 20261027 stage-2 DDL onto PROD — the two owner paths + +Diagnosis (why prod is not migrated as of 2026-10-30): the `migrate` job +(deploy.yml:155-223) applies ONE env per run — `ENV=prod` ONLY on a push to +main (deploy.yml:162,166), `ENV=dev` on a `pull_request` carrying the +`deploy` label (deploy.yml:163). The migration exists only on +`feat/final-clean`/PR #146 (commit `ca1f44e`); main's latest scaffold +(`c002cc1`, run 40575778111) does not contain it. So the Oct-28 green +migrate run 40690521087 applied the file with `ENV=dev` (job log: "Applying +supabase/migrations/20261027_... .sql (ENV=dev)") — the `-dev` tables got +the four columns + `Player-Game-Raw-Markers-dev`; `-prod` was never +touched. The job succeeded, which also proves the repo secret +`SUPABASE_DB_URL` (deploy.yml:167) IS configured in Settings -> Secrets — +no missing secrets, no token needed (`SUPABASE_ACCESS_TOKEN` only matters +for the optional `supabase db push` variant, deploy.yml:200-209). The DML +top-up (`topup_raw_game_cols.py`) runs over PostgREST with the +service-role key (its client performs NO DDL; docs/backtrack_dev_deleted.md +"Remaining manual steps" + docs/ml-picks-runbook.md §11 is why DDL needs psql), so it does not depend on `SUPABASE_DB_URL`. + +**PATH A — merge-then-auto-apply (zero manual SQL).** +1. Merge PR #146. The main-push `migrate` run re-applies every file + idempotently with `ENV=prod`, so the four ALTERs + the marker CREATE + land on `Player-Snapshots-backtrack-prod` with no owner action. +2. The next picks pass tops up YESTERDAY's (and up to + `MAX_MISSING_DAYS = 14` calendar days of unmarked FINAL days, + backfill_missing_days.py:95) rows automatically — first run writes, + every same-day re-run skips on the marker rows. +3. History older than the 14-day window keeps `game_*` NULL until the + one-shot top-up: `make topup-raw-game-cols ENV=prod --` (us-local, + owner AWS/DB-side; needs data/raw_nhl.sqlite loaded) or a CI wrap — + no make target existed, so `topup-raw-game-cols` was added to the + Makefile; a CI job hint if wanted later: + `gh workflow run`-style `Actions -> run topup_raw_game_cols + --env prod` would need a new sparse job wiring the + `SUPABASE_URL`/`SUPABASE_SERVICE_ROLE_KEY` secrets (the same ones the + picks workflow already carries) — the local path is cheaper and needs + no new YAML. + +**PATH B — pre-merge manual apply (owner Supabase dashboard/psql).** +No env-var substitution in the dashboard: run ONE of the two verbatim +variants in the Supabase project's SQL editor / psql +(`psql "$DATABASE_URL" < ...`, the URL from the project's Database +settings — NOT the SUPABASE_SERVICE_ROLE_KEY: the service-role key is +PostgREST-only and CANNOT run DDL; see proof that PostgREST cannot +DROP/ALTER in docs/backtrack_dev_deleted.md "Remaining manual steps" and +the DROP runbook §11 below): + +DEV variant (only if re-scoping to dev): +```sql +ALTER TABLE "Player-Snapshots-backtrack-dev" + ADD COLUMN IF NOT EXISTS "game_shots" INTEGER, + ADD COLUMN IF NOT EXISTS "game_goals" INTEGER, + ADD COLUMN IF NOT EXISTS "game_points" INTEGER, + ADD COLUMN IF NOT EXISTS "game_toi_min" DOUBLE PRECISION; +CREATE TABLE IF NOT EXISTS "Player-Game-Raw-Markers-dev" ( + "date" TEXT NOT NULL, + "games" INTEGER NOT NULL, + "player_games" INTEGER NOT NULL, + "backfilled_at" TIMESTAMPTZ NOT NULL DEFAULT now(), + CONSTRAINT "Player-Game-Raw-Markers-dev_pkey" PRIMARY KEY ("date") +); +ALTER TABLE "Player-Game-Raw-Markers-dev" ENABLE ROW LEVEL SECURITY; +``` + +PROD variant (the one prod needs): +```sql +ALTER TABLE "Player-Snapshots-backtrack-prod" + ADD COLUMN IF NOT EXISTS "game_shots" INTEGER, + ADD COLUMN IF NOT EXISTS "game_goals" INTEGER, + ADD COLUMN IF NOT EXISTS "game_points" INTEGER, + ADD COLUMN IF NOT EXISTS "game_toi_min" DOUBLE PRECISION; +CREATE TABLE IF NOT EXISTS "Player-Game-Raw-Markers-prod" ( + "date" TEXT NOT NULL, + "games" INTEGER NOT NULL, + "player_games" INTEGER NOT NULL, + "backfilled_at" TIMESTAMPTZ NOT NULL DEFAULT now(), + CONSTRAINT "Player-Game-Raw-Markers-prod_pkey" PRIMARY KEY ("date") +); +ALTER TABLE "Player-Game-Raw-Markers-prod" ENABLE ROW LEVEL SECURITY; +``` + +Then complete the per-row fill (PostgREST/service-role WRITES are permitted +once the columns exist; the top-up is data-DML only): +`make topup-raw-game-cols ENV=prod` (equivalent: +`uv run python smartscore/scripts/backtrack/topup_raw_game_cols.py +--env prod`, idempotent PK upserts over the ~623k prod history rows; add +`SPOT_CHECK=1` to verify-and-exit). If instead PATH A was taken, this is +the same one-shot top-up — unchanged. + +then builds the frame via `model.build_frame`/`add_derived(source="supabase")` +(a pick-date context row per fixture is injected from the live snapshot's +own morning rates and confirmed opponent goalie, since the backtrack tables +only gain a date's rows post-game), scores with +the ensemble's mean within-(date, tims) rank percentile, applies +`model.daily_picks` (one pick per tims group), validates the 3-pick shape, +and fills the stat column on the site's existing full-slate Picks rows +(`stat_update`, the ONLY mode - BEFORE the top-3 assembly, so a malformed +output shape can never withhold the fill), with the top-3 becoming log +output. It emits ONE structured log line +(`log: SMARTSCORE_ML_PICKS`, JSON) and appends a headline to the job +summary, plus a stale-artifact warning when the artifact trains through a +date older than 7 days. + +### 1.1 Write mode: `stat_update` — the ONLY mode (the corrected contract) + +**OWNER-CORRECTED CONTRACT (2026-11-03): `Picks-{ENV}` is the FULL PLAYER +SLATE for the current day — the picks table = the full slate + the model's +stat column, and the table is NEVER wiped by the ML path.** The site's own pipeline owns the rows: +`SaveToDb / PublishToDb` → `handle_publish_db` → `publish_public_db` → +`utility.save_to_db` full-wipes and re-inserts ALL of today's players +(hundreds of rows; ids restart at 1 - the site's OWN wipe, the only one +that exists). The ML model's job in the ONLY mode, `stat_update`, is to: + +* read TODAY's existing `Picks-{ENV}` rows (`id, player_id, name, + team_name, stat, tims`); +* compute a prediction for EVERY player on today's slate (the frame is + built from the live snapshot as always); +* `PATCH` **only the `stat` column** on each existing row — + `update({"stat": value}).eq("id", row_id)` — a PostgREST PATCH scoped to + an existing id can never insert and never touches another column, so the + row count, ids and every other column are identical before/after BY + CONSTRUCTION (test-pinned in tests/unit/test_predict_picks.py + + tests/unit/test_picks_db_nan_behaviors.py, incl. the mocked 495-row + prod full-slate per-row contract); +* **NEVER wipe the table and NEVER insert rows** of its own. +* WARN by name and leave `stat` untouched for slate players the model + could not score (call-ups without published history), and WARN for model + frame players the site left off the slate (likely not playing — no + write); +* treats a MISSING slate as a warn + clean skip: when `Picks-{ENV}` has no + rows for the pick date (this run fired BEFORE the site's own SaveToDb + publish), the run prints one `WARNING ... SKIPPED cleanly` line and + writes nothing — the site's pipeline always eventually publishes the + slate and the next kick re-fills it. + +**`stat` column convention (0-1 fraction):** the DB `stat` column holds a +0-1 decimal fraction, not a percent. The site's own publish writes raw +model scores on that scale, so the ML path divides its 0-100 rank +percentile by 100 at the write boundary (`stat_value(ensemble) / 100`). +The ML log, `SMARTSCORE_ML_PICKS` payload and job summary deliberately +stay on the 0-100 display scale; readers that show a percentage multiply +by 100 (`smartscore/scripts/get_odds.py:218,232`, and the site UI). + +`legacy_stat` = the site's legacy weighted-average value (0-1), written by +the site publish (skaters + goalies) and never touched by the ML overlay; +`stat` = the ML rank percentile (0-1). + +The **top-3-per-group challenge picks are an OUTPUT**, full stop: +they rank within `(date, tims)` exactly as before, but are emitted only +through the structured `SMARTSCORE_ML_PICKS` log (a `picks` array) and the +job summary (a picks table) — never written to the Picks table (they are a +projection of the stat column anyway). The `SMARTSCORE_ML_PICKS` summary +semantics: **3 challenge picks (top per group) + the stat column updated +on all slate rows**. + +**Evidence the site's OWN flows never needed the 3-row Picks +publication** (why the default changed): `UpdateHistory` +(`handle_save_historic_db`) derives the calendar's picks via `choose_picks` +from its OWN state payload (falling back to the published rows), and +`NotifyUsers` (`handle_emails`) derives the email picks via `choose_picks` +from the PUBLISHED FULL slate rows — both by taking, per tims group, the +max-`stat` player of the full slate. A 3-row wipe publication replaced the +slate those readers derive from. + +The legacy full REPLACE (`--write-mode legacy` / the old `save_picks_db` +schema-safe wipe+3-row publication) is **REMOVED ENTIRELY** as of the +three-knob consolidation — not demoted, deleted (the CLI rejects +`--write-mode`; the wiped-table writer and its probe/restore scaffolding +no longer exist in `run_daily_picks.py`). Git history retains the deleted +tests/behavior. The PATCH write path needs no scaffolding: it cannot wipe +or insert by construction. + +**Idempotency/timing, stated plainly:** the stat PATCHes are +read-modify-write per row, so later kicks in the same day simply re-fill +the CURRENT slate (the site re-publishes it — a full wipe + fresh Rust +stat values — after each refresh run; our PATCHes overwrite stat only +AFTER that). The ordering is already serialized on the AWS side: the +state machine's `KickMLPicks` state fires at the END of +`PlayerProcessingPipeline`, i.e. AFTER `PublishToDb` has written the +full-slate rows (templates/player_processing_pipeline.asl.json: +`PublishToDb -> KickMLPicks`). A manual run against a date the site has +not published yet hits the warn + clean skip above. + +**Verified live 2026-11-03 (slate 2026-11-03, artifact +(`artifact_2026-10-29_0.joblib`, 5d — fine), 495-row full slate on BOTH +tables):** dev dry run (read-only): `stat_column {stat_fill_skipped: true, +reason: dry}`, 3 top picks assembled, Picks-dev byte-identical pre/post (0 +rows, 0 columns changed — dry stays read-only end to end); dev non-dry + +prod full-slate: `stat_update: filled stat on 495/495` with 0 call-up +warnings; prod pre/post JSON diff shows exactly `{'stat': 495}` — the only +column touched, on all 495 rows (row count 495 unchanged, row ids +unchanged; all 495 previously held the site's raw fractions, 0.20–0.28 +style, now scaled rank percentiles e.g. Teddy Blueger 0.2045 → 0.513); +the SECOND prod pass wrote byte-identical values (full-table capture +sha256 equal across runs) — deterministic per-row inference, idempotent +re-fill confirmed; mean_max_prob 0.9481 with top-of-group Cutter Gauthier +(tims 1, 93.3), Logan Stankoven (tims 2, 95.6), Jakob Chychrun (tims 3, +95.6). + +### 1.1 Missing-day and empty-snapshot semantics (owner-approved) + +* A missing backtrack day is **NORMAL**: the tables only gain a date's rows + after that day's games end and the publish runs. The job's FIRST step + (backfill_missing_days, section 1.2) tops up the completed game days + after the latest published date directly from the NHL API, and the + inference pass prints ONE warning (`WARNING: published history ends at + ` / a "carry no per-game raw stat(s)" line) naming any day the + recompute will miss, then proceeds — the affected features are computed + over the published record it has. Never an exit. +* If the LIVE snapshot itself has no rows for the pick date (the snapshot + build has not run yet), there is nothing to score: the run prints + `no picks computed: no live snapshot rows for `, appends the same + line to the job summary, writes NO Picks rows, and exits 0 — CLEANLY, no + traceback. The scheduled job stays green. +* The SAME clean-skip became an OWNER CONFUSION before 2026-11-03: with + the then-default live read FOLLOWING the write env, an + `environment=dev` dispatch silently read the EMPTY + `Player-Snapshots-dev` shell and clean-skipped exactly this way — green + job, zero picks. That whole axis is now GONE (source is hard-pinned + prod); a clean-skip today means the PROD live snapshot genuinely + has no rows for the pick date yet. +* The artifact staleness warning is unchanged (section 6). +* Train/run parity of the shot block is enforced by test + `test_live_shot_block_matches_training_core` / + `test_live_shot_block_replays_historical_date_exactly` + (tests/unit/test_predict_picks.py): the live path's block equals + `shot_features()`' training math for the same rows, max abs diff < 1e-9. + +## 2. Artifact refresh (owner-run, local, on demand; NOT scheduled) + +`train_export.py --upload` is STILL the owner's only training step: + + # a. refresh the raw store for the recent seasons (local only) + make backtrack-store SEASON=2025 # runs local_store.py --build 2025 + # (+ SEASON=2026 when the new season opens) + # b. publish the newest rows to the backtrack tables (the history source: + # prior-games context for the ML pick pass - today's rows come from + # the LIVE Player-Snapshots table, and today's shot/TOI block from the + # raw store these dumps/rebuilds feed - see section 1.1) + make backtrack-publish ENV=prod SEASON=2025 SEASON=2026 + # c. local on-demand train + export + upload + make train-ml-export ENV=prod THROUGH= SEED=0 + # (equivalently: uv run --with lightgbm==4.7.0 python \ + # smartscore/scripts/backtrack/train_export.py --env prod \ + # --source supabase --through-date --seed 0 --upload) + +The **artifact-fact convention**: the newest artifact is always "whatever +the last `train_export.py --upload` pushed". The key is +`/artifact__.joblib` under prefix `predict/ml` +(`ML_ARTIFACT_PREFIX` for S3, `ML_ARTIFACT_STORAGE_PREFIX` for Storage): +file names sort by vintage and `run_daily_picks.load_artifact` / +`load_artifact_storage` always pick the lexically latest `.joblib` under +the prefix — no config file to keep in sync, no workflow edit on a +refresh, and a rollback is a re-upload/keep of the older key (or trimming +the newer key away). The local file `train_export.py` writes, +`data/ml/artifact__.joblib`, and the upload key share +the same object — the workflow reads the UPLOADED key by default. + +Latest vintage: `artifact_2026-10-29_0.joblib` (2026-10-30 owner refresh; +`--env prod --source supabase --seed 0` — 624,582 rows, frame_source +supabase, through 2026-10-29, seed 0, version 2) uploaded to Supabase +Storage `ml-artifacts/predict/ml/artifact_2026-10-29_0.joblib` +(byte-identical round-trip verified); the (2026-10-30 + 2026-10-29) local +dry smokes with it print NO staleness warning (`age=1d`) and 3 picks +(mean_max_prob 0.9815 / 0.9259). `artifact_2026-10-27_0.joblib` (and the +legacy `artifact_2026-06-14_0.joblib`) remain on the prefix as rollback +keys — the loader picks the lexically latest, so a rollback is a re-upload +of the older key. + +**Artifact SOURCES, in strict resolution order** (`run_daily_picks +.pick_daily_bundle`): + +1. `--artifact PATH` (a local file, e.g. committed under `data/ml/`) — + always wins; the downstream inference is byte-identical across sources. +2. S3 bucket/prefix — only when `ML_S3_BUCKET` is set AND AWS credentials + exist in the environment. If they are absent/denied and Storage is + configured, the run FALLS THROUGH to Storage (loud log line). +3. **Supabase Storage** (`ML_STORAGE_BUCKET`, default bucket + `ml-artifacts`, prefix `predict/ml`, PRIVATE bucket read with the + service-role key) — the no-AWS path and the ml-picks workflow's + DEFAULT: it uses the exact SUPABASE_* secrets the job needs anyway, so + an artifact refresh = one owner-side upload command, zero new secrets. + +Artifact **version 2** carries the logreg member as the FULL fitted train-time +preprocessing pipeline (SimpleImputer -> StandardScaler -> LogisticRegression); +version 1 artifacts auto-patch at load with a loud +"LEGACY ARTIFACT FORMAT" retrain warning (`train_export.py` below commit +"fix(artifact): export train-time preprocessing pipeline..." exported the bare +inner estimator, which crashed on NaN-bearing live frames). + +## 3. Owner setup — CURRENT minimal-secrets checklist + +The workflow's artifact DEFAULT is **Supabase Storage**, so the only +required secrets are the ones already needed: + +1. **Add/confirm the Supabase secrets** (artifact read + inference writes): + `SUPABASE_URL`, `SUPABASE_API_KEY`, `SUPABASE_SERVICE_ROLE_KEY` + (repo `Settings -> Secrets and variables -> Actions`; the same secrets + `deploy.yml` already uses — if they exist, nothing to do). +2. `MLPICKS_DISPATCH_TOKEN` (the per-game kick path's token) — if the + kick architecture is used; the nightly cron path needs nothing extra. +3. *(OPTIONAL, S3 path only)* `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, + `ML_S3_BUCKET` (+ `AWS_REGION`) — only if the owner wants the artifact + on S3. Absent secrets = the run reads Storage automatically. + +Artifact refresh (section 2c) with NO AWS at all: + + make train-ml-export ENV=prod THROUGH= SEED=0 # S3 unchanged, needs AWS + # NO-AWS equivalent (uploads to Supabase Storage bucket ml-artifacts): + uv run --with lightgbm==4.7.0 python smartscore/scripts/backtrack/train_export.py \ + --env prod --source supabase --through-date --seed 0 \ + --upload --storage-bucket ml-artifacts + +Verify the Storage upload, then trigger `dry: true` smoke (step 4). The +bucket auto-creates idempotently on first upload; it is PRIVATE — the +Actions runner downloads with the service-role key. + +Other accepted artifact sources (no code change, same inference): +commit the artifact into the repo under `data/ml/` (it is a few MB +compressed joblib of weights — weights are not secrets) and pass +`--artifact data/ml/.joblib`; or provide the 3 AWS secrets and +`ML_S3_BUCKET` for the legacy S3 read. + +(The old runbook's ECR Public alias console step is DELETED — there is no +registry, no image, and no alias anymore.) + +## 4. Expected accuracy by artifact vintage (measured, no tuning since) + +Pooled out-of-fold pick accuracy (one pick per tims group/day). Source: +`smartscore/scripts/backtrack/MODEL_NOTES.md` (96f0ff2 cache rows) and the +same file's era table. + +| vintage / era | ensemble | LGBM | hgpg | gpg | +|---|---:|---:|---:|---:| +| seed 0, pooled all-era (3,159 challenge dates) | **29.92%** | 29.060% | 28.047% | 26.496% | +| seed 1, pooled all-era | 29.41% | 29.376% | 28.047% | 26.496% | +| seed 3, pooled all-era | 29.82% | 28.997% | 28.047% | 26.496% | +| recommended bundle: seed 0 | ~29.9% | — | — | — | + +Since the stage-2 exact-feature design the INFERENCE-TIME rolling/career +block is computed exactly (same core, same per-game facts as training) — +the accuracy table above is governed by the ARTIFACT's vintage, not by the +attach: each artifact's `metadata.train_through` (printed on every run and +surfaced in the job summary) is the last date its training data covered, +and a vintage older than 7 days prints the section-6 staleness warning. +Refresh the artifact after landing data-plane changes so the model sees +the newest games. + +Season-by-season (ensemble means, same model): + +| season | ensemble | LGBM | hgpg | gpg | +|---|---:|---:|---:|---:| +| 2021-22 | 28.32% | 27.24% | 24.80% | 22.97% | +| 2022-23 | 30.28% | 28.48% | 30.18% | 27.33% | +| 2023-24 | 29.17% | 28.54% | 23.99% | 23.85% | +| 2024-25 | 29.41% | 29.86% | 30.36% | 29.32% | +| 2025-26 | 31.12% | 31.23% | 30.33% | 28.28% | + +Strict 2023-24+ slice (667 dates): ensemble mean **29.868%** (29.735 / +29.835 / 30.035 for seeds 0/1/3), LGBM 29.835%, hgpg 28.136%, gpg 27.086%. +Owner-facing headline stays **~29.7% all challenge dates / ~29.9% strict +2023+** — none of the V16 follow-up experiments beat the +0.5pp-on-both- +seeds gate, and the only ≥30% (LGBM 30.36%) was leak-invalidated via +same-game `lineup_unit`. + +## 5. Cost: $0.00 + +* GitHub Actions on a PUBLIC repo: free (standard hosted-runner minutes for + public repos cost nothing; with the store refresh in the job this is + ~tens of minutes a day across the cron pass and the kicks — still free). +* S3 artifact: free at this scale (a few MB per vintage, a couple of reads + a day). +* No ECR, no Lambda, no EventBridge, no CloudWatch — the whole MLPicks AWS + surface is gone. +* TOTAL ≈ **$0.00/month** (vs ~= $0.04-0.05/month for the retired image + pipeline). + +## 6. Roll-forward on a stale artifact + +`run_daily_picks.py` carries the handler's stale-artifact guard unchanged: +if the artifact's `train_through` is **more than ARTIFACT_STALE_DAYS = 7 +days** old, it prints +`WARNING: artifact trains through , which is days stale (refresh +with a local train_export.py --upload run)` and the job summary surfaces +the artifact vintage — the run still FAILS CLOSED if the frame is missing +today's rows, but it will happily score a stale artifact, so treat that as +the owner's reminder: the runbook's section 2a-2c is the roll-forward. +(For an emergency cut-over use the `date` input with yesterday's slate.) + +## 7. What NO LONGER exists in the repo + +* `smartscore/lambda/predict_picks/` entirely (Dockerfile, `handler.py`, + the `ml_picks_rust_stub.py` image-build stub, `__init__.py`). +* `build_scripts/deploy_ml_lambda.sh` and the Makefile's `build-ml-image` / + `deploy-ml-lambda` targets (plus `PUBLIC_ECR_ALIAS`/`PUBLIC_ECR_REPO` + vars). +* `templates/template.yaml`'s MLPicks resources and parameters: + `MLPicksFunction`, `MLPicksLogGroup`, `MLPicksDailyTrigger`, + `MLPicksFunctionPermission`, `MLPicksArtifactReadPolicy`, the + `MLS3Bucket`/`MLEcrImageUri` parameters, and the `MLS3Configured`/ + `MLImageConfigured` conditions. +* `deploy.yml`'s docker build/push + `--sync-only` sync steps and the + `MLS3Bucket`/`MLEcrImageUri` parameter overrides. +* The `PUBLIC_ECR_ALIAS` secret and the ECR Public/private repositories and + images in AWS. + +Everything runs from a **GitHub-hosted runner** (`ubuntu-latest`) on the +schedule above. The `train-ml-export` Makefile target survives (it wraps +the kept `train_export.py`); the other 15 lambdas and the deploy flow are +untouched. + +## 8. Open risks + +* The LIVE snapshot must publish its context columns (REQUIRED_LIVE_COLUMNS + in run_daily_picks.py — team_name / opp_goalie_* / the morning rates); + the pass hard-fails (fail-closed) naming exactly what is missing + (intentional), same as the old 16-column contract. +* The rolling/career shot block is EXACT as of the stage-2 design (the + published per-game raw columns + the shared core): today's 14 shot/TOI + features are recomputed from the same per-game facts the training frames + were built from, with the daily gap-fill (section 1.2) closing yesterday's + games before inference and per-date markers making re-runs free. The + freshness chain is now: the gap-fill (0-1 missing days typical) -> the + published record; a gap-fill failure degrades LOUDLY to + exact-over-available-history (warn-not-exit, section 1.1) and the affected + dates are retried by the next pass. What is still attached from PUBLISHED + rows and therefore lags by the publish cadence (unchanged, by design): the + team rates (`tgpg`, `otga`, `otshga`) from `Team-Stats-backtrack-{ENV}` + and the goalie context (`gaa`/`save_pct`/...) from + `Goalie-Snapshots-backtrack-{ENV}` plus the LIVE snapshot's own morning + rates — those tables' grains (team totals, goalie starts) are not in the + per-game raw columns' scope for the picks frame, and their freshness is + governed by the same nightly publish they always had (section 2a-2b + cadence, DAILY_DATA_RUNBOOK). +* The Picks write is stat-only by construction (`update().eq("id", ...)` + PostgREST PATCH): no delete, no insert, so the removed legacy writer's + wipe/restore scaffolding is unnecessary. The runbook guarantees the + picks table = the site's slate + the model's stat column; the site's OWN + SaveToDb path (its full-wipe + full-slate reinsert) is unchanged and + remains the ONLY wiper of the table. +* `pick_rows_to_picks_db` whitelists the SMARTSCORE_ML_PICKS output rows + (minus REMOVE_KEYS — `ppg` is not a table column on either env); a table + schema change must be reflected in REMOVE_KEYS/the whitelist + + migration. +* DST drift: the fixed UTC cron moves an hour across clock changes + relative to ET (section 1). +* Prod LIVE snapshot rows may be empty if the pipeline's snapshot build + stops — the run then exits CLEANLY (warn + no picks + status 0, section + 1.1) every day until the build recovers; the daily green-but-empty + summaries are the signal to check the pipeline. + +## 9. Per-game kick (race-fixed: the kick fires from the state machine) + +ADDITIVE to the nightly cron above: AWS EventBridge remains the SOURCE OF +TRUTH for "restart the pipeline ~5 minutes after every distinct game start"; +the ML picks pass runs on the GitHub Actions runner, kicked from the END of +the pipeline run itself. + +### 9.1 The new chain (Per-game kick) + +* **Chain:** per-game `TriggerStateMachineAt_*-{ENV}` rule (created by + `smartscore/utility.py::schedule_run`, game_start + + `PIPELINE_RESTART_OFFSET_MIN` = 5 minutes) -> PlayerProcessingPipeline + state machine RE-EXECUTION (a full refetch: GetTims re-reads the Tim's + pick pool — started games leave it — and SaveToDb/PublishToDb rewrite the + LIVE snapshot rows) -> new final `KickMLPicks` Task state invokes the + `MLPicksKick-{ENV}` relay Lambda -> one `repository_dispatch` + (`event_type: ml-picks-game`, `client_payload: {date, dry, context: + 'post-game-start'}`) into `ml-picks.yml`. ONE state-machine target per + rule (the pre-#146 shape); the old parallel event relay target is gone. + + ``` + EventBridge @ game_start + 5m -> state machine restart (refetch full: + GetTims -> SaveToDb -> [UpdateHistory] -> PublishToDb) -> KickMLPicks + -> repository_dispatch -> Actions ML pick pass (fresh groups) + ``` + +* **Explicit-date relay semantics:** the relay no longer derives the slate + date itself, and `schedule_run` no longer stamps a date into any target + Input. The state machine passes the pick date its own writes used: + `handle_publish_db` returns `{"date": event.date or get_date()}`, and the + `KickMLPicks` state relays it as the explicit `{'date': }` contract. + The Toronto-today fallback inside `ml_picks_kick.py` remains ONLY for an + owner manual invoke with no date at all (e.g. an ad-hoc console test of + the dispatch plumbing). +* **GAME-START RACE GUARD (why this ordering):** the previous design fired + the relay as a SECOND EventBridge target at game_start+5min — in parallel + with the state machine restart. The Actions job could therefore run + BEFORE the refetch completed and compute picks from stale groups (and + stale tims: started games leave the pick pool). Now the kick is a state + inside the same run, placed after PublishToDb: the ML pass starts the + SECOND the write path completes, so its snapshot read is time-consistent + with the rows just published. No wait/delay knob is needed anywhere — + the ASL ordering itself is the serialize point (nothing serializes the + ML-read after the writes anymore; now it is downstream of them). +* **The relay is bounded by design:** `smartscore/ml_picks_kick.py` uses + stdlib urllib only, no ML dependencies, and never touches Supabase or + Picks — it forwards `{date, dry}` and nothing more. +* **Cold-start env wiring (PR #146 escalation fix):** the relay's Handler is + `event_handler.handle_ml_picks_kick`, which lives in the SHARED + `event_handler` module chain — `event_handler.py:9 -> player_archive.py:38 + -> config.py` — and `config.py:19/:23` builds BOTH Supabase clients at + module import. The first deployment carried only `GITHUB_DISPATCH_TOKEN` + and died on cold start (`SupabaseException: supabase_url is required`) + before the handler ever ran. The template now wires + `SUPABASE_URL`/`SUPABASE_API_KEY`/`SUPABASE_SERVICE_ROLE_KEY` into + `MLPicksKickFunction`'s Environment from the SAME CloudFormation params + the other 15 functions use (`SupabaseUrl`/`SupabaseApiKey`/ + `SupabaseServiceRoleKey`) — no new secrets. The runtime contract is + UNCHANGED: the relay never USES the clients (guarded by + tests/unit/test_ml_picks_import_chain.py, which imports the real chain in + a deploy-zip-shaped sandbox; test_template_env_vars.py asserts the wiring + and reduces the old relay exemption to the optional ENV/PostHog keys + only). +* **IAM:** `StateMachineExecutionRole` carries `lambda:InvokeFunction` on + `MLPicksKickFunction` plus a `states.amazonaws.com` function-level + permission (`MLPicksKickStatePermission`, SourceArn pinned to the + pipeline state machine; **defensive** — the role grant is the primary + source). The old `MLPicksKickFunctionPermission` (events.amazonaws.com, + per-rule SourceArn) was removed with the parallel target. +* **PAT setup (one time):** create a **fine-grained PAT** scoped to this + repository with **BOTH Actions: Read & write AND Contents: Read & write** + permissions (the OLD guidance here said "Actions: write only" — that token + deploys fine but GitHub rejects its `repository_dispatch` with + `403 Resource not accessible by integration`, which is the exact failure + diagnosed in the run below). Fine-grained PATs need the Contents + permission for dispatch; Actions-only is the common single-checkbox miss. + **Simpler alternative (recommended):** a **classic PAT with the `repo` + scope** — the dispatch endpoint typically only accepts it with that scope + and it cannot be under-scoped in the same way. Short expiry + (30–90 days; note rotation below). Unchanged: store it as the GitHub + repo secret `MLPICKS_DISPATCH_TOKEN` (Actions forbids secret names + starting with `GITHUB_`; the Lambda env key stays + `GITHUB_DISPATCH_TOKEN` — `deploy.yml` maps one to the other). deploy.sh + then sets it as the CloudFormation `GITHUB_DISPATCH_TOKEN` parameter + with `NoEcho: true`: either deploy with + `GITHUB_DISPATCH_TOKEN= ./build_scripts/deploy.sh` (the script + forwards it as a parameter via `CFN_PARAM_OVERRIDES`), or set it once + through the console/CLI on the `SmartScore-{ENV}` stack — an + `update-stack` without the parameter keeps the previously stored value. + (Owner alternative if a CloudFormation-held PAT is not wanted: a + classic repo-scoped token with `repo` scope + Actions write, stored the + same way. NEVER commit the token; `deploy.sh` never prints it.) +* **Idempotency (multiple runs per day):** multiple state-machine runs per + date are fine and EXPECTED (the morning/projections/lineup refresh rules + all re-execute it, each firing exactly ONE kick at the end; the retained + nightly cron pass remains the guaranteed full-day snapshot fallback). + Every kick re-runs the same daily pass; the write (the ONLY mode, + `stat_update`) is a per-row stat-column PATCH on the site's OWN + full-slate rows (read-modify-write, never a wipe, never an insert), so a + repeat pass for the same date RE-FILLS the current slate's stat column + against whatever rows the site has published since. The + workflow serializes reruns via its `concurrency` group, so two kicks + overlapping queue, not race. +* **Cost/rates for an NHL day:** ~15 games/day after the first game + starts → ~15 kicks/day on the AWS side (each is one Lambda invocation + inside the existing state machine run — no extra Lambda trigger) and ~15 + one-dispatch GitHub API calls (far below the repo's 60+ authenticated + requests/hour headroom; no self-limiting needed). With the + runner-side store refresh (section 1.2) each Actions pass costs ~10-20 + min (refresh) + ~3-6 min (the pass itself), so ~30 passes worst case per + NHL day; on a public repo the hosted-runner minutes stay free, and the + HTTP-cache step makes a same-day second pass cheap (newly FINAL games + only). +* **Failed-kick semantics:** no `Retry` on `KickMLPicks` — a dispatch + failure (e.g. expired PAT) fails the state machine run loudly and shows + in CloudWatch, instead of silently dropping the pick pass. Re-triggering + (a later game-start rule or a manual replay via the + `workflow_dispatch` knob) is an idempotent re-kick. +* **Open risks:** PAT expiry silently breaks kicks before the nightly + cron saves the day — the relay fails loudly (missing/invalid token → + CloudWatch error per kick) and the workflow replay knob is + `workflow_dispatch` with `date`; EventBridge fan-out is bounded (1 + target/rule, ~15 rules/day, delete_expired_rules recycles them + nightly); duplicate kicks for the same game-start minute collapse into + one rule (rule names are time-keyed); an owner manual Lambda invoke + without a payload date falls back to Toronto-today. +* Actions minute limits: irrelevant for a public repo today, but if this + repo goes private, free minutes are 2000/month — the job uses ~3-6 + minutes/day, introducing order-of-magnitude headroom before it matters. + +## 10. ONE SHARED HISTORY LEDGER (dev backtrack tables deleted) + +**ONE SHARED HISTORY LEDGER: `Player-Snapshots-backtrack-prod`.** Both dev +and prod runs READ history from and BACKFILL into that same ledger; the ENV +suffix applies ONLY to the LIVE `Player-Snapshots-{env}` table and the +`Picks-{env}` table. The dev backtrack tables were deleted — see +`docs/backtrack_dev_deleted.md` (per-table verification: prod was verified +to supersede dev — identical key sets over the full dev range, value equality, +and prod's extra rows are exactly the 2026-27 season — before the +617k/34k/36k player/team/goalie dev rows were removed on 2026-10-24). The +empty dev Postgres shells were tracked separately for the OWNER to DROP +(PostgREST cannot DDL): final `DROP TABLE` SQL + VACUUM/size notes live in +**section 11, "Deleting the -dev backtrack table shells"** of this runbook +(added 2026-11-03; shells re-verified 0 rows on 2026-11-03). The migrate job +cannot recreate them (backtrack migrations are prod-pinned: +`BACKTRACK-PROD-PINNED` per file + deploy.yml guard). + +* **Who does what now:** the nightly publish and the one-shot top-ups publish + to the `-prod` backtrack tables (the bootstrap when the shared ledger is + truly empty: `make backtrack-publish ENV=prod`); `backfill_missing_days` + targets the shared ledger INDEPENDENT of `--env` (its only fail-loud gate + left is that shared ledger being TRULY empty — the real bootstrap state — + and it says exactly that); `run_daily_picks.history_rows` / + `history_team_rows` / `history_goalie_rows` read the shared `-prod` + ledgers regardless of the picks env. Dev-mode runs write their Picks and + read their LIVE snapshots `-dev`, but heal the SAME shared history. +* **Direct owner note — dev-mode kicks are viable again:** a dev-mode run is + SELF-HEALING against the shared ledger: its first step backfills + YESTERDAY's FINAL games straight into `Player-Snapshots-backtrack-prod` + (write-up regardless of the picks env) before any history is read, and + `history_rows` reads that ledger down. There is NO more false + "Player-Snapshots-backtrack-dev is empty — run the publish/backfill chain + first" wall: that message came from the deleted-dev-shell suffix routing + (the fail-loud guard intended for the OLD publish flows), which has been + removed — a manual dispatch `environment=dev` + kick now does the right thing and only the LIVE/Picks writes land `-dev`. +* **Bootstrap rule (unchanged in substance):** the ONE gate that still fails + loud is a genuinely empty shared ledger — run the publish/bootstrap chain + once (`make backtrack-publish ENV=prod`); the helper never bootstraps it. +* In-code anchors: `SHARED_HISTORY_LEDGER` + + `player_table`/`marker_table` in `backfill_missing_days.py`; + `SHARED_HISTORY_TABLE` / `SHARED_TEAM_TABLE` / `SHARED_GOALIE_TABLE` in + `run_daily_picks.py` (the deleted-shell guard for any script that still + resolves a `-dev` backtrack name stays available: + `smartscore/scripts/backtrack/deleted_env_tables.py`). + +## 11. Deleting the -dev backtrack table shells (rows deleted 2026-10-24; shells pending owner DROP) + +The three dev backtracking tables were ROW-deleted on **2026-10-24** after +`-prod` was verified to supersede them (same key sets over the full dev range +2013-10-01..2026-06-14, value equality on spot-checks, prod's extra rows are +exactly the 2026-27 season — full evidence in +`docs/backtrack_dev_deleted.md`). Their empty Postgres shells still exist: +PostgREST cannot DDL (proof: docs/backtrack_dev_deleted.md), so the final +`DROP TABLE` goes to the OWNER, in the Supabase dashboard SQL editor or +`psql "$SUPABASE_DB_URL"`. + +**Do NOT put these DROPs in `supabase/migrations/`** — the standing `migrate` +CI job re-applies every file in `supabase/migrations/` on every run +(deploy.yml "Apply migrations"), and on a `main` push it runs with `ENV=prod`, +aiming DDL straight at the prod tables. The migrate job can also never +re-create the dev shells again: every backtrack migration file in +`supabase/migrations/` is now hard-pinned to the `-prod` literal suffix +(`BACKTRACK-PROD-PINNED` header in each file; enforced by the "Guard +migration files" step in deploy.yml, which fails any migration that scopes a +backtrack table through `__ENV__` or hardcodes a `-dev`/`-prod` suffix +outside the pinned marker). + +### 11.1 Owner DROP SQL (Supabase dashboard SQL editor / psql via SUPABASE_DB_URL) + +Run verbatim (schema `public`; the shells are verified 0 rows — re-checked +2026-11-03): + +```sql +DROP TABLE IF EXISTS "Player-Snapshots-backtrack-dev"; +DROP TABLE IF EXISTS "Team-Stats-backtrack-dev"; +DROP TABLE IF EXISTS "Goalie-Snapshots-backtrack-dev"; +``` + +Then verify and reclaim space: + +* Verify: a `SELECT COUNT(*)` against each name now fails with `relation + ... does not exist`; simply confirm the three names disappear from the + dashboard's Table editor list. PostgREST HEAD on the same path returns a + 404 (instead of the earlier `Content-Range: */0` on the empty shell). +* Size note: `DROP TABLE` unlinks the heap/index files, so the dev shells' + disk is released by the drop itself, unlike the earlier (2026-10-24) + row-delete pass, which left dead tuples inside the still-alive shells. +* After the drop, run `VACUUM FULL "Player-Snapshots-backtrack-prod";` (and + likewise for `Team-Stats-backtrack-prod` / + `Goalie-Snapshots-backtrack-prod`) once, off-peak, to compact the shared + history ledgers and settle the dashboard's reported project size — + `VACUUM FULL` takes an ACCESS EXCLUSIVE lock on each, so schedule the + brief window (a pause/restore also reclaims disk but logs an outage). +* No backup is required for this step by the owner-run: the shells are + verified 0 rows, and full pre-delete backups of the row content already + exist (§11.2). + +### 11.2 Backup / restore paths (r-deldev worktree) + +The pre-delete row content was exported and hashed before the 2026-10-24 +deletion, in the `r-deldev` worktree (branch `feat/delete-backtrack-dev`; +local path `SmartScore-deldev`): + +* `data/backups/backtrack-dev-*.csv.gz` — one gzip per table + (`Player-Snapshots-backtrack-dev`, `Team-Stats-backtrack-dev`, + `Goalie-Snapshots-backtrack-dev`), row counts + SHA256 recorded in + `data/backups/MANIFEST.md` in the same worktree. +* Restore: per table, stream the gzip and re-upsert the CSV batches with + `on_conflict` = the table's primary key (`date,player_id` for players; + `season,team_abbrev,game_id` for team stats; `season,player_id,date` for + goalies), via the `SUPABASE_DB_URL` psql path (PostgREST batch upserts + work for the small tables; a full 617k-row player restore is safer psql/ + COPY). +* Everything the dev tables were derived from also lives in + `data/raw_nhl.sqlite` (the one-row-per-player-game audit trail), so a + full re-derivation is possible with `local_store.py --build --derive + --publish` (all publishes now target `-prod`). diff --git a/docs/shot_cols_dev_backfill_status.md b/docs/shot_cols_dev_backfill_status.md new file mode 100644 index 00000000..5c4e32d8 --- /dev/null +++ b/docs/shot_cols_dev_backfill_status.md @@ -0,0 +1,59 @@ +# Shot/TOI + club columns: dev-only backfill status (2026-10-24) + +Status of the 16-column migration/backfill on **Player-Snapshots-backtrack-dev** +only. The spec lives on `feat/supabase-spec` / PR #138 +(`docs/supabase_shot_columns.md`) and is **not duplicated here**; prod is NOT +touched this run. + +## What ran + +1. **DDL (Step 1)** — `supabase/migrations/20261024_add_shot_columns_player_snapshots_backtrack.sql` + (16 columns, `__ENV__` placeholder) was applied to **dev** by the + `migrate-adhoc` GitHub Actions workflow (run 40122024730, ENV=dev): all 16 + columns verified present on the dev table. +2. **Backfill (Step 2)** — `smartscore/scripts/backtrack/publish_shot_cols.py --env dev`: + 617,310 rows upserted in 1,235 batches of 500 with + `on_conflict="date,player_id", returning="minimal"`, 0 errors, 669s of + upload time (13m19s wall including local `shot_features()` compute over the + 692,634-row store). NaN→None via `astype(object)` before upsert; `name` + rides along because PostgREST enforces NOT NULL even on PK-conflict + sparse upserts (keys-only 400s with `null value in column "name"`). +3. **Spot check (Step 3)** — one-shot QA tool `spot_check_shot_cols.py` + (deleted after use; see it by sha in git history): 1,000 random + (date, player_id) rows read back from Supabase and compared against a + fresh verbatim `shot_features()` recompute. **0 mismatches across all 16 + columns** — retained here as the final QA evidence; worst relative float + diff 4.6e-15 (double round-trip noise, tolerance 1e-9); + `career_games`/`team_abbrev`/`opponent_abbrev` exact. Row count re-proven + 617,310 via full PK key dump (no rows added/deleted). + +## Non-null coverage (from the backfill dry run) + +`career_games`/`team_abbrev` 100%; shot/TOI rolling block 98.1% (12,387 +season-first-of-season rows NaN by design); `career_goals_pg`/`career_shots_pg`/ +r-windows/ewm 99.6% (career-debut rows NaN); `opponent_abbrev` 99.995% (32 +store rows the source game log lacked the field for — published NULL, mirrors +`club_map()`'s local null-club behavior); `sd_sh_pct` 97.2% (also +shots_before=0 rows). + +## Divergences from the spec doc (PR #138) + +* The spec's `~447k non-null` estimate for the `sd_*` block was low — actual + 605,393 non-null (98.1%); the NaN policy (season-first + career-first) is + as specified, the estimate just miscounted season boundaries. +* Batch size is 500 (spec §5 / publish() convention), not the 1,000–5,000 + mentioned in the run request — PostgREST's hard cap is 1,000 rows/request; + 500 keeps request sizes equal to the existing publish path. +* `count=exact` on the table times out under PostgREST's statement timeout + shortly after a bulk write; the authoritative row-count check is the full + PK key enumeration (PK guarantees one row per key). Script falls back + automatically. + +## Prod gate + +`Player-Snapshots-backtrack-prod` is untouched. Promotion when the owner +authorizes: apply the same migration through the standing `deploy.yml` +migrate job (the transient `migrate-adhoc` workflow that applied it to dev +has been deleted, superseded by the standing job), then +`uv run python smartscore/scripts/backtrack/publish_shot_cols.py --env prod`. +Backfill is idempotent (upsert on the PK; safe to re-run/reeinterrupt). diff --git a/docs/supabase_shot_columns.md b/docs/supabase_shot_columns.md new file mode 100644 index 00000000..14f60a9a --- /dev/null +++ b/docs/supabase_shot_columns.md @@ -0,0 +1,341 @@ +# Spec: Supabase columns the SmartScore ML ensemble needs to train/predict purely in-cloud + +Written against `smartscore/scripts/backtrack/model.py` and +`smartscore/scripts/backtrack/local_store.py` at **c82b2e7** (branch +`feat/feed-fidelity`). Goal: option 1 of the AWS free-tier plan — publish +the columns that are currently computed locally against +`data/raw_nhl.sqlite` so `model.py` (`shot_features()`, `club_map()`, +`add_derived()`) never needs the SQLite file. This doc changes **no code +and runs no SQL**; it is the decision table the owner reviews before +approving the migration. + +## 0. Today's state (verified) + +**Table naming.** `model.py` builds names as `f"Player-Snapshots-backtrack-{ENV}"` +with `ENV ∈ {dev, prod}` (`smartscore/config.py`), so the dev tables are +`Player-Snapshots-backtrack-dev`, `Team-Stats-backtrack-dev`, +`Goalie-Snapshots-backtrack-dev`. Every migration in `supabase/migrations/` +uses the `__ENV__` placeholder and is re-piped through psql on every deploy +(no migration history); all statements must stay idempotent. + +**Row counts (from the local model caches of the dev tables, Oct 2026):** + +| table | rows | date range | +|---|---|---| +| `Player-Snapshots-backtrack-dev` | **617,310** | 2013-10-01 .. 2026-06-14 | +| `Team-Stats-backtrack-dev` | 34,300 | full published window | +| `Goalie-Snapshots-backtrack-dev` | 36,696 | full published window | + +**Current player-snapshot columns** (order from the fetched dev CSV): +`date, player_id, name, team_name, home, gpg, hgpg, five_gpg, hppg, tgpg, +otga, otshga, injury_status, injury_desc, tims, lineup_unit, +lineup_position_group, pp_unit, lineup_status, scored, ppg` +— `tgpg/otga/otshga` are declared but **left null by design** (they live at +their honest grain in Team-Stats-backtrack). Key: `PRIMARY KEY (date, player_id)`, +upserted by `local_store.publish()` in 500-row batches with +`on_conflict="date,player_id"`. One row **per player per game date**, i.e. +the row for date D already reads "entering game D" (strictly-before +cutoff). Team rows key `(season, team_abbrev, game_id)`; goalie rows key +`(season, player_id, date)`. + +**What publish() sends today** (local_store.py publish(), ~line 1913): +`date, player_id, name, team_name, home, gpg, five_gpg, ppg, hgpg, hppg, +tims, scored, lineup_unit, lineup_position_group, pp_unit, lineup_status`, +sourced from local `derived_features` + `player_games` + `player_lineups` ++ `tims_daily`. `publish_team()` / `publish_goalies()` fill the other two +tables. PostgREST **rejects an entire batch that names an unknown column** +— the migration must land before any publish gains new keys. + +**The 42-feature count.** `DATASET_FEATURES` at c82b2e7 = 40 numeric + +2 categorical = **42** entries (the "43" in the deployment-plan report +appears to have counted the `scored` label). The ledger in §4 sums to 42 +every line accounted; the optional `--lineup projected` mode adds 8 more +(`proj_lineup_unit_b, proj_pp_unit_b, proj_line_conf, proj_pp_conf, +linemate_prior_gpg_mean, linemate_prior_ppg_mean, pp_unit_prior_ppg_mean, +line_intact`) which are **out of scope** for this spec but share the same +derivation paths and would also publish cleanly on the same PK. + +--- + +## 1. Decision table — Block A: per-player-game shot/TOI columns (14 new) + +All on **`Player-Snapshots-backtrack-{ENV}`**, riding the existing +`(date, player_id)` PK — no key change. Every column is an aggregate over +the player's **strictly earlier games** (exact port of `shot_features()`, +model.py:379-444), so the row's values are identical whether computed +locally pre-publish or consumed post-publish. + +| column | table | semantics / formula (exactly as `shot_features()` computes it) | source (local store) | grain | dtype | null policy | backfill est. | +|---|---|---|---|---|---|---|---| +| `sd_shots_pg` | Player-Snapshots | season-to-date shots/game = Σ shots over the player's games **in the same season, game_date < D** ÷ count of those games | `player_games.shots` (grid: player_id, game_date, season) | per player-game | `DOUBLE PRECISION` | NULL when 0 prior games in the season (season-first game; code emits NaN) | 617,310 rows touched (upsert; ~447k non-null) | +| `sd_goals_pg` | Player-Snapshots | season-to-date goals/game, same strictly-before frame | `player_games.goals` | per player-game | `DOUBLE PRECISION` | NULL on season-first game | 617,310 | +| `sd_toi_pg` | Player-Snapshots | season-to-date TOI/game in **decimal minutes**; raw `toi` is TEXT `"mm:ss"` → `mm + ss/60` (model.py:401-407) | `player_games.toi` | per player-game | `DOUBLE PRECISION` | NULL on season-first game, or unparseable/absent toi | 617,310 | +| `sd_sh_pct` | Player-Snapshots | season-to-date shooting talent = `goals_before / shots_before` (Σ goals ÷ Σ shots, NOT a mean of per-game pct) | `player_games.goals, .shots` | per player-game | `DOUBLE PRECISION` | NULL when `shots_before = 0` or 0 prior games | 617,310 | +| `r5_shots_pg` | Player-Snapshots | mean shots over the last ≤5 prior games (spans season boundaries; `shift(1).rolling(5, min_periods=1).mean()` per player) | `player_games.shots` | per player-game | `DOUBLE PRECISION` | NULL before the player's ≥2nd game overall | 617,310 | +| `r5_goals_pg` | Player-Snapshots | mean goals over last ≤5 prior games | `player_games.goals` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `r10_shots_pg` | Player-Snapshots | mean shots over last ≤10 prior games | `player_games.shots` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `r10_goals_pg` | Player-Snapshots | mean goals over last ≤10 prior games | `player_games.goals` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `r10_toi_pg` | Player-Snapshots | mean decimal-minute TOI over last ≤10 prior games | `player_games.toi` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `ewm_goals` | Player-Snapshots | exponentially-weighted mean of prior goals, halflife **5 games**, over `shift(1)` per-player series | `player_games.goals` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `ewm_shots` | Player-Snapshots | EWM of prior shots, halflife 5 | `player_games.shots` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `career_games` | Player-Snapshots | count of the player's games strictly before D, all seasons (`cumcount()` after sort by player_id, date, season) | `player_games` rows | per player-game | `INTEGER` (fits int32; int is exact) | never null (0 on debut) | 617,310 | +| `career_goals_pg` | Player-Snapshots | expanding mean of prior games' goals (all seasons): Σ prior goals ÷ prior games | `player_games.goals` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | +| `career_shots_pg` | Player-Snapshots | expanding mean of prior shots | `player_games.shots` | per player-game | `DOUBLE PRECISION` | NULL before 2nd game | 617,310 | + +**Ordering rule the backfill must reproduce to the decimal:** rows sorted +by `(player_id, game_date, season)`, then the per-player/season window +functions applied with a one-row lag (`shift(1)`), so the current game's +own line never enters its feature row — the pre-game/fold-safety invariant +the code comments lean on. Publishing precomputed rather than recomputing +preserves this *only if* done from the same sort; the safest backfill is +"run `shot_features()` verbatim and upsert its output" (sketch in §5). + +Nothing new is needed on `Team-Stats-backtrack-{ENV}` or +`Goalie-Snapshots-backtrack-{ENV}` — their rates (tgpg/otga/otshga, +gaa/save_pct/record/shutouts/games_played) already cover the team and +opposing-goalie features the model joins at read time. + +--- + +## 2. Decision table — Block B: team-abbreviation columns (2 new) + +`club_map()` (model.py:270-287) joins `player_games.team_abbrev / +opponent_abbrev` per `(date, player_id)` to build the `club` / `opp` +join keys. The Supabase snapshot's only team identity is `team_name` = +the NHL **place name**, which renders both New York clubs as +`"New York"` (NYR and NYI share dates constantly) — a name merge cannot +resolve which club a player skated for. (`New Jersey` is unambiguous, +`New York` is not; also `Los Angeles Kings`-style full names never +appear, this column is place names only.) + +Recommendation: **per-row adjective-free abbreviation columns on the +snapshot**, not a separate date→club map table. The snapshot rows are +already one-per-player-game with their own PK and publish path, `club_map` +is keyed `(date, player_id)` anyway, and a side lookup table would add a +third join plus its own publish pipeline for zero columns saved. + +| column | table | semantics / formula | source (local store) | grain | dtype | null policy | backfill est. | +|---|---|---|---|---|---|---|---| +| `team_abbrev` | Player-Snapshots | the club the player skated for in the row's own game (NHL 3-letter: TOR, NYR, NYI, ...) | `player_games.team_abbrev` keyed `(player_id, game_date)` | per player-game | `TEXT` | NULL only if the `player_games` row is missing (should not occur; publish fails closed today) | 617,310 | +| `opponent_abbrev` | Player-Snapshots | the opponent of that game | `player_games.opponent_abbrev` | per player-game | `TEXT` | NULL same as above | 617,310 | + +With these two columns everything `club_map()` supplies lives in Supabase: +`club` := `team_abbrev`, `opp` := `opponent_abbrev`, and the Team-Stats / +Goalie-Snapshots joins in `build_frame()` (model.py:314-334) resolve by +abbreviation instead of place name. **Minimal set = these 2 columns.** +Do not join by `team_name`/placeName under any circumstances (the +"New York" trap), and do not re-introduce `team_abbr` as a name on the +live `Player-Snapshots-{ENV}` table — that migration explicitly forbid it +(see 20261002 header note); this spec only touches the `backtrack` tables. + +--- + +## 3. Feature ledger — the full DATASET_FEATURES cross-check (c82b2e7 = 42) + +Categories: +**A** = `ALREADY-IN-SUPABASE` (direct column, or joined from another backtrack table at read time), +**S** = `ADDED-BY-THIS-SPEC` (§1/§2), +**D** = `DERIVABLE-AT-RUNTIME` (computed in `add_derived()`/`build_frame()`, all inputs are published columns — a cloud pipeline replicates it in pandas/SQL with no SQLite). + +| # | feature | kind | source of truth / proof | +|---|---|---|---| +| 1 | `gpg` | A | columns exist: `Player-Snapshots.gpg` (base migration 20261008) | +| 2 | `five_gpg` | A | `Player-Snapshots.five_gpg` exists | +| 3 | `ppg` | A | `Player-Snapshots.ppg` added by 20261009 migration | +| 4 | `hgpg` | A | `Player-Snapshots.hgpg` exists (3-yr window via compute_historic) | +| 5 | `hppg` | A | `Player-Snapshots.hppg` exists | +| 6 | `home` | A | `Player-Snapshots.home` BOOLEAN; model renders 1.0/0.0 (`build_frame`:351) — cast at read | +| 7 | `tims` | A | `Player-Snapshots.tims` (categorical feed from tims_daily) | +| 8 | `lineup_position_group` | A | `Player-Snapshots.lineup_position_group` ("F"/"D" from shift charts) | +| 9 | `tgpg` | A | `Team-Stats-backtrack.tgpg` joined on (date, club) | +| 10 | `otga` | A | `Team-Stats-backtrack.otga` (opponent-specific rate) | +| 11 | `otshga` | A | `Team-Stats-backtrack.otshga` | +| 12 | `opp_gaa` | A | `Goalie-Snapshots-backtrack.gaa` joined on (date, opp); most-experienced row wins ties | +| 13 | `opp_save_pct` | A | `Goalie-Snapshots.save_pct` | +| 14 | `opp_shutouts` | A | `Goalie-Snapshots.shutouts` | +| 15 | `opp_games_played` | A | `Goalie-Snapshots.games_played` | +| 16 | `opp_wins` | A | parse of `Goalie-Snapshots.record` "W-L-OTL" (`build_frame`:345-348) | +| 17 | `opp_losses` | A | parse of `record` | +| 18 | `opp_otl` | A | parse of `record` | +| 19 | `rank_gpg` | D | `rank(pct=True)` within (date, tims) over published `gpg`+`tims` (`add_derived`:643-645) | +| 20 | `rank_hgpg` | D | same over published `hgpg` | +| 21 | `rank_five_gpg` | D | same over published `five_gpg` | +| 22 | `rank_ppg` | D | same over published `ppg` | +| 23 | `prev2_goals` | D | rolling(2) sum of published `scored`, shift(1) per player (`add_derived`:588-592) | +| 24 | `prev3_goals` | D | rolling(3) sum of published `scored` | +| 25 | `games_since_goal` | D | streak over published `scored` history, cap 15 (`_since_last_goal`) | +| 26 | `days_since_game` | D | date gap to the player's previous published row (`add_derived`:594) | +| 27 | `club_rest_days` | D | date gap per club in published `Team-Stats (date, team_abbrev)` (`add_derived`:598-615) | +| 28 | `opp_rest_days` | D | same on the opponent's club rows | +| 29 | `sd_shots_pg` | S | needs `player_games.shots` sum — NOT published anywhere in Supabase today | +| 30 | `sd_goals_pg` | S | needs `player_games.goals` | +| 31 | `sd_toi_pg` | S | needs `player_games.toi` (TEXT mm:ss → decimal minutes) | +| 32 | `sd_sh_pct` | S | needs `player_games.goals ÷ shots` sums | +| 33 | `r5_shots_pg` | S | last-5 window over `player_games.shots` | +| 34 | `r5_goals_pg` | S | last-5 over `player_games.goals` | +| 35 | `r10_shots_pg` | S | last-10 over `player_games.shots` | +| 36 | `r10_goals_pg` | S | last-10 over `player_games.goals` | +| 37 | `r10_toi_pg` | S | last-10 over `player_games.toi` | +| 38 | `ewm_goals` | S | EWM(halflife=5) over `player_games.goals` | +| 39 | `ewm_shots` | S | EWM(halflife=5) over `player_games.shots` | +| 40 | `career_games` | S | count over `player_games` rows | +| 41 | `career_goals_pg` | S | expanding mean over `player_games.goals` | +| 42 | `career_shots_pg` | S | expanding mean over `player_games.shots` | + +**Sum: 42 = 18 ALREADY-IN-SUPABASE (rows 1-18) + 10 DERIVABLE-AT-RUNTIME +(rows 19-28) + 14 ADDED-BY-THIS-SPEC (rows 29-42). No feature silently +missing; after Block A+B, every number the model consumes lives in +Supabase.** The label `scored` (not a feature) is already column 20 of the +snapshot table; `club`/`opp` join keys come back as internal columns via +Block B. + +Why S and not D for the shot block: `D` requires the per-game **raw** +counters (each game's shots/toi) to be in Supabase. They are not, and +publishing them raw instead would (a) violate the store-design decision +"in this table a rate cannot be recomputed from Supabase alone requires +the SQLite file" being *the intentional trade* (20261008 migration +header), or (b) mean swapping the source of truth to Supabase — a much +bigger decision than an additive column set. Precomputing the same +strictly-before features publish-side keeps SQLite as source of truth and +is the smallest cloud-neutral change. + +--- + +## 4. SQL migration sketch (NOT executed by this PR) + +> **STAGE-2 (2026-10-27) — per-game RAW columns.** Supabase is the LIVE data +> plane. The rolling/career block above stays the training-side history; the +> picks pass now RECOMPUTES it exactly from the published per-game record. +> `supabase/migrations/20261027_add_per_game_raw_columns_player_snapshots_ +> backtrack.sql` adds the per-player-game columns: +> +> ```sql +> ALTER TABLE "Player-Snapshots-backtrack-__ENV__" +> ADD COLUMN IF NOT EXISTS "game_goals" INTEGER, +> ADD COLUMN IF NOT EXISTS "game_shots" INTEGER, +> ADD COLUMN IF NOT EXISTS "game_points" INTEGER, +> ADD COLUMN IF NOT EXISTS "game_toi_min" DOUBLE PRECISION; +> ``` +> +> The published per-game column list is therefore the FOUR raw columns +> (`game_shots` / `game_goals` / `game_points` / `game_toi_min`) beside the +> 14 precomputed aggregates + 2 club columns of Blocks A/B: goals/shots/toi +> are exactly what `model.shot_features_from_games` consumes (the picks +> pass's verbatim recompute core); `game_points` rides along as the +> per-game provenance the trending rates quote (no feature consumes it); +> no `game_played` — row existence/non-null `game_shots` IS the played +> flag (a boxscore lists exactly the players who appeared). Values ride +> the SAME upsert paths: `publish_shot_cols.attach_shot_columns` attaches +> them nightly, the one-shot `publish_shot_cols.py` top-up +> (`topup_raw_game_cols.py`) fills history, and `backfill_missing_days.py` +> creates/only-top-ups missed recent days (2-5 bounded NHL API requests, +> FINAL-state games only, per-date markers for idempotency). + +One migration file, `supabase/migrations/2026MMDD_add_shot_columns_player_snapshots_backtrack.sql`, +`__ENV__` placeholder, idempotent because deploy.yml re-pipes it through psql: + +```sql +-- Shot/TOI rolling block + club identity per player-game (see +-- docs/supabase_shot_columns.md). Row values are prior-games-only +-- aggregates computed by local_store from data/raw_nhl.sqlite; publish() +-- overwrites them on the (date, player_id) upsert. +ALTER TABLE "Player-Snapshots-backtrack-__ENV__" + ADD COLUMN IF NOT EXISTS "sd_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "sd_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "sd_toi_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "sd_sh_pct" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r5_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r5_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r10_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r10_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r10_toi_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "ewm_goals" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "ewm_shots" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "career_games" INTEGER, + ADD COLUMN IF NOT EXISTS "career_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "career_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "team_abbrev" TEXT, + ADD COLUMN IF NOT EXISTS "opponent_abbrev" TEXT; + +-- Optional: serves the (date, club) join Team-Stats lookups prefer. +-- The existing PK (date, player_id) already leads with date, so this +-- index is only worth adding if the planner churns on it in practice. +-- CREATE INDEX IF NOT EXISTS "Player-Snapshots-backtrack-__ENV___club_idx" +-- ON "Player-Snapshots-backtrack-__ENV__" ("team_abbrev", "date"); +``` + +No PK change (still `date, player_id`), no key breakage, no Team-Stats or +Goalie-Snapshots columns. + +**One-shot backfill pattern** (python side; a `--publish-shots/--rebuild` +flag or a one-off `local_store.py` mode): + +1. Load `player_games` from `data/raw_nhl.sqlite` and run the **verbatim** + `model.shot_features()` (its columns are exactly these 14) — do not + re-derive with SQL window functions; the naive-SQL reproduction of the + pandas EWM/rolling sequences is where silent decimal drift lives. +2. Pull `(player_id, game_date) → team_abbrev, opponent_abbrev` from + `player_games` (that is `club_map()` minus the unused columns). +3. Restrict to rows whose `(date, player_id)` exists in the snapshot table + (dev shows 617,310 such rows; the remaining ~1% of skater rows in the + store belong to dates/players publish never wrote). +4. Upsert in 500-row batches, `on_conflict="date,player_id"`, `returning="minimal"` + — identical to `publish()`. Convert `NaN → None` first (see §5). + +Incremental afterwards: `publish()` gains the 16 keys in its `SELECT` + +payload dict (one SELECT per derived join); **no extra rows are written** — +the columns ride the ~247 skater-row + ~24 team-row + goalie daily upserts +that a normal game day costs. The only daily increment is post-2026-10 +rows for new dates (~220-260 player rows on a full slate); the shot +columns are already folded into those. + +--- + +## 5. Gotchas the migration/publish must handle + +1. **season dtype TEXT ↔ int64.** The Supabase columns store `season` as + TEXT `"20232024"`; the CSV caches round-trip it as numpy int64 and the + raw store carries INTEGER. Every join/merge must normalise both sides + via `astype("Int64").astype(str)` exactly as `build_frame()`/`shot_features()` + do (model.py:286-299, 397). A bare int64 season with a null (nullable + `Int64` → "") will not text-match anything. The new columns + sidestep this by never shipping season-derived strings, but the + backfill job still merges on `season` internally and must normalise. +2. **NaN is not JSON.** The rolling block is NaN for the first game of a + career/season by design. supabase-py + PostgREST require `None`, not + float `nan`, in the upsert payload (bare NaN serialises as non-JSON `NaN` + and the batch dies). Apply `df.where(pd.notna(df), None)` (or `None` + in the dict comprehension) before `upsert`. +3. **"New York" ambiguity.** Joining any snapshot or team data by + `team_name` on a co-slated date risks mixing NYR/NYI everywhere. + This is precisely why Block B ships `team_abbrev`/`opponent_abbrev` + and why `club_map()` exists locally; the cloud pipeline must join + Team-Stats on `(date, team_abbrev)` and Goalie-Snapshots on + `(date, opponent_abbrev)`, never the place name. +4. **TOI is `"mm:ss"` TEXT.** Store minutes as decimal (mm + ss/60) in the + DOUBLE PRECISION column — the model consumes decimal minutes + (model.py:401-407); storing the string would trade one epoch of the + same dtype problem downstream. +5. **Publish order.** Migration first, then any publish that carries the + new keys — PostgREST 400s (and thereby *whole-batch-drop*) on unnamed + columns; the idempotent deploy re-run makes the safe order simply + "always merge the migration before the code change". +6. **upsert batch size 500** (PostgREST 1000-row default cap; backfill of + 617,310 rows = ~1,235 requests — several minutes, one-time only). +7. **Backfill idempotency.** The upsert keys on the PK, so re-running the + backfill is a safe overwrite, not an append. + +--- + +## 6. Owner sign-off summary + +* **Total new columns: 16** — 14 shot/TOI rolling features + 2 club + abbreviation columns, all on `Player-Snapshots-backtrack-{ENV}`. +* **Total backfill rows: 617,310 one-time upserts** on the dev table + (same row count for prod at promotion; no new rows created), plus barn + rows on new dates after (~250/day, existing pipeline). +* **Zero schema changes** to Team-Stats-backtrack / Goalie-Snapshots-backtrack. +* **Before/after cloud parity check:** the acceptance test for the + migration is that `model.py --env dev` produces identical DATASET rows + when `shot_features()/club_map()` read the published columns instead of + `data/raw_nhl.sqlite` (same strictly-before cutoff, same sort). diff --git a/pyproject.toml b/pyproject.toml index 33c91dfd..ce3c26f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ dev = [ # #113 data port. Kept out of the main dependencies so it does not ship in # the Lambda zip (deploy.sh runs `uv export --no-dev`). "pymongo>=4.16.0,<5.0.0", + "scikit-learn>=1.9.1", ] [tool.uv] @@ -63,6 +64,12 @@ select = [ ] [tool.ruff.lint.per-file-ignores] +"smartscore/ml_picks_kick.py" = [ + # S310 audit is satisfied by construction: the URL is built from the + # constant https:// GITHUB_API_BASE plus env-provided owner/repo tokens + # (never user-supplied file: or custom schemes). + "S310", +] "tests/*" = [ "D", "S", diff --git a/smartscore/email_utility.py b/smartscore/email_utility.py index 5e58bbfc..553599ae 100644 --- a/smartscore/email_utility.py +++ b/smartscore/email_utility.py @@ -35,7 +35,8 @@ def tims_key(p): for pick in sorted_picks: stat = pick.get("stat", "") try: - stat_str = f"{float(stat):.2f}%" + # DB stat is a 0-1 fraction + stat_str = f"{float(stat) * 100:.2f}%" except (ValueError, TypeError): stat_str = str(stat) text_body += f"{pick.get('tims', '')} | {pick.get('name', '')} | {pick.get('team_name', '')} | {stat_str}\n" @@ -77,7 +78,8 @@ def tims_key(p): for pick in sorted_picks: stat = pick.get("stat", "") try: - stat_str = f"{float(stat):.2f}%" + # DB stat is a 0-1 fraction + stat_str = f"{float(stat) * 100:.2f}%" except (ValueError, TypeError): stat_str = f"{stat}%" if stat != "" else "" html_body += f""" diff --git a/smartscore/event_handler.py b/smartscore/event_handler.py index d9bc6c9e..0a0f5ed4 100644 --- a/smartscore/event_handler.py +++ b/smartscore/event_handler.py @@ -4,6 +4,7 @@ from smartscore_info_client.schemas.team import TEAM_INFO_SCHEMA from decorators import lambda_handler_error_responder +from ml_picks_kick import relay_game_kick from nhl_lineups import get_nhl_com_lineups, get_rotowire_lineups from player_archive import save_player_snapshots from service import ( @@ -148,7 +149,7 @@ def handle_load_working_set(event, context): Args: event (dict): The status-only state from CheckCompleted; ``status`` is - carried through so CheckInitialRun still routes correctly. + carried through so CheckSaveHistory still routes correctly. context (dict): Unused Lambda context. Returns: @@ -319,6 +320,9 @@ def handle_publish_db(event, context): Returns: dict: A dictionary containing: - "statusCode" (int): HTTP status code. + - "date" (str): The pick date this run published (the event's + carried ``date``, else the pipeline's Toronto get_date()), + consumed downstream by the KickMLPicks state. - "players" (list): Player data, now including stat (and beta stat). """ @@ -335,7 +339,14 @@ def handle_publish_db(event, context): publish_public_db(entries) - return {"statusCode": 200} + # The date travels back up so the KickMLPicks state can relay an EXPLICIT + # pick date to the MLPicksKick relay (PR #146 follow-up race fix). The + # kick used to be a parallel EventBridge target that could run the + # Actions pass BEFORE this write path completed; now it fires from the + # END of the run, and 'event.date or get_date()' is the same pick date + # every handler in this run already used (first_run/normal_run paths + # re-enter without a state-carried date, so the fallback is canonical). + return {"statusCode": 200, "date": event.get("date") or get_date()} @lambda_handler_error_responder @@ -628,3 +639,30 @@ def handle_emails(event, context): return { "statusCode": 200, } + + +@lambda_handler_error_responder +def handle_ml_picks_kick(event, context): + """ + Per-game ML picks kick relay -> GitHub Actions. + + Invoked by the KickMLPicks Task state at the END of the + PlayerProcessingPipeline run (after SaveToDb/UpdateHistory/PublishToDb), + so the Actions pass only ever starts once today's snapshot rows (incl. + fresh Tims groups) are published. Understands only {date, dry} and + performs exactly one GitHub ``repository_dispatch`` (event_type + ml-picks-game) per invocation - no Supabase access and no picks logic; + the ml-picks.yml workflow holds those. + docs/ml-picks-runbook.md ("Per-game kick"). + + Args: + event (dict): The invoking state's payload; carries the explicit + pick ``date`` (YYYY-MM-DD) and optionally a ``dry`` flag. A + manual (owner) invoke may omit ``date`` - Toronto-today is + used then. + context (dict): Unused Lambda context. + + Returns: + dict: relay outcome incl. the exact client_payload sent. + """ + return relay_game_kick(event) diff --git a/smartscore/ml_picks_kick.py b/smartscore/ml_picks_kick.py new file mode 100644 index 00000000..4c3ff1a8 --- /dev/null +++ b/smartscore/ml_picks_kick.py @@ -0,0 +1,190 @@ +"""Per-game ML picks kick relay. + +The PlayerProcessingPipeline state machine's KickMLPicks Task state invokes +this Lambda at the END of the run (after SaveToDb/UpdateHistory/PublishToDb). +The relay turns the kick into a single ``repository_dispatch`` call on the +GitHub repo so .github/workflows/ml-picks.yml runs the daily picks pass on +the Actions runner. Serialization is the whole point (PR #146 follow-up +race fix): the kick can only fire once today's snapshot rows are published, +so the Actions job never computes picks from stale groups. + +RELAY ONLY: stdlib urllib for the HTTP call, no ML dependencies, and no +Supabase/Picks access of any kind - the workflow performs those upserts. +docs/ml-picks-runbook.md ("Per-game kick"). +""" + +import datetime +import json +import os +import time +import urllib.error +import urllib.request +from zoneinfo import ZoneInfo + +from aws_lambda_powertools import Logger + +logger = Logger() + +GITHUB_API_BASE = "https://api.github.com" + +DEFAULT_GITHUB_OWNER = "nathan-probert" +DEFAULT_GITHUB_REPO = "SmartScore" + +#: repository_dispatch event_type the ml-picks.yml workflow listens to. +DISPATCH_EVENT_TYPE = "ml-picks-game" +#: client_payload context marker: this dispatch came from a game-start kick, +#: not a manual run (the workflow logs it for triage). +KICK_CONTEXT = "post-game-start" + +#: One immediate retry, after this backoff, on transient GitHub responses. +RETRY_BACKOFF_SECONDS = 5 + +#: 429 (secondary rate limit) plus the 5xx family are worth one retry; +#: 401/403/422 are deterministic failures and must not be retried. +TRANSIENT_STATUS_CODES = {429, 500, 502, 503, 504} + +#: 403 = token reached GitHub but was rejected for permissions (scope miss), +#: not a bad-credentials problem (that is 401). Worth a fingerprint + hint. +PERMISSION_DENIED_STATUS = 403 + + +class MissingDispatchTokenError(RuntimeError): + """Raised when GITHUB_DISPATCH_TOKEN is absent/empty (fail loudly).""" + + +def pick_date_now(zone_name=None): + """Today's pick-date in the pick timezone, ``YYYY-MM-DD``. + + Mirrors the pipeline's America/Toronto notion of "today": + service.get_date() (smartscore/service.py) is + ``datetime.now(pytz.timezone("America/Toronto")).strftime("%Y-%m-%d")`` + and run_daily_picks.py defaults its --date to exactly that. zoneinfo is + the stdlib spelling of the same boundary. + """ + tz = ZoneInfo(zone_name or "America/Toronto") + return datetime.datetime.now(tz).date().isoformat() + + +def resolve_pick_date(event): + """Pick-date for this kick: explicit ``event.date`` wins. + + The invoking pipeline (KickMLPicks at the end of the state machine run) + passes the pick date it actually published for, so a warm-Lambda delay + can never shift the slate. The Toronto-today fallback is ONLY for an + owner manual invoke with no date at all - schedule_run no longer + dates-stamps anything, and the state machine always passes one. + """ + from_event = (event or {}).get("date") + if isinstance(from_event, str) and from_event.strip(): + return from_event.strip() + return pick_date_now() + + +def _http_error_body(exc): + """Best-effort read of an HTTPError's response body (TA: never a black box). + + GitHub's 403/422 bodies are the ONLY way to tell token-scope rejections + ("Resource not accessible by integration") apart from settings-level + blocks from inside the Lambda, so the body must survive into the logs. + Test doubles may hand us an fp-less HTTPError, hence the guard. + """ + try: + return (exc.read() or b"").decode("utf-8", errors="replace").strip() + except Exception: # noqa: BLE001 - diagnostics only, must never mask the status + return "" + + +def _post_dispatch(payload, token, owner, repo): + """POST one repository_dispatch; returns (ok, status_code_or_None, body).""" + url = f"{GITHUB_API_BASE}/repos/{owner}/{repo}/dispatches" + headers = { + "Accept": "application/vnd.github+json", + "Authorization": f"Bearer {token}", + "X-GitHub-Api-Version": "2022-11-28", + "Content-Type": "application/json", + } + request = urllib.request.Request( + url, + data=json.dumps(payload).encode("utf-8"), + headers=headers, + method="POST", + ) + try: + # Success is an empty 204; read-and-discard keeps urllib happy. + with urllib.request.urlopen(request, timeout=20) as response: + response.read() + return True, response.status, "" + except urllib.error.HTTPError as exc: + return False, exc.code, _http_error_body(exc) + except urllib.error.URLError as exc: + logger.error(f"GitHub dispatch network error: {exc}") + return False, None, "" + + +def relay_game_kick(event): + """Relay one per-game pipeline-finish kick into the ml-picks workflow. + + Args: + event: the invoking state's (or a manual) payload. Recognized keys: + ``date`` (pick-date YYYY-MM-DD, always set by the KickMLPicks + state) and ``dry`` (bool, smoke-run the pass). + + Returns: + dict: outcome summary, e.g. {"dispatched": True, ...}. + + Raises: + MissingDispatchTokenError: when GITHUB_DISPATCH_TOKEN is unset - + a silently dropped kick would masquerade as "nothing fired", + so this fails loudly instead. + RuntimeError: when both POST attempts fail (transient-then-transient). + """ + token = os.environ.get("GITHUB_DISPATCH_TOKEN") + if not token: + logger.error( + "GITHUB_DISPATCH_TOKEN is empty - cannot relay ml-picks-game; " + "set the CloudFormation GITHUB_DISPATCH_TOKEN parameter " + "(fine-grained PAT with Actions AND Contents write, this repo only, " + "or a classic PAT with the repo scope)." + ) + raise MissingDispatchTokenError("GITHUB_DISPATCH_TOKEN env var is missing or empty") + + owner = os.environ.get("GITHUB_OWNER", DEFAULT_GITHUB_OWNER) + repo = os.environ.get("GITHUB_REPO", DEFAULT_GITHUB_REPO) + + # ML_KICK_DRY lets prod force smoke runs without touching payloads. + dry = bool((event or {}).get("dry", False)) or os.environ.get("ML_KICK_DRY", "").lower() in {"1", "true"} + + dispatch_payload = { + "event_type": DISPATCH_EVENT_TYPE, + "client_payload": { + "date": resolve_pick_date(event), + "dry": dry, + "context": KICK_CONTEXT, + }, + } + + ok, status, body = _post_dispatch(dispatch_payload, token, owner, repo) + if not ok and status in TRANSIENT_STATUS_CODES: + body_note = f" response_body={body}" if body else "" + logger.warning(f"Transient GitHub dispatch failure ({status}){body_note}; retrying in {RETRY_BACKOFF_SECONDS}s") + time.sleep(RETRY_BACKOFF_SECONDS) + ok, status, body = _post_dispatch(dispatch_payload, token, owner, repo) + + if not ok: + detail = f"GitHub response body: {body}" if body else "GitHub response body: " + logger.error(f"GitHub repository_dispatch failed for {owner}/{repo} (status: {status}) - {detail}") + hint = "" + if status == PERMISSION_DENIED_STATUS: + hint = ( + "403 rejection (e.g. 'Resource not accessible by integration') means the token reached " + "GitHub but lacks permission: a fine-grained PAT needs BOTH Actions: Read & write AND " + "Contents: Read & write on this repo (Actions: write alone is the common miss); a classic " + "PAT with the repo scope is the simpler alternative. Not expiry (that is 401)." + ) + raise RuntimeError( + f"GitHub repository_dispatch failed (owner={owner}, repo={repo}, status={status}) - {detail}" + + (f" HINT: {hint}" if hint else "") + ) + + logger.info(f"ml-picks-game dispatched to {owner}/{repo} payload={dispatch_payload['client_payload']}") + return {"statusCode": 200, "dispatched": True, "client_payload": dispatch_payload["client_payload"]} diff --git a/smartscore/scripts/backtrack/DAILY_DATA_RUNBOOK.md b/smartscore/scripts/backtrack/DAILY_DATA_RUNBOOK.md new file mode 100644 index 00000000..f430e035 --- /dev/null +++ b/smartscore/scripts/backtrack/DAILY_DATA_RUNBOOK.md @@ -0,0 +1,304 @@ +# DAILY_DATA_RUNBOOK — the daily day-of data capture, in operational order + +Owner decision needed: the schedule in §6 is **proposed, not installed** +(this runbook documents it; installing is the owner's call — see §6). + +Purpose: make the incremental prior-day crawl → derived features → Supabase +publish chain a monitored, first-class daily routine so the deployed ML Lambda +always trains on complete prior-day data. No new modeling. + +Current season constant: **20262027** (bump `SEASON` at each season boundary; +`nhl_client._season_from_date` derives it purely from the month, ≥ July belongs +to the *new* season id). + +Last end-to-end verification: **2026-10-24** (evidence inline below). + +--- + +## 1. The steps in order (dependency chain) + +``` +schema migration (one-time, per spec PR #138 / migration PR from r-migration) + │ unblocks: publish sending the 16 new shot/TOI columns + ▼ +(A) incremental crawl ──────────────► data/raw_nhl.sqlite (local store) + │ run_background.py --cmd build --season $SEASON + │ (= box scores + shift charts on cache-miss, game-log merge, + │ lineup reconstruction, tims/goalie feeds, then derived + │ features + derived team features — see below) + ▼ +(B) (already inside build: derive | lineups | feeds) — no separate daily step + ▼ +(C) publish ─────────────────────────► Player-/Team-/Goalie-Snapshots-backtrack-{dev|prod} + │ make backtrack-publish SEASON=$SEASON ENV=prod + │ (upserts; reads the local store at run time → picks up every + │ row the latest build wrote, no manual flag, idempotent) + ▼ +(D) AWS Lambda trains/predicts off Player-Snapshots-backtrack-prod + (per-game EventBridge rules via schedule_run() — + smartscore/utility.py + fixed runs in templates/template.yaml) + +independent side-chains (not in the (A)→(D) line): +(P) projected-lineup collector 10:30 / 13:00 / 16:00 ET daily + snapshot_projected.py --env prod (PROJECTED_LINEUP_RUNBOOK.md) + its PROJECTED_PROXY tier reads local ACTUALs, so it benefits from a + nightly (A), but it never blocks on it. +(F) nightly feed-fidelity tracker 09:45 ET (FEED_FIDELITY_RUNBOOK.md) + depends on: (A) having the prior day's ACTUAL shift-chart units, + and (P) prod snapshots existing for the date. +(S) daily sanity check (read-only): daily_sanity.py — at any time, anytime + after (A) is expected to have caught up. +``` + +## 2. CRITICAL incremental gotcha — the season schedule cache + +`nhl_client.season_games()` keeps the season's discovered game list in +`data/cache/schedule-.json` and **returns that file verbatim while it +exists** — it never re-walks a warm schedule (the file is rewritten at the end +of a full walk). The per-game box scores and shift charts ARE incremental +(cache-miss only, warm cache ≈ free), but the game list itself is not. + +Consequence observed on 2026-10-24: a bare re-run of +`run_background.py --cmd build --season 20262027` re-merged everything for +games it already knew (6,600 player-games, latest `2026-10-22`) and +**added zero rows** while reporting a normal "derived features computed" — +a silently stale success. Deleting the schedule cache first re-walks the +schedule (a few dozen light requests), discovers the newly FINAL games, and +the per-game caches then serve everything already known: + +| run on 2026-10-24 (ET) | schedule cache? | runtime | rows | latest game date | +|---|---|---|---|---| +| `bt-202627d` 14:30 re-run | kept (stale, Oct 23) | 8.2 min | 6,600 (+0) | 2026-10-22 | +| `bt-202627e` 14:43 re-run, schedule cache deleted first | re-walked | 7.5 min | 6,720 (+120) | **2026-10-24** | + +The second run picked up 2 FINAL games on 2026-10-23 (80 player-games) plus +2 matinees already final on 2026-10-24 (40), 3 new shift-chart payloads +(1,866 shift rows), tims_daily 1,879→1,920 rows (latest `2026-10-23`), +lineups 4,896→5,004. New games after the walk (evening puck-drops there) are +picked up by the NEXT day's refresh — that is the day-of/overnight cadence the +schedule below encodes. + +**So the daily step is: delete the schedule cache, then build.** That is the +only machine-level "incremental refresh" trigger; there is no `--refresh` +flag. (Deleting the file is safe: it is a rebuilt-from-scratch cache, and the +walk rewrites it.) + +## 3. What `--build` already covers, and what must stay separate + +`local_store.py --build ` (main() at local_store.py~2179) runs, in +order: `build()` [box scores, shift charts, `merge_gamelogs`, `compute_lineups`, +challenge feeds] then `compute_derived` + `compute_derived_team`. So step (B) +of the prompt's ordering is *inside* step (A) — no separate `--derive` / +`--lineups` / `--feeds` call on the daily path. The pre-2017 runbook's +explicit `--derive/--lineups/--feeds` lines are for per-piecemail rebuilds of +older seasons, not the daily flow. + +`--publish` is **not** part of it. The publish chain is +`make backtrack-publish SEASON=... ENV=...` (Makefile~102), which re-runs +`--derive` (seconds, keeps shipped SQL authoritative) and then the three upserts: + +- `local_store.py --publish $SEASON` → `Player-Snapshots-backtrack-{ENV}` + (one row per (date, player_id); skaters only — goalie rows go elsewhere) +- `local_store.py --publish-team $SEASON` → `Team-Stats-backtrack-{ENV}` + (one row per (season, team_abbrev, game_id)) +- `local_store.py --publish-goalies $SEASON` → `Goalie-Snapshots-backtrack-{ENV}` + +Does publish pick the new rows up automatically? **Yes, once it runs.** It +SELECTs out of the local SQLite store at run time (join player_games < +derived_features < player_lineups / tims_daily / box scores); it has no +notion of "what was there last time". There is no manual refresh step +between build and publish. It upserts with `on_conflict=date,player_id` +(team: `(season, team_abbrev, game_id)`; goalies: `(season, player_id, date)`) +so re-runs are safe. Publish sends *only* columns the table declares — which +is exactly why the 16-column migration must land **before** the daily publish +is expected to carry those columns (PostgREST would reject whole batches on +unknown columns, so the code drops undeclared ones silently). + +Note the honest current state (2026-10-24 read-only check): +`Player-Snapshots-backtrack-prod` is **empty** (0 rows) and +`Player-Snapshots-backtrack-dev` tops out at `2026-06-14`. Before any prod +publish image channel is expected to be live, everyone must remember the prod +publish chain simply hasn't run yet — not a crawl fault. + +## 4. Order sensitivities — "what breaks if you swap two steps" + +| swap | consequence | +|---|---| +| build (A) after publish (C) | publish ships yesterday's store → the Lambda trains on T−2 data until morning, and tomorrow's publish overwrites nothing (idempotent upserts) but the training rows for the *skipped* date only appear after the next publish. No error anywhere: it looks healthy. | +| build without deleting the schedule cache | "successful" no-op through the last re-walked date (see §2). Silent — this is the one that eats you. | +| publish-columns (16 cols) before the migration PR lands | publish silently omits the columns (it self-truncates to declared columns), so prod rows land column-less and a later featured Lambda silently trains without them. | +| derive (in build) rolled back in front of crawl | derived_features recomputed on the OLD player_games while new rows arrive ⇒ today's features published tomorrow at the same rate; worst case a half-written derive with the crawder writing concurrently (SQLite serialises writers, so you get a queue, not corruption — but ordering confusion is how stale rows get published). | +| snapshot_projected (P) before the nightly crawl | PROJECTED_PROXY falls back to an older_actuals date — projections degrade qualitatively but never write ACTUAL labels; safe-but-stale, self-heals at the next slot. | +| fidelity tracker (F) before (A) catches the prior day | it skips (exit 0, one log line, no metrics): actuals missing ⇒ no data for that night. Re-run manually after the crawl catches up; nothing to cleanse. | +| `--ingest-cache` style mass re-ingests during a live crawl | two writers on the same tables: SQLite blocks, run_background tasks pile up, and the log stops advancing. Never run two builds concurrently; kill one first (`--name --stop`). | + +## 5. Proposed daily schedule (owner to install) + +Times ET; host runs Debian cron (no cronie ⇒ no `CRON_TZ`, so express in +host-local time as noted, or use the systemd timer where America/Toronto is +expressed in the unit itself). + +```cron +# ── daily data capture: refresh to the prior day's finals, then publish ───── +# 1) 03:30 ET: re-walk season schedule + incremental crawl/derive/lineups/feeds +# (late-night games finish after midnight; 03:30 clears their shift charts) +30 3 * * * rm -f /home/nathan/code/SmartScore-backtrack/data/cache/schedule-20262027.json && cd /home/nathan/code/SmartScore-backtrack && .venv/bin/python smartscore/scripts/backtrack/run_background.py --name bt-202627d --cmd build --season 20262027 >> /home/nathan/code/SmartScore-backtrack/data/bg/daily-build-cron.log 2>&1 +# 2) 04:20 ET: publish everything the store now holds (derive included), @prod +20 4 * * * cd /home/nathan/code/SmartScore-backtrack && ENV=prod .venv/bin/python smartscore/scripts/backtrack/local_store.py --publish 20262027 && ENV=prod .venv/bin/python smartscore/scripts/backtrack/local_store.py --publish-team 20262027 && ENV=prod .venv/bin/python smartscore/scripts/backtrack/local_store.py --publish-goalies 20262027 >> /home/nathan/code/SmartScore-backtrack/data/bg/daily-publish-cron.log 2>&1 +# 3) 04:40 ET (after the publish): sanity so the morning starts with evidence, +# not hope; add the dev tables too if you want both turtles raced +40 4 * * * cd /home/nathan/code/SmartScore-backtrack && .venv/bin/python smartscore/scripts/backtrack/daily_sanity.py --env prod >> /home/nathan/code/SmartScore-backtrack/data/bg/daily-sanity-cron.log 2>&1 +# 4) 09:45 / 09:55 ET: nightly fidelity vs yesterday's actuals (already +# designed in FEED_FIDELITY_RUNBOOK.md §Nightly schedule - keep those lines) +``` + +Why these times: run (1) needs the night's shift charts to be fetchable (late +games finish after midnight ET; 03:30 clears them); run (2) needs run (1)'s +output; run (3) needs run (2); the 10:30/13:00/16:00 projection collector needs +*nothing* on this list (independent chain P), and the 09:45 fidelity tracker +needs (1) and (P) — so it sits behind both in the day. + +### systemd timers (preferred on systemd hosts) + +`/etc/systemd/system/daily-data-build.service`: + +```ini +[Unit] +Description=Daily incremental season build (crawl + derive + lineups + feeds) + +[Service] +Type=oneshot +WorkingDirectory=/home/nathan/code/SmartScore-backtrack +Environment=PATH=/home/nathan/.local/bin:/usr/local/bin:/usr/bin:/bin +# delete the season schedule cache so season_games() re-walks and discovers +# newly FINAL games (see §2 - without this the build is a silent no-op) +ExecStart=/bin/sh -c 'rm -f data/cache/schedule-20262027.json && .venv/bin/python smartscore/scripts/backtrack/run_background.py --name bt-202627d --cmd build --season 20262027' +``` + +`/etc/systemd/system/daily-data-build.timer`: + +```ini +[Unit] +Description=Daily incremental build at 03:30 America/Toronto + +[Timer] +OnCalendar=*-*-* 03:30 America/Toronto +Persistent=true + +[Install] +WantedBy=timers.target +``` + +`daily-data-publish.service` / `.timer` mirror the build pair with +`OnCalendar=*-*-* 04:20 America/Toronto` and +`ExecStart=/home/nathan/code/SmartScore-backtrack/.venv/bin/python +smartscore/scripts/backtrack/local_store.py --publish 20262027`, plus +`--publish-team` and `--publish-goalies` lines (all with `Environment=ENV=prod`), +and the same coupling: a `Publish` unit `After=` + `Requires=` the build unit's +`daily-data-build.service`. + +## 6. Owner decision needed + +- ☐ Install the §5 cron or systemd timer (nothing is installed today: + `crontab -l` is empty, no user/system units relate to SmartScore, and + `.github/workflows/` has only deploy.yml triggered on push/PR — no `schedule:` + key anywhere in the repo). The AWS-side schedules (template.yaml + `cron(0 8/14 * * ? *)` + per-game EventBridge rules from `schedule_run`) + are the deployed pipeline's own triggers, unrelated to this local crawl. +- ☐ Choose tool: plain cron (no CRON_TZ available on this Debian) vs the + systemd timer (explicit timezone, Persistent=true hence catch-up races). +- ☐ Season bump: change every `20262027` literal when the season turns (4+1 + plus the §2 schedule-cache filename). +- ☐ Whether the daily publish to **prod** runs from this host before or only + after the 16-column migration PR is merged (§3's note). + +## 7. Health / monitoring checklist (copy-paste) + +Local store freshness and per-day counts — or just run the script: + +```bash +cd /home/nathan/code/SmartScore-backtrack +.venv/bin/python smartscore/scripts/backtrack/local_store.py --stats +.venv/bin/python smartscore/scripts/backtrack/daily_sanity.py --env prod # § example output below + +sqlite3 via python (no sqlite3 CLI on this host): +.venv/bin/python -c "import sqlite3; c=sqlite3.connect('file:data/raw_nhl.sqlite?mode=ro', uri=True); \ + print(c.execute(\"SELECT game_date, count(*) FROM player_games WHERE season='20262027' GROUP BY game_date ORDER BY game_date DESC LIMIT 7\").fetchall())" + +# latest build state / alive-pid / log tail: +.venv/bin/python smartscore/scripts/backtrack/run_background.py --name bt-202627d --status +.venv/bin/python smartscore/scripts/backtrack/run_background.py --name bt-202627d --tail 40 +tail -50 data/bg/daily-build-cron.log # installed-cron tail (once installed) + +# log presence per expectation (for batch evidence keeping): +ls -lat data/bg/*.log | head # last touched build logs +stat -c '%y %n' data/bg/bt-202627d.log data/cache/schedule-20262027.json data/raw_nhl.sqlite | sed 's/\.[0-9]* / /' +``` + +Supabase projected-table quick check (GET-only): + +```bash +cd /home/nathan/code/SmartScore-backtrack +.venv/bin/python - <<'EOF' +import os, time +from collections import Counter +from dotenv import load_dotenv +import requests +load_dotenv('.env') +key = os.environ['SUPABASE_SERVICE_ROLE_KEY'] +h = {'apikey': key, 'Authorization': 'Bearer ' + key} +date = time.strftime('%Y-%m-%d') +r = requests.get(os.environ['SUPABASE_URL'] + '/rest/v1/Player-Snapshots-prod', + headers=h, params={'select': 'lineup_status', 'date': f'eq.{date}'}) +print(date, Counter(x['lineup_status'] for x in r.json())) +EOF +``` + +(For the full breakdown — by_status rows, D-unit rows, PP1 rows, and both +published tables' latest dates — just use `daily_sanity.py`, which runs the +same pattern plus the local-store checks.) + +### Real example output — `daily_sanity.py --env both`, 2026-10-24 14:55 ET + +```text +note: this script only SELECTs; it never writes Supabase +== local store: raw_nhl.sqlite == +20262027 player_games latest game date : 2026-10-24 (26 dates, 6720 rows) +20262027 player_lineups (reconstructed) : 5004 rows +20262027 shifts games covered : 139 +20262027 tims_daily latest : 2026-10-23 (1920 rows) +20262027 derived_features rows : 6720 +20262027 derived_team_stats rows : 336 +last three game dates in the store (rows/day): + 2026-10-24: 40 rows + 2026-10-23: 80 rows + 2026-10-22: 480 rows + +== Supabase --env dev == +Player-Snapshots-dev @2026-10-24 rows: 549 by_status={'PROJECTED': 184, 'UNKNOWN': 365} + rows with D units (D1-D3 or group=D): 87 + rows with PP1: 118 +Player-Snapshots-backtrack-dev latest date: 2026-06-14 (36 rows on that date) +note: published table lags the local store - publish is a separate step; run make backtrack-publish after the build +== Supabase --env prod == +Player-Snapshots-prod @2026-10-24 rows: 548 by_status={'PROJECTED': 183, 'UNKNOWN': 365} + rows with D units (D1-D3 or group=D): 87 + rows with PP1: 118 +Player-Snapshots-backtrack-prod: no rows (empty table: publish has never run for this env) +``` + +Reads: the 10:30/13:00 collectors ran (548 PROJECTED PROD rows are present for +today, waiting for the third slot to fill the UNKNOWN bucket); the local store +leads the published dev table by every current-season game (publish pending — +see §3 note); D/PP1 shares look normal for a morning slot. + +## 8. Recovery cheatsheet + +- A task claims to be running forever → `--name --status` then `--stop`: + it kills the pid recorded in data/bg/.json and delays another start. +- A build died mid-crawl → re-run the same §5/§2 command; per-game caches make + replays free; pressed `--gamelogs`/`--lineups`/`--feeds` handle piecewise. +- Suspicious feeds 0 rows → check the 403 with Origin headers in + `nhl_client._get_json`, try `--feeds` alone for the same season. +- Duplicate name → run_background refuses a duplicate alive pid; use another + `--name` for a manual run during testing. diff --git a/smartscore/scripts/backtrack/FEED_FIDELITY_RUNBOOK.md b/smartscore/scripts/backtrack/FEED_FIDELITY_RUNBOOK.md new file mode 100644 index 00000000..b3c46f2f --- /dev/null +++ b/smartscore/scripts/backtrack/FEED_FIDELITY_RUNBOOK.md @@ -0,0 +1,170 @@ +# Feed-Fidelity Runbook — nightly lineup-feed fidelity vs backtracking actuals + +Owner: `smartscore/scripts/backtrack/fidelity_tracker.py` +Context: `MODEL_NOTES.md` → FINAL RESULT + `V16- collect` sections, and the V11 +sensitivity table (81% fidelity ≈ +0.1–0.3pp, 100% ≈ +1.2pp). + +## What it does + +Each run takes one game date and answers a single question: **how close is the +daily build's projected lineup to what actually deployed?** + +- **Projected side (Supabase, read-only):** `Player-Snapshots-prod` (with + `--env prod`) or `Player-Snapshots-backtrack-dev` (with `--env dev`); rows + with `lineup_status` in {`PROJECTED`, `PROJECTED_PROXY`}. `--env both` runs + both tables. NO Supabase write is ever issued — this module only SELECTs; + prod is reached with the service-role key for read reach, nothing more. +- **Actual side (local store, read-only):** `player_lineups` in + `data/raw_nhl.sqlite` (shift-derived ACTUAL lines via + `local_store.compute_lineups` / `lineup_reconstruct.reconstruct_game`), + joined to `player_games` on `(game_id, player_id)` for the game date, + team abbrev, and home flag. +- **Join:** on `(date, player_id)`. The daily build's `team_name` is a place + name, and "New York" is NYR/NYI-ambiguous, so identity is never taken from a + place-name string join: the (place, home/away split of the actuals) + resolution is used only to disambiguate, and a still-ambiguous row is + counted (`n_team_ambiguous`) and EXCLUDED, never guessed. +- **Metrics per compared pair:** + - `unit_match` — exact `lineup_unit` equality (F1–F4 / D1–D3). + - `pp_match` — exact `pp_unit` equality after PP normalization + ("POWER PLAY #1" → PP1; PP3/PP4 stay themselves). + - `presence_match` — the projected row says the player sits in a D/F slot + that also exists in the actual deployment (group equality). +- **Per-snapshot fidelity:** the collector runs 10:30 / 13:00 / 16:00 ET, but + the daily-build tables key on `(date, player_id)` with no snapshot column, + so the stored row is the accumulated view of all three runs. The tracker + detects a slot column generically (`source_slot`/`snapshot_slot`/`slot`, or + `*,_at`/`snapshot_time` bucketed in ET) and writes one metric row per + source-slot; today that resolves to the single slot `single`, and the + run-level number is carried under slot `all`. **When a per-which-slot + column is added to the daily build, per-snapshot fidelity starts flowing + with no code change** — and per-snapshot is the number that would say WHICH + collection slot to trust. + +## How to run + +```bash +cd /home/nathan/code/SmartScore-backtrack +.venv/bin/python smartscore/scripts/backtrack/fidelity_tracker.py --env prod --date 2026-10-22 +.venv/bin/python smartscore/scripts/backtrack/fidelity_tracker.py --env both # prod + dev +``` + +Skip behaviour (exit 0, no log rows, clear message): the date's ACTUAL rows +are not in the local store yet (the shift crawler backfills the current season +concurrently → run nightly *after* the crawl), no projected rows exist for the +date, or the local store file is missing. + +## Nightly schedule (cron) + +After the 16:00 ET collection slot and once shift charts for the prior day +have had their chance to land (games that night finish late ET; the crawler +ingests them overnight): + +```cron +# nightly feed-fidelity tracking of YESTERDAY's slate, prod first then dev +CRON_TZ=America/Toronto +45 9 * * * cd /home/nathan/code/SmartScore-backtrack && PATH=$HOME/.local/bin:$PATH .venv/bin/python smartscore/scripts/backtrack/fidelity_tracker.py --env prod --date "$(TZ=America/Toronto date -d yesterday +%F)" >> /home/nathan/code/SmartScore-backtrack/smartscore/scripts/backtrack/fidelity_tracker_cron.log 2>&1 +55 9 * * * cd /home/nathan/code/SmartScore-backtrack && PATH=$HOME/.local/bin:$PATH .venv/bin/python smartscore/scripts/backtrack/fidelity_tracker.py --env dev --date "$(TZ=America/Toronto date -d yesterday +%F)" >> /home/nathan/code/SmartScore-backtrack/smartscore/scripts/backtrack/fidelity_tracker_cron.log 2>&1 +``` + +Absolute paths and `PATH=$HOME/.local/bin:$PATH` are load-bearing: cron's +default PATH has no `uv`, and the module runs `uv run`-free because the +project venv is invoked directly. `--date` defaults to *today* ET; the cron +line passes yesterday explicitly so a 09:45 run measures yesterday's slate +after its actuals have accumulated. + +Skips log nothing, so a message-only cron log on a non-game day is normal. + +## Where the log lands + +`data/ml/fidelity_log.csv` (untracked cache file, like the rest of `data/ml`; +never committed). Schema — one row per (date, source-slot, metric): + +| column | meaning | +|---|---| +| `ts` | UTC append timestamp | +| `env` | prod / dev | +| `season` | season id as TEXT ("20262027") — a string everywhere in this module, never an int | +| `scope` | `date` (this run) or `season` (exposure-weighted aggregate recomputed each run) | +| `date` | game date (empty on `season` rows) | +| `source_slot` | collection slot (or `single` / `all`) | +| `metric` | `unit_match` / `pp_match` / `presence_match` | +| `value` | the rate (empty when no comparable pairs) | +| `matches` / `n` | matched bodies and the denominator — reweight with these, never average `value`s | + +Read back the trend: + +```bash +python3 - <<'EOF' +import csv +rows = [r for r in csv.DictReader(open("data/ml/fidelity_log.csv")) + if r["scope"] == "date" and r["metric"] == "unit_match"] +rows.sort(key=lambda r: r["ts"]) +for r in rows: print(r["date"], r["env"], r["source_slot"], f"{float(r['value'])*100:.1f}%", f"{r['matches']}/{r['n']}") +EOF +``` + +## Interpreting the numbers — the adoption gate + +- **unit_match is the gate metric.** The pre-declared bar: **≥ 90% on a + comparable-pair denominator, sustained over the validation window + (~2–3 weeks of dated rows).** +- **presence_match** says the projected player exists in the actual + deployment at all (scratch/late-scratch capture). A gap between + presence (high) and unit (low) means the names are right but the slot + labels are wrong — that is a source problem, not a coverage problem. +- **pp_match** is a secondary read on the PP-unit source (RotoWire) vs the + shift-chart reconstruction; verbatim "POWER PLAY #N" vs PP1/PP2 noise on + historical rows is normalized before comparison. +- Use the season-scope rows for the trend, and respect the `n`s: a 3/3 day is + not 100% fidelity. +- The numbers feed the model decision separately: fidelity ≥ 90% is the + necessary condition; the *McNemar* half (paired vs the no-lineup ensemble + on both seeds — see the V16 experiment scripts' McNemar plumbing) is what + converts FIDELITY measurements to adoption. + +### Explicitly: what number → adopt, what → stay at the 29.7% default + +**Adopt** only when the logged `unit_match` (season-scope, exposure-weighted) +holds ≥ **90%** across the validation window AND the paired McNemar tests vs +the no-lineup ensemble come back significant winners on **BOTH** seeds +(1 and 3). **Stay at the 29.7% default** (the no-lineup ensemble, 29.71% +pooled OOF) while fidelity sits under 90% — the V11 sensitivity says ~81% +fidelity is worth only +0.1–0.3pp (within noise) and only ~100% fidelity buys +~+1.2pp, so an under-gate feed buys nothing worth a default switch. + +## ⚠️ READ-ONLY against prod — explicit caveat + +The tracker never issues a Supabase write on ANY environment. Prod reads use +the existing service-role credential for read access; there is no insert, +patch, upsert, or delete anywhere in `fidelity_tracker.py`. The only file it +changes is the untracked `data/ml/fidelity_log.csv`. Nobody has authorized a +prod write through this feature; if a prod write ever becomes necessary it +needs its own approval, its own diff, and `-env prod` explicit gates like +`snapshot_projected.py` already has. + +## Known state (first prod check, 2026-10-23) + +- `--env prod --date 2026-10-22` (read-only sanity run): the current season's + shift backfill landed for 2026-10-22 during validation, so the run produced + real numbers instead of the expected skip. Prod table had 540 rows (525 + unit-carrying per MODEL_NOTES as of 2026-10-22; at run time 276 were + tracked rows — 275 live-pipeline `PROJECTED` F-only rows from the pre-fix + archive + 1 `PROJECTED_PROXY` — and 264 `UNKNOWN` were excluded by the + tracked-status filter). Result: **268 compared pairs, unit_match 164/268 = + 61.2%, pp_match 130/150 = 86.7%, presence_match 267/268 = 99.6%.** + Read: presence is near-perfect (projected players appear in the actual + deployment), but exact-unit fidelity sits far under the 90% gate — the + pre-fix live-pipeline archive's F-only labels do not meet the bar, which is + exactly what the gate is there to catch. Keep watching the nightly rows as + the collector's full-vocabulary rows (F + D + PP) accrue and the + crawler-current actuals cover them; the comparable denominator also grows + as D/PP labels reach the projected side. +- Earlier in the same session (pre-backfill) the skip path fired verbatim: + "no ACTUAL lineups in the local store for 2026-10-22 (... shift charts are + not crawled yet ...)" with exit 0 and no log rows — recorded as the + designed graceful behaviour. Skip-path rehearsed; first tracked numbers: + the 61.2% row above. +- Per-snapshot fidelity is pending a slot column on the daily build (see the + SOURCE SLOTS note above) — the "single"/"all" slots are placeholders until + then. diff --git a/smartscore/scripts/backtrack/MODEL_NOTES.md b/smartscore/scripts/backtrack/MODEL_NOTES.md new file mode 100644 index 00000000..fc85768d --- /dev/null +++ b/smartscore/scripts/backtrack/MODEL_NOTES.md @@ -0,0 +1,1890 @@ +# SmartScore Model Notes + +> **2026-10-27 (stage-2 exactness):** inference recomputes the rolling/career +> shot block EXACTLY from the published per-game raw columns +> (game_goals/game_shots/game_toi_min on Player-Snapshots-backtrack) — the +> stage-1 approximation is gone; only missing recent days are fetched from +> the NHL API. + +## FINAL RESULT — corrected, leak-free (2026-10-19) + +**Default:** fixed equal-weight rank ensemble `hgb+logreg+lgbm` +(`--model ensemble`). Mean **29.71%** pooled OOF across seeds 0/1/3 +(29.92 / 29.41 / 29.82; std **0.28**), vs hgpg **28.05%** and straight GPG +**26.50%**. + +**V16 (2026-10-22) — no V16 change adopted.** Six follow-up experiments +(exposure product, group-3 weights/dedicated model, PBP pass-context xG, +calibration swap, interactions, ALS latent factors) all failed the ++0.5pp-on-both-seeds adoption gate; exact rows are in the rejected master +table below. (The per-experiment `notes_v16_*.md` notebooks were deleted in +`chore/clean-tree`; full runs are preserved in git history at the +pre-cleanup commit `c82b2e7`.) +The **29.71%** mean pooled all-era result stands (seeds 0/1/3 = 29.92 / 29.41 +/ 29.82 on the 96f0ff2 cache); regenerating the ensemble on the current data +cache (617,310 rows incl. the V15 2013-17 rows) gives **29.28% / 29.60%** for +seeds 1/3. gpg **837/3159 = 26.496%** and hgpg **886/3159 = 28.047%** +reproduce exactly in every V16 run, validating the fold wiring. + +**≥30% is invalid:** the only ≥30% result was LGBM **30.36%** using +`lineup_unit`/`pp_unit` from the same game's shift chart. Those columns are +removed; corrected LGBM is **29.06%**. + +**Tims era:** challenge starts **2021-12-09** (243 pre-2023 dates; owner’s +2023 claim is wrong). Ensemble **29.71%** all 1,053 challenge dates +(29.87% strict 2023-24+); LGBM 29.14/29.84; hgpg 28.05/28.14; GPG +26.50/27.09. + +**Lineup check:** projected ensemble **29.88%** seed 1 (end-to-end) and +**29.60%** seed 3 (mean **29.74%**); oracle-lineup LGBM 4-seed mean +**30.33% ± 0.26** (seeds 0/1/2/3: 30.36/30.61/30.39/29.98). V11 sensitivity: +61.6% → 100% unit fidelity maps to 28.97/28.49 → 30.61/29.98 (seeds 1/3); +real 80-90% morning projections imply roughly **29.25-29.54%**, below 30. +Default stays no-lineup. + +**Real projections (V10):** 0 `PROJECTED` rows are archived (5,155 `UNKNOWN` +rows across 17 dates, with null `lineup_unit`/`pp_unit`). Real-projection +accuracy and the live simulation cannot be measured — collect PROJECTED rows +with units forward. + +**Tried and rejected — master table (V3..V16; seeds 1/3 unless stated, +pooled OOF hits/total on the 3,159 challenge picks; every McNemar is the +exact two-sided binomial on pooled paired picks). All experiment code was +deleted in `chore/clean-tree`; the blobs live in git history at the +pre-cleanup commit `c82b2e7`:** + +| experiment | pooled hits / total + result | exact McNemar (pooled) | verdict | +|---|---|---|---| +| V3a lambdarank within-day ranking objective | ranker **832/3159 = 26.34%** (HGB 916, logreg 917, hgpg 886, gpg 837) | ranker vs gpg 394-399 p=0.89; vs hgpg 332-386 p=0.048 (**worse**); HGB vs gpg 442-363 p=0.0059 | rejected (fell to the GPG level) | +| V3b calendar/schedule/rel-goalie features | HGB 907/3159 = 28.71%; ensemble 921 = 29.16% | V3b HGB vs V2 HGB 202-211 p=0.69; ens vs hgpg 280-245 p=0.14 | reverted (no gain) | +| V3c post-hoc blends on saved OOF | 9 variants; best z-score hgb+logreg+live 935/3159 = 29.598% (+0.317pp) | vs hgpg 211-162 p=0.013, but vs ensemble 164-154 p=0.614 | no variant qualified (needed +0.5pp & p<0.10 vs ens) | +| V3d model-family diversity | lgbm single 959/3159 = 30.358% (+1.08pp); all-four bag 946 = 29.946% | lgbm vs hgpg 354-281 p=0.0042 but vs ensemble 237-203 p=0.116 | defaults unchanged (missed p<0.10 bar vs ens) | +| V3e LGBM seed robustness | seeds 1/2/3 = 957/950/934, mean 29.978% (seed std 0.373) | pooled vs hgpg 1025-842 p=2.5e-05; loses the seasons split (394 < 396 hgpg) | default stays hgb | +| V3f LGBM + baseline blends | best rank 0.75 lgbm + 0.25 hgpg mean 29.841 ± 0.120 | vs lgbm pooled p>=0.12 for all hgpg blends (173-186 p=0.527) | no blend qualified | +| V3g seed bagging / LGBM config sweep | bag 945/3159 = 29.915% (< lgbm-alone 29.978%); config b timings out at 200s, c seed 1 939 = 29.725% | bag vs hgpg 328-269 p=0.0175 | no bag / no config qualified | +| V4 raw shot/TOI block — **promoted** | HGB seed 0 961/3159 = 30.421%, seed 42 950 = 30.073% | HGB vs hgpg 406-342 p=0.0212; vs gpg 468-355 p=9.2e-05 | promoted into `NUMERIC_FEATURES` (clean cross-family re-check LGBM +0.063/-0.253pp, p=0.962/0.733; the k-fold edge did NOT transfer to the seasons split) | +| V5 pick voting / recency weighting | A1 vote 929/3159 = 29.408%; A2 seed vote 938; recency mixed (linear -0.475/+0.886pp, half worse both) | vote vs hgpg 249-206 p=0.049 but vs lgbm 148-178 p=0.108 | rejected (nothing beat LGBM alone) | +| V6 lagged lineup/PP replacements | mean **+0.095pp** (29.376→29.408 / 28.870→29.313 / 28.997→28.807) | pooled 454-445 p=0.790 | reverted (< +0.5pp; the mandatory same-game leak correction is retained) | +| V7-objective Poisson LGBM + conditional softmax | Poisson pooled 1,855/6,318 = 29.361% (+0.174pp) +0.25/+0.09pp per seed; csoftmax 1,782 = 28.205% (−0.981pp, AUC 0.569) | Poisson vs binary 284-273 p=0.672 | rejected (both arms below the gate) | +| V7-context team form / special teams / goalie rest | 930/3159 = 29.440% (+0.063pp) / 908 = 28.743% (−0.253pp); mean −0.095pp | vs base p=0.954/0.680 | rejected | +| V7-shots raw distance/angle/HD/slot/rebound/PP | 924/3159 = 29.250% (−0.127pp) / 934 = 29.566% (+0.570pp), McNemar p>=0.37 | vs base p=0.874/0.369 | rejected (mixed) | +| V8-own-xG first-party per-shot xG model | 923/3159 = 29.218% (−0.158pp) / 905 = 28.648% (−0.349pp); per-shot AUC 0.769 | vs base p=0.82/0.57 | rejected | +| V8-shrinkage empirical-Bayes rate features | 907/3159 = 28.712% (−0.665pp) / 899 = 28.458% (−0.538pp) | vs base p=0.229/0.326 | rejected | +| V8-tune LGBM configs b/d | b +0.19 / −0.03pp; d −0.06 / +0.19pp vs a | vs a p=0.755/1.0 (b), 0.945/0.728 (d) | rejected (mixed) | +| V9-projected-lineups (prior-games projector, stages 1-5) | hard b +0.98 / −0.25pp (seed 1 p=0.081 / seed 3 p=0.695); probabilistic −0.41 / 0.00pp; projected ensemble +0.48 / −0.22pp (end-to-end seed 1 944/3159 = 29.883%, p=0.432 vs no-lineup); oracle LGBM 4-seed 30.334% ± 0.263 | projected ens vs hgpg p=0.025/0.049; vs no-lineup p=0.465/0.783 | rejected (mixed); oracle ensemble −0.16 / +0.38; `--lineup projected` stays opt-in, default no-lineup | +| V12-identity (player/team/age) | 881/3159 = 27.889% (−1.487pp) / 907 = 28.712% (−0.285pp) | p=0.058/0.734 | rejected | +| V12-era recent training (2021-22+) | LGBM −1.07 / −0.95pp; ensemble −0.15 / +0.08pp vs full-era | — | rejected | +| V12-qoc (shift-chart QoC/QoT) | 944/3159 = 29.883% (+0.507pp) / 917 = 29.028% (+0.032pp) | vs base p=0.413/1.0 | rejected (mixed) | +| V12-interactions (tims x rates) | 931/3159 = 29.471% (+0.095pp) / 0.000pp; g3 −0.57pp | vs base p=0.904/1.0 | rejected | +| V15 pre-2017 data (2013-17) | LGBM +0.10 / +0.41pp (931/3159 = 29.471% / 929 = 29.408%); ensemble 933 = 29.535% (−0.380pp) / 935 = 29.598% (−0.222pp) | LGBM p=0.91/0.52 | rejected (not adopted) | +| V16-exposure (prior xG/60 x projected-TOI product) | base ens 926→921 seed 1, 935→933 seed 3; LGBM 931→922, 929→924 | p=0.8023/0.9508 and 0.6108/0.8067 vs paired base; product correlates r=0.94 with xg60_prior and 0.85 with hgpg | rejected | +| V16-group3 (g3 weights w2/w4 + dedicated g3 model) | everything below the paired base on both seeds (g3 20.7/20.2 vs base 21.7 seed 1; 20.9/20.6 vs 21.1 seed 3) | vs base p≥0.27 all arms (g3pure 67-95 p=0.0336 *worse* seed 1) | rejected | +| V16-pbp (pass-context per-shot xG) | per-shot AUC +0.0007/+0.0009 over geometry-only 0.765; decisive matched-data pair LGBM −0.158/−0.127pp (6,993 games / 608,813 shots) | a-b p=0.8189/0.8567 | rejected | +| V16-calib (confident-miss competitor swap) | seed 1 936/3159 = 29.630% (+0.35pp), seed 3 −0.16pp; McNemar vs ensemble p=0.51/0.78 | | rejected | +| V16-interact (home x form / rest x role / opponent-relative) | ensemble +0.506/+0.253pp vs paired arm, LGBM −0.728/+0.095pp; ens McNemar p=0.3447/0.6593 | | rejected | +| V16-embed (ALS latent factors) | seed 1 −0.03pp / seed 3 +0.57pp | | **INVALID (leakage)** — see below | + +**INVALID — excluded (leakage):** the ALS latent-factor experiment +(`493ba96`) built player x season aggregate cells over **ALL training dates** +while the folds are shuffled date blocks, so a held-out game's factor includes +the player's **LATER same-season games** — **97.85%** of challenge rows are +affected (90,450 / 92,440 rows; per fold 97.57-98.08%); the seed-3 +0.57pp is +lookahead, not signal (independent OOF re-score audit, 2026-10-22; runs at +pre-cleanup commit `c82b2e7` in history). The latent-factor idea remains +**UNTESTED**; if retried it must use only strictly prior games per row +(expanding window). + +The **V6-era shift-unit leak** is the same class of failure: the +pre-correction headlines (V2-V5, incl. LGBM 30.36% / HGB 30.07-30.42%) used +`lineup_unit`/`pp_unit` from the same game's shift chart, so they are invalid +as deployment estimates; corrected LGBM is **29.06%** (918/3159). + + +**Post-roadmap findings:** identity features were negative; recent-era +training did not beat full-era on identical dates, but per-season accuracy +rises (2025-26 ensemble **31.6-32.9%** vs hgpg **30.3%**). QoC/QoT was mixed +(+0.51/+0.03pp) and reverted. Baseline per-group accuracy is **g1 39.9% / +g2 27.2% / g3 20.9%**; mean max predicted probability **0.315** vs realized +**0.293**. + +**Pre-2017 data (V15):** 190,070 extra skater rows were ingested and published +(2013-17, 617,310 snapshot rows total); LGBM +0.10/+0.41pp but the default +ensemble was **−0.38/−0.22pp**, so it was **not adopted**. Default remains the +2017+ no-lineup ensemble (**29.71%** mean all-era, **~30-32%** recent-era). +The four store dumps are committed (`9c9f315`) and `--refresh` now uses +date-window pagination to avoid the PostgREST 57014 timeout. + +**Conclusion:** with the currently available historical raw data, **~29.7% is +the pooled all-era expectation** (and **~30-32% on recent-era dates**), +contingent on real projection fidelity; V11 puts realistic 80-90% fidelity at +**~29.3-29.9%**. ≥30% was reachable only with same-game lookahead leakage. + +**Data priorities (owner rule, 2026-10-24):** (1) persist real **PROJECTED** +lineups with units going forward — `snapshot_projected.py` + the nightly +unit-match of build projections vs backtracking actuals (`fidelity_tracker.py`, +PR #137 tracker) make projection fidelity measurable, and the adoption gate +is fidelity >= 90% AND paired beats of the no-lineup ensemble on both seeds. +(2) **No market odds** — per owner rule the market-anytime-goal-scorer-odds +collection idea is dropped (historical odds are not free before 2023-05 +anyway; the feasibility scan is recorded in the V7 section). + +**Legitimate deployment lever, unverifiable historically:** projected +lineups and confirmed starting goalies are available pre-game in the live +pipeline — the crude projector gave an ensemble 29.88/29.60 (seeds 1/3) and the +oracle-lineup LGBM 4-seed mean is 30.33 ±0.26. V11 puts 80-90% line fidelity at +roughly **29.25-29.54%**; reaching 29.7-30.3 needs a near-oracle feed (~100%). +Test a real feed before switching the default. + +**Reproduce (default model — the canonical live ensemble):** +```bash +cd SmartScore-backtrack +for s in 0 1 3; do + OMP_NUM_THREADS=2 LGBM_N_JOBS=2 uv run --with lightgbm==4.7.0 python \ + smartscore/scripts/backtrack/model.py --env dev --model ensemble \ + --seed "$s" --split kfold --splits 5 --train-subset all +done +``` +(V4 shot/TOI features are retained in `NUMERIC_FEATURES`; the injury filter +was never worth testing - fields 100% null.) + +The V6-era leakage audit scripts and their write-up +(`docs/backtrack_audit.py`, `docs/backtrack_ablation.py`, +`docs/backtrack_model_audit.md`) were deleted in `chore/clean-tree`; +see commit `c82b2e7` in history. + +Working log for the goal-probability model built on the backtracked archive. +Purpose: record what was tried, what worked, what broke, and the data gotchas, +so nothing gets re-derived twice. Update it every session. + +**Repository state (2026-10-24, `chore/clean-tree`):** this is now the single +results/history document. All experiment scripts, per-experiment notes, +audit scripts, and experiment CSV caches were **deleted** (not archived) — +every exact blob is preserved in git history at the pre-cleanup commit +**`c82b2e7`** (`git show c82b2e7:`). What remains: the 11 canonical +model/pipeline scripts plus `snapshot_projected.py` / `fidelity_tracker.py`, +the operational runbooks, this file, and `docs/supabase_shot_columns.md` on +its own branch (see the deployment paragraph). + +## Source of truth facts (do not re-discover) + +- Backtracked data lives in the **dev** Supabase tables (`ENV` in `.env` is + `prod`, but the backtrack publish shipped to dev): + - `Player-Snapshots-backtrack-dev` — 427,240 rows, 2017-10-04 .. 2026-06-14. + - `Team-Stats-backtrack-dev` — 23,740 rows (per team per game). + - `Goalie-Snapshots-backtrack-dev` — 25,326 rows (per goalie appearance). +- `Player-Snapshots-backtrack-prod` is EMPTY. Add `--env dev` or the script + fails fast with "table is empty". +- Table download takes ~2.5 min; cached to `data/ml/*.csv` (see fetch_table). +- `data/raw_nhl.sqlite` (1.7 GB) is the raw layer the migrations call the + source of truth. Supabase rates alone are NOT recomputable. +- `tims` column: 1/2/3 = challenge pick group that date; 0 = not in the + challenge (334,800 rows; 92,440 rows are in groups). Sim rows = tims 1/2/3. +- Label: `scored` (100% filled on backtrack rows). Positives ~15% of rows. + +## Gotchas that already cost time (do not repeat) + +1. **"New York" is ambiguous.** Both clubs publish `team_name="New York"` in + Supabase. A name join leaves 14,685 rows (3.4%) unresolvable. The club per + player per game must come from `player_games` in raw_nhl.sqlite (it has + `team_abbrev`/`opponent_abbrev` per `player_id` per `game_date`). + Follow-up: 22,176 of the 474,721 `player_games` rows carry a NULL + `opponent_abbrev` (the first player rows of each game's block). Every one + of the 11,870 games has exactly two distinct clubs, so repair the opponent + from the other club in the same `game_id` before grouping by opponent. +2. **CSV round-trip types.** `pd.read_csv` parses season `20232024` as int64 + while the DB carries TEXT (and `player_games.season` is INTEGER). Cast + season to string on every frame before any merge. +3. **`live_score` mask bug** (fixed 2026-10-18): passing a train boolean mask + onto the *test* frame selects nothing via `.loc` index alignment → all-zero + scores → `idxmax` picks the first row per group → fake ~16% accuracy for + the live weights. Rule: the min/max function takes the train frame itself. +4. **`idxmax` on all-NaN groups raises.** `daily_picks` must filter NaN scores + first (team-debut rows have no tgpt/otga; live scores inherit those NaNs). +5. **`TEST_START & frame["scored"]` precedence** bit once — always + parenthesise `(frame["date"] < TEST_START) & (...)`. +6. The Rust module (`make_predictions_rust.so`) cannot be built on this box + (no `cc` linker). If the live evaluator is needed, replicate + `predictions.rs` in Python: it is literal - min-max on the hardcoded + `service.get_min_max()` values, then a linear weighted sum. + The hardcoded MinMax is: gpg/hgpg/five_gpg max 2.0, tgpt/otga max 4.0, + otshga 1.12, hppg 0.314, min 0 everywhere. +7. Train-era extrema have outliers (train tgpt max 10.0, hgpg max 3.0, gpg + max 4.0) — because the archived era is 9 seasons. Live scorer avoids this + by hardcoding. Any min-max variant must state which era it normalises on. +8. The scorer pipeline in the repo (`calculate_accuracy.py`) reads the LIVE + archive `Player-Snapshots-prod` (143,263 rows), evaluates dates >= + 2025-01-25 only, and summarises per-dates per-group accuracy. +9. **PBP fetch retry envelope (V16, 2026-10-23).** The gamecenter + play-by-play fetcher pulled 6,993/6,993 games with 0 fetch/parse + failures, but the endpoint's HTTP 429s are NOT retried by the + `nhl_client._get_json` retry envelope (4 attempts, 30s timeout, 1/2/4s + backoff) by design; three fan-out processes trip them, so the fetcher + runs a >50%-failure-rate breaker that stops the pass. One serialized + process at a 0.75s delay sustains ~1.3 games/s with zero failures; + exhausted game_ids landed in `data/ml/pbp_failed.csv` for re-running. +10. **PostgREST 57014 statement timeout on big table reads.** `--refresh` + on 617,310 rows died with `57014 canceling statement due to statement + timeout` after 254s (ordered offset pagination); `fetch_table` now + fetches monthly date windows (`_month_windows` + `_fetch_window`, + 153 windows for 2013-10-01..2026-06-14). Fix pagination, don't raise + the statement timeout. + +## Evaluation protocol (agreed) + +- The only metric that counts: per game date, one pick from each of tims + groups 1/2/3 (argmax of the method's score), hit iff `scored=1`. +- **k-fold over DATES is the standard** (not rows): shuffle the challenge + dates, cut into k=5 blocks, train on the rest, simulate on the block. + Report per-fold accuracy (mean ± std), pooled out-of-fold hits, and a + McNemar exact test on disagreeing picks vs the hgpg baseline. +- `--split seasons` (train < 2024-08-01, test 2024-25+25-26) is the + deployment-shaped backtest, but optimistic as the headline: the model makes + up ~2.4pp of "edge" training on earlier eras there. + +## Results log + +### V1 — 16 baseline features (rates, opp goalie, lineup), HGB + +Config: lr=0.03, max_iter=1200, 31 leaves, l2=1.0 (5-config sweep, all +differences ~1pp = pick noise). Features: gpg, five_gpg, ppg, hgpg, hppg, +tgpt, otga, otshga, home, opp goalie block (gaa, save_pct, shutouts, gp, +W/L/OTL), categorical lineup_unit / lineup_position_group / pp_unit / tims. + +| split | method | acc | n picks | +|---|---|---:|---:| +| seasons (chronological) | gpg | 28.8% | 1305 | +| seasons | hgpg | 30.3% | 1305 | +| seasons | live weights | 30.2% | 1288 | +| seasons | HGB | 31.2% | 1305 | +| kfold k=5 pooled | gpg | 26.5% | 3159 | +| kfold pooled | hgpg | 28.0% | 3159 | +| kfold pooled | live weights | 28.3% | 3124 | +| kfold pooled | HGB | 26.8% | 3159 | +| kfold pooled | random | 17.8% | 3159 | + +- McNemar on kfold pooled: HGB vs hgpg 378-416 (p=0.19), HGB vs gpg 418-407 + (p=0.73). **No model separated.** +- Lesson: the chronological "2.4pp model edge" was era-composition optimism. + hgpg (~28%) was the best simple rule under date-CV; and HGB trained on + challenge rows only had issues in eras where hgpp/rank inputs are sparse. + +### V2 — added relative-context features (same HGB config) + +New pre-game features (all verified leak-free): +- rank_* : within-(date, tims group) percentile of gpg, hgpg, five_gpg, ppg. +- prev2_goals / prev3_goals: goals in the 2/3 games strictly before the row's + game (shift-by-one of the scored label per player). +- games_since_goal: consecutive past games without a goal, capped 15, NaN if + never scored in coverage (mostly depth defencemen). +- days_since_game: per player. +- club_rest_days / opp_rest_days: per club appearance dates from team table. + +| split / config | method | pooled acc | hits / total | +|---|---|---:|---:| +| kfold, train=challenge | HGB | 27.35% (std 0.89) | 864 / 3159 | +| kfold, train=challenge | logreg | 28.46% | 899 / 3159 | +| kfold, train=all rows | **HGB** | **29.0%** (std 1.25) | **916 / 3159** | +| kfold, train=all rows | logreg | 29.0% | 917 / 3159 | +| kfold, train=all rows | ensemble (mean pct-rank of HGB+logreg) | 29.3% | 925 / 3159 | +| baselines (unchanged) | hgpg | 28.0% | 886 / 3159 | +| baselines | gpg | 26.5% | 837 / 3159 | + +Significance (McNemar exact, pooled picks): +- **HGB(all) vs gpg: 442-363 on disagreements, p = 0.0059 — significant.** +- HGB(all) vs hgpg: 373-343, p = 0.28 — direction right, not conclusive. +- logreg(all) vs hgpg: 201-170, p = 0.12 — same story. +- Ensemble vs hgpg: 290-251, p = 0.10; ensemble vs HGB: p = 0.69 (tie). + +Current headline: **V2 features + train on ALL rows, HGB or logreg ≈ 29.0% +pooled OOF; ensemble 29.3%** — clearly beats the straight-GPG rule, roughly +beats/ties hgpg and the live weights, margin short of significance vs hgpg. + +### V3a — within-day ranking objective (lambdarank) + +Config: `--ranker lambdarank`, LightGBM 4.7.0 `LGBMRanker` +(objective=lambdarank, 400 trees, lr=0.03, 31 leaves, min_child_samples=50, +subsample/colsample=0.8). Same V2 feature set; trained on ALL scored rows. +Rows grouped by `(date, tims)` (tims=0 forms its own per-date group), so the +model optimises the order inside each slate/group. Date-blocked kfold, k=5; +3,159 pooled picks. Code falls back to pairwise logistic on (winner, loser) +feature differences if lightgbm is not importable. + +Smoke (k=2, train=all, 173s): ranker 27.03% (854/3159), HGB 28.21%, +hgpg 28.05%, gpg 26.50%. + +Full k=5, train=all (426s): + +| method | pooled hits / 3159 | acc | per-fold mean ± std | +|---|---:|---:|---:| +| HGB | 916 | 29.00% | 28.995 ± 1.245 | +| logreg | 917 | 29.03% | 29.029 ± 1.252 | +| **ranker (lambdarank)** | **832** | **26.34%** | **26.336 ± 1.339** | +| hgpg | 886 | 28.05% | 28.046 ± 1.631 | +| gpg | 837 | 26.50% | 26.496 ± 1.163 | + +McNemar exact, pooled picks: +- ranker vs gpg: 394-399, p=0.89 (tie). +- ranker vs hgpg: 332-386, p=0.048 (**ranker worse**). +- HGB vs gpg: 442-363, p=0.0059; HGB vs hgpg: 373-343, p=0.28. + +Verdict: the ranking objective **did not help** — it fell to the straight-GPG +level and lost to hgpg, while both pointwise models stayed at ~29%. Per-group +ranker hit rates (g1/g2/g3 = 36.4/24.0/18.6) trail HGB (38.9/27.2/20.9); the +likely cause is that lambdarank only sees within-slate order (small groups, +truncation at 30) and discards the global 0/1 calibration that HGB/logreg use +across all 380k training rows. Do not promote it; keep `--ranker none` as the +default. + +### V3b — calendar / schedule / relative-goalie features (reverted) + +Added four leak-free pre-game features to the V2 set: +- `day_of_season`: 0-based index of the date among that season's distinct + dates (season derived from date, Aug-Jul boundary). +- `month`: 1-12 from the date. +- `rel_goalie_strength`: opponent starter's pre-game GAA minus the mean GAA + of that date's starters (same dedup rule as `build_frame`; NaN if unknown). +- `schedule_density`: club games in the 7 days before the game + (`date-7 <= prior game < date`), from the team table; NaN if unknown. + +Leakage/merge checks: row count stayed 427,240 before/after `add_derived`; +no `_x`/`_y` suffix columns; `month` matched the parsed date; each season's +first date had `day_of_season=0`; sampled `rel_goalie_strength` and +`schedule_density` matched independent recomputation. Calendar features use +the date only, goalie means use same-date pre-game snapshots, and density +counts strictly earlier dates. + +Full date-blocked k=5, train=all, 284s, 3,159 pooled picks: + +| method | pooled hits / 3159 | acc | per-fold mean ± std | +|---|---:|---:|---:| +| HGB | 907 | 28.71% | 28.710 ± 1.763 | +| logreg | 906 | 28.68% | 28.680 ± 1.079 | +| ensemble | 921 | 29.16% | 29.151 ± 2.697 | +| hgpg | 886 | 28.05% | 28.046 ± 1.631 | +| gpg | 837 | 26.50% | 26.496 ± 1.163 | + +Delta vs V2 (29.00 / 29.03 / 29.28): HGB **-0.29pp**, logreg **-0.35pp**, +ensemble **-0.13pp** — all within fold noise, no gain. + +McNemar exact, pooled picks: +- HGB vs gpg: 423-353, p=0.013; HGB vs hgpg: 353-332, p=0.44. +- logreg vs gpg: 331-262, p=0.0052; logreg vs hgpg: 193-173, p=0.32. +- ensemble vs gpg: 377-293, p=0.0013; ensemble vs hgpg: 280-245, p=0.14. +- **V3b HGB vs V2 HGB: 202-211, p=0.69** (tie); 1,062 of 3,159 picks changed. + +HGB permutation importance (fold-1 model, 3,000 held-out rows, 1 repeat, +ROC-AUC decrease), top 15: lineup_unit .0420, hgpg .0171, pp_unit .0125, +gpg .0092, hppg .0049, opp_save_pct .0042, otshga .0033, club_rest_days +.0027, otga .0019, ppg .0016, opp_wins .00082, opp_gaa .00070, tims .00070, +games_since_goal .00066, day_of_season .00053. The other new features were +negative (schedule_density -0.0008, month -0.00084, rel_goalie_strength +-0.0013). + +Verdict: **reverted**. No metric improved and the new features contributed +little or negatively; keep the V2 feature set as the baseline. + +### V3c — post-processing / blends on saved OOF scores (notes only) + +Source: `data/ml/oof_v2_baseline_repro.csv` (92,440 OOF rows, 3,159 challenge +picks); no retraining. Pick rule unchanged: argmax within `(date, tims)`, hit +iff `scored=1`. Rank blends use the percentile rank within `(date, tims)`; +z-score blends standardise within `(date, tims)`; the logit blend uses the +HGB/logreg probabilities (ranges 0.009-0.73 and 0.003-0.97, clipped 1e-6). +Missing `live` ranks/z-scores were filled neutral (0.5 / 0); 1,228 of 92,440 +rows lack `live`. No adaptive/tuned weights were used. + +| variant | hits / 3159 | acc | mean ± std | Δ vs ens | McNemar vs hgpg | McNemar vs ens | +|---|---:|---:|---:|---:|---|---| +| ensemble rank hgb+logreg | 925 | 29.281% | 29.278 ± 2.386 | — | 290-251, p=0.102 | — | +| rank hgb+logreg+live | 896 | 28.363% | 28.362 ± 2.243 | -0.918 | 216-206, p=0.661 | 112-141, p=0.078 | +| rank hgb+live | 907 | 28.712% | 28.708 ± 2.723 | -0.570 | 272-251, p=0.382 | 126-144, p=0.301 | +| rank logreg+live | 882 | 27.920% | 27.920 ± 0.609 | -1.361 | 162-166, p=0.869 | 215-258, p=0.053 | +| z-score hgb+logreg | 930 | 29.440% | 29.440 ± 2.042 | +0.158 | 257-213, p=0.047 | 126-121, p=0.799 | +| z-score hgb+logreg+live | 935 | 29.598% | 29.598 ± 1.302 | +0.317 | 211-162, p=0.013 | 164-154, p=0.614 | +| logit-avg hgb+logreg | 930 | 29.440% | 29.439 ± 1.857 | +0.158 | 260-216, p=0.049 | 127-122, p=0.800 | +| rank hgb+logreg+live+gpg | 892 | 28.237% | 28.235 ± 1.711 | -1.045 | 249-243, p=0.822 | 164-197, p=0.092 | +| rank hgb+logreg+live+gpg+hgpg | 904 | 28.617% | 28.615 ± 1.596 | -0.665 | 207-189, p=0.393 | 179-200, p=0.304 | + +Verdict: **no variant qualified** (needed >= +0.5pp vs ensemble and p<0.10 +vs ensemble). Best was z-score hgb+logreg+live at 29.60% (+0.32pp), but its +paired McNemar vs the ensemble was p=0.61. Keep the existing ensemble; no +`--blend` option added. + +### V3d — model-family diversity + +Added `--model {hgb,lgbm,extratrees}` (default hgb unchanged). `lgbm` is +`LGBMClassifier` binary (400 trees, lr 0.03, 31 leaves); `extratrees` is +`ExtraTreesClassifier` (400 trees, min_samples_leaf=20, n_jobs=-1), with +categoricals as ordinal codes and numeric NaNs left native. Logreg, ranker, +`daily_picks` and `score_picks` paths are unchanged. + +Full date-blocked k=5, train=all, 3,159 pooled picks. Runtime: lgbm **97s**, +extratrees **346s** (both under the 420s cap; AUC 0.6947/0.6933 vs HGB 0.6903). + +| variant | hits / 3159 | acc | mean ± std | Δ vs ens | McNemar vs hgpg | McNemar vs ens | +|---|---:|---:|---:|---:|---|---| +| current ensemble rank hgb+logreg | 925 | 29.281% | 29.278 ± 2.386 | — | 290-251, p=0.102 | — | +| lgbm single | 959 | 30.358% | 30.356 ± 1.719 | +1.076 | 354-281, p=0.0042 | 237-203, p=0.116 | +| extratrees single | 938 | 29.693% | 29.691 ± 2.162 | +0.412 | 323-271, p=0.036 | 269-256, p=0.601 | +| rank hgb+logreg+lgbm | 941 | 29.788% | 29.786 ± 2.059 | +0.506 | 306-251, p=0.022 | 107-91, p=0.286 | +| rank hgb+logreg+extratrees | 931 | 29.471% | 29.470 ± 2.309 | +0.190 | 269-224, p=0.047 | 112-106, p=0.735 | +| rank all four | 946 | 29.946% | 29.944 ± 2.122 | +0.665 | 293-233, p=0.010 | 120-99, p=0.176 | +| best three (logreg+lgbm+extratrees) | 940 | 29.756% | 29.754 ± 1.966 | +0.475 | 274-220, p=0.017 | 177-162, p=0.447 | + +Verdict: **defaults unchanged**. LGBM is the best single model (+1.08pp), but +its paired McNemar vs the current ensemble is p=0.116, missing the p<0.10 bar; +every ensemble also missed it. LGBM is worth a follow-up (more folds/seeds), +not a default switch yet. + +### V3e — LGBM seed robustness + +Added `--seed` (default 42) to control the date-shuffle in `fold_blocks`. +V2-V3d used the old hard-coded seed 0; pass `--seed 0` to reproduce those +fold assignments. LGBM, date-blocked k=5, train=all, 3,159 picks/seed: + +| seed | LGBM hits / 3159 | acc | per-fold std | vs hgpg | McNemar p | +|---|---:|---:|---:|---|---:| +| 1 | 957 | 30.294% | 3.348 | +2.247pp | 349-278, p=0.0051 | +| 2 | 950 | 30.073% | 2.793 | +2.026pp | 342-278, p=0.0113 | +| 3 | 934 | 29.566% | 1.446 | +1.519pp | 334-286, p=0.059 | +| **mean (1-3)** | — | **29.978%** | seed std **0.373** | — | — | + +McNemar vs hgpg pooled over the three seed runs: **1025-842, p=2.5e-05** +(n=1,867 discordant picks). Seed 0 (V3d) was 959/3159 30.358%, 354-281, +p=0.0042. + +Seasons split (`--split seasons`, one fit, 1,305 picks): LGBM **394/1305 +30.192%**, hgpg **396/1305 30.345%**, gpg 376/1305 28.812%. LGBM does **not** +beat hgpg on the chronological split. + +Verdict: **default stays hgb**. The multi-seed mean is 29.98% (<30.0) and seed +3 dipped to 29.57%; LGBM beats hgpg consistently in k-fold (all three seeds +positive, pooled p<0.001) but loses to hgpg on the seasons split. Tune +regularisation / try an LGBM+hgpg blend before promoting it. + +### V3f — LGBM + baseline blends on saved OOF (notes only) + +Inputs: `data/ml/oof_v3e_lgbm_seed{1,2,3}.csv` (3,159 picks/seed). Fixed, +pre-declared weights only; rank/z transforms within `(date,tims)`. + +| variant | seed 1 | seed 2 | seed 3 | mean ± std | McNemar vs lgbm (pooled) | +|---|---:|---:|---:|---:|---| +| lgbm alone | 30.294% | 30.073% | 29.566% | 29.978 ± 0.373 | — | +| rank 0.75 lgbm + 0.25 hgpg | 29.978% | 29.756% | 29.788% | 29.841 ± 0.120 | 173-186, p=0.527 | +| rank 0.50 lgbm + 0.50 hgpg | 29.630% | 29.471% | 29.218% | 29.440 ± 0.208 | 485-536, p=0.118 | +| z equal lgbm+hgpg | 29.693% | 29.376% | 29.376% | 29.482 ± 0.183 | 541-588, p=0.171 | +| z 0.75 lgbm + 0.25 hgpg | 29.471% | 29.915% | 29.693% | 29.693 ± 0.222 | 269-296, p=0.274 | +| rank 0.75 lgbm + 0.25 gpg | 29.250% | 29.250% | 29.376% | 29.292 ± 0.073 | 329-394, p=0.017 (worse) | + +McNemar vs hgpg pooled over all three runs: lgbm 1025-842, p=2.5e-05; +rank75_hgpg 917-747, p=3.4e-05; rank50_hgpg 612-480, p=7.2e-05; z_eq +529-393, p=8.4e-06; z75_hgpg 802-646, p=4.6e-05; rank75_gpg 996-878, +p=0.0069. + +Verdict: **no blend qualified**. None reached 30.0% in all three seeds (the +best, rank75_hgpg, was 29.76-29.98%), and none beat lgbm alone consistently — +rank75_hgpg won only seed 3, the others lost every seed; pooled McNemar vs +lgbm was p>=0.12 for all hgpg blends. No `--blend` flag added; notes only. + +### V4 — raw shot / TOI / shooting-talent block (winning feature set) + +Environment check first: `Player-/Team-/Goalie-Snapshots-backtrack-prod` all +still return **0 rows and no columns** (exact count queries, 2026-10-19), so +the work continued on `--env dev` with the existing `data/ml/*.csv` caches. +Dev row counts unchanged (427,240 / 23,740 / 25,326). + +Hypothesis: `gpg` is a season-to-date **goal** rate, and goals are the noisiest +possible talent estimate (~15% of all rows, ~27%/16%/9% by tims group). The +Supabase snapshots carry no shots or ice time, but `player_games` in +`raw_nhl.sqlite` has the boxscore line per player per game. New block, all +aggregates over a player's **strictly earlier** games (season-to-date prefix +sums minus the current row; last-5/10; EWM halflife 5; career expanding): + +- `sd_shots_pg`, `sd_goals_pg`, `sd_toi_pg`, `sd_sh_pct` +- `r5_shots_pg`, `r5_goals_pg`, `r10_shots_pg`, `r10_goals_pg`, `r10_toi_pg` +- `ewm_goals`, `ewm_shots`, `career_games`, `career_goals_pg`, + `career_shots_pg` + +Leakage checks: spot-checked a player-date against a manual prior-games query +(`sd_shots_pg` 1.80, `sd_goals_pg` 0.125, `r10_shots_pg` 1.90 — exact match); +the current game's line is excluded; 418,885 / 427,240 rows join a shot block +(the rest are first NHL games). No row-count change and no suffixed columns. + +Deployment pointer (2026-10-27): the deployed picks path now uses exact +same-day shot-block computation via the runner-side store refresh (dumps +load + current-season crawl on cache-miss, zero Supabase) - commit cd05868 +plus the refresh-store/workflow commit; see docs/ml-picks-runbook.md §1.1. + +Each extra feature group was added to the V2 set on its own (HGB, date-blocked +k=5, train=all, **seed 0** fold assignment, 3,159 picks). Seed 0 V2 baseline +reproduced at 916 hits / 28.997%. + +| added block | hits / 3159 | acc | +|---|---:|---:| +| none (V2 baseline) | 916 | 28.997% | +| opponent team rates + expected-goals interactions | 909 | 28.775% | +| own/opp goalie relative strength | 917 | 29.028% | +| schedule density / back-to-backs | 887 | 28.079% | +| calendar (month, day-of-week, season-day, playoffs) | 896 | 28.363% | +| recent-label form (prev5/10, EWM) | 913 | 28.902% | +| **shot / TOI block** | **961** | **30.421%** | + +Stacking other blocks onto the shot block did not improve on it: ++goalie 929 (29.408%), +opponent team 962 (30.453%), +recent form 938 +(29.693%), +calendar 953 (30.168%), +schedule 963 (30.484%), +opponent team +& schedule 939 (29.725%), +opp+schedule+recent 959 (30.358%), ++opp+schedule+calendar 954 (30.199%). All within ~1pp pick noise; the single +shot block is the simplest and already at the top. + +Leave-one-subgroup-out from the shot block (same seed-0 protocol), showing +all four subgroups carry signal: −season-to-date 926 (29.313%), −rolling 931 +(29.471%), −EWM 921 (29.155%), −career 914 (28.933%). + +Monotonic constraints (domain-sign on gpg/hgpg/ppg/shots/opp_gaa/ +opp_save_pct, HGB native `monotonic_cst`) **hurt**: shot block 924 +(29.250%), shot+schedule 937 (29.661%) vs 961/963 unconstrained. Rejected. + +End-to-end default run (`--model hgb --seed 42`, the current CLI defaults; +3m16s): **950 / 3159 = 30.073%**, per-fold 30.8/33.3/26.7/30.2/29.4 +(mean 30.07 ± 2.40), held-out AUC 0.694. Per-group hit rates g1/g2/g3 = +40.9/27.9/21.4 vs V2 38.9/27.2/20.9 — the gain is spread across all three +groups, not one lucky slate. Same-run baselines: hgpg 28.047% +(886), gpg 26.496% (837), logreg 28.965% (915). Exact McNemar on pooled picks: +**HGB vs hgpg 406-342, p = 0.0212; HGB vs gpg 468-355, p = 9.2e-05** — both +baseline gaps are significant at p < 0.05 in this run. + +Seed robustness (`--seed 0` and the default `--seed 42`, same config): + +| seed | hits / 3159 | acc | per-fold std | +|---|---:|---:|---:| +| 0 | 961 | 30.421% | 2.54* | +| 42 (default) | 950 | 30.073% | 2.40 | + +\* seed-0 per-fold figures come from the experiment harness, which uses the +same fold shuffle as the CLI `--seed 0`. A wider seed sweep was abandoned: +other swarm jobs saturated the 6-core box and one fold took 30+ minutes, so +only the two completed seeds are reported rather than a starved run. + +Secondary chronological split (`--split seasons`, train < 2024-08-01, test +2024-25 + 2025-26, 1,305 picks, one fit): HGB **390 = 29.885%**, hgpg +**396 = 30.345%**, gpg 376 = 28.812%, live 376/1288 = 29.193%. McNemar +HGB vs hgpg 153-159 (p = 0.78), HGB vs gpg 190-176 (p = 0.50) — statistically +a tie, with HGB a hair below hgpg. The shot block therefore does **not** beat +hgpg on the deployment-shaped split (same pattern V3e found for LGBM); the +>30% headline is a date-blocked k-fold result, not a chronological one. The +k-fold edge over both baselines is significant, but do not claim it transfers +across eras. + +Verdict: **promoted**. The shot/TOI block is now part of `NUMERIC_FEATURES`; +`--model hgb --seed 42` remains the default and clears 30.0% pooled OOF. + +### V3g — seed bagging and LGBM config sweep + +Housekeeping: the dangling V4 changes were a complete shot/TOI feature block +(from `player_games`: `sd_*`, `r5_*`/`r10_*`, `ewm_*`, `career_*`, 14 +features added to `NUMERIC_FEATURES`) plus V4 notes. Committed them to branch +`v4-shot-features` (`08e92e7`); concurrently another worker landed V4 on +`backtrack-recon` with follow-up commits through `beaee74`, so V4 is now the +current codebase and nothing is dangling. `data/ml/` remains an untracked +cache. + +Seed bagging (saved OOFs): z-score each seed's `lgbm` within `(date, tims)`, +average the three, one pick pass. **945 / 3159 = 29.915%**; per-fold std +2.932 using seed-1 fold labels (1.495/1.563 under seed-2/3 labels, which are +an arbitrary partition for a bag); McNemar vs hgpg **328-269, p=0.0175**. +Bagging does not beat lgbm-alone mean (29.978%). + +New `--lgbm-config {a,b,c}` (a=400/0.03/31 default; b=600/0.02/15/reg5; +c=800/0.02/63). Seeds 1 and 3, date-blocked k=5, train=all, 200s cap each. +These runs used the pre-V4 V2 feature worktree so they match the V3e +references; re-run on the now-current V4 features before promoting a config. + +| config | seed 1 | seed 3 | +|---|---:|---:| +| a (reference) | 30.294% (957) | 29.566% (934) | +| b | timeout at 200s | timeout at 200s | +| c | 29.725% (939) | timeout at 200s (2/5 folds done) | + +The b timeouts completed no folds; c seed 1 finished in 190s but is -0.569pp +vs a, so it cannot meet the +0.5pp-on-both-seeds bar. The other heavy jobs on +the host (V4 final HGB, audit LGBM, V3h) are the likely cause. No config +qualified, so seed 2 was not run and the default stays **a / hgb**. + +### V4 results — clean LGBM check (2026-10-19) + +V4 = 14 prior-games-only shot/TOI/talent features (`sd_*`, `r5_*`/`r10_*`, +`ewm_*`, `career_*`) from `player_games`; carried by `08e92e7` on branch +`v4-shot-features` and merged/followed up on `backtrack-recon` through +`beaee74`. + +LGBM, date-blocked k=5, train=all, `OMP_NUM_THREADS=2`, `LGBM_N_JOBS=2`: +each seed completed in 100s with `--seed` 1/3. + +| seed | V3e pre-V4 | V4 | delta | McNemar V4 vs V3e | +|---|---:|---:|---:|---| +| 1 | 957/3159 = 30.294% | 959/3159 = 30.358% | +0.063pp | 220-218, p=0.962 | +| 3 | 934/3159 = 29.566% | 926/3159 = 29.313% | -0.253pp | 207-215, p=0.733 | +| pooled | — | — | — | 427-433, p=0.865 | + +AUC rose slightly (0.6964/0.6968 vs 0.6946/0.6944), but picks did not: seed 1 +was positive by 0.06pp, seed 3 negative. Per the stop rule, seed 2 and HGB +seed 0 were **not** run. + +Fold-1 LGBM gain importance for the shot block (rank among 47 features): +career_goals_pg #2 (151,047), ewm_shots #4, sd_shots_pg #5, r10_toi_pg #6, +sd_toi_pg #7, career_shots_pg #9, career_games #14, ewm_goals #18, sd_sh_pct +#20, r10_shots_pg #21, sd_goals_pg #24, r5_shots_pg #31, r10_goals_pg #39, +r5_goals_pg #40. Permutation AUC drops were small: career_goals_pg 0.0089, +ewm_shots 0.0020, all others <=0.0015. + +Existing V4 accuracy runs: HGB seed 42 = 950/3159 30.073% +(`/tmp/opencode/v4_final.log`), seasons 390/1305 29.885%; the HGB seed-0 run +is incomplete (2/5 folds). Verdict: V4 is heavily used but does not improve +LGBM and shows no cross-family gain; its 30.4% seed-0 headline is still an +unverified harness number. Keep the code, but do not rely on the V4 promotion +until a clean HGB seed-0 run is completed. + +### V5 — pick voting and recency-weighted LGBM (notes only) + +**A. Pick voting.** Seed-0 files (`oof_v2_baseline_repro.csv`, +`oof_v3d_lgbm.csv`, `oof_v3d_et.csv`) share identical fold columns across all +92,440 rows, so A1 comparisons are paired. + +- A1 majority vote over hgb+logreg+lgbm+extratrees+live (tie-break mean rank): + **929/3159 = 29.408%**, per-fold std 1.562, folds 31.1/28.6/29.9/30.3/27.1. + vs hgpg 249-206, p=0.049; vs lgbm-alone 148-178, p=0.108. LGBM alone + remains higher at 959/3159 = 30.358%. +- A2 vote over the three LGBM seeds 1-3: **938/3159 = 29.693%**, std 2.865 + using seed-1 fold labels, folds 33.3/29.4/26.4/31.7/27.6. vs hgpg 331-279, + p=0.039. vs lgbm seed 1/2/3: 88-107 p=0.197, 68-80 p=0.366, 101-97 p=0.831. + The three seeds use different fold partitions, so A2's vote-vs-lgbm + comparisons are not paired; only the hgpg comparison is cleanly paired. + +**B. Recency-weighted LGBM** (V4 features, seeds 1/3, `OMP_NUM_THREADS=2`, +`LGBM_N_JOBS=2`, 89-103s each): + +| seed | weight | hits / 3159 | acc | per-fold std | Δ vs unweighted | McNemar | +|---|---|---:|---:|---:|---:|---| +| 1 | none | 959 | 30.358% | 3.101 | — | — | +| 1 | linear | 944 | 29.883% | 2.398 | -0.475pp | 135-150, p=0.407 | +| 1 | half | 934 | 29.566% | 2.983 | -0.791pp | 224-249, p=0.270 | +| 3 | none | 926 | 29.313% | 1.178 | — | — | +| 3 | linear | 954 | 30.199% | 0.948 | +0.886pp | 150-122, p=0.101 | +| 3 | half | 917 | 29.028% | 2.115 | -0.285pp | 221-230, p=0.706 | + +Verdict: **no variant won consistently**. Linear is mixed (loses seed 1, +wins seed 3), half loses both. The `--recency-weight` code was reverted; +default remains `none`. Pick voting also lost to LGBM alone. No code changes +committed. + +### V6 — leakage correction: current-game line/PP labels removed + +**Confirmed leak:** `DATASET_FEATURES` contained `lineup_unit`, `pp_unit` and +`lineup_position_group`. `lineup_unit`/`pp_unit` are built by +`lineup_reconstruct.reconstruct_game` from the **same game's shift chart** +(completed-game shifts), so they are lookahead. `lineup_position_group` is +F/D from the box-score `positions` mapping (static roster position), not a +shift chart, and is retained. All V2-V5 headline numbers that used +`lineup_unit`/`pp_unit` are therefore invalid as deployment estimates. + +**Lagged replacements (tested, then reverted):** `last_lineup_unit`, +`last_pp_unit`, `mode_lineup_unit_5`, `mode_pp_unit_5`, `line_stability_5`, +`pp_share_5`, computed per player sorted by date from rows `[i-5, i)` only; +NaN before the first game. + +Leakage proof: 10 distinct players with a lineup change all had +`last_lineup_unit` equal to the previous game's unit, never the current one: + +| player | date | prev | current | lag | +|---|---|---|---|---| +| 8448208 | 2017-10-14 | F3 | F1 | F3 | +| 8464989 | 2017-10-14 | F4 | F3 | F4 | +| 8465009 | 2017-10-09 | D2 | D3 | D2 | +| 8466138 | 2017-10-07 | F2 | F1 | F2 | +| 8466139 | 2017-10-09 | F3 | F2 | F3 | +| 8466251 | 2017-10-09 | F3 | F4 | F3 | +| 8467370 | 2018-03-06 | F4 | F3 | F4 | +| 8467400 | 2017-10-13 | D2 | D1 | D2 | +| 8467407 | 2018-03-11 | F3 | F2 | F3 | +| 8467875 | 2017-10-10 | F3 | F2 | F3 | + +The same 10/10 check passed for `last_pp_unit`. The lagged code does no SQL: +it only shifts/slices the already-joined frame. The raw queries are +`club_map` (selects `game_id` but has no current-game predicate) and +`shot_features` (no `game_id` column at all). + +LGBM, date-blocked k=5, train=all, seeds 1-3, `OMP_NUM_THREADS=2`, +`LGBM_N_JOBS=2`, 93-103s each: + +| seed | corrected baseline (no current lineup/PP) | + lagged features | delta | +|---|---:|---:|---:| +| 1 | 928/3159 = 29.376% | 929/3159 = 29.408% | +0.032pp | +| 2 | 912/3159 = 28.870% | 926/3159 = 29.313% | +0.443pp | +| 3 | 916/3159 = 28.997% | 910/3159 = 28.807% | -0.190pp | +| mean | 29.081% (std 0.264) | 29.176% (std 0.323) | **+0.095pp** | + +McNemar vs hgpg: 336-293 p=0.094, 331-291 p=0.118, 319-295 p=0.353; pooled +986-879 p=0.0141. Lagged vs corrected baseline: 166-165 p=1.0, 148-134 +p=0.439, 140-146 p=0.768; pooled 454-445 p=0.790. + +Lagged-column importances (fold-1 LGBM gain rank among 48 features; +permutation AUC drop): mode_lineup_unit_5 #2 (95,095; 0.0053), +last_lineup_unit #3 (30,011; -0.0001), pp_share_5 #13 (6,785; 0.0014), +last_pp_unit #15 (5,862; 0.0033), mode_pp_unit_5 #24 (3,206; 0.0008), +line_stability_5 #39 (1,071; 0.0004). + +Verdict: lagged features are leak-free but recover only **+0.095pp** on +average (< +0.5pp) and are mixed by seed, so they were **reverted**. The +mandatory correction is kept: `lineup_unit` and `pp_unit` are removed from +`DATASET_FEATURES`; only `lineup_position_group` and `tims` remain as +categoricals. The corrected LGBM reference is **29.08%** mean (audit seed-0 +corrected baseline 892/3159 = 28.237%). Prior HGB/LGBM headlines that used +current-game lineups are invalid; a corrected HGB run is still needed. + +### V6b — corrected (leak-free) headline + +Corrected HGB seed 0 (`--model hgb`, 213s) also produced logreg in the same +pass, so no separate logreg run was needed. Corrected LGBM seed 0 took 90s; +the ensemble default run took 257s. + +| method | hits / 3159 | acc | per-fold std | vs hgpg | vs corrected LGBM | +|---|---:|---:|---:|---|---| +| gpg | 837 | 26.496% | 1.163 | 326-375, p=0.070 | 319-400, p=0.0028 | +| hgpg | 886 | 28.047% | 1.631 | — | 297-329, p=0.215 | +| hgb | 917 | 29.028% | 2.409 | 373-342, p=0.262 | 223-224, p=1.0 | +| logreg | 918 | 29.060% | 1.940 | 273-241, p=0.172 | 254-254, p=1.0 | +| lgbm | 918 | 29.060% | 2.075 | 329-297, p=0.215 | — | +| rank ensemble (hgb+logreg+lgbm) | 943 | 29.851% | 2.357 | 335-278, p=0.024 | 136-111, p=0.127 | +| ensemble, end-to-end default run | 945 | 29.915% | 2.395 | 338-278, p=0.017 | 139-111, p=0.088 | + +The seed-0 corrected LGBM is **918/3159 = 29.060%**, not the audit's 892: +the audit number was on the pre-V4 feature set; the current 42-feature set +includes the V4 shot block, so the same-seed corrected baseline is 918. + +The ensemble beats corrected LGBM by **+0.791pp** on the reconstructed OOFs +(+0.855pp in the end-to-end run), so it clears the stated +0.5pp rule and is +now the documented default (`--model ensemble`, mean percentile rank of +hgb+logreg+lgbm). Caveat: the paired McNemar is p=0.127 on the reconstructed +OOF (p=0.088 end-to-end, where one tie makes 946 vs the printed 945 picks), so +the edge is directional rather than decisive. + +### V6c — ensemble multi-seed and injury audit + +End-to-end default ensemble (`--model ensemble`, k=5, train=all, +`OMP_NUM_THREADS=2`, 256s/seed): + +| seed | hits / 3159 | acc | per-fold std | vs hgpg | vs same-seed corrected LGBM | +|---|---:|---:|---:|---|---| +| 0 | 945 | 29.915% | 2.395 | 338-278, p=0.017 | 139-111, p=0.088 | +| 1 | 929 | 29.408% | 2.827 | 319-276, p=0.085 | 122-121, p=1.0 | +| 3 | 942 | 29.820% | 0.633 | 314-259, p=0.024 | 134-109, p=0.124 | +| **mean** | — | **29.714 ± 0.277** | — | — | — | + +Same-seed corrected LGBM: seed 0 918 (29.060%), seed 1 928 (29.376%), +seed 3 916 (28.997%). Ensemble deltas: +0.855, +0.032, +0.823pp; mean ++0.570pp. The edge is not uniform — seed 1 is a tie — so treat the ensemble +as directionally better, not a guaranteed per-seed win. OOF re-picks differ +from the printed totals by one tie on seeds 0/3 (946/941 vs 945/942). + +**Injury audit** (92,440 challenge rows): `injury_status` non-null **0**, +distinct **0**; `injury_desc` non-null **0**, distinct **0**. Overall scored +rate 17.256%, with no status breakdown possible. Of the 3,159 seed-0 ensemble +picks, **0** landed on a player with non-null injury status. The injury fields +are never populated on the backtrack archive, so a pre-game injury filter or +feature has no signal and is **not worth testing**. + +### V3h — player-vs-opponent history features (reverted) + +Hypothesis: a player's record against the specific opponent may add pre-game +signal beyond season-to-date / historic GPG. Four features, all built from +`player_games` and strictly prior games: + +- `opp_gpg_2y` — player goals / games vs this opponent over the current + season-to-date plus the immediately preceding season (all prior meetings if + fewer), NaN if none. +- `opp_gpg_career` — same over every prior meeting with that opponent. +- `opp_goals_last3` — goals in the player's last up-to-3 prior meetings. +- `team_vs_opp_gpg_2y` — club `team_goals_for` per game vs this opponent over + the same current + previous season window (every club appearance, not only + this player's). + +Built by sorting `player_games` per `(player_id, opp)` (and per +`(club, opp)` at club grain) and using `cumcount` / shifted cumulative sums, +so the current game never enters its own feature. The 2-year window uses the +raw `season` label, not calendar date (the 2019-20 season runs into Sep 2020). +Joined on `(date, player_id)` and `(date, club)`. + +Validation: 427,240 rows before and after the join; no duplicate/suffixed +columns; exactly the four new columns. Coverage of 427,240 rows: +`opp_gpg_2y` 360,763, `opp_gpg_career` 380,497, `opp_goals_last3` 380,497, +`team_vs_opp_gpg_2y` 395,421. Hand-checked Draisaitl vs NSH on 2021-11-03 +(`opp_goals_last3=8` = 2+2+4 from the three prior meetings) and random +samples against independent recomputation (300/300 career, 150/150 player +2-year, 200/200 club 2-year). + +Protocol: date-blocked k=5, `--train-subset all`, LGBM 400 trees, n_jobs=2, +seeds 1 and 3, 3,159 pooled picks. The baseline was rerun in the same worktree +and reproduced V3e exactly (seed 1 957 hits, seed 3 934). + +| seed | baseline hits / acc | V3h hits / acc | Δ | McNemar (base-only / V3h-only) | +|---|---:|---:|---:|---:| +| 1 | 957 / 30.294% | 938 / 29.693% | **-0.601pp** | 151-132, p=0.285 | +| 3 | 934 / 29.566% | 940 / 29.756% | **+0.190pp** | 145-151, p=0.771 | +| mean | — / 29.930% | — / 29.725% | **-0.206pp** | — | +| pooled seeds (descriptive) | 1,891 / 6,318 29.930% | 1,878 / 6,318 29.725% | -0.206pp | 296-283, p=0.618 | + +Held-out AUC moved only +0.0002 (seed 1, 0.6946→0.6948) and +0.0006 (seed 3, +0.6944→0.6950). Per-fold seed 1 lost in 4 of 5 folds +(-0.8/-0.8/-0.6/-1.5/+0.8pp); seed 3 was mixed (+0.1/-0.9/+0.8/+1.1/-0.2pp). +Only 283-296 of 3,159 picks changed per seed. + +LGBM gain importance (mean over folds, share of total; the two seeds agree to +2 d.p.): `opp_gpg_career` 1.06% (rank 12), `team_vs_opp_gpg_2y` 1.03% (13), +`opp_gpg_2y` 0.50% (22), `opp_goals_last3` 0.22% (29). They rank well below +gpg/hgpg and near ppg/otga, i.e. the model uses them only weakly. + +Verdict: **reverted**. The gain is not consistent (seed 1 -0.60pp, seed 3 +was +0.19pp; mean -0.21pp) and neither seed's McNemar is close to significant +(p=0.28, 0.77). Head-to-head history looks largely absorbed by the existing +season rates plus opponent team/goalie context. No `--opp-history` flag or +feature code retained; notes only. + +### V7-objective — Poisson LGBM and conditional-softmax logit (reverted) + +Protocol: date-blocked k=5, train=all, seeds 1/3, `OMP_NUM_THREADS=2`, +`LGBM_N_JOBS=2`, `timeout 300`, 3,159 pooled picks. The corrected binary +baseline reproduced exactly in this worktree: seed 1 **928 = 29.376%**, seed 3 +**916 = 28.997%**. Both arms use the same 42-feature set and the same folds. + +**A. Poisson LGBM.** Added `--objective {binary,poisson}`. The Poisson arm fits +`LGBMRegressor(objective="poisson")` on the raw `player_games.goals` count +(identical tree config) and scores `1 - exp(-lambda)`. All 92,440 challenge +rows join a goal count, and `goals >= 1` matches `scored = 1` exactly (no +mismatch). + +| seed | binary | poisson | delta | McNemar vs binary | McNemar vs hgpg | +|---|---:|---:|---:|---|---| +| 1 | 928 / 29.376% | 936 / 29.630% | +0.254pp | 153-145, p=0.685 | 326-276, p=0.046 | +| 3 | 916 / 28.997% | 919 / 29.091% | +0.094pp | 131-128, p=0.901 | 310-277, p=0.187 | +| pooled | 1,844 / 29.186% | 1,855 / 29.361% | +0.174pp | 284-273, p=0.672 | 636-553, p=0.017 | + +Held-out AUC 0.6929 (both seeds) vs 0.6924 / 0.6922 for binary. Runtime ~150s +per seed with both seeds running concurrently, under the 300s cap. + +Verdict: rejected — positive on both seeds but only +0.09pp on seed 3, well +short of +0.5pp, and the paired McNemar vs binary is a tie. + +**B. Conditional softmax.** Added `--model csoftmax`: a within-`(date, tims)` +conditional logit on the same features, fitted by scipy L-BFGS on challenge +rows only (PyTorch was not installed). Design matrix: 40 numeric features +median-imputed and standardised on the training rows, `lineup_position_group` +one-hot (F / D / missing) = 43 columns; `tims` is constant within a group and +cancels exactly in the softmax. Groups average 29.3 rows and 5.05 scorers (223 +of 3,159 have none), so the likelihood sums the log probability of every +scored row in the group (multiple-choice conditional logit). Returned score is +the within-group softmax probability. + +| seed | binary | csoftmax | delta | McNemar vs binary | McNemar vs hgpg | +|---|---:|---:|---:|---|---| +| 1 | 928 / 29.376% | 888 / 28.110% | -1.266pp | 228-268, p=0.080 | 328-326, p=0.969 | +| 3 | 916 / 28.997% | 894 / 28.300% | -0.697pp | 229-251, p=0.338 | 336-328, p=0.786 | +| pooled | 1,844 / 29.186% | 1,782 / 28.205% | -0.981pp | 457-519, p=0.051 | 664-654, p=0.804 | + +Training time 1.9-6.4s per fold (143-300 L-BFGS iterations; one seed-3 fold +hit the 300 cap), ~64s per seed end-to-end including the 14s frame build. +Held-out AUC 0.569 — far below LGBM's 0.692. The linear group-softmax cannot +represent the GBDT's nonlinear interactions, and it optimises within-slate rank +rather than the global 0/1 calibration the pointwise models exploit. + +Verdict: rejected — worse than binary on both seeds and no better than hgpg. +No code changes retained; the default remains `--model ensemble`. + +### V7-context — team form / special teams / goalie rest (reverted) + +Hypothesis: the corrected baseline has player rates and opponent-goalie +quality, but little recent **team** form or special-teams context. Added 13 +club-game features, all strictly prior games, from `player_games`: + +- `team_shots_for_5/10`, `team_shots_against_5/10` — rolling club shots. +- `team_goals_for_5/10`, `team_goals_against_5/10` — rolling official club + goals (goals against = the opponent's `team_goals_for` in the same game). +- `shooting_pct_5` = prior-5 goals / shots for; `save_pct_5` = + 1 - prior-5 goals against / shots against. +- `opp_penalties_drawn_pg` — opponent PIM/2 per game, season-to-date prior + (penalties the opponent takes, i.e. the club's PP exposure). +- `opp_pp_opportunities_pg` — club PIM/2 per game, season-to-date prior + (penalties the club takes, i.e. the opponent's PP exposure). +- `goalie_rest_days` — days since the opponent starting goalie's previous + start, NaN on his first start in coverage. + +The cached archive has no penalty-event table, so PIM/2 is the only penalty +proxy and over-counts majors/misconducts. `lineup_unit`/`pp_unit` were not +reintroduced; categoricals remain `lineup_position_group` and `tims`. + +Leakage checks: 427,240 rows before/after the join, no suffixed columns, +exactly the 13 new columns. Coverage: rolling/PDO features 426,646 rows, +penalty features 422,134 / 422,133, `goalie_rest_days` 423,568. Independent +recomputation matched 120/120 rolling+PDO rows, 150/150 penalty rows and +150/150 goalie-rest rows; every window is shifted one club game and every +season-to-date prefix excludes the current game. Club-game grain is 23,740 +rows with one starting goalie per club-game. + +Protocol: LGBM, date-blocked k=5, `--train-subset all`, seeds 1 and 3, +`OMP_NUM_THREADS=2`, `LGBM_N_JOBS=2`, 3,159 picks. The corrected baseline was +rerun in the same worktree and reproduced V6c exactly (seed 1 928, seed 3 916). + +| seed | baseline hits / acc | V7 hits / acc | Δ | McNemar vs baseline | McNemar vs hgpg | +|---|---:|---:|---:|---:|---:| +| 1 | 928 / 29.376% | 930 / 29.440% | **+0.063pp** | 152-154, p=0.954 | 327-283, p=0.082 | +| 3 | 916 / 28.997% | 908 / 28.743% | **-0.253pp** | 148-140, p=0.680 | 304-282, p=0.386 | +| mean | — / 29.187% | — / 29.092% | **-0.095pp** | — | — | + +Held-out AUC moved +0.0004 on both seeds (0.6924→0.6928, 0.6922→0.6926). +Per-fold deltas: seed 1 +0.8/-0.7/-0.6/+0.5/+0.3pp; seed 3 +0.0/+0.5/-2.2/+1.1/-0.6pp. Only 288-306 of 3,159 picks changed per seed. + +LGBM gain importance (mean over folds, share of total; 47 features; seed-1 +rank / share, seed-3 rank / share): `opp_pp_opportunities_pg` 17 / 0.59%, +23 / 0.55%; `opp_penalties_drawn_pg` 18 / 0.59%, 17 / 0.62%; `save_pct_5` +19 / 0.59%, 19 / 0.60%; `team_shots_against_10` 22 / 0.55%, 21 / 0.56%; +`team_shots_against_5` 24 / 0.52%, 24 / 0.51%; `team_shots_for_10` +27 / 0.48%, 29 / 0.44%; `shooting_pct_5` 28 / 0.44%, 27 / 0.48%; +`goalie_rest_days` 29 / 0.43%, 30 / 0.44%; `team_shots_for_5` +32 / 0.40%, 32 / 0.42%; `team_goals_against_10` 40 / 0.28%, 40 / 0.29%; +`team_goals_for_10` 41 / 0.28%, 41 / 0.28%; `team_goals_for_5` +44 / 0.19%, 45 / 0.19%; `team_goals_against_5` 45 / 0.17%, 44 / 0.19%. +All are well behind the player shot/career block and gpg/hgpg. + +Verdict: **reverted**. Seed 1 is a statistical tie (+0.06pp, p=0.95) and seed +3 is worse (-0.25pp); mean -0.10pp. The team context block adds no +deployment-relevant edge on top of the corrected baseline. No +`--context-features` flag or feature code retained; notes only. + +**Anytime-goal-scorer odds feasibility (no-cost check, no sign-up).** Not +available for free for this archive's era. The Odds API carries NHL player +props including Anytime Goal Scorer (Yes/No) for US books, but historical +player-prop snapshots only start **2023-05-03** and historical access is +**paid**; NHL game-line history starts 2020-06-29. Its free tier is +current/upcoming odds only, so it cannot backfill 2017-2023 and cannot supply +a free historical training set. OddsPortal / Covers expose historical game +odds on public pages (no official free API; player-prop coverage is patchy +and scraping is ToS-constrained); OddsPapi advertises free historical odds +including anytime goalscorer but needs an account and has unverified depth; +SportsGameOdds / BallDontLie / OddsBlaze / RapidOdds offer current props, +usually with paid historical tiers. Practical options: (a) collect current +anytime-goal-scorer snapshots forward via a free-tier odds API, or (b) pay +for a 2023+ player-prop backfill; neither helps the current 2017-2026 +backtest at zero cost. + +### V7-shots — own raw shot-event quality block (reverted) + +Hypothesis: replace MoneyPuck's xG with our own pre-game shot-quality features +built from the raw shot-event archive: distance/angle, high-danger and slot +attempts, rebounds, rushes, PP usage and goals, all prior-games only. The +V7-xG experiment was collinear with V4's volume/TOI block; raw geometry is a +different signal and does not import any external xG column. + +**Data.** MoneyPuck raw shot events, one row per unblocked attempt +(`event in {SHOT, MISS, GOAL}`): 2017-18 .. 2025-26, 1,025,121 attempts and +71,616 goals over 11,268 games. Nine per-season files were fetched from +`moneypuck.com/moneypuck/playerData/shots/shots_{season}.zip` (2025/2026) and +the MoneyPuck mirror `peter-tanner.com/moneypuck/downloads/shots_{season}.zip` +(2017-2024), verified season-by-season from `gameDate` min/max. Cached under +`data/moneypuck/shots/` (gitignored). Season start year = filename year; +`shots_2020` is the COVID 2020-21 season (Jan-Jul 2021). The partial 2026-27 +file was excluded. + +The raw files have no `gameDate`, `situation` or opponent columns. Game date is +mapped from `game_id` via `nhl_game_id = season*1_000_000 + game_id` against +`player_games` (100% of 2017-2025 games mapped); opponent/strength come from +home/away codes and skater counts. Build table: +`data/moneypuck/shots/player_game_shots_full.csv` — **427,402 player-games** +(364,488 with ≥1 attempt, 62,914 zero-attempt skater-games) and 1,940 players. + +**Features** (18, strictly prior games; shift(1) before every window; the +zero-attempt rows stay in the denominators): + +| feature | definition | +|---|---| +| `rs_shot_att_pg_5/10` | mean unblocked attempts per game | +| `rs_hd_att_pg_5/10` | mean attempts with distance < 20 ft and abs(angle) < 30° | +| `rs_slot_att_pg_5/10` | mean attempts with 54 ≤ abs(x) ≤ 89 and abs(y) ≤ 22 (arena-adjusted) | +| `rs_rebound_att_pg_5` | mean `shotRebound == 1` | +| `rs_pp_att_pg_5` | mean own skaters > opponent skaters | +| `rs_goals_pg_5` | mean raw goal flag | +| `rs_mean_distance_5` | attempt-weighted mean distance (ft) | +| `rs_mean_angle_5` | attempt-weighted mean abs angle (deg) | +| `rs_hd_share_5` | sum(HD attempts) / sum(attempts) over prior 5 | +| `rs_sd_shot_att_pg`, `rs_sd_hd_att_pg`, `rs_sd_goals_pg`, `rs_sd_hd_share`, `rs_sd_mean_distance`, `rs_sd_mean_angle` | same rates season-to-date before the row | + +**Leakage / merge checks.** + +- Frame stays **427,240 rows**; no `_x`/`_y` and no duplicate columns. +- Coverage `rs_shot_att_pg_5` **425,349 / 427,240 = 99.56%** (1,891 first + career games are NaN). +- Hand-checked three player-dates against the raw event rows (McDavid + 2017-10-21, Ovechkin 2017-10-17, and player 8448208 2017-11-09 whose prior + five games include attempts `[5, 0, 4, 1, 0]`). All nine rolling values + matched exactly (max abs diff 3.6e-15); e.g. 8448208 `rs_shot_att_pg_5` = + 10/5 = 2.0, proving zero-attempt games count in the denominator. +- Cross-check against the abandoned team files: 2024-25 regular unblocked + attempts 112,126 vs `I_F_shotsOnGoal + I_F_missedShots` 112,222 (-0.09%), + goals 7,891 vs 7,898 (-0.09%). + +**Protocol.** Date-blocked k=5, `--train-subset all`, `OMP_NUM_THREADS=2`, +`LGBM_N_JOBS=2`, `timeout 300`, LGBM config a. Baselines are the corrected V7 +base without the block (`oof_v7_base_lgbm_seed{1,3}.csv`): seed 1 +**928/3159 = 29.376%**, seed 3 **916/3159 = 28.997%**; hgpg **886 = 28.047%** +in both. AUC 0.6933 ± 0.0051 (seed 1), 0.6934 ± 0.0027 (seed 3). + +| model | seed | baseline | + raw shots | delta | McNemar vs base | McNemar vs hgpg | +|---|---|---:|---:|---:|---|---| +| LGBM | 1 | 928 = 29.376% | **924 = 29.250%** | **-0.127pp** | 178-182, p=0.874 | 326-288, p=0.135 | +| LGBM | 3 | 916 = 28.997% | **934 = 29.566%** | **+0.570pp** | 188-170, p=0.369 | 324-276, p=0.055 | +| LGBM mean | | 29.186% | 29.408% | +0.221pp | | | + +Per-fold: seed 1 31.0/28.1/27.0/32.1/28.1 (std 2.148); seed 3 +30.2/27.6/27.5/31.3/31.3 (std 1.883). The ensemble was **not run** because +both LGBM seeds did not improve (the pre-declared condition). + +**Importances** (fold-1 LGBM, seed 1, gain; rank among 60 features): + +| feature | gain | rank | +|---|---:|---:| +| `rs_sd_shot_att_pg` | 413 | 5 | +| `rs_sd_mean_distance` | 373 | 8 | +| `rs_mean_angle_5` | 364 | 9 | +| `rs_sd_mean_angle` | 341 | 12 | +| `rs_mean_distance_5` | 320 | 14 | +| `rs_slot_att_pg_10` | 268 | 18 | +| `rs_sd_hd_share` | 218 | 24 | +| `rs_pp_att_pg_5` | 207 | 26 | +| `rs_hd_share_5` | 206 | 27 | +| `rs_sd_hd_att_pg` | 184 | 28 | +| `rs_shot_att_pg_10` | 178 | 31 | +| `rs_shot_att_pg_5` | 152 | 36 | +| `rs_slot_att_pg_5` | 127 | 39 | +| `rs_sd_goals_pg` | 112 | 41 | +| `rs_hd_att_pg_10` | 94 | 46 | +| `rs_hd_att_pg_5` | 49 | 53 | +| `rs_rebound_att_pg_5` | 36 | 55 | +| `rs_goals_pg_5` | 13 | 59 | + +Geometry features are used heavily (five in the top 14), but the goal/rebound +flags are near the bottom and the pick metric did not follow. + +**Verdict: reverted.** Seed 1 is negative (-0.13pp, p=0.87 vs baseline) and +seed 3 is positive (+0.57pp, p=0.37 vs baseline); this is mixed, not the ++0.5pp-on-both-seeds bar, so the feature block and `--shot-features` flag were +removed and `model.py` is back to the corrected baseline. The per-player +table and raw caches were deleted from disk in `chore/clean-tree` +(owner-approved: data only; blobs in git history at `c82b2e7`). + +### V8-own-xG — our own per-shot expected-goals model (reverted) + +Hypothesis: the external MoneyPuck xG block was collinear with V4's volume +features, but **our own** per-shot model could isolate finishing skill from +shot quality without importing an external model. The label is the raw goal +flag, so this is a first-party model and allowed. + +**Per-shot model.** + +- **1,025,191** unblocked shot events, 2017-18 .. 2025-26; label `goal` + (**71,617** positives, 6.99%). +- Raw features only: `shotDistance`, `abs(shotAngle)`, `shotType` (one-hot), + `shotRebound`, `shotRush`, `homeSkatersOnIce - awaySkatersOnIce`, + `timeSinceLastEvent`, `period`, `shotOnEmptyNet`. No MoneyPuck `xGoal`, + `xFroze`, `xRebound`, `xShotWasOnGoal`, `shotGoalProbability` or any other + model output is read. +- **Fold assignment:** `model.fold_blocks` replicated exactly and verified + equal for seeds 1 and 3. Five shuffled date blocks over the **1,053** + challenge dates. For each fold F the classifier trains on every shot whose + date is **not** in F and predicts the shots in F; an assertion checks the + train/test date sets are disjoint. The 886 non-challenge dates get their own + five date blocks, trained only on non-challenge dates, so all 1,025,191 + shots have out-of-fold xG. +- OOF per-shot **AUC 0.7692 / logloss 0.2193** (seed 1) and **0.7691 / + 0.2194** (seed 3). Sum xG 71,941 vs 71,617 goals (mean 0.0702 per shot). + Per-shot files: `data/moneypuck/shots/shot_xg_seed{1,3}.csv`. + +**Player-game features** (aggregate `xg_sum`, `xg_per_attempt`, +`goals_minus_xg`, then shift(1) per player before every window): + +| feature | definition | +|---|---| +| `rs_xg_pg_5/10` | mean xG per game, prior 5 / 10 | +| `rs_xg_per_att_5/10` | sum(prior xG) / sum(prior attempts) | +| `rs_finishing_5/10` | sum(goals - xG) over prior 5 / 10 | +| `rs_xg_trend` | `rs_xg_pg_5` / season-to-date prior xG per game | + +Zero-attempt games stay in the grid: 0 xG, 0 attempts, 1 game played. + +**Merge / leakage checks.** + +- Shot grid 427,402 player-games; 425,462 have own-xG features (first career + games NaN). Model frame stays **427,240 rows**; no duplicate + `(date, player_id)`, no `_x`/`_y` columns. +- `fold_blocks` output for seeds 1/3 is byte-identical to `model.fold_blocks`. +- Fold assertions passed: no fold's model trained on any of its fold dates. +- Perturbing the target row's own game xG to 9999 left that row's + `rs_xg_pg_5` unchanged (0.27368485103188367 before and after), proving the + current game never enters its own rolling features. + +**Protocol.** LGBM config a, date-blocked k=5, `--train-subset all`, +`OMP_NUM_THREADS=2`, `LGBM_N_JOBS=2`, `timeout 300`. Baselines are the +corrected V7 base (`oof_v7_base_lgbm_seed{1,3}.csv`): seed 1 **928/3159 = +29.376%**, seed 3 **916/3159 = 28.997%**; hgpg **886 = 28.047%**. + +| model | seed | baseline | + own-xG | delta | McNemar vs base | McNemar vs hgpg | AUC | +|---|---|---:|---:|---:|---|---|---:| +| LGBM | 1 | 928 = 29.376% | **923 = 29.218%** | **-0.158pp** | 158-163, p=0.823 | 338-301, p=0.154 | 0.6921 ± 0.0050 | +| LGBM | 3 | 916 = 28.997% | **905 = 28.648%** | **-0.349pp** | 147-158, p=0.567 | 313-294, p=0.465 | 0.6924 ± 0.0014 | +| LGBM mean | | 29.186% | 28.933% | -0.254pp | | | | + +Per-fold: seed 1 33.3/28.0/26.5/31.1/27.1 (std 2.897); seed 3 +31.3/28.0/28.8/27.6/27.6 (std 1.543). The ensemble was not run because both +LGBM seeds did not improve. + +**Importances** (fold-1 LGBM, seed 1, gain rank among 49 features): + +| feature | gain | rank | +|---|---:|---:| +| `rs_xg_pg_10` | 439 | 4 | +| `rs_xg_trend` | 419 | 9 | +| `rs_xg_per_att_10` | 395 | 13 | +| `rs_xg_per_att_5` | 374 | 14 | +| `rs_finishing_5` | 330 | 19 | +| `rs_finishing_10` | 293 | 20 | +| `rs_xg_pg_5` | 289 | 21 | + +All seven features land in the top 21 and the per-shot model is well +calibrated (AUC 0.769), but the block still reduces pick accuracy — the signal +is either already carried by V4/V6 features or the rolling xG is too noisy at +the player-game grain. + +**Verdict: reverted.** Both seeds are negative (-0.16pp, -0.35pp) and both +McNemar tests are non-significant (p=0.82/0.57 vs the same-seed baseline). +The `own_xg.py` builder and `--own-xg-features` flag were removed; the +per-shot xG files and player-game feature tables under `data/moneypuck/shots/` +were deleted in `chore/clean-tree` (owner-approved data deletion; blobs in +git history / regenerable per the V8-own-xG recipe). + +### V8-shrinkage — empirical-Bayes rate features (reverted) + +Eight prior-only features on the corrected 42-feature set: +`shrunk_gpg_{5,15,40}` (career goals/games shrunk to the prior league mean), +`shrunk_season_gpg_{5,15}` (season rate shrunk to `hgpg`), +`shrunk_five_gpg_{3,10}` (last-5 goals shrunk to the season rate), and +`shrunk_sh_pct_50` (career shooting shrunk to the prior league shooting rate). +League means are cumulative through the previous date; all player counts are +prefix sums excluding the current row. + +Leakage/merge checks: 427,240 rows, no duplicate `(date, player_id)`, no +suffix columns; manual recomputation matched for five sampled players on +`shrunk_gpg_5`/`shrunk_season_gpg_5`/`shrunk_five_gpg_3`/`shrunk_sh_pct_50`. +Nulls: gpg/shot features 144 (first date), season blends 97,668, five-game +blends 8,355. + +LGBM, k=5, train=all, seeds 1/3, 300s cap (112s/117s): + +| seed | baseline hits/acc | shrinkage hits/acc | delta | vs baseline | vs hgpg | +|---|---:|---:|---:|---|---| +| 1 | 928 / 29.376% | 907 / 28.712% | **-0.665pp** | 128-149, p=0.229 | 320-299, p=0.422 | +| 3 | 916 / 28.997% | 899 / 28.458% | **-0.538pp** | 124-141, p=0.326 | 306-293, p=0.624 | + +Per-fold std: seed 1 3.272, seed 3 1.651. Both seeds got worse, so the code +was reverted (feature set back to 42). LGBM gain ranks were high — +`shrunk_gpg_40` #1 (179,958; perm 0.0079), `shrunk_gpg_15` #2 (75,879; 0.0011), +`shrunk_gpg_5` #9, `shrunk_season_gpg_15` #15, `shrunk_sh_pct_50` #17, +`shrunk_season_gpg_5` #28, `shrunk_five_gpg_10` #29, `shrunk_five_gpg_3` #30 — +but the signal is redundant with the existing rates and hurt pick accuracy. + +### V8-tune — LGBM hyperparameter sweep (reverted) + +Config d = 600 trees / lr 0.015 / 31 leaves / min_child_samples 30 / +reg_lambda 2; config b = 600 / 0.02 / 15 / reg5. Seed 1/3, k=5, train=all, +300s cap (105-123s each; b finally completed — its earlier timeouts were CPU +contention). Reference is config a (400/0.03/31). + +| config | seed 1 | seed 3 | delta vs a | McNemar vs a | per-fold std | +|---|---:|---:|---:|---|---| +| a | 928 / 29.376% | 916 / 28.997% | — | — | 2.351 / 1.315 | +| b | 934 / 29.566% | 915 / 28.965% | +0.190 / -0.032pp | 131-125 p=0.755; 129-130 p=1.0 | 2.790 / 0.750 | +| d | 926 / 29.313% | 922 / 29.186% | -0.063 / +0.190pp | 105-107 p=0.945; 106-100 p=0.728 | 2.916 / 0.428 | + +Verdict: neither config beats a on **both** seeds by +0.5pp; each is mixed +(b/d win one seed by ~0.19pp and lose the other). Defaults unchanged +(config a; ensemble default). Config d was reverted, notes only. + +### V9-projected-lineups — prior-games lineup projector (reverted) + +Stage-1 module: `smartscore/scripts/backtrack/lineup_project.py` (deleted in +`chore/clean-tree`; blob at `c82b2e7`) writes +`data/ml/projected_lineups.csv` (427,240 rows) in 15.9s, with no `model.py` +change. It emits methods a/b/c plus per-method confidence columns. + +Projector uses only games before the target date: (a) last prior unit, +(b) exponentially weighted mode over the last 10 games, (c) team-constrained +greedy assignment into F1-F4 / D1-D3 / PP1-PP2 slots. Model features use (c) +plus confidence (share of last 5 at the projected unit) and linemate quality +(mean prior gpg/ppg of line/PP mates, line_intact). Candidate players per +team-date are the archive's dressed roster; a live run would use the projected +roster, but no current-game unit label enters any feature. + +Projection match vs ACTUAL units (rows with actual non-null): + +| position | method a | method b | method c | +|---|---:|---:|---:| +| Forwards, unit | 58.11% | 59.63% | 59.44% | +| Defence, unit | 61.03% | 63.52% | 63.41% | +| PP unit | 67.04% | 76.43% | 70.98% | + +By season (method c): F 59.4 / 60.6 / 58.6 / 56.0 / 58.3 / 59.7 / 60.8 / +60.5 / 60.0%; D 63.7 / 61.7 / 61.9 / 63.3 / 63.6 / 62.6 / 63.4 / 65.4 / 65.0%; +PP 66.3 / 69.1 / 69.1 / 66.7 / 69.6 / 74.0 / 74.2 / 74.5 / 74.0% for +2017-18 through 2025-26. Method b was best overall (F 59.63, D 63.52, +PP 76.43). + +Model results (k=5, train=all; baselines no-lineup LGBM 29.376/28.997, +ensemble 29.915/29.408/29.820): + +| run | seed | hits / 3159 | acc | delta | McNemar vs baseline | per-fold std | +|---|---:|---:|---:|---:|---|---:| +| LGBM projected | 1 | 916 | 28.997% | -0.380 | 176-164, p=0.551 | 3.354 | +| LGBM projected | 3 | 908 | 28.743% | -0.253 | 167-159, p=0.698 | 1.362 | +| LGBM oracle | 1 | 967 | 30.611% | +1.235 | 178-217, p=0.056 | 3.298 | +| LGBM oracle | 3 | 947 | 29.978% | +0.981 | 163-194, p=0.112 | 0.532 | +| ensemble projected | 0 | 931 | 29.471% | -0.444 | 171-156, p=0.439 | 2.044 | +| ensemble projected | 1 | 920 | 29.123% | -0.285 | 169-160, p=0.659 | 3.219 | +| ensemble projected | 3 | 918 | 29.060% | -0.760 | 167-146, p=0.258 | 1.155 | + +(OOF re-picks for the ensemble differ by 1-2 ties from the logged totals.) +Projected lineups hurt every model/seed; the oracle shows the information is +worth ~+1.0 to +1.2pp, but projection accuracy (~60% line, ~71% PP for method +c) is too low. Reverted; feature set back to 42, notes only. + +**Stage 2 — method b re-evaluation.** Used method b (best: F 59.63%, PP +76.43%) plus `proj_line_conf`, `proj_pp_conf`, prior-only linemate means and +`line_intact`. Merge checks: 427,240 rows, no duplicate/suffixed columns; +nulls: line unit/conf 1,902, PP unit/conf 75,491, linemate means 17,040, +PP-mate mean 80,090, line_intact 0. All inputs are prior games only. + +| variant | seed 1 | seed 3 | +|---|---:|---:| +| no-lineup LGBM | 928 / 29.376% | 916 / 28.997% | +| projected method b | **959 / 30.358%** | 908 / 28.743% | +| projected delta | **+0.981pp** | -0.253pp | +| projected McNemar | 163-132, p=0.081 | 155-163, p=0.695 | +| projected per-fold std | 3.055 | 1.160 | +| oracle (actual units) | 967 / 30.611% | 947 / 29.978% | +| oracle delta | +1.235pp | +0.981pp | +| oracle McNemar | 217-178, p=0.056 | 194-163, p=0.112 | + +Projected feature importances (fold-1 LGBM gain rank/50; permutation AUC): +`proj_lineup_unit_b` #2 (145,540; 0.0118), `proj_pp_unit_b` #12 (5,827; +0.0017), `proj_pp_conf` #13 (5,719; 0.0007), `pp_unit_prior_ppg_mean` #14 +(5,416; 0.0016), `linemate_prior_gpg_mean` #20 (4,168; 0.0006), +`linemate_prior_ppg_mean` #25 (3,124; -0.0008), `proj_line_conf` #40 (967; +0.0003), `line_intact` #45 (270; -0.0002). + +Verdict: **mixed, not promoted**. Method b reaches 30.36% on seed 1 +(+0.98pp, p=0.081) but loses 0.25pp on seed 3; the oracle confirms lineup +information is worth ~+1.0 to +1.2pp, but projection quality is not reliable +enough. `--lineup projected` is retained as an opt-in; default remains +`--lineup none` and the rank ensemble. + +**Stage 3 — probabilistic lineups.** Prior-only decayed shares over the last +10 games for F1-F4, D1-D3 and PP1-PP2, plus expected line quality, expected +linemate gpg/ppg and PP expected ppg. No hard labels; all from prior games. + +Trio-continuity projector (most common prior trios/pairs over the last 10, +then method b for unassigned): **F 48.66%, D 55.56%** (coverage 81.0%/85.5%), +which does **not** beat method b (59.6%/63.5%). + +| variant | seed 1 | seed 3 | +|---|---:|---:| +| no-lineup LGBM | 928 / 29.376% | 916 / 28.997% | +| hard projected method b | 959 / 30.358% | 908 / 28.743% | +| probabilistic | 915 / 28.965% | 916 / 28.997% | +| probabilistic delta | **-0.412pp** | **0.000pp** | +| probabilistic McNemar | 172-185, p=0.525 | 169-169, p=1.0 | +| probabilistic per-fold std | 2.656 | 1.140 | +| oracle (actual units) | 967 / 30.611% | 947 / 29.978% | + +Probabilistic feature importances (fold-1 LGBM gain rank/55; permutation AUC): +`expected_line_quality` #2 (33,808; 0.0028), `f1_prob` #3 (26,850; 0.0011), +`d3_prob` #6 (12,934; -0.0019), `f2_prob` #8 (11,279; 0.0009), `pp1_prob` #10 +(10,283; 0.0036), `pp_unit_expected_ppg` #12 (9,461; -0.0008), +`expected_linemate_gpg` #21, `expected_linemate_ppg` #24, `f3_prob` #26, +`f4_prob` #28, `pp2_prob` #29, `d2_prob` #31, `d1_prob` #46. + +Verdict: **reverted**. Probabilistic features lose 0.41pp on seed 1 and tie +seed 3; the condition to run the ensemble was not met. The projector functions +remain deleted in `chore/clean-tree` (blob at `c82b2e7`); `model.py` keeps the stage-2 +`--lineup projected` opt-in only and defaults to no lineup. + +**Stage 4 — rank ensemble with lineup features.** Built the fixed equal-weight +rank ensemble from component OOFs (HGB+logreg run + the stage-2 projected/oracle +LGBM OOFs; the end-to-end 3-model run hit the 300s cap at fold 5). Baselines: +no-lineup ensemble 29.408% (seed 1) and 29.820% (seed 3). + +| variant | seed 1 | seed 3 | +|---|---:|---:| +| no-lineup ensemble | 929 / 29.408% | 942 / 29.820% | +| projected ensemble | 943 / 29.851% | 935 / 29.598% | +| projected delta | **+0.443pp** | **-0.222pp** | +| projected per-fold std | 3.186 | 0.667 | +| projected McNemar vs no-lineup | 165-151, p=0.465 | 162-168, p=0.783 | +| projected McNemar vs hgpg | 342-285, p=0.025 | 323-274, p=0.049 | +| oracle ensemble | 924 / 29.250% | 954 / 30.199% | +| oracle delta | -0.158pp | +0.379pp | +| oracle per-fold std | 3.171 | 0.805 | +| oracle McNemar vs hgpg | 328-290, p=0.137 | 331-263, p=0.006 | + +Projected ensemble mean over seeds 1/3 = 29.72%, same as the no-lineup 29.71% +mean; it does not reach 30.0% on both seeds and is not better on both. **Default +stays `--lineup none`.** Oracle mean is also 29.72% (29.25/30.20), showing the +crude projector is not the only limiter; real morning projections should sit +between the crude projector and the oracle, but that is not verifiable here. + +**Stage 5 — final numbers.** Oracle LGBM seed 2 = **960/3159 = 30.389%** +(123s). Four-seed oracle mean: **30.334% ± 0.263** (30.358 / 30.611 / 30.389 / +29.978 for seeds 0/1/2/3). + +End-to-end projected ensemble seed 1 with `timeout 600` completed in **328s**: +**944/3159 = 29.883%**, +0.475pp vs the 29.408% no-lineup ensemble; McNemar +vs no-lineup 166-151, p=0.432; vs hgpg 343-285, p=0.023. Projected ensemble +across available seeds: 29.883 (seed 1 end-to-end) and 29.598 (seed 3), +mean **29.74%**. Not a clear win on the same seed (p=0.43), so the default +stays `--lineup none`. Deployment estimate with real morning projections: +roughly **29.7-30.3%**, between the crude projected ensemble and oracle. + +### V10 — real projected lineups are not archived + +Inventory of `Player-Snapshots-prod` (Supabase, 2026-10-20): 143,935 total +rows; `lineup_status` non-null on 5,155 rows, **all `UNKNOWN`**, covering +17 dates (2026-10-04 .. 2026-10-20) and 745 players. Counts for +`PROJECTED` / `CONFIRMED` / `ACTUAL` are **0**; `lineup_unit` non-null **0** +and `pp_unit` non-null **0**. Mongo prod `players.SmartScore` (139,731 docs) +agrees: 138,949 null status, 782 `UNKNOWN`, **0 PROJECTED**, 0 non-null units; +dev is the same pattern. + +Real projection accuracy therefore has **n=0**: no archived PROJECTED rows and +no overlap with backtrack actual lineups (backtrack ends 2026-06-14; the +UNKNOWN prod rows start 2026-10-04). The live simulation cannot run — fewer +than 300 projected picks, in fact zero — so no match-rate, delta or McNemar +numbers exist. Our prior-game projector cannot be scored on those dates +either. The owner’s projection feed is live-only; forward-collect PROJECTED +rows with units before V10 can be evaluated. V9’s “unverifiable historically” +caveat stands. + +### V11 — projection-fidelity sensitivity curve + +Mixed lineup labels per row: actual with probability q, else method-b +projected; lineup-aware LGBM trained and evaluated at the same q, k=5, +train=all. Fidelity is the realized mixed-label match vs actual on the +challenge rows. + +| input | unit fidelity | PP fidelity | seed 1 | seed 3 | +|---|---:|---:|---:|---:| +| no-lineup | — | — | 29.376% | 28.997% | +| V9 stage-2 projected features | ~59.6% | ~76.4% | 30.358% | 28.743% | +| V11 q=0 (mixed-cat) | 61.6% | 80.8% | 28.965% | 28.490% | +| V11 q=0.5 | 81.0% | 90.3% | 29.250% | 28.933% | +| V11 q=0.75 | 90.3% | 95.2% | 29.535% | 29.376% | +| oracle q=1 | 100% | 100% | 30.611% | 29.978% | + +Per-fold std: q=0 2.551/1.622; q=0.5 1.957/1.049; q=0.75 2.254/0.960; +oracle 3.298/0.532. The V9 stage-2 projected row uses projected features +(confidence/linemate) and is not directly comparable to the mixed-categorical +curve; it is included because it is the known ~60% reference. + +No mixed fidelity reaches **30.0% on both seeds**: the oracle itself is +**29.978%** on seed 3, just under 30, and the best sub-oracle point (q=0.75) +is 29.535/29.376. Seed 1 crosses 30 only at q=1. Real morning projections +likely sit at ~80-90% unit fidelity, implying roughly **29.25-29.54%** on +seeds 1/3 — below 30 unless the feed is essentially oracle-accurate or the +model improves. + +### V12 — player/team identity + diagnostics (rejected) + +Added `player_id` and `team_abbrev` as regularised LGBM categoricals +(config e: min_data_per_group 200, cat_smooth 50, max_cat_threshold 32), plus +age and age² from NHL landing birthdates (1,891/1,891 cached) and prior career +games (`career_games`, already in the 42-feature set). + +| variant | seed 1 | seed 3 | +|---|---:|---:| +| no-lineup baseline | 928 / 29.376% | 916 / 28.997% | +| identity | 881 / 27.889% | 907 / 28.712% | +| delta | **-1.487pp** | **-0.285pp** | +| McNemar | 270-317, p=0.058 | 273-282, p=0.734 | +| per-fold std | 1.573 | 1.327 | + +Identity importances (fold-1 gain rank/46; permutation AUC): `player_id` #2 +(174,496; 0.0246), `team_abbrev` #10 (7,669; 0.0008), `career_games` #17 +(3,241; -0.0003), `age` #21 (2,538; 0.0028), `age_sq` #40 (504; 0.0002). +`player_id` is heavily used but hurts out-of-fold picks; reverted. + +**Diagnostics (baseline no-lineup LGBM, seeds 1+3):** +- Per tims group: g1 39.89% (420/1053), g2 27.16% (286/1053), g3 20.89% + (220/1053). +- Per season: 2021-22 27.64% (492), 2022-23 28.53% (666), 2023-24 28.88% + (696), 2024-25 29.91% (672), 2025-26 31.28% (633). +- Calibration: mean max predicted probability **0.3154** vs realized + accuracy **29.31%** (overconfident ~2.2pp); by group maxp/acc g1 + 0.4377/39.89%, g2 0.2960/27.16%, g3 0.2123/20.89%. +- Top pick equals the hgpg leader in **1,531/3,159 = 48.5%** of groups + (g1 46.9%, g2 45.2%, g3 53.3%). + +### V12-era — recent-era deployment backtest (full-era kept) + +Added `--test-start` and `--min-season`; training restricted to seasons +2021-22+. Two windows, LGBM and default ensemble, challenge picks only. + +| window | model | recent-era | full-era seed 1 | full-era seed 3 | hgpg | gpg | +|---|---|---:|---:|---:|---:|---:| +| train <2024-08-01, test 2024-25+25-26 (n=1305, 435 dates) | LGBM | 388 / 29.732% | 406 / 31.111% | 398 / 30.498% | 396 / 30.345% | 376 / 28.812% | +| same | ensemble | 395 / 30.268% | 391 / 29.962% | 403 / 30.881% | 396 / 30.345% | 376 / 28.812% | +| train <2025-08-01, test 2025-26 (n=633, 211 dates) | LGBM | 195 / 30.806% | 200 / 31.596% | 202 / 31.912% | 192 / 30.332% | 179 / 28.278% | +| same | ensemble | 200 / 31.596% | 191 / 30.174% | 208 / 32.859% | 192 / 30.332% | 179 / 28.278% | + +Against the mean full-era k-fold on identical dates: A LGBM -1.07pp, +A ensemble -0.15pp; B LGBM -0.95pp, B ensemble +0.08pp. No model beats the +full-era benchmark by >= +0.5pp consistently, so **full-era training remains +the recommended default**; the flags are retained for future backtests. + +Recent-era per-season: A LGBM 28.87/30.65 (2024-25/2025-26), A ensemble +28.87/31.75; B both only 2025-26 (LGBM 30.81, ensemble 31.60). +Per tims group: A LGBM 37.01/30.11/22.07, A ensemble 36.78/31.72/22.30; +B LGBM 32.23/31.75/28.44, B ensemble 34.60/30.81/29.38. +### V12-qoc — quality of competition/teammates from shift charts (reverted) + +Hypothesis: the existing player rates ignore who a player skated against and +with. The raw shift charts can produce prior-game QoC/QoT and, if zone starts +existed, usage context. + +**Data.** `shifts` in `data/raw_nhl.sqlite`: 9,125,547 shift rows, 2017-18 .. +2025-26, one row per player-period shift (`start_time`/`end_time`). Joined to +`player_games` for club/position/date; goalies excluded. For each game and +period the shifts were rasterised to a player × second on-ice matrix, giving +overlap seconds for every player pair. + +**Zone starts are not available.** The raw store has no play-by-play/faceoff +event table and no zone-start column in `shifts` or the boxscore JSON, so +`ozs_pct` was skipped. + +**Per-game metrics** (rate = prior-season goals/60 or points/60 from +`player_games`; rookies/no prior season → NaN): + +| metric | definition | +|---|---| +| `qoc_g60`, `qoc_p60` | overlap-weighted mean of opponents' prior-season goals/60, points/60 | +| `qot_g60`, `qot_p60` | same for teammates (self excluded) | +| `*_rel` | subtract the team-game minutes-weighted mean (team-relative) | + +That is 8 per-game metrics. Every model feature is shifted one row per player: +`r5_*`, `r10_*` and `sd_*` (season-to-date prior mean over valid games), 24 +columns total. + +**Checks.** 425,176 player-games in the QoC cache; merge keeps the frame at +**427,240 rows**, no `_x`/`_y`, no duplicate keys. `r5_qoc_g60` is non-null on +374,516 rows (87.7%; 2017-18 has no prior-season rates). Three player-games +were recomputed from raw shifts and prior-season totals and matched exactly +(e.g. 8479981 2021-12-28 1.903186 vs 1.903186; 8478403 2023-04-27 0.520029; +8480835 2023-03-14 0.121633). A rolling check matched the prior-5 mean to +1e-16, and setting the target game's QoC to 9999 left its `r5_qoc_g60` +unchanged. + +**Protocol.** LGBM config a, date-blocked k=5, `--train-subset all`, +`OMP_NUM_THREADS=2`, `LGBM_N_JOBS=2`, `timeout 300`. Baselines are the corrected +V7 base (`oof_v7_base_lgbm_seed{1,3}.csv`): seed 1 **928/3159 = 29.376%**, +seed 3 **916/3159 = 28.997%**; hgpg **886 = 28.047%**. + +| model | seed | baseline | + QoC/QoT | delta | McNemar vs base | McNemar vs hgpg | AUC | +|---|---|---:|---:|---:|---|---|---:| +| LGBM | 1 | 928 = 29.376% | **944 = 29.883%** | **+0.507pp** | 176-160, p=0.413 | 348-290, p=0.024 | 0.6931 ± 0.0049 | +| LGBM | 3 | 916 = 28.997% | **917 = 29.028%** | **+0.032pp** | 167-166, p=1.000 | 318-287, p=0.223 | 0.6928 ± 0.0019 | +| LGBM mean | | 29.186% | 29.455% | +0.269pp | | | | + +Per-fold: seed 1 33.6/27.2/25.3/33.2/30.2 (std 3.663); seed 3 +30.2/28.4/28.6/29.0/28.9 (std 0.684). The ensemble was not run because both +LGBM seeds did not clear +0.5pp. + +**Importances** (fold-1 LGBM, seed 1, gain rank among 66 features): + +| feature | gain | rank | +|---|---:|---:| +| `r5_qot_p60_rel` | 302 | 10 | +| `r5_qot_p60` | 225 | 17 | +| `r10_qot_g60_rel` | 221 | 18 | +| `sd_qoc_g60_rel` | 218 | 19 | +| `r5_qoc_g60_rel` | 217 | 20 | +| `r10_qot_p60` | 214 | 21 | +| `sd_qoc_g60` | 210 | 22 | +| `r5_qoc_g60` | 206 | 23 | + +The teammate-relative block is used most, but seed 3's gain is only +0.03pp +and its per-fold spread collapses to 0.684. + +**Verdict: reverted.** Seed 1 clears +0.5pp by 0.007pp (p=0.41 vs baseline), +seed 3 is flat (+0.03pp, p=1.0), so the both-seeds rule fails. The `qoc.py` +builder and `--qoc-features` flag were removed; the QoC cache in +`data/moneypuck/qoc_player_game.csv` was deleted in `chore/clean-tree`. + +### V12-interactions — explicit tims-group interactions (reverted) + +Added nine numeric interactions: `tims` (1/2/3; 0 for non-challenge) times +gpg, hgpg, five_gpg, ppg, rank_gpg, rank_hgpg, games_since_goal, +days_since_game, club_rest_days. Verified 427,240 rows, no duplicate/suffixed +columns, all inputs pre-game. + +| seed | baseline | interactions | delta | McNemar vs base | vs hgpg | per-fold std | +|---|---:|---:|---:|---|---:|---:| +| 1 | 928 / 29.376% | 931 / 29.471% | +0.095pp | 138-135, p=0.904 | 337-292, p=0.079 | 2.784 | +| 3 | 916 / 28.997% | 916 / 28.997% | 0.000pp | 140-140, p=1.0 | 326-296, p=0.245 | 0.736 | + +Per-group (combined seeds): baseline g1 39.89 / g2 27.16 / g3 20.89; +interactions g1 39.98 / g2 27.40 / g3 20.32 — **group 3 got worse by 0.57pp**. +Interaction importances were low (fold-1 gain rank/51: tims_x_rank_hgpg #29, +tims_x_rank_gpg #33, tims_x_hgpg #34, tims_x_gpg #36, tims_x_ppg #40, +tims_x_games_since_goal #43, tims_x_days_since_game #45, +tims_x_club_rest_days #47, tims_x_five_gpg #50). + +Verdict: **reverted**. No overall +0.5pp on both seeds and the group-3 rule +failed; `--interactions` code removed. + +### V14 — Tims-era re-evaluation and pre-2017 feasibility + +**True Tims start:** earliest date with `tims in {1,2,3}` is **2021-12-09**, +not 2023. There are **243 pre-2023 challenge dates** (729 picks); the owner’s +2023 claim is wrong. Challenge dates/picks by season: + +| season | dates | picks | +|---|---:|---:| +| 2021-22 | 164 | 492 | +| 2022-23 | 222 | 666 | +| 2023-24 | 232 | 696 | +| 2024-25 | 224 | 672 | +| 2025-26 | 211 | 633 | +| **total** | **1,053** | **3,159** | + +**All Tims-era challenge dates (n=3,159):** no-lineup ensemble seeds 0/1/3 = +**29.946 / 29.408 / 29.788%**, mean **29.714%**; LGBM seeds 0/1/3 = +29.060 / 29.376 / 28.997%, mean **29.144%**; hgpg **28.047%**; gpg **26.496%**. +**Strict 2023-24+ (n=2,001, 667 dates):** ensemble **29.868%** mean +(29.735 / 29.835 / 30.035), LGBM **29.835%** mean (29.685 / 30.285 / 29.535), +hgpg 28.136%, gpg 27.086%. The owner-facing Tims-era headline is therefore +**~29.7% all challenge dates, ~29.9% strict 2023+** — below 30%. + +| season | ensemble mean | LGBM mean | hgpg | gpg | +|---|---:|---:|---:|---:| +| 2021-22 | 28.32% | 27.24% | 24.80% | 22.97% | +| 2022-23 | 30.28% | 28.48% | 30.18% | 27.33% | +| 2023-24 | 29.17% | 28.54% | 23.99% | 23.85% | +| 2024-25 | 29.41% | 29.86% | 30.36% | 29.32% | +| 2025-26 | 31.12% | 31.23% | 30.33% | 28.28% | + +**Training strategy on identical 2023-24+ dates** (LGBM seed 1, k=5 over the +667 test dates): all seasons **614/2001 = 30.685%** vs train-2023+ only +**590/2001 = 29.485%**; all seasons +1.200pp, McNemar 159-135, p=0.180. +Full-era training wins; keep it. + +**Pre-2017 feasibility (investigation only, no scrape):** the endpoints serve +older seasons — one 2013-14 game log returned 78 games, `schedule/2013-10-01` +returned a 7-day window, and shiftcharts for game 2013021223 returned 730 rows. +Per season the pipeline would use `local_store.py --build/--derive/--lineups/ +--feeds/--publish` (or `reconstruct.py --season --write`) plus +`dump_store.py --export --season`. Four seasons (2013-14..2016-17) are roughly +190k extra player-games (+45% over 427k), ~0.7GB cache + ~0.7GB raw DB, and +~10k requests — about 1-2h at the 0.34s throttle plus parsing. They carry +`scored` labels and all feature inputs, but **no Tims groups before 2021-12** +(tims=0), so they can only augment pointwise training, not challenge +evaluation; era/style drift makes the expected value uncertain. + +### V14b — pre-2017 runbook + +Full copy-paste runbook: `docs/backtrack_pre2017_runbook.md` — deleted in +`chore/clean-tree`; blob at `c82b2e7` (commands preserved below). Entry points were +verified with `--help`; one 2013-14 game log, schedule window, and shiftchart +call returned data. Per season: + +```bash +export ENV=dev +for SEASON in 20132014 20142015 20152016 20162017; do + uv run python smartscore/scripts/backtrack/local_store.py --build "$SEASON" + uv run python smartscore/scripts/backtrack/local_store.py --derive "$SEASON" + uv run python smartscore/scripts/backtrack/local_store.py --lineups "$SEASON" + uv run python smartscore/scripts/backtrack/local_store.py --feeds "$SEASON" + uv run python smartscore/scripts/backtrack/local_store.py --publish "$SEASON" + uv run python smartscore/scripts/backtrack/local_store.py --publish-team "$SEASON" + uv run python smartscore/scripts/backtrack/local_store.py --publish-goalies "$SEASON" + uv run python smartscore/scripts/backtrack/dump_store.py --export --season "$SEASON" +done +``` + +Expect ~55k player-games, ~13 MB dump, ~0.18 GB cache + ~0.18 GB raw DB per +season, and 30-45 min/season (2-3h total). Verification SQL (row counts, date +range, `scored` sanity, feature-null rates, join integrity) and the model +refresh/evaluation commands are in the runbook. Blocker: pre-2021 rows have +**no Tims groups** (`tims=0`), so they are pointwise training rows only; verify +`pre-2021 rows with tims group = 0` and keep `rows in tims groups = 92,440`. + +### V15 — augmented pre-2017 training (not adopted) + +`Player-Snapshots-backtrack-dev` now has **617,310 rows** (427,240 + 190,070 +published 2013-17 skaters), dates **2013-10-01 .. 2026-06-14**; team cache +34,300 and goalie cache 36,696 rows. Total scored rows **617,310**; per-fold +train size **567,430–572,421** (mean **570,391**). + +`--refresh` failed on `Player-Snapshots-backtrack-dev` with PostgREST +`57014 canceling statement due to statement timeout` after **254s** (ordered +offset pagination at 617k rows). Cache was refreshed with date-windowed REST +queries instead. **Follow-up:** fix `fetch_table` pagination (keyset pagination +or per-season/date windows) rather than increasing the statement timeout. + +Augmented LGBM: seed 1 **931/3159 = 29.471%** (+0.095pp vs `oof_v6_baseline` +29.376%); seed 3 **929/3159 = 29.408%** (+0.412pp vs 28.997%); mean +0.253pp, +neither McNemar significant (p=0.91 / 0.52). + +Augmented ensemble (end-to-end, timeout 420): seed 0 **933/3159 = 29.535%** +(−0.380pp vs 29.915%); seed 3 **935/3159 = 29.598%** (−0.222pp vs 29.820%). +Both lower overall, so seed 1 was not run. + +Restricted metrics (complete component-OOF reconstruction; ±1–3 picks vs the +end-to-end runs): +- seed 0: 2023-24+ **608/2001 = 30.385%** (+0.650pp vs pre 29.735%); 2025-26 + **200/633 = 31.596%** (+1.264pp vs 30.332%). +- seed 3: 2023-24+ **598/2001 = 29.885%** (−0.150pp vs 30.035%); 2025-26 + **195/633 = 30.806%** (−2.054pp vs 32.859%). + +Verdict: **do not adopt** the augmented training set for the ensemble; overall +accuracy is slightly worse and the recent-era seed-0 gain is not consistent +across seeds. Keep the 2017+ training default. + +### V15b — pre-2017 dumps + refresh pagination fix + +Committed the four store dumps (`9c9f315`): + +| dump | bytes | +|---|---:| +| 20132014.sql.gz | 11,913,769 | +| 20142015.sql.gz | 11,932,704 | +| 20152016.sql.gz | 11,957,819 | +| 20162017.sql.gz | 11,855,755 | + +Plain git (no LFS; `.gitattributes` only sets the gzip diff driver, matching +the existing 2017-2021 dumps). + +`fetch_table` refresh now fetches **monthly date windows** via +`_month_windows` + `_fetch_window` instead of one 617k-row ordered range, +which tripped PostgREST `57014 statement timeout`. 153 windows cover +2013-10-01..2026-06-14. Verification on the 2016-10-01..2016-11-01 player +window: **4,680 rows in 1.72s**, columns identical to cache, key diff 0/0. +CSV format is unchanged; model behavior is unchanged. Full refresh was not +rerun (the chunked cache already has 617,310 rows). + +### V16- collect: projected-lineup persistence + +Shipped `smartscore/scripts/backtrack/snapshot_projected.py` (worktree +`SmartScore-backtrack`, branch `backtrack-recon`): a standalone collector that +reads the two public pre-game lineup sources the live pipeline reads (NHL.com's +daily lineup-projections article and RotoWire), matches both onto that date's +NHL schedule, resolves every player to an NHL id via `roster/{team}/current`, +and writes `Player-Snapshots-{ENV}` rows with +`lineup_status='PROJECTED'`, `lineup_unit` (F1-F4 **and** D1-D3; the live +product's merge nulls defence), `lineup_position_group` and `pp_unit` +(normalized to PP1/PP2; the pipeline persists RotoWire's verbatim +"POWER PLAY #1/#2" - both vocabularies now exist side-by-side in prod). + +Writes are idempotent on the `(date, player_id)` PK, in two modes: + +- `append` - inserts only pairs not yet stored (`Prefer: resolution=ignore-duplicates`); an existing row is never merged or overwritten. +- `refresh` - PATCHes **only the four lineup columns** on stored rows whose + `lineup_status` is null or `UNKNOWN` (i.e. a source failure stamp). Rows with + PROJECTED/CONFIRMED/ACTUAL are never touched, and no stats/scored column is ever in the batch. + +Safety gates: the article `datePublished` must equal the requested game date +(ET) or writes are refused (prevents filing yesterday's lineups under today, +and makes the pre-publish morning runs collect nothing instead of wrong data); +`--env prod` is explicit; `--limit` and `--dry-run` are available. + +**Audited state (independent leakage/number audit, 2026-10-22 — notes were deleted in `chore/clean-tree`, blob at `c82b2e7`; live Supabase check):** on **prod** as +of 2026-10-20 there are **255 PROJECTED / 240 UNKNOWN** rows with **0 D-unit +rows and 0 PP1** — the live pipeline's own signature (forwards only, verbatim +"POWER PLAY #1"). The collector's post-state (PROJECTED rows carrying D units: +**dev: 128 D / 22 PP1**; dev 390 PROJECTED / 105 UNKNOWN) appears on **dev +only**. The prod-write claim printed earlier in this section (UNKNOWN +4,900→4,765, PROJECTED 255→390 "incl. defence") was that **dev** post-state. + +Known source noise (stored verbatim): the article occasionally numbers extra +defence pairs (label "D4" for a 4th pair) and a handful of projected players +are not on the current roster feed (logged, skipped). PP labels are mixed +vocabulary until historical rows are rewritten (owner decision). + +FIXED 2026-10-22 (`d0ee9b9`): `snapshot_projected.py` now accumulates rows +with units. Prod after first runs: **540 rows — 525 with `lineup_unit`** +(D units 180, PP1 139, PP2 237), statuses **525 `PROJECTED_PROXY`** +(prior-game proxy units, provenance-flagged) / **2 `PROJECTED`** (official +article F/D + RotoWire PP) / **13 `UNKNOWN`** (no deployable history); +idempotency verified (second run: 0 writes). Stats columns untouched +(gpg/hgpg non-null on 539/540). Runbook: `PROJECTED_LINEUP_RUNBOOK.md` +(correct worktree path, PATH fix, cron + systemd-timer, 10:30/13:00/16:00 ET, +verification query). +Limits: proxy units come from last-season final deployments until fresher +shifts accumulate; on article-lag days RotoWire identity+PP still collects +with proxy flags; PP3/PP4 proxy rows surface verbatim under PROJECTED_PROXY +and the model boundary may need clamping. **Prospective projected-lineup +validation can now begin:** watch fidelity vs actuals over the next 2-3 +weeks per the V11 sensitivity (81% fidelity ~ +0.1-0.3pp, 100% ~ +1.2pp); +adopt only if fidelity >= 90% AND paired tests beat the no-lineup ensemble +on both seeds. + +Health check: PROJECTED dates accumulating forward under this heading; 0 new +dates on successive game days means the sources stopped (article moved hosts +or slug changed) and the collector refuses to write by design. + +### Legacy experiment code — deleted in chore/clean-tree + +Every rejected arm above was reproducible from a script this cleanup +**deleted**; each line below is therefore: *code deleted in +`chore/clean-tree`; see commit `c82b2e7` in history* (`git show c82b2e7:` +for the exact file, the `notes_v16_*` run notebooks, and the tracked +`data/ml/` experiment CSVs; `score_oof.py`/`score_embed_oof.py` re-scorers +were untracked and are gone). + +Command shape for every arm: `OMP_NUM_THREADS=2 LGBM_N_JOBS=2 uv run --with +lightgbm==4.7.0 python smartscore/scripts/backtrack/', source, re.S): + try: + decoded = json.loads(block) + except json.JSONDecodeError: + continue + if isinstance(decoded, dict) and "NewsArticle" in str(decoded.get("@type", "")): + published = decoded.get("datePublished") + if published: + return _start_date_et(published) + return None + + +def build_rows(date_str, delay_seconds=0.5, include_article=True): + """Collect every official published-source skater row for one game date. + + Rows share no (date, player_id) pair (the first source's field wins on + conflict, so the article's forward line stays the row and RotoWire only + fills pp_unit). ``include_article=False`` (a stale-article day) collects + the RotoWire slate only. ``meta`` carries, per (date, player_id) key, + the team abbreviation / scheduled start / roster position needed by the + pre-game guard and proxy checks; the meta dict is never sent to Supabase. + """ + games = schedule_games(date_str, delay_seconds=delay_seconds) + if not games: + print(f"{date_str}: no NHL games scheduled") + return {}, {}, ["no-scheduled-games"] + + start_by_key = {} + for game in games: + for side in (game["away"], game["home"]): + for key in _team_keys(side): + start_by_key[key] = game["start_utc"] + + from nhl_lineups import get_nhl_com_lineups, get_rotowire_lineups # noqa:PLC0415 + + sources = [] + if include_article: + sources.append((get_nhl_com_lineups(), _article_team_entries, "article")) + sources.append((get_rotowire_lineups(), _rotowire_team_entries, "rotowire")) + if not any(games for games, _, _ in sources): + return {}, {}, ["no lineup source returned any games"] + + rows = {} + meta = {} + skipped = [] + for source_games, team_fn, _tier in sources: + for game in source_games: + try: + matchup = _match_schedule_game(game.get("away"), game.get("home"), games) + except LookupError as e: + skipped.append(str(e)) + continue + if matchup is None: + skipped.append(f"{game.get('away')}@{game.get('home')}: no schedule match") + continue + + game_date = _start_date_et(matchup["game"]["start_utc"]) + for team in game.get("teams") or []: + target = _match_team(team.get("name"), matchup["away"], matchup["home"]) + if not target or not target.get("abbrev"): + skipped.append(f"{team.get('name')!r}: unresolved team on the schedule") + continue + roster = _roster(target["abbrev"], delay_seconds=delay_seconds) + + for name, unit, group, pp in team_fn(team): + resolved = roster.get(normalize_player_name(_clean_name(name))) + if not resolved: + skipped.append(f"{target['abbrev']} {name!r}: not on current roster") + continue + player_id, display, pos_group = resolved + key = (game_date, player_id) + meta[key] = { + "team_abbrev": target["abbrev"], + "start_utc": matchup["game"]["start_utc"], + "roster_group": pos_group, + } + row = rows.get(key) + home_flag = matchup["game"]["home"]["abbrev"] == target["abbrev"] + if row is None: + rows[key] = { + "date": game_date, + "player_id": player_id, + "name": display, + "team_name": target["place"], + "home": home_flag, + "lineup_unit": unit, + "lineup_position_group": group, + "pp_unit": pp, + "lineup_status": OFFICIAL_STATUS, + } + continue + # Merge the other source's contribution: article units win + # where present, RotoWire fills pp-only players. + if unit and not row["lineup_unit"]: + row["lineup_unit"], row["lineup_position_group"] = unit, group + if pp and not row["pp_unit"]: + row["pp_unit"] = pp + + return rows, meta, skipped + + +def _prior_from_archive(supabase, table, date_str, player_ids): + """Freshest strictly-prior archive row per player carrying a unit. + + The proxy source of first resort: earlier projection rows for the same + players, read with ``date < target`` only. + """ + prior = {} + ids = sorted({int(p) for p in player_ids}) + if not ids: + return prior + client = supabase.table(table) + offset = 0 + while True: + response = ( + client.select("date,player_id,lineup_unit,lineup_position_group,pp_unit") + .in_("player_id", ids) + .lt("date", date_str) + .or_("lineup_unit.not.is.null,pp_unit.not.is.null") + .order("date", desc=True) + .order("player_id") + .range(offset, offset + PAGE_SIZE - 1) + .execute() + ) + batch = response.data or [] + for row in batch: + pid = int(row["player_id"]) + entry = prior.setdefault( + pid, + { + "lineup_unit": None, + "lineup_position_group": None, + "pp_unit": None, + "lineup_date": None, + "pp_date": None, + "source": "archive", + }, + ) + date = row.get("date") or "" + if row.get("lineup_unit") and (entry["lineup_date"] is None or date > entry["lineup_date"]): + entry["lineup_unit"] = row["lineup_unit"] + entry["lineup_position_group"] = row.get("lineup_position_group") + entry["lineup_date"] = date + if row.get("pp_unit") and (entry["pp_date"] is None or date > entry["pp_date"]): + entry["pp_unit"] = _canonical_stored_pp(row["pp_unit"]) + entry["pp_date"] = date + if len(batch) < PAGE_SIZE: + break + offset += PAGE_SIZE + return prior + + +def _prior_from_sqlite(date_str, player_ids): + """Freshest strictly-prior reconstructed unit per player from the local store. + + ``player_lineups`` (see lineup_reconstruct) holds ACTUAL F1-F4/D1-D3 and + PP1/PP2 reconstructions per (player_id, game_id); ``player_games`` + supplies each game's ET date. Availability ends where the raw crawl + stopped (2026-06-14 at the time of writing), so this is the deeper but + staler fallback behind the archive scan. + """ + prior = {} + if not RAW_DB.exists() or not player_ids: + return prior + ids = sorted({int(p) for p in player_ids}) + con = sqlite3.connect(f"file:{RAW_DB}?mode=ro", uri=True) + try: + for start in range(0, len(ids), 500): + chunk = ids[start : start + 500] + placeholders = ",".join("?" * len(chunk)) + rows = con.execute( + ( # noqa: S608 + "SELECT pg.player_id, pg.game_date, pl.lineup_unit," + " pl.lineup_position_group, pl.pp_unit" + " FROM player_games pg" + " JOIN player_lineups pl" + " ON pl.game_id = pg.game_id AND pl.player_id = pg.player_id" + " WHERE pg.game_date < ? AND pl.lineup_unit IS NOT NULL" + " AND pg.player_id IN ({})" + ).format(placeholders), + [date_str, *chunk], + ).fetchall() + for player_id, game_date, lineup, group, pp in rows: + entry = prior.setdefault( + int(player_id), + { + "lineup_unit": None, + "lineup_position_group": None, + "pp_unit": None, + "lineup_date": None, + "pp_date": None, + "source": "sqlite-shiftcharts", + }, + ) + if game_date and (entry["lineup_date"] is None or game_date > entry["lineup_date"]): + entry["lineup_unit"], entry["lineup_position_group"], entry["lineup_date"] = ( + lineup, + group, + game_date, + ) + if pp and (entry["pp_date"] is None or game_date > entry["pp_date"]): + entry["pp_unit"] = pp + entry["pp_date"] = game_date + finally: + con.close() + return prior + + +def _assert_append_safe(batch): + """Refuse any append row carrying a column outside the allowlist. + + Defense in depth for the prod write path: the payload must contain only + identity + lineup columns - no stats, no grade - because a batch column + would reset the same field on any conflict-consumed stored row. + """ + allowed = set(PAYLOAD_COLUMNS) + for row in batch: + extra = set(row) - allowed + if extra: + raise AssertionError(f"append payload carries non-allowlisted columns: {sorted(extra)}") + forbidden = set(row) & FORBIDDEN_COLUMNS + if forbidden: + raise AssertionError(f"append payload carries FORBIDDEN stats/grade columns: {sorted(forbidden)}") + + +def _existing_rows(supabase, table, date_str): + """``{player_id: row}`` already stored for the date, paged.""" + client = supabase.table(table) + existing = {} + offset = 0 + while True: + response = ( + client.select("player_id,name,team_name,lineup_status,lineup_unit,lineup_position_group,pp_unit") + .eq("date", date_str) + .order("player_id") + .range(offset, offset + PAGE_SIZE - 1) + .execute() + ) + batch = response.data or [] + for row in batch: + existing[int(row["player_id"])] = row + if len(batch) < PAGE_SIZE: + break + offset += PAGE_SIZE + return existing + + +def _resolve_pair(stored, official, prior, roster_group): + """Final lineup fields + provenance status for one (date, player) pair. + + fill-only, provenance-disciplined: + + * ``HARD_KEEP_STATUSES`` rows (ACTUAL/CONFIRMED ground truth) -> None: + never modified. + * A non-null stored value is never overwritten. A stored verbatim + "POWER PLAY #N" pp label counts as changed only by canonicalisation + to PP1/PP2 - the same fact in the model's vocabulary. + * A stored ``PROJECTED`` row (an official projection) accepts official + fills only - proxy values must not launder into the official label. + * Any other stored row (an UNKNOWN stamp, a bare row) and brand-new + pairs: official fills win per field, remaining blanks fall back to + the strictly-prior proxy (position-guarded), and any proxy value on + the final row forces the ``PROJECTED_PROXY`` label. + + Returns ``(lineup_fields_dict, status)`` or ``None`` when nothing changes. + """ + s_status = (stored or {}).get("lineup_status") or "" + if s_status in HARD_KEEP_STATUSES: + return None + + official = official or {} + prior = prior or {} + s_unit = (stored or {}).get("lineup_unit") or None + s_group = (stored or {}).get("lineup_position_group") or None + s_pp_raw = (stored or {}).get("pp_unit") or None + s_pp = _canonical_stored_pp(s_pp_raw) if s_pp_raw else None + official_row = s_status == OFFICIAL_STATUS + + unit, group, pp = s_unit, s_group, s_pp + used_official = False + used_proxy = False + + if not unit and official.get("lineup_unit"): + unit, group, used_official = official["lineup_unit"], official.get("lineup_position_group"), True + if not pp and official.get("pp_unit"): + pp, used_official = official["pp_unit"], True + + if not official_row: + if not unit and prior.get("lineup_unit"): + prior_group = prior.get("lineup_position_group") + # Position guard: a prior unit labelled D never dresses a roster + # forward (or vice versa); an unknown roster side keeps the fill. + if not roster_group or not prior_group or prior_group[0] == roster_group[0]: + unit, group, used_proxy = prior["lineup_unit"], prior_group, True + if not pp and prior.get("pp_unit"): + pp, used_proxy = prior["pp_unit"], True + + if not official_row and not used_official and not used_proxy: + # nothing new from either tier - only the verbatim -> canonical pp + # rewrite can still make the patch worthwhile + if pp == s_pp_raw: + return None + + if not (unit or pp): + return None + + if official_row: + status = OFFICIAL_STATUS + elif used_proxy: + status = PROXY_STATUS + else: + status = OFFICIAL_STATUS + + changed = ( + (unit or None) != (s_unit or None) + or ((group or None) if unit else None) != (s_group or None) + or (pp or None) != (s_pp_raw or None) + or status != s_status + ) + if not changed: + return None + fields = {"lineup_unit": unit, "lineup_position_group": group, "pp_unit": pp} + return fields, status + + +def _execute_patch_groups(supabase, table, date_str, groups): + """PATCH exactly the four lineup columns, grouped by identical values. + + The UPDATE carries a ``lineup_status not.in (CONFIRMED, ACTUAL)`` filter + so a row promoted to the game's ground truth between the read and this + statement is skipped by the database, not just by our bookkeeping. + """ + patched = 0 + for (unit, group, pp, status), player_ids in groups.items(): + payload = { + "lineup_unit": unit, + "lineup_position_group": group, + "pp_unit": pp, + "lineup_status": status, + } + if set(payload) != REFRESH_COLUMNS: + raise AssertionError(f"refresh payload columns drifted: {sorted(payload)}") + ( + supabase.table(table) + .update(payload, returning="minimal") + .eq("date", date_str) + .in_("player_id", player_ids) + .not_.in_("lineup_status", list(HARD_KEEP_STATUSES)) + .execute() + ) + patched += len(player_ids) + return patched + + +def run(supabase, env, date_str, modes, limit=None, force=False, dry_run=False, use_proxy=True): + now_utc = datetime.datetime.now(datetime.timezone.utc) + article_date = article_published_date() + official_ok = article_date == date_str + if not official_ok: + print( + f"official tier: article covers {article_date}, requested {date_str};" + " published-source units skipped (the undated RotoWire page is only" + " believed when the dated article confirms the same slate)" + ) + if force: + official_ok = True + print(" --force given: official tier un-blocked by hand verification") + + rows, meta, skipped = {}, {}, [] + if official_ok: + rows, meta, skipped = build_rows(date_str) + else: + # Article lags the slate: the dated article's units are refused, but + # the RotoWire slate is collected (rows date-anchored by the schedule + # match), then the strictly-prior proxy tier fills lineup blanks. + rows, meta, skipped = build_rows(date_str, include_article=False) + print(" RotoWire-only tier: article stale, its F/D units refused") + forwards = sum(1 for row in rows.values() if row["lineup_position_group"] == "F") + defence = sum(1 for row in rows.values() if row["lineup_position_group"] == "D") + pp_count = sum(1 for row in rows.values() if row["pp_unit"]) + print( + f"{date_str}: official sources -> {len(rows)} rows (F {forwards}, D {defence}," + f" pp non-null {pp_count}); {len(skipped)} item(s) skipped" + ) + for line in skipped[:15]: + print(f" skipped: {line}") + if len(skipped) > 15: + print(f" ... {len(skipped) - 15} more") + + if dry_run: + for row in list(rows.values())[:5]: + print(" official sample:", json.dumps(row)) + return 0, "dry-run only (no table reads, no writes)" + + table = f"Player-Snapshots-{env}" + existing = _existing_rows(supabase, table, date_str) + print(f" stored rows for {date_str}: {len(existing)}") + + official_by_pid = {int(row["player_id"]): row for row in rows.values()} + + universe_ids = set(official_by_pid) | set(existing) + print(f" unit-freshening universe: {len(universe_ids)} player(s)") + + prior = {} + if use_proxy: + prior = _prior_from_archive(supabase, table, date_str, universe_ids) + for pid, entry in _prior_from_sqlite(date_str, universe_ids).items(): + target = prior.setdefault( + pid, + { + "lineup_unit": None, + "lineup_position_group": None, + "pp_unit": None, + "lineup_date": None, + "pp_date": None, + "source": "sqlite-shiftcharts", + }, + ) + if entry["lineup_unit"] and not target["lineup_unit"]: + target["lineup_unit"] = entry["lineup_unit"] + target["lineup_position_group"] = entry["lineup_position_group"] + target["lineup_date"] = entry["lineup_date"] + target["source"] = entry["source"] + if entry["pp_unit"] and not target["pp_unit"]: + target["pp_unit"] = entry["pp_unit"] + target["pp_date"] = entry["pp_date"] + coverage = sum(1 for entry in prior.values() if entry["lineup_unit"] or entry["pp_unit"]) + print(f" proxy coverage: {coverage} player(s) with a strictly-prior unit") + + # schedule lookups for the pre-game guard on stored-only players + games = schedule_games(date_str) + start_by_key = {} + abbrev_by_place = {} + for game in games: + for side in (game["away"], game["home"]): + for key in _team_keys(side): + start_by_key[key] = game["start_utc"] + if side.get("place"): + abbrev_by_place[normalize_player_name(side["place"])] = side["abbrev"] + + def game_start_for(pid): + """Scheduled start for a player's team, or None when unplaceable.""" + row = official_by_pid.get(pid) + if row is not None: + entry = meta.get((row["date"], int(row["player_id"]))) + if entry: + return entry.get("start_utc") + stored = existing.get(pid) + abbrev = None + if stored: + abbrev = abbrev_by_place.get(normalize_player_name(stored.get("team_name") or "")) + if abbrev: + return start_by_key.get(normalize_player_name(abbrev)) + return None + + def roster_group_for(pid): + entry = official_by_pid.get(pid) + if entry is not None: + return (meta.get((entry["date"], int(entry["player_id"]))) or {}).get("roster_group") + stored = existing.get(pid) + abbrev = None + if stored: + abbrev = abbrev_by_place.get(normalize_player_name(stored.get("team_name") or "")) + if abbrev: + for value in _roster(abbrev).values(): + if value[0] == pid: + return value[2] + return None + + # ---- resolve every pair in the universe ------------------------------- + new_payloads = [] + patch_groups = defaultdict(list) + guard_skipped = unknown_start = 0 + for pid in sorted(universe_ids): + resolved = _resolve_pair( + existing.get(pid), + official_by_pid.get(pid), + prior.get(pid) if use_proxy else None, + roster_group_for(pid), + ) + if resolved is None: + continue + fields, status = resolved + stored = existing.get(pid) + + if stored is None: + official_row = official_by_pid.get(pid) + if official_row is None: + continue # proxy-only pair with no identity: never fabricated + payload = { + "date": official_row["date"], + "player_id": pid, + "name": official_row["name"], + "team_name": official_row["team_name"], + "home": official_row["home"], + **fields, + "lineup_status": status, + } + new_payloads.append(payload) + else: + start_utc = game_start_for(pid) + if start_utc is None: + unknown_start += 1 + if not force: + continue # cannot verify the team plays this date: skip + elif _parse_utc(start_utc) <= now_utc and not force: + guard_skipped += 1 + continue # game already underway: never touch deployment data + patch_groups[(fields["lineup_unit"], fields["lineup_position_group"], fields["pp_unit"], status)].append( + pid + ) + + appended = refreshed = 0 + if "append" in modes: + batch = new_payloads[:limit] if limit is not None else new_payloads + if batch: + _assert_append_safe(batch) + for start in range(0, len(batch), BATCH_SIZE): + ( + supabase.table(table) + .upsert( + batch[start : start + BATCH_SIZE], + on_conflict="date,player_id", + ignore_duplicates=True, + returning="minimal", + ) + .execute() + ) + appended = len(batch) + print(f" append: {appended} new row(s) inserted (ignore_duplicates; existing rows untouched)") + + if "refresh" in modes: + if patch_groups: + refreshed = _execute_patch_groups(supabase, table, date_str, patch_groups) + print( + f" refresh: {refreshed} stored row(s) filled" + f" (guard-skipped: {guard_skipped} game-started, {unknown_start} team-unplaceable)" + ) + elif guard_skipped or unknown_start: + print(f" (append-only mode: {guard_skipped + unknown_start} pair(s) would have been guard-skipped)") + + return 0, f"appended {appended}, refreshed {refreshed}" + + +def main(): + parser = argparse.ArgumentParser(description=__doc__.split("\n")[0]) + parser.add_argument("--env", default="dev", choices=("dev", "prod"), help="Supabase table suffix (default dev).") + parser.add_argument("--date", default=None, help="Game date YYYY-MM-DD (default: today, America/Toronto).") + parser.add_argument("--mode", nargs="+", choices=("append", "refresh"), default=["append", "refresh"]) + parser.add_argument("--limit", type=int, default=None, help="Cap rows appended (safety for a first rollout).") + parser.add_argument( + "--force", action="store_true", help="Write even when the article date/query guards do not line up." + ) + parser.add_argument("--dry-run", action="store_true", help="Collect and report only; no writes, no table reads.") + parser.add_argument( + "--no-proxy", + action="store_true", + help="Skip the strictly-prior proxy tier; persist official published units only.", + ) + args = parser.parse_args() + + date_str = args.date or et_today() + if args.date and args.date != et_today() and not args.force: + print("note: the projected sources are a daily slate; non-today dates need --force and usually fail") + + os.environ["ENV"] = args.env + from config import SUPABASE_ADMIN_CLIENT # noqa:PLC0415 - initialised after ENV is final + + code, message = run( + SUPABASE_ADMIN_CLIENT, + args.env, + date_str, + set(args.mode), + limit=args.limit, + force=args.force, + dry_run=args.dry_run, + use_proxy=not args.no_proxy, + ) + print(f"{date_str}: {message}") + return code + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/smartscore/scripts/backtrack/topup_raw_game_cols.py b/smartscore/scripts/backtrack/topup_raw_game_cols.py new file mode 100644 index 00000000..77b83d9f --- /dev/null +++ b/smartscore/scripts/backtrack/topup_raw_game_cols.py @@ -0,0 +1,306 @@ +"""One-time top-up: fill the four per-game RAW columns of migration 20261027 +on Player-Snapshots-backtrack-{ENV}, for ALL historical rows, from the local +raw store (data/raw_nhl.sqlite ``player_games``). + +The stage-2 exactness companion of +supabase/migrations/20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql, +modeled on the 20261024 16-column pattern: an idempotent ALTER TABLE of +``Player-Snapshots-backtrack-prod`` (prod-pinned: the -dev backtracking +tables were deleted Oct 2026, docs/backtrack_dev_deleted.md, and the +backtrack migrations carry the BACKTRACK-PROD-PINNED marker instead of +``__ENV__`` so the standing ``migrate`` job can never revive them) applied by +deploy.yml's standing +``migrate`` job (ENV=prod on a push to main); psql re-applies every file in +supabase/migrations/ every run, +idempotency being the correctness guarantee. + +WHAT IT DOES (publish_shot_cols' batch conventions, verbatim) +-------- +1. Pages EVERY (date, player_id) key out of the snapshot table (month + windows + 10k range pages - the snapshot_keys() mechanics). +2. Reads the store's per-game rows: shots/goals/points keep the store's + exact integers (Int64 so a NaN stays null-able); toi 'MM:SS' parses to + decimal minutes by the SHARED parser model._toi_minutes - the exact cast + the 16-column backfill used; NaN -> None; season never ships (the joins + key on (date, player_id)). +3. Upserts exactly (date, player_id, game_*...) - six keys, ONE key + signature per batch - in 500-row batches with on_conflict="date,player_id", + returning="minimal". A row the store has no player_games row for is + SKIPPED, not zeroed: NULL stays "did not play" (the same convention + shot_features_from_games / _backfilled_game_rows read past rows by), row + counts can never shrink, and no other column is ever touched (a missing + key on PostgREST is an explicit NULL, never an omission - + run_daily_picks._upsert_raw_rows' rule). +4. Re-reads a 500-row sample and diffs every one of the four columns + against a store recompute (0 mismatches expected, rel tol 1e-9). + +PRECONDITION: the migration must have landed on the env's table - probed +via publish_shot_cols.raw_game_columns_landed; NO DDL is performed here. +IDEMPOTENT: PK upserts, so a re-run is a safe overwrite, not an append. + +Usage:: + + uv run python smartscore/scripts/backtrack/topup_raw_game_cols.py --env dev + uv run python smartscore/scripts/backtrack/topup_raw_game_cols.py --env prod +""" + +import argparse +import sys +import time +from pathlib import Path + +import numpy as np +import pandas as pd + +sys.path.append(str(Path(__file__).resolve().parents[2])) + +from model import SUPABASE_ADMIN_CLIENT, _month_windows, _toi_minutes, player_table # noqa: E402 +from publish_shot_cols import RAW_GAME_COLUMNS, raw_game_columns_landed, raw_game_map # noqa: E402 + +# PostgREST rows per request: the spec cap the 16-column backfill landed on. +BATCH_SIZE = 500 + +# The brief's "log per 20k": progress every 20_000 written rows. +PROGRESS_ROWS = 20_000 + +RAW_FETCH_COLUMNS = "date,player_id,game_shots,game_goals,game_points,game_toi_min" + +KEY_COLUMNS = ("date", "player_id", "name", *RAW_GAME_COLUMNS) + + +def snapshot_keys_frame(table): + """The full (date, player_id) key set + name, paged like snapshot_keys().""" + start = time.time() + first = SUPABASE_ADMIN_CLIENT.table(table).select("date").order("date").limit(1).execute().data + last = SUPABASE_ADMIN_CLIENT.table(table).select("date").order("date", desc=True).limit(1).execute().data + if not first or not last: + raise RuntimeError(f"{table} is empty - nothing to top-up") + frames = [] + for lo, hi in _month_windows(first[0]["date"], last[0]["date"]): + offset = 0 + query = SUPABASE_ADMIN_CLIENT.table(table).select("date,player_id,name").gte("date", lo).lt("date", hi) + query = query.order("date").order("player_id") + while True: + rows = query.range(offset, offset + 10_000 - 1).execute().data + if not rows: + break + frames.append(pd.DataFrame(rows)) + offset += len(rows) + if not frames: + raise RuntimeError(f"{table} paged 0 rows") + keys = pd.concat(frames, ignore_index=True) + keys["date"] = keys["date"].astype(str) + keys["player_id"] = keys["player_id"].astype("int64") + keys = keys.drop_duplicates(["date", "player_id"]) + print(f" {len(keys):,} snapshot rows paged in {time.time() - start:.0f}s", flush=True) + return keys + + +def build_key_frame(keys, store_frame): + """Keys the store supplies stats for, as a six-key frame. + + Casts are the 16-column backfill's: the store's exact integers kept via + Int64 (NaN stays null-able), toi decimal minutes by the shared parser, + NaN -> None done later in the record encoder. Store rows without the + essential boxscore integers (shots AND goals both NaN) are NOT a played + game, same drop rule the daily attach applies. + """ + if store_frame.empty: + merged = keys.head(0) + else: + source = store_frame.dropna(subset=["shots", "goals"])[["date", "player_id", "shots", "goals", "points", "toi"]] + merged = keys.merge(source, on=["date", "player_id"], how="inner", validate="many_to_one") + skipped = len(keys) - len(merged) + merged["player_id"] = merged["player_id"].astype("int64") + for game_col, store_col in (("game_shots", "shots"), ("game_goals", "goals"), ("game_points", "points")): + merged[game_col] = merged[store_col].astype("Int64") + # The shared parser: 'MM:SS' -> mm + ss/60 decimal minutes (empty -> NaN + # -> None at record-encoding time), the exact cast the 16-col backfill used. + merged["game_toi_min"] = _toi_minutes(merged["toi"]) + print( + f"filling {len(merged):,}/{len(keys):,} keys; {skipped:,} left NULL (no player_games row / no stats)", + flush=True, + ) + # list(...) - a bare tuple would go through the multiindex path in pandas. + return merged[list(KEY_COLUMNS)] # noqa: C405 + + +def payload_records(frame): + """Rows ready for supabase-py: python scalars, NaN -> None (shared rule).""" + data = frame.astype(object).where(pd.notna(frame), None) + return [ + {key: value.item() if isinstance(value, np.generic) else value for key, value in row.items()} + for row in data.to_dict("records") + ] + + +def upsert_frame(frame, table): + """500-row upserts on the PK; three retries a batch; log per 20k; raise on a failed batch.""" + records = payload_records(frame) + total = len(records) + print(f"upserting {total:,} rows to {table} ({BATCH_SIZE}/batch)", flush=True) + written = 0 + failed = [] + start = time.time() + for offset in range(0, total, BATCH_SIZE): + batch = records[offset : offset + BATCH_SIZE] + error = None + for attempt in range(3): + try: + SUPABASE_ADMIN_CLIENT.table(table).upsert( + batch, on_conflict="date,player_id", returning="minimal" + ).execute() + error = None + break + except Exception as exc: # noqa: BLE001 - retried below, then surfaced + error = exc + if attempt == 2: + break + time.sleep(2.0 * (attempt + 1)) + if error is not None: + failed.append((offset // BATCH_SIZE, f"{type(error).__name__}: {str(error)[:280]}")) + continue + written += len(batch) + if written % PROGRESS_ROWS == 0: + rate = written / max(time.time() - start, 1e-9) + print( + f" rows {written:,} {rate:,.0f} rows/s elapsed {time.time() - start:.0f}s errors {len(failed)}", + flush=True, + ) + if written: + rate = written / max(time.time() - start, 1e-9) + print(f"upserted {written:,} rows in {time.time() - start:.0f}s ({BATCH_SIZE}/batch)", flush=True) + if failed: + sample = ", ".join(f"batch#{index}: {err}" for index, err in failed[:3]) + raise RuntimeError(f"{len(failed)} batch(es) failed after retries: {sample} ...") + return written + + +def spot_check(env, table, sample_size=500, tol_rel=1e-9): + """Re-read a sample and diff the four columns against a store recompute. + + The sample taps three windows (head / middle / tail) spread across the + table's date axis, then diffs EVERY one of the four columns against the + values recomputed from the store with the same casts the run wrote + with. Pairs the store has no player_games row for are excluded - a spot + check verifies the topped-up set (NULL = did not play is checked by the + attach conventions, not here). Returns (mismatches, matched, worst_rel). + """ + start = time.time() + total = SUPABASE_ADMIN_CLIENT.table(table).select("date", count="exact").limit(1).execute().count + if total == 0: + print(f"spot-check: {table} has 0 rows - nothing to check") + return 0, 0, 0.0 + plates = [] + for offset in sorted({0, max(total // 2 - sample_size // 2, 0), max(total - sample_size, 0)}): + rows = ( + SUPABASE_ADMIN_CLIENT.table(table) + .select(RAW_FETCH_COLUMNS) + .order("date") + .order("player_id") + .range(offset, offset + sample_size - 1) + .execute() + .data + ) + plates.extend(rows or []) + sample = pd.DataFrame(plates).drop_duplicates(["date", "player_id"]).sort_values(["date", "player_id"]) + sample = sample.head(sample_size) + if sample.empty: + print(f"spot-check: {table} page read empty - cannot verify") + return 0, 0, 0.0 + print(f"spot-check: {len(sample)} rows read from {table} (table rows: {total:,})", flush=True) + store = raw_game_map(min_date=str(sample["date"].min()), max_date=str(sample["date"].max())) + store = store.dropna(subset=["shots", "goals"])[["date", "player_id", "shots", "goals", "points", "toi"]] + mismatches = 0 + worst_rel = 0.0 + recomputable = 0 + for row in sample.to_dict("records"): + source = store[(store["player_id"] == int(row["player_id"])) & (store["date"] == str(row["date"]))] + if source.empty: + continue # not store-covered: outside the recomputation claim + src = source.iloc[0] + recomputable += 1 + expected = { + "game_shots": int(src["shots"]), + "game_goals": int(src["goals"]), + "game_points": int(src["points"]), + "game_toi_min": float(_toi_minutes(pd.Series([src["toi"]])).iloc[0]), + } + for col, want in expected.items(): + got = row[col] + if got is None or want is None: + mismatches += 1 + continue + if col == "game_toi_min": + rel = abs(float(got) - want) / max(abs(want), 1e-12) + worst_rel = max(worst_rel, rel) + if rel > tol_rel: + mismatches += 1 + elif got != want: + mismatches += 1 + print( + ( + "spot-check vs recompute: " + f"mismatches={mismatches} matched={recomputable} columns={','.join(RAW_GAME_COLUMNS)} " + f"tol_rel={tol_rel} worst_rel={worst_rel:.2e}" + ), + flush=True, + ) + print(f"elapsed {time.time() - start:.0f}s", flush=True) + return mismatches, recomputable, worst_rel + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--env", default="dev", choices=["dev", "prod"], help="backtrack table suffix (default dev)") + parser.add_argument("--spot-check", action="store_true", help="500-row verify-and-exit (no writes)") + parser.add_argument("--skip-spot-check", action="store_true", help="upsert without the trailing verify") + args = parser.parse_args() + + table = player_table(args.env) + if not raw_game_columns_landed(table): + raise SystemExit( + f"migration 20261027 has NOT landed on {table}: no raw columns to top up. " + "Apply the migration first (standing CI migrate job - prod on main merge; " + "or psql with SUPABASE_DB_URL locally)." + ) + print(f"probe OK: game_* columns landed on {table}") + + if args.spot_check: + mismatches, recomputable, _ = spot_check(args.env, table, sample_size=500) + if mismatches: + raise SystemExit(1) + return + + try: + keys = snapshot_keys_frame(table) + except RuntimeError as exc: + if "is empty" not in str(exc): + raise + # An EMPTY backtrack table is a clean no-op top-up: the probe proved + # the columns exist, zero rows exist, so there is nothing to fill + # (verified live: Player-Snapshots-backtrack-dev is 0 rows). + print(f"{table} has 0 rows: top-up is a verified no-op (0 rows processed, 0 corrections)") + return + print(f"snapshot rows: {len(keys):,} ({table})", flush=True) + store = raw_game_map(min_date=str(keys["date"].min()), max_date=str(keys["date"].max())) + print(f"store rows over that date range: {len(store):,}", flush=True) + frame = build_key_frame(keys, store) + filled = int(frame["game_shots"].notna().sum()) + written = upsert_frame(frame, table) if len(frame) else 0 + print( + ( + f"corrections: {filled:,}/{len(keys):,} keys now carry per-game values " + f"({len(keys) - filled:,} left NULL: no player_games row / no bogus stats); " + f"upserted {written:,} rows, 0 deletions" + ), + flush=True, + ) + if not args.skip_spot_check: + mismatches, recomputable, _ = spot_check(args.env, table, sample_size=500) + if mismatches: + raise SystemExit(1) + + +if __name__ == "__main__": + main() diff --git a/smartscore/scripts/backtrack/train_export.py b/smartscore/scripts/backtrack/train_export.py new file mode 100644 index 00000000..522a3b3a --- /dev/null +++ b/smartscore/scripts/backtrack/train_export.py @@ -0,0 +1,491 @@ +"""On-demand, LOCAL training of the SmartScore ensemble -> ONE export artifact. + +GOAL (owner rules, binding) + +Training NEVER runs on AWS or in CI. The owner runs this script locally on +demand, it produces a versioned artifact, and (with --upload) puts that +artifact on S3 for the **predict-only daily pass** (the scheduled +.github/workflows/ml-picks.yml job via run_daily_picks.py). +Nothing in this file is scheduled; nothing daily runs locally either - this +is an owner-invoked, one-shot command. + +RAMBLE FREE / NO FORKING + +Every hyperparameter lives in ``smartscore/scripts/backtrack/model.py`` +(fit_hgb, fit_lgbm, fit_logreg, fit_ranker pins). This script imports model.py +math verbatim and adds one thing only: the deployment mode, where ALL scored +rows through --through-date are ONE training fold (no held-out test, no fold +sim), then exports everything a predict-only inference process needs. + +SEED + MEASURED NUMBERS + +The fitted estimators are always pinned random_state=0 inside model.py; +--seed only drives the k-fold date shuffle when --oof measures THIS bundle. +Canonical deployment seed is 0 - the best of the repo's pooled out-of-fold +sweep (pooled OOF pick accuracy, one pick per tims group per day): +seed 0 = 29.92%, seed 1 = 29.41%, seed 3 = 29.82% (96f0ff2 cache/MODEL_NOTES.md). +The table is recorded in the artifact metadata so any vintage traces to a +measured expected accuracy. Regenerating the ensemble on the current cache +(617,310 rows incl. the V15 2013-17 rows) measured seeds 1/3 at 29.28/29.82%; +era table lives in the runbook (docs/ml-picks-runbook.md). + +ARTIFACT + +``data/ml/artifact__.joblib`` (zlib-compressed joblib), +emitting BOTH agreed designs at once (run_daily_picks.normalise_bundle reads +either; joblib dedupes the shared estimator references): + + version 1 + train_through / seed + git_hash / generated_at + feature_order the EXACT ordered feature list the frame must + be rebuilt in (the daily pass asserts this) + categorical_maps {col: [values]} per CATEGORICAL_FEATURE - + the trained vocabulary the prediction encoding + step needs + derived_params the documented ensemble scoring recipe: + mean of within-(date, tims) rank(pct=True) + across {hgb, lgbm, logreg}, fillna(0) before + ranking, ranker excluded, daily_picks takes + the per-group max + models {hgb, lgbm, logreg, ranker} fitted estimators. + ARTIFACT VERSION 2: ``logreg`` is the FULL + fitted sklearn Pipeline + (SimpleImputer(median) -> StandardScaler -> + LogisticRegression) exactly as fit_logreg + produced it - live frames carry NaNs and the + member runs on them unharmed. v1 artifacts + exported the bare inner LR (broken on NaNs + and scaling at inference); readers auto-patch + v1 with a LOUD retrain warning. + + legacy aliases (same objects): hgb, lgbm, logreg, ranker, + numeric_features / categorical_features / all_features, categories, + required_snapshot_columns (the 16 Supabase columns the frame reads, + docs/supabase_shot_columns.md), metadata (train_through, seed, git hash, + rows, dates, fit seconds, library versions, expected OOF accuracy table) + +USAGE (owner-run, from the repo root; .env supplies Supabase config when +--source supabase; sqlite uses data/raw_nhl.sqlite) + + uv run python smartscore/scripts/backtrack/train_export.py \ + [--through-date YYYY-MM-DD] [--seed 0] [--env dev] + [--source sqlite|supabase] [--oof] [--upload] + [--s3-bucket ML_S3_BUCKET] [--s3-prefix predict/ml] + +--upload uploads via boto3 bucket/prefix from --s3-bucket/--s3-prefix (or the +ML_S3_BUCKET / ML_S3_PREFIX environment variables). DEFAULT IS NO UPLOAD - an +owner-run by itself never touches AWS. +""" + +import argparse +import datetime +import os +import subprocess +import sys +import time +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[3] +sys.path.insert(0, str(ROOT / "smartscore")) +sys.path.insert(1, Path(__file__).resolve().parent) + +import joblib # noqa: E402 +import model # noqa: E402 + +# noqa: E402 +import pandas as pd # noqa: E402 (model.py uses the global pd namespace) + +CACHE_DIR = ROOT / "data" / "ml" + +# Pooled out-of-fold 3-picks-per-day accuracy by seed (96f0ff2 cache, +# MODEL_NOTES.md). Quoted - never tuned - by the deployment number table. +EXPECTED_OOF = {0: 29.92, 1: 29.41, 3: 29.82} +DEPLOYMENT_SEED = 0 +LGBM_CONFIG = "a" + + +def git_commit(): + try: + return subprocess.run( + ["git", "rev-parse", "HEAD"], # noqa: S607 + capture_output=True, + text=True, + check=True, # noqa: S607 + ).stdout.strip() + except Exception: # noqa: BLE001 + return "unknown" + + +def load_frame(args): + """The through-date frame via model.py's own builders - no fork.""" + print(f"loading frames (env={args.env}, source={args.source}) ...", flush=True) + players, teams, goalies = model.load_frames(args.env, refresh=args.refresh) + # The live API can return empty strings for the rate columns on rows the + # publish wrote before a rate existed (pandas infers object dtype, and + # lightgbm refuses object columns outright - the CSV round-trip used to + # mask this by writing "" and re-reading it as NaN). Coerce every + # numeric-expected column back to numbers: "" -> NaN, the same value the + # CSV path always trained on. + numeric = set(model.SHOT_FEATURES) | { + "gpg", + "hgpg", + "five_gpg", + "hppg", + "ppg", + "tgpg", + "otga", + "otshga", + "home", + "tims", + "scored", + "gaa", + "save_pct", + "shutouts", + "games_played", + } + for frame in (players, teams, goalies): + for column in frame.columns: + if column in numeric and frame[column].dtype == object: + frame[column] = pd.to_numeric(frame[column], errors="coerce") + frame = model.build_frame(players, teams, goalies, source=args.source) + frame = model.add_derived(frame, teams, source=args.source) + frame = frame[frame["scored"].notna()].reset_index(drop=True) + if args.through_date: + frame = frame[frame["date"].astype(str) <= args.through_date].reset_index(drop=True) + print(f"training rows: {len(frame):,} through {frame['date'].max()}", flush=True) + return frame + + +def fit_bundle(frame, args): + """Fit on ONE fold that is the whole scored frame (all through-date rows). + + model.fit_hgb / fit_lgbm / fit_logreg / fit_ranker all take (train, test) + and fit on train; a one-row test frame keeps the calls verbatim while + making the returned in-fold predictions degenerate (discarded). Encoding + exactly mirrors model.categorise(frame, ): category vocabulary from + the training columns only, strings to category dtype. + """ + probe = frame.iloc[:1] # a one-row "test"; the 0-row shape trips sklearn + x_train, _ = model.categorise(frame, probe) + timings = {} + + # model.fit_* fit AND predict, returning a probability Series - the fitted + # estimator itself is not exposed. A capture wrapper on the estimator + # classes (set back after fitting) grabs the fitted objects WITHOUT + # touching any hyperparameter: construction stays 100% inside model.py. + captured = {} + cap_stack = [] + import sklearn.ensemble # noqa: E401, PLC0415, F401 (pre-seeds the modules we wrapper-capture) + import sklearn.linear_model # noqa: E401, PLC0415, F401 + + try: + import lightgbm # noqa:PLC0415 (optional dep; ranked bundle member) + except ImportError: + lightgbm = None # ranker ships omitted; a warning comes from fit_bundle + + def _wrap(holder, attr): + """Install a self-capturing subclass of holder.; restored later.""" + base = getattr(holder, attr) + + class _Captured(base): # noqa: N801 + def fit(self, *fit_args, **fit_kwargs): + result = super().fit(*fit_args, **fit_kwargs) + captured[attr] = self + return result + + setattr(holder, attr, _Captured) + cap_stack.append((holder, attr, base)) + + for module, attr in ( + (model, "HistGradientBoostingClassifier"), + (lightgbm, "LGBMClassifier"), + (lightgbm, "LGBMRanker"), + (model, "LogisticRegression"), # model.py binds it from sklearn.linear_model + (model, "SimpleImputer"), # logreg's pipeline preprocessing (artifact v2) + (model, "StandardScaler"), # logreg's pipeline preprocessing (artifact v2) + ): + if module is not None and hasattr(module, attr): + _wrap(module, attr) + + try: + start = time.time() + model.fit_hgb(frame, probe) # probability output discarded + timings["hgb_s"] = round(time.time() - start, 1) + + start = time.time() + model.fit_lgbm(frame, probe, args.lgbm_config) + timings["lgbm_s"] = round(time.time() - start, 1) + + start = time.time() + model.fit_logreg(frame, probe) + timings["logreg_s"] = round(time.time() - start, 1) + + # Pin logreg's pipeline members NOW: model.fit_ranker's pairwise + # fallback (when lightgbm is missing) constructs its own + # SimpleImputer/StandardScaler in the same module namespace, and an + # earlier capture-list entry would otherwise grab the ranker's + # pair-diff-fitted preprocessing for the logreg pipeline. + logreg_imputer = captured.get("SimpleImputer") + logreg_scaler = captured.get("StandardScaler") + + ranker = None + try: + model.fit_ranker(frame, probe, "lambdarank") + except ImportError: + ranker = captured.get("LGBMRanker") + if ranker is None: + print("ranker: lightgbm unavailable; bundle ships without it", flush=True) + timings["ranker_s"] = round(time.time() - start, 1) + finally: + for holder, name, base in cap_stack: + setattr(holder, name, base) + + # unlock states: restore original classes so the objects pickle + _restored = {attr: base for holder, attr, base in cap_stack} + for attr, estimator in captured.items(): + try: + estimator.__class__ = _restored[attr] + except TypeError: + pass + + hgb = captured["HistGradientBoostingClassifier"] + lgbm = captured.get("LGBMClassifier") + # ARTIFACT v2: export logreg as the FULL fitted pipeline + # (SimpleImputer(median) -> StandardScaler -> LogisticRegression) - exactly + # the object chain fit_logreg produced. Exporting the bare inner estimator + # (v1) left live inference broken two ways: the imputer never ran on the + # NaN-bearing live frames (ValueError: Input X contains NaN) and the LR ran + # on unscaled features (it was fitted on the scaled block). The trained + # sklearn Pipeline is plain-picklable, so option (a) is used. + logreg = model.make_pipeline(logreg_imputer, logreg_scaler, captured["LogisticRegression"]) + + bundle = { + # --- ARTIFACT CONTRACT keys (sibling-agreed; the daily pass reads both + # --- designs via normalise_bundle) ------------------------------ + # version 2: the logreg member carries its train-time preprocessing + # pipeline (documented in the module docstring and + # docs/ml-picks-runbook.md); v1 artifacts auto-patch with a warning. + "version": 2, + "train_through": str(frame["date"].max()), + "seed": args.seed, + "git_hash": (g := git_commit()), + "generated_at": (generated_at := datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds")), + "feature_order": list(model.DATASET_FEATURES), + "categorical_maps": { + col: sorted(str(value) for value in frame[col].dropna().astype(str).unique()) + for col in model.CATEGORICAL_FEATURES + }, + # The documented ensemble scoring recipe, verbatim the daily pass must + # reproduce: per model.run_folds' ensemble column - predict each + # member, fillna(0), rank(pct=True) within (date, tims), MEAN across + # the {hgb, lgbm, logreg} ranks (the ranker is exported for + # traceability only, never in the ensemble mean), then daily_picks + # takes each group's max - exactly one pick per tims group per date. + "derived_params": { + "ensemble_recipe": "mean of within-(date, tims) rank(pct=True) across members {hgb, lgbm, logreg}", + "ensemble_members": ["hgb", "lgbm", "logreg"], + "ranker_in_ensemble": False, + "fillna_before_rank": 0.0, + "logreg_features": list(model.NUMERIC_FEATURES), + "pick_rule": "model.daily_picks: max ensemble value within each " + "(date, tims in {1,2,3}); exactly one pick per group per date", + "required_snapshot_columns": list(FRAME_SOURCE_COLUMNS[args.source]), + }, + "models": { + "hgb": hgb, + "lgbm": lgbm, + "logreg": logreg, + "ranker": ranker, + }, + # --- legacy envelope keys (same objects; the legacy reader path + # --- and any older reader keep working) -------------------------- + "hgb": hgb, + "lgbm": lgbm, + "logreg": logreg, + "ranker": ranker, + "numeric_features": list(model.NUMERIC_FEATURES), + "categorical_features": list(model.CATEGORICAL_FEATURES), + "all_features": list(model.DATASET_FEATURES), + "categories": { + col: sorted(str(value) for value in frame[col].dropna().astype(str).unique()) + for col in model.CATEGORICAL_FEATURES + }, + "required_snapshot_columns": FRAME_SOURCE_COLUMNS[args.source], + "metadata": { + "train_through": str(frame["date"].max()), + "seed": args.seed, + "version": 2, + "generated_at": generated_at, + "expected_oof_pct": {str(k): v for k, v in EXPECTED_OOF.items()}, + "oof_measured": False, + "git_hash": (g := git_commit()), + "git_commit": g, + "frame_source": args.source, + "rows": int(len(frame)), + "dates": int(frame["date"].nunique()), + "fit_seconds": timings, + "lgbm_config": args.lgbm_config, + "lineup_mode": "none", + "trained_at": datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds"), + }, + } + return bundle + + +# The 16 shot/TOI + club columns the frame reads per env path +# (docs/supabase_shot_columns.md); sqlite covers them from the raw store. +FRAME_SOURCE_COLUMNS = { + "supabase": [ + "sd_shots_pg", + "sd_goals_pg", + "sd_toi_pg", + "sd_sh_pct", + "r5_shots_pg", + "r5_goals_pg", + "r10_shots_pg", + "r10_goals_pg", + "r10_toi_pg", + "ewm_goals", + "ewm_shots", + "career_games", + "career_goals_pg", + "career_shots_pg", + "team_abbrev", + "opponent_abbrev", + ], + "sqlite": [], +} + + +def run_oof(frame, args): + """Measure THIS bundle seed's pooled OOF pick accuracy via model.run_folds. + + Slow by design (a full k-fold sim; seeds 1/3 measured ~29.28/29.82% on the + current cache). Skipped by default; the metadata seed table is the quoted + number meanwhile. + """ + + class _Args: # model.run_folds expects the argparse surface of model.main() + refresh = False + env = args.env + split = "kfold" + splits = args.oof_splits + test_start = model.TEST_START + min_season = None + seed = args.seed + train_subset = "all" + model_ = "ensemble" + model_name = "ensemble" + ranker = "none" + lgbm_config = args.lgbm_config + + print(f"oof: {args.oof_splits}-fold sim at seed {args.seed} (slow) ...", flush=True) + start = time.time() + _, pooled, _, _ = model.run_folds(frame, _Args()) + picks = pd.concat(pooled["ensemble"], ignore_index=True) + result = model.score_picks(picks, "ensemble_oof") + print( + f"oof pooled seed {args.seed}: {result['hits']}/{result['total']} " + f"= {result['acc']:.2f}% over {result['days']} dates ({time.time() - start:.0f}s)", + flush=True, + ) + return result + + +def upload_artifact(path, args): + if args.storage_bucket: + from config import SUPABASE_ADMIN_CLIENT # noqa: PLC0415 (service-role client; .env / CI secrets) + + prefix = (args.s3_prefix or "predict/ml").rstrip("/") + key = f"{prefix}/{path.name}" + payload = path.read_bytes() + SUPABASE_ADMIN_CLIENT.storage.from_(args.storage_bucket).upload( + key, payload, {"upsert": "true", "content-type": "application/octet-stream"} + ) + print(f"uploaded: {args.storage_bucket}/{key} (Supabase Storage)", flush=True) + return + + import boto3 # noqa: PLC0415 (boto3 only loads when the owner asks for S3) + + bucket = args.s3_bucket or os.environ.get("ML_S3_BUCKET", "") + prefix = args.s3_prefix or os.environ.get("ML_S3_PREFIX", "predict/ml") + if not bucket: + raise SystemExit("--upload needs --s3-bucket (or ML_S3_BUCKET env, or --storage-bucket)") + key = f"{prefix.rstrip('/')}/{path.name}" + boto3.client("s3").upload_file(str(path), bucket, key) + print(f"uploaded: s3://{bucket}/{key}", flush=True) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--env", default="dev", help="backtrack-table suffix (dev default locally; prod for deploy)") + parser.add_argument("--refresh", action="store_true", help="re-download the table CSV caches") + parser.add_argument( + "--source", + choices=model.FRAME_SOURCES, + default="sqlite", + help="sqlite (default, local raw store) or supabase (published 16 columns)", + ) + parser.add_argument( + "--through-date", default=None, help="last training date YYYY-MM-DD (default: the store/cache's latest date)" + ) + parser.add_argument( + "--seed", + type=int, + default=DEPLOYMENT_SEED, + help="fold-shuffle seed for --oof + metadata (default 0 = the measured best: " + "29.92%% vs 29.41%% s1 / 29.82%% s3)", + ) + parser.add_argument( + "--oof", action="store_true", help="run the k-fold sim after fitting (slow; measures this seed)" + ) + parser.add_argument("--oof-splits", type=int, default=5) + parser.add_argument("--lgbm-config", choices=list(model.LGBM_CONFIGS), default=LGBM_CONFIG) + parser.add_argument( + "--out", default=None, help="override the artifact path (default data/ml/artifact__.joblib)" + ) + parser.add_argument( + "--upload", + action="store_true", + help="push the artifact to Supabase Storage (--storage-bucket) or S3 (default: OFF)", + ) + parser.add_argument( + "--storage-bucket", + default=os.environ.get("ML_STORAGE_BUCKET", ""), + help="Supabase Storage bucket for --upload (no AWS; the dailies read it back with the same SUPABASE_* secrets)", + ) + parser.add_argument("--s3-bucket", default=os.environ.get("ML_S3_BUCKET", "")) + parser.add_argument("--s3-prefix", default=os.environ.get("ML_S3_PREFIX", "predict/ml")) + args = parser.parse_args() + + frame = load_frame(args) + if frame.empty: + raise SystemExit("no scored rows after filters; check --through-date / --env / the cache") + + bundle = fit_bundle(frame, args) + bundle["metadata"]["oof_measured"] = args.oof + path = ( + Path(args.out) + if args.out + else CACHE_DIR / (f"artifact_{bundle['metadata']['train_through']}_{args.seed}.joblib") + ) + if str(path.parent) == str(CACHE_DIR): + CACHE_DIR.mkdir(parents=True, exist_ok=True) + joblib.dump(bundle, path, compress=("zlib", 3)) + print(f"artifact: {path} ({path.stat().st_size / 1_000_000:.1f} MB)", flush=True) + print(f"metadata: {bundle['metadata']}", flush=True) + + if args.oof: + result = run_oof(frame, args) + bundle["metadata"]["oof_measured_acc_pct"] = round(float(result["acc"]), 2) + joblib.dump(bundle, path, compress=("zlib", 3)) + + if args.upload: + upload_artifact(path, args) + else: + print("upload skipped (no --upload; owner rules: on-demand only)", flush=True) + + +if __name__ == "__main__": + main() diff --git a/smartscore/service.py b/smartscore/service.py index 2ea1e629..8eaabb11 100644 --- a/smartscore/service.py +++ b/smartscore/service.py @@ -227,6 +227,9 @@ def make_predictions_teams(players, teams): rust_probabilities = make_predictions_rust.predict(rust_players, min_max, WEIGHTS) for i, player in enumerate(players): player["stat"] = rust_probabilities[i] + # Preserve the site's legacy weighted-average prediction alongside the + # ML-overwritten `stat` (legacy_stat = same value, copied not recomputed). + player["legacy_stat"] = rust_probabilities[i] return players diff --git a/smartscore/utility.py b/smartscore/utility.py index ce318f35..b2c258b3 100644 --- a/smartscore/utility.py +++ b/smartscore/utility.py @@ -206,6 +206,20 @@ def create_cron_schedule(date_string): return cron_expression +# --- Per-game pipeline restart ---------------------------------------------- +# EventBridge stays the SOURCE OF TRUTH for "restart the pipeline ~5 minutes +# after every distinct game start". No ML kick lives here anymore: the kick +# moved downstream INTO the PlayerProcessingPipeline ASL (KickMLPicks Task +# state, after PublishToDb). That ordering is the serialize point - the +# Actions ML pass runs the second the write path (SaveToDb/UpdateHistory/ +# PublishToDb) completes, so its snapshot read can no longer race fresh +# Tims/snapshot writes with stale groups. +PIPELINE_RESTART_OFFSET_MIN = 5 +"""Minutes after each distinct game start the state machine restarts. + +Knob: change here only - the '+5 minutes' timedelta the rules always used.""" + + def delete_expired_rules(): client = boto3.client("events") response = client.list_rules() @@ -221,13 +235,27 @@ def delete_expired_rules(): def schedule_run(times): + """Create one per-game rule with the SINGLE state-machine target. + + Each TriggerStateMachineAt_*-{ENV} rule put by this function targets + ONLY the PlayerProcessingPipeline state machine (the pre-#146 shape). + The old parallel MLPicksKick Lambda target is gone: the ML picks + dispatch now fires from the KickMLPicks state at the END of the state + machine run (after SaveToDb/UpdateHistory/PublishToDb), so nothing can + execute the ML pass before the refetched Tims/LIVE snapshot rows are + written. delete_expired_rules() swaps stale multi-target rules for + single-target ones on the next pipeline event (rules are recreated per + day, same rule-name family). + """ logger.info(f"Scheduling rule for given times: [{times}]") delete_expired_rules() times = sorted(times) for idx, time_str in enumerate(times): event_time = parser.parse(time_str) - trigger_time = event_time + timedelta(minutes=5) + # PIPELINE_RESTART_OFFSET_MIN is the single knob for the game-start + # offset: the state machine restarts just after each game starts. + trigger_time = event_time + timedelta(minutes=PIPELINE_RESTART_OFFSET_MIN) cron_schedule = create_cron_schedule(trigger_time) rule_name = f"TriggerStateMachineAt_{trigger_time.strftime('%Y%m%d%H%M')}-{ENV}" @@ -262,7 +290,7 @@ def schedule_run(times): "Arn": state_machine_arn, "RoleArn": role_arn, "Input": json.dumps(input_payload), - } + }, ], ) diff --git a/supabase/migrations/20261008_add_player_snapshots_backtrack.sql b/supabase/migrations/20261008_add_player_snapshots_backtrack.sql index a217e26c..74c30f6d 100644 --- a/supabase/migrations/20261008_add_player_snapshots_backtrack.sql +++ b/supabase/migrations/20261008_add_player_snapshots_backtrack.sql @@ -1,3 +1,15 @@ +-- (deploy.yml 'Guard migration files' allowlist marker.) +-- BACKTRACK-PROD-PINNED. The -dev backtracking tables were deleted Oct 2026: +-- their rows were removed on 2026-10-24 and the owner issued the final +-- DROP TABLE for the three empty shells that same month +-- (docs/backtrack_dev_deleted.md; DROP SQL in docs/ml-picks-runbook.md, +-- section "Deleting the -dev backtrack table shells"). +-- The standing migrate job re-applies every file in supabase/migrations/ on +-- every run, so ALL statements in this file target the '-prod' tables +-- LITERALLY. Do not re-introduce the __ENV__ token here: a PR deploy with +-- ENV=dev would otherwise revive the retired '-dev' shell. These statements +-- are idempotent no-ops against an environment that never had dev backtrack +-- tables. -- Player-Snapshots-backtrack: season-to-date stats reconstructed from NHL game logs. -- -- WHY THIS EXISTS @@ -88,7 +100,7 @@ -- Idempotent because .github/workflows/deploy.yml pipes every file in this -- directory through psql on every deploy with no migration history. -CREATE TABLE IF NOT EXISTS "Player-Snapshots-backtrack-__ENV__" ( +CREATE TABLE IF NOT EXISTS "Player-Snapshots-backtrack-prod" ( -- Key and identity "date" TEXT NOT NULL, "player_id" BIGINT NOT NULL, @@ -121,16 +133,16 @@ CREATE TABLE IF NOT EXISTS "Player-Snapshots-backtrack-__ENV__" ( -- Training label. null = not graded, matching Player-Snapshots-{ENV}. "scored" INTEGER, - CONSTRAINT "Player-Snapshots-backtrack-__ENV___pkey" PRIMARY KEY ("date", "player_id") + CONSTRAINT "Player-Snapshots-backtrack-prod_pkey" PRIMARY KEY ("date", "player_id") ); -- The PK covers `WHERE date = ?`. This serves the per-player rebuild and the diff -- against Player-Snapshots-{ENV}, which both filter on player_id. -CREATE INDEX IF NOT EXISTS "Player-Snapshots-backtrack-__ENV___player_idx" - ON "Player-Snapshots-backtrack-__ENV__" ("player_id", "date"); +CREATE INDEX IF NOT EXISTS "Player-Snapshots-backtrack-prod_player_idx" + ON "Player-Snapshots-backtrack-prod" ("player_id", "date"); -- Same reasoning as the live archive: the training set is not publicly readable. -ALTER TABLE "Player-Snapshots-backtrack-__ENV__" ENABLE ROW LEVEL SECURITY; +ALTER TABLE "Player-Snapshots-backtrack-prod" ENABLE ROW LEVEL SECURITY; -- The opponent-goalie block moved to Goalie-Snapshots-backtrack-{ENV}, where one -- row per goalie appearance beats one number repeated across ~21 skater rows per @@ -138,13 +150,13 @@ ALTER TABLE "Player-Snapshots-backtrack-__ENV__" ENABLE ROW LEVEL SECURITY; -- move; on a fresh table the columns above are never created and the statements -- are no-ops. publish() stopped sending the keys in the same change (PostgREST -- rejects a batch naming a column the table does not declare). -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_name"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_team"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_status"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_confirmed"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_nhl_id"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_gaa"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_save_pct"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_record"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_shutouts"; -ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-__ENV__" DROP COLUMN IF EXISTS "opp_goalie_games_played"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_name"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_team"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_status"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_confirmed"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_nhl_id"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_gaa"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_save_pct"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_record"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_shutouts"; +ALTER TABLE IF EXISTS "Player-Snapshots-backtrack-prod" DROP COLUMN IF EXISTS "opp_goalie_games_played"; diff --git a/supabase/migrations/20261008_add_team_stats_backtrack.sql b/supabase/migrations/20261008_add_team_stats_backtrack.sql index 6ddc2071..b1d18b41 100644 --- a/supabase/migrations/20261008_add_team_stats_backtrack.sql +++ b/supabase/migrations/20261008_add_team_stats_backtrack.sql @@ -1,3 +1,15 @@ +-- (deploy.yml 'Guard migration files' allowlist marker.) +-- BACKTRACK-PROD-PINNED. The -dev backtracking tables were deleted Oct 2026: +-- their rows were removed on 2026-10-24 and the owner issued the final +-- DROP TABLE for the three empty shells that same month +-- (docs/backtrack_dev_deleted.md; DROP SQL in docs/ml-picks-runbook.md, +-- section "Deleting the -dev backtrack table shells"). +-- The standing migrate job re-applies every file in supabase/migrations/ on +-- every run, so ALL statements in this file target the '-prod' tables +-- LITERALLY. Do not re-introduce the __ENV__ token here: a PR deploy with +-- ENV=dev would otherwise revive the retired '-dev' shell. These statements +-- are idempotent no-ops against an environment that never had dev backtrack +-- tables. -- Team-Stats-backtrack: team-level rates per team per game. -- -- WHY A SEPARATE TABLE @@ -54,7 +66,7 @@ -- Idempotent because .github/workflows/deploy.yml pipes every file in this directory -- through psql on every deploy with no migration history. -CREATE TABLE IF NOT EXISTS "Team-Stats-backtrack-__ENV__" ( +CREATE TABLE IF NOT EXISTS "Team-Stats-backtrack-prod" ( "season" TEXT NOT NULL, "team_abbrev" TEXT NOT NULL, "team_name" TEXT, @@ -63,12 +75,12 @@ CREATE TABLE IF NOT EXISTS "Team-Stats-backtrack-__ENV__" ( "tgpg" DOUBLE PRECISION, "otga" DOUBLE PRECISION, "otshga" DOUBLE PRECISION, - CONSTRAINT "Team-Stats-backtrack-__ENV___pkey" PRIMARY KEY ("season", "team_abbrev", "game_id") + CONSTRAINT "Team-Stats-backtrack-prod_pkey" PRIMARY KEY ("season", "team_abbrev", "game_id") ); -- The PK leads with season/team. This serves the per-date read that joins against -- Player-Snapshots-backtrack-{ENV}, which filters on date. -CREATE INDEX IF NOT EXISTS "Team-Stats-backtrack-__ENV___date_idx" - ON "Team-Stats-backtrack-__ENV__" ("date"); +CREATE INDEX IF NOT EXISTS "Team-Stats-backtrack-prod_date_idx" + ON "Team-Stats-backtrack-prod" ("date"); -ALTER TABLE "Team-Stats-backtrack-__ENV__" ENABLE ROW LEVEL SECURITY; +ALTER TABLE "Team-Stats-backtrack-prod" ENABLE ROW LEVEL SECURITY; diff --git a/supabase/migrations/20261009_add_ppg_player_snapshots_backtrack.sql b/supabase/migrations/20261009_add_ppg_player_snapshots_backtrack.sql index 5af2d176..98af90e0 100644 --- a/supabase/migrations/20261009_add_ppg_player_snapshots_backtrack.sql +++ b/supabase/migrations/20261009_add_ppg_player_snapshots_backtrack.sql @@ -1,3 +1,15 @@ +-- (deploy.yml 'Guard migration files' allowlist marker.) +-- BACKTRACK-PROD-PINNED. The -dev backtracking tables were deleted Oct 2026: +-- their rows were removed on 2026-10-24 and the owner issued the final +-- DROP TABLE for the three empty shells that same month +-- (docs/backtrack_dev_deleted.md; DROP SQL in docs/ml-picks-runbook.md, +-- section "Deleting the -dev backtrack table shells"). +-- The standing migrate job re-applies every file in supabase/migrations/ on +-- every run, so ALL statements in this file target the '-prod' tables +-- LITERALLY. Do not re-introduce the __ENV__ token here: a PR deploy with +-- ENV=dev would otherwise revive the retired '-dev' shell. These statements +-- are idempotent no-ops against an environment that never had dev backtrack +-- tables. -- ppg: power play goals per game, single season, on Player-Snapshots-backtrack. -- -- WHY A NEW COLUMN @@ -16,5 +28,5 @@ -- directory through psql on every deploy with no migration history: a plain ADD -- COLUMN would fail on the second run. -ALTER TABLE "Player-Snapshots-backtrack-__ENV__" +ALTER TABLE "Player-Snapshots-backtrack-prod" ADD COLUMN IF NOT EXISTS "ppg" DOUBLE PRECISION; diff --git a/supabase/migrations/20261015_add_goalie_snapshots_backtrack.sql b/supabase/migrations/20261015_add_goalie_snapshots_backtrack.sql index 6de9633d..fd9e3660 100644 --- a/supabase/migrations/20261015_add_goalie_snapshots_backtrack.sql +++ b/supabase/migrations/20261015_add_goalie_snapshots_backtrack.sql @@ -1,3 +1,15 @@ +-- (deploy.yml 'Guard migration files' allowlist marker.) +-- BACKTRACK-PROD-PINNED. The -dev backtracking tables were deleted Oct 2026: +-- their rows were removed on 2026-10-24 and the owner issued the final +-- DROP TABLE for the three empty shells that same month +-- (docs/backtrack_dev_deleted.md; DROP SQL in docs/ml-picks-runbook.md, +-- section "Deleting the -dev backtrack table shells"). +-- The standing migrate job re-applies every file in supabase/migrations/ on +-- every run, so ALL statements in this file target the '-prod' tables +-- LITERALLY. Do not re-introduce the __ENV__ token here: a PR deploy with +-- ENV=dev would otherwise revive the retired '-dev' shell. These statements +-- are idempotent no-ops against an environment that never had dev backtrack +-- tables. -- Goalie-Snapshots-backtrack: season-to-date goalie stats reconstructed from NHL game logs. -- -- WHY A SEPARATE TABLE @@ -53,7 +65,7 @@ -- Idempotent because .github/workflows/deploy.yml pipes every file in this -- directory through psql on every deploy with no migration history. -CREATE TABLE IF NOT EXISTS "Goalie-Snapshots-backtrack-__ENV__" ( +CREATE TABLE IF NOT EXISTS "Goalie-Snapshots-backtrack-prod" ( "season" TEXT NOT NULL, "player_id" BIGINT NOT NULL, "team_abbrev" TEXT NOT NULL, @@ -68,12 +80,12 @@ CREATE TABLE IF NOT EXISTS "Goalie-Snapshots-backtrack-__ENV__" ( "shutouts" INTEGER, "games_played" INTEGER, - CONSTRAINT "Goalie-Snapshots-backtrack-__ENV___pkey" PRIMARY KEY ("season", "player_id", "date") + CONSTRAINT "Goalie-Snapshots-backtrack-prod_pkey" PRIMARY KEY ("season", "player_id", "date") ); -- The PK covers reads filtered by player_id. This serves the join from -- Player-Snapshots-backtrack-{ENV}, which filters on date. -CREATE INDEX IF NOT EXISTS "Goalie-Snapshots-backtrack-__ENV___date_idx" - ON "Goalie-Snapshots-backtrack-__ENV__" ("date"); +CREATE INDEX IF NOT EXISTS "Goalie-Snapshots-backtrack-prod_date_idx" + ON "Goalie-Snapshots-backtrack-prod" ("date"); -ALTER TABLE "Goalie-Snapshots-backtrack-__ENV__" ENABLE ROW LEVEL SECURITY; +ALTER TABLE "Goalie-Snapshots-backtrack-prod" ENABLE ROW LEVEL SECURITY; diff --git a/supabase/migrations/20261024_add_shot_columns_player_snapshots_backtrack.sql b/supabase/migrations/20261024_add_shot_columns_player_snapshots_backtrack.sql new file mode 100644 index 00000000..105278c2 --- /dev/null +++ b/supabase/migrations/20261024_add_shot_columns_player_snapshots_backtrack.sql @@ -0,0 +1,64 @@ +-- (deploy.yml 'Guard migration files' allowlist marker.) +-- BACKTRACK-PROD-PINNED. The -dev backtracking tables were deleted Oct 2026: +-- their rows were removed on 2026-10-24 and the owner issued the final +-- DROP TABLE for the three empty shells that same month +-- (docs/backtrack_dev_deleted.md; DROP SQL in docs/ml-picks-runbook.md, +-- section "Deleting the -dev backtrack table shells"). +-- The standing migrate job re-applies every file in supabase/migrations/ on +-- every run, so ALL statements in this file target the '-prod' tables +-- LITERALLY. Do not re-introduce the __ENV__ token here: a PR deploy with +-- ENV=dev would otherwise revive the retired '-dev' shell. These statements +-- are idempotent no-ops against an environment that never had dev backtrack +-- tables. +-- Player-Snapshots-backtrack: shot/TOI rolling block + club identity (16 new columns). +-- +-- SPEC: docs/supabase_shot_columns.md (§1 Block A, §2 Block B, §4 sketch). +-- Regressed in from the migration sketch there; the owner-approved option 1 +-- ("train purely from Supabase") turns the sketch into this file. Backfill of +-- the values is a one-shot job (smartscore/scripts/backtrack/publish_shot_cols.py) +-- run after this migration lands; publish() then carries the same keys daily. +-- +-- WHY (Block A - the 14 shot/TOI features, model.py SHOT_FEATURES at c82b2e7) +-- The ensemble's shot/TOI/rolling block (sd_*, r5/r10_*, ewm_*, career_*) is +-- computed against data/raw_nhl.sqlite by model.py shot_features(). SQLite is +-- not reachable from the in-cloud ML Lambda, so those 14 features are the only +-- DATASET_FEATURES inputs missing from Supabase. This migration adds the +-- columns holding their precomputed values; the strictly-prior-games semantics +-- ("entering game D", sorted (player_id, date, season), shift(1)) are the +-- same shape Player-Snapshots-backtrack already has - one row per player per +-- game date, values prefixed by games strictly before D. +-- +-- WHY (Block B - the 2 club-abbreviation columns) +-- club_map() joins player_games.team_abbrev / opponent_abbrev per +-- (date, player_id) because the snapshot's team_name is a place name that +-- renders both New York clubs as "New York", never resolvable by name merge. +-- Publishing the abbreviations makes club := team_abbrev and +-- opp := opponent_abbrev available without SQLite. Never join by team_name. +-- +-- No PK change: all 16 columns ride the existing (date, player_id) primary +-- key through upsert. No Team-Stats-backtrack / Goalie-Snapshots-backtrack +-- change: their rates already cover the team and opposing-goalie features +-- joined at read time. Down-migration is a plain DROP COLUMN of these 16. +ALTER TABLE "Player-Snapshots-backtrack-prod" + ADD COLUMN IF NOT EXISTS "sd_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "sd_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "sd_toi_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "sd_sh_pct" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r5_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r5_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r10_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r10_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "r10_toi_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "ewm_goals" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "ewm_shots" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "career_games" INTEGER, + ADD COLUMN IF NOT EXISTS "career_goals_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "career_shots_pg" DOUBLE PRECISION, + ADD COLUMN IF NOT EXISTS "team_abbrev" TEXT, + ADD COLUMN IF NOT EXISTS "opponent_abbrev" TEXT; + +-- Optional: serves the (date, club) join that Team-Stats lookups prefer. +-- The existing PK (date, player_id) already leads with date, so this index is +-- only worth adding if the planner churns on it in practice. +-- CREATE INDEX IF NOT EXISTS "Player-Snapshots-backtrack-prod_club_idx" +-- ON "Player-Snapshots-backtrack-prod" ("team_abbrev", "date"); diff --git a/supabase/migrations/20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql b/supabase/migrations/20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql new file mode 100644 index 00000000..3ec648e2 --- /dev/null +++ b/supabase/migrations/20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql @@ -0,0 +1,98 @@ +-- (deploy.yml 'Guard migration files' allowlist marker.) +-- BACKTRACK-PROD-PINNED. The -dev backtracking tables were deleted Oct 2026: +-- their rows were removed on 2026-10-24 and the owner issued the final +-- DROP TABLE for the three empty shells that same month +-- (docs/backtrack_dev_deleted.md; DROP SQL in docs/ml-picks-runbook.md, +-- section "Deleting the -dev backtrack table shells"). +-- The standing migrate job re-applies every file in supabase/migrations/ on +-- every run, so ALL statements in this file target the '-prod' tables +-- LITERALLY. Do not re-introduce the __ENV__ token here: a PR deploy with +-- ENV=dev would otherwise revive the retired '-dev' shell. These statements +-- are idempotent no-ops against an environment that never had dev backtrack +-- tables. +-- Player-Snapshots-backtrack: the RAW per-game layer, in-column (stage 2 - +-- exact same-day rolling/career features at picks time). +-- +-- WHY (Block C - the raw per-game numbers) +-- The 16 shot/TOI columns of 20261024 are AGGREGATES ("entering game D", one +-- value per published row). They cannot state a game that the backtrack +-- publish has not covered yet, so a run on the morning after games computes +-- every rolling/ewm/career feature WITHOUT those games. Block C adds the +-- numbers themselves, per player per game, so the daily pick pass can extend +-- the per-game ledger itself: +-- +-- * the FIRST run of a day backfills YESTERDAY's (and any older uncovered) +-- completed games' per-player raw stats into these columns (run_daily_picks +-- .backfill_raw_game_days, keyed (date, player_id), boxscore-sourced - +-- shots/points per skater per game from gamecenter boxscores, toi parsed +-- to decimal minutes by the same parser shot_features always used); +-- * every run then recomputes today's 14 shot/TOI features with the exact +-- shot_features math (model.shot_features_from_games - imported, never +-- forked) over the per-game history INCLUDING that backfill, instead of +-- attaching last published aggregates (the stage-1 approximation). +-- +-- COLUMN CHOICE - exactly what the features consume +-- model.shot_features()/shot_features_from_games read per game exactly +-- goals, shots, toi (MM:SS or minutes; grouped per player and season, and +-- expanded career sums). add_derived's prior-goal/rolling-scored features read +-- the row's `scored` label (existing column). So the block ships: +-- game_shots, game_goals, game_points, game_toi_min +-- game_points is not consumed by any of the 14 (goals are) but is free from the +-- same boxscore and is the per-game provenance the trending rates quote; it +-- ships for the audit trail. game_plusminus / assists / pim / shift counts were +-- checked and are consumed by NO feature today (drop them instead of paying +-- four never-read columns; the source-of-truth raw layer stays +-- data/data dumps + data/raw_nhl.sqlite for anything widened later). +-- `played` needs NO flag: for a completed game, a row carrying non-null +-- game_shots IS the played mark (a boxscore lists exactly the players who +-- appeared); (date, player_id) is the PK. +-- +-- APPLIED BY: deploy.yml's standing `migrate` job (lint + test, then psql +-- --single-transaction over supabase/migrations/ with prod substituted): +-- ENV=prod on a push to main, ENV=dev on a PR carrying the `deploy` label. +-- Nothing else auto-applies migrations; idempotency (ADD COLUMN IF NOT +-- EXISTS) is what makes the every-run re-apply safe. The stage-2 exactness +-- contract: the precomputed r5/r10/ewm/career publish-cols (20261024) stay +-- untouched - these per-game columns are the raw layer a later stage +-- recomputes them from. + +ALTER TABLE "Player-Snapshots-backtrack-prod" + ADD COLUMN IF NOT EXISTS "game_shots" INTEGER, + ADD COLUMN IF NOT EXISTS "game_goals" INTEGER, + ADD COLUMN IF NOT EXISTS "game_points" INTEGER, + ADD COLUMN IF NOT EXISTS "game_toi_min" DOUBLE PRECISION; + +-- The backfill idempotency markers. +-- +-- WHY: the backfill is the day's FIRST run's write step (before the picks +-- compute; run_daily_picks runs it every pass). It must be a no-op on the +-- later passes the same day (the per-game kick architecture fires ~15 runs +-- per slate date) and re-entrant after a partial crawl. A marker ROW per +-- processed date settles both: once a date is fully written the marker is +-- upserted and every subsequent pass skips the date without re-crawling; a +-- date whose writes failed, or whose games had not all ended (FUT/LIVE +-- state), stays UNMARKED and is retried by a later run. games/player_games +-- record what the date held; backfilled_at is the stamp. +-- +-- TEXT date: the whole backtrack family keys dates as TEXT +-- (20261008_add_player_snapshots_backtrack.sql); the marker keys must stringed +-- compare the same way. +CREATE TABLE IF NOT EXISTS "Player-Game-Raw-Markers-prod" ( + "date" TEXT NOT NULL, + "games" INTEGER NOT NULL, + "player_games" INTEGER NOT NULL, + "backfilled_at" TIMESTAMPTZ NOT NULL DEFAULT now(), + CONSTRAINT "Player-Game-Raw-Markers-prod_pkey" PRIMARY KEY ("date") +); + +-- Same exposure stance as the backtrack family: service role only (the pick +-- run's client), no anon reads. +ALTER TABLE "Player-Game-Raw-Markers-prod" ENABLE ROW LEVEL SECURITY; + +-- NO retroactive data backfill of this migration itself: the crawl that built +-- the backtrack family already landed every historical date it covered, and +-- the local raw store (data/dumps/.sql.gz -> data/raw_nhl.sqlite) +-- carries the full per-game precision for 2013-10-01..last dump. So the +-- pre-gap published rows leave Block C NULL and the daily run fills the +-- columns FORWARD (yesterday-forward, per (date, player_id) upserts). A +-- down-migration is a plain DROP of the four columns + the marker table. diff --git a/supabase/migrations/20261103_add_legacy_stat_column.sql b/supabase/migrations/20261103_add_legacy_stat_column.sql new file mode 100644 index 00000000..6369954f --- /dev/null +++ b/supabase/migrations/20261103_add_legacy_stat_column.sql @@ -0,0 +1,20 @@ +-- Migration: preserve the site's legacy weighted-average prediction on Picks. + +-- The site's own publish writes its weighted-average score into `stat`; the +-- ML overlay later overwrites `stat` with the ML rank percentile (0-1). To +-- keep the site's original value available alongside, store it in +-- `legacy_stat` (same 0-1 scale). Written by the site publish only; the ML +-- overlay never touches it. + +-- Dev and prod share one Supabase project and differ only by table-name +-- suffix (see f"Picks-{ENV}" in smartscore/utility.py). The table name below +-- therefore uses an __ENV__ placeholder. Every statement is idempotent +-- (ADD COLUMN IF NOT EXISTS). psql keeps no migration history, so CI +-- re-applies every file on each run. + +-- No SQL backfill: existing rows populate on the next site publish. Only the +-- Picks table is touched; Historic-Picks and the ML log payload are out of +-- scope for this migration. + +ALTER TABLE "Picks-__ENV__" + ADD COLUMN IF NOT EXISTS "legacy_stat" DOUBLE PRECISION; diff --git a/templates/player_processing_pipeline.asl.json b/templates/player_processing_pipeline.asl.json index 62959c60..25595f6c 100644 --- a/templates/player_processing_pipeline.asl.json +++ b/templates/player_processing_pipeline.asl.json @@ -77,7 +77,7 @@ }, "EnsureFirstRunStatus": { "Type": "Pass", - "Comment": "The GetPlayers sub-machine returns only players/teams. This branch is first_run by construction, so restore the status CheckInitialRun/CheckSaveHistory need.", + "Comment": "The GetPlayers sub-machine returns only players/teams. This branch is first_run by construction, so restore the status CheckSaveHistory need.", "Parameters": { "players.$": "$.players", "teams.$": "$.teams", @@ -118,24 +118,9 @@ }, "GetTims": { "Type": "Task", + "Comment": "First/normal runs archive AND publish via SaveToDb (PR #134 made normal_run archive too, and PR #136 made last_run exit at CheckLastRun), so the former CheckInitialRun Choice state had all three branches going to the same SaveToDb and was removed. CheckSaveHistory still branches on $.status.", "Resource": "arn:aws:lambda:${AWS_REGION}:${AWS_ACCOUNT_ID}:function:GetTims-${ENV}", - "Next": "CheckInitialRun" - }, - "CheckInitialRun": { - "Type": "Choice", - "Choices": [ - { - "Variable": "$.status", - "StringEquals": "first_run", - "Next": "SaveToDb" - }, - { - "Variable": "$.status", - "StringEquals": "normal_run", - "Next": "SaveToDb" - } - ], - "Default": "SaveToDb" + "Next": "SaveToDb" }, "SaveToDb": { "Type": "Task", @@ -160,7 +145,18 @@ }, "PublishToDb": { "Type": "Task", + "Comment": "Publishes the LIVE snapshot rows. No longer End:true: the KickMLPicks state follows, so the ML picks dispatch can only fire once this write (incl. the refetched tims) has completed - that ASL ordering is the serialize point for the Actions pass (PR #146 follow-up race fix). KickMLPicks expects this state to carry 'date', which handle_publish_db returns (the event's carried date, else get_date()).", "Resource": "arn:aws:lambda:${AWS_REGION}:${AWS_ACCOUNT_ID}:function:PublishDb-${ENV}", + "Next": "KickMLPicks" + }, + "KickMLPicks": { + "Type": "Task", + "Comment": "Race fix (PR #146 follow-up): the ML picks dispatch used to be a parallel EventBridge target firing at game_start+5min, racing this run's SaveToDb/UpdateHistory/PublishToDb writes (Actions computed picks from stale groups). The kick now fires here, at the END of the write path on BOTH first_run and normal/last_run exec-rounds, invoking the MLPicksKick relay Lambda with the explicit contract {'date': } from the pipeline's own state ($.date) - no more schedule_time date stamping. ResultPath NONE keeps the state lean; no Retry (a relay 4xx fails the run loudly - re-triggering the game-start rule is an idempotent re-kick), and a successful dispatch is the expected empty 204.", + "Resource": "arn:aws:lambda:${AWS_REGION}:${AWS_ACCOUNT_ID}:function:MLPicksKick-${ENV}", + "Parameters": { + "date.$": "$.date" + }, + "ResultPath": null, "End": true } } diff --git a/templates/template.yaml b/templates/template.yaml index 7364d2be..e9baa3ef 100644 --- a/templates/template.yaml +++ b/templates/template.yaml @@ -31,7 +31,19 @@ Parameters: Type: String Default: "" Description: PostHog project/personal API key for runtime feature-flag evaluation - + GithubDispatchToken: + Type: String + NoEcho: true + Default: "" + Description: >- + Fine-grained PAT (Actions: Read & write AND Contents: Read & write, + this repo only - Actions: write alone is REJECTED with 403) that + MLPicksKick-{ENV} uses to repository_dispatch 'ml-picks-game' into + .github/workflows/ml-picks.yml. (CFN logical IDs are alphanumeric-only, + so the environment-variable-style GITHUB_DISPATCH_TOKEN name cannot be + used as a declaration key here.) Empty is allowed (deploy param + override or GITHUB_DISPATCH_TOKEN env in deploy.sh); the relay then + fails loudly per invocation instead of silently dropping kicks. Resources: # IAM Role for Lambda Execution LambdaExecutionRole: @@ -103,6 +115,7 @@ Resources: - !GetAtt SendEmailsFunction.Arn - !GetAtt SavePlayersFunction.Arn - !GetAtt LoadWorkingSetFunction.Arn + - !GetAtt MLPicksKickFunction.Arn - Effect: Allow Action: - states:StartExecution @@ -495,6 +508,62 @@ Resources: SUPABASE_SERVICE_ROLE_KEY: !Ref SupabaseServiceRoleKey POSTHOG_FEATURE_FLAG_KEY: !Ref PosthogApiKey + # Per-game ML picks kick relay: the PlayerProcessingPipeline state + # machine's KickMLPicks Task state invokes this Lambda at the END of the + # run (after SaveToDb/UpdateHistory/PublishToDb) so the GitHub Actions + # ML pass only starts once today's snapshot rows are published (PR #146 + # follow-up race fix). No Supabase access, stdlib urllib only. Real code + # is pushed by deploy.sh's LAMBDA_FUNCTIONS loop (MLPicksKick-$ENV entry). + MLPicksKickFunction: + Type: AWS::Lambda::Function + Properties: + FunctionName: !Sub "MLPicksKick-${ENV}" + Handler: event_handler.handle_ml_picks_kick + Role: !GetAtt LambdaExecutionRole.Arn + Runtime: python3.12 + # One urllib POST + one backoff retry: 30s is generous headroom. + Timeout: 30 + MemorySize: 512 + Code: + ZipFile: | + # Provisional entry matching the Handler below; deploy.sh pushes + # the real event_handler.py via update-function-code right after. + def handle_ml_picks_kick(event, context): + return {"status": "lambda function placeholder"} + # ENV wiring (PR #146 escalation): the Handler lives in the SHARED + # event_handler module chain (event_handler.handle_ml_picks_kick -> + # player_archive.py:38 -> config.py), and config.py builds BOTH + # Supabase clients at import time (config.py:19/:23). Without the + # Supabase env the COLD START dies with SupabaseException before the + # handler runs - which is exactly how MLPicksKick-{env} deployed with + # only GITHUB_DISPATCH_TOKEN failed to ever boot. The relay still never + # USES the clients (stdlib urllib relay only); this wiring exists for + # the import, from the SAME parameters the other 15 functions use + # (SupabaseUrl/SupabaseApiKey/SupabaseServiceRoleKey) - no new secrets. + # ENV/POSTHOG_FEATURE_FLAG_KEY are NOT needed here: the import chain + # defaults ENV ("dev", config.py:12) and only lazily consults PostHog, + # and the relay never evaluates flags. + Environment: + Variables: + SUPABASE_URL: !Ref SupabaseUrl + SUPABASE_API_KEY: !Ref SupabaseApiKey + SUPABASE_SERVICE_ROLE_KEY: !Ref SupabaseServiceRoleKey + GITHUB_DISPATCH_TOKEN: !Ref GithubDispatchToken + + # State machine -> Lambda invoke grant. The OLD MLPicksKickFunctionPermission + # (Principal: events.amazonaws.com, SourceArn scoped to the per-game + # TriggerStateMachineAt_* rules) is REMOVED - EventBridge no longer targets + # this Lambda; the state machine is the invoke principal (defensive + # function-level policy here, primary grant is the StateMachineExecutionRole + # Resource list above). + MLPicksKickStatePermission: + Type: AWS::Lambda::Permission + Properties: + FunctionName: !GetAtt MLPicksKickFunction.Arn + Action: lambda:InvokeFunction + Principal: states.amazonaws.com + SourceArn: !Sub "arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:PlayerProcessingPipeline-${ENV}" + # IAM Role for EventBridge to invoke Step Function EventBridgeInvokeRole: Type: AWS::IAM::Role @@ -677,6 +746,12 @@ Resources: LogGroupName: !Sub "/aws/lambda/GetGoalies-${ENV}" RetentionInDays: 1 + MLPicksKickLogGroup: + Type: AWS::Logs::LogGroup + Properties: + LogGroupName: !Sub "/aws/lambda/MLPicksKick-${ENV}" + RetentionInDays: 1 + Outputs: StepFunctionExecutionRoleArn: Description: IAM role ARN to be used by Step Functions diff --git a/tests/unit/test_backfill_missing_days.py b/tests/unit/test_backfill_missing_days.py new file mode 100644 index 00000000..5654666e --- /dev/null +++ b/tests/unit/test_backfill_missing_days.py @@ -0,0 +1,692 @@ +"""Unit tests for the stage-2 gap-fill helper (backfill_missing_days.py): +write semantics (raw-columns-only top-up, minimal-row creation, marker +idempotency, dry = zero writes), the FINAL-state / fresh-cache guards, and +the exact rolling/career recompute's parity against the local-store path. +""" + +import datetime +import importlib.util +import sqlite3 +import sys +from pathlib import Path +from unittest.mock import MagicMock +from zoneinfo import ZoneInfo + +import pandas as pd +import pytest + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT / "smartscore")) +sys.path.insert(1, str(ROOT / "smartscore" / "scripts" / "backtrack")) + +_spec = importlib.util.spec_from_file_location( + "backfill", ROOT / "smartscore" / "scripts" / "backtrack" / "backfill_missing_days.py" +) +bf = importlib.util.module_from_spec(_spec) +sys.modules["backfill"] = bf +_spec.loader.exec_module(bf) + +model = sys.modules["model"] if "model" in sys.modules else __import__("model") + +# ------------------------------------------------------------------ fixture + +GAME_ID = 2026010001 +DAY = "2026-10-25" +DAY_BEFORE = "2026-10-24" + +# One precomputed rolling column with a sentinel value on the published rows: +# if any upsert payload ever carried it, the merge-duplicates apply below +# would overwrite the sentinel and the test fails. +PRECOMPUTED_SENTINEL = 9.9 + + +def fake_boxscore_records(): + """fetch_boxscore's normalised shape (subset of fields the wrapper reads).""" + return [ + { + "game_id": GAME_ID, + "game_date": DAY, + "player_id": 1, + "name": "A. Forward", + "team_abbrev": "TOR", + "position": "C", + "goals": 1, + "points": 2, + "shots": 3, + "toi": "18:31", + }, + { + "game_id": GAME_ID, + "game_date": DAY, + "player_id": 2, + "name": "B. Defence", + "team_abbrev": "TOR", + "position": "D", + "goals": 0, + "points": 0, + "shots": 0, + "toi": None, + }, + { + "game_id": GAME_ID, + "game_date": DAY, + "player_id": 3, + "name": "C. Newcomer", + "team_abbrev": "MTL", + "position": "W", + "goals": 0, + "points": 1, + "shots": 2, + "toi": "12:00", + }, + { + "game_id": GAME_ID, + "game_date": DAY, + "player_id": 99, + "name": "G. Goalie", + "team_abbrev": "TOR", + "position": "G", + "goals": 0, + "points": 0, + "shots": 0, + "toi": "60:00", + }, + ] + + +def fake_schedule(states=("FINAL", "OFF", "LIVE", "FUT", "PPD")): + """A fetch_schedule payload for one week with DAY's games (one per state).""" + games = [] + for index, state in enumerate(states): + games.append( + { + "id": GAME_ID + index, + "gameType": 2, + "gameState": state, + "gameDate": DAY, + "startTimeUTC": f"{DAY}T23:00:00Z", + "homeTeam": {"abbrev": "TOR"}, + "awayTeam": {"abbrev": "MTL"}, + } + ) + return {"gameWeek": [{"date": DAY, "games": games}]} + + +class FakeSnapshotTable: + """Player-Snapshots-backtrack fake: merge-duplicates upsert semantics - + an existing (date, player_id) row is updated ONLY in the payload's keys + (a missing key survives untouched), a missing row is appended.""" + + def __init__(self, frame): + self._frame = frame + self.upserts = [] + self._eq = None + self._low = None + self._desc_sort = False + + def select(self, *_a, **_k): + self._eq = None + self._low = None + self._desc_sort = False + if hasattr(self, "_page"): + del self._page # a new query chain starts fresh (real PostgREST builders do) + return self + + def order(self, _col, desc=False): + self._desc_sort = bool(desc) + return self + + def limit(self, _n): + return self + + def eq(self, _col, value): + self._eq = value + return self + + def gte(self, _col, value): + self._low = value + return self + + def range(self, lo, hi): + self._page = (lo, hi) + return self + + def _view(self): + rows = self._frame + if self._eq is not None: + rows = rows[rows["date"].astype(str) == str(self._eq)] + if self._low is not None: + rows = rows[rows["date"].astype(str) >= str(self._low)] + if self._desc_sort: + rows = rows.sort_values("date", ascending=False) + return rows + + def execute(self): + rows = self._view() + if hasattr(self, "_page"): + lo, hi = self._page + rows = rows.iloc[lo : min(hi + 1, len(rows))] + return MagicMock(data=rows.to_dict("records")) + + def upsert(self, rows, on_conflict=None, returning=None): + assert on_conflict == "date,player_id" + assert _is_json_safe(rows) + self.upserts.append(list(rows)) + return self + + def apply_upserts(self): + """Merge-duplicates: existing keys update provided keys ONLY.""" + for batch in self.upserts: + for row in batch: + mask = (self._frame["date"].astype(str) == str(row["date"])) & ( + self._frame["player_id"].astype(int) == int(row["player_id"]) + ) + if mask.any(): + for key, value in row.items(): + self._frame.loc[mask, key] = value + else: + self._frame = pd.concat([self._frame, pd.DataFrame([row])], ignore_index=True) + + +class FakeMarkerTable(FakeSnapshotTable): + """Player-Game-Raw-Markers fake: PK (date,) upserts, readable back.""" + + def upsert(self, rows, on_conflict=None, returning=None): + assert on_conflict == "date" + assert _is_json_safe(rows) + self.upserts.append(list(rows)) + self.apply_upserts() # markers are readable by the very next read + return self + + def apply_upserts(self): + for batch in self.upserts: + for row in batch: + mask = self._frame["date"].astype(str) == str(row["date"]) + if mask.any(): + for key, value in row.items(): + self._frame.loc[mask, key] = value + else: + self._frame = pd.concat([self._frame, pd.DataFrame([row])], ignore_index=True) + + +def _is_json_safe(rows): + import math # noqa: PLC0415 + + for row in rows: + for value in row.values(): + if value is None: + continue + if isinstance(value, float) and math.isnan(value): + return False + if not isinstance(value, (str, int, float, bool)): + return False + return True + + +def published_frame(with_day_rows=False): + """Rows the publish already owns: dates strictly before DAY (so + latest_published_date < through and the window opens), each carrying a + sentinel precomputed rolling column the backfill must never touch. + ``with_day_rows`` adds DAY rows (the two-lane test patches + latest_published_date to keep the window open).""" + rows = [] + for day in ("2026-10-20", DAY_BEFORE): + for player in (1, 2): + rows.append( + { + "date": day, + "player_id": player, + "name": f"p{player}", + "r10_shots_pg": PRECOMPUTED_SENTINEL, + } + ) + if with_day_rows: + for player in (1, 2): + rows.append({"date": DAY, "player_id": player, "name": f"p{player}", "r10_shots_pg": PRECOMPUTED_SENTINEL}) + return pd.DataFrame(rows) + + +@pytest.fixture +def wired(monkeypatch): + """Latest published date = DAY_BEFORE; DAY's players 1+2 already + published (with the sentinel precomputed column), player 3 absent.""" + snapshots = FakeSnapshotTable(published_frame()) + markers = FakeMarkerTable(pd.DataFrame(columns=["date", "games", "player_games", "backfilled_at"])) + fake_client = MagicMock() + + def _table(name): + if name == bf.player_table("prod"): + return snapshots + if name == bf.marker_table("prod"): + return markers + raise AssertionError(f"unexpected table {name}") + + fake_client.table.side_effect = _table + monkeypatch.setattr(bf, "SUPABASE_ADMIN_CLIENT", fake_client) + monkeypatch.setattr(bf, "fetch_schedule", lambda date, delay_seconds=None: fake_schedule()) + monkeypatch.setattr(bf, "fetch_boxscore", lambda game_id, delay_seconds=None, **_k: fake_boxscore_records()) + return snapshots, markers + + +# ----------------------------------------------------------- write semantics + + +def test_backfill_writes_only_missing_dates_rows(wired): + """One missing day (DAY); the writes carry only that day's rows - the + CREATE lane (identity + raw) for every boxscore skater the table lacks, + goalies excluded.""" + snapshots, _markers = wired + summary = bf.backfill("prod", through_date=DAY, dry=False) + assert summary["games"] == 2 # FINAL + OFF are terminal; LIVE/FUT/PPD skipped + upsert_dates = {row["date"] for batch in snapshots.upserts for row in batch} + assert upsert_dates <= {DAY} + keys = [(row["date"], row["player_id"]) for batch in snapshots.upserts for row in batch] + assert (DAY, 1) in keys and (DAY, 2) in keys and (DAY, 3) in keys + assert not any(key == (DAY, 99) for key in keys) # goalies excluded + raw_keys = {"date", "player_id", "game_goals", "game_shots", "game_points", "game_toi_min"} + create_rows = [row for batch in snapshots.upserts for row in batch if set(row) != raw_keys] + assert {row["player_id"] for row in create_rows} == {1, 2, 3} + newcomer = next(row for row in create_rows if row["player_id"] == 3) + assert newcomer["team_abbrev"] == "MTL" + assert newcomer["opponent_abbrev"] == "TOR" and newcomer["scored"] == 0 + # the backtracking table carries NO season column (run_daily_picks derives + # the season label from the date) - a season key would be a PGRST204 400 + assert "season" not in newcomer + + +def test_backfill_two_lanes_top_up_existing_create_absent(wired, monkeypatch): + """The two-lane split: a player the table already published for DAY gets + ONLY the raw block (update lane); an absent player gets the minimal + identity+raw shape (create lane). latest_published_date is patched so the + window stays open despite the DAY rows.""" + snapshots, _markers = wired + day_rows = published_frame(with_day_rows=True) + snapshots._frame = pd.concat([snapshots._frame, day_rows[day_rows["date"] == DAY]], ignore_index=True) + monkeypatch.setattr(bf, "latest_published_date", lambda env: DAY_BEFORE) + summary = bf.backfill("prod", through_date=DAY, dry=False) + assert summary["games"] == 2 + raw_keys = {"date", "player_id", "game_goals", "game_shots", "game_points", "game_toi_min"} + update_rows = [row for batch in snapshots.upserts for row in batch if set(row) == raw_keys] + create_rows = [row for batch in snapshots.upserts for row in batch if set(row) != raw_keys] + assert {row["player_id"] for row in update_rows} == {1, 2} + assert {row["player_id"] for row in create_rows} == {3} + + +def test_backfill_never_overwrites_precomputed_columns_or_duplicates(wired, monkeypatch): + """(test c) The first-run backfill on rows the publish already wrote: + merge-duplicates applies ONLY the raw keys - the 16 precomputed rolling + columns keep their published values, and no (date, player_id) row is + duplicated.""" + snapshots, _markers = wired + day_rows = published_frame(with_day_rows=True) + snapshots._frame = pd.concat([snapshots._frame, day_rows[day_rows["date"] == DAY]], ignore_index=True) + monkeypatch.setattr(bf, "latest_published_date", lambda env: DAY_BEFORE) + before_rows = len(snapshots._frame) + bf.backfill("prod", through_date=DAY, dry=False) + snapshots.apply_upserts() + preexisting = snapshots._frame.iloc[:before_rows] + assert (preexisting["r10_shots_pg"] == PRECOMPUTED_SENTINEL).all() + assert len(snapshots._frame) == before_rows + 1 # exactly one created row (player 3) + keys = list(zip(snapshots._frame["date"].astype(str), snapshots._frame["player_id"].astype(int))) + assert len(keys) == len(set(keys)) + + +def test_backfill_marker_makes_second_run_a_pure_skip(wired, monkeypatch): + """(test e) First-run-of-day semantics, both idempotency paths: + + * the created rows advance the table's latest published date, so the + next pass finds latest >= through and stops before any request; + * when NO row was created (all boxscore players already published), the + latest date stays behind - the MARKER then settles it: the marked date + is skipped with zero NHL requests and zero writes. + """ + snapshots, markers = wired + first = bf.backfill("prod", through_date=DAY, dry=False) + assert first["backfilled"] == [DAY] and len(markers.upserts) == 1 + snapshots.apply_upserts() # the created row advances latest_published_date + + fetches = [] + + def _track_schedule(date, delay_seconds=None): + fetches.append(date) + return fake_schedule() + + monkeypatch.setattr(bf, "fetch_schedule", _track_schedule) + batches_before = len(snapshots.upserts) + second = bf.backfill("prod", through_date=DAY, dry=False) + assert second["status"] == "up-to-date" and second["games"] == 0 + assert len(snapshots.upserts) == batches_before # no new writes + assert len(markers.upserts) == 1 # no second marker write + assert fetches == [] # no NHL request at all + + # the marker-only path: drop every DAY row so latest falls back behind + # DAY, keep the marker, re-run - the marked date is skipped, silently. + snapshots._frame = snapshots._frame[snapshots._frame["date"].astype(str) != DAY].reset_index(drop=True) + snapshots.upserts.clear() + third = bf.backfill("prod", through_date=DAY, dry=False) + assert third["skipped"] == [DAY] and third["games"] == 0 + assert snapshots.upserts == [] and fetches == [] + + +def test_backfill_dry_prevents_all_writes(wired, capsys): + """(test d) dry=True: the reads happen (schedule + boxscore), but ZERO + Supabase writes of any kind - no player-row upsert, no marker row.""" + snapshots, markers = wired + summary = bf.backfill("prod", through_date=DAY, dry=True) + out = capsys.readouterr().out + assert snapshots.upserts == [] and markers.upserts == [] + assert summary["rows"] > 0 # the dry pass still counts what it WOULD write + assert "dry-read" in out and "(dry)" in out + + +def test_backfill_partial_failure_continues_and_reports(wired, monkeypatch): + """One failed date stays UNMARKED and the run continues to the next - + the summary names both (the picks pass proceeds either way).""" + snapshots, markers = wired + monkeypatch.setattr(bf, "latest_published_date", lambda env: "2026-10-23") # window: 10-24 + DAY + + def _schedule(date, delay_seconds=None): + if date == "2026-10-24": + raise RuntimeError("schedule endpoint down") + return fake_schedule() + + monkeypatch.setattr(bf, "fetch_schedule", _schedule) + summary = bf.backfill("prod", through_date=DAY, dry=False) + assert summary["status"] == "partial" + assert summary["failed_days"] == ["2026-10-24"] and summary["backfilled"] == [DAY] + assert markers._frame["date"].astype(str).tolist() == [DAY] # the failed date is unmarked + + +def test_backfill_continues_past_live_games(wired, monkeypatch): + """The FINAL-only guard: a LIVE box score is NEVER fetched (the cache- + hostage hazard), so 3 of the 5 slate games are skipped with a note; + boxscore requests exactly 2 (one per terminal game).""" + snapshots, _markers = wired + fetches = [] + + def _track(game_id, delay_seconds=None, **_k): + fetches.append(game_id) + return fake_boxscore_records() + + monkeypatch.setattr(bf, "fetch_boxscore", _track) + summary = bf.backfill("prod", through_date=DAY, dry=False) + assert sorted(fetches) == [GAME_ID, GAME_ID + 1] + assert summary["pending"] == [DAY] + assert _rows_total(snapshots.upserts) == 2 * 3 # 3 skaters x 2 terminal games (goalie cut) + + +def _rows_total(upserts): + return sum(len(batch) for batch in upserts) + + +def test_upsert_retry_envelope(wired, monkeypatch): + """Three tries per batch with backoff (the repo's envelope): two + transient failures then success still lands the batch.""" + snapshots, _markers = wired + attempts = [] + sleeps = [] + real_upsert = snapshots.upsert + + def _flaky(rows, on_conflict=None, returning=None): + attempts.append(1) + if len(attempts) < 3: + raise RuntimeError("transient 5xx") + return real_upsert(rows, on_conflict=on_conflict, returning=returning) + + def _track_sleep(seconds): + sleeps.append(seconds) + + monkeypatch.setattr(snapshots, "upsert", _flaky) + monkeypatch.setattr(bf.time, "sleep", _track_sleep) + written = bf._upsert_rows(bf.player_table("prod"), [{"date": DAY, "player_id": 7, "game_shots": 1}]) + assert written == 1 and len(attempts) == 3 and sleeps == [2.0, 4.0] + + +def test_fresh_cache_override_deletes_stale_boxscore_cache(wired, monkeypatch, tmp_path): + """The cached-LIVE hazard, overridden: an existing boxscore-N.json cache + file is DELETED before the fetch (the fresh GET re-caches final data); + nhl_client itself is untouched.""" + snapshots, _markers = wired + cache = tmp_path / "boxscore-2026010001.json" + cache.write_text("[]", encoding="utf-8") + monkeypatch.setattr(bf, "CACHE_DIR", tmp_path) + bf.backfill("prod", through_date=DAY, dry=False) + assert not cache.exists() # the stale file did not survive the pass + + +def test_backfill_skips_gracefully_pre_migration(monkeypatch, capsys): + """A table without the 20261027 raw columns (pre-merge prod): the probe + gates the helper - ONE loud warning, ZERO writes, no schedule request.""" + fake_client = MagicMock() + fake_client.table.return_value.select.return_value.limit.return_value.execute.side_effect = RuntimeError( + "column game_shots does not exist" + ) + monkeypatch.setattr(bf, "SUPABASE_ADMIN_CLIENT", fake_client) + monkeypatch.setattr(bf, "_RAW_SCHEMA_PROBE", {}) + fetches = [] + monkeypatch.setattr(bf, "fetch_schedule", lambda date, delay_seconds=None: fetches.append(date) or fake_schedule()) + summary = bf.backfill("prod", through_date=DAY, dry=False) + out = capsys.readouterr().out + assert summary["status"] == "skipped-columns" and summary["rows"] == 0 + assert fetches == [] # no NHL request either - the gate precedes the crawl + assert "not landed" in out and "20261027" in out + + +# --------------------------------------------- shared-ledger routing (§10) + +SHARED_LEDGER = "Player-Snapshots-backtrack-prod" + + +def test_backfill_dev_run_targets_the_shared_ledger(wired, capsys): + """(a) A dev-mode run's backfill targets the SHARED history ledger (and + its shared marker shelf), NOT the deleted `-dev` backtrack table that the + old suffix routing resolved - the owner's dev-mode traceback was exactly + that stale routing. No `RuntimeError` / 'run the publish/backfill chain + first' wall: the run HEALS the shared ledger like any other.""" + # the resolution itself: env-independent + assert bf.player_table("dev") == SHARED_LEDGER == bf.player_table("prod") + assert bf.marker_table("dev") == "Player-Game-Raw-Markers-prod" == bf.marker_table("prod") + summary = bf.backfill("dev", through_date=DAY, dry=False) + assert summary["status"] == "ok" and summary["backfilled"] == [DAY] + out = capsys.readouterr().out + assert "backtrack-dev" not in out # no deleted shell ever resolved + # the writes went through the shared ledger's routing (the `wired` fake + # keys ONLY the shared names) - a dev-suffix table request would have raised + snapshots, markers = wired + assert snapshots.upserts and markers.upserts + + +def test_backfill_empty_shared_ledger_fails_loud_bootstrap(monkeypatch): + """(d) The ONE remaining fail-loud gate: a genuinely EMPTY shared ledger + names the bootstrap chain (make backtrack-publish ENV=prod) - a + DIFFERENT, clearer message than the removed publish-era wall, and never + the deleted-dev-shell routing ('...-backtrack-dev' / 'run the + publish/backfill chain first').""" + + class _EmptyTable: + """A PostgREST chain over a table with ZERO rows (the probe AND the + latest-date read both land here).""" + + def select(self, *_a, **_k): + return self + + def order(self, *_a, **_k): + return self + + def limit(self, *_a, **_k): + return self + + def execute(self): + return MagicMock(data=[]) + + fake_client = MagicMock() + fake_client.table.side_effect = lambda *_a, **_k: _EmptyTable() + monkeypatch.setattr(bf, "SUPABASE_ADMIN_CLIENT", fake_client) + monkeypatch.setattr(bf, "_RAW_SCHEMA_PROBE", {}) # probe succeeds: columns landed + with pytest.raises( + RuntimeError, + match="shared history ledger.*make backtrack-publish ENV=prod.*never bootstraps", + ) as raised: + bf.backfill("dev", through_date=DAY, dry=False) + message = str(raised.value) + assert "run the publish/backfill chain first" not in message # the false wall is GONE + assert "backtrack-dev" not in message # no deleted shell ever resolved + + +def test_days_between_bounds_the_sweep(): + """A >14-day gap is capped: the helper never sweeps a season.""" + days = bf.days_between("2026-09-01", "2026-10-01") + assert len(days) == 14 + assert days[0] == "2026-09-02" and days[-1] == "2026-09-15" + + +def test_raw_column_payload_toi_parsing(): + game = fake_schedule()["gameWeek"][0]["games"][0] + update_rows, create_rows = bf._record_rows(game, fake_boxscore_records()) + forward = next(row for row in update_rows if row["player_id"] == 1) + assert forward["game_toi_min"] == pytest.approx(18 + 31 / 60) + assert forward["game_goals"] == 1 and forward["game_shots"] == 3 + assert forward["game_points"] == 2 + # missing TOI stays an honest None (the core drops + warns downstream) + missing = next(row for row in update_rows if row["player_id"] == 2) + assert missing["game_toi_min"] is None + assert missing["game_shots"] == 0 + # the create lane carries the identity columns the minimal row needs + newcomer = next(row for row in create_rows if row["player_id"] == 3) + assert newcomer["team_abbrev"] == "MTL" and newcomer["opponent_abbrev"] == "TOR" + + +def test_yesterday_et_default(): + """--through-date defaults to ET-yesterday (not host-local blindly).""" + stamp = datetime.datetime(2026, 10, 28, 1, 0, tzinfo=ZoneInfo("America/Toronto")) + assert bf.yesterday_et(now=stamp) == "2026-10-27" + + +# ------------------------------------- exact parity vs the local-store path + + +def test_stage2_recompute_matches_local_store_exactly(tmp_path, monkeypatch, capsys): + """THE parity anchor (deliverable 6b): one historical date, the + local-store path (model.shot_features() reading a REAL sqlite player_games + store) vs the published-record path (run_daily_picks. + shot_block_from_history) - same per-game lines -> identical 14 features, + max abs diff < 1e-9 (observed 0.0).""" + + run_daily_picks = _load_run_daily_picks() + days = ["2026-01-01", "2026-01-03", "2026-01-05", "2026-01-08"] + rows = [] + for index, day in enumerate(days): + for offset, player in enumerate([1, 2]): + rows.append( + { + "player_id": player, + "game_id": 1000 + index * 10 + offset, + "game_date": day, + "season": 20252026, + "position": "C", + "name": f"p{player}", + "team_abbrev": "TOR", + "home": 1, + "goals": (index + offset) % 2, + "shots": 1 + ((index + offset) % 4), + "toi": f"{10 + index:02d}:{(15 * offset) % 60:02d}", + } + ) + db = tmp_path / "raw.sqlite" + con = sqlite3.connect(db) + con.execute( + "CREATE TABLE player_games (player_id INTEGER, game_id INTEGER, game_date TEXT, season INTEGER," + " position TEXT, name TEXT, team_abbrev TEXT, home INTEGER, goals INTEGER, shots INTEGER, toi TEXT)" + ) + con.executemany( + f"INSERT INTO player_games VALUES ({','.join('?' * 11)})", + [ + tuple( + r[c] + for c in ( + "player_id", + "game_id", + "game_date", + "season", + "position", + "name", + "team_abbrev", + "home", + "goals", + "shots", + "toi", + ) + ) + for r in rows + ], + ) + con.commit() + con.close() + + monkeypatch.setattr(model, "RAW_DB", db) + from model import shot_features # noqa: PLC0415 - reads model.RAW_DB at call time + + x_date = days[-1] + training = shot_features() + training_rows = training[training["date"] == x_date].sort_values("player_id").reset_index(drop=True) + + # the published record: the same lines under the stage-2 column names + history = pd.DataFrame(rows).rename(columns={"game_date": "date"}) + history["game_goals"] = history["goals"] + history["game_shots"] = history["shots"] + history["game_toi_min"] = model._toi_minutes(history["toi"]) + + block = ( + run_daily_picks.shot_block_from_history(x_date, [1, 2], history).sort_values("player_id").reset_index(drop=True) + ) + diffs = (training_rows[model.SHOT_FEATURES] - block[model.SHOT_FEATURES]).abs() + observed = float(diffs.to_numpy().max()) + anchor = training_rows[["player_id", "sd_shots_pg", "career_goals_pg", "career_games"]].to_string(index=False) + print(f"\nparity anchor {x_date}: max abs diff {observed!r}\n{anchor}") + assert observed < 1e-9 + + +def test_null_raw_rows_warn_and_recompute_over_partial_prefix(capsys): + """(test b) Published rows with NO per-game raw stat (pre-top-up + lateness) are dropped from the ledger with a LOUD warning, and the + rolling/ewm/career math runs over the available raw rows - verified + against the shared core over the dropped frame (partial prefix).""" + run_daily_picks = _load_run_daily_picks() + days = ["2026-01-01", "2026-01-03", "2026-01-05", "2026-01-08"] + rows = [] + for index, day in enumerate(days): + rows.append( + { + "date": day, + "player_id": 1, + "game_goals": index % 2, + "game_shots": 1 + (index % 4), + "game_toi_min": 10.0 + index, + } + ) + history = pd.DataFrame(rows) + history.loc[history["date"] == "2026-01-05", ["game_goals", "game_shots", "game_toi_min"]] = None + + block = run_daily_picks.shot_block_from_history("2026-01-08", [1], history) + out = capsys.readouterr().out + assert "WARNING" in out and "partial-prefix" in out and "1 published row" in out + + # the partial prefix IS what the shared core computes over the kept rows + # (the kept frame already carries the on_date row, so no synthetic line) + kept = history.dropna(subset=["game_shots"]).rename( + columns={"game_goals": "goals", "game_shots": "shots", "game_toi_min": "toi"} + ) + kept["season"] = "20252026" + expected = model.shot_features_from_games(kept) + expected = expected[expected["date"] == "2026-01-08"].reset_index(drop=True) + diffs = (expected[model.SHOT_FEATURES] - block[model.SHOT_FEATURES]).abs().to_numpy().max() + assert diffs < 1e-9 + + +def _load_run_daily_picks(): + spec = importlib.util.spec_from_file_location( + "run_daily_picks_stage2_test", ROOT / "smartscore" / "scripts" / "backtrack" / "run_daily_picks.py" + ) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod diff --git a/tests/unit/test_backtrack_deleted_env_tables.py b/tests/unit/test_backtrack_deleted_env_tables.py new file mode 100644 index 00000000..f198d05e --- /dev/null +++ b/tests/unit/test_backtrack_deleted_env_tables.py @@ -0,0 +1,114 @@ +"""Guards for the deleted dev backtrack tables (deleted_env_tables.py). + +The guard is NAME-based: it raises on a resolved table name regardless of +whether that table still exists in Supabase (the empty shells were DROPped by +the owner Oct 2026), so none of these tests need a live connection. +""" + +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, "smartscore/scripts/backtrack") + +from deleted_env_tables import DELETED_BACKTRACK_TABLES, guard_backtrack_table + +MIGRATIONS = Path(__file__).resolve().parents[2] / "supabase" / "migrations" + + +def test_dev_tables_named_in_error(): + for table in DELETED_BACKTRACK_TABLES: + with pytest.raises(RuntimeError, match=table.replace("-", "\\-")): + guard_backtrack_table(table) + + +def test_error_points_to_prod(): + for table in DELETED_BACKTRACK_TABLES: + with pytest.raises(RuntimeError, match="ENV=prod"): + guard_backtrack_table(table) + + +def test_deleted_registry_only_lists_verified_tables(): + assert DELETED_BACKTRACK_TABLES == { + "Player-Snapshots-backtrack-dev", + "Team-Stats-backtrack-dev", + "Goalie-Snapshots-backtrack-dev", + } + + +def test_prod_tables_pass_through(): + for prod in ( + "Player-Snapshots-backtrack-prod", + "Team-Stats-backtrack-prod", + "Goalie-Snapshots-backtrack-prod", + ): + assert guard_backtrack_table(prod) == prod + + +def test_guard_is_name_based_not_existence_based(): + """The guard must keep failing even after the shell disappears. + + The empty shells were DROPped by the owner Oct 2026 (PostgREST cannot + DDL), so a PostgREST 404 is one possible failure mode - but the guard's + promise is that the NAME itself is fatal before any request is made, + whether or not the table still exists. Assert the raise is unconditional + and carries the explicit prod pointer, with no Supabase client involved. + """ + for table in sorted(DELETED_BACKTRACK_TABLES): + with pytest.raises(RuntimeError) as excinfo: + guard_backtrack_table(table) + assert "ENV=prod" in str(excinfo.value) + + +def _migration_files(): + return sorted(MIGRATIONS.glob("*.sql")) + + +def test_migrations_never_scope_a_backtrack_table_via_env(): + """No migration may recreate the deleted -dev backtrack shells. + + The standing migrate job substitutes __ENV__ -> dev on PR deploys, so a + `CREATE TABLE IF NOT EXISTS "-backtrack-__ENV__"` resurrects the + deleted dev shell on the next main-push/PR run. All backtrack migrations + are prod-pinned literally (BACKTRACK-PROD-PINNED headers; the CI guard in + .github/workflows/deploy.yml enforces the same rule). Mirror that rule + here so a regression fails `make test` too. + """ + offenders = [] + for path in _migration_files(): + for lineno, line in enumerate(path.read_text().splitlines(), 1): + if "backtrack" in line.lower() and "__ENV__" in line: + offenders.append(f"{path.name}:{lineno}: {line.strip()}") + assert not offenders, f"backtrack tables may not be __ENV__-scoped (dev backtrack tables are deleted): {offenders}" + + +def test_migrations_never_name_a_deleted_dev_table(): + """No migration file may spell one of the deleted table names at all.""" + for path in _migration_files(): + text = path.read_text() + for table in DELETED_BACKTRACK_TABLES: + assert table not in text, f"{path.name} still names deleted {table}" + + +def test_backtrack_migrations_carry_the_prod_pin_marker(): + """The 6 backtrack migration files carry the prod-pin allowlist marker. + + Marker rule lives in .github/workflows/deploy.yml ('Guard migration + files'): a file with BACKTRACK-PROD-PINNED may hardcode the '-prod' + literal suffix. The marker also documents WHY (dev backtracking deleted + Oct 2026) at the top of each file. + """ + marker_files = {p.name for p in _migration_files() if "BACKTRACK-PROD-PINNED" in p.read_text()} + backtrack_files = {p.name for p in _migration_files() if "backtrack" in p.stem} + assert backtrack_files == marker_files, ( + f"backtrack migrations missing the prod-pin marker: {sorted(backtrack_files - marker_files)}" + ) + assert all("backtrack" in name for name in marker_files) and marker_files == { + "20261008_add_player_snapshots_backtrack.sql", + "20261008_add_team_stats_backtrack.sql", + "20261009_add_ppg_player_snapshots_backtrack.sql", + "20261015_add_goalie_snapshots_backtrack.sql", + "20261024_add_shot_columns_player_snapshots_backtrack.sql", + "20261027_add_per_game_raw_columns_player_snapshots_backtrack.sql", + } diff --git a/tests/unit/test_backtrack_local_store.py b/tests/unit/test_backtrack_local_store.py index 8469075b..94c8f55b 100644 --- a/tests/unit/test_backtrack_local_store.py +++ b/tests/unit/test_backtrack_local_store.py @@ -4,6 +4,7 @@ from types import SimpleNamespace import local_store +import publish_shot_cols import pytest @@ -436,13 +437,25 @@ def test_publish_prefers_archive_names_over_boxscore_initials(tmp_path, monkeypa {"player_id": 201, "name": "Brent Burns"}, ] ) - monkeypatch.setattr(local_store, "config", lambda: ("dev", client)) + monkeypatch.setattr(local_store, "config", lambda: ("prod", client)) + + # The session-wide supabase mock (tests/unit/conftest.py) makes the + # shot-columns migration probe read as "landed", which would send + # attach_shot_columns into shot_features() against the canonical + # data/raw_nhl.sqlite - an untracked 2.5 GB store this test does not build + # and must not require (it makes its own tmp_path store). Seed the probe + # cache the way a not-yet-migrated table looks, so attach takes its + # documented probe-gated no-op path; the 16 shot/TOI columns have their + # own coverage in test_shot_columns.py. + publish_shot_cols._PROBE["Player-Snapshots-backtrack-prod"] = False written = local_store.publish("20232024", db_path=tmp_path / "raw.sqlite") assert written == 2 # Names were read from the archive table and rows written to the backtrack one. - assert set(client.table_names) == {"Player-Snapshots-dev", "Player-Snapshots-backtrack-dev"} + # (prod: Player-Snapshots-backtrack-dev was deleted on 2026-10-24; the guard + # in deleted_env_tables.py must not fire here.) + assert set(client.table_names) == {"Player-Snapshots-prod", "Player-Snapshots-backtrack-prod"} names = {r["player_id"]: r["name"] for r in client.upserted} # The archive's full spelling wins where it exists... assert names[201] == "Brent Burns" @@ -876,13 +889,15 @@ def test_publish_goalies_ships_team_scoped_stats_and_full_names(tmp_path, monkey conn.close() client = _FakeArchiveClient([]) - monkeypatch.setattr(local_store, "config", lambda: ("dev", client)) + monkeypatch.setattr(local_store, "config", lambda: ("prod", client)) written = local_store.publish_goalies("20232024", db_path=tmp_path / "raw.sqlite") assert written == 4 - # Goalie rows go to the goalie table and nowhere else. - assert client.table_names == ["Goalie-Snapshots-backtrack-dev"] + # Goalie rows go to the goalie table and nowhere else. ENV=dev now fails + # the guard (Goalie-Snapshots-backtrack-dev was deleted 2026-10-24), so the + # publish is exercised against prod. + assert client.table_names == ["Goalie-Snapshots-backtrack-prod"] assert all(k["on_conflict"] == "season,player_id,date" for k in client.upsert_kwargs) rows = {(r["player_id"], r["date"]): r for r in client.upserted} assert all(r["team_abbrev"] == "TOR" and r["team_name"] == local_store.to_place("TOR") for r in client.upserted) @@ -918,9 +933,30 @@ def test_publish_goalies_without_features_writes_nothing(tmp_path, monkeypatch): conn.close() client = _FakeArchiveClient([]) - monkeypatch.setattr(local_store, "config", lambda: ("dev", client)) + monkeypatch.setattr(local_store, "config", lambda: ("prod", client)) written = local_store.publish_goalies("20232024", db_path=tmp_path / "raw.sqlite") assert written == 0 assert client.table_names == [] + + +def test_publish_team_env_dev_fails_loud(tmp_path, monkeypatch): + """A stale ENV=dev publish fails loud: no PostgREST 404, no silent write. + + Team-Stats-backtrack-dev was deleted (rows 2026-10-24; empty shell + dropped Oct 2026, docs/backtrack_dev_deleted.md), so a dev-resolved + publish must raise via guard_backtrack_table BEFORE any Supabase + request is attempted. + """ + conn = local_store.connect(tmp_path / "store.sqlite") + conn.execute( + "INSERT INTO derived_team_stats (season, team_abbrev, game_date, game_id, tgpg, otga, otshga)" + " VALUES ('20232024', 'BOS', '2023-10-05', 20001, '', '', '')" + ) + conn.commit() + conn.close() + + monkeypatch.setattr(local_store, "config", lambda: ("dev", None)) + with pytest.raises(RuntimeError, match="no longer exists"): + local_store.publish_team("20232024", db_path=tmp_path / "store.sqlite") diff --git a/tests/unit/test_email_utility.py b/tests/unit/test_email_utility.py index 24de920f..f862f969 100644 --- a/tests/unit/test_email_utility.py +++ b/tests/unit/test_email_utility.py @@ -3,7 +3,7 @@ import pytest -from email_utility import send_email +from email_utility import get_html_and_text, send_email PICKS = [{"name": "Player 1", "stat": 0.9, "tims": 1}] @@ -30,3 +30,48 @@ def test_send_email_sends_on_success(mock_smtp, mock_feature_enabled): server.starttls.assert_called_once() server.send_message.assert_called_once() server.quit.assert_called_once() + + +def test_stat_fraction_rendered_as_true_percent_in_text_body(): + """The DB stat is a 0-1 fraction, so 0.9 is 90%, not 0.90%.""" + picks = [ + {"name": "Player 1", "stat": 0.9, "tims": 1}, + {"name": "Player 2", "stat": 0.5, "tims": 2}, + ] + + _, text_body = get_html_and_text(picks) + + assert "| 90.00%" in text_body + assert "| 50.00%" in text_body + + +def test_stat_fraction_rendered_as_true_percent_in_html_body(): + """The HTML table path scales the 0-1 fraction by 100 too.""" + picks = [ + {"name": "Player 1", "stat": 0.9, "tims": 1}, + {"name": "Player 2", "stat": 0.5, "tims": 2}, + ] + + html_body, _ = get_html_and_text(picks) + + assert ">90.00%" in html_body + assert ">50.00%" in html_body + + +def test_stat_fallbacks_unchanged_for_missing_or_non_numeric_values(): + """None, empty, and non-numeric stats keep the pre-existing fallbacks.""" + picks = [ + {"name": "None Stat", "stat": None, "tims": 1}, + {"name": "Empty Stat", "stat": "", "tims": 2}, + {"name": "Text Stat", "stat": "n/a", "tims": 3}, + ] + + html_body, text_body = get_html_and_text(picks) + + assert "| None\n" in text_body + assert "| \n" in text_body + assert "| n/a\n" in text_body + + assert 'font-weight:bold;">None%' in html_body + assert 'font-weight:bold;">' in html_body + assert 'font-weight:bold;">n/a%' in html_body diff --git a/tests/unit/test_event_handler.py b/tests/unit/test_event_handler.py index 91e86948..0994cfb5 100644 --- a/tests/unit/test_event_handler.py +++ b/tests/unit/test_event_handler.py @@ -128,7 +128,7 @@ def test_handle_load_working_set_returns_separated_slices(mock_load, mock_get_da @patch("event_handler.load_working_set") def test_handle_load_working_set_passes_status_through(mock_load): - """last_run must survive to CheckInitialRun's routing.""" + """last_run must survive to CheckSaveHistory's routing.""" mock_load.return_value = ([{"id": 1}], [{"team_id": 10}]) result = handle_load_working_set({"status": "last_run"}, {}) @@ -158,8 +158,9 @@ def test_handle_get_tims_normal_run_stays_strict(mock_get_tims): mock_get_tims.assert_called_once_with(players, allow_empty=False) +@patch("event_handler.get_date", return_value="2026-04-15") @patch("event_handler.publish_public_db") -def test_handle_publish_db_with_players(mock_publish): +def test_handle_publish_db_with_players(mock_publish, mock_get_date): """Test publishing database with player data.""" players = [ {"name": "Player 1", "stat": 0.8}, @@ -169,17 +170,20 @@ def test_handle_publish_db_with_players(mock_publish): event = {"players": players} result = handle_publish_db(event, {}) - assert result == {"statusCode": 200} + # The publish returns the pick date it wrote with: KickMLPicks needs it + # to relay an explicit date to the MLPicksKick dispatch (race fix). + assert result == {"statusCode": 200, "date": "2026-04-15"} mock_publish.assert_called_once_with(players) +@patch("event_handler.get_date", return_value="2026-04-15") @patch("event_handler.publish_public_db") -def test_handle_publish_db_empty_players(mock_publish): +def test_handle_publish_db_empty_players(mock_publish, mock_get_date): """Test publishing database with empty player list.""" event = {"players": []} result = handle_publish_db(event, {}) - assert result == {"statusCode": 200} + assert result == {"statusCode": 200, "date": "2026-04-15"} mock_publish.assert_called_once_with([]) @@ -221,10 +225,25 @@ def test_handle_publish_db_no_players_key(mock_publish): event = {} result = handle_publish_db(event, {}) - assert result == {"statusCode": 200} + assert result["statusCode"] == 200 + assert "date" in result # the explicit-date relay contract holds on every path mock_publish.assert_called_once_with([]) +@patch("event_handler.publish_public_db") +def test_handle_publish_db_carries_the_events_date(mock_publish): + """A state-carried date wins over the get_date() fallback. + + last_run reaches PublishToDb with the date LoadWorkingSet stamped, so + the kick gets the date this run actually published for. + """ + event = {"players": [{"id": 1, "stat": 0.8}], "date": "2026-01-14"} + + result = handle_publish_db(event, {}) + + assert result == {"statusCode": 200, "date": "2026-01-14"} + + def test_handle_parse_teams_empty_event(): """Test handling empty event.""" result = handle_parse_teams([], {}) diff --git a/tests/unit/test_fidelity_tracker.py b/tests/unit/test_fidelity_tracker.py new file mode 100644 index 00000000..16329cf6 --- /dev/null +++ b/tests/unit/test_fidelity_tracker.py @@ -0,0 +1,484 @@ +"""fidelity_tracker: metric math on small synthetic frames, and the skip paths. + +These unit tests run against synthetic rows only - no Supabase call and no +real local store. The skip-path tests drive track_date with an in-memory +fake supabase client and monkeypatched store readers. +""" + +import csv + +import fidelity_tracker as ft +import pytest +from fidelity_tracker import ( + aggregate_past_log, + detect_slot_column, + fidelity_metrics, + normalize_pp, + normalize_unit, + pair_with_actuals, + season_for_date, + slot_for_row, + track_date, +) + + +def _pair(**overrides): + base = { + "date": "2026-10-22", + "player_id": 1, + "projected_unit": "F1", + "projected_pp": "PP1", + "projected_group": "F", + "actual_unit": "F1", + "actual_pp": "PP1", + "actual_group": "F", + "actual_game_id": 1, + } + base.update(overrides) + return base + + +# ------- normalizers ------- + + +def test_normalize_unit_trims_and_uppercases(): + assert normalize_unit(" f1 ") == "F1" + assert normalize_unit(None) is None + assert normalize_unit("") is None + assert normalize_unit(float("nan")) is None + + +def test_normalize_pp_translates_verbatim_pipeline_labels(): + assert normalize_pp("POWER PLAY #1") == "PP1" + assert normalize_pp("POWER PLAY #2") == "PP2" + assert normalize_pp("PP1") == "PP1" + assert normalize_pp(" PP2 ") == "PP2" + # PP3/PP4 are proxy noise, kept as themselves - never folded into PP1/PP2. + assert normalize_pp("POWER PLAY #3") == "PP3" + assert normalize_pp(None) is None + + +# ------- season ------- + + +def test_season_boundary_is_july_not_january(): + assert season_for_date("2026-10-22") == "20262027" + assert season_for_date("2026-01-02") == "20252026" + assert season_for_date("2024-07-01") == "20242025" + assert isinstance(season_for_date("2026-10-22"), str) + + +# ------- slot detection ------- + + +def test_no_slot_column_means_single_slot(): + rows = [{"date": "d", "player_id": 1}] + assert detect_slot_column(rows) is None + assert slot_for_row(rows[0], None) == "single" + + +def test_label_column_wins_over_timestamp(): + rows = [ + {"source_slot": "1030", "snapshot_time": "2026-10-22T10:30:00-04:00", "player_id": 1}, + {"source_slot": "1600", "snapshot_time": "2026-10-22T16:00:00-04:00", "player_id": 2}, + ] + assert detect_slot_column(rows) == "source_slot" + assert {slot_for_row(row, "source_slot") for row in rows} == {"1030", "1600"} + + +def test_timestamp_column_buckets_in_et(): + row = {"updated_at": "2026-10-22T14:00:00-04:00"} + assert slot_for_row(row, "updated_at") == "14:00" + + +# ------- pairing ------- + + +def test_pair_joins_on_date_and_player_id(): + projected = [ + { + "player_id": 5, + "team_name": "Minnesota", + "home": False, + "lineup_unit": "F2", + "pp_unit": "PP1", + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + actual = [ + { + "game_id": 99, + "player_id": 5, + "team_abbrev": "MIN", + "home": 0, + "game_date": "2026-10-22", + "lineup_unit": "F2", + "pp_unit": "PP1", + "lineup_position_group": "F", + "lineup_status": "ACTUAL", + } + ] + pairs, breadcrumbs = pair_with_actuals(projected, actual, "2026-10-22") + assert len(pairs) == 1 + assert breadcrumbs == {} + assert pairs[0]["projected_unit"] == "F2" + assert pairs[0]["actual_unit"] == "F2" + + +def test_ambiguous_place_is_excluded_never_guessed(): + # (New York, home) matching two clubs must be excluded, never guessed. + projected = [ + { + "player_id": 5, + "team_name": "New York", + "home": True, + "lineup_unit": "F1", + "pp_unit": None, + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + actual = [ + { + "game_id": 1, + "player_id": 5, + "team_abbrev": "NYI", + "home": 1, + "game_date": "2026-10-22", + "lineup_unit": "F1", + "pp_unit": None, + "lineup_position_group": "F", + "lineup_status": "ACTUAL", + }, + { + "game_id": 2, + "player_id": 6, + "team_abbrev": "NYR", + "home": 1, + "game_date": "2026-10-22", + "lineup_unit": "D1", + "pp_unit": None, + "lineup_position_group": "D", + "lineup_status": "ACTUAL", + }, + ] + pairs, breadcrumbs = pair_with_actuals(projected, actual, "2026-10-22") + assert pairs == [] + assert breadcrumbs["n_team_ambiguous"] == 1 + + +def test_new_york_resolves_through_the_home_split(): + # NYI hosts, NYR plays away: (New York, home=True) resolves to NYI only, + # so the same ambiguous place now joins cleanly through the scheduled split. + projected = [ + { + "player_id": 5, + "team_name": "New York", + "home": True, + "lineup_unit": "F1", + "pp_unit": None, + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + actual = [ + { + "game_id": 1, + "player_id": 5, + "team_abbrev": "NYI", + "home": 1, + "game_date": "2026-10-22", + "lineup_unit": "F1", + "pp_unit": None, + "lineup_position_group": "F", + "lineup_status": "ACTUAL", + }, + { + "game_id": 2, + "player_id": 6, + "team_abbrev": "NYR", + "home": 0, + "game_date": "2026-10-22", + "lineup_unit": "D1", + "pp_unit": None, + "lineup_position_group": "D", + "lineup_status": "ACTUAL", + }, + ] + pairs, breadcrumbs = pair_with_actuals(projected, actual, "2026-10-22") + assert len(pairs) == 1 + assert pairs[0]["actual_unit"] == "F1" + assert breadcrumbs == {} + + +def test_projected_player_absent_from_actuals_is_counted(): + projected = [ + { + "player_id": 5, + "team_name": "Boston", + "home": True, + "lineup_unit": "F1", + "pp_unit": None, + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + pairs, breadcrumbs = pair_with_actuals(projected, [], "2026-10-22") + assert pairs == [] + assert breadcrumbs["n_unknown_players"] == 1 + + +def test_non_actual_status_carries_group_but_no_unit(): + # An actual row without the ACTUAL stamp (missing-unit pass) may join but + # contributes no unit/pp value - an absence, not a match. + projected = [ + { + "player_id": 5, + "team_name": "Boston", + "home": True, + "lineup_unit": "F1", + "pp_unit": "PP1", + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + actual = [ + { + "game_id": 1, + "player_id": 5, + "team_abbrev": "BOS", + "home": 1, + "game_date": "2026-10-22", + "lineup_unit": None, + "pp_unit": None, + "lineup_position_group": "F", + "lineup_status": "REJECTED", + } + ] + pairs, _ = pair_with_actuals(projected, actual, "2026-10-22") + assert pairs[0]["actual_unit"] is None + assert pairs[0]["actual_pp"] is None + assert pairs[0]["actual_group"] == "F" + + +# ------- metric math ------- + + +def test_metrics_perfect_when_every_pair_matches(): + pairs = [_pair(player_id=i) for i in range(10)] + metrics = fidelity_metrics(pairs) + assert metrics["unit_match"] == {"value": 1.0, "matches": 10, "n": 10} + assert metrics["pp_match"] == {"value": 1.0, "matches": 10, "n": 10} + assert metrics["presence_match"] == {"value": 1.0, "matches": 10, "n": 10} + + +def test_metrics_partial_and_denominators_independent(): + pairs = [ + _pair(player_id=1, projected_unit="F1", actual_unit="F1", projected_pp="PP1", actual_pp="PP1"), + _pair(player_id=2, projected_unit="F2", actual_unit="D1", projected_pp=None), # unit wrong, no projected PP + _pair(player_id=3, projected_unit="F3", actual_unit=None, actual_pp=None), # unit missing + _pair(player_id=4, projected_unit="F1", actual_unit="F1", projected_pp="PP2", actual_pp="PP1"), + ] + metrics = fidelity_metrics(pairs) + # unit: 2 of 3 comparable; PP: 1 of 2 comparable; presence: all 4 are F-F pairs. + assert metrics["unit_match"]["value"] == pytest.approx(2 / 3) + assert metrics["unit_match"]["n"] == 3 + assert metrics["pp_match"] == {"value": 0.5, "matches": 1, "n": 2} + assert metrics["presence_match"] == {"value": 1.0, "matches": 4, "n": 4} + + +def test_metrics_empty_input_yields_null_rates(): + metrics = fidelity_metrics([]) + assert all(entry == {"value": None, "matches": 0, "n": 0} for entry in metrics.values()) + + +# ------- logging ------- + + +def test_aggregate_reweights_by_exposure(tmp_path): + log = tmp_path / "fidelity_log.csv" + with open(log, "w", newline="") as handle: + writer = csv.writer(handle) + writer.writerow(ft.LOG_COLUMNS) + # A weak slot and a strong slot: the pooled rate must be exposure-weighted. + writer.writerow(["t", "prod", "20262027", "date", "2026-10-20", "single", "unit_match", "0.000000", 0, 2]) + writer.writerow(["t", "prod", "20262027", "date", "2026-10-21", "single", "unit_match", "0.900000", 9, 10]) + + aggregate_past_log("prod", "20262027", log_path=log) + with open(log, newline="") as handle: + rows = [row for row in csv.DictReader(handle) if row["scope"] == "season"] + unit = next(row for row in rows if row["metric"] == "unit_match") + assert int(unit["matches"]) == 9 + assert int(unit["n"]) == 12 + assert float(unit["value"]) == pytest.approx(9 / 12) + + +# ------- fake supabase and store doubles ------- + + +class _Query: + def __init__(self, rows): + self._rows = rows + + def select(self, *_): + return self + + def eq(self, *_): + return self + + def execute(self): + result = type("R", (), {})() + result.data = self._rows + return result + + +class _FakeClient: + """Minimal supabase table client: .table(T).select(...).eq(...).execute().""" + + def __init__(self, rows): + self._rows = rows + + def table(self, _table): + return _Query(self._rows) + + +@pytest.fixture +def log_and_db(tmp_path): + return tmp_path / "fidelity_log.csv", tmp_path / "raw_nhl.sqlite" + + +# ------- skip paths ------- + + +def test_skip_when_no_actual_rows_logged_or_compared(log_and_db): + # The backtracking actuals are the concurrent crawler's backfill: until a + # date's shift charts land, the tracker must skip with a clear message, + # log nothing, and exit 0. + log_path, _ = log_and_db + projected = [ + { + "date": "2026-10-22", + "player_id": 5, + "team_name": "Boston", + "home": True, + "lineup_unit": "F1", + "pp_unit": "PP1", + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + with pytest.MonkeyPatch.context() as mp: + mp.setattr(ft, "actuals_for_date", lambda date_str, db_path=None: []) # store exists, no rows yet + status, message = track_date( + "prod", "2026-10-22", supabase=_FakeClient(projected), db_path=log_and_db[1], log_path=log_path + ) + assert status == "skip" + assert "no ACTUAL lineups" in message + assert "crawled" in message + assert not log_path.exists(), "a skip must not log" + + +def test_skip_when_store_file_missing(log_and_db): + # A missing store file is a distinct, clearer skip than a store with no rows. + log_path, db = log_and_db + projected = [ + { + "date": "2026-10-22", + "player_id": 5, + "team_name": "Boston", + "home": True, + "lineup_unit": "F1", + "pp_unit": "PP1", + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + ] + status, message = track_date("prod", "2026-10-22", supabase=_FakeClient(projected), db_path=db, log_path=log_path) + assert status == "skip" + assert "local store not found" in message + + +def test_skip_when_no_projected_rows(log_and_db): + log_path, _ = log_and_db + # prod: the dev daily-build table (Player-Snapshots-backtrack-dev) is + # deleted, so skip semantics are exercised on the prod leg - an empty + # projected read must skip without logging, on either leg. + status, message = track_date( + "prod", "2026-10-22", supabase=_FakeClient([]), db_path=log_path.with_suffix(".sqlite"), log_path=log_path + ) + assert status == "skip" + assert "nothing to compare" in message + assert not log_path.exists(), "a skip must not log" + + +# ------- happy path, fully faked ------- + + +def test_track_date_happy_path_writes_log(tmp_path): + projected = [ + { + "date": "2026-10-22", + "player_id": i, + "team_name": "Boston", + "home": True, + "lineup_unit": "F1", + "pp_unit": "PP2", + "lineup_position_group": "F", + "lineup_status": "PROJECTED", + } + for i in (1, 2, 3, 4) + ] + actual = [ + { + "game_id": 9, + "player_id": i, + "team_abbrev": "BOS", + "home": 1, + "game_date": "2026-10-22", + "lineup_unit": "F1" if i % 2 else "F3", + "pp_unit": "PP2", + "lineup_position_group": "F", + "lineup_status": "ACTUAL", + } + for i in (1, 2, 3, 4) + ] + log_path, db_path = tmp_path / "fidelity_log.csv", tmp_path / "store.sqlite" + + with pytest.MonkeyPatch.context() as mp: + mp.setattr(ft, "actuals_for_date", lambda date_str, db_path=None: actual) + status, message = track_date( + "prod", "2026-10-22", supabase=_FakeClient(projected), db_path=db_path, log_path=log_path + ) + + assert status == "tracked", message + # Unit: F1 for players 1,3 and F3 for 2,4 -> 2/4. PP: PP1-PP2 everywhere -> 4/4. + assert "2/4 = 50.0%" in message + assert "4/4 = 100.0%" in message + + with open(log_path, newline="") as handle: + rows = list(csv.DictReader(handle)) + assert rows, "a tracked run must append log rows" + date_rows = [row for row in rows if row["scope"] == "date" and row["date"] == "2026-10-22"] + unit_row = next(row for row in date_rows if row["metric"] == "unit_match" and row["source_slot"] == "single") + assert int(unit_row["matches"]) == 2 and int(unit_row["n"]) == 4 + assert any(row["scope"] == "season" for row in rows), "season-scope aggregate rows are appended per run" + # nothing below came from anywhere real: the fake client saw only synthetic rows + + +# --- deleted dev daily-build table: fail loud on --env dev ------------------- +# Player-Snapshots-backtrack-dev was deleted (rows removed 2026-10-24, empty +# shell dropped Oct 2026; docs/backtrack_dev_deleted.md), one shared history +# ledger: there is exactly ONE daily-build history source and it is prod. + + +def test_load_daily_build_dev_fails_loud(): + """ENV=dev must raise the registry guard, not a PostgREST 404.""" + with pytest.raises(RuntimeError, match="no longer exists"): + ft.load_daily_build("dev", "2026-10-22", supabase=_FakeClient([])) + + +def test_track_date_dev_fails_loud(): + """The CLI's (env, date) entry must raise the same guard for dev.""" + with pytest.raises(RuntimeError, match="ENV=prod"): + ft.track_date("dev", "2026-10-22", supabase=_FakeClient([])) diff --git a/tests/unit/test_ml_picks_import_chain.py b/tests/unit/test_ml_picks_import_chain.py new file mode 100644 index 00000000..cc6db79e --- /dev/null +++ b/tests/unit/test_ml_picks_import_chain.py @@ -0,0 +1,178 @@ +"""Cold-start proof for the MLPicksKick relay's shared import chain. + +The deployed Handler is ``event_handler.handle_ml_picks_kick``, so the +Lambda imports the WHOLE shared module chain on every cold start: +``event_handler.py:9 -> player_archive.py:38 -> config.py``, and +``config.py:19/:23`` builds BOTH Supabase clients at module-import time. +With the deployed function carrying only ``GITHUB_DISPATCH_TOKEN``, the +cold start died on ``SupabaseException: supabase_url is required`` before +the handler ever ran (PR #146 owner escalation). + +units/conftest.py patches ``supabase.create_client`` globally, which masks +exactly this failure inside the ordinary unit suite - so this file imports +the REAL chain in subprocesses against a staged, deploy-zip-shaped copy of +``smartscore/*.py`` (flat directory, no ``.env``, no parent-project state), +asserting: + +* with NO Supabase env (the old deployed state) the chain CANNOT import; +* with only SUPABASE_URL or SUPABASE_URL+SUPABASE_API_KEY it still cannot; +* with the full trio (the template's Option-A wiring) the chain imports. + +The template-level guarantee (that every function, relay included, carries +the trio from the shared ``Supabase*`` parameters) lives in +test_template_env_vars.py; this file proves the requirement is real rather +than imagined. +""" + +import os +import shutil +import subprocess +import sys +from pathlib import Path + +import pytest + +REPO_ROOT = Path(__file__).resolve().parents[2] +SMARTSCORE_DIR = REPO_ROOT / "smartscore" + +#: The import-required Supabase trio, mirroring the template wiring. +IMPORT_TRIO = ("SUPABASE_URL", "SUPABASE_API_KEY", "SUPABASE_SERVICE_ROLE_KEY") + +# Dummy values only - create_client never touches the network at import. +DUMMY_ENV = { + "SUPABASE_URL": "https://coldstart-test.supabase.co", + "SUPABASE_API_KEY": "coldstart-test-anon-key", + "SUPABASE_SERVICE_ROLE_KEY": "coldstart-test-service-key", +} + +# Runs INSIDE the simulated zip root, with cwd pointed there too, so +# python-dotenv (load_dotenv in config.py) cannot find the owner's repo +# .env - the deployed Lambda has no such file. +PROBE_SCRIPT = """ +import importlib +try: + importlib.import_module("event_handler") +except Exception as exc: # noqa: BLE001 - the subprocess reports the failure + print(f"IMPORT-FAIL {type(exc).__name__}: {exc}") + raise SystemExit(2) +print("IMPORT-OK event_handler") +""" + + +@pytest.fixture(scope="module") +def lambda_sim_dir(tmp_path_factory) -> Path: + """A flat directory shaped like the deploy zip: smartscore/*.py at root. + + importlib resolves ``event_handler``/``player_archive``/``config`` from + here exactly as the Lambda does (the zip unpacks smartscore/* to the + task root), and ``load_dotenv()`` walking up finds no ``.env`` because + the parent chain is pytest's tmp tree. + """ + sim_dir = tmp_path_factory.mktemp("lambdasim") + for module_file in sorted(SMARTSCORE_DIR.glob("*.py")): + shutil.copy2(module_file, sim_dir / module_file.name) + assert (sim_dir / "config.py").is_file() + assert (sim_dir / "event_handler.py").is_file() + return sim_dir + + +def _import_chain(sim_dir: Path, present: tuple = IMPORT_TRIO) -> subprocess.CompletedProcess: + """Import ``event_handler`` in a subprocess as the deployed Lambda does. + + The environment is scrubbed of the Supabase trio (plus GITHUB_DISPATCH_TOKEN) + and each var in ``present`` is added back with its dummy value, so a dev + shell that happens to export SUPABASE_* can never mask the scenario. + """ + env = { + key: value + for key, value in os.environ.items() + if not key.startswith("SUPABASE_") and key not in {"GITHUB_DISPATCH_TOKEN"} + } + for var in present: + env[var] = DUMMY_ENV[var] + env["PYTHONPATH"] = str(sim_dir) + os.pathsep + env.get("PYTHONPATH", "") + + probe_path = sim_dir / "_import_probe.py" + if not probe_path.is_file(): + probe_path.write_text(PROBE_SCRIPT, encoding="utf-8") + + return subprocess.run( + [sys.executable, str(probe_path)], + cwd=sim_dir, + env=env, + capture_output=True, + text=True, + timeout=120, + check=False, + ) + + +class TestColdStartNeedsSupabaseEnv: + def test_no_supabase_env_fails_the_chain_import(self, lambda_sim_dir: Path): + """The escalated deployed state: SUPABASE_URL+API_KEY absent. + + config.py:19 builds the anon client at import -> the cold start dies + with SupabaseException before handle_ml_picks_kick can run. + """ + result = _import_chain(lambda_sim_dir, present=()) + + assert result.returncode != 0, ( + "the handler chain imported WITHOUT any Supabase env - if this " + "ever becomes true, the template's import-required wiring (and " + "test_template_env_vars.py) is over-wired and can be reduced" + ) + assert "IMPORT-FAIL" in result.stdout + assert "supabase_url is required" in result.stdout + + def test_missing_service_role_key_fails_the_chain_import(self, lambda_sim_dir: Path): + """URL+anon present, SUPABASE_SERVICE_ROLE_KEY absent. + + config.py:23-26 builds the service-role client at import -> the + cold start dies too ("supabase_key is required"), which is why the + template wires all THREE keys and not just the first failing two. + """ + result = _import_chain(lambda_sim_dir, present=("SUPABASE_URL", "SUPABASE_API_KEY")) + + assert result.returncode != 0 + assert "IMPORT-FAIL" in result.stdout + assert "supabase_key is required" in result.stdout + + def test_missing_api_key_alone_fails_the_chain_import(self, lambda_sim_dir: Path): + """SUPABASE_API_KEY absent (URL present): the same import crash. + + Mapping the failure to exactly one var per case proves each of the + three is individually import-required, not just the pair. + """ + result = _import_chain(lambda_sim_dir, present=("SUPABASE_URL",)) + + assert result.returncode != 0 + assert "supabase_key is required" in result.stdout + + def test_full_trio_imports_the_chain(self, lambda_sim_dir: Path): + """With the trio wired (the template's Option-A state) the handler + chain imports cleanly - the fix is sufficient for the cold start.""" + result = _import_chain(lambda_sim_dir, present=IMPORT_TRIO) + + assert result.returncode == 0, ( + f"the handler chain failed to import WITH the import-required env:\n{result.stdout}\n{result.stderr}" + ) + assert "IMPORT-OK event_handler" in result.stdout + + def test_the_relay_module_alone_never_imports_config(self, lambda_sim_dir: Path): + """Why the wiring is non-obvious: ``ml_picks_kick`` itself is only + stdlib - the import-time requirement comes from the SHARED handler + chain, not from the relay module.""" + env = {key: value for key, value in os.environ.items() if not key.startswith("SUPABASE_")} + env["PYTHONPATH"] = str(lambda_sim_dir) + result = subprocess.run( + [sys.executable, "-c", "import ml_picks_kick; print('IMPORT-OK ml_picks_kick')"], + cwd=lambda_sim_dir, + env=env, + capture_output=True, + text=True, + timeout=60, + check=False, + ) + + assert result.returncode == 0 + assert "IMPORT-OK ml_picks_kick" in result.stdout diff --git a/tests/unit/test_ml_picks_kick.py b/tests/unit/test_ml_picks_kick.py new file mode 100644 index 00000000..724c6728 --- /dev/null +++ b/tests/unit/test_ml_picks_kick.py @@ -0,0 +1,235 @@ +"""Unit tests for the MLPicksKick relay (smartscore/ml_picks_kick.py). + +The relay performs exactly ONE GitHub repository_dispatch per pipeline kick +(the KickMLPicks state at the end of the PlayerProcessingPipeline run). +These tests mock urllib entirely - no network, no Supabase, no real AWS - +and pin down: the exact POST body/URL (owner/repo, event_type, +client_payload), year-free ordering of the payload keys, the single +immediate retry on transient 5xx/429, the fail-loud missing-token path, and +that an explicit event date is used verbatim (no ET-today derivation when +the pipeline passes one). docs/ml-picks-runbook.md ("Per-game kick"). +""" + +import io +import logging +import re +from unittest.mock import patch + +import pytest + +import ml_picks_kick +from ml_picks_kick import ( + DEFAULT_GITHUB_OWNER, + DEFAULT_GITHUB_REPO, + DISPATCH_EVENT_TYPE, + KICK_CONTEXT, + MissingDispatchTokenError, + relay_game_kick, + resolve_pick_date, +) + +DISPATCH_URL = f"https://api.github.com/repos/{DEFAULT_GITHUB_OWNER}/{DEFAULT_GITHUB_REPO}/dispatches" + + +class _FakeResponse: + """Empty 204, the success shape of repository_dispatch.""" + + status = 204 + + def read(self): + return b"" + + def __enter__(self): + return self + + def __exit__(self, *args): + return False + + +def _http_error(status, body=b""): + return ml_picks_kick.urllib.error.HTTPError( + url=DISPATCH_URL, code=status, msg="error", hdrs=None, fp=io.BytesIO(body) + ) + + +@pytest.fixture +def token_env(monkeypatch): + monkeypatch.setenv("GITHUB_DISPATCH_TOKEN", "gh_pat_test_token") + monkeypatch.delenv("GITHUB_OWNER", raising=False) + monkeypatch.delenv("GITHUB_REPO", raising=False) + monkeypatch.delenv("ML_KICK_DRY", raising=False) + + +def _sent_request(mock_urlopen): + assert mock_urlopen.call_count >= 1 + request = mock_urlopen.call_args[0][0] + return request, mock_urlopen + + +def test_exact_post_body_and_target(mock_dispatch, token_env): + relay_game_kick({"date": "2026-03-14"}) + request, _ = _sent_request(mock_dispatch) + + # owner/repo resolution: api.github.com/repos///dispatches + assert request.full_url == DISPATCH_URL + assert request.get_method() == "POST" + + body = ml_picks_kick.json.loads(request.data.decode("utf-8")) + assert request.headers["Authorization"] == "Bearer gh_pat_test_token" + assert body["event_type"] == DISPATCH_EVENT_TYPE + assert body["client_payload"] == { + "date": "2026-03-14", # the explicit date the KickMLPicks state passed + "dry": False, + "context": KICK_CONTEXT, + } + + +def test_explicit_date_is_used_verbatim_without_any_date_derivation(mock_dispatch, token_env): + """An explicit event.date must fully replace the ET slate derivation. + + The date used to be stamped by schedule_run into the EventBridge target + Input and re-derived from Toronto-today as a fallback; now the pipeline + passes its own published date, so when it is present the wall clock is + never consulted at all. + """ + with patch("ml_picks_kick.datetime.datetime") as mock_now: + relay_game_kick({"date": "2026-01-14"}) + mock_now.now.assert_not_called() + + request, _ = _sent_request(mock_dispatch) + body = ml_picks_kick.json.loads(request.data.decode("utf-8")) + assert body["client_payload"]["date"] == "2026-01-14" + + +def test_payload_ordering_is_year_free(mock_dispatch, token_env): + """Key order is stable and no year/month stamping creeps in. + + The payload carries only the slate date - never a created_at/happened + timestamp - so re-runs on one date produce byte-identical dispatches + regardless of the year they happen in. + """ + relay_game_kick({"date": "2026-03-14"}) + request, _ = _sent_request(mock_dispatch) + + body = ml_picks_kick.json.loads(request.data.decode("utf-8")) + assert list(body) == ["event_type", "client_payload"] + assert list(body["client_payload"]) == ["date", "dry", "context"] + + # Byte-stability rule: only the slate date travels (no wall-clock + # timestamp), so re-kicks of one date dispatch identical bodies. + date = body["client_payload"]["date"] + assert re.fullmatch(r"\d{4}-\d{2}-\d{2}", date) + assert f'{{"date": "{date}", "dry":' in request.data.decode("utf-8") + + +@pytest.mark.parametrize("status", sorted(ml_picks_kick.TRANSIENT_STATUS_CODES)) +def test_transient_failure_retries_once(status, token_env, monkeypatch): + monkeypatch.setattr(ml_picks_kick.time, "sleep", lambda seconds: None) + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.side_effect = [ + _http_error(status), + _FakeResponse(), + ] + result = relay_game_kick({"date": "2026-03-14"}) + + assert mock_urlopen.call_count == 2 # one immediate retry, then success + assert result["dispatched"] is True + + +def test_permanent_failure_is_not_retried(token_env, monkeypatch): + monkeypatch.setattr(ml_picks_kick.time, "sleep", lambda seconds: None) + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.side_effect = [_http_error(403)] + with pytest.raises(RuntimeError, match="repository_dispatch failed"): + relay_game_kick({"date": "2026-03-14"}) + + assert mock_urlopen.call_count == 1 # 4xx is deterministic: no retry + + +def test_403_body_and_scope_hint_are_surfaced(token_env, monkeypatch): + """The 403 must never be a black box: body + scope hint in the raise. + + GitHub's 403 body is the ONLY way to diagnose an under-scoped token from + inside the Lambda (fine-grained PAT with Actions: write only → 'Resource + not accessible by integration'), so the relay includes GitHub's response + body verbatim plus the corrected permission guidance in the message. + """ + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.side_effect = [_http_error(403, b'{ "message": "Resource not accessible by integration" }')] + with pytest.raises( + RuntimeError, + match="Resource not accessible by integration", + ) as excinfo: + relay_game_kick({"date": "2026-03-14"}) + + message = str(excinfo.value) + assert "status=403" in message + assert "Actions: Read & write AND Contents: Read & write" in message + assert "repo scope" in message + + +def test_transient_failure_retry_log_includes_body(token_env, monkeypatch, caplog): + monkeypatch.setattr(ml_picks_kick.time, "sleep", lambda seconds: None) + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.side_effect = [ + _http_error(502, b'{"message": "soz, blip"}'), + _FakeResponse(), + ] + with caplog.at_level(logging.WARNING): + relay_game_kick({"date": "2026-03-14"}) + + needle = "Transient GitHub dispatch failure" + warnings = [r for r in caplog.records if r.levelno == logging.WARNING and needle in r.message] + assert warnings, "retry warning expected" + assert "soz, blip" in warnings[0].getMessage() + + +def test_missing_token_fails_loudly_before_any_http(monkeypatch): + monkeypatch.delenv("GITHUB_DISPATCH_TOKEN", raising=False) + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + with pytest.raises(MissingDispatchTokenError): + relay_game_kick({"date": "2026-03-14"}) + + assert mock_urlopen.call_count == 0 # nothing silently dropped either + + +def test_owner_repo_env_overrides(token_env, monkeypatch): + monkeypatch.setenv("GITHUB_OWNER", "someone-else") + monkeypatch.setenv("GITHUB_REPO", "OtherRepo") + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.return_value = _FakeResponse() + relay_game_kick({"date": "2026-03-14"}) + + request = mock_urlopen.call_args[0][0] + assert request.full_url == "https://api.github.com/repos/someone-else/OtherRepo/dispatches" + + +def test_ml_kick_dry_env_forces_dry(token_env, monkeypatch): + monkeypatch.setenv("ML_KICK_DRY", "true") + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.return_value = _FakeResponse() + relay_game_kick({"date": "2026-03-14"}) + + request = mock_urlopen.call_args[0][0] + body = ml_picks_kick.json.loads(request.data.decode("utf-8")) + assert body["client_payload"]["dry"] is True + + +def test_resolve_pick_date_falls_back_to_toronto_today(): + # Manual owner invoke without a date: mirror the pipeline's ET-today + # notion (service.get_date). This fallback exists ONLY for manual mode - + # the state machine always passes an explicit date. + with patch("ml_picks_kick.datetime.datetime") as mock_now: + mock_now.now.return_value.date.return_value.isoformat.return_value = "2026-07-04" + assert resolve_pick_date({}) == "2026-07-04" + mock_now.now.assert_called_once() + (tz_arg,), _ = mock_now.now.call_args + assert str(tz_arg) == "America/Toronto" + + +@pytest.fixture +def mock_dispatch(): + """The happy-path urlopen stub: one empty 204.""" + with patch("ml_picks_kick.urllib.request.urlopen") as mock_urlopen: + mock_urlopen.return_value = _FakeResponse() + yield mock_urlopen diff --git a/tests/unit/test_notify_users_state_size.py b/tests/unit/test_notify_users_state_size.py index 92b57037..a0ca49b5 100644 --- a/tests/unit/test_notify_users_state_size.py +++ b/tests/unit/test_notify_users_state_size.py @@ -104,18 +104,12 @@ def test_pipeline_normal_and_last_run_reload_separated_slices(): assert last_run_routing["last_run"] == "PublishToDb" assert pipeline["States"]["CheckLastRun"]["Default"] == "GetInjuries" - # CheckInitialRun is now only reachable for first_run/normal_run, so - # last_run must no longer be routed there; unexpected statuses degrade - # to the normal-run archive+publish rather than hanging the machine. # normal_run goes through SaveToDb so the mid-morning refresh also - # updates Player-Snapshots. - initial_routing = { - choice["StringEquals"]: choice["Next"] for choice in pipeline["States"]["CheckInitialRun"]["Choices"] - } - assert "last_run" not in initial_routing - assert initial_routing["normal_run"] == "SaveToDb" - assert initial_routing["first_run"] == "SaveToDb" - assert pipeline["States"]["CheckInitialRun"]["Default"] == "SaveToDb" + # updates Player-Snapshots; the former CheckInitialRun Choice was a no-op + # (all three branches were SaveToDb, PR #134/#136) and was removed - + # GetTims routes straight to SaveToDb. + assert "CheckInitialRun" not in pipeline["States"] + assert pipeline["States"]["GetTims"]["Next"] == "SaveToDb" assert pipeline["States"]["SaveToDb"]["Next"] == "CheckSaveHistory" history_routing = { diff --git a/tests/unit/test_picks_db_nan_behaviors.py b/tests/unit/test_picks_db_nan_behaviors.py new file mode 100644 index 00000000..4b622950 --- /dev/null +++ b/tests/unit/test_picks_db_nan_behaviors.py @@ -0,0 +1,436 @@ +"""Unit tests for the stat-only Picks write (run_daily_picks.stat_update_picks_db). + +No AWS, no Supabase: the Picks table is an in-memory fake shaped like the +supabase-py builder chain, with an explicit column set (a live Picks table +carries exactly id/date/player_id/name/team_name/stat/tims/gpg/hgpg - it has +NO `ppg`, which a stat-only PATCH can never touch anyway; the whitelist +comment lives in run_daily_picks.REMOVE_KEYS). Asserted: + +(a) the SMARTSCORE_ML_PICKS output rows never carry REMOVE_KEYS (`ppg`); +(b) the stat fill is a per-row, id-scoped PATCH that moves ONLY the stat + column - NO delete, no insert, no upsert, row count/ids unchanged - on a + 3-row dev slate AND on a mocked full 495-row Picks-prod slate + (the live-verified full-slate shape, mocked); +(c) a non-finite prediction PATCHes stat=None; a missing slate is a clean + zero-write skip; call-ups are WARNed; a failing PATCH is LOUD and an + all-patches-failed run raises. + +The site's own pipeline keeps utility.save_to_db (its OWN full-slate wipe + +reinsert path, untouched); the ML path writes through stat_update only, so +the moment run_daily_picks' legacy wipe-then-3-row mode was removed, the +probe/wipe/restore scaffolding (save_picks_db) went with it - these tests +no longer cover it (git history retains the deleted tests). +Import bootstrap mirrors tests/unit/test_predict_picks.py. +""" + +import copy +import importlib.util +import sys +import types +from pathlib import Path + +import numpy as np +import pandas as pd +import pytest + +ROOT = Path(__file__).resolve().parents[2] +sys.path[0:0] = [str(ROOT / "smartscore"), str(ROOT / "smartscore" / "scripts" / "backtrack")] + +# constants.py expects the compiled prediction wheel at import time (see +# test_predict_picks.py's note); the run path here only reads constant strings. +_rust_stub = types.ModuleType("make_predictions_rust") + + +class _StubWeights: # noqa: N801 + def __init__(self, **_kwargs): + self.__dict__.update(_kwargs) + + +_rust_stub.Weights = _StubWeights +sys.modules.setdefault("make_predictions_rust", _rust_stub) + +_SPEC = importlib.util.spec_from_file_location( + "run_daily_picks", ROOT / "smartscore" / "scripts" / "backtrack" / "run_daily_picks.py" +) +# Reuse the module tests/unit/test_predict_picks.py already loaded under the +# canonical "run_daily_picks" name when this file shares a session with it: +# BOTH files patch by string key ("run_daily_picks.SUPABASE_ADMIN_CLIENT"), +# and re-executing the module under the same sys.modules key would replace +# the entry with a new object - the other file's patches (and `mod`) would +# then point at a stale object -> cross-file pollution (26 failures). One +# shared module object per session, each test wiring its own fakes via +# monkeypatch (which restores attributes between tests), keeps both files' +# `mod` references consistent. +mod = sys.modules.get("run_daily_picks") +if not hasattr(mod, "__file__") or Path(mod.__file__).resolve() != Path(_SPEC.origin).resolve(): + mod = importlib.util.module_from_spec(_SPEC) + sys.modules["run_daily_picks"] = mod + _SPEC.loader.exec_module(mod) + +ON_DATE = "2026-10-19" + +# The live Picks-{ENV} column set (probed 2026-10-27: no `ppg` on either env; +# every remaining whitelisted key exists). +PICKS_COLUMNS = {"id", "date", "player_id", "name", "team_name", "stat", "tims", "gpg", "hgpg"} + +PRIOR_ROWS = [ + { + "id": 1, + "date": "2026-10-11", + "player_id": 55, + "name": "old pick", + "team_name": "T", + "stat": 12.3, + "tims": 1, + "gpg": 0.3, + "hgpg": 0.1, + }, + { + "id": 2, + "date": "2026-10-11", + "player_id": 56, + "name": "old pick 2", + "team_name": "T", + "stat": 9.9, + "tims": 2, + "gpg": 0.2, + "hgpg": 0.2, + }, +] + + +class FakePostgrestError(Exception): + """A 4xx PostgREST error (PGRST204 = unknown column in a write).""" + + def __init__(self, code, message): + super().__init__(message) + self.code = code + + +class FakeResult: + def __init__(self, rows): + self.data = rows + self.count = None + + +class FakeQueryBuilder: + """Mini supabase-py builder: select/delete/upsert/eq/neq/limit/execute. + + Column-faithful: any request naming a column the table lacks raises the + PGRST204-equivalent, exactly like the live Picks-{ENV} tables (that is + what turns one unsupported key into wipe-then-fail). Every filter method + chains, so the builder satisfies the `.delete().neq(...)` shape too. + """ + + def __init__(self, fake, table): + self._fake = fake + self._table = table + self._mode = "select" + self._columns = None + self._payload = None + self._eq = None + + def select(self, *columns, **_kw): + self._mode = "select" + joined = ",".join(columns) + self._columns = [col.strip() for col in joined.split(",") if col.strip()] + return self + + def update(self, payload): + """The stat_update PATCH shape: update({...}).eq(col, val).execute().""" + self._mode = "update" + self._payload = dict(payload) + return self + + def upsert(self, payload): + self._mode = "upsert" + self._payload = payload + return self + + def eq(self, col, val): + self._eq = (col, val) + return self + + def limit(self, _n): + return self + + def execute(self): + fake = self._fake + rows = fake.tables[self._table] + if self._mode == "select": + return self._execute_select(fake, rows) + if self._mode == "update": + return self._execute_update(fake, rows) + raise AssertionError(f"unexpected builder mode {self._mode}") + + def _execute_select(self, fake, rows): + if self._columns: + fake.log.append(("select", tuple(self._columns))) + if self._columns == ["*"]: # PostgREST select=* means all columns + return FakeResult([dict(row) for row in rows]) + unknown = [col for col in self._columns or [] if col not in fake.columns] + if unknown: + raise FakePostgrestError("PGRST204", f"column {self._table}.{unknown[0]} does not exist") + return FakeResult([dict(row) for row in rows]) + + def _execute_update(self, fake, rows): + if fake.fail_updates: # scripted PATCH failure(s), consumed in call order + raise fake.fail_updates.pop(0) + unknown = set(self._payload) - fake.columns + if unknown: + raise FakePostgrestError("PGRST204", f"column {self._table}.{sorted(unknown)[0]} does not exist") + col, val = self._eq or (None, None) + if col is None: + raise AssertionError("unfiltered update (a stat fill must never be unscoped)") + matched = [row for row in rows if row.get(col) == val] + for row in matched: + row.update(self._payload) + fake.log.append(("update", (col, val, dict(self._payload), len(matched)))) + return FakeResult([dict(row) for row in rows]) + + +class FakeSupabase: + """One-table client with a fixed column set + an order-revealing call log.""" + + def __init__(self, table, columns, rows=None, fail_updates=None): + self.columns = set(columns) + self.tables = {table: [dict(r) for r in (rows or [])]} + self.log = [] + self.fail_updates = list(fail_updates or []) + + def table(self, name): + assert len(self.tables) == 1, f"client wired for one table, asked for {name}" + return FakeQueryBuilder(self, name) + + +def make_picks(): + """Three whitelisted output rows (ppg dropped by pick_rows_to_picks_db - + the run's top-3 log/summary projection).""" + picks = pd.DataFrame( + { + "date": [ON_DATE] * 3, + "player_id": [101.0, 102.0, 103.0], + "name": ["mack", "kadri", "raddysh"], + "team_name": ["Colorado", "Colorado", "Toronto"], + "tims": [1.0, 2.0, 3.0], + "gpg": [0.5, 0.4, 0.3], + "hgpg": [0.2, 0.21, 0.1], + "ppg": [0.9, 0.8, 0.7], + "ensemble": [0.999, 0.978, 1.0], + } + ) + return mod.pick_rows_to_picks_db(picks) + + +def wire_env(monkeypatch, fake): + monkeypatch.setattr(mod, "ENV", "dev") + monkeypatch.setattr(mod, "SUPABASE_ADMIN_CLIENT", fake) + + +def rows_of(fake, table="Picks-dev"): + return fake.tables[table] + + +# ------------------------------------------------------------- (a) ppg dropped + + +def test_payload_never_carries_remove_keys(): + """The SMARTSCORE_ML_PICKS output rows are exactly the live table's + column keys - `ppg` is gone.""" + rows = make_picks() + assert len(rows) == 3 + for row in rows: + assert set(row) == {"date", "player_id", "name", "team_name", "stat", "tims", "gpg", "hgpg"} + assert set(row).isdisjoint(mod.REMOVE_KEYS) + # the whitelist keeps the training-frame keys for the record; REMOVE_KEYS + # decides what is serialized + assert "ppg" in mod.PICK_DB_COLUMNS and mod.REMOVE_KEYS == ["ppg"] + + +# ------------------------------- stat_update (the ONLY write: stat-only PATCH) + + +def make_sim(): + """The scored sim, keyed to PRIOR_ROWS' player_ids (55/56) plus player + 99 - which the slate does NOT carry (the scratched-frame case).""" + return pd.DataFrame( + { + "date": [ON_DATE] * 3, + "player_id": [55, 56, 99], + "tims": [1, 2, 1], + "ensemble": [0.999, 0.111, 0.5], + } + ) + + +def test_stat_value_convention_matches_the_legacy_percent(): + """stat_value is the DISPLAY convention (0-100 percent, 1 decimal); + the DB write divides it by 100 at the stat_update PATCH boundary, so + the column holds a 0-1 fraction. None on a non-finite prediction (a + NaN must never patch a number into the column).""" + assert mod.stat_value(0.12345) == 12.3 + assert mod.stat_value(0.999) == 99.9 + assert mod.stat_value(np.nan) is None + assert mod.stat_value(float("inf")) is None + + +def test_stat_update_patches_only_stat_and_never_inserts(monkeypatch): + """THE no-wipe contract at the write surface: stat_update issues ONLY + per-row PATCHes (update().eq('id', ...)) - no delete, no insert, no + upsert - and each PATCH carries ONLY the stat key. The other columns + and the row count are untouched.""" + prior = copy.deepcopy(PRIOR_ROWS) + fake = FakeSupabase("Picks-dev", PICKS_COLUMNS, rows=prior) + wire_env(monkeypatch, fake) + + result = mod.stat_update_picks_db(make_sim(), ON_DATE) + + kinds = [entry[0] for entry in fake.log] + assert kinds == ["select", "update", "update"] # NO delete, NO insert, NO upsert + for entry in fake.log: + if entry[0] == "update": + _col, row_id, payload, matched = entry[1] + assert row_id in (1, 2) # the PATCH is id-scoped + assert set(payload) == {"stat"} # ONLY the stat column moves + assert matched == 1 + table = rows_of(fake) + assert len(table) == 2 # row count unchanged (99 was never inserted) + assert sorted(row["id"] for row in table) == [1, 2] # ids untouched + by_id = {row["id"]: row for row in table} + assert by_id[1] == {**prior[0], "stat": 99.9 / 100} # 0.999 - the 0-1 decimal write form + assert by_id[2] == {**prior[1], "stat": 11.1 / 100} # 0.111 + assert result["filled"] == 2 and result["slate_rows"] == 2 and result["not_on_slate"] == 1 + + +def test_stat_update_nan_prediction_patches_none(monkeypatch): + """A non-finite ensemble PATCHes stat=None (the column stays null) - it + never crashes the fill nor lies with a number. Same convention as + pick_rows_to_picks_db's stat cell (see mod.stat_value).""" + sim = pd.DataFrame({"player_id": [55], "ensemble": [np.nan]}) + fake = FakeSupabase("Picks-dev", PICKS_COLUMNS, rows=PRIOR_ROWS) + wire_env(monkeypatch, fake) + + result = mod.stat_update_picks_db(sim, ON_DATE) + + assert result["filled"] == 1 + assert rows_of(fake)[0]["stat"] is None + + +def test_stat_update_100th_percentile_writes_exactly_one(monkeypatch): + """Micro-assert of the 0-1 decimal write boundary: a player at the + 100th percentile (stat_value -> 100) PATCHes stat == 1.0 EXACTLY.""" + sim = pd.DataFrame({"player_id": [55], "ensemble": [1.0]}) + fake = FakeSupabase("Picks-dev", PICKS_COLUMNS, rows=copy.deepcopy(PRIOR_ROWS)) + wire_env(monkeypatch, fake) + + result = mod.stat_update_picks_db(sim, ON_DATE) + + assert result["filled"] == 1 + assert rows_of(fake)[0]["stat"] == 1.0 + + +def test_stat_update_missing_slate_is_a_clean_skip_with_zero_writes(monkeypatch): + """The TIMING dependency: when the site's own SaveToDb publish has not + written the date's slate yet, the mode returns skipped cleanly - exactly + ONE read, no PATCH, no insert (the site's pipeline owns the rows).""" + fake = FakeSupabase("Picks-dev", PICKS_COLUMNS, rows=[]) + wire_env(monkeypatch, fake) + + result = mod.stat_update_picks_db(make_sim(), ON_DATE) + + assert result == {"slate_rows": 0, "filled": 0, "no_frame": 0, "not_on_slate": 0, "skipped": True} + assert [entry[0] for entry in fake.log] == ["select"] + + +def test_stat_update_warns_callups_and_leaves_their_stat(monkeypatch, capsys): + """A slate row without a prediction (call-up without history) is WARNed + by name and its stat stays untouched - never an invented value.""" + empty_stat_row = {**PRIOR_ROWS[0], "id": 3, "name": "callup", "player_id": 404, "stat": None} + fake = FakeSupabase("Picks-dev", PICKS_COLUMNS, rows=PRIOR_ROWS + [empty_stat_row]) + wire_env(monkeypatch, fake) + + result = mod.stat_update_picks_db(make_sim(), ON_DATE) + + assert result["no_frame"] == 1 and result["filled"] == 2 + out = capsys.readouterr().out + assert "callup' (player_id 404)" in out + assert "stat left UNTOUCHED" in out + assert rows_of(fake)[2]["stat"] is None + + +def test_stat_update_write_failure_is_loud_and_continues(monkeypatch, capsys): + """One failing PATCH cannot withhold the fill: the failing row keeps the + site's stat, the rest land, and the failure is LOUD (the same spirit as + save_picks_db, minus the scaffolding a PATCH never needs).""" + sim = pd.DataFrame({"player_id": [55, 56], "ensemble": [0.5, 0.6]}) + fake = FakeSupabase( + "Picks-dev", PICKS_COLUMNS, rows=PRIOR_ROWS, fail_updates=[FakePostgrestError("PGRST204", "boom")] + ) + wire_env(monkeypatch, fake) + + result = mod.stat_update_picks_db(sim, ON_DATE) + + assert result["filled"] == 1 + out = capsys.readouterr().out + assert "stat PATCH failed for Picks-dev row id=1" in out + assert "the next kick re-fills" in out + + +def test_stat_update_total_write_failure_raises(monkeypatch): + """Every PATCH failing = the write path failed outright: raise (never a + green run that wrote zero stat columns while the slate stood full).""" + sim = pd.DataFrame({"player_id": [55, 56], "ensemble": [0.5, 0.6]}) + fake = FakeSupabase( + "Picks-dev", + PICKS_COLUMNS, + rows=PRIOR_ROWS, + fail_updates=[FakePostgrestError("PGRST204", "boom"), FakePostgrestError("PGRST204", "boom")], + ) + wire_env(monkeypatch, fake) + + with pytest.raises(RuntimeError, match="wrote zero stat columns"): + mod.stat_update_picks_db(sim, ON_DATE) + + +def test_stat_update_full_prod_like_slate_495_rows(monkeypatch): + """The 495-row Picks-prod full-slate shape, mocked (the live-verified + prod run's setup): every slate row gets exactly ONE id-scoped PATCH + carrying ONLY {"stat"}; row count, ids and every other column are + unchanged; NO delete/insert/upsert happens anywhere.""" + slate = [ + { + "id": row_id, + "date": ON_DATE, + "player_id": 1_000_000 + row_id, + "name": f"player-{row_id}", + "team_name": "T", + "stat": 0.2 + (row_id % 10) * 0.01, # the site's raw fractions + "tims": (row_id % 3) + 1, + } + for row_id in range(1, 496) + ] + sim = pd.DataFrame( + { + "date": [ON_DATE] * 495, + "player_id": [1_000_000 + row_id for row_id in range(1, 496)], + "tims": [(row_id % 3) + 1 for row_id in range(1, 496)], + "ensemble": [0.5 + (row_id % 50) / 100 for row_id in range(1, 496)], + } + ) + fake = FakeSupabase("Picks-prod", PICKS_COLUMNS, rows=slate) + monkeypatch.setattr(mod, "ENV", "prod") + monkeypatch.setattr(mod, "SUPABASE_ADMIN_CLIENT", fake) + + result = mod.stat_update_picks_db(sim, ON_DATE) + + assert result == {"slate_rows": 495, "filled": 495, "no_frame": 0, "not_on_slate": 0, "skipped": False} + kinds = [entry[0] for entry in fake.log] + assert kinds == ["select"] + ["update"] * 495 # one read + 495 PATCHes: NO delete / no insert / no upsert + assert len({(e[1][0], e[1][1]) for e in fake.log if e[0] == "update"}) == 495 # every id unique + before = {r["id"]: dict(r) for r in slate} + after = {r["id"]: dict(r) for r in fake.tables["Picks-prod"]} + assert set(after) == set(before) and len(after) == 495 # ids/count unchanged + for row_id, old in before.items(): + assert old["stat"] != after[row_id]["stat"] # the stat column moved... + old.pop("stat"), after[row_id].pop("stat") + assert old == after[row_id] # ...and ONLY it did diff --git a/tests/unit/test_pipeline_schedule.py b/tests/unit/test_pipeline_schedule.py index 11bf571f..cc944830 100644 --- a/tests/unit/test_pipeline_schedule.py +++ b/tests/unit/test_pipeline_schedule.py @@ -33,10 +33,18 @@ class CfnLoader(yaml.SafeLoader): - """SafeLoader that keeps CloudFormation intrinsic tag scalars inspectable.""" + """SafeLoader that keeps CloudFormation intrinsic tags inspectable (scalar or sequence values).""" -CfnLoader.add_multi_constructor("!", lambda loader, suffix, node: {suffix: loader.construct_scalar(node)}) +def _cfn_intrinsic(loader, suffix, node): + if isinstance(node, yaml.SequenceNode): + return {suffix: loader.construct_sequence(node)} + if isinstance(node, yaml.MappingNode): + return {suffix: loader.construct_mapping(node)} + return {suffix: loader.construct_scalar(node)} + + +CfnLoader.add_multi_constructor("!", _cfn_intrinsic) TEMPLATE = yaml.load((TEMPLATES / "template.yaml").read_text(encoding="utf-8"), Loader=CfnLoader) @@ -139,15 +147,51 @@ def test_first_run_fetches_lineups_before_predictions(): def test_normal_run_archives_before_publishing(): pipeline = _asl("player_processing_pipeline.asl.json")["States"] - routing = {choice["StringEquals"]: choice["Next"] for choice in pipeline["CheckInitialRun"]["Choices"]} - assert routing["normal_run"] == "SaveToDb" - assert routing["first_run"] == "SaveToDb" + # The former CheckInitialRun Choice state was a no-op once PR #134 made + # normal_run archive too (all three branches went to the same SaveToDb); + # GetTims now routes straight to SaveToDb. + assert pipeline["GetTims"]["Next"] == "SaveToDb" + assert "CheckInitialRun" not in pipeline assert pipeline["SaveToDb"]["Next"] == "CheckSaveHistory" history = {choice["StringEquals"]: choice["Next"] for choice in pipeline["CheckSaveHistory"]["Choices"]} assert history["first_run"] == "UpdateHistory" assert pipeline["CheckSaveHistory"]["Default"] == "PublishToDb" + # The ML kick is no longer a parallel EventBridge target: it fires after + # the write path completes (PublishToDb -> KickMLPicks -> End). + assert pipeline["PublishToDb"]["Next"] == "KickMLPicks" + + +def test_kick_ml_picks_is_the_terminal_write_path_consumer(): + """Race fix (PR #146 follow-up): KickMLPicks runs at the END of the run. + + The kick must be the terminal Task of BOTH first_run and + normal_run/last_run rounds, pass ONLY the pipeline's own pick date + ($.date), and keep the state lean via ResultPath NONE. No Retry: a + failed dispatch fails the run loudly, and re-triggering is an idempotent + re-kick. + """ + pipeline = _asl("player_processing_pipeline.asl.json") + + kick = pipeline["States"]["KickMLPicks"] + assert kick["Type"] == "Task" + assert kick["Resource"].endswith(":function:MLPicksKick-prod") + assert kick["Parameters"] == {"date.$": "$.date"} + assert kick["ResultPath"] is None + assert kick["End"] is True + assert "Retry" not in kick + + +def test_publish_to_db_is_no_longer_the_terminal_state(): + pipeline = _asl("player_processing_pipeline.asl.json")["States"] + + # Serialization point: PublishToDb hands off to KickMLPicks instead of + # ending the run, so the Actions pass starts only after the LIVE + # snapshot rows (incl. fresh tims) are published. + assert pipeline["PublishToDb"]["Next"] == "KickMLPicks" + assert "End" not in pipeline["PublishToDb"] + _PLAYERS = [ { @@ -220,15 +264,12 @@ def test_status_routes_to_the_expected_archive_branch(status): if status == "last_run": # last_run is routed at CheckLastRun, before the enrichment chain; - # CheckInitialRun must be unreachable for it. + # the enrichment branches (GetTims -> SaveToDb) must be unreachable for it. last_run_routing = {choice["StringEquals"]: choice["Next"] for choice in pipeline["CheckLastRun"]["Choices"]} assert last_run_routing["last_run"] == "PublishToDb" - initial = {choice["StringEquals"]: choice["Next"] for choice in pipeline["CheckInitialRun"]["Choices"]} - assert "last_run" not in initial return - initial = {choice["StringEquals"]: choice["Next"] for choice in pipeline["CheckInitialRun"]["Choices"]} - assert initial[status] == "SaveToDb" + assert pipeline["GetTims"]["Next"] == "SaveToDb" history = {choice["StringEquals"]: choice["Next"] for choice in pipeline["CheckSaveHistory"]["Choices"]} assert history["first_run"] == "UpdateHistory" @@ -346,13 +387,18 @@ def test_asl_routing_per_run_status(): assert normal[0] == "LoadWorkingSet" assert "SaveToDb" in normal assert "UpdateHistory" not in normal - assert normal[-1] == "PublishToDb" + assert normal[-1] == "KickMLPicks" last = _trace_asl(pipeline, "last_run") assert last[0] == "LoadWorkingSet" assert "SaveToDb" not in last assert "UpdateHistory" not in last - assert last[-1] == "PublishToDb" + assert last[-1] == "KickMLPicks" + + # Every exec-round kicks AFTER the publish writes complete. + for trace in (first, normal, last): + assert "KickMLPicks" in trace + assert trace.index("PublishToDb") < trace.index("KickMLPicks") @patch("event_handler.backfill_dates") diff --git a/tests/unit/test_predict_picks.py b/tests/unit/test_predict_picks.py new file mode 100644 index 00000000..71d3b697 --- /dev/null +++ b/tests/unit/test_predict_picks.py @@ -0,0 +1,1783 @@ +"""Unit tests for the predict-only ML picks daily pass (no AWS, no Supabase). + +The entry point under test is smartscore/scripts/backtrack/run_daily_picks.py +(the former Lambda handler's logic, now driven by the scheduled +.github/workflows/ml-picks.yml run). Stubbed surfaces: boto3.client("s3") +returns an in-memory fake (the bundle is joblib-dumped into a BytesIO), the +Supabase reads go through a fake table builder shaped like supabase-py's +builder chain (LIVE Player-Snapshots rows for the pick date; backtrack rows +for history), and the raw per-game store is a synthetic frame. Asserted: the +live-snapshot column hard fail naming exactly what is missing, the +no-live-rows CLEAN exit (warn + no write + status 0), the missing-history-day +warn-and-continue, the train/run shot-block equivalence (the shared core vs +the training math, <1e-9), the stale-artifact warning, encode +order/categories (the artifact's order/shape assertion), the ensemble +within-group rank rule, one-pick-per-group assembly, payload whitelisting, +and the dry/published run paths. +""" + +import datetime +import importlib.util +import io +import json +import re +import sys +import types +from pathlib import Path +from unittest.mock import MagicMock # noqa: E402 (bootstrap precedes; see module docstring + stubs) + +import numpy as np +import pandas as pd +import pytest + +ROOT = Path(__file__).resolve().parents[2] +sys.path[0:0] = [str(ROOT / "smartscore"), str(ROOT / "smartscore" / "scripts" / "backtrack")] + +# constants.py expects the compiled prediction wheel (make compile) at import +# time; save_to_db's code path only reads constant strings. Stub the wheel the +# way tests/unit/conftest.py stubs supabase - the integration compile is not a +# dependency of unit-testing the pick assembly. +_rust_stub = types.ModuleType("make_predictions_rust") + + +class _StubWeights: # noqa: N801 + def __init__(self, **_kwargs): + self.__dict__.update(_kwargs) + + +_rust_stub.Weights = _StubWeights +sys.modules.setdefault("make_predictions_rust", _rust_stub) + +# sys.path bootstrap precedes these imports deliberately (see above) +# (bootstrap deliberately precedes these imports) +# noqa anchor +# run_daily_picks is loaded ONCE per session under its canonical name: other +# unit files (tests/unit/test_picks_db_nan_behaviors.py) stub the same module +# with the file's fixtures patching by string key ("run_daily_picks.ENV"), +# which only lands if sys.modules["run_daily_picks"] is the SAME object this +# file's `mod` refers to (a second exec_module would clobber the entry and a +# name-keyed patch would land on the wrong module object -> cross-file +# pollution, 26 failures when the files share a session). +_run_dp_path = ROOT / "smartscore" / "scripts" / "backtrack" / "run_daily_picks.py" +mod = sys.modules.get("run_daily_picks") +if not hasattr(mod, "__file__") or Path(mod.__file__).resolve() != _run_dp_path.resolve(): + _SPEC = importlib.util.spec_from_file_location("run_daily_picks", _run_dp_path) # noqa: E402 + mod = importlib.util.module_from_spec(_SPEC) + sys.modules["run_daily_picks"] = mod + _SPEC.loader.exec_module(mod) + +# The runner-side refresh wrapper (ml-picks.yml's crawl step): same import +# pattern, no Supabase config manufactured (refresh_store deliberately +# imports no config module). +_RSPEC = importlib.util.spec_from_file_location( # noqa: E402 + "refresh_store", ROOT / "smartscore" / "scripts" / "backtrack" / "refresh_store.py" +) +refresh_mod = importlib.util.module_from_spec(_RSPEC) +sys.modules["refresh_store"] = refresh_mod +_RSPEC.loader.exec_module(refresh_mod) + +model = mod.model + + +class FakeProba: + """A 'model' whose positive-class probability column is a chosen array.""" + + def __init__(self, values): + self.values = np.asarray(values, dtype=float) + + def predict_proba(self, x): + return np.column_stack([1 - self.values[: len(x)], self.values[: len(x)]]) + + +class FakeRanker: + """Stand-in ranker: predict() scores are higher-is-better.""" + + def __init__(self, values): + self.values = np.asarray(values, dtype=float) + + def predict(self, x): + return self.values[: len(x)] + + +def make_bundle(today="2026-06-14"): + return { + "hgb": FakeProba([0.1, 0.8, 0.3, 0.6]), + "lgbm": FakeProba([0.2, 0.9, 0.4, 0.1]), + "logreg": FakeProba([0.3, 0.7, 0.5, 0.0]), + "ranker": FakeRanker([0.5, 0.4, 0.9, 0.2]), + "numeric_features": ["gpg", "hgpg"], + "categorical_features": ["tims"], + "all_features": ["gpg", "hgpg", "tims"], + "categories": {"tims": ["1", "2", "3"]}, + "metadata": {"train_through": today, "seed": 0, "git_hash": "abc1234"}, + } + + +@pytest.fixture +def env_vars(monkeypatch): + monkeypatch.setenv("ENV", "prod") + # run_daily_picks captures `from config import ENV` at import time, so the + # setenv above cannot rebind the module global: on CI (no local .env) it + # stays at config's default 'dev' and the STAGE B gap-fill is invoked with + # the wrong env. Bind the module global to the same env the fixture declares. + monkeypatch.setattr(mod, "ENV", "prod") + monkeypatch.setenv("ML_S3_BUCKET", "test-artifacts") + monkeypatch.delenv("ML_ARTIFACT_PREFIX", raising=False) + monkeypatch.delenv("ML_HISTORY_WINDOW_DAYS", raising=False) + + +# ------------------------------------------------------------------ fakes + + +class FakeResult: + """\\.range() result: exposes .data as row dicts.""" + + def __init__(self, frame): + self.data = frame.to_dict(orient="records") + + +class FakeTable: + def __init__(self, frame): + self._frame = frame + self._low = None + self._high = None + self._eq = None + + def select(self, *_cols, **_kw): + return self + + def limit(self, _n): + return self + + def eq(self, _col, value): + self._eq = value + return self + + def gte(self, _col, value): + self._low = value + return self + + def lt(self, _col, value): + self._high = value + return self + + def order(self, _col, **_kw): + return self + + def range(self, lo, hi): + rows = self._frame + if self._eq is not None: + col = "date" + rows = rows[rows[col].astype(str) == str(self._eq)] + if self._low is not None: + rows = rows[rows["date"] >= self._low] + if self._high is not None: + rows = rows[rows["date"] < self._high] + self._slice = rows.iloc[lo : min(hi + 1, len(rows))] + return self + + def execute(self): + if not hasattr(self, "_slice"): # a read that never paged (live .eq read) + self._slice = self._frame + return FakeResult(self._slice) + + +ON_DATE = "2026-06-14" +HISTORY_DATE = "2026-06-10" + +# The live snapshot's ON_DATE slate (Player-Snapshots-{ENV} shape: place-name +# team, abbrev opponent goalie team, morning-fresh rates, no shot columns). +LIVE_TEAMS = [ + ("Toronto", "TOR", "MTL"), + ("Toronto", "TOR", "MTL"), + ("Montréal", "MTL", "TOR"), + ("Montréal", "MTL", "TOR"), +] + + +def fake_live_rows(): + return pd.DataFrame( + { + "date": [ON_DATE] * 4, + "player_id": [1, 2, 9, 10], + "name": ["a", "b", "g", "h"], + "team_name": [t for t, _a, _o in LIVE_TEAMS], + "team_abbrev": [a for _t, a, _o in LIVE_TEAMS], + "opp_goalie_team": [o for _t, _a, o in LIVE_TEAMS], + "opp_goalie_name": ["brodeur"] * 4, + "home": [1, 1, 0, 0], + "tims": [1, 1, 2, 3], + "scored": [None] * 4, + "gpg": [0.5, 0.2, 0.0, 0.0], + "hgpg": [0.1, 0.2, 0.0, 0.0], + "five_gpg": [0.1, 0.2, 0.0, 0.0], + "hppg": [0.0] * 4, + "ppg": [0.2, 0.1, 0.0, 0.0], + "tgpg": [3.0, 3.0, 2.0, 2.0], + "otga": [2.5, 2.5, 2.0, 2.0], + "otshga": [0.01, 0.01, 0.02, 0.02], + "opp_goalie_gaa": [2.5] * 4, + "opp_goalie_save_pct": [0.9] * 4, + "opp_goalie_record": ["10-4-2"] * 4, + "opp_goalie_shutouts": [1] * 4, + "opp_goalie_games_played": [10] * 4, + "injury_status": [None] * 4, + "injury_desc": [None] * 4, + "lineup_unit": [None] * 4, + "lineup_position_group": ["C", "W", "C", "W"], + "lineup_status": [None] * 4, + "pp_unit": [None] * 4, + } + ) + + +def fake_history_players(): + """The SHARED history ledger Player-Snapshots-backtrack-prod shape (every + picks env reads that ONE ledger): one row per player-game + STRICTLY before the pick date (the prior-games context: scored labels, + club identity, rates), PLUS the stage-2 per-game raw columns.""" + return attach_fake_raw(fake_history_players_base()) + + +def fake_history_players_base(): + """The pre-20261027 frame shape (16 club columns, no raw) - test source + for the fail-closed migration-col check.""" + days = ["2026-06-01", "2026-06-03", "2026-06-05", "2026-06-08", HISTORY_DATE] + rows = [] + for index, day in enumerate(days): + rows.append( + pd.DataFrame( + { + "date": [day] * 4, + "player_id": [1, 2, 9, 10], + "name": ["a", "b", "g", "h"], + "team_name": ["Toronto", "Toronto", "Montréal", "Montréal"], + "team_abbrev": ["TOR", "TOR", "MTL", "MTL"], + "opponent_abbrev": ["MTL", "MTL", "TOR", "TOR"], + "home": [1, 1, 0, 0], + "tims": [0, 0, 0, 0], + "scored": [(index + offset) % 2 for offset in range(4)], + "gpg": [0.3, 0.2, 0.1, 0.0], + "hgpg": [0.1, 0.2, 0.0, 0.0], + "five_gpg": [0.1, 0.2, 0.0, 0.0], + "hppg": [0.0] * 4, + "ppg": [0.2, 0.1, 0.0, 0.0], + "injury_status": [None] * 4, + "injury_desc": [None] * 4, + "lineup_unit": [None] * 4, + "lineup_position_group": ["C", "W", "C", "W"], + "lineup_status": [None] * 4, + "pp_unit": [None] * 4, + } + ) + ) + return pd.concat(rows, ignore_index=True) + + +def attach_fake_raw(frame): + """The stage-2 raw columns for one fake-history frame: each row's OWN + game stats, matching fake_player_games()'s per-(player, date) lines + (toi already decimal minutes - what game_toi_min publishes).""" + games = fake_player_games() + lookup = { + (str(row["date"]), int(row["player_id"])): ( + int(row["goals"]), + int(row["shots"]), + float(row["toi"].split(":")[0]) + int(row["toi"].split(":")[1]) / 60, + ) + for row in games.to_dict("records") + } + keys = list(zip(frame["date"].astype(str), frame["player_id"].astype(int))) + missing = [key for key in keys if key not in lookup] + assert not missing, f"fake raw columns undefined for {missing[:3]}" + frame = frame.copy() + frame["game_goals"] = [lookup[key][0] for key in keys] + frame["game_shots"] = [lookup[key][1] for key in keys] + frame["game_points"] = [lookup[key][0] for key in keys] # provenance column; goals==points in the fixture + frame["game_toi_min"] = [lookup[key][2] for key in keys] + return frame + + +# The raw per-game store the shot block is computed from (the same games the +# history rows summarize): 2 skater-games per player per day, deterministic. +CORE_GAME_DAYS = ["2026-06-01", "2026-06-03", "2026-06-05", "2026-06-08", HISTORY_DATE] + + +def fake_player_games(): + rows = [] + for index, day in enumerate(CORE_GAME_DAYS): + for offset, player in enumerate([1, 2, 9, 10]): + rows.append( + { + "player_id": player, + "date": day, + "season": "20252026", + "goals": (index + offset) % 2, + "shots": 1 + ((index + offset) % 4), + "toi": f"{10 + index:02d}:{(15 * offset) % 60:02d}", + } + ) + return pd.DataFrame(rows) + + +def fake_teams(): + return pd.DataFrame( + { + "date": [HISTORY_DATE, ON_DATE] * 2, + "team_abbrev": ["TOR", "TOR", "MTL", "MTL"], + "tgpg": [3.0] * 4, + "otga": [2.5] * 4, + "otshga": [0.01] * 4, + "season": ["20252026"] * 4, + } + ) + + +def fake_goalies(): + return pd.DataFrame( + { + "date": [HISTORY_DATE, ON_DATE] * 2, + "player_id": [9, 9, 10, 10], + "name": ["g", "g", "h", "h"], + "team_abbrev": ["MTL", "MTL", "TOR", "TOR"], + "gaa": [2.5] * 4, + "save_pct": [0.9] * 4, + "record": ["10-4-2"] * 4, + "shutouts": [1] * 4, + "games_played": [10, 10, 12, 12], + "season": ["20252026"] * 4, + } + ) + + +@pytest.fixture +def prediction_tables(monkeypatch): + """Fakes for the NEW data flow: the LIVE snapshot table carries only the + pick-date rows; the backtrack tables carry strictly-prior history; the + raw per-game store is a synthetic frame (no sqlite on disk).""" + tables = { + "Player-Snapshots-backtrack": fake_history_players(), + "Player-Snapshots": fake_live_rows(), + "Team-Stats-backtrack": fake_teams(), + "Goalie-Snapshots-backtrack": fake_goalies(), + "Default": fake_goalies(), + } + + # The Picks-{ENV} slate (stat_update's writable surface): a mutable + # FakePicksTable reachable from the tests via the fake client. + picks_table = FakePicksTable(fake_picks_slate()) + + fake_client = MagicMock(name="supabase_admin") + + def _table(name): + if name.startswith("Picks-"): + return picks_table + for prefix, frame in tables.items(): + if name.startswith(prefix): + return FakeTable(frame) + return FakeTable(tables["Default"]) + + fake_client.table.side_effect = _table + fake_client.picks_table = picks_table + monkeypatch.setattr("run_daily_picks.SUPABASE_ADMIN_CLIENT", fake_client) + # the gap-fill helper shares the admin client; patch it too so a run()'s + # first-step invocation (and the dry witness) never leaves the fakes. + monkeypatch.setattr("backfill_missing_days.SUPABASE_ADMIN_CLIENT", fake_client) + # the first-step backfill itself is patched to a no-op summary here; the + # wiring tests below re-patch it with a call recorder. + monkeypatch.setattr( + "run_daily_picks.backfill_missing_days.backfill", + lambda *a, **k: { + "status": "up-to-date", + "games": 0, + "rows": 0, + "created": 0, + "backfilled": [], + "skipped": [], + "failed_days": [], + "pending": [], + }, + ) + + # the stage-2 raw columns are "landed" on the fake table: the exact + # recompute reads the published record (fake_history_players' raw block), + # no local store exists or is needed. + monkeypatch.setattr("run_daily_picks._RAW_PROBE", {"prod": True}) + return fake_client + + +def fake_s3(monkeypatch, bundle): + import joblib # noqa: PLC0415 + + buffer = io.BytesIO() + joblib.dump(bundle, buffer, compress=("zlib", 3)) + payload = buffer.getvalue() + + s3 = MagicMock() + s3.list_objects_v2.return_value = { + "Contents": [ + {"Key": "predict/ml/artifact_2026-06-13_0.joblib"}, + {"Key": "predict/ml/artifact_2026-06-14_0.joblib"}, + {"Key": "predict/ml/nothing.zip"}, + ] + } + s3.get_object.return_value = {"Body": io.BytesIO(payload)} + monkeypatch.setattr("run_daily_picks.boto3.client", lambda service, **_kw: s3) + return s3 + + +class FakePicksTable: + """The Picks-{ENV} builder chain the stat_update writer uses: + select(.eq date) / update(.eq id).execute(). + + Records every PATCH in ``.patches`` as (row_id, payload, before-row + copy), so the tests can assert the write touched ONLY the stat column + of the EXISTING rows (mutation on the shared row dicts makes the + before/after compare trivial). + """ + + def __init__(self, rows): + self.rows = [dict(row) for row in rows] + self.patches = [] + self._eq = None + self._pending = None + + def select(self, *_cols, **_kw): + return self + + def update(self, payload): + self._pending = dict(payload) + return self + + def eq(self, col, value): + self._eq = (col, value) + return self + + def execute(self): + if self._pending is not None: + col, value = self._eq or (None, None) + for row in self.rows: + if str(row.get(col)) == str(value): + self.patches.append((row["id"], dict(self._pending), dict(row))) + row.update(self._pending) + self._eq = None + self._pending = None + return FakeResult(pd.DataFrame(self.rows)) + + +# The live Picks-{ENV} column set (test_picks_db_nan_behaviors.PICKS_COLUMNS): +# the site's OWN full-slate publish (utility.save_to_db) wrote these rows for +# the pick date - the stat_update writer PATCHes only their stat. +def fake_picks_slate(): + return [ + { + "id": row_id, + "date": ON_DATE, + "player_id": player_id, + "name": name, + "team_name": team, + "stat": None, + "tims": tims, + "gpg": gpg, + "hgpg": hgpg, + } + for row_id, player_id, name, team, tims, gpg, hgpg in ( + (1, 1, "a", "Toronto", 1, 0.5, 0.1), + (2, 2, "b", "Toronto", 1, 0.2, 0.2), + (3, 9, "g", "Montréal", 2, 0.0, 0.0), + (4, 10, "h", "Montréal", 3, 0.0, 0.0), + ) + ] + + +# --------------------------------------------------------------- artifacts + + +def test_load_artifact_picks_lexically_latest_joblib(env_vars, monkeypatch): + s3 = fake_s3(monkeypatch, make_bundle()) + key, loaded = mod.load_artifact(s3, "test-artifacts", "predict/ml") + assert key.endswith("artifact_2026-06-14_0.joblib") + assert loaded["metadata"]["seed"] == 0 + + +def test_load_artifact_empty_prefix_raises(env_vars, monkeypatch): + s3 = MagicMock() + s3.list_objects_v2.return_value = {"Contents": []} + with pytest.raises(RuntimeError, match="no artifact"): + mod.load_artifact(s3, "test-artifacts", "predict/ml") + + +def fake_storage(monkeypatch, bundle): + import joblib # noqa: PLC0415 + + buffer = io.BytesIO() + joblib.dump(bundle, buffer, compress=("zlib", 3)) + payload = buffer.getvalue() + + storage = MagicMock() + storage.list.return_value = [ + {"name": "artifact_2026-06-13_0.joblib"}, + {"name": "artifact_2026-06-14_0.joblib"}, + {"name": "nothing.zip"}, + ] + storage.download.return_value = payload + client = MagicMock() + client.storage.from_.return_value = storage + monkeypatch.setattr(mod, "SUPABASE_ADMIN_CLIENT", client) + return client + + +def test_load_artifact_storage_picks_lexically_latest_joblib(env_vars, monkeypatch): + client = fake_storage(monkeypatch, make_bundle()) + key, loaded = mod.load_artifact_storage(client, "ml-artifacts", "predict/ml") + key_norm = key.removeprefix("predict/ml/") + assert key_norm.endswith("artifact_2026-06-14_0.joblib") + assert loaded["metadata"]["seed"] == 0 + client.storage.from_.assert_called_with("ml-artifacts") + + +def test_load_artifact_storage_empty_listing_raises(env_vars, monkeypatch): + client = MagicMock() + client.storage.from_.return_value.list.return_value = [] + with pytest.raises(RuntimeError, match="no artifact"): + mod.load_artifact_storage(client, "ml-artifacts", "predict/ml") + + +def test_pick_daily_bundle_s3_fails_falls_through_to_storage(env_vars, monkeypatch): + import joblib # noqa: PLC0415 + + bucket_payload = io.BytesIO() + joblib.dump(make_bundle(), bucket_payload, compress=("zlib", 3)) + + s3 = MagicMock() + from botocore.exceptions import NoCredentialsError # noqa: PLC0415 (test-local) + + s3.list_objects_v2.side_effect = NoCredentialsError() + monkeypatch.setattr("run_daily_picks.boto3.client", lambda service, **_kw: s3) + + client = fake_storage(monkeypatch, make_bundle()) + key, loaded = mod.pick_daily_bundle("s3-bucket", "predict/ml", None, "ml-artifacts", "predict/ml") + assert "artifact_" in key + assert loaded["metadata"]["seed"] == 0 + client.storage.from_.assert_called_with("ml-artifacts") + + +def make_contract_bundle(today=ON_DATE): + """The sibling's ARTIFACT CONTRACT design: ONLY the contract keys.""" + return { + "version": 1, + "train_through": today, + "seed": 0, + "git_hash": "abc1234", + "generated_at": f"{today}T12:00:00+00:00", + "feature_order": ["gpg", "hgpg", "tims"], + "categorical_maps": {"tims": ["1", "2", "3"]}, + "derived_params": { + "ensemble_recipe": "mean of within-(date,tims) rank(pct) of hgb/lgbm/logreg", + }, + "models": { + "hgb": FakeProba([0.1, 0.8, 0.3, 0.6]), + "lgbm": FakeProba([0.2, 0.9, 0.4, 0.1]), + "logreg": FakeProba([0.3, 0.7, 0.5, 0.0]), + "ranker": FakeRanker([0.5, 0.4, 0.9, 0.2]), + }, + } + + +def test_normalise_bundle_reads_contract_design(): + canon = mod.normalise_bundle(make_contract_bundle()) + assert [c for c in canon["all_features"]] == ["gpg", "hgpg", "tims"] + assert canon["categorical_features"] == ["tims"] + assert canon["numeric_features"] == ["gpg", "hgpg"] # feature_order minus cats + assert canon["categories"] == {"tims": ["1", "2", "3"]} + assert canon["metadata"]["train_through"] == ON_DATE + assert canon["metadata"]["version"] == 1 + assert canon["ranker"] is not None + # identical predictions to the legacy design (same member models) + frame = pd.DataFrame({"gpg": [0.5], "hgpg": [0.1], "tims": [1]}) + a, b = mod.encode_frame(canon, frame), mod.encode_frame(make_bundle(), frame) + pd.testing.assert_frame_equal(a, b, check_categorical=False) + + +def test_normalise_bundle_reads_legacy_design(): + legacy = make_bundle() + canon = mod.normalise_bundle(legacy) + assert canon["all_features"] == legacy["all_features"] + assert canon["categorical_features"] == legacy["categorical_features"] + assert canon["metadata"]["seed"] == 0 + + +def test_normalise_bundle_missing_key_clear_error(): + contract = make_contract_bundle() + del contract["models"] + with pytest.raises(RuntimeError, match="missing ensemble member|malformed"): + mod.normalise_bundle(contract) + legacy = make_bundle() + del legacy["all_features"], legacy["categorical_features"], legacy["categories"] + with pytest.raises(RuntimeError, match="malformed"): + mod.normalise_bundle(legacy) + contract2 = make_contract_bundle() + del contract2["feature_order"] + with pytest.raises(RuntimeError, match="malformed"): + mod.normalise_bundle(contract2) + + +def test_handler_runs_on_contract_design_artifact(env_vars, prediction_tables, monkeypatch): + """The sibling's artifact design drives the full path end to end.""" + s3 = fake_s3(monkeypatch, make_contract_bundle()) + result = mod.handler({"date": ON_DATE}, None) + assert result["statusCode"] == 200 and not result["dry"] + assert result["stat_update"] == {"slate_rows": 4, "filled": 4, "no_frame": 0, "not_on_slate": 0, "skipped": False} + assert result["artifact"]["seed"] == 0 + assert result["artifact"]["through"] == ON_DATE + assert not s3.get_object.call_args_list[0].args # reads the lexically latest key + + +def test_staleness_note_warns_beyond_7_days(env_vars, capsys): + stale = make_bundle() + stale["metadata"]["train_through"] = (datetime.date.today() - datetime.timedelta(days=8)).isoformat() + assert mod.staleness_note(stale) == 8 + assert "8 days stale" in capsys.readouterr().out + + fresh = make_bundle() + fresh["metadata"]["train_through"] = datetime.date.today().isoformat() + assert mod.staleness_note(fresh) == 0 + assert "stale" not in capsys.readouterr().out + + +def test_require_live_columns_hard_fail_names_exact_missing(): + rows = pd.DataFrame([{c: 1.0 for c in ("gpg", "team_name", "tims")}]) + with pytest.raises(RuntimeError) as err: + mod.require_live_columns(rows, ON_DATE) + msg = str(err.value) + for col in ("opp_goalie_team", "hgpg", "lineup_position_group"): + assert col in msg + assert "missing exactly" in msg + + +# ------------------------------------------------------------------ encode + + +def test_encode_frame_matches_artifact_column_order(): + frame = pd.DataFrame({"gpg": [0.5, 0.2, 0.9], "hgpg": [0.1, 0.2, 0.3], "tims": [1, 2, 3]}) + x = mod.encode_frame(make_bundle(), frame) + assert list(x.columns) == ["gpg", "hgpg", "tims"] # the artifact's order, not the frame's + assert list(x["tims"].cat.categories) == ["1", "2", "3"] + assert x["gpg"].notna().all() + + +def test_encode_frame_unseen_category_maps_to_nan(): + frame = pd.DataFrame({"gpg": [0.5], "hgpg": [0.1], "tims": [7]}) + x = mod.encode_frame(make_bundle(), frame) + assert pd.isna(x["tims"].iloc[0]) # unseen -> NaN (training-side policy) + + +def test_ensemble_scores_rank_rule(): + frame = pd.DataFrame( + { + "date": [ON_DATE] * 3, + "player_id": [1, 2, 3], + "tims": [1, 1, 2], + "gpg": [0.5, 0.2, 0.9], + "hgpg": [0.1, 0.2, 0.3], + } + ) + sim = mod.ensemble_scores(make_bundle(), frame) + assert sim["ensemble"].between(0.0, 1.0).all() + group1 = sim[sim["tims"] == 1] + # the real model outputs (index 1) dominate both other members inside + # tims=1: hgb 0.8 vs 0.1, lgbm 0.9 vs 0.2, logreg 0.7 vs 0.3 + assert group1["ensemble"].idxmax() == 1 + + +def _assemble_frame(today, players, teams, goalies, history): + """The run()'s frame assembly, test-visible: the shared-core shot block + over the published per-game record, onto the build_frame join, then + add_derived, sliced to the pick date.""" + shot_block = mod.shot_block_from_history(ON_DATE, pd.to_numeric(today["player_id"]).tolist(), history) + frame = model.build_frame(players, teams, goalies, source="supabase") + frame = frame.drop(columns=model.SHOT_FEATURES, errors="ignore").merge( + shot_block, on=["date", "player_id"], how="left", validate="many_to_one" + ) + frame = model.add_derived(frame, teams, source="supabase") + return frame[frame["date"].astype(str) == ON_DATE].reset_index(drop=True) + + +def test_supabase_frame_matches_artifact_features(env_vars, prediction_tables): + loaded = mod.load_prediction_tables("prod", ON_DATE) + assert loaded is not None + today, players, teams, goalies, history = loaded + frame = _assemble_frame(today, players, teams, goalies, history) + bundle = make_bundle() + assert not frame.empty + assert all(col in frame.columns for col in bundle["all_features"]) + x = mod.encode_frame(bundle, frame) + assert list(x.columns) == bundle["all_features"] # same order/shape as the artifact + + +# ------------------------------------------------ new data-flow semantics + + +def test_no_live_rows_exits_cleanly(env_vars, prediction_tables, monkeypatch, capsys): + """Owner rule: NO live snapshot rows for the pick date = the morning + snapshot build has not run yet -> warn + no picks + CLEAN exit 0 (no + RuntimeError, no traceback, no Picks write).""" + empty_live = fake_live_rows().iloc[0:0] + # serve an EMPTY live table while keeping the backtrack tables + fake_client = MagicMock(name="supabase_admin") + tables = { + "Player-Snapshots-backtrack": fake_history_players(), + "Player-Snapshots": empty_live, + "Team-Stats-backtrack": fake_teams(), + "Goalie-Snapshots-backtrack": fake_goalies(), + "Default": fake_goalies(), + } + + def _table(name): + for prefix, frame in tables.items(): + if name.startswith(prefix): + return FakeTable(frame) + return FakeTable(tables["Default"]) + + fake_client.table.side_effect = _table + monkeypatch.setattr("run_daily_picks.SUPABASE_ADMIN_CLIENT", fake_client) + monkeypatch.setattr("run_daily_picks._RAW_PROBE", {"prod": True}) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + + result = mod.handler({"date": ON_DATE}, None) # must NOT raise + assert result["statusCode"] == 200 + assert result["picks"] == [] + assert "no live snapshot rows" in result["message"] + assert prediction_tables.picks_table.patches == [] # no Picks write + out = capsys.readouterr().out + assert "no picks computed: no live snapshot rows for 2026-06-14" in out + assert "Traceback" not in out + + +def test_missing_history_day_warns_but_still_picks(env_vars, prediction_tables, monkeypatch, capsys): + """Owner rule: a game day the published record does not cover is NORMAL -> + ONE warning line naming the day, and the run still assembles its 3 picks + on the history it has (missing-day semantics: no hard-fail).""" + # HISTORY_DATE (2026-06-10) is published but carries NO per-game raw + # stats (a row predating the one-shot top-up): its games cannot enter + # the shift(1)/rolling math - warn + continue. + history_gapped = fake_history_players() + gap_day = history_gapped["date"] == HISTORY_DATE + history_gapped.loc[gap_day, ["game_goals", "game_shots", "game_toi_min"]] = pd.NA + fake_client = MagicMock(name="supabase_admin") + tables = { + "Player-Snapshots-backtrack": history_gapped, + "Player-Snapshots": fake_live_rows(), + "Team-Stats-backtrack": fake_teams(), + "Goalie-Snapshots-backtrack": fake_goalies(), + "Default": fake_goalies(), + } + + def _table(name): + for prefix, frame in tables.items(): + if name.startswith(prefix): + return FakeTable(frame) + return FakeTable(tables["Default"]) + + fake_client.table.side_effect = _table + monkeypatch.setattr("run_daily_picks.SUPABASE_ADMIN_CLIENT", fake_client) + monkeypatch.setattr("run_daily_picks._RAW_PROBE", {"prod": True}) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + + result = mod.handler({"date": ON_DATE, "dry": True}, None) + assert result["statusCode"] == 200 + assert len(result["picks"]) == 3 # assembled anyway (dry: no write) + assert prediction_tables.picks_table.patches == [] + out = capsys.readouterr().out + assert "WARNING: 1 published game day(s) inside the lookback window carry no per-game raw stat(s)" in out + assert HISTORY_DATE in out + assert "continuing" in out + + +def test_live_shot_block_matches_training_core(env_vars, prediction_tables): + """THE train/run parity gate: the live path's today shot block (the + PUBLISHED per-game record + ONE synthetic today-row per player through + the shared core) must equal the training path's shot_features() values + for the same rows to <1e-9. + + Two shapes: + 1. a historical replay date (the record already covers the games) - + identical by construction, guards the wiring; + 2. the pick date itself, where the training math is replayed by + appending the players' real ON_DATE game lines to the store and + comparing against the live path's synthetic-row block - the + synthetic zeros can never enter their own features (shift(1)). + """ + games = fake_player_games() + # (2) the training math's hypothetical: the players' real ON_DATE games + today_games = pd.DataFrame( + { + "player_id": [1, 2, 9, 10], + "date": [ON_DATE] * 4, + "season": ["20252026"] * 4, + "goals": [1, 0, 2, 0], + "shots": [3, 1, 5, 2], + "toi": ["18:31", "12:04", "21:45", "08:59"], + } + ) + full = model.shot_features_from_games(pd.concat([games, today_games], ignore_index=True)) + training_rows = full[full["date"] == ON_DATE].sort_values("player_id").reset_index(drop=True) + + history = mod.load_prediction_tables("prod", ON_DATE)[4] + live_block = ( + mod.shot_block_from_history(ON_DATE, [1, 2, 9, 10], history).sort_values("player_id").reset_index(drop=True) + ) + assert list(live_block["player_id"]) == [1, 2, 9, 10] + diffs = (training_rows[model.SHOT_FEATURES] - live_block[model.SHOT_FEATURES]).abs() + assert diffs.to_numpy().max() < 1e-9 + # and the historical replay is exact to the core (same function, same rows) + historical = mod.shot_block_from_history(CORE_GAME_DAYS[-1], [1, 2, 9, 10], history) + assert not historical.empty + + +def test_live_shot_block_replays_historical_date_exactly(env_vars, prediction_tables): + """Acceptance test from the design fix: for one historical date X, the + live path (the published per-game record < X feeding the shared core) + and the local-store training path produce the SAME 14 features - max + abs diff < 1e-9.""" + games = fake_player_games() + x_date = CORE_GAME_DAYS[-1] # 2026-06-10: a played, published date + training = model.shot_features_from_games(games) + training_rows = training[training["date"] == x_date].sort_values("player_id").reset_index(drop=True) + + history = mod.load_prediction_tables("prod", x_date)[4] + live_block = ( + mod.shot_block_from_history(x_date, [1, 2, 9, 10], history).sort_values("player_id").reset_index(drop=True) + ) + diffs = (training_rows[model.SHOT_FEATURES] - live_block[model.SHOT_FEATURES]).abs() + assert diffs.to_numpy().max() < 1e-9 + + +def test_season_label_matches_the_store_keying_incl_covid(): + """The published record carries no season column, so season_label IS the + season key the recompute groups on - it must reproduce the raw store's + ids. The two COVID-era post-seasons are the trap: the 2019-20 bubble + (Jul-Sep 2020, keyed 20192020) and the delayed 2020-21 post-season + (July 2021, keyed 20202021) - a plain month rule mislabels both and + shifts every season-scoped feature for the veterans who played them + (verified against the store: 56 distinct game dates).""" + assert mod.season_label("2026-10-24") == "20262027" + assert mod.season_label("2026-06-13") == "20252026" + assert mod.season_label("2020-08-01") == "20192020" # the bubble + assert mod.season_label("2021-07-07") == "20202021" # the delayed 2020-21 final + assert mod.season_label("2022-06-26") == "20212022" # a normal June final + + +def test_history_rows_reads_the_shared_ledger_on_a_dev_run(env_vars, monkeypatch): + """(c) A dev-mode run's history_rows reads the SHARED ledger + (Player-Snapshots-backtrack-prod) - never the deleted `-dev` backtrack + name the old suffix routing resolved; only the LIVE table stays + env-resolved. Strictly-prior semantics unchanged (same function core).""" + seen_tables = [] + history = fake_history_players() + + def _spy_window(table, _columns, _first, before_date, _keys): + seen_tables.append((table, before_date)) + old = history[history["date"].astype(str) < str(before_date)] + return old.reset_index(drop=True) + + monkeypatch.setattr(mod, "_paged_date_window", _spy_window) + monkeypatch.setattr(mod, "_first_published_date", lambda table: "2013-10-01") + monkeypatch.setattr(mod, "_RAW_PROBE", {"dev": True}) + frame = mod.history_rows("dev", ON_DATE) + assert seen_tables == [("Player-Snapshots-backtrack-prod", ON_DATE)] + assert not frame.empty # strictly-before rows fetched whole, as before + # the deleted shell never resolves anywhere in the module's routing + assert "Player-Snapshots-backtrack-dev" not in " ".join(t for t, _b in seen_tables) + + +def test_dev_run_history_reads_route_to_the_shared_ledger(env_vars, monkeypatch): + """(c) Wiring: a picks env of dev still routes EVERY history read + (players/teams/goalies) to the SHARED `-prod` backtrack tables; the only + env-resolved reads are the LIVE snapshot (`Player-Snapshots-dev`) and, + later, `Picks-dev`. Spied at the module's own routing layer + (_paged_date_window / _first_published_date / today_live_rows) so the + assertion does not depend on which run_daily_picks module instance the + fakes were wired to.""" + routed = [] + live_reads = [] + live = fake_live_rows() + history = fake_history_players() + + def _frame_for(table): + if table.startswith("Player-Snapshots-backtrack"): + return history + if table.startswith("Team-Stats"): + return fake_teams() + return fake_goalies() + + def _window(table, _cols, _first, _before, _keys): + routed.append(table) + return _frame_for(table) + + monkeypatch.setattr(mod, "_paged_date_window", _window) + monkeypatch.setattr(mod, "_first_published_date", lambda table: "2013-10-01") + monkeypatch.setattr(mod, "_RAW_PROBE", {"dev": True}) + + def _live_spy(env, on_date): + live_reads.append(mod.live_player_table(env)) + return live + + monkeypatch.setattr(mod, "today_live_rows", _live_spy) + today, _players, _teams, _goalies, history_out = mod.load_prediction_tables("dev", ON_DATE) + assert today is not None and not history_out.empty + assert live_reads == ["Player-Snapshots-dev"] # the LIVE read IS env-resolved + assert routed == ["Team-Stats-backtrack-prod", "Goalie-Snapshots-backtrack-prod", "Player-Snapshots-backtrack-prod"] + assert all(n.endswith("-prod") for n in routed) # SHARED ledgers only + assert "Player-Snapshots-backtrack-dev" not in routed # the deleted shell never resolves + + +def test_history_rows_fail_closed_without_raw_columns(env_vars, monkeypatch): + """The stage-2 gate: a picks run reaching the read BEFORE the raw-column + migration has landed fails LOUDLY, naming the migration file - not a + silent stage-1-style feature approximation. (The fake client rejects the + `game_shots` probe the way a real PostgREST 400s an unknown column.)""" + fake_client = MagicMock(name="supabase_admin") + probe = MagicMock(name="client_table") + probe.select.side_effect = Exception("PGRST204: column game_shots does not exist") + fake_client.table.return_value = probe + monkeypatch.setattr("run_daily_picks.SUPABASE_ADMIN_CLIENT", fake_client) + monkeypatch.setattr("run_daily_picks._RAW_PROBE", {}) + with pytest.raises(RuntimeError, match="20261027_add_per_game_raw_columns_player_snapshots_backtrack"): + mod.history_rows("prod", ON_DATE) + + +# ----------------------------------------------------------- refresh store + + +def test_refresh_chain_dumps_then_current_season(monkeypatch, tmp_path): + """The runner-side refresh chain: dump load FIRST, then the current + season's build for the --through date's season - and the season schedule + cache is dropped so the walk re-discovers newly FINAL games (the + DAILY_DATA_RUNBOOK section-2 gotcha: a warm schedule file is served + verbatim and silently freezes the game list). No fetches here at all: + build/load are stubbed, this asserts the ORDER + the season selection + + the schedule-cache eviction.""" + calls = [] + schedule_cache = tmp_path / "schedule-20262027.json" + schedule_cache.write_text("[]", encoding="utf-8") + + monkeypatch.setattr(refresh_mod.dump_store, "load", lambda db, dumps: calls.append("load") or 685914) + monkeypatch.setattr(refresh_mod.local_store, "CACHE_DIR", tmp_path) + + def _fake_build(season, db_path=None, delay_seconds=None): + calls.append(f"build:{season}:{delay_seconds}") + + return 120, 120 + + monkeypatch.setattr(refresh_mod.local_store, "build", _fake_build) + connect_calls = [] + + class _FakeConn: + def execute(self, *_a, **_k): + connect_calls.append("query") + + class _Row: + def fetchone(self): + return (0,) + + return _Row() + + def close(self): + pass + + monkeypatch.setattr(refresh_mod.local_store, "connect", lambda _p: _FakeConn()) + + season, _rows, _newest = refresh_mod.refresh( + through="2026-10-27", db_path=tmp_path / "raw.sqlite", dump_dir=tmp_path + ) + + assert season == "20262027" + assert calls == ["load", "build:20262027:0.34"] + assert not schedule_cache.exists() # fresh walk enforced + assert "20252026" == refresh_mod.season_label("2026-06-13") # Jan-Jun -> year-1 + + +def test_refresh_is_idempotent_and_skips_load_with_warm_schedule(monkeypatch, tmp_path): + """--skip-load keeps the existing store and crawls only (a twice-a-day + pass never re-loads the dumps), and a cold refresh with --warm-schedule + (fresh_schedule=False) keeps the schedule cache instead of evicting it. + Season math: month>=7 belongs to the NEW season id.""" + calls = [] + schedule_cache = tmp_path / "schedule-20252026.json" + schedule_cache.write_text("[]", encoding="utf-8") + + monkeypatch.setattr(refresh_mod.dump_store, "load", lambda *_a, **_k: calls.append("load") or 1) + monkeypatch.setattr(refresh_mod.local_store, "CACHE_DIR", tmp_path) + monkeypatch.setattr( + refresh_mod.local_store, "build", lambda season, **_k: calls.append(f"build:{season}") or (0, 0) + ) + + def _fake_conn(_p): + class _Conn: + def execute(self, *_a, **_k): + class _Row: + def fetchone(self): + return (0,) + + return _Row() + + def close(self): + pass + + return _Conn() + + monkeypatch.setattr(refresh_mod.local_store, "connect", _fake_conn) + + (tmp_path / "raw.sqlite").write_text("", encoding="utf-8") # store exists + season, _rows, _newest = refresh_mod.refresh( + through="2026-10-27", db_path=tmp_path / "raw.sqlite", dump_dir=tmp_path, skip_load=True, fresh_schedule=False + ) + + assert season == "20262027" # October belongs to the new season + assert calls == ["build:20262027"] # no dump load, no network fetch code touched + assert schedule_cache.exists() # warm schedule kept on request + + +# ----------------------------------------------------------- pick assembly + + +def test_pick_rows_one_per_group_and_order(): + frame = pd.DataFrame( + { + "date": [ON_DATE, ON_DATE, ON_DATE, ON_DATE], + "player_id": [1, 2, 9, 10], + "name": ["a", "b", "g", "h"], + "team_name": ["T", "T", "Time", "Noise"], + "tims": [1, 1, 2, 3], + "ensemble": [0.4, 0.8, 0.6, np.nan], + } + ) + picks = model.daily_picks(frame, "ensemble") + row_map = dict(zip(picks["tims"], picks["player_id"])) + # highest ensemble member per group; tims=3 is all-NaN -> daily_picks + # (documented) skips that group, and a real slate would then hard-fail in + # validate_picks instead of publishing an ambiguous slate + assert row_map == {1: 2, 2: 9} + + +def test_validate_picks_rejects_wrong_shape(): + sim = pd.DataFrame( + { + "date": [ON_DATE] * 2, + "player_id": [1, 2], + "tims": [1, 1], + "ensemble": [0.5, 0.6], + } + ) + picks = model.daily_picks(sim, "ensemble") + with pytest.raises(RuntimeError, match="3 picks"): + mod.validate_picks(picks, ON_DATE) + + +def test_pick_payload_whitelist(): + picks = pd.DataFrame( + { + "date": [ON_DATE], + "player_id": [1.0], + "name": ["a"], + "team_name": ["T"], + "tims": [1.0], + "gpg": [0.5], + "hgpg": [0.1], + "ppg": [0.2], + "ensemble": [0.12345], + "scored": [np.nan], + } + ) + rows = mod.pick_rows_to_picks_db(picks) + + assert len(rows) == 1 + assert rows[0] == { + "date": ON_DATE, + "player_id": 1, + "name": "a", + "team_name": "T", + "stat": 12.3, # ensemble ranked-pct -> percent, 1 decimal + "tims": 1, + "gpg": 0.5, + "hgpg": 0.1, + } + # `ppg` is not a live Picks-{ENV} column on either env (smoke: the legacy + # wipe-then-insert shipped it, the insert failed PGRST204, the table was + # left empty); REMOVE_KEYS strips it before anything is serialized. + assert "ppg" in mod.REMOVE_KEYS + assert {k for row in rows for k in row}.isdisjoint(mod.REMOVE_KEYS) + + +# ------------------------------------------------------ handler end-to-end + + +def test_handler_dry_skips_write(env_vars, prediction_tables, monkeypatch): + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + result = mod.handler({"date": ON_DATE, "dry": True}, None) + assert result["dry"] and prediction_tables.picks_table.patches == [] + + +def test_handler_first_step_backfill_invoked_once_when_not_dry(env_vars, prediction_tables, monkeypatch): + """STAGE B wiring: a NOT-dry run's FIRST data step is the daily gap-fill, + invoked once with --env ENV --through-date (the pick date's yesterday).""" + invocations = [] + + def _record(env, through_date=None, **_k): + invocations.append((env, through_date)) + return { + "status": "ok", + "games": 1, + "rows": 4, + "created": 1, + "backfilled": ["2026-06-13"], + "skipped": [], + "failed_days": [], + "pending": [], + } + + monkeypatch.setattr("run_daily_picks.backfill_missing_days.backfill", _record) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + result = mod.handler({"date": ON_DATE}, None) + assert result["statusCode"] == 200 + assert invocations == [("prod", "2026-06-13")] # exactly once, yesterday ET of the pick date + + +def test_handler_dry_skips_the_backfill_entirely(env_vars, prediction_tables, monkeypatch, capsys): + """A dry pass is read-only end to end: the gap-fill NEVER runs (no + writes, no crawl); the run only LISTS the missing game days.""" + invocations = [] + + def _record(*_a, **_k): + invocations.append(1) + return {"status": "ok", "failed_days": []} + + monkeypatch.setattr("run_daily_picks.backfill_missing_days.backfill", _record) + # the read-only witness: latest published date well behind the pick date + monkeypatch.setattr("run_daily_picks.backfill_missing_days.latest_published_date", lambda env: "2026-06-01") + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + result = mod.handler({"date": ON_DATE, "dry": True}, None) + assert result["dry"] and invocations == [] + out = capsys.readouterr().out + assert "WARNING (dry)" in out and "not backfilled" in out + + +def test_handler_backfill_failure_still_picks(env_vars, prediction_tables, monkeypatch, capsys): + """A partial/failed gap-fill is LOUD but never fatal: the exact recompute + proceeds over the history that is published and the picks still land.""" + + def _boom(*_a, **_k): + raise RuntimeError("supabase down") + + monkeypatch.setattr("run_daily_picks.backfill_missing_days.backfill", _boom) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + result = mod.handler({"date": ON_DATE}, None) + assert result["statusCode"] == 200 + assert [row_id for row_id, _payload, _pre in prediction_tables.picks_table.patches] == [1, 2, 3, 4] + assert "gap-fill backfill failed outright" in capsys.readouterr().out + + +def test_handler_carry_forward_fallback_only_when_exact_fails(env_vars, prediction_tables, monkeypatch, capsys): + """The stage-1 carry-forward attach survives ONLY as the clearly-marked + last-resort fallback: when the exact recompute raises, the run attaches + the last published row's precomputed rolling columns and STILL picks - + and still stat-fills the slate - with a LOUD warning naming the fallback.""" + monkeypatch.setattr( + "run_daily_picks.shot_block_from_history", + lambda *_a, **_k: (_ for _ in ()).throw(RuntimeError("core exploded")), + ) + # the fallback's lazy read: the players' latest published rolling row + latest = fake_history_players().sort_values("date").groupby("player_id").tail(1) + for col in model.SHOT_FEATURES: + latest[col] = 0.5 + monkeypatch.setattr(mod, "_latest_shot_columns", lambda env, ids: latest) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + result = mod.handler({"date": ON_DATE}, None) + assert result["statusCode"] == 200 + assert [row_id for row_id, _payload, _pre in prediction_tables.picks_table.patches] == [1, 2, 3, 4] + out = capsys.readouterr().out + assert "STAGE-1 carry-forward attach" in out + + +def test_handler_missing_columns_fails_instead_of_publishing(env_vars, prediction_tables, monkeypatch): + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + today = fake_live_rows().drop(columns=["opp_goalie_team", "hgpg"]) + monkeypatch.setattr("run_daily_picks.today_live_rows", lambda _env, _d: today) + with pytest.raises(RuntimeError, match="opp_goalie_team"): + mod.handler({"date": ON_DATE}, None) + assert prediction_tables.picks_table.patches == [] + + +def test_handler_ambiguous_slate_malformed_picks_output_fails(env_vars, prediction_tables, monkeypatch): + """A malformed picks shape still aborts the run LOUD (validate_picks), + but only AFTER the stat fill landed - the fill is the write path's + primary output and deliberately runs first.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + + def _only_one_group(sim, col): + return sim[sim["tims"] == 1].head(1) + + monkeypatch.setattr("run_daily_picks.model.daily_picks", _only_one_group) + with pytest.raises(RuntimeError, match="3 picks"): + mod.handler({"date": ON_DATE}, None) + # the stat fill DID land before the output shape failed + assert [row_id for row_id, _payload, _pre in prediction_tables.picks_table.patches] == [1, 2, 3, 4] + + +def _real_logreg_pipeline(): + """The full fit_logreg chain, fitted on a tiny deterministic fold. + + Used both as artifact v2's logreg member and (unwrapped: the inner bare LR) + as the v1 fixture member. + """ + from sklearn.impute import SimpleImputer # noqa: PLC0415 (test-local fixture) + from sklearn.linear_model import LogisticRegression # noqa: PLC0415 + from sklearn.pipeline import make_pipeline # noqa: PLC0415 + from sklearn.preprocessing import StandardScaler # noqa: PLC0415 + + frame = pd.DataFrame( + { + "gpg": [0.5, 0.2, 0.9, 1.1, 0.0, 0.8], + "hgpg": [0.1, 0.2, 0.3, 0.35, 0.0, 0.28], + "tims": [1, 1, 1, 2, 2, 2], + "scored": [0, 0, 1, 0, 0, 1], + } + ) + x = frame[["gpg", "hgpg"]] + pipe = make_pipeline(SimpleImputer(strategy="median"), StandardScaler(), LogisticRegression()) + pipe.fit(x, frame["scored"]) + return pipe, pipe[-1], x + + +def test_artifact_v2_nan_frame_pipeline_member_succeeds(): + """Artifact v2: logreg IS the imputing pipeline -> NaN frames score fine. + + The v1 miss this regression-tests: a bare LogisticRegression raised + 'ValueError: Input X contains NaN' on every live frame (live frames always + carry NaNs - debut rows, opp-goalie gaps), killing the whole run. + """ + pipe, _bare, _x = _real_logreg_pipeline() + bundle = make_contract_bundle() + bundle["version"] = 2 # the v2 contract: version is a TOP-LEVEL key + bundle["models"]["logreg"] = pipe + bundle["logreg"] = pipe # legacy alias, same object (the v2 shape) + canon = mod.normalise_bundle(bundle) + assert hasattr(canon["logreg"], "steps") # the pipeline member, exported as-is + + frame = pd.DataFrame( + { + "date": [ON_DATE, ON_DATE], + "player_id": [1, 2], + "tims": [1, 1], + "gpg": [np.nan, 0.4], # the NaNs the v1 path crashed on + "hgpg": [np.nan, 0.1], + } + ) + sim = mod.ensemble_scores(canon, frame) + assert len(sim) == 2 + assert sim["logreg"].notna().all() # imputed inside the member, not crashed + + +def test_artifact_v1_fallback_warns_loud_and_still_picks(capsys): + """v1 artifact (bare LR): loud LEGACY warning + the adapter still picks.""" + _pipe, bare, x = _real_logreg_pipeline() + bundle = make_contract_bundle() # version stays 1 + bundle["models"]["logreg"] = bare # the v1 miss: bare inner estimator + bundle["logreg"] = bare + canon = mod.normalise_bundle(bundle, key="artifact_2026-06-14_0.joblib") + + frame = pd.DataFrame( + { + "date": [ON_DATE, ON_DATE], + "player_id": [1, 2], + "tims": [1, 1], + "gpg": [np.nan, 0.4], # NaNs the bare member would have crashed on + "hgpg": [np.nan, 0.1], + } + ) + sim = mod.ensemble_scores(canon, frame) + assert len(sim) == 2 + assert sim["logreg"].notna().all() + # the loud retrain warning is printed at load time + assert "LEGACY ARTIFACT FORMAT" in capsys.readouterr().out + # and the shape the daily pass needs: one pick per (date, tims) group + picks = model.daily_picks(sim, "ensemble") + assert len(picks) == 1 + + +# --------------------------------------- write-env + --env (import-time) resolution +# The ml-picks.yml safety contract: the workflow resolves the WRITE env +# explicitly (scheduled = the job-level env: ENV: prod ONLY; manual dispatch = +# the `environment` input override at the "Resolve the picks ENV" step) and +# binds the resolved value as a step-level ENV on both script steps - GitHub +# Actions puts it in the PROCESS environment before `python` starts, so +# config.py's import-time read (config.py:12, ENV = os.environ.get("ENV", +# "dev")) IS the default target resolution, and the script's --env knob +# rebinds the SAME module global. These tests pin both entry points of that +# contract against the ONLY write surface left (stat_update_picks_db): a +# fresh config + run_daily_picks import sees exactly the os.environ value +# present before import, and the stat fill routes every surface (the slate +# read, every PATCH) to Picks-{ENV} - so a run cannot silently write the +# wrong Picks table. + + +class _EnvProbeTable: + """Minimal supabase-py builder-chain fake for stat_update's two + surfaces: the slate read (select(...).eq("date", ...)) and the per-row + PATCH (update(payload).eq("id", row_id)).execute().""" + + def __init__(self, state): + self._state = state + self._eq = None + self._pending = None + + def select(self, *_columns): + return self + + def update(self, payload): + self._pending = dict(payload) + return self + + def eq(self, col, value): + self._eq = (col, value) + return self + + def execute(self): + rows = self._state["rows"] + if self._pending is not None: + col, value = self._eq or (None, None) + matched = [row for row in rows if str(row.get(col)) == str(value)] + for row in matched: + row.update(self._pending) + self._state.setdefault("patches", []).append((self._eq, dict(self._pending), len(matched))) + self._pending = None + self._eq = None + return types.SimpleNamespace(data=[dict(row) for row in rows]) + # the slate read filters by date (the eq before execute) + col, value = self._eq or (None, None) + if col is None: + data = [dict(row) for row in rows] + else: + data = [dict(row) for row in rows if str(row.get(col)) == str(value)] + self._eq = None + return types.SimpleNamespace(data=data) + + +class _EnvProbeClient: + """Name-recording client: every .table() call records the table name, so + the test asserts ALL of the write path's surfaces hit the SAME table.""" + + def __init__(self): + self.tables = {} + + def table(self, name): + return _EnvProbeTable(self.tables.setdefault(name, {"rows": [], "patches": []})) + + +def _fresh_import_with_env(monkeypatch, env_value=None): + """Import a SECOND config + run_daily_picks copy with os.environ.ENV set + (or absent) BEFORE import - the GitHub Actions contract above. `config` is + swapped in sys.modules for a fresh copy because a cached `from config + import ENV` would rebind the STALE import-time value instead of the one + the fresh process env would give; monkeypatch restores the real modules + after the test. load_dotenv is neutralized so a local .env (which carries + ENV=prod on owner machines) cannot shadow the env-under-test the way CI + (no .env) sees it.""" + if env_value is None: + monkeypatch.delenv("ENV", raising=False) + else: + monkeypatch.setenv("ENV", env_value) + monkeypatch.setattr(sys.modules["dotenv"], "load_dotenv", lambda *args, **kwargs: False) + + spec = importlib.util.spec_from_file_location( + f"config_envprobe_{env_value or 'unset'}", ROOT / "smartscore" / "config.py" + ) + fresh_config = importlib.util.module_from_spec(spec) + monkeypatch.setitem(sys.modules, "config", fresh_config) + spec.loader.exec_module(fresh_config) + + name = f"run_daily_picks_envprobe_{env_value or 'unset'}" + spec = importlib.util.spec_from_file_location( + name, ROOT / "smartscore" / "scripts" / "backtrack" / "run_daily_picks.py" + ) + fresh = importlib.util.module_from_spec(spec) + monkeypatch.setitem(sys.modules, name, fresh) + spec.loader.exec_module(fresh) + return fresh + + +@pytest.mark.parametrize("env_value", [None, "dev", "prod"]) +def test_env_resolved_at_import_routes_the_picks_write(monkeypatch, env_value): + """The ENV import math: unset -> config's 'dev' default; ENV=prod preset -> + 'prod'. Each fresh module then runs the ONE write surface (stat_update): + every surface - the slate read and every stat PATCH - must resolve to + Picks-{env} and touch nothing else, and the hard pins (source prod / + history the shared ledger) are read-only constants on the fresh module.""" + fresh = _fresh_import_with_env(monkeypatch, env_value) + expected_env = env_value or "dev" + + # the workflow-resolved ENV is visible module-side exactly as the runner set it + assert fresh.ENV == expected_env + # the HARD PINS are constants on the module, not resolvable knobs + assert fresh.SOURCE_ENV == "prod" + assert fresh.HISTORY_ENV == "prod" + + client = _EnvProbeClient() + monkeypatch.setattr(fresh, "SUPABASE_ADMIN_CLIENT", client) + table = f"Picks-{expected_env}" + client.table(table)._state["rows"].append( + { + "id": 1, + "date": "2026-06-15", + "player_id": 123, + "name": "a", + "team_name": "T", + "stat": None, + "tims": 2, + } + ) + sim = pd.DataFrame({"player_id": [123], "ensemble": [0.51]}) + + fresh.stat_update_picks_db(sim, "2026-06-15") + + # ALL surfaces (the slate read + the PATCH) targeted the SAME, ONLY table + assert set(client.tables) == {table}, f"write surface touched {set(client.tables)}, not purely {table}" + (_eq, payload, matched) = client.tables[table]["patches"][0] + assert _eq == ("id", 1) and payload == {"stat": 0.51} and matched == 1 # 51.0/100: the 0-1 decimal write form + # stat-only: every other column of the EXISTING row is identical + row = client.table(table)._state["rows"][0] + assert row["player_id"] == 123 and row["name"] == "a" and row["tims"] == 2 + assert len(client.tables[table]["rows"]) == 1 # nothing inserted + + +# ------------------------------------------------------- pinned axes (CLI knobs) +# The three-knob CLI contract: --date / --dry / --env are the WHOLE surface; +# source = Player-Snapshots-prod PINNED, history = the ONE shared -prod +# ledger PINNED, mode = stat_update ONLY (test_predict_picks has no +# write_mode/source/history event keys anymore). The pre-deployment +# validation profile is unchanged in effect: ENV=dev (Picks-dev stat fill) +# with reads all against prod (the real prod live slate + the shared +# history) - Picks-prod untouched. + + +def record_table_names(fake_client): + """Wrap a fake client's table() side_effect to record every table name + a run resolves (the routing witness for the pin tests).""" + names = [] + real = fake_client.table.side_effect + + def _recorder(name): + names.append(name) + return real(name) + + fake_client.table.side_effect = _recorder + return names + + +def test_pins_printed_in_the_run_header(env_vars, prediction_tables, monkeypatch, capsys): + """The run's identity line names the three hard pins loudly (no axes, + no mode: stat_update / prod / shared ledger).""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + assert mod.handler({"date": ON_DATE, "dry": True}, None)["statusCode"] == 200 + out = capsys.readouterr().out + assert ( + "mode: stat_update (hard-pinned); source: prod (Player-Snapshots-prod); " + "history: shared ledger (Player-Snapshots-backtrack-prod)" in out + ) + payload = picks_log_line(out) + # the SMARTSCORE_ML_PICKS log line: the axis keys are GONE + assert "write_mode" not in payload and "source_env" not in payload and "history_env" not in payload + assert "date" in payload and "n_picks" in payload and "picks" in payload + assert "mean_max_prob" in payload and "artifact" in payload + + +def test_pinned_source_reads_prod_from_any_write_env(env_vars, prediction_tables, monkeypatch, capsys): + """Source is a HARD PIN: even a Picks-dev (ENV=dev) run reads TODAY's + rows from the REAL prod live table Player-Snapshots-prod (and the + shared -prod history); Picks-dev is never read, and a picks log line + carries no source_env/history_env axis keys.""" + monkeypatch.setattr(mod, "ENV", "dev") # a Picks-dev (write-side) run + monkeypatch.delenv("SOURCE_ENV", raising=False) + monkeypatch.delenv("HISTORY_ENV", raising=False) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + names = record_table_names(prediction_tables) + + result = mod.handler({"date": ON_DATE, "dry": True}, None) # NO source/history keys + + assert result["statusCode"] == 200 and len(result["picks"]) == 3 + assert "Player-Snapshots-prod" in names # the live read IS pinned to prod + assert "Player-Snapshots-dev" not in names # the dev live shell is never touched + history_tables = [n for n in names if "backtrack" in n] + assert not [n for n in history_tables if "-dev" in n] # the shared ledger only (-prod) + for shared in ( + "Player-Snapshots-backtrack-prod", + "Team-Stats-backtrack-prod", + "Goalie-Snapshots-backtrack-prod", + ): + assert shared in names + assert not [n for n in names if n.startswith("Picks-")] # dry: no picks read/write at all + out = capsys.readouterr().out + assert "source: prod (Player-Snapshots-prod)" in out + + +def test_env_dev_stat_fills_picks_dev_with_pinned_prod_reads(env_vars, prediction_tables, monkeypatch, capsys): + """--env dev (write side): the stat fill PATCHes ONLY the rows of + Picks-dev, while every read stays on the PINNED prod surfaces.""" + monkeypatch.setattr(mod, "ENV", "dev") + monkeypatch.delenv("SOURCE_ENV", raising=False) + monkeypatch.delenv("HISTORY_ENV", raising=False) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + names = record_table_names(prediction_tables) + + result = mod.handler({"date": ON_DATE}, None) + + assert result["statusCode"] == 200 and result["stat_update"]["filled"] == 4 + assert "Picks-dev" in names # the write target per --env + assert not [n for n in names if n == "Picks-prod"] # Picks-prod untouched + assert "Player-Snapshots-prod" in names # the live read is still the PIN + assert all(n.endswith("-prod") for n in names if "backtrack" in n) # shared history + picks = prediction_tables.picks_table + assert [row_id for row_id, _payload, _pre in picks.patches] == [1, 2, 3, 4] + assert all(set(payload) == {"stat"} for _i, payload, _p in picks.patches) + out = capsys.readouterr().out + assert "write: Picks-dev" in out + + +def test_env_prod_stat_fills_picks_prod(env_vars, prediction_tables, monkeypatch, capsys): + """--env prod (the nightly default): Picks-prod stat fill, prod reads.""" + monkeypatch.setattr(mod, "ENV", "prod") + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + names = record_table_names(prediction_tables) + + result = mod.handler({"date": ON_DATE}, None) + + assert result["statusCode"] == 200 and result["stat_update"]["filled"] == 4 + assert "Picks-prod" in names + out = capsys.readouterr().out + assert "write: Picks-prod" in out + + +def test_cli_has_exactly_three_knobs(monkeypatch): + """(c) The CLI accepted surface is EXACTLY --date / --dry / --env: a + removed knob (--write-mode, --source-env, --history-env, --artifact, the + --s3-*/--storage-* overrides) is REJECTED by argparse (SystemExit), and + an accepted invocation carries only the date/dry keys (the env rides the + module global).""" + events = [] + monkeypatch.setattr(mod, "run", lambda event, context=None: (events.append(event), {"statusCode": 200})[1]) + + mod.main(["--date", "2026-10-23", "--dry"]) + assert events[0] == {"date": "2026-10-23", "dry": True} + assert "write_mode" not in events[0] and "source_env" not in events[0] and "history_env" not in events[0] + + for removed in ( + ["--write-mode", "legacy"], + ["--write-mode", "stat_update"], + ["--source-env", "prod"], + ["--history-env", "prod"], + ["--artifact", "data/ml/x.joblib"], + ["--s3-bucket", "b"], + ["--storage-prefix", "predict/ml"], + ["--env", "staging"], # whitelist: dev|prod ONLY + ): + with pytest.raises(SystemExit): + mod.main(removed) + + +def test_cli_env_knob_rebinds_the_write_env(monkeypatch): + """--env dev|prod: the knob rebinds the module-global write env before + run() starts (the manual override of the SAME value the workflow binds + through the process env); an unset --env leaves the import-time value.""" + events = [] + monkeypatch.setattr(mod, "run", lambda event, context=None: (events.append(event), {"statusCode": 200})[1]) + original_env = mod.ENV + try: + monkeypatch.setattr(mod, "ENV", "prod") + mod.main(["--date", "2026-10-23", "--env", "dev"]) + assert mod.ENV == "dev" + mod.main(["--date", "2026-10-23"]) # no --env: the import-time value wins + assert mod.ENV == "dev" + finally: + mod.ENV = original_env + + +# -------------------------------------------------- stat_update (ONLY) write + + +def picks_log_line(out): + return json.loads([line for line in out.splitlines() if "SMARTSCORE_ML_PICKS" in line][0]) + + +def test_stat_update_is_the_only_write_mode(env_vars, prediction_tables, monkeypatch, capsys): + """The owner-corrected contract: the ONLY mode PATCHes ONLY the stat + column on the EXISTING Picks-{ENV} slate rows - row count, ids and + every other column identical before/after (no delete, no insert), and + the top-3 challenge picks emitted as log output only.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + picks = prediction_tables.picks_table + before = [dict(row) for row in picks.rows] # the pre-run slate, including stat=None + + result = mod.handler({"date": ON_DATE}, None) + + assert result["statusCode"] == 200 + assert result["stat_update"] == {"slate_rows": 4, "filled": 4, "no_frame": 0, "not_on_slate": 0, "skipped": False} + # (a) ONLY the stat column moved, on the EXISTING rows (no insert, no wipe) + assert len(picks.rows) == len(before) == 4 + assert [row["id"] for row in picks.rows] == [row["id"] for row in before] + for after, pre in zip(picks.rows, before): + for col, value in after.items(): + if col == "stat": + assert pre["stat"] is None and isinstance(value, float) and 0.0 <= value <= 1.0 + else: + assert value == pre[col], f"column {col} mutated: {pre[col]!r} -> {value!r}" + # four PATCHes, each carrying ONLY the stat key, one per existing id + assert [row_id for row_id, _payload, _pre in picks.patches] == [1, 2, 3, 4] + assert all(set(payload) == {"stat"} for _i, payload, _p in picks.patches) + # the 0-1 decimal write boundary: the PATCHed stat is the percent + # convention (stat_value: round(x*100, 1)) divided by 100, full precision + stat = picks.patches[0][1]["stat"] + assert 0.0 < stat <= 1.0 + assert abs(stat * 100 - round(stat * 100, 1)) < 1e-9 # the percent form has exactly 1 decimal + # the top-3 challenge picks are an OUTPUT: logged, never written (the + # Picks table saw ONLY stat PATCHes - no delete/insert surface exists) + payload = picks_log_line(capsys.readouterr().out) + assert payload["stat_column"]["stat_filled"] == 4 + assert len(payload["picks"]) == 3 and {row["tims"] for row in payload["picks"]} == {1, 2, 3} + assert all(row["stat"] is not None for row in payload["picks"]) + # the log stat stays on the 0-100 display scale; the DB value is that / 100 + assert all(0.0 <= row["stat"] <= 100.0 for row in payload["picks"]) + + +def test_stat_update_missing_slate_skips_cleanly_no_insert(env_vars, prediction_tables, monkeypatch, capsys): + """TIMING dependency (the owner-corrected contract): when the run fires + before the site's own SaveToDb publish, Picks-{ENV} has no rows for the + date -> WARN + CLEAN skip (status 200, no exception, no write, no + invented rows). The top-3 picks remain a log output of the frame.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + prediction_tables.picks_table.rows.clear() + + result = mod.handler({"date": ON_DATE}, None) # must NOT raise + + assert result["statusCode"] == 200 + assert result["stat_update"] == {"slate_rows": 0, "filled": 0, "no_frame": 0, "not_on_slate": 0, "skipped": True} + assert prediction_tables.picks_table.patches == [] + out = capsys.readouterr().out + assert "no rows for 2026-06-14" in out and "SKIPPED cleanly" in out + assert "never inserting our own rows" in out + payload = picks_log_line(out) + assert payload["stat_column"]["stat_fill_skipped"] is True + assert len(payload["picks"]) == 3 # the top-3 projection is still emitted + + +def test_stat_update_warns_slate_rows_without_a_prediction(env_vars, prediction_tables, monkeypatch, capsys): + """(b) missing players: a slate row the model frame cannot score + (call-up without history) is WARNed BY NAME and left UNTOUCHED - no + invented stat, no inserted row.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + prediction_tables.picks_table.rows.append( + { + "id": 5, + "date": ON_DATE, + "player_id": 99, + "name": "callup", + "team_name": "Toronto", + "stat": None, + "tims": 1, + "gpg": 0.0, + "hgpg": 0.0, + } + ) + result = mod.handler({"date": ON_DATE}, None) + + assert result["statusCode"] == 200 + assert result["stat_update"] == {"slate_rows": 5, "filled": 4, "no_frame": 1, "not_on_slate": 0, "skipped": False} + out = capsys.readouterr().out + assert "no model prediction (call-ups without published history" in out + assert "'callup' (player_id 99)" in out # WARNed by name + untouched = [row for row in prediction_tables.picks_table.rows if row["id"] == 5][0] + assert untouched["stat"] is None # stat left UNTOUCHED + assert len(prediction_tables.picks_table.rows) == 5 # no insert happened + + +def test_stat_update_warns_frame_players_absent_from_the_slate(env_vars, prediction_tables, monkeypatch, capsys): + """(c) extra frame players: a scored player the slate does not carry + (the site left him off - likely scratched) is WARNed, never written, + and never inserted as a minimal row.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + picks = prediction_tables.picks_table + picks.rows = [row for row in picks.rows if row["player_id"] != 2] # the site dropped player 2 + + result = mod.handler({"date": ON_DATE}, None) + + assert result["statusCode"] == 200 + assert result["stat_update"] == {"slate_rows": 3, "filled": 3, "no_frame": 0, "not_on_slate": 1, "skipped": False} + out = capsys.readouterr().out + assert "not on today's Picks-prod slate" in out + assert "no stat write for them" in out + assert len(picks.rows) == 3 and [row["id"] for row in picks.rows] == [1, 3, 4] # no row inserted + assert {row_id for row_id, _pl, _p in picks.patches} == {1, 3, 4} + + +def test_stat_update_dry_is_read_only(env_vars, prediction_tables, monkeypatch, capsys): + """(a/d) A dry pass in the DEFAULT mode PATCHes nothing; it still + assembles + logs the top-3 output.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + picks = prediction_tables.picks_table + before = [dict(row) for row in picks.rows] + + result = mod.handler({"date": ON_DATE, "dry": True}, None) + + assert result["statusCode"] == 200 and result["dry"] + assert "stat_update" not in result # nothing computed toward a write + assert picks.rows == before and picks.patches == [] + out = capsys.readouterr().out + assert "dry: stat update skipped (read-only)" in out + payload = picks_log_line(out) + assert payload["stat_column"]["stat_fill_skipped"] is True + + +def test_stat_update_top3_only_in_job_summary(env_vars, prediction_tables, monkeypatch, tmp_path): + """The job summary lists the pin line, the top-3 picks table + the + stat-fill headline; the picks themselves reach the summary ONLY as text + output - the table mutation is stat-only on the site's rows.""" + summary = tmp_path / "step-summary.md" + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary)) + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + + mod.handler({"date": ON_DATE}, None) + + text = summary.read_text(encoding="utf-8") + assert "- mode: stat_update (hard-pinned); source: prod; history: shared ledger" in text + assert "top-3 challenge picks (OUTPUT ONLY" in text + assert "stat column updated on ALL players of the current Picks-{ENV} slate (no wipe" in text + assert "stat fill: 4 of 4 slate row(s) patched" in text + # the top-3 rows appear ONLY as this summary table (the picks were + # never written to the Picks table - the write is a stat-only PATCH) + table_rows = [line for line in text.splitlines() if re.match(r"^\| \d+ \| ", line)] + assert len(table_rows) == 3 + assert any("| stat |" in line for line in text.splitlines()) # the table's header + + +def test_stat_update_patch_leaves_legacy_stat_untouched(env_vars, prediction_tables, monkeypatch, capsys): + """Regression: the ML stat_update PATCH must carry ONLY {'stat': ...}; + a pre-existing legacy_stat on the Picks row is never sent or clobbered.""" + fake_s3(monkeypatch, make_bundle(today=datetime.date.today().isoformat())) + picks = prediction_tables.picks_table + # Seed every slate row with a legacy_stat value the ML path must preserve. + for row in picks.rows: + row["legacy_stat"] = 0.31 + row["stat"] = 0.31 + + before_legacy = [row["legacy_stat"] for row in picks.rows] + + result = mod.handler({"date": ON_DATE}, None) + + assert result["statusCode"] == 200 + assert result["stat_update"]["filled"] == 4 + # PATCH payload carries ONLY the stat key - legacy_stat is never sent. + assert [row_id for row_id, _payload, _pre in picks.patches] == [1, 2, 3, 4] + assert all(set(payload) == {"stat"} for _i, payload, _p in picks.patches) + assert all("legacy_stat" not in payload for _i, payload, _p in picks.patches) + # The row's legacy_stat survives untouched. + assert [row["legacy_stat"] for row in picks.rows] == before_legacy == [0.31, 0.31, 0.31, 0.31] diff --git a/tests/unit/test_service_predictions.py b/tests/unit/test_service_predictions.py index bdb49cbe..c9495ee3 100644 --- a/tests/unit/test_service_predictions.py +++ b/tests/unit/test_service_predictions.py @@ -48,7 +48,9 @@ def test_make_predictions_teams_basic(mock_rust, mock_min_max): assert len(result) == 2 assert result[0]["stat"] == 0.65 + assert result[0]["legacy_stat"] == 0.65 assert result[1]["stat"] == 0.75 + assert result[1]["legacy_stat"] == 0.75 mock_rust.predict.assert_called_once() diff --git a/tests/unit/test_shot_columns.py b/tests/unit/test_shot_columns.py new file mode 100644 index 00000000..d3971320 --- /dev/null +++ b/tests/unit/test_shot_columns.py @@ -0,0 +1,299 @@ +import sys +from pathlib import Path + +import numpy as np +import pandas as pd + +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "smartscore" / "scripts")) +sys.path.append(str(Path(__file__).resolve().parents[2] / "smartscore" / "scripts" / "backtrack")) + +import publish_shot_cols # noqa: E402 +from publish_shot_cols import attach_shot_columns, payload_records # noqa: E402 + + +def _stub_block(): + """Frame shaped like shot_features() + club cols for attach tests.""" + frame = pd.DataFrame( + { + "date": ["2025-01-01", "2025-01-02", "2025-01-03"], + "player_id": [1, 1, 1], + "sd_shots_pg": [np.nan, 2.5, 2.25], + "sd_goals_pg": [np.nan, 2.0, 1.5], + "sd_toi_pg": [np.nan, 14.5, 15.25], + "sd_sh_pct": [np.nan, 2.0 / 2.5, 1.5 / 2.25], + "r5_shots_pg": [np.nan, 1.0, 1.5], + "r5_goals_pg": [np.nan, 1.0, 1.3333333333333333], + "r10_shots_pg": [np.nan, 1.0, 1.5], + "r10_goals_pg": [np.nan, 1.0, 1.3333333333333333], + "r10_toi_pg": [np.nan, 12.0, 13.25], + "ewm_goals": [np.nan, 2.0, 1.75], + "ewm_shots": [np.nan, 2.5, 2.33], + "career_games": [0, 1, 2], + "career_goals_pg": [np.nan, 2.0, 1.5], + "career_shots_pg": [np.nan, 2.5, 2.25], + "team_abbrev": ["EDM", "EDM", "EDM"], + "opponent_abbrev": ["WPG", "TOR", np.nan], + } + ) + return frame + + +def test_payload_records_nan_becomes_none_and_ints_stay_int(): + frame = pd.DataFrame( + { + "date": ["2025-01-01"], + "player_id": [7], + "name": ["P. Test"], + "sd_shots_pg": [np.nan], + "career_games": [0], + "opponent_abbrev": [None], + } + ) + record = payload_records(frame)[0] + assert record["sd_shots_pg"] is None + assert record["opponent_abbrev"] is None + assert type(record["career_games"]) is int and record["career_games"] == 0 + assert type(record["player_id"]) is int and record["player_id"] == 7 + assert type(record["name"]) is str + + +def test_payload_records_keeps_float_precision(): + frame = pd.DataFrame( + { + "date": ["x"], + "player_id": [1], + "name": ["n"], + "sd_shots_pg": [2 / 3], + "career_games": [9], + "opponent_abbrev": ["TOR"], + } + ) + assert payload_records(frame)[0]["sd_shots_pg"] == 2 / 3 + + +class _FakeTable: + select_count = 0 + + def __init__(self, client, name): + self._client = client + self._name = name + + def select(self, columns): + self._client.last_select = columns + type(self).select_count += 1 + return self + + def limit(self, n): + return self + + def execute(self): + if "sd_shots_pg" in self._client.last_select and not self._client.migration_landed: + raise RuntimeError(f"column sd_shots_pg does not exist on {self._name}") + if "game_shots" in self._client.last_select and not self._client.raw_landed: + raise RuntimeError(f"column game_shots does not exist on {self._name}") + return type("R", (), {"data": []})() + + def upsert(self, batch, on_conflict=None, returning=None): + self._client.upserts.append((list(batch), on_conflict, returning)) + return type("R", (), {"data": []})() + + +class _FakeClient: + def __init__(self, migration_landed, raw_landed=None): + self.migration_landed = migration_landed + self.raw_landed = migration_landed if raw_landed is None else raw_landed + self.upserts = [] + self.last_select = "" + + def table(self, name): + return _FakeTable(self, name) + + +def test_attach_noop_until_migration_landed(monkeypatch): + client = _FakeClient(migration_landed=False) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + _clear_probes() + payload = [{"date": "2025-01-02", "player_id": 1, "name": "n"}] + result = attach_shot_columns(payload, "Player-Snapshots-backtrack-dev", block=_stub_block()) + assert result == payload # untouched: no new keys + assert len(client.upserts) == 0 + + +def test_attach_adds_columns_once_landed(monkeypatch): + client = _FakeClient(migration_landed=True, raw_landed=True) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + _clear_probes() + payload = [ + {"date": "2025-01-02", "player_id": 1, "name": "n"}, + {"date": "2025-01-03", "player_id": 1, "name": "n"}, + {"date": "2025-01-09", "player_id": 999, "name": "n"}, # not in block + ] + # An EMPTY raw block: the store supplies nothing for these keys, so the + # 16 columns attach and NO raw keys are fabricated (unit-test friendly: + # no sqlite/network path). + result = attach_shot_columns( + payload, "Player-Snapshots-backtrack-dev", block=_stub_block(), raw_block=pd.DataFrame() + ) + assert result[0]["sd_shots_pg"] == 2.5 + assert result[0]["career_games"] == 1 + assert result[0]["team_abbrev"] == "EDM" + assert result[1]["sd_shots_pg"] == 2.25 + # NaN semantics: season-first row carries None opp, an absent source row is never fabricated + assert result[1]["opponent_abbrev"] is None + assert "sd_shots_pg" not in payload[2] or payload[2].get("sd_shots_pg") is None + + +def test_attach_probe_is_cached(monkeypatch): + client = _FakeClient(migration_landed=True) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + publish_shot_cols._PROBE.clear() + publish_shot_cols._RAW_PROBE.clear() + # First call probes and installs the cache flag. + attach_shot_columns([], "Player-Snapshots-backtrack-dev", block=_stub_block()) + assert publish_shot_cols._PROBE["Player-Snapshots-backtrack-dev"] is True + select_count = _FakeTable.select_count + # A second call must not re-probe (network-free skip path). Block and + # payload supplied so no sqlite/hosts are touched. + attach_shot_columns([], "Player-Snapshots-backtrack-dev", block=_stub_block()) + assert _FakeTable.select_count == select_count + + +def _stub_raw_block(): + """Frame shaped like raw_game_map()'s output for attach tests.""" + return pd.DataFrame( + { + "date": ["2025-01-01", "2025-01-02", "2025-01-03"], + "player_id": [1, 1, 2], + "shots": [1, 2, 0], + "goals": [0, 1, 0], + "points": [0, 2, 0], + "toi_min": ["19:30", np.nan, 13.25], + } + ) + + +def _clear_probes(): + publish_shot_cols._PROBE.clear() + publish_shot_cols._RAW_PROBE.clear() + + +def test_attach_adds_raw_game_columns_once_landed(monkeypatch): + client = _FakeClient(migration_landed=True, raw_landed=True) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + _clear_probes() + payload = [ + {"date": "2025-01-01", "player_id": 1, "name": "n"}, # store row: toi string -> minutes + {"date": "2025-01-02", "player_id": 1, "name": "n"}, # store row: NaN toi -> None + {"date": "2025-01-09", "player_id": 999, "name": "n"}, # no store row: NO raw keys at all + ] + result = attach_shot_columns( + payload, "Player-Snapshots-backtrack-dev", block=_stub_block(), raw_block=_stub_raw_block() + ) + assert result[0]["game_shots"] == 1 + assert result[0]["game_goals"] == 0 + assert result[0]["game_points"] == 0 + assert result[0]["game_toi_min"] == 19.5 # 'MM:SS-string passthrough in _toi_minutes... minutes float + assert type(result[0]["game_shots"]) is int + assert result[1]["game_shots"] == 2 and result[1]["game_goals"] == 1 + assert result[1]["game_toi_min"] is None # NaN -> None encode + # A row the store cannot supply gets NO raw keys (NULL = did not play), + # while the 16 aggregate columns still attach. + assert all(key not in result[2] for key in publish_shot_cols.RAW_GAME_COLUMNS) + assert result[2].get("sd_shots_pg") is None # absent source row never fabricated + + +def test_attach_skips_raw_keys_until_raw_columns_landed(monkeypatch): + client = _FakeClient(migration_landed=True, raw_landed=False) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + _clear_probes() + payload = [{"date": "2025-01-02", "player_id": 1, "name": "n"}] + result = attach_shot_columns( + payload, "Player-Snapshots-backtrack-dev", block=_stub_block(), raw_block=_stub_raw_block() + ) + assert result[0]["sd_shots_pg"] == 2.5 # 16 keys unaffected by the raw split + assert all(key not in result[0] for key in publish_shot_cols.RAW_GAME_COLUMNS) + + +def test_attach_startup_never_mixes_raw_without_block(monkeypatch): + # On a table where BOTH landed but the caller supplies no raw_block (the + # real nightly path), the raw source is raw_game_map() - the store read. + # That path is exercised elsewhere; here assert probing only, with an + # empty payload so nothing is fetched. + client = _FakeClient(migration_landed=True, raw_landed=True) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + _clear_probes() + assert attach_shot_columns([], "Player-Snapshots-backtrack-dev", block=_stub_block()) == [] + assert publish_shot_cols._RAW_PROBE["Player-Snapshots-backtrack-dev"] is True + + +def test_attach_is_idempotent_and_never_deletes_rows(monkeypatch): + client = _FakeClient(migration_landed=True, raw_landed=True) + monkeypatch.setattr(publish_shot_cols, "SUPABASE_ADMIN_CLIENT", client) + _clear_probes() + payload = [ + {"date": "2025-01-01", "player_id": 1, "name": "n"}, + {"date": "2025-01-02", "player_id": 1, "name": "n"}, + ] + first = attach_shot_columns( + [dict(row) for row in payload], + "Player-Snapshots-backtrack-dev", + block=_stub_block(), + raw_block=_stub_raw_block(), + ) + # Second attach on the ALREADY-attached rows: same source, same casts, so + # every value is re-derived identically - no drift, no extra keys, and the + # row set cannot shrink (updates never delete: the table's row count is + # invariant, the 623,358-row top-up never dropped a row). + second = attach_shot_columns( + first, "Player-Snapshots-backtrack-dev", block=_stub_block(), raw_block=_stub_raw_block() + ) + assert len(second) == len(payload) + assert all("game_shots" in row for row in second[:2]) + assert {row["date"]: row["game_shots"] for row in second} == { + "2025-01-01": 1, + "2025-01-02": 2, + } + expected_keys = { + "date", + "player_id", + "name", + *publish_shot_cols.RAW_GAME_COLUMNS, + "sd_shots_pg", + "sd_goals_pg", + "sd_toi_pg", + "sd_sh_pct", + "r5_shots_pg", + "r5_goals_pg", + "r10_shots_pg", + "r10_goals_pg", + "r10_toi_pg", + "ewm_goals", + "ewm_shots", + "career_games", + "career_goals_pg", + "career_shots_pg", + "team_abbrev", + "opponent_abbrev", + } + assert set(second[0]) == expected_keys # idempotency: second pass adds exactly nothing new + + +def test_raw_records_nan_becomes_none_and_ints_stay_int(): + frame = pd.DataFrame( + { + "date": ["2025-01-01", "2025-01-02"], + "player_id": [7, 8], + "name": ["a", "b"], + "game_shots": pd.array([3, pd.NA], dtype="Int64"), # the builder's dtype + "game_goals": pd.array([1, 0], dtype="Int64"), + "game_points": pd.array([2, pd.NA], dtype="Int64"), + "game_toi_min": [12.5, np.nan], + } + ) + records = payload_records(frame) + assert type(records[0]["game_shots"]) is int and records[0]["game_shots"] == 3 + assert records[0]["game_toi_min"] == 12.5 + assert records[1]["game_shots"] is None + assert records[1]["game_points"] is None + assert records[1]["game_toi_min"] is None + assert records[1]["game_goals"] == 0 # zero is a VALUE, never lost to NaN encoding diff --git a/tests/unit/test_template_env_vars.py b/tests/unit/test_template_env_vars.py index a4b32932..24ad5dac 100644 --- a/tests/unit/test_template_env_vars.py +++ b/tests/unit/test_template_env_vars.py @@ -23,6 +23,19 @@ class CfnLoader(yaml.SafeLoader): CfnLoader.add_multi_constructor("!", lambda loader, suffix, node: {"__cfn_tag__": suffix}) +class CfnValueLoader(yaml.SafeLoader): + """SafeLoader that KEEPS intrinsic-tag values so Resource lists/Grant shapes stay inspectable.""" + + +def _keep_intrinsic(loader, suffix, node): + if isinstance(node, yaml.SequenceNode): + return [getattr(child, "value", _keep_intrinsic(loader, suffix, child)) for child in node.value] + return loader.construct_scalar(node) + + +CfnValueLoader.add_multi_constructor("!", _keep_intrinsic) + + def _find_template() -> Path: for parent in Path(__file__).resolve().parents: candidate = parent / "templates" / "template.yaml" @@ -34,18 +47,40 @@ def _find_template() -> Path: TEMPLATE_PATH = _find_template() TEMPLATE_TEXT = TEMPLATE_PATH.read_text(encoding="utf-8") TEMPLATE = yaml.load(TEMPLATE_TEXT, Loader=CfnLoader) +VALUE_TEMPLATE = yaml.load(TEMPLATE_TEXT, Loader=CfnValueLoader) + +# Import-time REQUIRED (cold_start): every Handler in this template lives in +# the shared ``event_handler`` module chain, which imports ``config.py`` and +# builds BOTH Supabase clients while the module is being imported +# (event_handler.py:9 -> player_archive.py:38 -> config.py:19/:23). Missing +# any of the three crashes the Lambda on cold start with ``SupabaseException`` +# before the handler runs. PR #146 escalation: MLPicksKick-{env} deployed +# with only GITHUB_DISPATCH_TOKEN and could never boot - the pure relay +# semantics hid the shared-import requirement. +IMPORT_REQUIRED_ENV_VARS = ( + "SUPABASE_URL", + "SUPABASE_API_KEY", + "SUPABASE_SERVICE_ROLE_KEY", +) # Credentials shared by every handler: the Supabase/PostHog clients, which # player_archive also needs because Player-Snapshots has RLS on and no policies # (service role only). Scoped per-handler credentials (Brevo) are deliberately # excluded - only SendEmailsFunction needs those. -SHARED_ENV_VARS = ( - "ENV", - "SUPABASE_URL", - "SUPABASE_API_KEY", - "SUPABASE_SERVICE_ROLE_KEY", - "POSTHOG_FEATURE_FLAG_KEY", -) +SHARED_ENV_VARS = ("ENV", *IMPORT_REQUIRED_ENV_VARS, "POSTHOG_FEATURE_FLAG_KEY") + +# Relay-exempt variables: ENV and the PostHog key are OPTIONAL at import +# (ENV defaults to "dev" and feature_flags only lazily consults PostHog), so +# the relay may still omit them. The relay must NOT be exempt from +# IMPORT_REQUIRED_ENV_VARS: it shares event_handler's import chain +# (test_relay_carries_import_required_env_var... below). The old FULL +# exemption of MLPicksKick from Supabase wiring predates the cold-start +# escalation and was wrong: "never USES Supabase" does not mean "never +# IMPORTS config". +RELAY_ONLY_FUNCTIONS = frozenset({"MLPicksKickFunction"}) + +# Per-function scoped credentials not covered by SHARED_ENV_VARS. +RELAY_ENV_VARS = {"MLPicksKickFunction": ("GITHUB_DISPATCH_TOKEN",)} def lambda_functions() -> dict: @@ -70,9 +105,16 @@ def test_every_lambda_function_gets_shared_env_var(env_var): """Every handler can reach Supabase and PostHog. A new Lambda added to the template without this variable would otherwise - only fail when that handler first runs. + only fail when that handler first runs. Relay-only functions + (RELAY_ONLY_FUNCTIONS) are exempt ONLY from the optional shared vars + (ENV/POSTHOG): they still must carry IMPORT_REQUIRED_ENV_VARS - see + test_relay_carries_import_required_env_var_from_the_shared_param. """ - missing = [name for name, resource in lambda_functions().items() if env_var not in env_vars(resource)] + missing = [ + name + for name, resource in lambda_functions().items() + if env_var not in env_vars(resource) and name not in RELAY_ONLY_FUNCTIONS + ] assert not missing, ( f"{len(missing)} Lambda function(s) missing {env_var}: {sorted(missing)}. " @@ -80,6 +122,55 @@ def test_every_lambda_function_gets_shared_env_var(env_var): ) +# The import trio's values come from the SAME parameters the other 15 +# functions use - no new secrets and no inline values. +IMPORT_REQUIRED_PARAM_SOURCES = { + "SUPABASE_URL": "SupabaseUrl", + "SUPABASE_API_KEY": "SupabaseApiKey", + "SUPABASE_SERVICE_ROLE_KEY": "SupabaseServiceRoleKey", +} + + +@pytest.mark.parametrize( + "env_var,param_name", + sorted(IMPORT_REQUIRED_PARAM_SOURCES.items()), +) +def test_relay_carries_import_required_env_var_from_the_shared_param(env_var, param_name): + """MLPicksKick is a relay at RUNTIME but a full pipeline module at IMPORT. + + Its Handler is ``event_handler.handle_ml_picks_kick``, so the Lambda + imports the shared chain the other 15 functions share, and + ``config.py:19/:23`` builds both Supabase clients at module import. The + deployed escalation proved it: with only GITHUB_DISPATCH_TOKEN wired the + relay died on cold start with ``SupabaseException: supabase_url is + required``. Assert presence AND parameter source - the trio must come + from the same ``Supabase*`` CloudFormation parameters the other + functions use. + """ + resource = lambda_functions().get("MLPicksKickFunction") + assert resource is not None, "MLPicksKickFunction missing from template.yaml" + assert env_var in env_vars(resource), f"MLPicksKickFunction is missing {env_var} (import-required, config.py)" + + variables = VALUE_TEMPLATE["Resources"]["MLPicksKickFunction"]["Properties"]["Environment"]["Variables"] + assert variables[env_var] == param_name, ( + f"MLPicksKickFunction's {env_var} must be !Ref {param_name} (the shared Supabase parameter), " + f"got {variables[env_var]!r}" + ) + + +@pytest.mark.parametrize("function_name,env_var", [(f, e) for f, vars_ in RELAY_ENV_VARS.items() for e in vars_]) +def test_relay_function_gets_its_scoped_env_var(function_name, env_var): + """Every relay-only Lambda still gets its own scoped credentials. + + MLPicksKick's GitHub dispatch is a 401-only failure at runtime without + GITHUB_DISPATCH_TOKEN wired through the template's NoEcho parameter - + exactly the class of silent breakage this file exists to prevent. + """ + resource = lambda_functions().get(function_name) + assert resource is not None, f"{function_name} missing from template.yaml" + assert env_var in env_vars(resource), f"{function_name} is missing {env_var} (Architecture A per-game relay)" + + def test_no_lambda_still_receives_the_retired_worker_token(): """The smartscore-api worker is gone (#113); its token must not linger. @@ -97,13 +188,56 @@ def test_no_lambda_still_receives_the_retired_worker_token(): assert "SMARTSCORE_API_TOKEN" not in TEMPLATE_TEXT -def test_every_ref_points_at_a_declared_parameter(): +def test_every_ref_points_at_a_declared_parameter_or_resource(): """Catches typos in !Ref targets, which CloudFormation only rejects at deploy.""" - declared = set(TEMPLATE.get("Parameters", {})) + declared = set(TEMPLATE.get("Parameters", {})) | set(TEMPLATE.get("Resources", {})) referenced = set(re.findall(r"!Ref\s+([A-Za-z0-9_]+)", TEMPLATE_TEXT)) undeclared = sorted(referenced - declared) - assert not undeclared, f"!Ref to undeclared parameter(s): {undeclared}" + assert not undeclared, f"!Ref to undeclared parameter(s)/resource(s): {undeclared}" + + +def test_kick_ml_picks_role_and_permission_wiring(): + """KickMLPicks wiring (PR #146 follow-up race fix). + + The state machine's KickMLPicks Task invokes MLPicksKick at the END of + the run, so (a) the StateMachineExecutionRole must grant + lambda:InvokeFunction on the relay, and (b) the invoke permission must + name states.amazonaws.com - the state machine is the principal, EventBridge + is no longer an MLPicksKick invoker. + """ + role = VALUE_TEMPLATE["Resources"]["StateMachineExecutionRole"]["Properties"] + policy_document = role["Policies"][0]["PolicyDocument"] + invoke_statement = next( + statement for statement in policy_document["Statement"] if "lambda:InvokeFunction" in statement["Action"] + ) + assert any(resource == "MLPicksKickFunction.Arn" for resource in invoke_statement["Resource"]), ( + "StateMachineExecutionRole missing lambda:InvokeFunction on MLPicksKickFunction - " + "the KickMLPicks state would fail with AccessDenied" + ) + + permission = VALUE_TEMPLATE["Resources"]["MLPicksKickStatePermission"]["Properties"] + assert permission["Principal"] == "states.amazonaws.com" + assert "stateMachine:PlayerProcessingPipeline-${ENV}" in permission["SourceArn"] + + # The old EventBridge-per-rule grant is retired: no events.amazonaws.com + # principal invokes the relay. + assert "MLPicksKickFunctionPermission" not in VALUE_TEMPLATE["Resources"] + for name, resource in VALUE_TEMPLATE["Resources"].items(): + if resource.get("Type") != "AWS::Lambda::Permission": + continue + properties = resource.get("Properties", {}) + if "MLPicksKickFunction" in str(properties.get("FunctionName", "")): + assert properties["Principal"] == "states.amazonaws.com", ( + f"{name} must not re-introduce an EventBridge principal" + ) + + +def test_kick_ml_picks_asl_state_points_at_the_relay_function(): + """The pipeline ASL's final state invokes the relay by its function name.""" + asl_text = (TEMPLATE_PATH.parent / "player_processing_pipeline.asl.json").read_text(encoding="utf-8") + assert "function:MLPicksKick-${ENV}" in asl_text, "KickMLPicks state must invoke MLPicksKick-${ENV}" + assert "MLPicksKickStatePermission" in VALUE_TEMPLATE["Resources"] def _deploy_script() -> Path: diff --git a/tests/unit/test_utility.py b/tests/unit/test_utility.py index 5ae57ef4..5cfc3400 100644 --- a/tests/unit/test_utility.py +++ b/tests/unit/test_utility.py @@ -335,3 +335,15 @@ def test_save_to_db_carries_forward_goalie_values_on_fetch_failure(mock_request, posted = mock_request.call_args.kwargs["json_data"] assert posted[0]["opp_goalie_name"] == "Starter" assert posted[0]["opp_goalie_status"] == "CONFIRMED" + + +@patch("utility.count_picks_for_date", return_value=1) +@patch("utility.exponential_backoff_supabase_request") +def test_save_to_db_preserves_legacy_stat(mock_request, mock_count): + """Site publish payload carries legacy_stat alongside stat.""" + players = [{"id": 1, "date": "2026-04-15", "player_id": 11, "stat": 0.42, "legacy_stat": 0.42}] + save_to_db(players, "2026-04-15") + + posted = mock_request.call_args.kwargs["json_data"] + assert posted[0]["legacy_stat"] == 0.42 + assert posted[0]["legacy_stat"] == posted[0]["stat"] diff --git a/tests/unit/test_utility_schedule_run.py b/tests/unit/test_utility_schedule_run.py index 07309155..ec759c35 100644 --- a/tests/unit/test_utility_schedule_run.py +++ b/tests/unit/test_utility_schedule_run.py @@ -41,3 +41,41 @@ def test_schedule_run_last_game_true(mock_session, mock_ssm_client, mock_sts_cli else: assert payload_dict["last_game"] is False assert payload_dict["source"] == "eventBridge" + + +@patch("utility.get_events_client") +@patch("utility.get_sts_client") +@patch("utility.get_ssm_client") +@patch("utility.boto3.session.Session") +def test_schedule_run_single_canonical_state_machine_target( + mock_session, mock_ssm_client, mock_sts_client, mock_events_client +): + """One rule, ONE target: the state machine only (pre-#146 shape restored). + + The old parallel MLPicksKick Lambda target (Id mlPicksKickTarget) is + gone - the ML picks dispatch now fires from the KickMLPicks state at the + END of the state machine run (after SaveToDb/UpdateHistory/PublishToDb), + so the Actions pass cannot race the refetched tims/LIVE snapshot writes. + """ + times = ["2026-01-15T00:30:00Z"] # game start 00:30 UTC -> trigger at 00:35 UTC + + mock_session.return_value.region_name = "us-east-1" + mock_sts_client.return_value.get_caller_identity.return_value = {"Account": "123456789012"} + mock_ssm_client.return_value.get_parameter.return_value = {"Parameter": {"Value": "role-arn"}} + + rule_name = "TriggerStateMachineAt_202601150035-dev" + schedule_run(times) + + mock_events_client.return_value.put_rule.assert_called_once_with( + Name=rule_name, + ScheduleExpression="cron(35 0 15 1 ? 2026)", + State="ENABLED", + ) + + targets = mock_events_client.return_value.put_targets.call_args[1]["Targets"] + assert [t["Id"] for t in targets] == ["1"] + assert targets[0]["Arn"] == "arn:aws:states:us-east-1:123456789012:stateMachine:PlayerProcessingPipeline-dev" + assert targets[0]["RoleArn"] == "role-arn" + payload = json.loads(targets[0]["Input"]) + # Single rule for one time means idx == 0 == last: last_game is True. + assert payload == {"source": "eventBridge", "last_game": True} diff --git a/uv.lock b/uv.lock index d0d82f4c..5c69ab09 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 1 +revision = 5 requires-python = "==3.12.*" resolution-markers = [ "sys_platform == 'win32'", @@ -11,9 +11,9 @@ resolution-markers = [ name = "annotated-types" version = "0.8.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893 } +sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427 }, + { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" }, ] [[package]] @@ -24,9 +24,9 @@ dependencies = [ { name = "idna" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/61/cc/a381afa6efea9f496eff839d4a6a1aed3bfafc7b3ab4b0d1b243a12573dd/anyio-4.14.2.tar.gz", hash = "sha256:cfa139f3ed1a23ee8f88a145ddb5ac7605b8bbfd8592baacd7ce3d8bb4313c7f", size = 260176 } +sdist = { url = "https://files.pythonhosted.org/packages/61/cc/a381afa6efea9f496eff839d4a6a1aed3bfafc7b3ab4b0d1b243a12573dd/anyio-4.14.2.tar.gz", hash = "sha256:cfa139f3ed1a23ee8f88a145ddb5ac7605b8bbfd8592baacd7ce3d8bb4313c7f", size = 260176, upload-time = "2026-07-12T20:29:07.082Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/da/35/f2287558c17e29fafc8ef3daf819bb9834061cfa43bff8014f7df7f63bdc/anyio-4.14.2-py3-none-any.whl", hash = "sha256:9f505dda5ac9f0c8309b5e8bd445a8c2bf7246f3ce950121e45ea15bc41d1494", size = 125813 }, + { url = "https://files.pythonhosted.org/packages/da/35/f2287558c17e29fafc8ef3daf819bb9834061cfa43bff8014f7df7f63bdc/anyio-4.14.2-py3-none-any.whl", hash = "sha256:9f505dda5ac9f0c8309b5e8bd445a8c2bf7246f3ce950121e45ea15bc41d1494", size = 125813, upload-time = "2026-07-12T20:29:05.763Z" }, ] [[package]] @@ -37,18 +37,18 @@ dependencies = [ { name = "jmespath" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6b/d2/ead05769a42baf2c01e9e8909b5b7a0a42b0798ab2d0eccacdef3d1f009d/aws_lambda_powertools-3.34.0.tar.gz", hash = "sha256:75f2c65a5997630666c9c3c495002c1f9d1e9defd3cb6d5d9fc7272b7dc9ef54", size = 800151 } +sdist = { url = "https://files.pythonhosted.org/packages/6b/d2/ead05769a42baf2c01e9e8909b5b7a0a42b0798ab2d0eccacdef3d1f009d/aws_lambda_powertools-3.34.0.tar.gz", hash = "sha256:75f2c65a5997630666c9c3c495002c1f9d1e9defd3cb6d5d9fc7272b7dc9ef54", size = 800151, upload-time = "2026-08-10T11:26:10.742Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/d1/9e9433f99d8c9084d3bc831900f1ce7a99b0a2c153d9223e46839d8cc665/aws_lambda_powertools-3.34.0-py3-none-any.whl", hash = "sha256:ab1354c58085ccecf92e9c548b1336ad5bae72c7ae23e61d2aa0ff15520d679c", size = 957321 }, + { url = "https://files.pythonhosted.org/packages/b3/d1/9e9433f99d8c9084d3bc831900f1ce7a99b0a2c153d9223e46839d8cc665/aws_lambda_powertools-3.34.0-py3-none-any.whl", hash = "sha256:ab1354c58085ccecf92e9c548b1336ad5bae72c7ae23e61d2aa0ff15520d679c", size = 957321, upload-time = "2026-08-10T11:26:09.002Z" }, ] [[package]] name = "backoff" version = "2.2.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/47/d7/5bbeb12c44d7c4f2fb5b56abce497eb5ed9f34d85701de869acedd602619/backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba", size = 17001 } +sdist = { url = "https://files.pythonhosted.org/packages/47/d7/5bbeb12c44d7c4f2fb5b56abce497eb5ed9f34d85701de869acedd602619/backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba", size = 17001, upload-time = "2022-10-05T19:19:32.061Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/df/73/b6e24bd22e6720ca8ee9a85a0c4a2971af8497d8f3193fa05390cbd46e09/backoff-2.2.1-py3-none-any.whl", hash = "sha256:63579f9a0628e06278f7e47b7d7d5b6ce20dc65c5e96a6f3ca99a6adca0396e8", size = 15148 }, + { url = "https://files.pythonhosted.org/packages/df/73/b6e24bd22e6720ca8ee9a85a0c4a2971af8497d8f3193fa05390cbd46e09/backoff-2.2.1-py3-none-any.whl", hash = "sha256:63579f9a0628e06278f7e47b7d7d5b6ce20dc65c5e96a6f3ca99a6adca0396e8", size = 15148, upload-time = "2022-10-05T19:19:30.546Z" }, ] [[package]] @@ -59,9 +59,9 @@ dependencies = [ { name = "soupsieve" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/43/65/318323f98dbee45d42dff61d8f047181bc6f2268a9068cfad035a46be5af/beautifulsoup4-4.15.0.tar.gz", hash = "sha256:288e3ca7d54b06f2ac191970bc275c1939cb46d450b255bf6718b04aa37ab4f7", size = 632571 } +sdist = { url = "https://files.pythonhosted.org/packages/43/65/318323f98dbee45d42dff61d8f047181bc6f2268a9068cfad035a46be5af/beautifulsoup4-4.15.0.tar.gz", hash = "sha256:288e3ca7d54b06f2ac191970bc275c1939cb46d450b255bf6718b04aa37ab4f7", size = 632571, upload-time = "2026-06-07T16:44:20.453Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/c6/92fcd42f1ba33e1184263f25bfabf3d27c383410470f169e4b8163bf9c17/beautifulsoup4-4.15.0-py3-none-any.whl", hash = "sha256:d6f88de62e1d4e38ecb1077eb9724cd0eff29d2a08ca16a401e9b9e93f117cf9", size = 109924 }, + { url = "https://files.pythonhosted.org/packages/88/c6/92fcd42f1ba33e1184263f25bfabf3d27c383410470f169e4b8163bf9c17/beautifulsoup4-4.15.0-py3-none-any.whl", hash = "sha256:d6f88de62e1d4e38ecb1077eb9724cd0eff29d2a08ca16a401e9b9e93f117cf9", size = 109924, upload-time = "2026-06-07T16:44:21.566Z" }, ] [[package]] @@ -73,9 +73,9 @@ dependencies = [ { name = "jmespath" }, { name = "s3transfer" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ec/30/96cf7d324e75cd2c349e2911ae2334d987fb8525d551495a2ef6758c26f3/boto3-1.43.83.tar.gz", hash = "sha256:6413d6e99f716af5d333a732db140e4b3359cac005a1271b11777b6d9ca82194", size = 112686 } +sdist = { url = "https://files.pythonhosted.org/packages/ec/30/96cf7d324e75cd2c349e2911ae2334d987fb8525d551495a2ef6758c26f3/boto3-1.43.83.tar.gz", hash = "sha256:6413d6e99f716af5d333a732db140e4b3359cac005a1271b11777b6d9ca82194", size = 112686, upload-time = "2026-08-28T19:35:52.273Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f2/4b/843f30dc77324778efa90c4169d503963668760b8d8abdf26a61bd090141/boto3-1.43.83-py3-none-any.whl", hash = "sha256:73a3564f737d4516625964eee709a498fa98ccee6aca929febad2b0b5fbeae1e", size = 140025 }, + { url = "https://files.pythonhosted.org/packages/f2/4b/843f30dc77324778efa90c4169d503963668760b8d8abdf26a61bd090141/boto3-1.43.83-py3-none-any.whl", hash = "sha256:73a3564f737d4516625964eee709a498fa98ccee6aca929febad2b0b5fbeae1e", size = 140025, upload-time = "2026-08-28T19:35:49.228Z" }, ] [[package]] @@ -87,18 +87,18 @@ dependencies = [ { name = "python-dateutil" }, { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ed/6f/cf16418004c832e6eb9abc6905fa323a3bf96a76ca7f2e97858801a4103e/botocore-1.43.83.tar.gz", hash = "sha256:d9389b3b74400c34219965a2fb858c1d48744718865ee0496fd03bd5b21b943f", size = 16010078 } +sdist = { url = "https://files.pythonhosted.org/packages/ed/6f/cf16418004c832e6eb9abc6905fa323a3bf96a76ca7f2e97858801a4103e/botocore-1.43.83.tar.gz", hash = "sha256:d9389b3b74400c34219965a2fb858c1d48744718865ee0496fd03bd5b21b943f", size = 16010078, upload-time = "2026-08-28T19:35:46.211Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/98/50/332d6713fa09b05ff0882f5d194569fa70d1c8735aca9829b1286fef32ba/botocore-1.43.83-py3-none-any.whl", hash = "sha256:bf75a6cf587c22d968e43e79fe122c39f82deafbe9c3422bc5d3e80b6210fc98", size = 15704489 }, + { url = "https://files.pythonhosted.org/packages/98/50/332d6713fa09b05ff0882f5d194569fa70d1c8735aca9829b1286fef32ba/botocore-1.43.83-py3-none-any.whl", hash = "sha256:bf75a6cf587c22d968e43e79fe122c39f82deafbe9c3422bc5d3e80b6210fc98", size = 15704489, upload-time = "2026-08-28T19:35:40.603Z" }, ] [[package]] name = "certifi" version = "2026.7.22" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112 } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983 }, + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, ] [[package]] @@ -108,103 +108,112 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pycparser", marker = "implementation_name != 'PyPy'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807 } +sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821 }, - { url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719 }, - { url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799 }, - { url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389 }, - { url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249 }, - { url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775 }, - { url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822 }, - { url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232 }, - { url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597 }, - { url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292 }, - { url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919 }, - { url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093 }, + { url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" }, + { url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" }, + { url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" }, + { url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" }, + { url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" }, + { url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" }, + { url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" }, + { url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" }, + { url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" }, + { url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" }, + { url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" }, ] [[package]] name = "cfgv" version = "3.5.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334 } +sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445 }, + { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" }, ] [[package]] name = "charset-normalizer" version = "3.5.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e5/3f/143b048436775b0f76ac3eec145c019e8173ccc2885c8f20319b996d5e83/charset_normalizer-3.5.1.tar.gz", hash = "sha256:6117b84ea48435e5356dc737f5121485c30920ba43375fa7b434fd753df0eac3", size = 171764 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/30/27/78873dc8b6a56357517b74b6bb9568b80450e7bb4f6ef7e3fa9d22aa0bd7/charset_normalizer-3.5.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:5b6d1386bf0096d26d3a863dc0a487a5b4eb9aa93cf5ba69683d29dde6b9d60f", size = 344456 }, - { url = "https://files.pythonhosted.org/packages/9a/4c/be49ada26b1f0232d57aa89bbebf997a5cc2332a5616b6eca26ff680044d/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4582c27e8c889d64811987b5967fbd3ae0c823fe1fd933b543d55ac20bb475fa", size = 238530 }, - { url = "https://files.pythonhosted.org/packages/76/84/6f1290fa07ae6978d3960caa3eb1b8019bf9284ab7c2297b00c099ef4250/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1d1c7a53a6c2103925cdd6d7229f8c567379f211c869793df679f2e9f738c369", size = 230200 }, - { url = "https://files.pythonhosted.org/packages/e7/a0/47b18adeed31c8f16ba9700f32c1b18594cfa09f47eb672a488c273c22bf/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e6621fb2a4988d6e53eedc455e5903e2679f3967b8acb3d639f1b63c14a2e893", size = 262222 }, - { url = "https://files.pythonhosted.org/packages/38/fe/341861ac118dae06f3ec0eb487488af52128f2ef2faf0b11003944d22259/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7c0c10730342b0c9b35dd1d619beb8214e520bd96a1f870f452680b238aab3e0", size = 258951 }, - { url = "https://files.pythonhosted.org/packages/6f/89/bb5108dc6c3651dca963f2b0a3ba19bbcb370c94e1b6d3e0e844a58e6dca/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9af956078716df40d985fb0dfeb2c2120c5ca92ba4ff4b388acfd01cdc14d08", size = 248801 }, - { url = "https://files.pythonhosted.org/packages/b1/ba/ef83ae3aca816393decfa3530976f38a79812d707b80b580ac33b83f9877/charset_normalizer-3.5.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f9f8405c2c758532c74fed975dbee57be1f31a6e865c031870c79a6ed3212ada", size = 244070 }, - { url = "https://files.pythonhosted.org/packages/f6/0b/c5292a2462d69b7378ea89793bbb5b2b6fcf6f7dd6d1667f9619094ad553/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:96fef3e886d6a9874b14f27fc193fbdc69d5d8035783d86aa4e1cea594e695f9", size = 240110 }, - { url = "https://files.pythonhosted.org/packages/46/22/111e5be3b740d5c2a5bfcedb3d237b6591e5c2e82ae9d6ffcb121fe0909c/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5d8531a6569d025f68e2321e7638fb7978f23db58e5f69f56913837aae03816e", size = 232836 }, - { url = "https://files.pythonhosted.org/packages/f9/d2/d2aad6fe0dbb44b194bf3becb60f5a0ac48446ade999a47fe7bb41eb09a7/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:aae2ee51122d3ae968a3837d97dc24a0aeebb0dea23694422cd172bd30017cd6", size = 262712 }, - { url = "https://files.pythonhosted.org/packages/35/5a/337e4663a5eae6de99db940ee8066d4145caafb61327db62deda15313cce/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:7235dc28fc6dd9d832ac7c7bce95367dedb85929f17368a0c2bee1e080b9acbf", size = 242977 }, - { url = "https://files.pythonhosted.org/packages/ca/85/f82f8a92e31c7519410e2e1afdc630f28ec47490ce2c09a11c1a43cbb459/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:4abdc5f9ad448c1ecbfae2974b820535d6bc6e7eef63babbab3d81cf46968c71", size = 260207 }, - { url = "https://files.pythonhosted.org/packages/b7/52/643d11ffd60e9ac2fd1fb87e167a19285b9eefeff4a40e63c87cbfbeab36/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ba501e667c17d8411f98e67a022d9604ef179aff0e459b7e292c796837c13573", size = 250562 }, - { url = "https://files.pythonhosted.org/packages/62/16/46556278c2168d12df9da7fede5dc6fc70e60301b26a82bbeec238c9cfe3/charset_normalizer-3.5.1-cp312-cp312-win32.whl", hash = "sha256:cfa1c0cc3a8f9f53f1243a5a99ac36fd003880199383b37672e86ddda9cb07e2", size = 178507 }, - { url = "https://files.pythonhosted.org/packages/9d/7a/4c6c298171e6b3e745633180ff59350fc0ca0db1ffd28df1e369e0579f71/charset_normalizer-3.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:3617ac3cfd8b9888f145ad89dd6e692285834b0201c6074a5eeaad3fd4d668c2", size = 200551 }, - { url = "https://files.pythonhosted.org/packages/cd/d7/eb95a042f0dd22e304b0b6472b154f3546a1a039a9ee89ccb2a7f61591fc/charset_normalizer-3.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:88e85ab89cb822c1e635f51d6d32e488f94e002e70e2f492bdb8b945543f345a", size = 180700 }, - { url = "https://files.pythonhosted.org/packages/5b/97/fb4e82231aba271ffd775a1b4993b0defc4e3059f286ae41d9433409fe85/charset_normalizer-3.5.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:41876ee62a3dddf48ff1121ad8f0798032aa03f2fd35f21f34a4cab14f18d8d2", size = 331467 }, - { url = "https://files.pythonhosted.org/packages/9f/2f/fe3f187327aac18e2d54e9d2b08e15d27bf9b642d9e51c219f130fc34d1a/charset_normalizer-3.5.1-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:a6dac12ff6b846103483683f60c5f8fee205121adc58ffd87e90a90a3af69e99", size = 253057 }, - { url = "https://files.pythonhosted.org/packages/d7/c7/9e48cee5c161fe24da823b61bf381921d77cb994a0a4de148e95018c1984/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cee5dd7c6fb5dd52a0fe2a740f9bc6e3593f5f8b1788bde49de02086f30182b2", size = 240930 }, - { url = "https://files.pythonhosted.org/packages/49/e0/716601f3cc69be7b198951150c75ead1ece33c3c8036ff6ffa46029659a0/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:343fb4f2821043bd87095f7b08a1a181febc8e36ac64212143bbfd0a0e1bc235", size = 230822 }, - { url = "https://files.pythonhosted.org/packages/d3/05/71bfc5caa0abcc45aea1f6a4d50ac68e59605ddc7666fe8494f4cd229665/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ae4a097991662cd4fff0ddc74e0fe7874f82e00042fa0ea00855645ed0c79598", size = 260037 }, - { url = "https://files.pythonhosted.org/packages/c3/92/de7e32ed05341e7a9c4c877c318418197b7f2d66a3b68d561bf2ac57ca3e/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4b599739b93b2cbeded49645ae3c8d1405c29ddfbceac1545c87a3f9580a9e96", size = 255097 }, - { url = "https://files.pythonhosted.org/packages/f5/7b/ade0a122600319dfa0b1000ab0f9731c94a817904cf3c5de408c73a4ede7/charset_normalizer-3.5.1-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b39b69b347e5e47a3b5b8cfc005c68c1ba347474e3960236c4944a8ecd174962", size = 250166 }, - { url = "https://files.pythonhosted.org/packages/75/9c/019fbb9f4834491a160951349b1a3714439376f66e5f7cf18b4f18f0c7aa/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a2028475ba855475b8b4d3cfeb4994269c967aea8b9892dfba907f4263a863a3", size = 241821 }, - { url = "https://files.pythonhosted.org/packages/2b/b8/11d4840bfc99330cc7fbcc2681ee5a044553a6e77655508d8f9b2bff7b34/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:36047af20e17097c3bb9476c2b7655f2f7aa51322c0ba58c07695bedf755a950", size = 232529 }, - { url = "https://files.pythonhosted.org/packages/18/96/2b3a21492d9f65171ac75d872f5018260013d00bfa0ff70ec9f179148cbd/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:4c4fb141a727957c93edfe5c32a26ceb6b5f6461d67146e2d39f51e16170bea8", size = 260348 }, - { url = "https://files.pythonhosted.org/packages/d6/aa/a69a2028e8bd052476c245460ab19d7de595de084dd968f2d75cd50c3e25/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:2f293479cce755c75f1697e87c409b7ae4c555c7dfecb6e988ad13abba943031", size = 247234 }, - { url = "https://files.pythonhosted.org/packages/35/8a/3d130aeabcaf3d2466af76b7b141c08d9e89c9016ab4b7cdd0f7dc2d1c62/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:3588e376b3ea2eea84976f67273d679f229e24c66dce7b82ae45aef04ff6e072", size = 256917 }, - { url = "https://files.pythonhosted.org/packages/80/c2/a7379b840292d0c1ab9fbd17d1f3967aa81794dc95bc74be8999d7fedcf7/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e199fb99720074809a7720f1c0b4d919eea8b87e88713e0f8f602f7bef543d9d", size = 254846 }, - { url = "https://files.pythonhosted.org/packages/01/65/d43b714731bb2f40d4053dfa00ecfc1c5a301f8e3316c5db3a09af59fe94/charset_normalizer-3.5.1-cp37-abi3-win32.whl", hash = "sha256:dd732602a7009217f658d5863d12d79d373a4de0eebc111094bcdd3bb8e0a6cc", size = 174216 }, - { url = "https://files.pythonhosted.org/packages/35/4f/b911ed898b26a09789eba9c9200c999aff6c61b4bafaf4838e56d1a1e1a3/charset_normalizer-3.5.1-cp37-abi3-win_amd64.whl", hash = "sha256:70055ff39b97c99e7ae40ea3e393fb62aa2e44dbd9b29f8d14f42fb0025c3959", size = 199764 }, - { url = "https://files.pythonhosted.org/packages/f0/a7/920baf467bfd9bf689f3b318340f37aee4572a71f162bd8db51da55ba4fa/charset_normalizer-3.5.1-cp37-abi3-win_arm64.whl", hash = "sha256:87e4f41d375c0b9be2fb5251aee4b8a689169e134535aed81bf085c3b647451e", size = 287318 }, - { url = "https://files.pythonhosted.org/packages/cc/61/d01fc49b8dea277640b55a9e15960dbca9fdc8c9fde18e572d39c59f4019/charset_normalizer-3.5.1-py3-none-any.whl", hash = "sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6", size = 68658 }, +sdist = { url = "https://files.pythonhosted.org/packages/e5/3f/143b048436775b0f76ac3eec145c019e8173ccc2885c8f20319b996d5e83/charset_normalizer-3.5.1.tar.gz", hash = "sha256:6117b84ea48435e5356dc737f5121485c30920ba43375fa7b434fd753df0eac3", size = 171764, upload-time = "2026-08-15T08:20:44.807Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/30/27/78873dc8b6a56357517b74b6bb9568b80450e7bb4f6ef7e3fa9d22aa0bd7/charset_normalizer-3.5.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:5b6d1386bf0096d26d3a863dc0a487a5b4eb9aa93cf5ba69683d29dde6b9d60f", size = 344456, upload-time = "2026-08-15T08:17:10.072Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4c/be49ada26b1f0232d57aa89bbebf997a5cc2332a5616b6eca26ff680044d/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4582c27e8c889d64811987b5967fbd3ae0c823fe1fd933b543d55ac20bb475fa", size = 238530, upload-time = "2026-08-15T08:17:11.563Z" }, + { url = "https://files.pythonhosted.org/packages/76/84/6f1290fa07ae6978d3960caa3eb1b8019bf9284ab7c2297b00c099ef4250/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1d1c7a53a6c2103925cdd6d7229f8c567379f211c869793df679f2e9f738c369", size = 230200, upload-time = "2026-08-15T08:17:12.919Z" }, + { url = "https://files.pythonhosted.org/packages/e7/a0/47b18adeed31c8f16ba9700f32c1b18594cfa09f47eb672a488c273c22bf/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e6621fb2a4988d6e53eedc455e5903e2679f3967b8acb3d639f1b63c14a2e893", size = 262222, upload-time = "2026-08-15T08:17:14.571Z" }, + { url = "https://files.pythonhosted.org/packages/38/fe/341861ac118dae06f3ec0eb487488af52128f2ef2faf0b11003944d22259/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7c0c10730342b0c9b35dd1d619beb8214e520bd96a1f870f452680b238aab3e0", size = 258951, upload-time = "2026-08-15T08:17:16.158Z" }, + { url = "https://files.pythonhosted.org/packages/6f/89/bb5108dc6c3651dca963f2b0a3ba19bbcb370c94e1b6d3e0e844a58e6dca/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9af956078716df40d985fb0dfeb2c2120c5ca92ba4ff4b388acfd01cdc14d08", size = 248801, upload-time = "2026-08-15T08:17:17.683Z" }, + { url = "https://files.pythonhosted.org/packages/b1/ba/ef83ae3aca816393decfa3530976f38a79812d707b80b580ac33b83f9877/charset_normalizer-3.5.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f9f8405c2c758532c74fed975dbee57be1f31a6e865c031870c79a6ed3212ada", size = 244070, upload-time = "2026-08-15T08:17:19.191Z" }, + { url = "https://files.pythonhosted.org/packages/f6/0b/c5292a2462d69b7378ea89793bbb5b2b6fcf6f7dd6d1667f9619094ad553/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:96fef3e886d6a9874b14f27fc193fbdc69d5d8035783d86aa4e1cea594e695f9", size = 240110, upload-time = "2026-08-15T08:17:20.547Z" }, + { url = "https://files.pythonhosted.org/packages/46/22/111e5be3b740d5c2a5bfcedb3d237b6591e5c2e82ae9d6ffcb121fe0909c/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5d8531a6569d025f68e2321e7638fb7978f23db58e5f69f56913837aae03816e", size = 232836, upload-time = "2026-08-15T08:17:21.895Z" }, + { url = "https://files.pythonhosted.org/packages/f9/d2/d2aad6fe0dbb44b194bf3becb60f5a0ac48446ade999a47fe7bb41eb09a7/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:aae2ee51122d3ae968a3837d97dc24a0aeebb0dea23694422cd172bd30017cd6", size = 262712, upload-time = "2026-08-15T08:17:23.727Z" }, + { url = "https://files.pythonhosted.org/packages/35/5a/337e4663a5eae6de99db940ee8066d4145caafb61327db62deda15313cce/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:7235dc28fc6dd9d832ac7c7bce95367dedb85929f17368a0c2bee1e080b9acbf", size = 242977, upload-time = "2026-08-15T08:17:25.157Z" }, + { url = "https://files.pythonhosted.org/packages/ca/85/f82f8a92e31c7519410e2e1afdc630f28ec47490ce2c09a11c1a43cbb459/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:4abdc5f9ad448c1ecbfae2974b820535d6bc6e7eef63babbab3d81cf46968c71", size = 260207, upload-time = "2026-08-15T08:17:26.602Z" }, + { url = "https://files.pythonhosted.org/packages/b7/52/643d11ffd60e9ac2fd1fb87e167a19285b9eefeff4a40e63c87cbfbeab36/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ba501e667c17d8411f98e67a022d9604ef179aff0e459b7e292c796837c13573", size = 250562, upload-time = "2026-08-15T08:17:27.971Z" }, + { url = "https://files.pythonhosted.org/packages/62/16/46556278c2168d12df9da7fede5dc6fc70e60301b26a82bbeec238c9cfe3/charset_normalizer-3.5.1-cp312-cp312-win32.whl", hash = "sha256:cfa1c0cc3a8f9f53f1243a5a99ac36fd003880199383b37672e86ddda9cb07e2", size = 178507, upload-time = "2026-08-15T08:17:29.277Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7a/4c6c298171e6b3e745633180ff59350fc0ca0db1ffd28df1e369e0579f71/charset_normalizer-3.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:3617ac3cfd8b9888f145ad89dd6e692285834b0201c6074a5eeaad3fd4d668c2", size = 200551, upload-time = "2026-08-15T08:17:30.668Z" }, + { url = "https://files.pythonhosted.org/packages/cd/d7/eb95a042f0dd22e304b0b6472b154f3546a1a039a9ee89ccb2a7f61591fc/charset_normalizer-3.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:88e85ab89cb822c1e635f51d6d32e488f94e002e70e2f492bdb8b945543f345a", size = 180700, upload-time = "2026-08-15T08:17:32.028Z" }, + { url = "https://files.pythonhosted.org/packages/5b/97/fb4e82231aba271ffd775a1b4993b0defc4e3059f286ae41d9433409fe85/charset_normalizer-3.5.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:41876ee62a3dddf48ff1121ad8f0798032aa03f2fd35f21f34a4cab14f18d8d2", size = 331467, upload-time = "2026-08-15T08:19:50.959Z" }, + { url = "https://files.pythonhosted.org/packages/9f/2f/fe3f187327aac18e2d54e9d2b08e15d27bf9b642d9e51c219f130fc34d1a/charset_normalizer-3.5.1-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:a6dac12ff6b846103483683f60c5f8fee205121adc58ffd87e90a90a3af69e99", size = 253057, upload-time = "2026-08-15T08:19:52.654Z" }, + { url = "https://files.pythonhosted.org/packages/d7/c7/9e48cee5c161fe24da823b61bf381921d77cb994a0a4de148e95018c1984/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cee5dd7c6fb5dd52a0fe2a740f9bc6e3593f5f8b1788bde49de02086f30182b2", size = 240930, upload-time = "2026-08-15T08:19:54.163Z" }, + { url = "https://files.pythonhosted.org/packages/49/e0/716601f3cc69be7b198951150c75ead1ece33c3c8036ff6ffa46029659a0/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:343fb4f2821043bd87095f7b08a1a181febc8e36ac64212143bbfd0a0e1bc235", size = 230822, upload-time = "2026-08-15T08:19:55.807Z" }, + { url = "https://files.pythonhosted.org/packages/d3/05/71bfc5caa0abcc45aea1f6a4d50ac68e59605ddc7666fe8494f4cd229665/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ae4a097991662cd4fff0ddc74e0fe7874f82e00042fa0ea00855645ed0c79598", size = 260037, upload-time = "2026-08-15T08:19:57.312Z" }, + { url = "https://files.pythonhosted.org/packages/c3/92/de7e32ed05341e7a9c4c877c318418197b7f2d66a3b68d561bf2ac57ca3e/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4b599739b93b2cbeded49645ae3c8d1405c29ddfbceac1545c87a3f9580a9e96", size = 255097, upload-time = "2026-08-15T08:19:59.056Z" }, + { url = "https://files.pythonhosted.org/packages/f5/7b/ade0a122600319dfa0b1000ab0f9731c94a817904cf3c5de408c73a4ede7/charset_normalizer-3.5.1-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b39b69b347e5e47a3b5b8cfc005c68c1ba347474e3960236c4944a8ecd174962", size = 250166, upload-time = "2026-08-15T08:20:00.612Z" }, + { url = "https://files.pythonhosted.org/packages/75/9c/019fbb9f4834491a160951349b1a3714439376f66e5f7cf18b4f18f0c7aa/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a2028475ba855475b8b4d3cfeb4994269c967aea8b9892dfba907f4263a863a3", size = 241821, upload-time = "2026-08-15T08:20:02.321Z" }, + { url = "https://files.pythonhosted.org/packages/2b/b8/11d4840bfc99330cc7fbcc2681ee5a044553a6e77655508d8f9b2bff7b34/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:36047af20e17097c3bb9476c2b7655f2f7aa51322c0ba58c07695bedf755a950", size = 232529, upload-time = "2026-08-15T08:20:04.008Z" }, + { url = "https://files.pythonhosted.org/packages/18/96/2b3a21492d9f65171ac75d872f5018260013d00bfa0ff70ec9f179148cbd/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:4c4fb141a727957c93edfe5c32a26ceb6b5f6461d67146e2d39f51e16170bea8", size = 260348, upload-time = "2026-08-15T08:20:05.877Z" }, + { url = "https://files.pythonhosted.org/packages/d6/aa/a69a2028e8bd052476c245460ab19d7de595de084dd968f2d75cd50c3e25/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:2f293479cce755c75f1697e87c409b7ae4c555c7dfecb6e988ad13abba943031", size = 247234, upload-time = "2026-08-15T08:20:07.487Z" }, + { url = "https://files.pythonhosted.org/packages/35/8a/3d130aeabcaf3d2466af76b7b141c08d9e89c9016ab4b7cdd0f7dc2d1c62/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:3588e376b3ea2eea84976f67273d679f229e24c66dce7b82ae45aef04ff6e072", size = 256917, upload-time = "2026-08-15T08:20:09.142Z" }, + { url = "https://files.pythonhosted.org/packages/80/c2/a7379b840292d0c1ab9fbd17d1f3967aa81794dc95bc74be8999d7fedcf7/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e199fb99720074809a7720f1c0b4d919eea8b87e88713e0f8f602f7bef543d9d", size = 254846, upload-time = "2026-08-15T08:20:10.727Z" }, + { url = "https://files.pythonhosted.org/packages/01/65/d43b714731bb2f40d4053dfa00ecfc1c5a301f8e3316c5db3a09af59fe94/charset_normalizer-3.5.1-cp37-abi3-win32.whl", hash = "sha256:dd732602a7009217f658d5863d12d79d373a4de0eebc111094bcdd3bb8e0a6cc", size = 174216, upload-time = "2026-08-15T08:20:12.334Z" }, + { url = "https://files.pythonhosted.org/packages/35/4f/b911ed898b26a09789eba9c9200c999aff6c61b4bafaf4838e56d1a1e1a3/charset_normalizer-3.5.1-cp37-abi3-win_amd64.whl", hash = "sha256:70055ff39b97c99e7ae40ea3e393fb62aa2e44dbd9b29f8d14f42fb0025c3959", size = 199764, upload-time = "2026-08-15T08:20:13.908Z" }, + { url = "https://files.pythonhosted.org/packages/f0/a7/920baf467bfd9bf689f3b318340f37aee4572a71f162bd8db51da55ba4fa/charset_normalizer-3.5.1-cp37-abi3-win_arm64.whl", hash = "sha256:87e4f41d375c0b9be2fb5251aee4b8a689169e134535aed81bf085c3b647451e", size = 287318, upload-time = "2026-08-15T08:20:15.551Z" }, + { url = "https://files.pythonhosted.org/packages/cc/61/d01fc49b8dea277640b55a9e15960dbca9fdc8c9fde18e572d39c59f4019/charset_normalizer-3.5.1-py3-none-any.whl", hash = "sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6", size = 68658, upload-time = "2026-08-15T08:20:43.306Z" }, +] + +[[package]] +name = "cloudpickle" +version = "3.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/27/fb/576f067976d320f5f0114a8d9fa1215425441bb35627b1993e5afd8111e5/cloudpickle-3.1.2.tar.gz", hash = "sha256:7fda9eb655c9c230dab534f1983763de5835249750e85fbcef43aaa30a9a2414", size = 22330, upload-time = "2025-11-03T09:25:26.604Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/39/799be3f2f0f38cc727ee3b4f1445fe6d5e4133064ec2e4115069418a5bb6/cloudpickle-3.1.2-py3-none-any.whl", hash = "sha256:9acb47f6afd73f60dc1df93bb801b472f05ff42fa6c84167d25cb206be1fbf4a", size = 22228, upload-time = "2025-11-03T09:25:25.534Z" }, ] [[package]] name = "colorama" version = "0.4.6" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] [[package]] name = "coverage" version = "7.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d1/f5/deb1a27aa20746c0278ac998c4179e272004699b2d33959ce020c5ac1615/coverage-7.16.0.tar.gz", hash = "sha256:077f0964087883176ff6ab9b074694cae29f8c708273b13ca62c183c6ed716cd", size = 945620 } +sdist = { url = "https://files.pythonhosted.org/packages/d1/f5/deb1a27aa20746c0278ac998c4179e272004699b2d33959ce020c5ac1615/coverage-7.16.0.tar.gz", hash = "sha256:077f0964087883176ff6ab9b074694cae29f8c708273b13ca62c183c6ed716cd", size = 945620, upload-time = "2026-08-28T21:54:37.74Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bc/9c/8d2688694f53dc0b0f0e4783c7eb3c4bb1e79beaf1411879f6dabedf4607/coverage-7.16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d1c77c3579ac42798f8b7eed6d3dd258debacca32c8753fc8a1f6eaf1db644f5", size = 223194 }, - { url = "https://files.pythonhosted.org/packages/ca/11/f002163dd688aa3fa49ac6a424b7c2705c7fcf80fba18ec9f586d77827ca/coverage-7.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1f81cb1554c3712e41649ed5dc98656b50b958e4da12f0f5adb681ce3db92831", size = 223553 }, - { url = "https://files.pythonhosted.org/packages/81/65/f9d469e97c4554372a710650a109004a2434dfc56f577142e5d6057fa0cc/coverage-7.16.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6e701938ec9081d3e400a0c9a9a8ae0f7ca44214741daeac4454b1c6ef6dbd19", size = 255054 }, - { url = "https://files.pythonhosted.org/packages/95/29/dd89fd39af1a3b6e9a9c3eddeaf03f6376ba517d43d6cbf8b519177e2a10/coverage-7.16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:719a3feb6220dd32ed932d4c3676d17fb8739e2643b29c0e7c3af400ff80ac44", size = 257790 }, - { url = "https://files.pythonhosted.org/packages/0a/64/208d26cedc525d6b5db9c492cf9130784c42d9eb08d22badaa7b806005ad/coverage-7.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:87771ecf986cff55e87413238cd5e4f54d949c2074bd6fc1657d26a56314ee24", size = 258904 }, - { url = "https://files.pythonhosted.org/packages/1f/98/28e2752aa9a8baee5798edade9c95602ca200f4e7eeb503eb64df42e5921/coverage-7.16.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:47d5e1fc0b321c8308a2aacee0497c435b08acaa629b7059798fdf6fc3006352", size = 261165 }, - { url = "https://files.pythonhosted.org/packages/eb/77/fa6ae699a0ea2bc12acb38a85d96b786fea0f833c12b5756056350e0e547/coverage-7.16.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:01b18b8a6c9cec8d5f45550e2501426ed982cf2c35016b0acd2ba9b5d8b2fb06", size = 255416 }, - { url = "https://files.pythonhosted.org/packages/89/c8/5ee46d1de7d34cb00ba08b5c50da1971114dbc09ca9898ccc32975ec74dd/coverage-7.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:32c56b5b47c50635081445ac404dd08c2d591b9c837c22570aa9e182c3b42cd4", size = 256825 }, - { url = "https://files.pythonhosted.org/packages/15/f6/d59e1c0693ad48855fe20169fbf6ee5befefe5887a7fabf5f0bcb464a2dc/coverage-7.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:6ad3bbad240ab937512156bc944fdee63ac4dd34a7558a3094548fd4c1150c02", size = 254970 }, - { url = "https://files.pythonhosted.org/packages/df/7b/b51bbe05b3a7565927fccfb1be42b8b3c1f4ab15e53d91b303e9923969aa/coverage-7.16.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4c1f16d5555a195295d0dc9c902612270e3dfed6a11f3bf7bc470b7b6a79ed3c", size = 259039 }, - { url = "https://files.pythonhosted.org/packages/fa/04/d513f816456a8a43c1859abe88a37d01d7d2515b6c3e24ebb3c9b1dd44ec/coverage-7.16.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:f6c9c21a8bf0d19788f3c5f3e020c90317a0a63ef60521b376003801e21250fb", size = 254539 }, - { url = "https://files.pythonhosted.org/packages/dc/54/5542190ceb97e0d1333a4ce0c8f95b2ef2efe790f1ad018a4b61766f849e/coverage-7.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06f20145a9eb5bf1fd1dde3c0bc2af2e7c22135ab07ca6284d6ada7cc3904c4e", size = 256410 }, - { url = "https://files.pythonhosted.org/packages/ee/28/78643f361ff6bb5b2ade90f8bfc8395fe9ca367a18c101f8991215b4c65b/coverage-7.16.0-cp312-cp312-win32.whl", hash = "sha256:916cf8d25c1ce148f7eceb1d45afc9724841200110adc4e53250391852debd91", size = 225239 }, - { url = "https://files.pythonhosted.org/packages/67/61/8e76b36c36b1a033dc933dd2480db96b04ce3be975793ce3fad122e7174d/coverage-7.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:78f8b56261d608be102c62edd3a60b66bcd0b581f3f86fdcabaf8b8d95adc950", size = 225775 }, - { url = "https://files.pythonhosted.org/packages/c8/f3/bb4787a4b81c1792ca69b502f5f730dbbb609f73fed552ab074c6b92cb8b/coverage-7.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:577c2ac8c0036f6f8edd3a7783a9e67302b17771d1abf0fd2ed246e3158be51b", size = 225159 }, - { url = "https://files.pythonhosted.org/packages/b1/5a/234e8fadf85c3cc48cb31c247b9e8e0c7f06ece80f5b29f9b8c241f9da4c/coverage-7.16.0-py3-none-any.whl", hash = "sha256:245f7de6d023a5bba375dbec9f2e0869bfa26ac0cc639bbb7b4c814884000b73", size = 214977 }, + { url = "https://files.pythonhosted.org/packages/bc/9c/8d2688694f53dc0b0f0e4783c7eb3c4bb1e79beaf1411879f6dabedf4607/coverage-7.16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d1c77c3579ac42798f8b7eed6d3dd258debacca32c8753fc8a1f6eaf1db644f5", size = 223194, upload-time = "2026-08-28T21:51:27.767Z" }, + { url = "https://files.pythonhosted.org/packages/ca/11/f002163dd688aa3fa49ac6a424b7c2705c7fcf80fba18ec9f586d77827ca/coverage-7.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1f81cb1554c3712e41649ed5dc98656b50b958e4da12f0f5adb681ce3db92831", size = 223553, upload-time = "2026-08-28T21:51:29.46Z" }, + { url = "https://files.pythonhosted.org/packages/81/65/f9d469e97c4554372a710650a109004a2434dfc56f577142e5d6057fa0cc/coverage-7.16.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6e701938ec9081d3e400a0c9a9a8ae0f7ca44214741daeac4454b1c6ef6dbd19", size = 255054, upload-time = "2026-08-28T21:51:31.54Z" }, + { url = "https://files.pythonhosted.org/packages/95/29/dd89fd39af1a3b6e9a9c3eddeaf03f6376ba517d43d6cbf8b519177e2a10/coverage-7.16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:719a3feb6220dd32ed932d4c3676d17fb8739e2643b29c0e7c3af400ff80ac44", size = 257790, upload-time = "2026-08-28T21:51:33.374Z" }, + { url = "https://files.pythonhosted.org/packages/0a/64/208d26cedc525d6b5db9c492cf9130784c42d9eb08d22badaa7b806005ad/coverage-7.16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:87771ecf986cff55e87413238cd5e4f54d949c2074bd6fc1657d26a56314ee24", size = 258904, upload-time = "2026-08-28T21:51:35.096Z" }, + { url = "https://files.pythonhosted.org/packages/1f/98/28e2752aa9a8baee5798edade9c95602ca200f4e7eeb503eb64df42e5921/coverage-7.16.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:47d5e1fc0b321c8308a2aacee0497c435b08acaa629b7059798fdf6fc3006352", size = 261165, upload-time = "2026-08-28T21:51:36.744Z" }, + { url = "https://files.pythonhosted.org/packages/eb/77/fa6ae699a0ea2bc12acb38a85d96b786fea0f833c12b5756056350e0e547/coverage-7.16.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:01b18b8a6c9cec8d5f45550e2501426ed982cf2c35016b0acd2ba9b5d8b2fb06", size = 255416, upload-time = "2026-08-28T21:51:38.495Z" }, + { url = "https://files.pythonhosted.org/packages/89/c8/5ee46d1de7d34cb00ba08b5c50da1971114dbc09ca9898ccc32975ec74dd/coverage-7.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:32c56b5b47c50635081445ac404dd08c2d591b9c837c22570aa9e182c3b42cd4", size = 256825, upload-time = "2026-08-28T21:51:40.27Z" }, + { url = "https://files.pythonhosted.org/packages/15/f6/d59e1c0693ad48855fe20169fbf6ee5befefe5887a7fabf5f0bcb464a2dc/coverage-7.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:6ad3bbad240ab937512156bc944fdee63ac4dd34a7558a3094548fd4c1150c02", size = 254970, upload-time = "2026-08-28T21:51:43.136Z" }, + { url = "https://files.pythonhosted.org/packages/df/7b/b51bbe05b3a7565927fccfb1be42b8b3c1f4ab15e53d91b303e9923969aa/coverage-7.16.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4c1f16d5555a195295d0dc9c902612270e3dfed6a11f3bf7bc470b7b6a79ed3c", size = 259039, upload-time = "2026-08-28T21:51:44.983Z" }, + { url = "https://files.pythonhosted.org/packages/fa/04/d513f816456a8a43c1859abe88a37d01d7d2515b6c3e24ebb3c9b1dd44ec/coverage-7.16.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:f6c9c21a8bf0d19788f3c5f3e020c90317a0a63ef60521b376003801e21250fb", size = 254539, upload-time = "2026-08-28T21:51:46.733Z" }, + { url = "https://files.pythonhosted.org/packages/dc/54/5542190ceb97e0d1333a4ce0c8f95b2ef2efe790f1ad018a4b61766f849e/coverage-7.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06f20145a9eb5bf1fd1dde3c0bc2af2e7c22135ab07ca6284d6ada7cc3904c4e", size = 256410, upload-time = "2026-08-28T21:51:48.363Z" }, + { url = "https://files.pythonhosted.org/packages/ee/28/78643f361ff6bb5b2ade90f8bfc8395fe9ca367a18c101f8991215b4c65b/coverage-7.16.0-cp312-cp312-win32.whl", hash = "sha256:916cf8d25c1ce148f7eceb1d45afc9724841200110adc4e53250391852debd91", size = 225239, upload-time = "2026-08-28T21:51:50.22Z" }, + { url = "https://files.pythonhosted.org/packages/67/61/8e76b36c36b1a033dc933dd2480db96b04ce3be975793ce3fad122e7174d/coverage-7.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:78f8b56261d608be102c62edd3a60b66bcd0b581f3f86fdcabaf8b8d95adc950", size = 225775, upload-time = "2026-08-28T21:51:51.912Z" }, + { url = "https://files.pythonhosted.org/packages/c8/f3/bb4787a4b81c1792ca69b502f5f730dbbb609f73fed552ab074c6b92cb8b/coverage-7.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:577c2ac8c0036f6f8edd3a7783a9e67302b17771d1abf0fd2ed246e3158be51b", size = 225159, upload-time = "2026-08-28T21:51:53.667Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5a/234e8fadf85c3cc48cb31c247b9e8e0c7f06ece80f5b29f9b8c241f9da4c/coverage-7.16.0-py3-none-any.whl", hash = "sha256:245f7de6d023a5bba375dbec9f2e0869bfa26ac0cc639bbb7b4c814884000b73", size = 214977, upload-time = "2026-08-28T21:54:35.189Z" }, ] [[package]] @@ -214,36 +223,36 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/47/93/ac8f3d5ff04d54bc814e961a43ae5b0b146154c89c61b47bb07557679b18/cryptography-46.0.7.tar.gz", hash = "sha256:e4cfd68c5f3e0bfdad0d38e023239b96a2fe84146481852dffbcca442c245aa5", size = 750652 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/5d/4a8f770695d73be252331e60e526291e3df0c9b27556a90a6b47bccca4c2/cryptography-46.0.7-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:ea42cbe97209df307fdc3b155f1b6fa2577c0defa8f1f7d3be7d31d189108ad4", size = 7179869 }, - { url = "https://files.pythonhosted.org/packages/5f/45/6d80dc379b0bbc1f9d1e429f42e4cb9e1d319c7a8201beffd967c516ea01/cryptography-46.0.7-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b36a4695e29fe69215d75960b22577197aca3f7a25b9cf9d165dcfe9d80bc325", size = 4275492 }, - { url = "https://files.pythonhosted.org/packages/4a/9a/1765afe9f572e239c3469f2cb429f3ba7b31878c893b246b4b2994ffe2fe/cryptography-46.0.7-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5ad9ef796328c5e3c4ceed237a183f5d41d21150f972455a9d926593a1dcb308", size = 4426670 }, - { url = "https://files.pythonhosted.org/packages/8f/3e/af9246aaf23cd4ee060699adab1e47ced3f5f7e7a8ffdd339f817b446462/cryptography-46.0.7-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:73510b83623e080a2c35c62c15298096e2a5dc8d51c3b4e1740211839d0dea77", size = 4280275 }, - { url = "https://files.pythonhosted.org/packages/0f/54/6bbbfc5efe86f9d71041827b793c24811a017c6ac0fd12883e4caa86b8ed/cryptography-46.0.7-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:cbd5fb06b62bd0721e1170273d3f4d5a277044c47ca27ee257025146c34cbdd1", size = 4928402 }, - { url = "https://files.pythonhosted.org/packages/2d/cf/054b9d8220f81509939599c8bdbc0c408dbd2bdd41688616a20731371fe0/cryptography-46.0.7-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:420b1e4109cc95f0e5700eed79908cef9268265c773d3a66f7af1eef53d409ef", size = 4459985 }, - { url = "https://files.pythonhosted.org/packages/f9/46/4e4e9c6040fb01c7467d47217d2f882daddeb8828f7df800cb806d8a2288/cryptography-46.0.7-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:24402210aa54baae71d99441d15bb5a1919c195398a87b563df84468160a65de", size = 3990652 }, - { url = "https://files.pythonhosted.org/packages/36/5f/313586c3be5a2fbe87e4c9a254207b860155a8e1f3cca99f9910008e7d08/cryptography-46.0.7-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:8a469028a86f12eb7d2fe97162d0634026d92a21f3ae0ac87ed1c4a447886c83", size = 4279805 }, - { url = "https://files.pythonhosted.org/packages/69/33/60dfc4595f334a2082749673386a4d05e4f0cf4df8248e63b2c3437585f2/cryptography-46.0.7-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:9694078c5d44c157ef3162e3bf3946510b857df5a3955458381d1c7cfc143ddb", size = 4892883 }, - { url = "https://files.pythonhosted.org/packages/c7/0b/333ddab4270c4f5b972f980adef4faa66951a4aaf646ca067af597f15563/cryptography-46.0.7-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:42a1e5f98abb6391717978baf9f90dc28a743b7d9be7f0751a6f56a75d14065b", size = 4459756 }, - { url = "https://files.pythonhosted.org/packages/d2/14/633913398b43b75f1234834170947957c6b623d1701ffc7a9600da907e89/cryptography-46.0.7-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:91bbcb08347344f810cbe49065914fe048949648f6bd5c2519f34619142bbe85", size = 4410244 }, - { url = "https://files.pythonhosted.org/packages/10/f2/19ceb3b3dc14009373432af0c13f46aa08e3ce334ec6eff13492e1812ccd/cryptography-46.0.7-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:5d1c02a14ceb9148cc7816249f64f623fbfee39e8c03b3650d842ad3f34d637e", size = 4674868 }, - { url = "https://files.pythonhosted.org/packages/1a/bb/a5c213c19ee94b15dfccc48f363738633a493812687f5567addbcbba9f6f/cryptography-46.0.7-cp311-abi3-win32.whl", hash = "sha256:d23c8ca48e44ee015cd0a54aeccdf9f09004eba9fc96f38c911011d9ff1bd457", size = 3026504 }, - { url = "https://files.pythonhosted.org/packages/2b/02/7788f9fefa1d060ca68717c3901ae7fffa21ee087a90b7f23c7a603c32ae/cryptography-46.0.7-cp311-abi3-win_amd64.whl", hash = "sha256:397655da831414d165029da9bc483bed2fe0e75dde6a1523ec2fe63f3c46046b", size = 3488363 }, - { url = "https://files.pythonhosted.org/packages/a7/7f/cd42fc3614386bc0c12f0cb3c4ae1fc2bbca5c9662dfed031514911d513d/cryptography-46.0.7-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:462ad5cb1c148a22b2e3bcc5ad52504dff325d17daf5df8d88c17dda1f75f2a4", size = 7165618 }, - { url = "https://files.pythonhosted.org/packages/a5/d0/36a49f0262d2319139d2829f773f1b97ef8aef7f97e6e5bd21455e5a8fb5/cryptography-46.0.7-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:84d4cced91f0f159a7ddacad249cc077e63195c36aac40b4150e7a57e84fffe7", size = 4270628 }, - { url = "https://files.pythonhosted.org/packages/8a/6c/1a42450f464dda6ffbe578a911f773e54dd48c10f9895a23a7e88b3e7db5/cryptography-46.0.7-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:128c5edfe5e5938b86b03941e94fac9ee793a94452ad1365c9fc3f4f62216832", size = 4415405 }, - { url = "https://files.pythonhosted.org/packages/9a/92/4ed714dbe93a066dc1f4b4581a464d2d7dbec9046f7c8b7016f5286329e2/cryptography-46.0.7-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5e51be372b26ef4ba3de3c167cd3d1022934bc838ae9eaad7e644986d2a3d163", size = 4272715 }, - { url = "https://files.pythonhosted.org/packages/b7/e6/a26b84096eddd51494bba19111f8fffe976f6a09f132706f8f1bf03f51f7/cryptography-46.0.7-cp38-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:cdf1a610ef82abb396451862739e3fc93b071c844399e15b90726ef7470eeaf2", size = 4918400 }, - { url = "https://files.pythonhosted.org/packages/c7/08/ffd537b605568a148543ac3c2b239708ae0bd635064bab41359252ef88ed/cryptography-46.0.7-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1d25aee46d0c6f1a501adcddb2d2fee4b979381346a78558ed13e50aa8a59067", size = 4450634 }, - { url = "https://files.pythonhosted.org/packages/16/01/0cd51dd86ab5b9befe0d031e276510491976c3a80e9f6e31810cce46c4ad/cryptography-46.0.7-cp38-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:cdfbe22376065ffcf8be74dc9a909f032df19bc58a699456a21712d6e5eabfd0", size = 3985233 }, - { url = "https://files.pythonhosted.org/packages/92/49/819d6ed3a7d9349c2939f81b500a738cb733ab62fbecdbc1e38e83d45e12/cryptography-46.0.7-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:abad9dac36cbf55de6eb49badd4016806b3165d396f64925bf2999bcb67837ba", size = 4271955 }, - { url = "https://files.pythonhosted.org/packages/80/07/ad9b3c56ebb95ed2473d46df0847357e01583f4c52a85754d1a55e29e4d0/cryptography-46.0.7-cp38-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:935ce7e3cfdb53e3536119a542b839bb94ec1ad081013e9ab9b7cfd478b05006", size = 4879888 }, - { url = "https://files.pythonhosted.org/packages/b8/c7/201d3d58f30c4c2bdbe9b03844c291feb77c20511cc3586daf7edc12a47b/cryptography-46.0.7-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:35719dc79d4730d30f1c2b6474bd6acda36ae2dfae1e3c16f2051f215df33ce0", size = 4449961 }, - { url = "https://files.pythonhosted.org/packages/a5/ef/649750cbf96f3033c3c976e112265c33906f8e462291a33d77f90356548c/cryptography-46.0.7-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:7bbc6ccf49d05ac8f7d7b5e2e2c33830d4fe2061def88210a126d130d7f71a85", size = 4401696 }, - { url = "https://files.pythonhosted.org/packages/41/52/a8908dcb1a389a459a29008c29966c1d552588d4ae6d43f3a1a4512e0ebe/cryptography-46.0.7-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a1529d614f44b863a7b480c6d000fe93b59acee9c82ffa027cfadc77521a9f5e", size = 4664256 }, - { url = "https://files.pythonhosted.org/packages/4b/fa/f0ab06238e899cc3fb332623f337a7364f36f4bb3f2534c2bb95a35b132c/cryptography-46.0.7-cp38-abi3-win32.whl", hash = "sha256:f247c8c1a1fb45e12586afbb436ef21ff1e80670b2861a90353d9b025583d246", size = 3013001 }, - { url = "https://files.pythonhosted.org/packages/d2/f1/00ce3bde3ca542d1acd8f8cfa38e446840945aa6363f9b74746394b14127/cryptography-46.0.7-cp38-abi3-win_amd64.whl", hash = "sha256:506c4ff91eff4f82bdac7633318a526b1d1309fc07ca76a3ad182cb5b686d6d3", size = 3472985 }, +sdist = { url = "https://files.pythonhosted.org/packages/47/93/ac8f3d5ff04d54bc814e961a43ae5b0b146154c89c61b47bb07557679b18/cryptography-46.0.7.tar.gz", hash = "sha256:e4cfd68c5f3e0bfdad0d38e023239b96a2fe84146481852dffbcca442c245aa5", size = 750652, upload-time = "2026-04-08T01:57:54.692Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/5d/4a8f770695d73be252331e60e526291e3df0c9b27556a90a6b47bccca4c2/cryptography-46.0.7-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:ea42cbe97209df307fdc3b155f1b6fa2577c0defa8f1f7d3be7d31d189108ad4", size = 7179869, upload-time = "2026-04-08T01:56:17.157Z" }, + { url = "https://files.pythonhosted.org/packages/5f/45/6d80dc379b0bbc1f9d1e429f42e4cb9e1d319c7a8201beffd967c516ea01/cryptography-46.0.7-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b36a4695e29fe69215d75960b22577197aca3f7a25b9cf9d165dcfe9d80bc325", size = 4275492, upload-time = "2026-04-08T01:56:19.36Z" }, + { url = "https://files.pythonhosted.org/packages/4a/9a/1765afe9f572e239c3469f2cb429f3ba7b31878c893b246b4b2994ffe2fe/cryptography-46.0.7-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5ad9ef796328c5e3c4ceed237a183f5d41d21150f972455a9d926593a1dcb308", size = 4426670, upload-time = "2026-04-08T01:56:21.415Z" }, + { url = "https://files.pythonhosted.org/packages/8f/3e/af9246aaf23cd4ee060699adab1e47ced3f5f7e7a8ffdd339f817b446462/cryptography-46.0.7-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:73510b83623e080a2c35c62c15298096e2a5dc8d51c3b4e1740211839d0dea77", size = 4280275, upload-time = "2026-04-08T01:56:23.539Z" }, + { url = "https://files.pythonhosted.org/packages/0f/54/6bbbfc5efe86f9d71041827b793c24811a017c6ac0fd12883e4caa86b8ed/cryptography-46.0.7-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:cbd5fb06b62bd0721e1170273d3f4d5a277044c47ca27ee257025146c34cbdd1", size = 4928402, upload-time = "2026-04-08T01:56:25.624Z" }, + { url = "https://files.pythonhosted.org/packages/2d/cf/054b9d8220f81509939599c8bdbc0c408dbd2bdd41688616a20731371fe0/cryptography-46.0.7-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:420b1e4109cc95f0e5700eed79908cef9268265c773d3a66f7af1eef53d409ef", size = 4459985, upload-time = "2026-04-08T01:56:27.309Z" }, + { url = "https://files.pythonhosted.org/packages/f9/46/4e4e9c6040fb01c7467d47217d2f882daddeb8828f7df800cb806d8a2288/cryptography-46.0.7-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:24402210aa54baae71d99441d15bb5a1919c195398a87b563df84468160a65de", size = 3990652, upload-time = "2026-04-08T01:56:29.095Z" }, + { url = "https://files.pythonhosted.org/packages/36/5f/313586c3be5a2fbe87e4c9a254207b860155a8e1f3cca99f9910008e7d08/cryptography-46.0.7-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:8a469028a86f12eb7d2fe97162d0634026d92a21f3ae0ac87ed1c4a447886c83", size = 4279805, upload-time = "2026-04-08T01:56:30.928Z" }, + { url = "https://files.pythonhosted.org/packages/69/33/60dfc4595f334a2082749673386a4d05e4f0cf4df8248e63b2c3437585f2/cryptography-46.0.7-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:9694078c5d44c157ef3162e3bf3946510b857df5a3955458381d1c7cfc143ddb", size = 4892883, upload-time = "2026-04-08T01:56:32.614Z" }, + { url = "https://files.pythonhosted.org/packages/c7/0b/333ddab4270c4f5b972f980adef4faa66951a4aaf646ca067af597f15563/cryptography-46.0.7-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:42a1e5f98abb6391717978baf9f90dc28a743b7d9be7f0751a6f56a75d14065b", size = 4459756, upload-time = "2026-04-08T01:56:34.306Z" }, + { url = "https://files.pythonhosted.org/packages/d2/14/633913398b43b75f1234834170947957c6b623d1701ffc7a9600da907e89/cryptography-46.0.7-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:91bbcb08347344f810cbe49065914fe048949648f6bd5c2519f34619142bbe85", size = 4410244, upload-time = "2026-04-08T01:56:35.977Z" }, + { url = "https://files.pythonhosted.org/packages/10/f2/19ceb3b3dc14009373432af0c13f46aa08e3ce334ec6eff13492e1812ccd/cryptography-46.0.7-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:5d1c02a14ceb9148cc7816249f64f623fbfee39e8c03b3650d842ad3f34d637e", size = 4674868, upload-time = "2026-04-08T01:56:38.034Z" }, + { url = "https://files.pythonhosted.org/packages/1a/bb/a5c213c19ee94b15dfccc48f363738633a493812687f5567addbcbba9f6f/cryptography-46.0.7-cp311-abi3-win32.whl", hash = "sha256:d23c8ca48e44ee015cd0a54aeccdf9f09004eba9fc96f38c911011d9ff1bd457", size = 3026504, upload-time = "2026-04-08T01:56:39.666Z" }, + { url = "https://files.pythonhosted.org/packages/2b/02/7788f9fefa1d060ca68717c3901ae7fffa21ee087a90b7f23c7a603c32ae/cryptography-46.0.7-cp311-abi3-win_amd64.whl", hash = "sha256:397655da831414d165029da9bc483bed2fe0e75dde6a1523ec2fe63f3c46046b", size = 3488363, upload-time = "2026-04-08T01:56:41.893Z" }, + { url = "https://files.pythonhosted.org/packages/a7/7f/cd42fc3614386bc0c12f0cb3c4ae1fc2bbca5c9662dfed031514911d513d/cryptography-46.0.7-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:462ad5cb1c148a22b2e3bcc5ad52504dff325d17daf5df8d88c17dda1f75f2a4", size = 7165618, upload-time = "2026-04-08T01:57:10.645Z" }, + { url = "https://files.pythonhosted.org/packages/a5/d0/36a49f0262d2319139d2829f773f1b97ef8aef7f97e6e5bd21455e5a8fb5/cryptography-46.0.7-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:84d4cced91f0f159a7ddacad249cc077e63195c36aac40b4150e7a57e84fffe7", size = 4270628, upload-time = "2026-04-08T01:57:12.885Z" }, + { url = "https://files.pythonhosted.org/packages/8a/6c/1a42450f464dda6ffbe578a911f773e54dd48c10f9895a23a7e88b3e7db5/cryptography-46.0.7-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:128c5edfe5e5938b86b03941e94fac9ee793a94452ad1365c9fc3f4f62216832", size = 4415405, upload-time = "2026-04-08T01:57:14.923Z" }, + { url = "https://files.pythonhosted.org/packages/9a/92/4ed714dbe93a066dc1f4b4581a464d2d7dbec9046f7c8b7016f5286329e2/cryptography-46.0.7-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5e51be372b26ef4ba3de3c167cd3d1022934bc838ae9eaad7e644986d2a3d163", size = 4272715, upload-time = "2026-04-08T01:57:16.638Z" }, + { url = "https://files.pythonhosted.org/packages/b7/e6/a26b84096eddd51494bba19111f8fffe976f6a09f132706f8f1bf03f51f7/cryptography-46.0.7-cp38-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:cdf1a610ef82abb396451862739e3fc93b071c844399e15b90726ef7470eeaf2", size = 4918400, upload-time = "2026-04-08T01:57:19.021Z" }, + { url = "https://files.pythonhosted.org/packages/c7/08/ffd537b605568a148543ac3c2b239708ae0bd635064bab41359252ef88ed/cryptography-46.0.7-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1d25aee46d0c6f1a501adcddb2d2fee4b979381346a78558ed13e50aa8a59067", size = 4450634, upload-time = "2026-04-08T01:57:21.185Z" }, + { url = "https://files.pythonhosted.org/packages/16/01/0cd51dd86ab5b9befe0d031e276510491976c3a80e9f6e31810cce46c4ad/cryptography-46.0.7-cp38-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:cdfbe22376065ffcf8be74dc9a909f032df19bc58a699456a21712d6e5eabfd0", size = 3985233, upload-time = "2026-04-08T01:57:22.862Z" }, + { url = "https://files.pythonhosted.org/packages/92/49/819d6ed3a7d9349c2939f81b500a738cb733ab62fbecdbc1e38e83d45e12/cryptography-46.0.7-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:abad9dac36cbf55de6eb49badd4016806b3165d396f64925bf2999bcb67837ba", size = 4271955, upload-time = "2026-04-08T01:57:24.814Z" }, + { url = "https://files.pythonhosted.org/packages/80/07/ad9b3c56ebb95ed2473d46df0847357e01583f4c52a85754d1a55e29e4d0/cryptography-46.0.7-cp38-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:935ce7e3cfdb53e3536119a542b839bb94ec1ad081013e9ab9b7cfd478b05006", size = 4879888, upload-time = "2026-04-08T01:57:26.88Z" }, + { url = "https://files.pythonhosted.org/packages/b8/c7/201d3d58f30c4c2bdbe9b03844c291feb77c20511cc3586daf7edc12a47b/cryptography-46.0.7-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:35719dc79d4730d30f1c2b6474bd6acda36ae2dfae1e3c16f2051f215df33ce0", size = 4449961, upload-time = "2026-04-08T01:57:29.068Z" }, + { url = "https://files.pythonhosted.org/packages/a5/ef/649750cbf96f3033c3c976e112265c33906f8e462291a33d77f90356548c/cryptography-46.0.7-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:7bbc6ccf49d05ac8f7d7b5e2e2c33830d4fe2061def88210a126d130d7f71a85", size = 4401696, upload-time = "2026-04-08T01:57:31.029Z" }, + { url = "https://files.pythonhosted.org/packages/41/52/a8908dcb1a389a459a29008c29966c1d552588d4ae6d43f3a1a4512e0ebe/cryptography-46.0.7-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a1529d614f44b863a7b480c6d000fe93b59acee9c82ffa027cfadc77521a9f5e", size = 4664256, upload-time = "2026-04-08T01:57:33.144Z" }, + { url = "https://files.pythonhosted.org/packages/4b/fa/f0ab06238e899cc3fb332623f337a7364f36f4bb3f2534c2bb95a35b132c/cryptography-46.0.7-cp38-abi3-win32.whl", hash = "sha256:f247c8c1a1fb45e12586afbb436ef21ff1e80670b2861a90353d9b025583d246", size = 3013001, upload-time = "2026-04-08T01:57:34.933Z" }, + { url = "https://files.pythonhosted.org/packages/d2/f1/00ce3bde3ca542d1acd8f8cfa38e446840945aa6363f9b74746394b14127/cryptography-46.0.7-cp38-abi3-win_amd64.whl", hash = "sha256:506c4ff91eff4f82bdac7633318a526b1d1309fc07ca76a3ad182cb5b686d6d3", size = 3472985, upload-time = "2026-04-08T01:57:36.714Z" }, ] [[package]] @@ -253,54 +262,54 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "packaging" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5a/d3/8ae2869247df154b64c1884d7346d412fed0c49df84db635aab2d1c40e62/deprecation-2.1.0.tar.gz", hash = "sha256:72b3bde64e5d778694b0cf68178aed03d15e15477116add3fb773e581f9518ff", size = 173788 } +sdist = { url = "https://files.pythonhosted.org/packages/5a/d3/8ae2869247df154b64c1884d7346d412fed0c49df84db635aab2d1c40e62/deprecation-2.1.0.tar.gz", hash = "sha256:72b3bde64e5d778694b0cf68178aed03d15e15477116add3fb773e581f9518ff", size = 173788, upload-time = "2020-04-20T14:23:38.738Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/02/c3/253a89ee03fc9b9682f1541728eb66db7db22148cd94f89ab22528cd1e1b/deprecation-2.1.0-py2.py3-none-any.whl", hash = "sha256:a10811591210e1fb0e768a8c25517cabeabcba6f0bf96564f8ff45189f90b14a", size = 11178 }, + { url = "https://files.pythonhosted.org/packages/02/c3/253a89ee03fc9b9682f1541728eb66db7db22148cd94f89ab22528cd1e1b/deprecation-2.1.0-py2.py3-none-any.whl", hash = "sha256:a10811591210e1fb0e768a8c25517cabeabcba6f0bf96564f8ff45189f90b14a", size = 11178, upload-time = "2020-04-20T14:23:36.581Z" }, ] [[package]] name = "distlib" version = "0.4.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c9/02/bd72be9134d25ed783ecbbc38a539ffaefbf90c78418c7fb7229600dbac7/distlib-0.4.3.tar.gz", hash = "sha256:f152097224a0ae24be5a0f6bae1b9359af82133bce63f98a95f86cae1aede9ed", size = 615141 } +sdist = { url = "https://files.pythonhosted.org/packages/c9/02/bd72be9134d25ed783ecbbc38a539ffaefbf90c78418c7fb7229600dbac7/distlib-0.4.3.tar.gz", hash = "sha256:f152097224a0ae24be5a0f6bae1b9359af82133bce63f98a95f86cae1aede9ed", size = 615141, upload-time = "2026-06-12T08:04:52.847Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/02/08/9c41fb51ab5b43eb21674aff13df270e8ba6c4b29c8624e328dc7a9482af/distlib-0.4.3-py2.py3-none-any.whl", hash = "sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b", size = 470628 }, + { url = "https://files.pythonhosted.org/packages/02/08/9c41fb51ab5b43eb21674aff13df270e8ba6c4b29c8624e328dc7a9482af/distlib-0.4.3-py2.py3-none-any.whl", hash = "sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b", size = 470628, upload-time = "2026-06-12T08:04:50.506Z" }, ] [[package]] name = "distro" version = "1.9.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722 } +sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722, upload-time = "2023-12-24T09:54:32.31Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277 }, + { url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277, upload-time = "2023-12-24T09:54:30.421Z" }, ] [[package]] name = "dnspython" version = "2.8.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251 } +sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094 }, + { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" }, ] [[package]] name = "filelock" version = "3.32.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6d/30/03b03951873a1a0ffc7e8ca0e10c15597b59e8d0e39260704cd2ea087bc4/filelock-3.32.4.tar.gz", hash = "sha256:2bde2e4cf732e0153406d8a7bc80620ecf5e621fe0d25e41143c4e3b4733ff30", size = 222126 } +sdist = { url = "https://files.pythonhosted.org/packages/6d/30/03b03951873a1a0ffc7e8ca0e10c15597b59e8d0e39260704cd2ea087bc4/filelock-3.32.4.tar.gz", hash = "sha256:2bde2e4cf732e0153406d8a7bc80620ecf5e621fe0d25e41143c4e3b4733ff30", size = 222126, upload-time = "2026-08-23T17:37:55.363Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/01/a4/9b63d595d748e3aff8812b65eacc1a2c4bd90b7c2012e08e72373b4835eb/filelock-3.32.4-py3-none-any.whl", hash = "sha256:22e58ca3b1ae3b98993b762d7338367ae64fe50252bf78d59da3bfebcdf1cedd", size = 99864 }, + { url = "https://files.pythonhosted.org/packages/01/a4/9b63d595d748e3aff8812b65eacc1a2c4bd90b7c2012e08e72373b4835eb/filelock-3.32.4-py3-none-any.whl", hash = "sha256:22e58ca3b1ae3b98993b762d7338367ae64fe50252bf78d59da3bfebcdf1cedd", size = 99864, upload-time = "2026-08-23T17:37:53.913Z" }, ] [[package]] name = "h11" version = "0.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250 } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515 }, + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, ] [[package]] @@ -311,18 +320,18 @@ dependencies = [ { name = "hpack" }, { name = "hyperframe" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e7/85/7c366e69d84c17bb778fe41419e1fbcce3033d5b7ce29bbffff0a98b859f/h2-4.4.1.tar.gz", hash = "sha256:4e866ffb1a869ae14dd9b5e6beb5c24a13da0495ad72b65925ded182521c1516", size = 2157281 } +sdist = { url = "https://files.pythonhosted.org/packages/e7/85/7c366e69d84c17bb778fe41419e1fbcce3033d5b7ce29bbffff0a98b859f/h2-4.4.1.tar.gz", hash = "sha256:4e866ffb1a869ae14dd9b5e6beb5c24a13da0495ad72b65925ded182521c1516", size = 2157281, upload-time = "2026-08-03T11:45:09.509Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/22/e85faf23bd72a92d1921e37d674ca56eb298a3c8be31fdecef0ff2b3aaac/h2-4.4.1-py3-none-any.whl", hash = "sha256:0e25f1462b23c9cb82d9eb02e28bc706dac2a68cb457c6a0d74d63c8a2a5d0e6", size = 62636 }, + { url = "https://files.pythonhosted.org/packages/7e/22/e85faf23bd72a92d1921e37d674ca56eb298a3c8be31fdecef0ff2b3aaac/h2-4.4.1-py3-none-any.whl", hash = "sha256:0e25f1462b23c9cb82d9eb02e28bc706dac2a68cb457c6a0d74d63c8a2a5d0e6", size = 62636, upload-time = "2026-08-03T11:44:59.164Z" }, ] [[package]] name = "hpack" version = "4.2.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/26/5b/fcabf6028144a8723726318b07a32c2f3314acdff6265743cf08a344b18e/hpack-4.2.0.tar.gz", hash = "sha256:0895cfa3b5531fc65fe439c05eb65144f123bf7a394fcaa56aa423548d8e45c0", size = 51300 } +sdist = { url = "https://files.pythonhosted.org/packages/26/5b/fcabf6028144a8723726318b07a32c2f3314acdff6265743cf08a344b18e/hpack-4.2.0.tar.gz", hash = "sha256:0895cfa3b5531fc65fe439c05eb65144f123bf7a394fcaa56aa423548d8e45c0", size = 51300, upload-time = "2026-06-23T18:34:46.667Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/71/b4/4a9fcfb2aef6ba44d9073ecd301443aa00b3dac95de5619f2a7de7ec8a91/hpack-4.2.0-py3-none-any.whl", hash = "sha256:858ac0b02280fa582b5080d68db0899c62a80375e0e5413a74970c5e518b6986", size = 34246 }, + { url = "https://files.pythonhosted.org/packages/71/b4/4a9fcfb2aef6ba44d9073ecd301443aa00b3dac95de5619f2a7de7ec8a91/hpack-4.2.0-py3-none-any.whl", hash = "sha256:858ac0b02280fa582b5080d68db0899c62a80375e0e5413a74970c5e518b6986", size = 34246, upload-time = "2026-06-23T18:34:45.472Z" }, ] [[package]] @@ -333,9 +342,9 @@ dependencies = [ { name = "certifi" }, { name = "h11" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484 } +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784 }, + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, ] [[package]] @@ -348,9 +357,9 @@ dependencies = [ { name = "httpcore" }, { name = "idna" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406 } +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517 }, + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, ] [package.optional-dependencies] @@ -362,45 +371,57 @@ http2 = [ name = "hyperframe" version = "6.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/02/e7/94f8232d4a74cc99514c13a9f995811485a6903d48e5d952771ef6322e30/hyperframe-6.1.0.tar.gz", hash = "sha256:f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08", size = 26566 } +sdist = { url = "https://files.pythonhosted.org/packages/02/e7/94f8232d4a74cc99514c13a9f995811485a6903d48e5d952771ef6322e30/hyperframe-6.1.0.tar.gz", hash = "sha256:f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08", size = 26566, upload-time = "2025-01-22T21:41:49.302Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/48/30/47d0bf6072f7252e6521f3447ccfa40b421b6824517f82854703d0f5a98b/hyperframe-6.1.0-py3-none-any.whl", hash = "sha256:b03380493a519fce58ea5af42e4a42317bf9bd425596f7a0835ffce80f1a42e5", size = 13007 }, + { url = "https://files.pythonhosted.org/packages/48/30/47d0bf6072f7252e6521f3447ccfa40b421b6824517f82854703d0f5a98b/hyperframe-6.1.0-py3-none-any.whl", hash = "sha256:b03380493a519fce58ea5af42e4a42317bf9bd425596f7a0835ffce80f1a42e5", size = 13007, upload-time = "2025-01-22T21:41:47.295Z" }, ] [[package]] name = "identify" version = "2.6.19" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/52/63/51723b5f116cc04b061cb6f5a561790abf249d25931d515cd375e063e0f4/identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842", size = 99567 } +sdist = { url = "https://files.pythonhosted.org/packages/52/63/51723b5f116cc04b061cb6f5a561790abf249d25931d515cd375e063e0f4/identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842", size = 99567, upload-time = "2026-04-17T18:39:50.265Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/94/84/d9273cd09688070a6523c4aee4663a8538721b2b755c4962aafae0011e72/identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a", size = 99397 }, + { url = "https://files.pythonhosted.org/packages/94/84/d9273cd09688070a6523c4aee4663a8538721b2b755c4962aafae0011e72/identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a", size = 99397, upload-time = "2026-04-17T18:39:49.221Z" }, ] [[package]] name = "idna" version = "3.19" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5f/f7/abb373e5757eaec4b922b92f97ec8d6d7e057cf06778247604fbc4e7c3f3/idna-3.19.tar.gz", hash = "sha256:5e0811a4383b21dc5838069f801c4fb62113b7447663d2530d2bd6e77b49bf15", size = 215237 } +sdist = { url = "https://files.pythonhosted.org/packages/5f/f7/abb373e5757eaec4b922b92f97ec8d6d7e057cf06778247604fbc4e7c3f3/idna-3.19.tar.gz", hash = "sha256:5e0811a4383b21dc5838069f801c4fb62113b7447663d2530d2bd6e77b49bf15", size = 215237, upload-time = "2026-08-18T05:14:24.27Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/57/b0/0e52c878c53f245edd3a11020f20979b3f490f245af532c7cae3027754b5/idna-3.19-py3-none-any.whl", hash = "sha256:815e7be7a7806d54abb586dc943addc79e8b2ee16915059658cbeff4b1b43bf4", size = 68550 }, + { url = "https://files.pythonhosted.org/packages/57/b0/0e52c878c53f245edd3a11020f20979b3f490f245af532c7cae3027754b5/idna-3.19-py3-none-any.whl", hash = "sha256:815e7be7a7806d54abb586dc943addc79e8b2ee16915059658cbeff4b1b43bf4", size = 68550, upload-time = "2026-08-18T05:14:22.343Z" }, ] [[package]] name = "iniconfig" version = "2.3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503 } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484 }, + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] [[package]] name = "jmespath" version = "1.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d3/59/322338183ecda247fb5d1763a6cbe46eff7222eaeebafd9fa65d4bf5cb11/jmespath-1.1.0.tar.gz", hash = "sha256:472c87d80f36026ae83c6ddd0f1d05d4e510134ed462851fd5f754c8c3cbb88d", size = 27377 } +sdist = { url = "https://files.pythonhosted.org/packages/d3/59/322338183ecda247fb5d1763a6cbe46eff7222eaeebafd9fa65d4bf5cb11/jmespath-1.1.0.tar.gz", hash = "sha256:472c87d80f36026ae83c6ddd0f1d05d4e510134ed462851fd5f754c8c3cbb88d", size = 27377, upload-time = "2026-01-22T16:35:26.279Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/14/2f/967ba146e6d58cf6a652da73885f52fc68001525b4197effc174321d70b4/jmespath-1.1.0-py3-none-any.whl", hash = "sha256:a5663118de4908c91729bea0acadca56526eb2698e83de10cd116ae0f4e97c64", size = 20419 }, + { url = "https://files.pythonhosted.org/packages/14/2f/967ba146e6d58cf6a652da73885f52fc68001525b4197effc174321d70b4/jmespath-1.1.0-py3-none-any.whl", hash = "sha256:a5663118de4908c91729bea0acadca56526eb2698e83de10cd116ae0f4e97c64", size = 20419, upload-time = "2026-01-22T16:35:24.919Z" }, +] + +[[package]] +name = "joblib" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cloudpickle" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d5/1d/537ab090f302b838943a1b56497dd53059b9a9b46a074936470173a2e207/joblib-1.6.0.tar.gz", hash = "sha256:2ccc96785b12046c08fd6d55839c12857831b54a3c1673ffadd2f04bfc4eda03", size = 327903, upload-time = "2026-08-31T09:39:04.122Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/53/84099323c2ec4be98d935f63c033ac4151ee83836ca1050ede3b3aadf155/joblib-1.6.0-py3-none-any.whl", hash = "sha256:3dbbf9f6e4b592a2357b854608e980fe6390d131d7a82f011a377ef2ebef7aba", size = 306115, upload-time = "2026-08-31T09:39:02.298Z" }, ] [[package]] @@ -410,94 +431,103 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "packaging" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/55/79/de6c16cc902f4fc372236926b0ce2ab7845268dcc30fb2fbb7f71b418631/marshmallow-3.26.2.tar.gz", hash = "sha256:bbe2adb5a03e6e3571b573f42527c6fe926e17467833660bebd11593ab8dfd57", size = 222095 } +sdist = { url = "https://files.pythonhosted.org/packages/55/79/de6c16cc902f4fc372236926b0ce2ab7845268dcc30fb2fbb7f71b418631/marshmallow-3.26.2.tar.gz", hash = "sha256:bbe2adb5a03e6e3571b573f42527c6fe926e17467833660bebd11593ab8dfd57", size = 222095, upload-time = "2025-12-22T06:53:53.309Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/be/2f/5108cb3ee4ba6501748c4908b908e55f42a5b66245b4cfe0c99326e1ef6e/marshmallow-3.26.2-py3-none-any.whl", hash = "sha256:013fa8a3c4c276c24d26d84ce934dc964e2aa794345a0f8c7e5a7191482c8a73", size = 50964 }, + { url = "https://files.pythonhosted.org/packages/be/2f/5108cb3ee4ba6501748c4908b908e55f42a5b66245b4cfe0c99326e1ef6e/marshmallow-3.26.2-py3-none-any.whl", hash = "sha256:013fa8a3c4c276c24d26d84ce934dc964e2aa794345a0f8c7e5a7191482c8a73", size = 50964, upload-time = "2025-12-22T06:53:51.801Z" }, ] [[package]] name = "maturin" version = "1.15.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b9/c8/22e5e21b2679c9bce6415ca578034ca2cc9316be0642ae21e051a2d5198c/maturin-1.15.0.tar.gz", hash = "sha256:94b26cc8e8aba61a5f2099715fe640e18c5f678e9a500408b38761263954228a", size = 385504 } +sdist = { url = "https://files.pythonhosted.org/packages/b9/c8/22e5e21b2679c9bce6415ca578034ca2cc9316be0642ae21e051a2d5198c/maturin-1.15.0.tar.gz", hash = "sha256:94b26cc8e8aba61a5f2099715fe640e18c5f678e9a500408b38761263954228a", size = 385504, upload-time = "2026-08-24T12:11:22.665Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/14/69/5c01b461044eb1f45ddcce006706eb88110c793cdb11c7ae0b5e08492e94/maturin-1.15.0-py3-none-linux_armv6l.whl", hash = "sha256:6bf6dc62e22d4dcfd5a51244ff0d58975fa4979c48209fe84159617648956d82", size = 10206220 }, - { url = "https://files.pythonhosted.org/packages/eb/1f/2b431554e11687cdb1077e0cdadcc118c53f611086b3af00c8545a67c6a5/maturin-1.15.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:cd35772633f489841132bc8e71d6fc7f842df30b9c05cd5cdf1ee1ddcb744cc7", size = 19416513 }, - { url = "https://files.pythonhosted.org/packages/51/36/e23a21cb34a648b711036b9b2fe1d4f3f4ee24f8db54215d73f1a9a3a3ec/maturin-1.15.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:c40b4eae7bf5ef1f4b1af8d623fe4105016f93578fb15b764e741d08ec3b92dd", size = 10014962 }, - { url = "https://files.pythonhosted.org/packages/8c/80/33b15cb2d8f30f12c807955e8f2fd775027692904e30ec0784744ce8cd83/maturin-1.15.0-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:7eb066372f541f8eb4909c79c5d9bd0b9e8125980bdf1ec9e8aba23c6c8d6c55", size = 10196223 }, - { url = "https://files.pythonhosted.org/packages/fe/91/b495e19e2f5c503b540452b2039115e7b2363867e8c5ad4179eb752fa92c/maturin-1.15.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:653020a63525bb224e5ab0adf02e17a2e08bc86dbea7fc1399c9a56d7529b99e", size = 10541186 }, - { url = "https://files.pythonhosted.org/packages/5d/2b/2abff58037188d852b124871b1f0d720e1c2bfb3d4f1b03d87c52cd66488/maturin-1.15.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:0ebf9767892725083138e671c34482c660317a2f3d6a29fc0e0f34e9d8c99136", size = 10083468 }, - { url = "https://files.pythonhosted.org/packages/3f/07/b7e9f8be99a6627849e81ac7b6694876bce8f50a92995fe17e3cf2610f0a/maturin-1.15.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:7ab7eebffd7b8debca2265985de4eaeb332141276d24b9560b5ad484d4b3add1", size = 10047786 }, - { url = "https://files.pythonhosted.org/packages/ca/ab/167e3cb7accee11b507dbe53e0e87aeccb376d44ae66284c96ee4df3a9fd/maturin-1.15.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:126e12e618b4db42f68c779a56d41f82a390145ba36ac3f621d057eb34f5ad9d", size = 13315332 }, - { url = "https://files.pythonhosted.org/packages/14/4d/801379f646cbc6b00998e5289b0630a886be3a4ee4c75b6bc9b87478a7f1/maturin-1.15.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4f9d33e6c3f9615c8caceecbbbd440f8eb25a3ddeb687077682cd5eca2e9ae15", size = 10807183 }, - { url = "https://files.pythonhosted.org/packages/89/27/2e612e1cbd1580e9e94d4722c227b5180dca27b32b955a34b79918aa1292/maturin-1.15.0-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:bf29beddd0c6708f112db51d5275fc28b28b9e9c9c5faae387eaef662918b176", size = 10413274 }, - { url = "https://files.pythonhosted.org/packages/70/d8/202a7b4d75a51f20f84ec9ce3b7345b12b822207072164e2b1c6ef665125/maturin-1.15.0-py3-none-win32.whl", hash = "sha256:da649988be98e87e009e51b1bf0d301b6a301bc0cecbdd60d40d8ba60748d1ca", size = 8928744 }, - { url = "https://files.pythonhosted.org/packages/40/dc/4e90da594986ba78dd3bc8a5921ecdcdb11085b22b02a412caab3b225601/maturin-1.15.0-py3-none-win_amd64.whl", hash = "sha256:552c2be4afd43fe8d5c9f3ec8d4c4756d973b8dcbe94c14084390301f50243e1", size = 10335085 }, - { url = "https://files.pythonhosted.org/packages/8b/10/15d4314edf130955edf2dc237aa393a8a7c10f2b9b57b89fa2f61f915659/maturin-1.15.0-py3-none-win_arm64.whl", hash = "sha256:c7dc0c66c78d3debdd9c5aa807e861fbcbf07f3505d34b125df74c03986b0f48", size = 9713795 }, + { url = "https://files.pythonhosted.org/packages/14/69/5c01b461044eb1f45ddcce006706eb88110c793cdb11c7ae0b5e08492e94/maturin-1.15.0-py3-none-linux_armv6l.whl", hash = "sha256:6bf6dc62e22d4dcfd5a51244ff0d58975fa4979c48209fe84159617648956d82", size = 10206220, upload-time = "2026-08-24T12:10:53.327Z" }, + { url = "https://files.pythonhosted.org/packages/eb/1f/2b431554e11687cdb1077e0cdadcc118c53f611086b3af00c8545a67c6a5/maturin-1.15.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:cd35772633f489841132bc8e71d6fc7f842df30b9c05cd5cdf1ee1ddcb744cc7", size = 19416513, upload-time = "2026-08-24T12:10:56.126Z" }, + { url = "https://files.pythonhosted.org/packages/51/36/e23a21cb34a648b711036b9b2fe1d4f3f4ee24f8db54215d73f1a9a3a3ec/maturin-1.15.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:c40b4eae7bf5ef1f4b1af8d623fe4105016f93578fb15b764e741d08ec3b92dd", size = 10014962, upload-time = "2026-08-24T12:10:58.486Z" }, + { url = "https://files.pythonhosted.org/packages/8c/80/33b15cb2d8f30f12c807955e8f2fd775027692904e30ec0784744ce8cd83/maturin-1.15.0-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:7eb066372f541f8eb4909c79c5d9bd0b9e8125980bdf1ec9e8aba23c6c8d6c55", size = 10196223, upload-time = "2026-08-24T12:11:00.696Z" }, + { url = "https://files.pythonhosted.org/packages/fe/91/b495e19e2f5c503b540452b2039115e7b2363867e8c5ad4179eb752fa92c/maturin-1.15.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:653020a63525bb224e5ab0adf02e17a2e08bc86dbea7fc1399c9a56d7529b99e", size = 10541186, upload-time = "2026-08-24T12:11:02.857Z" }, + { url = "https://files.pythonhosted.org/packages/5d/2b/2abff58037188d852b124871b1f0d720e1c2bfb3d4f1b03d87c52cd66488/maturin-1.15.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:0ebf9767892725083138e671c34482c660317a2f3d6a29fc0e0f34e9d8c99136", size = 10083468, upload-time = "2026-08-24T12:11:05.012Z" }, + { url = "https://files.pythonhosted.org/packages/3f/07/b7e9f8be99a6627849e81ac7b6694876bce8f50a92995fe17e3cf2610f0a/maturin-1.15.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:7ab7eebffd7b8debca2265985de4eaeb332141276d24b9560b5ad484d4b3add1", size = 10047786, upload-time = "2026-08-24T12:11:07.042Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ab/167e3cb7accee11b507dbe53e0e87aeccb376d44ae66284c96ee4df3a9fd/maturin-1.15.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:126e12e618b4db42f68c779a56d41f82a390145ba36ac3f621d057eb34f5ad9d", size = 13315332, upload-time = "2026-08-24T12:11:09.433Z" }, + { url = "https://files.pythonhosted.org/packages/14/4d/801379f646cbc6b00998e5289b0630a886be3a4ee4c75b6bc9b87478a7f1/maturin-1.15.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4f9d33e6c3f9615c8caceecbbbd440f8eb25a3ddeb687077682cd5eca2e9ae15", size = 10807183, upload-time = "2026-08-24T12:11:11.73Z" }, + { url = "https://files.pythonhosted.org/packages/89/27/2e612e1cbd1580e9e94d4722c227b5180dca27b32b955a34b79918aa1292/maturin-1.15.0-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:bf29beddd0c6708f112db51d5275fc28b28b9e9c9c5faae387eaef662918b176", size = 10413274, upload-time = "2026-08-24T12:11:14.04Z" }, + { url = "https://files.pythonhosted.org/packages/70/d8/202a7b4d75a51f20f84ec9ce3b7345b12b822207072164e2b1c6ef665125/maturin-1.15.0-py3-none-win32.whl", hash = "sha256:da649988be98e87e009e51b1bf0d301b6a301bc0cecbdd60d40d8ba60748d1ca", size = 8928744, upload-time = "2026-08-24T12:11:16.269Z" }, + { url = "https://files.pythonhosted.org/packages/40/dc/4e90da594986ba78dd3bc8a5921ecdcdb11085b22b02a412caab3b225601/maturin-1.15.0-py3-none-win_amd64.whl", hash = "sha256:552c2be4afd43fe8d5c9f3ec8d4c4756d973b8dcbe94c14084390301f50243e1", size = 10335085, upload-time = "2026-08-24T12:11:18.326Z" }, + { url = "https://files.pythonhosted.org/packages/8b/10/15d4314edf130955edf2dc237aa393a8a7c10f2b9b57b89fa2f61f915659/maturin-1.15.0-py3-none-win_arm64.whl", hash = "sha256:c7dc0c66c78d3debdd9c5aa807e861fbcbf07f3505d34b125df74c03986b0f48", size = 9713795, upload-time = "2026-08-24T12:11:20.83Z" }, ] [[package]] name = "multidict" version = "6.7.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1a/c2/c2d94cbe6ac1753f3fc980da97b3d930efe1da3af3c9f5125354436c073d/multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d", size = 102010 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/8d/9c/f20e0e2cf80e4b2e4b1c365bf5fe104ee633c751a724246262db8f1a0b13/multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172", size = 76893 }, - { url = "https://files.pythonhosted.org/packages/fe/cf/18ef143a81610136d3da8193da9d80bfe1cb548a1e2d1c775f26b23d024a/multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd", size = 45456 }, - { url = "https://files.pythonhosted.org/packages/a9/65/1caac9d4cd32e8433908683446eebc953e82d22b03d10d41a5f0fefe991b/multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7", size = 43872 }, - { url = "https://files.pythonhosted.org/packages/cf/3b/d6bd75dc4f3ff7c73766e04e705b00ed6dbbaccf670d9e05a12b006f5a21/multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53", size = 251018 }, - { url = "https://files.pythonhosted.org/packages/fd/80/c959c5933adedb9ac15152e4067c702a808ea183a8b64cf8f31af8ad3155/multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75", size = 258883 }, - { url = "https://files.pythonhosted.org/packages/86/85/7ed40adafea3d4f1c8b916e3b5cc3a8e07dfcdcb9cd72800f4ed3ca1b387/multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b", size = 242413 }, - { url = "https://files.pythonhosted.org/packages/d2/57/b8565ff533e48595503c785f8361ff9a4fde4d67de25c207cd0ba3befd03/multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733", size = 268404 }, - { url = "https://files.pythonhosted.org/packages/e0/50/9810c5c29350f7258180dfdcb2e52783a0632862eb334c4896ac717cebcb/multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a", size = 269456 }, - { url = "https://files.pythonhosted.org/packages/f3/8d/5e5be3ced1d12966fefb5c4ea3b2a5b480afcea36406559442c6e31d4a48/multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961", size = 256322 }, - { url = "https://files.pythonhosted.org/packages/31/6e/d8a26d81ac166a5592782d208dd90dfdc0a7a218adaa52b45a672b46c122/multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582", size = 253955 }, - { url = "https://files.pythonhosted.org/packages/59/4c/7c672c8aad41534ba619bcd4ade7a0dc87ed6b8b5c06149b85d3dd03f0cd/multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e", size = 251254 }, - { url = "https://files.pythonhosted.org/packages/7b/bd/84c24de512cbafbdbc39439f74e967f19570ce7924e3007174a29c348916/multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3", size = 252059 }, - { url = "https://files.pythonhosted.org/packages/fa/ba/f5449385510825b73d01c2d4087bf6d2fccc20a2d42ac34df93191d3dd03/multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6", size = 263588 }, - { url = "https://files.pythonhosted.org/packages/d7/11/afc7c677f68f75c84a69fe37184f0f82fce13ce4b92f49f3db280b7e92b3/multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a", size = 259642 }, - { url = "https://files.pythonhosted.org/packages/2b/17/ebb9644da78c4ab36403739e0e6e0e30ebb135b9caf3440825001a0bddcb/multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba", size = 251377 }, - { url = "https://files.pythonhosted.org/packages/ca/a4/840f5b97339e27846c46307f2530a2805d9d537d8b8bd416af031cad7fa0/multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511", size = 41887 }, - { url = "https://files.pythonhosted.org/packages/80/31/0b2517913687895f5904325c2069d6a3b78f66cc641a86a2baf75a05dcbb/multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19", size = 46053 }, - { url = "https://files.pythonhosted.org/packages/0c/5b/aba28e4ee4006ae4c7df8d327d31025d760ffa992ea23812a601d226e682/multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf", size = 43307 }, - { url = "https://files.pythonhosted.org/packages/81/08/7036c080d7117f28a4af526d794aab6a84463126db031b007717c1a6676e/multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56", size = 12319 }, +sdist = { url = "https://files.pythonhosted.org/packages/1a/c2/c2d94cbe6ac1753f3fc980da97b3d930efe1da3af3c9f5125354436c073d/multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d", size = 102010, upload-time = "2026-01-26T02:46:45.979Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8d/9c/f20e0e2cf80e4b2e4b1c365bf5fe104ee633c751a724246262db8f1a0b13/multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172", size = 76893, upload-time = "2026-01-26T02:43:52.754Z" }, + { url = "https://files.pythonhosted.org/packages/fe/cf/18ef143a81610136d3da8193da9d80bfe1cb548a1e2d1c775f26b23d024a/multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd", size = 45456, upload-time = "2026-01-26T02:43:53.893Z" }, + { url = "https://files.pythonhosted.org/packages/a9/65/1caac9d4cd32e8433908683446eebc953e82d22b03d10d41a5f0fefe991b/multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7", size = 43872, upload-time = "2026-01-26T02:43:55.041Z" }, + { url = "https://files.pythonhosted.org/packages/cf/3b/d6bd75dc4f3ff7c73766e04e705b00ed6dbbaccf670d9e05a12b006f5a21/multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53", size = 251018, upload-time = "2026-01-26T02:43:56.198Z" }, + { url = "https://files.pythonhosted.org/packages/fd/80/c959c5933adedb9ac15152e4067c702a808ea183a8b64cf8f31af8ad3155/multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75", size = 258883, upload-time = "2026-01-26T02:43:57.499Z" }, + { url = "https://files.pythonhosted.org/packages/86/85/7ed40adafea3d4f1c8b916e3b5cc3a8e07dfcdcb9cd72800f4ed3ca1b387/multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b", size = 242413, upload-time = "2026-01-26T02:43:58.755Z" }, + { url = "https://files.pythonhosted.org/packages/d2/57/b8565ff533e48595503c785f8361ff9a4fde4d67de25c207cd0ba3befd03/multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733", size = 268404, upload-time = "2026-01-26T02:44:00.216Z" }, + { url = "https://files.pythonhosted.org/packages/e0/50/9810c5c29350f7258180dfdcb2e52783a0632862eb334c4896ac717cebcb/multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a", size = 269456, upload-time = "2026-01-26T02:44:02.202Z" }, + { url = "https://files.pythonhosted.org/packages/f3/8d/5e5be3ced1d12966fefb5c4ea3b2a5b480afcea36406559442c6e31d4a48/multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961", size = 256322, upload-time = "2026-01-26T02:44:03.56Z" }, + { url = "https://files.pythonhosted.org/packages/31/6e/d8a26d81ac166a5592782d208dd90dfdc0a7a218adaa52b45a672b46c122/multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582", size = 253955, upload-time = "2026-01-26T02:44:04.845Z" }, + { url = "https://files.pythonhosted.org/packages/59/4c/7c672c8aad41534ba619bcd4ade7a0dc87ed6b8b5c06149b85d3dd03f0cd/multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e", size = 251254, upload-time = "2026-01-26T02:44:06.133Z" }, + { url = "https://files.pythonhosted.org/packages/7b/bd/84c24de512cbafbdbc39439f74e967f19570ce7924e3007174a29c348916/multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3", size = 252059, upload-time = "2026-01-26T02:44:07.518Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/f5449385510825b73d01c2d4087bf6d2fccc20a2d42ac34df93191d3dd03/multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6", size = 263588, upload-time = "2026-01-26T02:44:09.382Z" }, + { url = "https://files.pythonhosted.org/packages/d7/11/afc7c677f68f75c84a69fe37184f0f82fce13ce4b92f49f3db280b7e92b3/multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a", size = 259642, upload-time = "2026-01-26T02:44:10.73Z" }, + { url = "https://files.pythonhosted.org/packages/2b/17/ebb9644da78c4ab36403739e0e6e0e30ebb135b9caf3440825001a0bddcb/multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba", size = 251377, upload-time = "2026-01-26T02:44:12.042Z" }, + { url = "https://files.pythonhosted.org/packages/ca/a4/840f5b97339e27846c46307f2530a2805d9d537d8b8bd416af031cad7fa0/multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511", size = 41887, upload-time = "2026-01-26T02:44:14.245Z" }, + { url = "https://files.pythonhosted.org/packages/80/31/0b2517913687895f5904325c2069d6a3b78f66cc641a86a2baf75a05dcbb/multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19", size = 46053, upload-time = "2026-01-26T02:44:15.371Z" }, + { url = "https://files.pythonhosted.org/packages/0c/5b/aba28e4ee4006ae4c7df8d327d31025d760ffa992ea23812a601d226e682/multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf", size = 43307, upload-time = "2026-01-26T02:44:16.852Z" }, + { url = "https://files.pythonhosted.org/packages/81/08/7036c080d7117f28a4af526d794aab6a84463126db031b007717c1a6676e/multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56", size = 12319, upload-time = "2026-01-26T02:46:44.004Z" }, +] + +[[package]] +name = "narwhals" +version = "2.27.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/21/f64d6b2dbea7bf3f8c38cdc786dcc6ef012ca3d173ad208c782c9a7bedf6/narwhals-2.27.1.tar.gz", hash = "sha256:aed93076a3ea42d9c32c88e4eb5ea422a21937011cbe1f480f9572a523c82094", size = 735013, upload-time = "2026-10-10T06:52:18.113Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/89/5d4c86da1130d9059681e5b6cd7645df5c10279a6a079c5c37dcb2cc6f3f/narwhals-2.27.1-py3-none-any.whl", hash = "sha256:d057df13f5852b8e157596e82eb5e955fad267425df5e420e0ee9863da483b31", size = 483211, upload-time = "2026-10-10T06:52:16.32Z" }, ] [[package]] name = "nodeenv" version = "1.10.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611 } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438 }, + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, ] [[package]] name = "numpy" version = "2.5.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/9a/80/db0b4559e57ec36362bedbb05530a87fafbcb6067708c946967a41d449e7/numpy-2.5.2.tar.gz", hash = "sha256:d482d171c406ae88c5b19cad3b6a1c4c5209f886ab74bc44c2c865c23f52d860", size = 20773161 } +sdist = { url = "https://files.pythonhosted.org/packages/9a/80/db0b4559e57ec36362bedbb05530a87fafbcb6067708c946967a41d449e7/numpy-2.5.2.tar.gz", hash = "sha256:d482d171c406ae88c5b19cad3b6a1c4c5209f886ab74bc44c2c865c23f52d860", size = 20773161, upload-time = "2026-08-09T13:48:27.962Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/69/72/dccb0aaf40972777283303919f613964227266d0c13adebb79ac124f1c3e/numpy-2.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:14e373cfc6387177e8409dac3c7159be8eb05cd77096cd7c950268b86f62831c", size = 16891693 }, - { url = "https://files.pythonhosted.org/packages/60/2e/b5aee50a1f74ac815cf8331812cb8251e29024025de462e0c047641c614c/numpy-2.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4bbd96c833ecc8cc069ce518078fc8c60cb9cbfb0fea5b7a803ad65035596d03", size = 11903109 }, - { url = "https://files.pythonhosted.org/packages/f3/f4/29e78102a80601cf034d4e9767022cffeca2c3b4c926e1754572ca95593d/numpy-2.5.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:6e8172ddfcf5cf74b811d372b570b83c60bd2de87a6fbfbebdadb4a9bd9c6cbb", size = 5350202 }, - { url = "https://files.pythonhosted.org/packages/11/4b/dcd3b7eadaf4035d2c7a4289d232523a6964f602598ef7674e4bd7291f93/numpy-2.5.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:65f188481f1669e26f62b701e8205d19e460fa4a9b52a1414ba382330e4a3414", size = 6687736 }, - { url = "https://files.pythonhosted.org/packages/e5/21/4947e0e9d6c9fc2e2ff15b8949049ee44f63adb9cacc729ab8793f97e712/numpy-2.5.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8ee9c4eeb8454b3660a8b53493563c3e121c2fc94fbd72b848ef814ed7b676a9", size = 15612696 }, - { url = "https://files.pythonhosted.org/packages/3a/5f/62d28cf019460c7f1394105b4d49d9911a9c444cb77ab0bd95a204c5a6de/numpy-2.5.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3cdec01fa790a186d430433fdd4d4ffb70eed6f0eeb4bf05c8dbe2dce0a9bcb8", size = 16722264 }, - { url = "https://files.pythonhosted.org/packages/14/25/3f0be4c1b9fdf5dd5e708a6806978564d7c46a055c000496309ff2a2f8af/numpy-2.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7999d4ddb0c4025018373fd787510d46e04c769467af22869707b3c1cfd459ab", size = 16974396 }, - { url = "https://files.pythonhosted.org/packages/22/72/6262cbdeeb45da9d971e40715f579d791603ba8ec0b5e2db1ac55454421d/numpy-2.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c1f017dc0875c9209d219f97feceb7d54c2661bb243deb4114478e1295808af7", size = 18476044 }, - { url = "https://files.pythonhosted.org/packages/36/33/29208b8b075bde62d26a81d14b358c42b0f69b6cabd98d4ff97f37f22b05/numpy-2.5.2-cp312-cp312-win32.whl", hash = "sha256:d6a48072864e3324e194a8fbb3c657bcc5b5c869dbc64c9537b1d5c862572c0a", size = 6072817 }, - { url = "https://files.pythonhosted.org/packages/7f/b9/87fea2769fe1c47c1b5b01d8310772c9d1a85d485de7cf386ef7a3332b02/numpy-2.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:28ac63476ec7651484215ee7fa15a1f78b57c14621f01e392afe17b9a1390ce4", size = 12464674 }, - { url = "https://files.pythonhosted.org/packages/14/52/032b97e00461ab0809bbe4c588b035620e5a14b8cdee47ecddefc7b17d33/numpy-2.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:27650bb0e7140fa3d37b9923b4803645e0b125d190f326eecfd3f4dad8e8ade1", size = 10397131 }, + { url = "https://files.pythonhosted.org/packages/69/72/dccb0aaf40972777283303919f613964227266d0c13adebb79ac124f1c3e/numpy-2.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:14e373cfc6387177e8409dac3c7159be8eb05cd77096cd7c950268b86f62831c", size = 16891693, upload-time = "2026-08-09T13:44:51.702Z" }, + { url = "https://files.pythonhosted.org/packages/60/2e/b5aee50a1f74ac815cf8331812cb8251e29024025de462e0c047641c614c/numpy-2.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4bbd96c833ecc8cc069ce518078fc8c60cb9cbfb0fea5b7a803ad65035596d03", size = 11903109, upload-time = "2026-08-09T13:44:55.501Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f4/29e78102a80601cf034d4e9767022cffeca2c3b4c926e1754572ca95593d/numpy-2.5.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:6e8172ddfcf5cf74b811d372b570b83c60bd2de87a6fbfbebdadb4a9bd9c6cbb", size = 5350202, upload-time = "2026-08-09T13:44:58.401Z" }, + { url = "https://files.pythonhosted.org/packages/11/4b/dcd3b7eadaf4035d2c7a4289d232523a6964f602598ef7674e4bd7291f93/numpy-2.5.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:65f188481f1669e26f62b701e8205d19e460fa4a9b52a1414ba382330e4a3414", size = 6687736, upload-time = "2026-08-09T13:45:00.813Z" }, + { url = "https://files.pythonhosted.org/packages/e5/21/4947e0e9d6c9fc2e2ff15b8949049ee44f63adb9cacc729ab8793f97e712/numpy-2.5.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8ee9c4eeb8454b3660a8b53493563c3e121c2fc94fbd72b848ef814ed7b676a9", size = 15612696, upload-time = "2026-08-09T13:45:04.151Z" }, + { url = "https://files.pythonhosted.org/packages/3a/5f/62d28cf019460c7f1394105b4d49d9911a9c444cb77ab0bd95a204c5a6de/numpy-2.5.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3cdec01fa790a186d430433fdd4d4ffb70eed6f0eeb4bf05c8dbe2dce0a9bcb8", size = 16722264, upload-time = "2026-08-09T13:45:07.714Z" }, + { url = "https://files.pythonhosted.org/packages/14/25/3f0be4c1b9fdf5dd5e708a6806978564d7c46a055c000496309ff2a2f8af/numpy-2.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7999d4ddb0c4025018373fd787510d46e04c769467af22869707b3c1cfd459ab", size = 16974396, upload-time = "2026-08-09T13:45:11.316Z" }, + { url = "https://files.pythonhosted.org/packages/22/72/6262cbdeeb45da9d971e40715f579d791603ba8ec0b5e2db1ac55454421d/numpy-2.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c1f017dc0875c9209d219f97feceb7d54c2661bb243deb4114478e1295808af7", size = 18476044, upload-time = "2026-08-09T13:45:14.869Z" }, + { url = "https://files.pythonhosted.org/packages/36/33/29208b8b075bde62d26a81d14b358c42b0f69b6cabd98d4ff97f37f22b05/numpy-2.5.2-cp312-cp312-win32.whl", hash = "sha256:d6a48072864e3324e194a8fbb3c657bcc5b5c869dbc64c9537b1d5c862572c0a", size = 6072817, upload-time = "2026-08-09T13:45:17.867Z" }, + { url = "https://files.pythonhosted.org/packages/7f/b9/87fea2769fe1c47c1b5b01d8310772c9d1a85d485de7cf386ef7a3332b02/numpy-2.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:28ac63476ec7651484215ee7fa15a1f78b57c14621f01e392afe17b9a1390ce4", size = 12464674, upload-time = "2026-08-09T13:45:20.734Z" }, + { url = "https://files.pythonhosted.org/packages/14/52/032b97e00461ab0809bbe4c588b035620e5a14b8cdee47ecddefc7b17d33/numpy-2.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:27650bb0e7140fa3d37b9923b4803645e0b125d190f326eecfd3f4dad8e8ade1", size = 10397131, upload-time = "2026-08-09T13:45:23.73Z" }, ] [[package]] name = "packaging" version = "26.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412 } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956 }, + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, ] [[package]] @@ -509,35 +539,35 @@ dependencies = [ { name = "python-dateutil" }, { name = "tzdata", marker = "sys_platform == 'emscripten' or sys_platform == 'win32'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/be/4f/5f3422a2afec5ffc46308b79e53291365a93748b498ac2e58bead0197916/pandas-3.0.5.tar.gz", hash = "sha256:dca3734d6ab7c906e6730f0788b0a1dbb9f2467731f9711f77995c8e9d62d712", size = 4658219 } +sdist = { url = "https://files.pythonhosted.org/packages/be/4f/5f3422a2afec5ffc46308b79e53291365a93748b498ac2e58bead0197916/pandas-3.0.5.tar.gz", hash = "sha256:dca3734d6ab7c906e6730f0788b0a1dbb9f2467731f9711f77995c8e9d62d712", size = 4658219, upload-time = "2026-07-22T22:19:28.819Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1c/54/1dc810ea558d1320b597aa140a514f2fdf1d2ea09c38cf556f13ea712ec9/pandas-3.0.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fa290c16964d4963fbfbc358928239cf3bd755b20e988ce944877def2f44471d", size = 10411717 }, - { url = "https://files.pythonhosted.org/packages/68/56/fbe81c09195924d8b7b8d4461a20458fe80a6a5ed6b24f0314da684277e1/pandas-3.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c2e26bb46934b8a2ca0c3de1d3d606fc5f6746584791b2db264d58cf370e08dc", size = 9957095 }, - { url = "https://files.pythonhosted.org/packages/e0/51/fac252f4a913ed5eabf3c11b880a9e8d5a6c10f0b2129d0462212d238b4d/pandas-3.0.5-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:73fa87b08a7ef706f8aafda39ddaccf2a99047bea62d8c88a0361bcafb2237bc", size = 10485458 }, - { url = "https://files.pythonhosted.org/packages/12/98/e976540c1addf70442be7842a18cf70884a964abbf69442504f4d2939989/pandas-3.0.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d373ce03ffd84010ed9839fa73672a9c8256990532e158440c0085db7d914b34", size = 10998091 }, - { url = "https://files.pythonhosted.org/packages/a4/8c/1f29b5be8d3fc47dd7567eb167fabba2085879b31e0287ce7cba6d3d2ff4/pandas-3.0.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2a29c53d85ea98c5e792c59ef82ee9fbe6ca902c0d0adb6b23f45ef894cd7bf6", size = 11499501 }, - { url = "https://files.pythonhosted.org/packages/9d/e2/bd9c98ad2df7b38bde002adde4cdf353519da51881634323b126c55997f9/pandas-3.0.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a5ad3b02ed6bc7d7ae9b70804b2c6aa31827489d150f8e623ce82491b82085d7", size = 12060559 }, - { url = "https://files.pythonhosted.org/packages/f3/9a/ffbd852d58bd74a617fe2f8ee6a58a96982271ce41cf981eab22190b4a4b/pandas-3.0.5-cp312-cp312-pyemscripten_2024_0_wasm32.whl", hash = "sha256:b2acb4650527eec6822c3dadb2b771277b65e7dae7a267d4bccf65fd1bb3fbce", size = 7197652 }, - { url = "https://files.pythonhosted.org/packages/70/b5/d2d3e9ae73362ba4229651b0ee1455cf78073a1ce585f6ff693782ce263e/pandas-3.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:80a611068e8a3ac23f7398c6c14eb46dc974e5cc9997f653e2dcfd1da74edd41", size = 9831691 }, - { url = "https://files.pythonhosted.org/packages/52/51/dea1e89d6a6796b9c43f85a09b484ee03edb8a4c4842e73e200a8c11301c/pandas-3.0.5-cp312-cp312-win_arm64.whl", hash = "sha256:25ff585b972a18ef1fe9ffa3ac6544d9950508aa76832e5147640b6022821e49", size = 9105796 }, + { url = "https://files.pythonhosted.org/packages/1c/54/1dc810ea558d1320b597aa140a514f2fdf1d2ea09c38cf556f13ea712ec9/pandas-3.0.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fa290c16964d4963fbfbc358928239cf3bd755b20e988ce944877def2f44471d", size = 10411717, upload-time = "2026-07-22T22:18:08.307Z" }, + { url = "https://files.pythonhosted.org/packages/68/56/fbe81c09195924d8b7b8d4461a20458fe80a6a5ed6b24f0314da684277e1/pandas-3.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c2e26bb46934b8a2ca0c3de1d3d606fc5f6746584791b2db264d58cf370e08dc", size = 9957095, upload-time = "2026-07-22T22:18:10.6Z" }, + { url = "https://files.pythonhosted.org/packages/e0/51/fac252f4a913ed5eabf3c11b880a9e8d5a6c10f0b2129d0462212d238b4d/pandas-3.0.5-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:73fa87b08a7ef706f8aafda39ddaccf2a99047bea62d8c88a0361bcafb2237bc", size = 10485458, upload-time = "2026-07-22T22:18:12.834Z" }, + { url = "https://files.pythonhosted.org/packages/12/98/e976540c1addf70442be7842a18cf70884a964abbf69442504f4d2939989/pandas-3.0.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d373ce03ffd84010ed9839fa73672a9c8256990532e158440c0085db7d914b34", size = 10998091, upload-time = "2026-07-22T22:18:15.209Z" }, + { url = "https://files.pythonhosted.org/packages/a4/8c/1f29b5be8d3fc47dd7567eb167fabba2085879b31e0287ce7cba6d3d2ff4/pandas-3.0.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2a29c53d85ea98c5e792c59ef82ee9fbe6ca902c0d0adb6b23f45ef894cd7bf6", size = 11499501, upload-time = "2026-07-22T22:18:17.689Z" }, + { url = "https://files.pythonhosted.org/packages/9d/e2/bd9c98ad2df7b38bde002adde4cdf353519da51881634323b126c55997f9/pandas-3.0.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a5ad3b02ed6bc7d7ae9b70804b2c6aa31827489d150f8e623ce82491b82085d7", size = 12060559, upload-time = "2026-07-22T22:18:20.147Z" }, + { url = "https://files.pythonhosted.org/packages/f3/9a/ffbd852d58bd74a617fe2f8ee6a58a96982271ce41cf981eab22190b4a4b/pandas-3.0.5-cp312-cp312-pyemscripten_2024_0_wasm32.whl", hash = "sha256:b2acb4650527eec6822c3dadb2b771277b65e7dae7a267d4bccf65fd1bb3fbce", size = 7197652, upload-time = "2026-07-22T22:18:22.502Z" }, + { url = "https://files.pythonhosted.org/packages/70/b5/d2d3e9ae73362ba4229651b0ee1455cf78073a1ce585f6ff693782ce263e/pandas-3.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:80a611068e8a3ac23f7398c6c14eb46dc974e5cc9997f653e2dcfd1da74edd41", size = 9831691, upload-time = "2026-07-22T22:18:24.534Z" }, + { url = "https://files.pythonhosted.org/packages/52/51/dea1e89d6a6796b9c43f85a09b484ee03edb8a4c4842e73e200a8c11301c/pandas-3.0.5-cp312-cp312-win_arm64.whl", hash = "sha256:25ff585b972a18ef1fe9ffa3ac6544d9950508aa76832e5147640b6022821e49", size = 9105796, upload-time = "2026-07-22T22:18:27.064Z" }, ] [[package]] name = "platformdirs" version = "4.11.5" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ea/06/cf1564dcc2e2261c8c8c6c05628dc8b418943bdae2a4e58640ceb2f770fa/platformdirs-4.11.5.tar.gz", hash = "sha256:e8b31f4f8bcbbedef91a6b57a706255e4f148d2a4e01648382a0a47342539173", size = 34823 } +sdist = { url = "https://files.pythonhosted.org/packages/ea/06/cf1564dcc2e2261c8c8c6c05628dc8b418943bdae2a4e58640ceb2f770fa/platformdirs-4.11.5.tar.gz", hash = "sha256:e8b31f4f8bcbbedef91a6b57a706255e4f148d2a4e01648382a0a47342539173", size = 34823, upload-time = "2026-08-27T21:36:37.46Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/12/6f3fcd5067a9cbf4f8664b32957973498da8b083455203c8d9cab83a725c/platformdirs-4.11.5-py3-none-any.whl", hash = "sha256:89f8d42695853b89c7170bd49bc3dc593f98a71e695ede88e06a3b247bc4563b", size = 23900 }, + { url = "https://files.pythonhosted.org/packages/c7/12/6f3fcd5067a9cbf4f8664b32957973498da8b083455203c8d9cab83a725c/platformdirs-4.11.5-py3-none-any.whl", hash = "sha256:89f8d42695853b89c7170bd49bc3dc593f98a71e695ede88e06a3b247bc4563b", size = 23900, upload-time = "2026-08-27T21:36:36.227Z" }, ] [[package]] name = "pluggy" version = "1.6.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412 } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538 }, + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, ] [[package]] @@ -550,9 +580,9 @@ dependencies = [ { name = "pydantic" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e2/22/88c470d8838d2678a44e0172d061630b8837cba3fb7fb492e28f6578c309/postgrest-2.31.0.tar.gz", hash = "sha256:2f395d84b2ee34fc57622ff2f711df603e2ede625f98e5015240741888f7bd0c", size = 14419 } +sdist = { url = "https://files.pythonhosted.org/packages/e2/22/88c470d8838d2678a44e0172d061630b8837cba3fb7fb492e28f6578c309/postgrest-2.31.0.tar.gz", hash = "sha256:2f395d84b2ee34fc57622ff2f711df603e2ede625f98e5015240741888f7bd0c", size = 14419, upload-time = "2026-06-04T13:37:20.474Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ea/3e/41909586cb148db0259e0208310067afda4cc097f4c7a779e829c1e68c46/postgrest-2.31.0-py3-none-any.whl", hash = "sha256:c2fd47c94e13ee8335111c4f03c9a24ea9766ce9d35fc3cd7330057c9e7ea0c3", size = 23098 }, + { url = "https://files.pythonhosted.org/packages/ea/3e/41909586cb148db0259e0208310067afda4cc097f4c7a779e829c1e68c46/postgrest-2.31.0-py3-none-any.whl", hash = "sha256:c2fd47c94e13ee8335111c4f03c9a24ea9766ce9d35fc3cd7330057c9e7ea0c3", size = 23098, upload-time = "2026-06-04T13:37:19.452Z" }, ] [[package]] @@ -565,9 +595,9 @@ dependencies = [ { name = "requests" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e4/04/7aef5b358b5627086ba9643b32f7616aab8c07d6be829a1dcfc4424d317a/posthog-7.44.2.tar.gz", hash = "sha256:e375172bfaad5c7cfa25c027bc3b9db2794cd94f3845d13b0b51108bdfe80a3b", size = 480055 } +sdist = { url = "https://files.pythonhosted.org/packages/e4/04/7aef5b358b5627086ba9643b32f7616aab8c07d6be829a1dcfc4424d317a/posthog-7.44.2.tar.gz", hash = "sha256:e375172bfaad5c7cfa25c027bc3b9db2794cd94f3845d13b0b51108bdfe80a3b", size = 480055, upload-time = "2026-08-27T08:06:51.238Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7b/ce/17f7050afd08facdede145321be581425999b1e067c3cde7147fb7a8b89c/posthog-7.44.2-py3-none-any.whl", hash = "sha256:4a3d4b7c994d0b2d43a05b03293ce9a652900a5143d79fbeedb2f2fa78048ad3", size = 567692 }, + { url = "https://files.pythonhosted.org/packages/7b/ce/17f7050afd08facdede145321be581425999b1e067c3cde7147fb7a8b89c/posthog-7.44.2-py3-none-any.whl", hash = "sha256:4a3d4b7c994d0b2d43a05b03293ce9a652900a5143d79fbeedb2f2fa78048ad3", size = 567692, upload-time = "2026-08-27T08:06:49.505Z" }, ] [[package]] @@ -581,44 +611,44 @@ dependencies = [ { name = "pyyaml" }, { name = "virtualenv" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/74/89/1f3e8e1fc3e97de0fa963495832f581f025f29471602a309e48808244292/pre_commit-4.6.2.tar.gz", hash = "sha256:8f5d7bfb021ecdbcd9d49d89847082dd24172ccde534390081a679ad046e2441", size = 198670 } +sdist = { url = "https://files.pythonhosted.org/packages/74/89/1f3e8e1fc3e97de0fa963495832f581f025f29471602a309e48808244292/pre_commit-4.6.2.tar.gz", hash = "sha256:8f5d7bfb021ecdbcd9d49d89847082dd24172ccde534390081a679ad046e2441", size = 198670, upload-time = "2026-08-10T22:07:18.421Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/45/e2/bbb7129c9e7999a6b8ee9cca3b66486c25c423ab5a75f34071798b74ce94/pre_commit-4.6.2-py2.py3-none-any.whl", hash = "sha256:e2dde9a75d3bce11bd3831c26d134df00a2803c1d818be6a0383c3dcda25dc4e", size = 226202 }, + { url = "https://files.pythonhosted.org/packages/45/e2/bbb7129c9e7999a6b8ee9cca3b66486c25c423ab5a75f34071798b74ce94/pre_commit-4.6.2-py2.py3-none-any.whl", hash = "sha256:e2dde9a75d3bce11bd3831c26d134df00a2803c1d818be6a0383c3dcda25dc4e", size = 226202, upload-time = "2026-08-10T22:07:16.942Z" }, ] [[package]] name = "propcache" version = "0.5.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ec/44/c87281c333769159c50594f22610f77398a47ccbfbbf23074e744e86f87c/propcache-0.5.2.tar.gz", hash = "sha256:01c4fc7480cd0598bb4b57022df55b9ca296da7fc5a8760bd8451a7e63a7d427", size = 50208 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/4a/cb/e27bc2b2737a0bb49962b275efa051e8f1c35a936df7d5139b6b658b7dc9/propcache-0.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806719138ecd720339a12410fb9614ac9b2b2d3a5fdf8235d56981c36f4039ba", size = 95887 }, - { url = "https://files.pythonhosted.org/packages/e6/13/b8ae04c59392f8d11c6cd9fb4011d1dc7c86b81225c770280300e259ffe1/propcache-0.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:db2b80ea58eab4f86b2beec3cc8b39e8ff9276ac20e96b7cce43c8ae84cd6b5a", size = 54654 }, - { url = "https://files.pythonhosted.org/packages/2c/7d/49777a3e20b55863d4794384a38acd460c04157b0a00f8602b0d508b8431/propcache-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e5cbfac9f61484f7e9f3597775500cd3ebe8274e9b050c38f9525c77c97520bf", size = 55190 }, - { url = "https://files.pythonhosted.org/packages/44/c7/085d0cd63062e84044e3f05797749c3f8e3938ff3aeb0eb2f69d43fafc91/propcache-0.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbc581d2814337da56222fab8dc5f161cd798a434e49bac27930aaef798e144", size = 59995 }, - { url = "https://files.pythonhosted.org/packages/9c/42/32cf8e3009e92b2645cf1e944f701e8ea4e924dffde1ee26db860bcbf7e4/propcache-0.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:857187f381f88c8e2fa2fe56ab94879d011b883d5a2ee5a1b60a8cd2a06846d9", size = 63422 }, - { url = "https://files.pythonhosted.org/packages/9e/1b/f112433f99fc979431b87a39ef169e3f8df070d99a72792c56d6937ac48b/propcache-0.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:178b4a2cdaac1818e2bf1c5a99b94383fa73ea5382e032a48dec07dc5668dc42", size = 64342 }, - { url = "https://files.pythonhosted.org/packages/14/15/5574111ae50dd6e879456888c0eadd4c5a869959775854e18e18a6b345f3/propcache-0.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f328175a2cde1f0ff2c4ed8ce968b9dcfb55f3a7153f39e2957ed994da13476", size = 61639 }, - { url = "https://files.pythonhosted.org/packages/cc/da/4d775080b1490c0ae604acda868bd71aabe3a89ed16f2aa4339eb8a283e7/propcache-0.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5671d09a36b06d0fd4a3da0fccbcae360e9b1570924171a15e9e0997f0249fba", size = 61588 }, - { url = "https://files.pythonhosted.org/packages/04/ac/f076982cbe2195ee9cf32de5a1e46951d9fb399fc207f390562dd0fd8fb2/propcache-0.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:80168e2ebe4d3ec6599d10ad8f520304ae1cad9b6c5a95372aef1b66b7bfb53a", size = 60029 }, - { url = "https://files.pythonhosted.org/packages/70/60/189be62e0dd898dce3b331e1b8c7a543cd3a405ac0c81fe8ee8a9d5d77e1/propcache-0.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:45f11346f884bc47444f6e6647131055844134c3175b629f84952e2b5cd62b64", size = 56774 }, - { url = "https://files.pythonhosted.org/packages/ea/9e/93377b9c7939c1ffae98f878dee955efadfd638078bc86dbc21f9d52f651/propcache-0.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8e778ebd44ef4f66ed60a0416b06b489687db264a9c0b3620362f26489492913", size = 63532 }, - { url = "https://files.pythonhosted.org/packages/14/f9/590ef6cfb9b8028d516d287812ece32bb0bc5f11fbb9c8bf6b2e6313fec8/propcache-0.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c0cb9ed24c8964e172768d455a38254c2dd8a552905729ce006cad3d3dda59b1", size = 61592 }, - { url = "https://files.pythonhosted.org/packages/b4/5e/70958b3034c297a630bba2f17ca7abc2d5f39a803ad7e370ab79d1ecd022/propcache-0.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1d1ad32d9d4355e2be65574fd0bfd3677e7066b009cd5b9b2dee8aa6a6393b33", size = 64788 }, - { url = "https://files.pythonhosted.org/packages/12/fd/77fe5936d8c3086ca9048f7f415f122ed82e53884a9ec193646b42deef06/propcache-0.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c80f4ba3e8f00189165999a742ee526ebeccedf6c3f7beb0c7df821e9772435a", size = 62514 }, - { url = "https://files.pythonhosted.org/packages/cf/74/66bd798b5b3be70aa1b391f5cc9d6a0a5532d7fd3b19ec0b213e72e6ad9d/propcache-0.5.2-cp312-cp312-win32.whl", hash = "sha256:8c7972d8f193740d9175f0998ab38717e6cd322d5935c5b0fef8c0d323fd9031", size = 39018 }, - { url = "https://files.pythonhosted.org/packages/61/7c/5c0d34aa3024694d6dcb9271cdbdd08c4e47c1c0ad95ec7e7bc74cdea145/propcache-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:d9ee8826a7d47863a08ac44e1a5f611a462eefc3a194b492da242128bec75b42", size = 42322 }, - { url = "https://files.pythonhosted.org/packages/4d/91/875812f1a3feb20ceba818ef39fbe4d92f1081e04ac815c822496d0d038b/propcache-0.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:2800a4a8ead6b28cccd1ec54b59346f0def7922ee1c7598e8499c733cfbb7c84", size = 38172 }, - { url = "https://files.pythonhosted.org/packages/3a/ed/1cdcab6ba3d6ab7feca11fc14f0eeea80755bb53ef4e892079f31b10a25f/propcache-0.5.2-py3-none-any.whl", hash = "sha256:be1ddfcbb376e3de5d2e2db1d58d6d67463e6b4f9f040c000de8e300295465fe", size = 14036 }, +sdist = { url = "https://files.pythonhosted.org/packages/ec/44/c87281c333769159c50594f22610f77398a47ccbfbbf23074e744e86f87c/propcache-0.5.2.tar.gz", hash = "sha256:01c4fc7480cd0598bb4b57022df55b9ca296da7fc5a8760bd8451a7e63a7d427", size = 50208, upload-time = "2026-05-08T21:02:12.199Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4a/cb/e27bc2b2737a0bb49962b275efa051e8f1c35a936df7d5139b6b658b7dc9/propcache-0.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806719138ecd720339a12410fb9614ac9b2b2d3a5fdf8235d56981c36f4039ba", size = 95887, upload-time = "2026-05-08T21:00:11.277Z" }, + { url = "https://files.pythonhosted.org/packages/e6/13/b8ae04c59392f8d11c6cd9fb4011d1dc7c86b81225c770280300e259ffe1/propcache-0.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:db2b80ea58eab4f86b2beec3cc8b39e8ff9276ac20e96b7cce43c8ae84cd6b5a", size = 54654, upload-time = "2026-05-08T21:00:12.604Z" }, + { url = "https://files.pythonhosted.org/packages/2c/7d/49777a3e20b55863d4794384a38acd460c04157b0a00f8602b0d508b8431/propcache-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e5cbfac9f61484f7e9f3597775500cd3ebe8274e9b050c38f9525c77c97520bf", size = 55190, upload-time = "2026-05-08T21:00:13.935Z" }, + { url = "https://files.pythonhosted.org/packages/44/c7/085d0cd63062e84044e3f05797749c3f8e3938ff3aeb0eb2f69d43fafc91/propcache-0.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbc581d2814337da56222fab8dc5f161cd798a434e49bac27930aaef798e144", size = 59995, upload-time = "2026-05-08T21:00:15.526Z" }, + { url = "https://files.pythonhosted.org/packages/9c/42/32cf8e3009e92b2645cf1e944f701e8ea4e924dffde1ee26db860bcbf7e4/propcache-0.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:857187f381f88c8e2fa2fe56ab94879d011b883d5a2ee5a1b60a8cd2a06846d9", size = 63422, upload-time = "2026-05-08T21:00:16.824Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1b/f112433f99fc979431b87a39ef169e3f8df070d99a72792c56d6937ac48b/propcache-0.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:178b4a2cdaac1818e2bf1c5a99b94383fa73ea5382e032a48dec07dc5668dc42", size = 64342, upload-time = "2026-05-08T21:00:18.362Z" }, + { url = "https://files.pythonhosted.org/packages/14/15/5574111ae50dd6e879456888c0eadd4c5a869959775854e18e18a6b345f3/propcache-0.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f328175a2cde1f0ff2c4ed8ce968b9dcfb55f3a7153f39e2957ed994da13476", size = 61639, upload-time = "2026-05-08T21:00:19.692Z" }, + { url = "https://files.pythonhosted.org/packages/cc/da/4d775080b1490c0ae604acda868bd71aabe3a89ed16f2aa4339eb8a283e7/propcache-0.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5671d09a36b06d0fd4a3da0fccbcae360e9b1570924171a15e9e0997f0249fba", size = 61588, upload-time = "2026-05-08T21:00:21.155Z" }, + { url = "https://files.pythonhosted.org/packages/04/ac/f076982cbe2195ee9cf32de5a1e46951d9fb399fc207f390562dd0fd8fb2/propcache-0.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:80168e2ebe4d3ec6599d10ad8f520304ae1cad9b6c5a95372aef1b66b7bfb53a", size = 60029, upload-time = "2026-05-08T21:00:22.713Z" }, + { url = "https://files.pythonhosted.org/packages/70/60/189be62e0dd898dce3b331e1b8c7a543cd3a405ac0c81fe8ee8a9d5d77e1/propcache-0.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:45f11346f884bc47444f6e6647131055844134c3175b629f84952e2b5cd62b64", size = 56774, upload-time = "2026-05-08T21:00:24.001Z" }, + { url = "https://files.pythonhosted.org/packages/ea/9e/93377b9c7939c1ffae98f878dee955efadfd638078bc86dbc21f9d52f651/propcache-0.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8e778ebd44ef4f66ed60a0416b06b489687db264a9c0b3620362f26489492913", size = 63532, upload-time = "2026-05-08T21:00:25.545Z" }, + { url = "https://files.pythonhosted.org/packages/14/f9/590ef6cfb9b8028d516d287812ece32bb0bc5f11fbb9c8bf6b2e6313fec8/propcache-0.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c0cb9ed24c8964e172768d455a38254c2dd8a552905729ce006cad3d3dda59b1", size = 61592, upload-time = "2026-05-08T21:00:27.186Z" }, + { url = "https://files.pythonhosted.org/packages/b4/5e/70958b3034c297a630bba2f17ca7abc2d5f39a803ad7e370ab79d1ecd022/propcache-0.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1d1ad32d9d4355e2be65574fd0bfd3677e7066b009cd5b9b2dee8aa6a6393b33", size = 64788, upload-time = "2026-05-08T21:00:28.8Z" }, + { url = "https://files.pythonhosted.org/packages/12/fd/77fe5936d8c3086ca9048f7f415f122ed82e53884a9ec193646b42deef06/propcache-0.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c80f4ba3e8f00189165999a742ee526ebeccedf6c3f7beb0c7df821e9772435a", size = 62514, upload-time = "2026-05-08T21:00:30.098Z" }, + { url = "https://files.pythonhosted.org/packages/cf/74/66bd798b5b3be70aa1b391f5cc9d6a0a5532d7fd3b19ec0b213e72e6ad9d/propcache-0.5.2-cp312-cp312-win32.whl", hash = "sha256:8c7972d8f193740d9175f0998ab38717e6cd322d5935c5b0fef8c0d323fd9031", size = 39018, upload-time = "2026-05-08T21:00:31.622Z" }, + { url = "https://files.pythonhosted.org/packages/61/7c/5c0d34aa3024694d6dcb9271cdbdd08c4e47c1c0ad95ec7e7bc74cdea145/propcache-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:d9ee8826a7d47863a08ac44e1a5f611a462eefc3a194b492da242128bec75b42", size = 42322, upload-time = "2026-05-08T21:00:32.918Z" }, + { url = "https://files.pythonhosted.org/packages/4d/91/875812f1a3feb20ceba818ef39fbe4d92f1081e04ac815c822496d0d038b/propcache-0.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:2800a4a8ead6b28cccd1ec54b59346f0def7922ee1c7598e8499c733cfbb7c84", size = 38172, upload-time = "2026-05-08T21:00:35.124Z" }, + { url = "https://files.pythonhosted.org/packages/3a/ed/1cdcab6ba3d6ab7feca11fc14f0eeea80755bb53ef4e892079f31b10a25f/propcache-0.5.2-py3-none-any.whl", hash = "sha256:be1ddfcbb376e3de5d2e2db1d58d6d67463e6b4f9f040c000de8e300295465fe", size = 14036, upload-time = "2026-05-08T21:02:10.673Z" }, ] [[package]] name = "pycparser" version = "3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492 } +sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172 }, + { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, ] [[package]] @@ -631,9 +661,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "typing-inspection" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/53/ef/fc4f868f4e2cee79f863883abffceff107875f569b848507319842d2a681/pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08", size = 845750 } +sdist = { url = "https://files.pythonhosted.org/packages/53/ef/fc4f868f4e2cee79f863883abffceff107875f569b848507319842d2a681/pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08", size = 845750, upload-time = "2026-08-28T14:04:00.916Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/47/c95ffc2009878c7aac0c5e08528022dcb885933252a88b5f170058014464/pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73", size = 472589 }, + { url = "https://files.pythonhosted.org/packages/eb/47/c95ffc2009878c7aac0c5e08528022dcb885933252a88b5f170058014464/pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73", size = 472589, upload-time = "2026-08-28T14:03:59.136Z" }, ] [[package]] @@ -643,45 +673,45 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/af/f9/8a06bea35ef8daf588f707784c973a7046e0034c8d8cfb08828eeffb8b75/pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc", size = 472262 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/82/3f/76358795aa7a8c6d4f36e2cb828ad1c90ee118e1393a9281664f5aade9d4/pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d", size = 2076516 }, - { url = "https://files.pythonhosted.org/packages/db/50/26b091836076ce4cb2fac264186936acc069e0595772cfd02a563bc4761a/pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e", size = 1922874 }, - { url = "https://files.pythonhosted.org/packages/09/f0/2a8ce3849e299d44e2d2c196b6082643a3235565a735cb51db7a6261f614/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29", size = 1951772 }, - { url = "https://files.pythonhosted.org/packages/87/46/ac0dc8bdd9e6048183a14eb127764e7ad9240021c17513074a4711b0e31e/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4", size = 2031832 }, - { url = "https://files.pythonhosted.org/packages/c4/c2/339de5bef7be36301a2231eaa52e62163742c2281f11b5f4892bc79785cd/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a", size = 2208645 }, - { url = "https://files.pythonhosted.org/packages/7b/a0/9ff22b797724262da14427abaed4dd1d864a139693fc5e7809114376a716/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62", size = 2265935 }, - { url = "https://files.pythonhosted.org/packages/c0/a4/eb9409ec0736e50aa70a412f16c204ed149516846912f7e6724d4c73ee53/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2", size = 2066284 }, - { url = "https://files.pythonhosted.org/packages/c0/02/7f6156ffc926857f1c37c07d9a388682865a81830ab6a1b637082c25e399/pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869", size = 2105889 }, - { url = "https://files.pythonhosted.org/packages/92/b1/e781d357ebe09fc929f995700f1b3503e8897f1cece183ecb1300d4d67e9/pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5", size = 2158006 }, - { url = "https://files.pythonhosted.org/packages/70/0a/644597d84ab400e50609c192120b85c9681c22d3a20461b9060a79be0a7a/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3", size = 2158408 }, - { url = "https://files.pythonhosted.org/packages/1e/ee/ca3b7b3a4b3769ffe9ce9432a7c9be755de9593a46d3b0d54d0409323e44/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b", size = 2309609 }, - { url = "https://files.pythonhosted.org/packages/ce/52/39fa1f451486019524ca685020390e7ca351832fd874530ba30c8628e6dc/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0", size = 2342618 }, - { url = "https://files.pythonhosted.org/packages/81/5e/468fc630568c61dcef3cd47ad32ffbeed9af643f49208d1ea86ab4f890c4/pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b", size = 1939475 }, - { url = "https://files.pythonhosted.org/packages/cf/c9/4c19f41b84cf6b622a72fbeed7665b25d47a187d68d47d0d430c07f23268/pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8", size = 2043140 }, - { url = "https://files.pythonhosted.org/packages/af/dd/0c1a050299147c746e5256db16d645ab5efd4f78c59937d581a0524e74a2/pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084", size = 1997729 }, - { url = "https://files.pythonhosted.org/packages/df/dd/053c2e4303f791f3b8f8a14ab0b22008e8eb21d868c0c90b4f9be705b76a/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942", size = 2062540 }, - { url = "https://files.pythonhosted.org/packages/d7/dd/a18df751a5e37dd51bfad7f68e766999125bebe68c9e1d10a493ad01bd63/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f", size = 1902040 }, - { url = "https://files.pythonhosted.org/packages/b7/13/01d40f9d07ce8a779fd6e0bd8ad4fba91309500dd67b869e2e219d261a6d/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433", size = 1967479 }, - { url = "https://files.pythonhosted.org/packages/fa/04/c81d4841331c2178b6fb09ae225425e110ed72d990c9fe556c4ec03d1013/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c", size = 2111034 }, +sdist = { url = "https://files.pythonhosted.org/packages/af/f9/8a06bea35ef8daf588f707784c973a7046e0034c8d8cfb08828eeffb8b75/pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc", size = 472262, upload-time = "2026-08-28T10:01:31.677Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3f/76358795aa7a8c6d4f36e2cb828ad1c90ee118e1393a9281664f5aade9d4/pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d", size = 2076516, upload-time = "2026-08-28T09:58:21.576Z" }, + { url = "https://files.pythonhosted.org/packages/db/50/26b091836076ce4cb2fac264186936acc069e0595772cfd02a563bc4761a/pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e", size = 1922874, upload-time = "2026-08-28T09:58:23.766Z" }, + { url = "https://files.pythonhosted.org/packages/09/f0/2a8ce3849e299d44e2d2c196b6082643a3235565a735cb51db7a6261f614/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29", size = 1951772, upload-time = "2026-08-28T09:58:25.435Z" }, + { url = "https://files.pythonhosted.org/packages/87/46/ac0dc8bdd9e6048183a14eb127764e7ad9240021c17513074a4711b0e31e/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4", size = 2031832, upload-time = "2026-08-28T09:58:27.102Z" }, + { url = "https://files.pythonhosted.org/packages/c4/c2/339de5bef7be36301a2231eaa52e62163742c2281f11b5f4892bc79785cd/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a", size = 2208645, upload-time = "2026-08-28T09:58:28.948Z" }, + { url = "https://files.pythonhosted.org/packages/7b/a0/9ff22b797724262da14427abaed4dd1d864a139693fc5e7809114376a716/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62", size = 2265935, upload-time = "2026-08-28T09:58:30.625Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/eb9409ec0736e50aa70a412f16c204ed149516846912f7e6724d4c73ee53/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2", size = 2066284, upload-time = "2026-08-28T09:58:32.289Z" }, + { url = "https://files.pythonhosted.org/packages/c0/02/7f6156ffc926857f1c37c07d9a388682865a81830ab6a1b637082c25e399/pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869", size = 2105889, upload-time = "2026-08-28T09:58:33.986Z" }, + { url = "https://files.pythonhosted.org/packages/92/b1/e781d357ebe09fc929f995700f1b3503e8897f1cece183ecb1300d4d67e9/pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5", size = 2158006, upload-time = "2026-08-28T09:58:35.647Z" }, + { url = "https://files.pythonhosted.org/packages/70/0a/644597d84ab400e50609c192120b85c9681c22d3a20461b9060a79be0a7a/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3", size = 2158408, upload-time = "2026-08-28T09:58:37.38Z" }, + { url = "https://files.pythonhosted.org/packages/1e/ee/ca3b7b3a4b3769ffe9ce9432a7c9be755de9593a46d3b0d54d0409323e44/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b", size = 2309609, upload-time = "2026-08-28T09:58:39.22Z" }, + { url = "https://files.pythonhosted.org/packages/ce/52/39fa1f451486019524ca685020390e7ca351832fd874530ba30c8628e6dc/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0", size = 2342618, upload-time = "2026-08-28T09:58:40.89Z" }, + { url = "https://files.pythonhosted.org/packages/81/5e/468fc630568c61dcef3cd47ad32ffbeed9af643f49208d1ea86ab4f890c4/pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b", size = 1939475, upload-time = "2026-08-28T09:58:42.591Z" }, + { url = "https://files.pythonhosted.org/packages/cf/c9/4c19f41b84cf6b622a72fbeed7665b25d47a187d68d47d0d430c07f23268/pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8", size = 2043140, upload-time = "2026-08-28T09:58:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/af/dd/0c1a050299147c746e5256db16d645ab5efd4f78c59937d581a0524e74a2/pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084", size = 1997729, upload-time = "2026-08-28T09:58:46.13Z" }, + { url = "https://files.pythonhosted.org/packages/df/dd/053c2e4303f791f3b8f8a14ab0b22008e8eb21d868c0c90b4f9be705b76a/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942", size = 2062540, upload-time = "2026-08-28T10:01:00.318Z" }, + { url = "https://files.pythonhosted.org/packages/d7/dd/a18df751a5e37dd51bfad7f68e766999125bebe68c9e1d10a493ad01bd63/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f", size = 1902040, upload-time = "2026-08-28T10:01:02.529Z" }, + { url = "https://files.pythonhosted.org/packages/b7/13/01d40f9d07ce8a779fd6e0bd8ad4fba91309500dd67b869e2e219d261a6d/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433", size = 1967479, upload-time = "2026-08-28T10:01:05.004Z" }, + { url = "https://files.pythonhosted.org/packages/fa/04/c81d4841331c2178b6fb09ae225425e110ed72d990c9fe556c4ec03d1013/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c", size = 2111034, upload-time = "2026-08-28T10:01:07.345Z" }, ] [[package]] name = "pygments" version = "2.21.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329 } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147 }, + { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, ] [[package]] name = "pyjwt" version = "2.13.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3b/81/58d0ac84e1ef3a3843791d6954d94c0b33d526c75eeb1efbce9d0a4c4077/pyjwt-2.13.0.tar.gz", hash = "sha256:41571c89ca91598c79e8ef18a2d07367d4810fbbd6f637794879baf1b7703423", size = 107515 } +sdist = { url = "https://files.pythonhosted.org/packages/3b/81/58d0ac84e1ef3a3843791d6954d94c0b33d526c75eeb1efbce9d0a4c4077/pyjwt-2.13.0.tar.gz", hash = "sha256:41571c89ca91598c79e8ef18a2d07367d4810fbbd6f637794879baf1b7703423", size = 107515, upload-time = "2026-05-21T19:54:36.618Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a3/5e/ecf12fdb62546d64385c158514e9b2b671f7832108ef2ecd2020ce0af2d1/pyjwt-2.13.0-py3-none-any.whl", hash = "sha256:66adcc2aff09b3f1bbd95fc1e1577df8ac8723c978552fd43304c8a290ac5728", size = 31274 }, + { url = "https://files.pythonhosted.org/packages/a3/5e/ecf12fdb62546d64385c158514e9b2b671f7832108ef2ecd2020ce0af2d1/pyjwt-2.13.0-py3-none-any.whl", hash = "sha256:66adcc2aff09b3f1bbd95fc1e1577df8ac8723c978552fd43304c8a290ac5728", size = 31274, upload-time = "2026-05-21T19:54:35.362Z" }, ] [package.optional-dependencies] @@ -696,27 +726,27 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "dnspython" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/dc/04/455039b475bb8afa5af9b8c363fb773a45d898016f04ee40c1c75003a3f9/pymongo-4.18.2.tar.gz", hash = "sha256:1bd4321cc63c06954953eae9eb8fb5d9075296b96c0e3ed34ccb91a0dcce31a5", size = 2746691 } +sdist = { url = "https://files.pythonhosted.org/packages/dc/04/455039b475bb8afa5af9b8c363fb773a45d898016f04ee40c1c75003a3f9/pymongo-4.18.2.tar.gz", hash = "sha256:1bd4321cc63c06954953eae9eb8fb5d9075296b96c0e3ed34ccb91a0dcce31a5", size = 2746691, upload-time = "2026-09-24T16:59:59.472Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/10/eb/995ec978741cfc56a29223ec0806976218b95d79a516d9b719c984ead130/pymongo-4.18.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:78a3b324407ba7228a57f207e175efc40341c1312d1e7df2d4ad8141ff6d8e00", size = 819057 }, - { url = "https://files.pythonhosted.org/packages/40/e4/5a166bbac7f6e620cfb75b0640e793dd3ce69423a1f89cf6a0bfc588c107/pymongo-4.18.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:498187b5171d5efa87291b30e4cbf1e9849929c02bc436e95a3d01ff19e49f42", size = 819448 }, - { url = "https://files.pythonhosted.org/packages/c9/c8/82194d9a1387a56cac996901f92ea6a25ae817622ee32d15c986638b263f/pymongo-4.18.2-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2c003646d3fa5db4e835483fc29018eb06d8c637cf69f676ffbb3f0734005220", size = 1039602 }, - { url = "https://files.pythonhosted.org/packages/cc/06/628f93f15f269d8a1ea20a024083e67871f722876a33992aec5525a6c6c4/pymongo-4.18.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c743347143298252948e038f768ea6f71b71ef8a85b7cf0dc13b734e072f74da", size = 1050746 }, - { url = "https://files.pythonhosted.org/packages/bf/93/58ea76803128651ec9c732b59b8c1eb73d511c085c2e5786da3289d4015c/pymongo-4.18.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:09e6afa68001433c42925a258b57f2ceccb95c73fe8920452e147a82d90c1ae9", size = 1075681 }, - { url = "https://files.pythonhosted.org/packages/7c/6d/702ee4593420e2a8ceb169ece6394f0bb9fc2e8e8d8101e99f2468ed6d0d/pymongo-4.18.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8d3445caeeb47dc64bf416dc03e0b3bfcf3b60a109dec355a563aa62c135cb33", size = 1068235 }, - { url = "https://files.pythonhosted.org/packages/a9/92/a02a4108ca4faf05bca394d65dcebc7b84b0248cff23aa89927c81a0d5dd/pymongo-4.18.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecde9e735e1f86559e0a71a5bbec671e59a35549bfd8c60968d9f032b05013de", size = 1049896 }, - { url = "https://files.pythonhosted.org/packages/6e/93/65ef17eecdd86c153f7907b2d490d85eb655d3a5eb35a8494e7e09376353/pymongo-4.18.2-cp312-cp312-win32.whl", hash = "sha256:a463c3fc072655b7fe9e9ded4601876bef7f1df98f6f3faeed07fa7f11309fff", size = 815124 }, - { url = "https://files.pythonhosted.org/packages/3c/cc/fd66aa9d8956e8269ea63b2977a7fd38fbec45795d38b8067bfafc98992f/pymongo-4.18.2-cp312-cp312-win_amd64.whl", hash = "sha256:cbb67901ba9b6334fa94643d66587a30ffe5be05061af287364e6b5f7d239dc5", size = 821996 }, - { url = "https://files.pythonhosted.org/packages/06/21/983d340cfe226c987014f1caf9568b176cbd7f25dd87536379a609e6371e/pymongo-4.18.2-cp312-cp312-win_arm64.whl", hash = "sha256:94c5e0fe9af4c05f382ae7c4addd0255a8ddcc91b3d2a6bc09b34230cb28290b", size = 815707 }, + { url = "https://files.pythonhosted.org/packages/10/eb/995ec978741cfc56a29223ec0806976218b95d79a516d9b719c984ead130/pymongo-4.18.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:78a3b324407ba7228a57f207e175efc40341c1312d1e7df2d4ad8141ff6d8e00", size = 819057, upload-time = "2026-09-24T16:58:35.844Z" }, + { url = "https://files.pythonhosted.org/packages/40/e4/5a166bbac7f6e620cfb75b0640e793dd3ce69423a1f89cf6a0bfc588c107/pymongo-4.18.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:498187b5171d5efa87291b30e4cbf1e9849929c02bc436e95a3d01ff19e49f42", size = 819448, upload-time = "2026-09-24T16:58:37.221Z" }, + { url = "https://files.pythonhosted.org/packages/c9/c8/82194d9a1387a56cac996901f92ea6a25ae817622ee32d15c986638b263f/pymongo-4.18.2-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2c003646d3fa5db4e835483fc29018eb06d8c637cf69f676ffbb3f0734005220", size = 1039602, upload-time = "2026-09-24T16:58:38.821Z" }, + { url = "https://files.pythonhosted.org/packages/cc/06/628f93f15f269d8a1ea20a024083e67871f722876a33992aec5525a6c6c4/pymongo-4.18.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c743347143298252948e038f768ea6f71b71ef8a85b7cf0dc13b734e072f74da", size = 1050746, upload-time = "2026-09-24T16:58:40.322Z" }, + { url = "https://files.pythonhosted.org/packages/bf/93/58ea76803128651ec9c732b59b8c1eb73d511c085c2e5786da3289d4015c/pymongo-4.18.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:09e6afa68001433c42925a258b57f2ceccb95c73fe8920452e147a82d90c1ae9", size = 1075681, upload-time = "2026-09-24T16:58:41.722Z" }, + { url = "https://files.pythonhosted.org/packages/7c/6d/702ee4593420e2a8ceb169ece6394f0bb9fc2e8e8d8101e99f2468ed6d0d/pymongo-4.18.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8d3445caeeb47dc64bf416dc03e0b3bfcf3b60a109dec355a563aa62c135cb33", size = 1068235, upload-time = "2026-09-24T16:58:43.228Z" }, + { url = "https://files.pythonhosted.org/packages/a9/92/a02a4108ca4faf05bca394d65dcebc7b84b0248cff23aa89927c81a0d5dd/pymongo-4.18.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecde9e735e1f86559e0a71a5bbec671e59a35549bfd8c60968d9f032b05013de", size = 1049896, upload-time = "2026-09-24T16:58:44.914Z" }, + { url = "https://files.pythonhosted.org/packages/6e/93/65ef17eecdd86c153f7907b2d490d85eb655d3a5eb35a8494e7e09376353/pymongo-4.18.2-cp312-cp312-win32.whl", hash = "sha256:a463c3fc072655b7fe9e9ded4601876bef7f1df98f6f3faeed07fa7f11309fff", size = 815124, upload-time = "2026-09-24T16:58:46.39Z" }, + { url = "https://files.pythonhosted.org/packages/3c/cc/fd66aa9d8956e8269ea63b2977a7fd38fbec45795d38b8067bfafc98992f/pymongo-4.18.2-cp312-cp312-win_amd64.whl", hash = "sha256:cbb67901ba9b6334fa94643d66587a30ffe5be05061af287364e6b5f7d239dc5", size = 821996, upload-time = "2026-09-24T16:58:47.769Z" }, + { url = "https://files.pythonhosted.org/packages/06/21/983d340cfe226c987014f1caf9568b176cbd7f25dd87536379a609e6371e/pymongo-4.18.2-cp312-cp312-win_arm64.whl", hash = "sha256:94c5e0fe9af4c05f382ae7c4addd0255a8ddcc91b3d2a6bc09b34230cb28290b", size = 815707, upload-time = "2026-09-24T16:58:49.493Z" }, ] [[package]] name = "pysocks" version = "1.7.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/bd/11/293dd436aea955d45fc4e8a35b6ae7270f5b8e00b53cf6c024c83b657a11/PySocks-1.7.1.tar.gz", hash = "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0", size = 284429 } +sdist = { url = "https://files.pythonhosted.org/packages/bd/11/293dd436aea955d45fc4e8a35b6ae7270f5b8e00b53cf6c024c83b657a11/PySocks-1.7.1.tar.gz", hash = "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0", size = 284429, upload-time = "2019-09-20T02:07:35.714Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8d/59/b4572118e098ac8e46e399a1dd0f2d85403ce8bbaad9ec79373ed6badaf9/PySocks-1.7.1-py3-none-any.whl", hash = "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5", size = 16725 }, + { url = "https://files.pythonhosted.org/packages/8d/59/b4572118e098ac8e46e399a1dd0f2d85403ce8bbaad9ec79373ed6badaf9/PySocks-1.7.1-py3-none-any.whl", hash = "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5", size = 16725, upload-time = "2019-09-20T02:06:22.938Z" }, ] [[package]] @@ -730,9 +760,9 @@ dependencies = [ { name = "pluggy" }, { name = "pygments" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618 } +sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750 }, + { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, ] [[package]] @@ -744,9 +774,9 @@ dependencies = [ { name = "pluggy" }, { name = "pytest" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/30/4c/f883ab8f0daad69f47efdf95f55a66b51a8b939c430dadce0611508d9e99/pytest_cov-6.3.0.tar.gz", hash = "sha256:35c580e7800f87ce892e687461166e1ac2bcb8fb9e13aea79032518d6e503ff2", size = 70398 } +sdist = { url = "https://files.pythonhosted.org/packages/30/4c/f883ab8f0daad69f47efdf95f55a66b51a8b939c430dadce0611508d9e99/pytest_cov-6.3.0.tar.gz", hash = "sha256:35c580e7800f87ce892e687461166e1ac2bcb8fb9e13aea79032518d6e503ff2", size = 70398, upload-time = "2025-09-06T15:40:14.361Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/b4/bb7263e12aade3842b938bc5c6958cae79c5ee18992f9b9349019579da0f/pytest_cov-6.3.0-py3-none-any.whl", hash = "sha256:440db28156d2468cafc0415b4f8e50856a0d11faefa38f30906048fe490f1749", size = 25115 }, + { url = "https://files.pythonhosted.org/packages/80/b4/bb7263e12aade3842b938bc5c6958cae79c5ee18992f9b9349019579da0f/pytest_cov-6.3.0-py3-none-any.whl", hash = "sha256:440db28156d2468cafc0415b4f8e50856a0d11faefa38f30906048fe490f1749", size = 25115, upload-time = "2025-09-06T15:40:12.44Z" }, ] [[package]] @@ -756,9 +786,9 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "six" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432 } +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892 }, + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, ] [[package]] @@ -768,45 +798,45 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "filelock" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/91/96/0f93e27c9f60a650838f2118159aa115fd5732c0716247917b7ba7ede665/python_discovery-1.6.0.tar.gz", hash = "sha256:6393b4eae1be8b2182670635e7baff89ac21cb9f8e86fd1ff40c7b1144febb4c", size = 82849 } +sdist = { url = "https://files.pythonhosted.org/packages/91/96/0f93e27c9f60a650838f2118159aa115fd5732c0716247917b7ba7ede665/python_discovery-1.6.0.tar.gz", hash = "sha256:6393b4eae1be8b2182670635e7baff89ac21cb9f8e86fd1ff40c7b1144febb4c", size = 82849, upload-time = "2026-08-28T17:30:02.366Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/43/5e/21abf578182fb15006a57faf3711a1e659e29d600d19b6e557eae908c81d/python_discovery-1.6.0-py3-none-any.whl", hash = "sha256:d4e244cf17b8b29819ed78003d55fbacf86eda23425b075454fff9271b79377a", size = 38451 }, + { url = "https://files.pythonhosted.org/packages/43/5e/21abf578182fb15006a57faf3711a1e659e29d600d19b6e557eae908c81d/python_discovery-1.6.0-py3-none-any.whl", hash = "sha256:d4e244cf17b8b29819ed78003d55fbacf86eda23425b075454fff9271b79377a", size = 38451, upload-time = "2026-08-28T17:30:01.236Z" }, ] [[package]] name = "python-dotenv" version = "1.2.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6a/53/ed9d74092561d4b01a2ef1349d52cdbc135e526c245f366b089cfca6de49/python_dotenv-1.2.3.tar.gz", hash = "sha256:a20a594dabeaa385725aa239d5244871c143ecb356add8a20fcf23773a6c3a35", size = 58945 } +sdist = { url = "https://files.pythonhosted.org/packages/6a/53/ed9d74092561d4b01a2ef1349d52cdbc135e526c245f366b089cfca6de49/python_dotenv-1.2.3.tar.gz", hash = "sha256:a20a594dabeaa385725aa239d5244871c143ecb356add8a20fcf23773a6c3a35", size = 58945, upload-time = "2026-08-16T16:54:54.067Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0d/17/c5c6b53ddc18f297992099b3d9ec16c855c0ccc83263a21fe4d1c625ec6c/python_dotenv-1.2.3-py3-none-any.whl", hash = "sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9", size = 22780 }, + { url = "https://files.pythonhosted.org/packages/0d/17/c5c6b53ddc18f297992099b3d9ec16c855c0ccc83263a21fe4d1c625ec6c/python_dotenv-1.2.3-py3-none-any.whl", hash = "sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9", size = 22780, upload-time = "2026-08-16T16:54:52.473Z" }, ] [[package]] name = "pytz" version = "2024.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3a/31/3c70bf7603cc2dca0f19bdc53b4537a797747a58875b552c8c413d963a3f/pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a", size = 319692 } +sdist = { url = "https://files.pythonhosted.org/packages/3a/31/3c70bf7603cc2dca0f19bdc53b4537a797747a58875b552c8c413d963a3f/pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a", size = 319692, upload-time = "2024-09-11T02:24:47.91Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/11/c3/005fcca25ce078d2cc29fd559379817424e94885510568bc1bc53d7d5846/pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725", size = 508002 }, + { url = "https://files.pythonhosted.org/packages/11/c3/005fcca25ce078d2cc29fd559379817424e94885510568bc1bc53d7d5846/pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725", size = 508002, upload-time = "2024-09-11T02:24:45.8Z" }, ] [[package]] name = "pyyaml" version = "6.0.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960 } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063 }, - { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973 }, - { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116 }, - { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011 }, - { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870 }, - { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089 }, - { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181 }, - { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658 }, - { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003 }, - { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344 }, + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, ] [[package]] @@ -818,33 +848,33 @@ dependencies = [ { name = "typing-extensions" }, { name = "websockets" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/df/34/54a1eaaefa24db5cb12596fd74792e08efa53ed30dc5bce2c0a68ded6146/realtime-2.31.0.tar.gz", hash = "sha256:9e641cb4d77ca0fe768515f8cf9f83550c79f49ce1550a95afc2dc0e252be8c9", size = 18716 } +sdist = { url = "https://files.pythonhosted.org/packages/df/34/54a1eaaefa24db5cb12596fd74792e08efa53ed30dc5bce2c0a68ded6146/realtime-2.31.0.tar.gz", hash = "sha256:9e641cb4d77ca0fe768515f8cf9f83550c79f49ce1550a95afc2dc0e252be8c9", size = 18716, upload-time = "2026-06-04T13:37:22.089Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/13/60/164246615e8b059f6d53d34648a0784260421ec98a07eb1e45160f063221/realtime-2.31.0-py3-none-any.whl", hash = "sha256:f6e494b53d6a6e80b6efcee6711c8dd40413a52e766271de1bce8ced6c36cc1d", size = 22374 }, + { url = "https://files.pythonhosted.org/packages/13/60/164246615e8b059f6d53d34648a0784260421ec98a07eb1e45160f063221/realtime-2.31.0-py3-none-any.whl", hash = "sha256:f6e494b53d6a6e80b6efcee6711c8dd40413a52e766271de1bce8ced6c36cc1d", size = 22374, upload-time = "2026-06-04T13:37:21.162Z" }, ] [[package]] name = "regex" version = "2026.7.19" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/20/98/04b13f1ddfb63158025291c02e03eb42fbb7acb51d091d541050eb4e35e8/regex-2026.7.19.tar.gz", hash = "sha256:7e77b324909c1617cbb4c668677e2c6ae13f44d7c1de0d4f15f2e3c10f3315b5", size = 416440 } +sdist = { url = "https://files.pythonhosted.org/packages/20/98/04b13f1ddfb63158025291c02e03eb42fbb7acb51d091d541050eb4e35e8/regex-2026.7.19.tar.gz", hash = "sha256:7e77b324909c1617cbb4c668677e2c6ae13f44d7c1de0d4f15f2e3c10f3315b5", size = 416440, upload-time = "2026-07-19T00:19:48.923Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3b/b9/d11d7e501ac8fd7d617684423ebb9561e0b998481c1e4cbc0cb212c5d74a/regex-2026.7.19-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2cc3460cedf7579948486eab03bc9ad7089df4d7281c0f47f4afe03e8d13f02d", size = 496778 }, - { url = "https://files.pythonhosted.org/packages/3f/a9/a5ab6f312f24318019170dc485d5421fe4f89e43a98640da50d95a8a7041/regex-2026.7.19-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0e9554c8785eac5cffe6300f69a91f58ba72bc88a5f8d661235ad7c6aa5b8ccd", size = 297122 }, - { url = "https://files.pythonhosted.org/packages/b3/63/4cab4d7f2d384a144d420b763d97674cb70619c878ea6fcd7640d0e62143/regex-2026.7.19-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d7da47a0f248977f08e2cb659ff3c17ddc13a4d39b3a7baa0a81bf5b415430f6", size = 292009 }, - { url = "https://files.pythonhosted.org/packages/22/85/102a81b218298957d4ea7d2f084fae537a71add9d6ff93c8e67284c5f45e/regex-2026.7.19-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:93db40c8de0815baab96a06e08a984bac71f989d13bab789e382158c5d426797", size = 796708 }, - { url = "https://files.pythonhosted.org/packages/78/b5/dc136af5629938a037cd2b304c12240e132ec92f38be8ff9cc89af2a1f2d/regex-2026.7.19-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:66bd62c59a5427746e8c44becae1d9b99d22fb13f30f492083dfb9ad7c45cc18", size = 865651 }, - { url = "https://files.pythonhosted.org/packages/e0/75/67402ae3cd9c8c988a4c805d15ee3eef015e7ca4cb112cf3e640fc1f4153/regex-2026.7.19-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1649eb39fcc9ea80c4d2f110fde2b8ab2aef3877b98f02ab9b14e961f418c511", size = 911756 }, - { url = "https://files.pythonhosted.org/packages/2a/8e/096d00c7c480ef2ff4265349b14e2261d4ab787ba1f74e2e80d1c58079c3/regex-2026.7.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9dce8ec9695f531a1b8a6f314fd4b393adcccf2ea861db480cdf97a301d01a68", size = 801798 }, - { url = "https://files.pythonhosted.org/packages/f0/41/e7ecac6edb5722417f85cc67eaf386322fbe8acf6918ec2fdc37c20dd9d0/regex-2026.7.19-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3080a7fd38ef049bd489e01c970c97dd84ff446a885b0f1f6b26d9b1ad13ce11", size = 776933 }, - { url = "https://files.pythonhosted.org/packages/6f/69/03c9b3f058d66403e0ca2c938696e81d51cd4c6d47ec5265f02f96948d9a/regex-2026.7.19-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1d793a7988e04fcb1e2e135567443d82173225d657419ec09414a9b5a145b986", size = 784338 }, - { url = "https://files.pythonhosted.org/packages/f6/f7/b38ab3d43f284afbb618fcd15d0e77eb786ae461ce1f6bc7494619ddc0f2/regex-2026.7.19-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:e8b0abe7d870f53ca5143895fef7d1041a0c831a140d3dc2c760dd7ba25d4a8b", size = 860452 }, - { url = "https://files.pythonhosted.org/packages/15/5c/ff60ef0571121714f3cf9920bc183071e384a10b556d042e0fdb06cc07a5/regex-2026.7.19-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:4e5413bd5f13d3a4e3539ca98f70f75e7fca92518dd7f117f030ebedd10b60cb", size = 765958 }, - { url = "https://files.pythonhosted.org/packages/aa/0f/bd34021162c0ab47f9a315bd56cd5642e920c8e5668a75ef6c6a6fca590d/regex-2026.7.19-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:73b133a9e6fb512858e7f065e96f1180aa46646bc74a83aea62f1d314f3dd035", size = 851765 }, - { url = "https://files.pythonhosted.org/packages/2a/20/a2ca43edade0595cccfdc98636739f536d9e26898e7dbddc2b9e98898953/regex-2026.7.19-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dbe6493fbd27321b1d1f2dd4f5c7e5bd4d8b1d7cab7f32fd67db3d0b2ed8248a", size = 789714 }, - { url = "https://files.pythonhosted.org/packages/5d/47/e02db4015d424fc83c00ea0ac8c5e5ec14397943de9abf909d5ce3a25931/regex-2026.7.19-cp312-cp312-win32.whl", hash = "sha256:ddd67571c10869f65a5d7dde536d1e066e306cc90de57d7de4d5f34802428bb5", size = 267157 }, - { url = "https://files.pythonhosted.org/packages/08/8e/c780c131f79b42ed22d1bd7da4096c2c35f813e835acd02ef0f018bd892c/regex-2026.7.19-cp312-cp312-win_amd64.whl", hash = "sha256:e30d40268a28d54ce0437031750497004c22602b8e3ab891f759b795a003b312", size = 277777 }, - { url = "https://files.pythonhosted.org/packages/3e/4c/e4d7e086449bdf379d89774bf1f89dc4a41943f3c5a6125a03905b34b5fb/regex-2026.7.19-cp312-cp312-win_arm64.whl", hash = "sha256:de9208bb427130c82a5dbfd104f92c8876fc9559278c880b3002755bbbe9c83d", size = 277136 }, + { url = "https://files.pythonhosted.org/packages/3b/b9/d11d7e501ac8fd7d617684423ebb9561e0b998481c1e4cbc0cb212c5d74a/regex-2026.7.19-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2cc3460cedf7579948486eab03bc9ad7089df4d7281c0f47f4afe03e8d13f02d", size = 496778, upload-time = "2026-07-19T00:17:05.677Z" }, + { url = "https://files.pythonhosted.org/packages/3f/a9/a5ab6f312f24318019170dc485d5421fe4f89e43a98640da50d95a8a7041/regex-2026.7.19-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0e9554c8785eac5cffe6300f69a91f58ba72bc88a5f8d661235ad7c6aa5b8ccd", size = 297122, upload-time = "2026-07-19T00:17:07.59Z" }, + { url = "https://files.pythonhosted.org/packages/b3/63/4cab4d7f2d384a144d420b763d97674cb70619c878ea6fcd7640d0e62143/regex-2026.7.19-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d7da47a0f248977f08e2cb659ff3c17ddc13a4d39b3a7baa0a81bf5b415430f6", size = 292009, upload-time = "2026-07-19T00:17:09.648Z" }, + { url = "https://files.pythonhosted.org/packages/22/85/102a81b218298957d4ea7d2f084fae537a71add9d6ff93c8e67284c5f45e/regex-2026.7.19-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:93db40c8de0815baab96a06e08a984bac71f989d13bab789e382158c5d426797", size = 796708, upload-time = "2026-07-19T00:17:11.542Z" }, + { url = "https://files.pythonhosted.org/packages/78/b5/dc136af5629938a037cd2b304c12240e132ec92f38be8ff9cc89af2a1f2d/regex-2026.7.19-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:66bd62c59a5427746e8c44becae1d9b99d22fb13f30f492083dfb9ad7c45cc18", size = 865651, upload-time = "2026-07-19T00:17:13.312Z" }, + { url = "https://files.pythonhosted.org/packages/e0/75/67402ae3cd9c8c988a4c805d15ee3eef015e7ca4cb112cf3e640fc1f4153/regex-2026.7.19-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1649eb39fcc9ea80c4d2f110fde2b8ab2aef3877b98f02ab9b14e961f418c511", size = 911756, upload-time = "2026-07-19T00:17:15.015Z" }, + { url = "https://files.pythonhosted.org/packages/2a/8e/096d00c7c480ef2ff4265349b14e2261d4ab787ba1f74e2e80d1c58079c3/regex-2026.7.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9dce8ec9695f531a1b8a6f314fd4b393adcccf2ea861db480cdf97a301d01a68", size = 801798, upload-time = "2026-07-19T00:17:17.208Z" }, + { url = "https://files.pythonhosted.org/packages/f0/41/e7ecac6edb5722417f85cc67eaf386322fbe8acf6918ec2fdc37c20dd9d0/regex-2026.7.19-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3080a7fd38ef049bd489e01c970c97dd84ff446a885b0f1f6b26d9b1ad13ce11", size = 776933, upload-time = "2026-07-19T00:17:19.347Z" }, + { url = "https://files.pythonhosted.org/packages/6f/69/03c9b3f058d66403e0ca2c938696e81d51cd4c6d47ec5265f02f96948d9a/regex-2026.7.19-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1d793a7988e04fcb1e2e135567443d82173225d657419ec09414a9b5a145b986", size = 784338, upload-time = "2026-07-19T00:17:21.057Z" }, + { url = "https://files.pythonhosted.org/packages/f6/f7/b38ab3d43f284afbb618fcd15d0e77eb786ae461ce1f6bc7494619ddc0f2/regex-2026.7.19-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:e8b0abe7d870f53ca5143895fef7d1041a0c831a140d3dc2c760dd7ba25d4a8b", size = 860452, upload-time = "2026-07-19T00:17:23.119Z" }, + { url = "https://files.pythonhosted.org/packages/15/5c/ff60ef0571121714f3cf9920bc183071e384a10b556d042e0fdb06cc07a5/regex-2026.7.19-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:4e5413bd5f13d3a4e3539ca98f70f75e7fca92518dd7f117f030ebedd10b60cb", size = 765958, upload-time = "2026-07-19T00:17:24.81Z" }, + { url = "https://files.pythonhosted.org/packages/aa/0f/bd34021162c0ab47f9a315bd56cd5642e920c8e5668a75ef6c6a6fca590d/regex-2026.7.19-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:73b133a9e6fb512858e7f065e96f1180aa46646bc74a83aea62f1d314f3dd035", size = 851765, upload-time = "2026-07-19T00:17:26.993Z" }, + { url = "https://files.pythonhosted.org/packages/2a/20/a2ca43edade0595cccfdc98636739f536d9e26898e7dbddc2b9e98898953/regex-2026.7.19-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dbe6493fbd27321b1d1f2dd4f5c7e5bd4d8b1d7cab7f32fd67db3d0b2ed8248a", size = 789714, upload-time = "2026-07-19T00:17:28.699Z" }, + { url = "https://files.pythonhosted.org/packages/5d/47/e02db4015d424fc83c00ea0ac8c5e5ec14397943de9abf909d5ce3a25931/regex-2026.7.19-cp312-cp312-win32.whl", hash = "sha256:ddd67571c10869f65a5d7dde536d1e066e306cc90de57d7de4d5f34802428bb5", size = 267157, upload-time = "2026-07-19T00:17:31.051Z" }, + { url = "https://files.pythonhosted.org/packages/08/8e/c780c131f79b42ed22d1bd7da4096c2c35f813e835acd02ef0f018bd892c/regex-2026.7.19-cp312-cp312-win_amd64.whl", hash = "sha256:e30d40268a28d54ce0437031750497004c22602b8e3ab891f759b795a003b312", size = 277777, upload-time = "2026-07-19T00:17:32.848Z" }, + { url = "https://files.pythonhosted.org/packages/3e/4c/e4d7e086449bdf379d89774bf1f89dc4a41943f3c5a6125a03905b34b5fb/regex-2026.7.19-cp312-cp312-win_arm64.whl", hash = "sha256:de9208bb427130c82a5dbfd104f92c8876fc9559278c880b3002755bbbe9c83d", size = 277136, upload-time = "2026-07-19T00:17:34.803Z" }, ] [[package]] @@ -857,9 +887,9 @@ dependencies = [ { name = "idna" }, { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856 } +sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075 }, + { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, ] [package.optional-dependencies] @@ -871,25 +901,25 @@ socks = [ name = "ruff" version = "0.16.5" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f3/85/c8e12473c93018f92d19dd988a294202e1c27426c47ec4de53ffb847b8d8/ruff-0.16.5.tar.gz", hash = "sha256:1b88500f9ffbcab3dedb0082c9f9492e91ec3d618aac1236a3e0189938f7040b", size = 4912003 } +sdist = { url = "https://files.pythonhosted.org/packages/f3/85/c8e12473c93018f92d19dd988a294202e1c27426c47ec4de53ffb847b8d8/ruff-0.16.5.tar.gz", hash = "sha256:1b88500f9ffbcab3dedb0082c9f9492e91ec3d618aac1236a3e0189938f7040b", size = 4912003, upload-time = "2026-08-27T16:34:18.258Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c6/b6/77c90a970fe2dae17a723acbd011043ea97c98d7deacccefdc4ba74ec512/ruff-0.16.5-py3-none-linux_armv6l.whl", hash = "sha256:12e5f673e774c35fbb62f288809c7653b73445f8ecec6b6063fd6ea3521aa14b", size = 10011941 }, - { url = "https://files.pythonhosted.org/packages/4b/46/6cf67cf6411885a1d6f7f6d801682f155536a85176d10b605e2ceffed8bd/ruff-0.16.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:eda58a5802de40e7ed5b32b64e0b32539338cc6fcd2c78f61e3ad6a0d79f51c3", size = 10204049 }, - { url = "https://files.pythonhosted.org/packages/46/fd/c8720ca7a090abf0c2fef4abe8a5ef6e5127ed15196d8886ff75a2b370e2/ruff-0.16.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5ae9a7b9a8875131f40f8fe967cc86abf899779efd663cb7ce3d572d01da7eb", size = 9809037 }, - { url = "https://files.pythonhosted.org/packages/43/45/a684caacdedaca180f52bacccc40bf0789d2c5a7c75f25324853e9eaedb5/ruff-0.16.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b719b0a1f4d59710d283ab2965f621684a108a9e41da622e3b23f0326cd0025", size = 9964129 }, - { url = "https://files.pythonhosted.org/packages/9e/f2/5d2bcdaca6b5b93d1b4dfc166cd2aebf7680143a1b38a28759df13a94d31/ruff-0.16.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2298f2780ed1be0c5cb1361e32ab7b1467f3cce7dabe101d2210a314f2fe42e9", size = 9821518 }, - { url = "https://files.pythonhosted.org/packages/aa/ff/011cce29accf9257d5974145b733fc653a37985ed6825413a3987cefbfe0/ruff-0.16.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:258f29035a2dd021e7861e631b227a5b3f14e50c1184c9a6a122c5f4576154d7", size = 10534835 }, - { url = "https://files.pythonhosted.org/packages/d7/5a/f0cf109bada9bba0e96c90c21c9f9251803f57225c32d293327a03c710d6/ruff-0.16.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b9a4f0432966834019c74d1b7e5c51224305d7713f3d7faf3e7451f1a3be3cde", size = 11252550 }, - { url = "https://files.pythonhosted.org/packages/63/4d/1d481aaea2046c6a7ed7c291f9004c669cce3c087b6b376ed5b08271e3fe/ruff-0.16.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b5eb3a8c3d0ade9cea42b591fd530368e8798380e30e0a308b85a5cf718f09ea", size = 10777949 }, - { url = "https://files.pythonhosted.org/packages/ee/34/ee245ca55f64443233034b3d02b03236b19242004281247c079390b7facd/ruff-0.16.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef0f69e191a13a3c9816f63163c88790cb12cd157bbbb384e9c44745702ab105", size = 10311656 }, - { url = "https://files.pythonhosted.org/packages/a7/4d/c33a333e341c0a2b96c715b52d89a606f5a34cd4ac493cd9b8d0187186b8/ruff-0.16.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0eeab41fbea2c42f98dfb9822cdccda9d24ba38d49f6dc945b5c236d48f0ef29", size = 10532125 }, - { url = "https://files.pythonhosted.org/packages/30/e1/a64cef78b40192497bb98a27a8aa8f2c98ee9ee15bc97f7712d94ef32937/ruff-0.16.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f0768e9df4300713fff30733c87575f68b6f1d8de41184e505b7fdd9c0c95eaf", size = 10097648 }, - { url = "https://files.pythonhosted.org/packages/cc/4e/4cdc9ed3c3e109d2f71e62572a37457298d7bc7501ec3138babb7ed32bbd/ruff-0.16.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:95cc70cdc7aa80c338de356279d2adbeb2de0f520b9ecd8aba75b94e95e02f91", size = 9829344 }, - { url = "https://files.pythonhosted.org/packages/39/4a/31ed35ce31729955fc583ee0d176d6e784c1290cb0b0a75cb2134c1ab72a/ruff-0.16.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d185c8398ded1bfd91c0c2cb258346307571eccc473a8490af8c3977399c384a", size = 10277117 }, - { url = "https://files.pythonhosted.org/packages/a8/a0/60356d86687b4b666d593df213f4dc3041750d024cb7bf2cfa81cfd65c2e/ruff-0.16.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fb8e3a3c4c6a784150a7ced53b015f4b253fc2bf97a610886419ead64b4756ef", size = 10711653 }, - { url = "https://files.pythonhosted.org/packages/ed/20/656d67f5b25ca9bda4e02b1de25867b2954e1d19e03648060f167ad0f4cc/ruff-0.16.5-py3-none-win32.whl", hash = "sha256:288b0a5f080492fe5635db849f9e2e84aa3cce7b7f0e955997d416c507c76a26", size = 10034250 }, - { url = "https://files.pythonhosted.org/packages/5b/42/ee8e68a207b9127fcde6c3d7e197def432f346cb1af159e1fa14ca0d1cdc/ruff-0.16.5-py3-none-win_amd64.whl", hash = "sha256:ddc6385fb2137f616357ca03d6c74f4be987f80fed4008566b754f6032b8546f", size = 10516714 }, - { url = "https://files.pythonhosted.org/packages/73/e3/7df5a396e445b9ba49ce9a9437439a4d80042c61c0ade199abf8d16de1ac/ruff-0.16.5-py3-none-win_arm64.whl", hash = "sha256:a64abe90968719b851bb7cedffaa8753fbdbdadab483089682db623f3edc587e", size = 10391564 }, + { url = "https://files.pythonhosted.org/packages/c6/b6/77c90a970fe2dae17a723acbd011043ea97c98d7deacccefdc4ba74ec512/ruff-0.16.5-py3-none-linux_armv6l.whl", hash = "sha256:12e5f673e774c35fbb62f288809c7653b73445f8ecec6b6063fd6ea3521aa14b", size = 10011941, upload-time = "2026-08-27T16:33:41.287Z" }, + { url = "https://files.pythonhosted.org/packages/4b/46/6cf67cf6411885a1d6f7f6d801682f155536a85176d10b605e2ceffed8bd/ruff-0.16.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:eda58a5802de40e7ed5b32b64e0b32539338cc6fcd2c78f61e3ad6a0d79f51c3", size = 10204049, upload-time = "2026-08-27T16:33:44.056Z" }, + { url = "https://files.pythonhosted.org/packages/46/fd/c8720ca7a090abf0c2fef4abe8a5ef6e5127ed15196d8886ff75a2b370e2/ruff-0.16.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5ae9a7b9a8875131f40f8fe967cc86abf899779efd663cb7ce3d572d01da7eb", size = 9809037, upload-time = "2026-08-27T16:33:46.257Z" }, + { url = "https://files.pythonhosted.org/packages/43/45/a684caacdedaca180f52bacccc40bf0789d2c5a7c75f25324853e9eaedb5/ruff-0.16.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b719b0a1f4d59710d283ab2965f621684a108a9e41da622e3b23f0326cd0025", size = 9964129, upload-time = "2026-08-27T16:33:48.352Z" }, + { url = "https://files.pythonhosted.org/packages/9e/f2/5d2bcdaca6b5b93d1b4dfc166cd2aebf7680143a1b38a28759df13a94d31/ruff-0.16.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2298f2780ed1be0c5cb1361e32ab7b1467f3cce7dabe101d2210a314f2fe42e9", size = 9821518, upload-time = "2026-08-27T16:33:50.57Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ff/011cce29accf9257d5974145b733fc653a37985ed6825413a3987cefbfe0/ruff-0.16.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:258f29035a2dd021e7861e631b227a5b3f14e50c1184c9a6a122c5f4576154d7", size = 10534835, upload-time = "2026-08-27T16:33:52.522Z" }, + { url = "https://files.pythonhosted.org/packages/d7/5a/f0cf109bada9bba0e96c90c21c9f9251803f57225c32d293327a03c710d6/ruff-0.16.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b9a4f0432966834019c74d1b7e5c51224305d7713f3d7faf3e7451f1a3be3cde", size = 11252550, upload-time = "2026-08-27T16:33:54.521Z" }, + { url = "https://files.pythonhosted.org/packages/63/4d/1d481aaea2046c6a7ed7c291f9004c669cce3c087b6b376ed5b08271e3fe/ruff-0.16.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b5eb3a8c3d0ade9cea42b591fd530368e8798380e30e0a308b85a5cf718f09ea", size = 10777949, upload-time = "2026-08-27T16:33:56.88Z" }, + { url = "https://files.pythonhosted.org/packages/ee/34/ee245ca55f64443233034b3d02b03236b19242004281247c079390b7facd/ruff-0.16.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef0f69e191a13a3c9816f63163c88790cb12cd157bbbb384e9c44745702ab105", size = 10311656, upload-time = "2026-08-27T16:33:59.12Z" }, + { url = "https://files.pythonhosted.org/packages/a7/4d/c33a333e341c0a2b96c715b52d89a606f5a34cd4ac493cd9b8d0187186b8/ruff-0.16.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0eeab41fbea2c42f98dfb9822cdccda9d24ba38d49f6dc945b5c236d48f0ef29", size = 10532125, upload-time = "2026-08-27T16:34:01.166Z" }, + { url = "https://files.pythonhosted.org/packages/30/e1/a64cef78b40192497bb98a27a8aa8f2c98ee9ee15bc97f7712d94ef32937/ruff-0.16.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f0768e9df4300713fff30733c87575f68b6f1d8de41184e505b7fdd9c0c95eaf", size = 10097648, upload-time = "2026-08-27T16:34:03.16Z" }, + { url = "https://files.pythonhosted.org/packages/cc/4e/4cdc9ed3c3e109d2f71e62572a37457298d7bc7501ec3138babb7ed32bbd/ruff-0.16.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:95cc70cdc7aa80c338de356279d2adbeb2de0f520b9ecd8aba75b94e95e02f91", size = 9829344, upload-time = "2026-08-27T16:34:05.134Z" }, + { url = "https://files.pythonhosted.org/packages/39/4a/31ed35ce31729955fc583ee0d176d6e784c1290cb0b0a75cb2134c1ab72a/ruff-0.16.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d185c8398ded1bfd91c0c2cb258346307571eccc473a8490af8c3977399c384a", size = 10277117, upload-time = "2026-08-27T16:34:07.425Z" }, + { url = "https://files.pythonhosted.org/packages/a8/a0/60356d86687b4b666d593df213f4dc3041750d024cb7bf2cfa81cfd65c2e/ruff-0.16.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:fb8e3a3c4c6a784150a7ced53b015f4b253fc2bf97a610886419ead64b4756ef", size = 10711653, upload-time = "2026-08-27T16:34:09.712Z" }, + { url = "https://files.pythonhosted.org/packages/ed/20/656d67f5b25ca9bda4e02b1de25867b2954e1d19e03648060f167ad0f4cc/ruff-0.16.5-py3-none-win32.whl", hash = "sha256:288b0a5f080492fe5635db849f9e2e84aa3cce7b7f0e955997d416c507c76a26", size = 10034250, upload-time = "2026-08-27T16:34:11.8Z" }, + { url = "https://files.pythonhosted.org/packages/5b/42/ee8e68a207b9127fcde6c3d7e197def432f346cb1af159e1fa14ca0d1cdc/ruff-0.16.5-py3-none-win_amd64.whl", hash = "sha256:ddc6385fb2137f616357ca03d6c74f4be987f80fed4008566b754f6032b8546f", size = 10516714, upload-time = "2026-08-27T16:34:13.963Z" }, + { url = "https://files.pythonhosted.org/packages/73/e3/7df5a396e445b9ba49ce9a9437439a4d80042c61c0ade199abf8d16de1ac/ruff-0.16.5-py3-none-win_arm64.whl", hash = "sha256:a64abe90968719b851bb7cedffaa8753fbdbdadab483089682db623f3edc587e", size = 10391564, upload-time = "2026-08-27T16:34:16.064Z" }, ] [[package]] @@ -899,18 +929,60 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "botocore" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/76/43/35e4d8aa320bffe8287fe8f65f578fa2d2db0a64212f0e710dce58267854/s3transfer-0.19.2.tar.gz", hash = "sha256:ba0309fd86be3c27dbf78cdd813c13c5e1df16e5874b99d2535ebbdfb9892993", size = 165592 } +sdist = { url = "https://files.pythonhosted.org/packages/76/43/35e4d8aa320bffe8287fe8f65f578fa2d2db0a64212f0e710dce58267854/s3transfer-0.19.2.tar.gz", hash = "sha256:ba0309fd86be3c27dbf78cdd813c13c5e1df16e5874b99d2535ebbdfb9892993", size = 165592, upload-time = "2026-07-22T19:30:44.432Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bc/e7/5c595c75e9f41a44f30e526eda465ea0b4eec93470e074e4a111b253f13a/s3transfer-0.19.2-py3-none-any.whl", hash = "sha256:d8168eccca828cbb2cd573675333f3bddd254313a9c42494b84c76b539e8ba25", size = 90216 }, + { url = "https://files.pythonhosted.org/packages/bc/e7/5c595c75e9f41a44f30e526eda465ea0b4eec93470e074e4a111b253f13a/s3transfer-0.19.2-py3-none-any.whl", hash = "sha256:d8168eccca828cbb2cd573675333f3bddd254313a9c42494b84c76b539e8ba25", size = 90216, upload-time = "2026-07-22T19:30:43.251Z" }, +] + +[[package]] +name = "scikit-learn" +version = "1.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "joblib" }, + { name = "narwhals" }, + { name = "numpy" }, + { name = "scipy" }, + { name = "threadpoolctl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d2/eb/eaf5e07fcc0da7149b0e084f24e54edd7441b9a89ce7e034032ae97fe3a0/scikit_learn-1.9.1.tar.gz", hash = "sha256:629cada3e33e2b9bf376cdc7614a47a4140b8aedc1d836579e359736fbd82977", size = 7786908, upload-time = "2026-09-10T18:34:04.679Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/a7/25f0a43d2fde306e8ef45f45121192f687b79beaf4bae8c21607c46c5e63/scikit_learn-1.9.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0c0f8b5d09b44101cea2767f300680bada1ea27f976fe4b48b83950a4f55a49a", size = 8775209, upload-time = "2026-09-10T18:32:42.804Z" }, + { url = "https://files.pythonhosted.org/packages/60/ea/57e57539ce175d774fc291ed091b0a6d756854b92cd92554c6bb4d0ae498/scikit_learn-1.9.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:8c14ce41d561f7749f990b41d6703fe02c4669fbc485e598e069e0a1967b488e", size = 8295541, upload-time = "2026-09-10T18:32:45.069Z" }, + { url = "https://files.pythonhosted.org/packages/78/2b/5721a174406bfba49bce20ae997b3b64cf355c3f623a2638284ab6a82156/scikit_learn-1.9.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e4c20a6c017d820faa7ac8c783e3d0c6a9a2e297bf9f55332ca17cdf7fd4d04d", size = 8871592, upload-time = "2026-09-10T18:32:46.999Z" }, + { url = "https://files.pythonhosted.org/packages/8e/57/a50162f3d29feb979ab6347c6debda506dfb525bcff3c50dd17606651c7e/scikit_learn-1.9.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e5d7b18a5b9dca241a74695f3275fa4c895a9dadc72b3d8df5fa9d1083c9b83e", size = 9166043, upload-time = "2026-09-10T18:32:49.343Z" }, + { url = "https://files.pythonhosted.org/packages/72/8d/27c054166bac671770d1ea0ef7716134fe8119c0df224a58c89fd735a61c/scikit_learn-1.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:4b59abb30618121cc46b45972d6bf53a7128b4df4cd346c6ca6f4d5f9031e49c", size = 8262238, upload-time = "2026-09-10T18:32:51.679Z" }, + { url = "https://files.pythonhosted.org/packages/9d/d6/493086006ea0c68ad62c40a8dece1961b61bf503f45400f133d47f56e5be/scikit_learn-1.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:d5945a2908be62350e2978344e62b56c1552c2ca4f844ebf6277c94944d647dd", size = 7902102, upload-time = "2026-09-10T18:32:53.67Z" }, +] + +[[package]] +name = "scipy" +version = "1.18.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7e/74/66de6258867beb2ef08f35f9f2ac017a52cacd5081714d239ff1a442d458/scipy-1.18.1.tar.gz", hash = "sha256:52c4b7422442aba924d03ad4019852b08a92e64ea187b933135687bfe2747307", size = 30781235, upload-time = "2026-08-21T23:28:50.599Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/f7/240c110c08693826b4513a52f5717d62ec7c7af72f2920821247c03b17b3/scipy-1.18.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:457fd7a2a8edeb044ab6ffbc0aa03ff6cd18491356e5e0c834d76ce621b916d1", size = 31111061, upload-time = "2026-08-21T23:23:44.522Z" }, + { url = "https://files.pythonhosted.org/packages/05/4a/78c6285577c375e7cf27277ea8ee6961224327f1e1a0c44af5f17f23635c/scipy-1.18.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:e708533e8b2ae2497d65346538a7dcc92814410b25b81432eac66de0f2af8265", size = 28733332, upload-time = "2026-08-21T23:23:50.015Z" }, + { url = "https://files.pythonhosted.org/packages/a5/f6/a5b82f8abbe14d134691b8b903696f701d25a081353a29dc655c364d9e62/scipy-1.18.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:7bbf207c4453ce1ad2e00b17313852b33310b83090c2311bdaf97f93c0380d12", size = 20475078, upload-time = "2026-08-21T23:23:54.138Z" }, + { url = "https://files.pythonhosted.org/packages/23/22/0858a0bbd6b3e825ceb8cd9baf9eaf3b2f2b1d77727eb6be40500bcdc92f/scipy-1.18.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:78c0665edead396b1abb4897c41a5c1d9bf090c8a637a4c20a61678e0a264e66", size = 23108904, upload-time = "2026-08-21T23:23:57.824Z" }, + { url = "https://files.pythonhosted.org/packages/75/9a/2e71719f31eaefe0e3a1706c4a1ded94e664bfd95ffca2b219a671faee01/scipy-1.18.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3c085faa2cfa879c5141df483f836f4d691045a078224a670fa570fa01612d89", size = 34025113, upload-time = "2026-08-21T23:24:02.209Z" }, + { url = "https://files.pythonhosted.org/packages/df/64/ff35eb9e54894cf471ff4716abd3c81eb0a0626869217ce3e6ba4ccf17d7/scipy-1.18.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f55fa87b6c612ecd6b058f167c53231b1d14e412efe361d3d6e38b3631c73218", size = 35344199, upload-time = "2026-08-21T23:24:07.844Z" }, + { url = "https://files.pythonhosted.org/packages/d3/af/c5538be1792f7034c12c7db6ee67cace58253c7b87b122d68253eaf5de89/scipy-1.18.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c35d74ce0e193ff740c2f2be2ac913ddc232fe6c1ff40b26cfecb9c670c63314", size = 35639587, upload-time = "2026-08-21T23:24:13.05Z" }, + { url = "https://files.pythonhosted.org/packages/91/4c/075e4f66471bac101141ac739e9e135549be1bae584571bd03a530c056e1/scipy-1.18.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d2924a03db38dc2e848bca2fe9f077dafb891480b91a00a0963a8cf86dfc31c1", size = 37480330, upload-time = "2026-08-21T23:24:19.608Z" }, + { url = "https://files.pythonhosted.org/packages/39/e7/979fd14e75008623df31ba70d6bb144700f68feadcea042021c06a05bf82/scipy-1.18.1-cp312-cp312-win_amd64.whl", hash = "sha256:5e4d44984abc0020154ea81b247adeddcc3ac5527b975ff798bd1ba0adc513c2", size = 36658278, upload-time = "2026-08-21T23:24:25.463Z" }, + { url = "https://files.pythonhosted.org/packages/c7/0b/e1525354ff9d7d5feb6d1b31af6d14072e5c91e9607b421fa1ec889660b3/scipy-1.18.1-cp312-cp312-win_arm64.whl", hash = "sha256:d65d448389b8436493abcf629cc94ad0cf32aecaf06e1acca1de53cc795f2f12", size = 24400588, upload-time = "2026-08-21T23:24:30.579Z" }, ] [[package]] name = "six" version = "1.17.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031 } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050 }, + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, ] [[package]] @@ -947,6 +1019,7 @@ dev = [ { name = "pytest-cov" }, { name = "pyyaml" }, { name = "ruff" }, + { name = "scikit-learn" }, { name = "statelint" }, { name = "warp-lang" }, ] @@ -982,6 +1055,7 @@ dev = [ { name = "pytest-cov", specifier = ">=6.0.0,<7.0.0" }, { name = "pyyaml", specifier = ">=6.0.1,<7.0.0" }, { name = "ruff", specifier = ">=0.5.5,<1.0.0" }, + { name = "scikit-learn", specifier = ">=1.9.1" }, { name = "statelint", specifier = ">=2.0.0,<3.0.0" }, { name = "warp-lang", specifier = ">=1.11.0,<2.0.0" }, ] @@ -999,9 +1073,9 @@ dependencies = [ name = "soupsieve" version = "2.9.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/69/99/a6ca3beb3ccacb41fb3321d8a60e5566f9e6467601ef8eba6a17e1b89778/soupsieve-2.9.2.tar.gz", hash = "sha256:4a55d8cf158a9c2e587fa4922f1bbb91d68ac829e2d6f25403a85747c71daf74", size = 122445 } +sdist = { url = "https://files.pythonhosted.org/packages/69/99/a6ca3beb3ccacb41fb3321d8a60e5566f9e6467601ef8eba6a17e1b89778/soupsieve-2.9.2.tar.gz", hash = "sha256:4a55d8cf158a9c2e587fa4922f1bbb91d68ac829e2d6f25403a85747c71daf74", size = 122445, upload-time = "2026-08-07T00:57:24.801Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/dc/ad025c1ee131eba60c69f4dd5779b18fcf1e6b21a343e2162a84d5d133c7/soupsieve-2.9.2-py3-none-any.whl", hash = "sha256:8089a26fd974ca7a1f30276d3d8492ab266ab15af581642dfe8aa162e0c1c823", size = 37370 }, + { url = "https://files.pythonhosted.org/packages/eb/dc/ad025c1ee131eba60c69f4dd5779b18fcf1e6b21a343e2162a84d5d133c7/soupsieve-2.9.2-py3-none-any.whl", hash = "sha256:8089a26fd974ca7a1f30276d3d8492ab266ab15af581642dfe8aa162e0c1c823", size = 37370, upload-time = "2026-08-07T00:57:23.524Z" }, ] [[package]] @@ -1012,9 +1086,9 @@ dependencies = [ { name = "python-dateutil" }, { name = "regex" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6d/16/00370c38ba07c257fcfd58e3507fe2dbfbdf77a6668dab38029cd6365792/statelint-2.0.0.tar.gz", hash = "sha256:0f6ffda86cfc398ca58f29706cfbf1a4b11c49143244cf4391c2101d61d07107", size = 31617 } +sdist = { url = "https://files.pythonhosted.org/packages/6d/16/00370c38ba07c257fcfd58e3507fe2dbfbdf77a6668dab38029cd6365792/statelint-2.0.0.tar.gz", hash = "sha256:0f6ffda86cfc398ca58f29706cfbf1a4b11c49143244cf4391c2101d61d07107", size = 31617, upload-time = "2025-04-26T14:08:48.055Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6d/e3/033b5e0fc42b0e2c44aa0e201bb084eb1a91e36a87b021dcc8185cacce97/statelint-2.0.0-py2.py3-none-any.whl", hash = "sha256:053e54391aabcefd975d4e445bc18a649cd92c0e2ef1598e5b8c077ce3321233", size = 37432 }, + { url = "https://files.pythonhosted.org/packages/6d/e3/033b5e0fc42b0e2c44aa0e201bb084eb1a91e36a87b021dcc8185cacce97/statelint-2.0.0-py2.py3-none-any.whl", hash = "sha256:053e54391aabcefd975d4e445bc18a649cd92c0e2ef1598e5b8c077ce3321233", size = 37432, upload-time = "2025-04-26T14:08:46.837Z" }, ] [[package]] @@ -1027,18 +1101,18 @@ dependencies = [ { name = "pydantic" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/13/30/fee43d523d3f680a833a4aae5bf8094de0b9031b0c2bddb3e0bc6e829e1b/storage3-2.31.0.tar.gz", hash = "sha256:d2161e2ea650dc115a1787c30e09b118365589ac772f4dd8643e3a503ecfc667", size = 20348 } +sdist = { url = "https://files.pythonhosted.org/packages/13/30/fee43d523d3f680a833a4aae5bf8094de0b9031b0c2bddb3e0bc6e829e1b/storage3-2.31.0.tar.gz", hash = "sha256:d2161e2ea650dc115a1787c30e09b118365589ac772f4dd8643e3a503ecfc667", size = 20348, upload-time = "2026-06-04T13:37:23.703Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2f/b2/60d86a3a99ae743e8a00a6df912f85269b3bc882ba217b8ce1690881c669/storage3-2.31.0-py3-none-any.whl", hash = "sha256:4bf46e8bea320743179a6beafdc7531c5242495e00e0cc22af7c7a9d69d4ed84", size = 28492 }, + { url = "https://files.pythonhosted.org/packages/2f/b2/60d86a3a99ae743e8a00a6df912f85269b3bc882ba217b8ce1690881c669/storage3-2.31.0-py3-none-any.whl", hash = "sha256:4bf46e8bea320743179a6beafdc7531c5242495e00e0cc22af7c7a9d69d4ed84", size = 28492, upload-time = "2026-06-04T13:37:22.792Z" }, ] [[package]] name = "strenum" version = "0.4.15" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/85/ad/430fb60d90e1d112a62ff57bdd1f286ec73a2a0331272febfddd21f330e1/StrEnum-0.4.15.tar.gz", hash = "sha256:878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff", size = 23384 } +sdist = { url = "https://files.pythonhosted.org/packages/85/ad/430fb60d90e1d112a62ff57bdd1f286ec73a2a0331272febfddd21f330e1/StrEnum-0.4.15.tar.gz", hash = "sha256:878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff", size = 23384, upload-time = "2023-06-29T22:02:58.399Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/81/69/297302c5f5f59c862faa31e6cb9a4cd74721cd1e052b38e464c5b402df8b/StrEnum-0.4.15-py3-none-any.whl", hash = "sha256:a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659", size = 8851 }, + { url = "https://files.pythonhosted.org/packages/81/69/297302c5f5f59c862faa31e6cb9a4cd74721cd1e052b38e464c5b402df8b/StrEnum-0.4.15-py3-none-any.whl", hash = "sha256:a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659", size = 8851, upload-time = "2023-06-29T22:02:56.947Z" }, ] [[package]] @@ -1054,9 +1128,9 @@ dependencies = [ { name = "supabase-functions" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fe/8e/54a2f950629689b1613434a61fc3bff5f92f84ba6b20213f5b2add05c1bb/supabase-2.31.0.tar.gz", hash = "sha256:3467b09d00482b9a0138235bdbde7a350426f93cf2a1342372eaddfc669f1206", size = 9805 } +sdist = { url = "https://files.pythonhosted.org/packages/fe/8e/54a2f950629689b1613434a61fc3bff5f92f84ba6b20213f5b2add05c1bb/supabase-2.31.0.tar.gz", hash = "sha256:3467b09d00482b9a0138235bdbde7a350426f93cf2a1342372eaddfc669f1206", size = 9805, upload-time = "2026-06-04T13:37:25.22Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/06/5e6f4bf89dedadf81f893832115c1866da1aa093142c9989c2818780dae3/supabase-2.31.0-py3-none-any.whl", hash = "sha256:25f2a99207a75f2d9377e2332783b4389cf56b02cbebdaf0c1743112dcbb704e", size = 16728 }, + { url = "https://files.pythonhosted.org/packages/95/06/5e6f4bf89dedadf81f893832115c1866da1aa093142c9989c2818780dae3/supabase-2.31.0-py3-none-any.whl", hash = "sha256:25f2a99207a75f2d9377e2332783b4389cf56b02cbebdaf0c1743112dcbb704e", size = 16728, upload-time = "2026-06-04T13:37:24.278Z" }, ] [[package]] @@ -1068,9 +1142,9 @@ dependencies = [ { name = "pydantic" }, { name = "pyjwt", extra = ["crypto"] }, ] -sdist = { url = "https://files.pythonhosted.org/packages/61/8a/408689cf39820f0d46d2731d6747ff94dbefc87ae977b4b5c4066da5b070/supabase_auth-2.31.0.tar.gz", hash = "sha256:0945b33fa96239c76dc8eaf96d7d2c94991950d24b4cfe4a5c2da9aa5e909663", size = 39151 } +sdist = { url = "https://files.pythonhosted.org/packages/61/8a/408689cf39820f0d46d2731d6747ff94dbefc87ae977b4b5c4066da5b070/supabase_auth-2.31.0.tar.gz", hash = "sha256:0945b33fa96239c76dc8eaf96d7d2c94991950d24b4cfe4a5c2da9aa5e909663", size = 39151, upload-time = "2026-06-04T13:37:27.375Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ca/5e/22f3b0546bb1f0985f06fb1ebf5f6405a3b1bb7a5db01142c26cf148e988/supabase_auth-2.31.0-py3-none-any.whl", hash = "sha256:5e9c8b4ecdee6af04dbcb06455ce78cb15674806fcb6b425170455307d70b0ee", size = 48363 }, + { url = "https://files.pythonhosted.org/packages/ca/5e/22f3b0546bb1f0985f06fb1ebf5f6405a3b1bb7a5db01142c26cf148e988/supabase_auth-2.31.0-py3-none-any.whl", hash = "sha256:5e9c8b4ecdee6af04dbcb06455ce78cb15674806fcb6b425170455307d70b0ee", size = 48363, upload-time = "2026-06-04T13:37:26.26Z" }, ] [[package]] @@ -1082,18 +1156,27 @@ dependencies = [ { name = "strenum" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/84/5d/61c2446ed26a57fa5543f9c270a731320911569202340d15341f72cdba7c/supabase_functions-2.31.0.tar.gz", hash = "sha256:4ad027b3ae3bd28b31233339f4db1da6965affd3546f655b421baf40cee2690f", size = 4683 } +sdist = { url = "https://files.pythonhosted.org/packages/84/5d/61c2446ed26a57fa5543f9c270a731320911569202340d15341f72cdba7c/supabase_functions-2.31.0.tar.gz", hash = "sha256:4ad027b3ae3bd28b31233339f4db1da6965affd3546f655b421baf40cee2690f", size = 4683, upload-time = "2026-06-04T13:37:28.878Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/90/79/1a8162ce7d705381a4f2668c0da68e097b103c1aa701418a31da52905c7b/supabase_functions-2.31.0-py3-none-any.whl", hash = "sha256:3fdc4c4766152bfda63bdd0e286fc8a06f50e1280711fae4a1dfc9b7e9ebabc6", size = 8794, upload-time = "2026-06-04T13:37:28.022Z" }, +] + +[[package]] +name = "threadpoolctl" +version = "3.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/00/dc/6c58154c1c65f758ea979e7139cb76993a9cfc662d14e9be3c4a667cfb77/threadpoolctl-3.7.0.tar.gz", hash = "sha256:61348cfb77d53b9242e0017029244b559b810c142ced65b4e21eeca1843959a7", size = 31961, upload-time = "2026-09-15T15:46:20.263Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/90/79/1a8162ce7d705381a4f2668c0da68e097b103c1aa701418a31da52905c7b/supabase_functions-2.31.0-py3-none-any.whl", hash = "sha256:3fdc4c4766152bfda63bdd0e286fc8a06f50e1280711fae4a1dfc9b7e9ebabc6", size = 8794 }, + { url = "https://files.pythonhosted.org/packages/43/3f/f88a53f60a472b46f4023f56d204dd7de33d34c5d2acbfa0d70a674e639e/threadpoolctl-3.7.0-py3-none-any.whl", hash = "sha256:cd8b60b5641b45c67bbf73c64c843235fc2d8a480c87389f52f5dbee893b86be", size = 26362, upload-time = "2026-09-15T15:46:19.168Z" }, ] [[package]] name = "typing-extensions" version = "4.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555 } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571 }, + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, ] [[package]] @@ -1103,36 +1186,36 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928 } +sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928, upload-time = "2026-08-12T12:37:25.997Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750 }, + { url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" }, ] [[package]] name = "tzdata" version = "2026.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/92/ff/5a28bdfd8c3ebec42564ac7d0e54ca3db65044a9314a97f9564fa7a1e926/tzdata-2026.3.tar.gz", hash = "sha256:4a1518b8993086a7982523e071643f3c0e5f213e75b21318e78bcabfff9d1415", size = 198674 } +sdist = { url = "https://files.pythonhosted.org/packages/92/ff/5a28bdfd8c3ebec42564ac7d0e54ca3db65044a9314a97f9564fa7a1e926/tzdata-2026.3.tar.gz", hash = "sha256:4a1518b8993086a7982523e071643f3c0e5f213e75b21318e78bcabfff9d1415", size = 198674, upload-time = "2026-07-10T08:50:37.887Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/6d/b53b99a9f2766d095985947a5782f1702cabb129a34f7a802d7197af832f/tzdata-2026.3-py2.py3-none-any.whl", hash = "sha256:dc096730c87af6cab1b171c9d532be840741ff5d459015e7f6947bd7d7e54931", size = 348168 }, + { url = "https://files.pythonhosted.org/packages/e5/6d/b53b99a9f2766d095985947a5782f1702cabb129a34f7a802d7197af832f/tzdata-2026.3-py2.py3-none-any.whl", hash = "sha256:dc096730c87af6cab1b171c9d532be840741ff5d459015e7f6947bd7d7e54931", size = 348168, upload-time = "2026-07-10T08:50:36.46Z" }, ] [[package]] name = "unidecode" version = "1.4.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/94/7d/a8a765761bbc0c836e397a2e48d498305a865b70a8600fd7a942e85dcf63/Unidecode-1.4.0.tar.gz", hash = "sha256:ce35985008338b676573023acc382d62c264f307c8f7963733405add37ea2b23", size = 200149 } +sdist = { url = "https://files.pythonhosted.org/packages/94/7d/a8a765761bbc0c836e397a2e48d498305a865b70a8600fd7a942e85dcf63/Unidecode-1.4.0.tar.gz", hash = "sha256:ce35985008338b676573023acc382d62c264f307c8f7963733405add37ea2b23", size = 200149, upload-time = "2025-04-24T08:45:03.798Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8f/b7/559f59d57d18b44c6d1250d2eeaa676e028b9c527431f5d0736478a73ba1/Unidecode-1.4.0-py3-none-any.whl", hash = "sha256:c3c7606c27503ad8d501270406e345ddb480a7b5f38827eafe4fa82a137f0021", size = 235837 }, + { url = "https://files.pythonhosted.org/packages/8f/b7/559f59d57d18b44c6d1250d2eeaa676e028b9c527431f5d0736478a73ba1/Unidecode-1.4.0-py3-none-any.whl", hash = "sha256:c3c7606c27503ad8d501270406e345ddb480a7b5f38827eafe4fa82a137f0021", size = 235837, upload-time = "2025-04-24T08:45:01.609Z" }, ] [[package]] name = "urllib3" version = "2.7.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602 } +sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087 }, + { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" }, ] [[package]] @@ -1145,9 +1228,9 @@ dependencies = [ { name = "platformdirs" }, { name = "python-discovery" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/79/41/c3f34799487924f2a6f43b8a8b7acd345a6c61aac2211d4bced8621ca4f1/virtualenv-21.7.7.tar.gz", hash = "sha256:6874376f99ba6b8d4e3ee8bde67f9285412400c7d5b29ba41ee6daa5e0221bdc", size = 5347022 } +sdist = { url = "https://files.pythonhosted.org/packages/79/41/c3f34799487924f2a6f43b8a8b7acd345a6c61aac2211d4bced8621ca4f1/virtualenv-21.7.7.tar.gz", hash = "sha256:6874376f99ba6b8d4e3ee8bde67f9285412400c7d5b29ba41ee6daa5e0221bdc", size = 5347022, upload-time = "2026-08-28T18:59:50.093Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/f8/dcec8dc767b812193316c7debed1e2b53e586e59c267bfe517688ff90275/virtualenv-21.7.7-py3-none-any.whl", hash = "sha256:67a6a68fef3ad8ca16b8b89f33fd8f97996cc0bf0db31629d07ecf8dec539a2c", size = 5324620 }, + { url = "https://files.pythonhosted.org/packages/95/f8/dcec8dc767b812193316c7debed1e2b53e586e59c267bfe517688ff90275/virtualenv-21.7.7-py3-none-any.whl", hash = "sha256:67a6a68fef3ad8ca16b8b89f33fd8f97996cc0bf0db31629d07ecf8dec539a2c", size = 5324620, upload-time = "2026-08-28T18:59:48.056Z" }, ] [[package]] @@ -1158,30 +1241,30 @@ dependencies = [ { name = "numpy" }, ] wheels = [ - { url = "https://files.pythonhosted.org/packages/73/8a/8be711f3b5431a6e0bdb97117d681b03cf2bb95d6fcf8869861900898d88/warp_lang-1.16.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:19a7590c4484e8250ab19165311d2a1774138663b361c41e8be2865c7515c4ae", size = 25221601 }, - { url = "https://files.pythonhosted.org/packages/1d/3d/47feef2eee4739437e19d6949ea231ca4181c9eacbaa39144761e6130d94/warp_lang-1.16.0-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:96449fc1e3b354185e2f09434fb794b5953ab2e8673b104d7e7f48d5d418bb35", size = 163074225 }, - { url = "https://files.pythonhosted.org/packages/db/96/0c2b070b3101c669955cafd36262548b2e8b00dfdeda3aeb7afbc0f9d65c/warp_lang-1.16.0-py3-none-manylinux_2_34_aarch64.whl", hash = "sha256:d4715171bd6821436b82293d774c9a082ace08215c189572b4348d1e48fb8ee8", size = 167563789 }, - { url = "https://files.pythonhosted.org/packages/7e/17/c98fab81156f0d25f17200f52f69210b94a9abba101066736df8cc493522/warp_lang-1.16.0-py3-none-win_amd64.whl", hash = "sha256:8690c9096e0a271985339d4aa4b37675e7d62852620ca861ac032dc85b124542", size = 146387135 }, + { url = "https://files.pythonhosted.org/packages/73/8a/8be711f3b5431a6e0bdb97117d681b03cf2bb95d6fcf8869861900898d88/warp_lang-1.16.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:19a7590c4484e8250ab19165311d2a1774138663b361c41e8be2865c7515c4ae", size = 25221601, upload-time = "2026-08-03T02:26:38.389Z" }, + { url = "https://files.pythonhosted.org/packages/1d/3d/47feef2eee4739437e19d6949ea231ca4181c9eacbaa39144761e6130d94/warp_lang-1.16.0-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:96449fc1e3b354185e2f09434fb794b5953ab2e8673b104d7e7f48d5d418bb35", size = 163074225, upload-time = "2026-08-03T02:27:03.632Z" }, + { url = "https://files.pythonhosted.org/packages/db/96/0c2b070b3101c669955cafd36262548b2e8b00dfdeda3aeb7afbc0f9d65c/warp_lang-1.16.0-py3-none-manylinux_2_34_aarch64.whl", hash = "sha256:d4715171bd6821436b82293d774c9a082ace08215c189572b4348d1e48fb8ee8", size = 167563789, upload-time = "2026-08-03T02:27:37.512Z" }, + { url = "https://files.pythonhosted.org/packages/7e/17/c98fab81156f0d25f17200f52f69210b94a9abba101066736df8cc493522/warp_lang-1.16.0-py3-none-win_amd64.whl", hash = "sha256:8690c9096e0a271985339d4aa4b37675e7d62852620ca861ac032dc85b124542", size = 146387135, upload-time = "2026-08-03T02:28:17.956Z" }, ] [[package]] name = "websockets" version = "15.0.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016 } +sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016, upload-time = "2025-03-05T20:03:41.606Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/51/6b/4545a0d843594f5d0771e86463606a3988b5a09ca5123136f8a76580dd63/websockets-15.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3e90baa811a5d73f3ca0bcbf32064d663ed81318ab225ee4f427ad4e26e5aff3", size = 175437 }, - { url = "https://files.pythonhosted.org/packages/f4/71/809a0f5f6a06522af902e0f2ea2757f71ead94610010cf570ab5c98e99ed/websockets-15.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:592f1a9fe869c778694f0aa806ba0374e97648ab57936f092fd9d87f8bc03665", size = 173096 }, - { url = "https://files.pythonhosted.org/packages/3d/69/1a681dd6f02180916f116894181eab8b2e25b31e484c5d0eae637ec01f7c/websockets-15.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2", size = 173332 }, - { url = "https://files.pythonhosted.org/packages/a6/02/0073b3952f5bce97eafbb35757f8d0d54812b6174ed8dd952aa08429bcc3/websockets-15.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b56bdcdb4505c8078cb6c7157d9811a85790f2f2b3632c7d1462ab5783d215", size = 183152 }, - { url = "https://files.pythonhosted.org/packages/74/45/c205c8480eafd114b428284840da0b1be9ffd0e4f87338dc95dc6ff961a1/websockets-15.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0af68c55afbd5f07986df82831c7bff04846928ea8d1fd7f30052638788bc9b5", size = 182096 }, - { url = "https://files.pythonhosted.org/packages/14/8f/aa61f528fba38578ec553c145857a181384c72b98156f858ca5c8e82d9d3/websockets-15.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64dee438fed052b52e4f98f76c5790513235efaa1ef7f3f2192c392cd7c91b65", size = 182523 }, - { url = "https://files.pythonhosted.org/packages/ec/6d/0267396610add5bc0d0d3e77f546d4cd287200804fe02323797de77dbce9/websockets-15.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d5f6b181bb38171a8ad1d6aa58a67a6aa9d4b38d0f8c5f496b9e42561dfc62fe", size = 182790 }, - { url = "https://files.pythonhosted.org/packages/02/05/c68c5adbf679cf610ae2f74a9b871ae84564462955d991178f95a1ddb7dd/websockets-15.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5d54b09eba2bada6011aea5375542a157637b91029687eb4fdb2dab11059c1b4", size = 182165 }, - { url = "https://files.pythonhosted.org/packages/29/93/bb672df7b2f5faac89761cb5fa34f5cec45a4026c383a4b5761c6cea5c16/websockets-15.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be571a8b5afed347da347bfcf27ba12b069d9d7f42cb8c7028b5e98bbb12597", size = 182160 }, - { url = "https://files.pythonhosted.org/packages/ff/83/de1f7709376dc3ca9b7eeb4b9a07b4526b14876b6d372a4dc62312bebee0/websockets-15.0.1-cp312-cp312-win32.whl", hash = "sha256:c338ffa0520bdb12fbc527265235639fb76e7bc7faafbb93f6ba80d9c06578a9", size = 176395 }, - { url = "https://files.pythonhosted.org/packages/7d/71/abf2ebc3bbfa40f391ce1428c7168fb20582d0ff57019b69ea20fa698043/websockets-15.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcd5cf9e305d7b8338754470cf69cf81f420459dbae8a3b40cee57417f4614a7", size = 176841 }, - { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743 }, + { url = "https://files.pythonhosted.org/packages/51/6b/4545a0d843594f5d0771e86463606a3988b5a09ca5123136f8a76580dd63/websockets-15.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3e90baa811a5d73f3ca0bcbf32064d663ed81318ab225ee4f427ad4e26e5aff3", size = 175437, upload-time = "2025-03-05T20:02:16.706Z" }, + { url = "https://files.pythonhosted.org/packages/f4/71/809a0f5f6a06522af902e0f2ea2757f71ead94610010cf570ab5c98e99ed/websockets-15.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:592f1a9fe869c778694f0aa806ba0374e97648ab57936f092fd9d87f8bc03665", size = 173096, upload-time = "2025-03-05T20:02:18.832Z" }, + { url = "https://files.pythonhosted.org/packages/3d/69/1a681dd6f02180916f116894181eab8b2e25b31e484c5d0eae637ec01f7c/websockets-15.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2", size = 173332, upload-time = "2025-03-05T20:02:20.187Z" }, + { url = "https://files.pythonhosted.org/packages/a6/02/0073b3952f5bce97eafbb35757f8d0d54812b6174ed8dd952aa08429bcc3/websockets-15.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b56bdcdb4505c8078cb6c7157d9811a85790f2f2b3632c7d1462ab5783d215", size = 183152, upload-time = "2025-03-05T20:02:22.286Z" }, + { url = "https://files.pythonhosted.org/packages/74/45/c205c8480eafd114b428284840da0b1be9ffd0e4f87338dc95dc6ff961a1/websockets-15.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0af68c55afbd5f07986df82831c7bff04846928ea8d1fd7f30052638788bc9b5", size = 182096, upload-time = "2025-03-05T20:02:24.368Z" }, + { url = "https://files.pythonhosted.org/packages/14/8f/aa61f528fba38578ec553c145857a181384c72b98156f858ca5c8e82d9d3/websockets-15.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64dee438fed052b52e4f98f76c5790513235efaa1ef7f3f2192c392cd7c91b65", size = 182523, upload-time = "2025-03-05T20:02:25.669Z" }, + { url = "https://files.pythonhosted.org/packages/ec/6d/0267396610add5bc0d0d3e77f546d4cd287200804fe02323797de77dbce9/websockets-15.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d5f6b181bb38171a8ad1d6aa58a67a6aa9d4b38d0f8c5f496b9e42561dfc62fe", size = 182790, upload-time = "2025-03-05T20:02:26.99Z" }, + { url = "https://files.pythonhosted.org/packages/02/05/c68c5adbf679cf610ae2f74a9b871ae84564462955d991178f95a1ddb7dd/websockets-15.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5d54b09eba2bada6011aea5375542a157637b91029687eb4fdb2dab11059c1b4", size = 182165, upload-time = "2025-03-05T20:02:30.291Z" }, + { url = "https://files.pythonhosted.org/packages/29/93/bb672df7b2f5faac89761cb5fa34f5cec45a4026c383a4b5761c6cea5c16/websockets-15.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be571a8b5afed347da347bfcf27ba12b069d9d7f42cb8c7028b5e98bbb12597", size = 182160, upload-time = "2025-03-05T20:02:31.634Z" }, + { url = "https://files.pythonhosted.org/packages/ff/83/de1f7709376dc3ca9b7eeb4b9a07b4526b14876b6d372a4dc62312bebee0/websockets-15.0.1-cp312-cp312-win32.whl", hash = "sha256:c338ffa0520bdb12fbc527265235639fb76e7bc7faafbb93f6ba80d9c06578a9", size = 176395, upload-time = "2025-03-05T20:02:33.017Z" }, + { url = "https://files.pythonhosted.org/packages/7d/71/abf2ebc3bbfa40f391ce1428c7168fb20582d0ff57019b69ea20fa698043/websockets-15.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcd5cf9e305d7b8338754470cf69cf81f420459dbae8a3b40cee57417f4614a7", size = 176841, upload-time = "2025-03-05T20:02:34.498Z" }, + { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" }, ] [[package]] @@ -1193,24 +1276,24 @@ dependencies = [ { name = "multidict" }, { name = "propcache" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/31/33/ebe9e3d1f86c7a0b51094c0a146392045ca1631d2664889539dec8088a33/yarl-1.24.5.tar.gz", hash = "sha256:e81b83143bee16329c23db3c1b2d82b29892fcbcb849186d2f6e98a5abe9a57f", size = 228679 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1b/84/71d051c850b5af41d168c679d9eb67eb7c55283ac4ee131673edf134bc4e/yarl-1.24.5-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d693396e5aea78db03decd60aec9ece16c9b40ba00a587f089615ff4e718a81d", size = 136035 }, - { url = "https://files.pythonhosted.org/packages/03/4d/8ad27f9a1b7e69313cca5d695b925b48efe51208d3490e0844bae97cabc0/yarl-1.24.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3363fcc96e665878946ad7a106b9a13eac0541766a690ef287c0232ac768b6ec", size = 97642 }, - { url = "https://files.pythonhosted.org/packages/ea/b4/05b4131c407006cd1e410e9c6539f16a0945724677e5364447313c15ea3e/yarl-1.24.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9d399bdcfb4a0f659b9b3788bbc89babe63d9a6a65aacdf4d4e7065ff2e6316c", size = 97323 }, - { url = "https://files.pythonhosted.org/packages/20/16/e618c875c73e0e39611f20a581b3d5e8d59b8857bf001bee3263044c6deb/yarl-1.24.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90333fd89b43c0d08ac85f3f1447593fc2c66de18c3d6378d7125ea118dc7a54", size = 107741 }, - { url = "https://files.pythonhosted.org/packages/d9/9a/c4defeaf3ed33fcb346aacf9c6e971a8d4e2bde04a0310e79abb208e7965/yarl-1.24.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:665b0a2c463cc9423dd647e0bfd9f4ccc9b50f768c55304d5e9f80b177c1de12", size = 103570 }, - { url = "https://files.pythonhosted.org/packages/5f/e7/0e0e0de5865ebd5914537ef486f36c727a59865c3ac0cf5ff1b32aececbf/yarl-1.24.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e006d3a974c4ee19512e5f058abedb6eef36a5e553c14812bdeba1758d812e6d", size = 115815 }, - { url = "https://files.pythonhosted.org/packages/2b/27/ca56b700cb170aba25a3893b75355b213935657dc5714d2383354a270e62/yarl-1.24.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e7d42c531243450ef0d4d9c172e7ed6ef052640f195629065041b5add4e058d1", size = 116025 }, - { url = "https://files.pythonhosted.org/packages/d6/d0/d56c859b8222116f5d68459199f48359e0bf121b6f65a69bf329b3602ba0/yarl-1.24.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f08c7513ecef5aad65687bfdf6bc601ae9fccd04a42904501f8f7141abad9eb9", size = 109835 }, - { url = "https://files.pythonhosted.org/packages/70/a2/3a35557e4d1a79425040eba202ccaf08bdc8717680fc77e2498a1ad2e0a5/yarl-1.24.5-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6c95b17fe34ed802f17e205112e6e10db92275c34fee290aa9bdc55a9c724027", size = 108884 }, - { url = "https://files.pythonhosted.org/packages/e4/35/ef4c26356b7913c68983bac2d72a4212b3347af551cb8d250b99b5ed7b7f/yarl-1.24.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:56b149b22de33b23b0c6077ab9518c6dcb538ad462e1830e68d06591ccf6e38b", size = 107308 }, - { url = "https://files.pythonhosted.org/packages/d5/91/ff0dc66c2ccf3e0153ab97ff61eabab4400e6a5264af427ab30cd69f1857/yarl-1.24.5-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a8fe66b8f300da93798025a785a5b90b42f3810dc2b72283ff84a41aaaebc293", size = 103646 }, - { url = "https://files.pythonhosted.org/packages/74/f0/33b9271c7f881766359d58266fa0811d2e5210ed860e28da7dc6d7786344/yarl-1.24.5-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:377fe3732edbaf78ee74efdf2c9f49f6e99f20e7f9d2649fda3eb4badd77d76e", size = 115305 }, - { url = "https://files.pythonhosted.org/packages/ef/65/fd79fb1868c4a80db8661091de525bf430f63c3bea1b20e8b6a84fc7d359/yarl-1.24.5-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:e8ffa78582120024f476a611d7befc123cee59e47e8309d470cf667d806e613b", size = 108404 }, - { url = "https://files.pythonhosted.org/packages/ff/ba/dbabe6b262f17a816c70cfc09558dbf03ece3ec76684d02f911a3d3a189c/yarl-1.24.5-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:daba5e594f06114e37db186efd2dd916609071e59daca901a0a2e71f02b142ce", size = 115940 }, - { url = "https://files.pythonhosted.org/packages/a5/43/fab2d1dad9d340a268cdde63756a123d069723efff6a372d123fa74a9517/yarl-1.24.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:65be18ec59496c13908f02a2472751d9ef840b4f3fb5726f129306bf6a2a7bba", size = 110006 }, - { url = "https://files.pythonhosted.org/packages/c4/27/41eb51bbd1b8d89546b83897cfb0164f1e109304fd408dbb151b639eec0f/yarl-1.24.5-cp312-cp312-win_amd64.whl", hash = "sha256:a929d878fec099030c292803b31e5d5540a7b6a31e6a3cc76cb4685fc2a2f51b", size = 97618 }, - { url = "https://files.pythonhosted.org/packages/3c/25/b2553764b3d65db711d8f45416351ec4f420847558eb669edcbcaadf5780/yarl-1.24.5-cp312-cp312-win_arm64.whl", hash = "sha256:7ce27823052e2013b597e0c738b13e7e36b8ccb9400df8959417b052ab0fd92c", size = 93018 }, - { url = "https://files.pythonhosted.org/packages/61/02/962c1cbfc401a30c1d034dc67ff395f64b52302c6d62de556c1fca99acc0/yarl-1.24.5-py3-none-any.whl", hash = "sha256:a33700d13d9b7d84fd10947b09ff69fb9a792e519c8cb9764a3ca70baa6c23a7", size = 58612 }, +sdist = { url = "https://files.pythonhosted.org/packages/31/33/ebe9e3d1f86c7a0b51094c0a146392045ca1631d2664889539dec8088a33/yarl-1.24.5.tar.gz", hash = "sha256:e81b83143bee16329c23db3c1b2d82b29892fcbcb849186d2f6e98a5abe9a57f", size = 228679, upload-time = "2026-07-20T02:07:45.435Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1b/84/71d051c850b5af41d168c679d9eb67eb7c55283ac4ee131673edf134bc4e/yarl-1.24.5-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d693396e5aea78db03decd60aec9ece16c9b40ba00a587f089615ff4e718a81d", size = 136035, upload-time = "2026-07-20T02:05:25.489Z" }, + { url = "https://files.pythonhosted.org/packages/03/4d/8ad27f9a1b7e69313cca5d695b925b48efe51208d3490e0844bae97cabc0/yarl-1.24.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3363fcc96e665878946ad7a106b9a13eac0541766a690ef287c0232ac768b6ec", size = 97642, upload-time = "2026-07-20T02:05:27.429Z" }, + { url = "https://files.pythonhosted.org/packages/ea/b4/05b4131c407006cd1e410e9c6539f16a0945724677e5364447313c15ea3e/yarl-1.24.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9d399bdcfb4a0f659b9b3788bbc89babe63d9a6a65aacdf4d4e7065ff2e6316c", size = 97323, upload-time = "2026-07-20T02:05:29.441Z" }, + { url = "https://files.pythonhosted.org/packages/20/16/e618c875c73e0e39611f20a581b3d5e8d59b8857bf001bee3263044c6deb/yarl-1.24.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90333fd89b43c0d08ac85f3f1447593fc2c66de18c3d6378d7125ea118dc7a54", size = 107741, upload-time = "2026-07-20T02:05:31.367Z" }, + { url = "https://files.pythonhosted.org/packages/d9/9a/c4defeaf3ed33fcb346aacf9c6e971a8d4e2bde04a0310e79abb208e7965/yarl-1.24.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:665b0a2c463cc9423dd647e0bfd9f4ccc9b50f768c55304d5e9f80b177c1de12", size = 103570, upload-time = "2026-07-20T02:05:33.303Z" }, + { url = "https://files.pythonhosted.org/packages/5f/e7/0e0e0de5865ebd5914537ef486f36c727a59865c3ac0cf5ff1b32aececbf/yarl-1.24.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e006d3a974c4ee19512e5f058abedb6eef36a5e553c14812bdeba1758d812e6d", size = 115815, upload-time = "2026-07-20T02:05:35.292Z" }, + { url = "https://files.pythonhosted.org/packages/2b/27/ca56b700cb170aba25a3893b75355b213935657dc5714d2383354a270e62/yarl-1.24.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e7d42c531243450ef0d4d9c172e7ed6ef052640f195629065041b5add4e058d1", size = 116025, upload-time = "2026-07-20T02:05:37.503Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d0/d56c859b8222116f5d68459199f48359e0bf121b6f65a69bf329b3602ba0/yarl-1.24.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f08c7513ecef5aad65687bfdf6bc601ae9fccd04a42904501f8f7141abad9eb9", size = 109835, upload-time = "2026-07-20T02:05:39.506Z" }, + { url = "https://files.pythonhosted.org/packages/70/a2/3a35557e4d1a79425040eba202ccaf08bdc8717680fc77e2498a1ad2e0a5/yarl-1.24.5-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6c95b17fe34ed802f17e205112e6e10db92275c34fee290aa9bdc55a9c724027", size = 108884, upload-time = "2026-07-20T02:05:41.584Z" }, + { url = "https://files.pythonhosted.org/packages/e4/35/ef4c26356b7913c68983bac2d72a4212b3347af551cb8d250b99b5ed7b7f/yarl-1.24.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:56b149b22de33b23b0c6077ab9518c6dcb538ad462e1830e68d06591ccf6e38b", size = 107308, upload-time = "2026-07-20T02:05:43.697Z" }, + { url = "https://files.pythonhosted.org/packages/d5/91/ff0dc66c2ccf3e0153ab97ff61eabab4400e6a5264af427ab30cd69f1857/yarl-1.24.5-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a8fe66b8f300da93798025a785a5b90b42f3810dc2b72283ff84a41aaaebc293", size = 103646, upload-time = "2026-07-20T02:05:45.895Z" }, + { url = "https://files.pythonhosted.org/packages/74/f0/33b9271c7f881766359d58266fa0811d2e5210ed860e28da7dc6d7786344/yarl-1.24.5-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:377fe3732edbaf78ee74efdf2c9f49f6e99f20e7f9d2649fda3eb4badd77d76e", size = 115305, upload-time = "2026-07-20T02:05:47.832Z" }, + { url = "https://files.pythonhosted.org/packages/ef/65/fd79fb1868c4a80db8661091de525bf430f63c3bea1b20e8b6a84fc7d359/yarl-1.24.5-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:e8ffa78582120024f476a611d7befc123cee59e47e8309d470cf667d806e613b", size = 108404, upload-time = "2026-07-20T02:05:49.604Z" }, + { url = "https://files.pythonhosted.org/packages/ff/ba/dbabe6b262f17a816c70cfc09558dbf03ece3ec76684d02f911a3d3a189c/yarl-1.24.5-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:daba5e594f06114e37db186efd2dd916609071e59daca901a0a2e71f02b142ce", size = 115940, upload-time = "2026-07-20T02:05:51.741Z" }, + { url = "https://files.pythonhosted.org/packages/a5/43/fab2d1dad9d340a268cdde63756a123d069723efff6a372d123fa74a9517/yarl-1.24.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:65be18ec59496c13908f02a2472751d9ef840b4f3fb5726f129306bf6a2a7bba", size = 110006, upload-time = "2026-07-20T02:05:53.554Z" }, + { url = "https://files.pythonhosted.org/packages/c4/27/41eb51bbd1b8d89546b83897cfb0164f1e109304fd408dbb151b639eec0f/yarl-1.24.5-cp312-cp312-win_amd64.whl", hash = "sha256:a929d878fec099030c292803b31e5d5540a7b6a31e6a3cc76cb4685fc2a2f51b", size = 97618, upload-time = "2026-07-20T02:05:55.57Z" }, + { url = "https://files.pythonhosted.org/packages/3c/25/b2553764b3d65db711d8f45416351ec4f420847558eb669edcbcaadf5780/yarl-1.24.5-cp312-cp312-win_arm64.whl", hash = "sha256:7ce27823052e2013b597e0c738b13e7e36b8ccb9400df8959417b052ab0fd92c", size = 93018, upload-time = "2026-07-20T02:05:57.554Z" }, + { url = "https://files.pythonhosted.org/packages/61/02/962c1cbfc401a30c1d034dc67ff395f64b52302c6d62de556c1fca99acc0/yarl-1.24.5-py3-none-any.whl", hash = "sha256:a33700d13d9b7d84fd10947b09ff69fb9a792e519c8cb9764a3ca70baa6c23a7", size = 58612, upload-time = "2026-07-20T02:07:43.461Z" }, ]