fix(drift_narrator): 補寫 narrative_text 到 DB + drift_repository.update_narrative
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
OG T
2026-04-10 11:06:50 +08:00
parent c6edfb5614
commit b24fae313e
2 changed files with 16 additions and 0 deletions

View File

@@ -154,6 +154,15 @@ class DriftReportRepository:
)
async def update_narrative(self, report_id: str, narrative: str) -> None:
"""更新 AI 人話摘要 (Phase 30 ADR-067)"""
async with get_db_context() as db:
await db.execute(
text("UPDATE drift_reports SET narrative_text = :narrative WHERE report_id = :report_id"),
{"report_id": report_id, "narrative": narrative},
)
_drift_repo: DriftReportRepository | None = None