refactor: remove KI-Orakel from history page and backend

Drop oracle UI, API endpoint, scheduled generation, and related docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-06-17 08:32:28 +02:00
parent 648e62d2b4
commit c59c3069c4
10 changed files with 12 additions and 155 deletions
+1 -24
View File
@@ -11,7 +11,7 @@ from fastapi import Depends, FastAPI, HTTPException, Request
from fastapi.responses import FileResponse, JSONResponse
from fastapi.staticfiles import StaticFiles
from server.ai import generate_daily_motivation, generate_oracle, get_oracle, get_roast_of_the_day
from server.ai import generate_daily_motivation, get_roast_of_the_day
from server.auth import create_token, require_auth, verify_pin
from server.config_loader import load_meds_config, slot_to_dict, today_str
from server.db import ensure_schema, get_db, new_id, utc_now_iso
@@ -51,17 +51,6 @@ async def _ensure_today_motivation() -> None:
await db.close()
async def _ensure_today_oracle() -> None:
config = load_meds_config()
db = await get_db()
try:
await generate_oracle(db, config.timezone)
except Exception:
logger.exception("Startup oracle generation failed")
finally:
await db.close()
@asynccontextmanager
async def lifespan(app: FastAPI):
db = await get_db()
@@ -69,7 +58,6 @@ async def lifespan(app: FastAPI):
await db.close()
start_scheduler()
asyncio.create_task(_ensure_today_motivation())
asyncio.create_task(_ensure_today_oracle())
yield
@@ -219,17 +207,6 @@ async def get_roast(_: dict = Depends(require_auth)) -> JSONResponse:
return JSONResponse(data, headers=NO_STORE)
@app.get("/api/oracle")
async def get_oracle_route(_: dict = Depends(require_auth)) -> JSONResponse:
config = load_meds_config()
db = await get_db()
try:
data = await get_oracle(db, config.timezone)
finally:
await db.close()
return JSONResponse(data, headers=NO_STORE)
# Static files — must be after API routes
PUBLIC = pathlib.Path(settings.public_dir)
if PUBLIC.exists():