refactor(server): extract the progression routes into routers/progression.py (R3) - #853
Merged
Merged
Conversation
…sion.py (R3) 4 routes (overview/add-paths/onboarding/events, spec 010) + their EXCLUSIVE helpers (_goal_ui_progress, _progression_overview 112L) + the _PROGRESSION_EVENT_TYPES whitelist. Bodies verbatim; @app -> @router, meta_db -> appstate.meta_db, _clean_str from reqfields. The two SHARED server accessors read through the seam: get_progression_content (added for shop #851) and builtin_diagnostic_filename (new slot — a trivial const-returning fn shared with the stats router's api_record_stats). Both are injected via the second appstate.configure() after their defs (the import-top configure runs before them). The cache + fns stay in server.py, so test_progression_api's server._progression_content patch is untouched — 0 retarget. server.py: 7,798 -> 7,594. Verified: pyflakes clean; route table IDENTICAL (143); both seam accessors wired; pytest 2401 passed (63 in test_progression_api); eslint 0. Boot smoke: GET /api/progression 200 (drives _progression_overview + both accessors), events 400 on bad body. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe progression API was moved from ChangesProgression router extraction
Estimated code review effort: 3 (Moderate) | ~20 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
4 progression routes (overview / add-paths / onboarding / events, spec 010) + their exclusive helpers (
_goal_ui_progress, the 112-line_progression_overview) + the_PROGRESSION_EVENT_TYPESwhitelist.The two shared server accessors read through the seam:
get_progression_content(landed forshop#851) andbuiltin_diagnostic_filename(new slot — a trivial const-returning fn shared withstats'api_record_stats). Both injected via the secondappstate.configure()after their defs (the import-topconfigureruns before them). The cache + fns stay inserver.py, sotest_progression_api'sserver._progression_contentpatch is untouched — 0 retarget.Bodies verbatim (
@app→@router,meta_db→appstate.meta_db,_clean_strfromreqfields).server.py: 7,798 → 7,594.Verification
pyflakesclean.pytest2401 passed (63 intest_progression_api, whose_progression_contentpatch still works).GET /api/progression200 (drives_progression_overview+ both accessors); events400on bad body.npm run lint0; Codex 0 findings.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation