refactor: extract /api/v1/recipes into its own FastAPI router - #34
Merged
Conversation
Paso 2.piloto. Copy the six recipe handlers out of launch, delete the originals, and mount create_recipes_router at the same ordinal. Method, path, order, status and JSON stay the same. Workspace, NSFW policy and get_model_def are injected; concat and WanGP stay behind existing ports.
PR Review — Loreframe StudioRisk: low Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
Owner
Author
|
cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8693e8d. Configure here.
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.
Alcance
Paso 2.piloto del plan canónico, sobre
main79dad74(PRs #31 #32 #33 ya mezclados, CI de main verde)./api/v1/recipessalen enteras de_launch_runtime.pyaapp/routers/recipes.py.create_recipes_router(...)en la misma posición ordinal (53–58).workspace_dir,nsfw_allowed,get_model_def,safe_join. No hayLaunchContext.get_model_defviene del muro WanGP (services.generation).Tabla estática: solo cambia
source→app/routers/recipes.py. Ordinales, method y path intactos.Tests locales
tests/test_recipes_router.py(ASGI): list NSFW, GET 404, thumbnail 404, save-from-output 400/mode, import 400, delete builtin 400tests/test_architecture_contracts.pytests/test_architecture_factory.pyRollback
Un commit:
git revert 8693e8d.Confirmaciones
app/models/**._launch_runtime.py: este es el único PR de extracción sobre launch. No mezclar desde el agente.Tras este PR el plan dice parar nuevas extracciones HTTP hasta asignación explícita.
Note
Low Risk
Mechanical route extraction with explicit dependency injection and new contract tests; no intended API or feature changes.
Overview
Moves all six Studio recipe HTTP endpoints out of
_launch_runtime.pyintoapp/routers/recipes.py, mounted viacreate_recipes_router(...)at the same route ordinals (53–58). Paths, methods, and handler behavior are intended to stay the same; the router takes injected callbacks (workspace_dir,nsfw_allowed,get_model_def,safe_join) so it does not import WanGP or the launch runtime.save-from-outputnow usesget_model_deffromservices.generation(passed in at mount time) instead of callingwgp.get_model_defdirectly.tests/fixtures/route_table.jsonupdates each recipe route’ssourceto the new module.tests/test_recipes_router.pyadds ASGI contract tests for NSFW filtering, validation, save-from-output mode selection, import, and delete rules.Reviewed by Cursor Bugbot for commit 8693e8d. Configure here.