Skip to content

PR #576: Fix Steamer Tier 4 cascade — raise DraftEdge threshold 50→100 to unblock dispatch#446

Merged
jaayslaughter-cpu merged 1 commit into
mainfrom
fix/steamer-tier4-cascade-pr576
May 17, 2026
Merged

PR #576: Fix Steamer Tier 4 cascade — raise DraftEdge threshold 50→100 to unblock dispatch#446
jaayslaughter-cpu merged 1 commit into
mainfrom
fix/steamer-tier4-cascade-pr576

Conversation

@jaayslaughter-cpu
Copy link
Copy Markdown
Owner

@jaayslaughter-cpu jaayslaughter-cpu commented May 17, 2026

Root Cause

Dispatches have been silently blocked for 3+ days because of a threshold mismatch between steamer_layer.py and the pre-dispatch health gate in tasklets.py.

The exact failure chain:

  1. Postgres steamer cache has ~65 rows → discarded (< 100 gate) ✅
  2. FanGraphs API 403-blocked on Railway → Tiers 1–3 fail ✅
  3. DraftEdge returns 65 players → 65 >= 50ACCEPTS — stops at Tier 4 ❌
  4. Health gate in tasklets.py: 65 > 0 AND 65 < 100DISPATCH BLOCKED

The Tier 4 acceptance threshold (>= 50) was set when DraftEdge returned only ~32 players at startup. It was never updated to match the health gate threshold (>= 100).

Fix

steamer_layer.py — one-line change:

  • if de_data and len(de_data) >= 50:>= 100
  • Updated comment to explain the health gate alignment

After this fix:

  • DraftEdge returns 65 → 65 >= 100 → False → cascades to Tier 5
  • Tier 5 static CSV loads 5,663 players
  • Health gate: 5663 < 100 → False → DISPATCH PASSES
  • Tier 5 saves to Postgres → future restarts use 5,663-row PG cache

Self-Healing Effect

After first deploy, Tier 5 writes 5,663 rows back to Postgres. Next day's startup reads PG cache (5,663 ≥ 100) → no API calls needed at all. Steamer is permanently healthy unless Postgres cache is wiped.

Impact

  • Unblocks all 3 frozen agents (EVHunter, F5Agent, UnderMachine)
  • Resolves 0-dispatch days on May 14, 16, 17
  • No logic changes — thresholds only

Summary by cubic

Raise Tier 4 DraftEdge acceptance threshold from 50 to 100 to match the pre-dispatch health gate and unblock dispatch. Thin (~65) DraftEdge results now fall through to Tier 5 static CSV so dispatch proceeds and the cache heals.

  • Bug Fixes
    • Require >=100 players from DraftEdge in Tier 4 (was 50); updated comment/log to reflect the gate in tasklets.py.
    • Results: cascades to Tier 5 (5,663 players), dispatch passes, and Postgres cache repopulates; unblocks EVHunter, F5Agent, and UnderMachine.

Written for commit bcd6850. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved projection data reliability by refining fallback mechanisms to require more comprehensive datasets before using external sources, ensuring better data quality when limited datasets are available.

Review Change Stack

…h health gate

DraftEdge returning 65 players was being accepted by Tier 4 (threshold >= 50)
but then failing the pre-dispatch health gate in tasklets.py (requires >= 100).
This mismatch silently blocked all dispatches for 3+ days.

Raising threshold to >= 100 causes 65-player results to cascade to Tier 5
static CSV (5,663 players), which passes the health gate cleanly."
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5f973982-889d-48b2-8d45-6a6876e33223

📥 Commits

Reviewing files that changed from the base of the PR and between a6c7b8d and bcd6850.

📒 Files selected for processing (1)
  • steamer_layer.py

📝 Walkthrough

Walkthrough

The Steamer tier-4 DraftEdge fallback now enforces a stricter minimum batter count of 100 projected players (raised from 50) before caching results. When DraftEdge provides fewer players, the system falls through to tier-5 CSV fallback. The corresponding log message was updated to reflect the new threshold condition.

Changes

DraftEdge Tier-4 Fallback Threshold

Layer / File(s) Summary
Stricter batter-count requirement and log message update
steamer_layer.py
Tier-4 _get_cache now requires at least 100 projected players from DraftEdge before caching; otherwise falls through to tier-5. Log message updated to reflect the new "(< 100 threshold)" condition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • jaayslaughter-cpu/mework#400: Both PRs modify the Steamer DraftEdge tier-4 caching/fallback behavior in steamer_layer.py—the main PR raises the _get_cache batter-count threshold (50→100) while the retrieved PR adds the DraftEdge tier-4 fallback path that _get_cache gates.

Poem

🐰 A threshold raised, from fifty to a hundred strong,
The batter count now guards what's right from wrong,
When DraftEdge thins, we fall back to CSV's way,
A stricter gate means better stats to play! 📊

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/steamer-tier4-cascade-pr576

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented May 17, 2026

DeepSource Code Review

We reviewed changes in a6c7b8d...bcd6850 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Docker May 17, 2026 6:00p.m. Review ↗
JavaScript May 17, 2026 6:00p.m. Review ↗
Python May 17, 2026 6:00p.m. Review ↗
SQL May 17, 2026 6:00p.m. Review ↗
Secrets May 17, 2026 6:00p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@jaayslaughter-cpu jaayslaughter-cpu merged commit 65d509d into main May 17, 2026
6 of 9 checks passed
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the minimum player threshold for DraftEdge data from 50 to 100 in steamer_layer.py. This adjustment ensures that degraded API responses, which typically return around 65 players, correctly trigger a fallback to the Tier 5 static CSV to maintain data integrity. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant