chore(prep): shared groundwork for batch-4 (report pipeline)

第四批(T15 编排/T16 视觉诊断/T17 文案校验)协调提交:
- 迁移 0006:rp_report(result JSONB 按阶段键承载中间态)/rp_input
 (derived_features 视觉中间态)/rp_share(V1 只建结构)
- ORM 三模型;错误码 40420/40920(文案无价格字样)
- 配置:report_pipeline_stages(dotted path 动态装配)+ vision/tier
- packages/report/pipeline.py:Stage Protocol + ReportContext(三任务共同契约,
  动态 import 的动机与代价写在 docstring)
- 路由桩 reports.py 已注册
This commit is contained in:
xsl
2026-08-14 21:51:05 +08:00
parent 7fb1e4514f
commit d974526904
8 changed files with 263 additions and 1 deletions
+13 -1
View File
@@ -12,7 +12,18 @@ from contextlib import asynccontextmanager
from fastapi import FastAPI
from apps.api.deps import build_llm_gateway
from apps.api.routers import agent, auth, auth_sms, events, health, kb, quota, tasks, uploads
from apps.api.routers import (
agent,
auth,
auth_sms,
events,
health,
kb,
quota,
reports,
tasks,
uploads,
)
from packages.shared.config import Settings, get_settings
from packages.shared.db import dispose_engine
from packages.shared.handlers import install_exception_handlers
@@ -78,6 +89,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
events.router,
uploads.router,
kb.router,
reports.router,
)
for router in routers:
app.include_router(router, prefix=cfg.api_prefix)
+11
View File
@@ -0,0 +1,11 @@
"""报告路由(骨架,T15 填充实现)。
POST /reports、GET /reports、GET /reports/{id}、POST /reports/{id}/regenerate;
实现契约见 docs/开发任务包/T15-报告域骨架.md。
"""
from __future__ import annotations
from fastapi import APIRouter
router = APIRouter(prefix="/reports", tags=["reports"])