Sweep TECH_DEBT entries the control loop and #440 resolved #441
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!441
Loading…
Reference in a new issue
No description provided.
Delete branch "sweep-tech-debt-resolved-by-the-control-loop-436"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Removed (8)
Code that no longer exists:
create_the_picksruns three times for postseason week 4create_picks.pygone; rewritten as a provider entry, see belowsync_team_recordsdies whole if one team is missingupdate_team_records, which warns per teamschedule_jobsno longer runs at startupaward_update_all.pygoneNflApiGamegone;schemas.pyvalidates at the edge[0]on team lookupsDataSourceoutlived its columnapp/models/data_source.pygone, no referencesAnd one fixed rather than deleted: Pick validity is enforced only in the UI,
closed by the server-side upset check in #440.
Rewritten (3)
No coverage outside the provider wrappers → Routes and templates are
largely untested.
test_picks_routescovers the picks page and form andestablishes the harness; the entry now names what is still uncovered
(
/standings,/allpicks,v2admin, mail, templates) and notes that theexpensive part is done.
create_the_picksruns three times →post 4sticks for months, in theprovider section. The Tank01 behaviour is permanent and worth recording. What
changed is that it is now harmless for three unrelated reasons --
add_week_if_new,GameStateleavingNO_GAMES, and the picks page beinggated on
OddsState.LOCKED. None of them was written for this, so the entrysays so before someone simplifies one away.
No bootstrap path keeps its analysis but drops the speculative ending for
what actually happened: the Aug 2026 production rebuild restored
teamonlybecause
rebuild_database.shwas edited to preserve it partway through.Added (3)
picks_formswallows everyIntegrityError(#438) -- three defectspresented as successes during the picks work. All fixed upstream, which is
why the next one will be just as quiet.
test_tank01_api.py.a fixed id with no
replace_existing, so a job outliving the 60-second tickmakes the next
add_jobraiseConflictingIdError. Self-healing, but costsa tick and logs a misleading error.
Structure
The Migration in flight (provider boundary) section is gone -- the migration
landed. Its two surviving entries moved to Data and schema. Added an Error
handling section for the last one.
Every file path and symbol referenced in the document is verified to exist.
resolves #436
This is a documentation-only PR (plus the routine patch version bump), so I verified the debt entries against the actual code rather than looking for runtime bugs. The sweep is accurate almost everywhere I checked — but one carried-over entry names a job that no longer works the way the entry describes.
Review
A clean, well-organized sweep of
docs/TECH_DEBT.mdthat removes entries for code that no longer exists and rewrites/adds three that reflect the current state. I spot-checked the file paths, symbols, and behavioral claims against the tree; the overwhelming majority hold, but thepicks_for_weekentry misattributes the fan-out cost to a job that has since stopped using that code path.Worth fixing
docs/TECH_DEBT.md— thepicks_for_week lost its session-scoped cacheentry misdescribesupdate_player_records. The entry claims:update_awardsgenuinely does this (app/jobs/update_awards.py:27,74-75→Player.wins_for_week/losses_for_week). Butupdate_player_recordsdoes not: it callsplayer.recalculate_record(session)(app/jobs/update_player_records.py:10), andrecalculate_record(app/models/player.py:99-113) iterates thegame_picksrelationship once and computes the record in a single pass — it never touchespicks_for_weekor the*_for_weekhelpers. So the "three queries per player per week" characterization and theapp/jobs/update_player_records.pyfile reference are wrong for the current code; onlyupdate_awardsis a beneficiary. Given the PR's stated premise ("Every file path and symbol referenced in the document is verified to exist"), this is the one entry that would mislead the next reader who acts on it. Either dropupdate_player_recordsfrom the entry or note it was migrated off the helpers.Nits
docs/TECH_DEBT.md— "Routes and templates are largely untested" referencesapp/routers/v2as if it were a package. The actual file isapp/routers/v2.py(a single module, not a directory). Minor, but the doc elsewhere is precise about.pyvs. package, so worth normalizing.Verified accurate (no action needed)
For the record, these claims all check out against the tree:
launch_*functions (app/jobs/scheduler.py:171-231) all calladd_jobwith a fixedidand noreplace_existing, while theschedule_*functions passreplace_existing=True— exactly as described, andadd_games_for_current_weekis a one-shotADD_GAMESlauncher.picks_form swallows every IntegrityError:app/main.py:440-446catches baresqlalchemy.exc.IntegrityError, rolls back, and then renderspicks_form.j2(the success template).PlayerGamePickdocstring still documentsseason/week_noas denormalized:ivar:columns (app/models/player_game_pick.py:21-36) that no longer exist on the model.create_picks.py,award_update_all.py,sync_team_records.py,data_source.py, oldtank01_api.pyinternals), and the "still uncovered" test list matchestests/andapp/routers/.2.20.1is applied consistently in bothpyproject.tomlanduv.lock, per the CLAUDE.md convention.