[페이지 분류 강화 작업]

This commit is contained in:
LASTA_DEV01\lasta
2026-05-22 20:16:28 +09:00
parent 93980da14d
commit a358f221ff
29 changed files with 5633 additions and 52 deletions

View File

@@ -156,7 +156,7 @@ def create_app() -> FastAPI:
# ─── /health ──────────────────────────────────────────────────────
@app.get("/health", tags=["meta"])
async def health() -> JSONResponse:
async def health(request: Request) -> JSONResponse:
"""Liveness check for the HTTP service and optional LLM readiness."""
settings = platform_config.load_settings()
if _startup_error:
@@ -172,7 +172,7 @@ def create_app() -> FastAPI:
},
)
ctx = get_app_context()
ctx = _request_app_context(request)
if ctx.tools.llm is None:
return JSONResponse(
status_code=503,
@@ -192,13 +192,13 @@ def create_app() -> FastAPI:
# ─── /info ────────────────────────────────────────────────────────
@app.get("/info", tags=["meta"])
async def info() -> JSONResponse:
async def info(request: Request) -> JSONResponse:
"""Service-level capabilities (mirrors OntoCast /info semantics)."""
settings = platform_config.load_settings()
phase = int(settings.phase)
storage_backend = settings.storage_backend
if not _startup_error:
ctx = get_app_context()
ctx = _request_app_context(request)
phase = int(ctx.settings.phase)
storage_backend = ctx.settings.storage_backend
@@ -449,6 +449,13 @@ def create_app() -> FastAPI:
return app
def _request_app_context(request: Request) -> AppContext:
override = request.app.dependency_overrides.get(get_app_context)
if override is not None:
return override()
return get_app_context()
# Top-level instance for `uvicorn platform.api.main:app`.
app = create_app()

View File

@@ -82,6 +82,6 @@ def _remove_route(app: FastAPI, path: str, methods: set[str]) -> None:
for route in app.router.routes
if not (
getattr(route, "path", None) == path
and set(getattr(route, "methods", set())) == methods
and methods.issubset(set(getattr(route, "methods", set())))
)
]