diff --git a/TODO_NEXT_STEPS.txt b/TODO_NEXT_STEPS.txt index 90c42f0..2161c8e 100644 --- a/TODO_NEXT_STEPS.txt +++ b/TODO_NEXT_STEPS.txt @@ -4,6 +4,7 @@ ================================================================================ 【已完成】 + - V10.246 強化 `/observability/ppt_audit_history` 視覺 QA runtime 可讀性:功能開關、轉檔器與視覺模型改成中文 checklist,Vision QA 狀態卡直接顯示 runtime 就緒資訊,DB 產出狀態統一為「已產出」。 - V10.245 重整 `/observability/ppt_audit_history` 首屏資訊階層:改成簡報操作摘要、最新可預覽簡報、下一步動作與自適應報表類型 segmented grid;產線覆蓋矩陣改為下方驗收明細,避免一進頁只看到大量「產線狀態」或類型按鈕右側溢出。 - V10.242 修正 `/metabase`、`/grist` 外部工具入口:全域導覽固定回 momo-pro 內部橋接頁,避免資料協作錯連其他專案站;入口頁補路由狀態、設定診斷與可用替代分析入口,降低空白頁誤判。 - V10.221 補 `/observability/ppt_audit_history` AiderHeal 背景任務可見性:正在修復中的簡報會顯示於產線頁,並提供 JSON 狀態端點讓派工後即時刷新,避免重新整理後不知道是否已在修。 diff --git a/config.py b/config.py index dd463a8..53823f1 100644 --- a/config.py +++ b/config.py @@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.245" +SYSTEM_VERSION = "V10.246" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/services/ppt_auto_generation_service.py b/services/ppt_auto_generation_service.py index fde3ed8..d6c61b7 100644 --- a/services/ppt_auto_generation_service.py +++ b/services/ppt_auto_generation_service.py @@ -700,7 +700,7 @@ def get_generation_run_history( "target_label": row[2] or "", "status": status, "status_label": { - "ready": "已產生", + "ready": "已產出", "missing_file": "未落盤", "error": "失敗", "planned": "已規劃", diff --git a/services/ppt_vision_service.py b/services/ppt_vision_service.py index fef68cd..0318f1a 100644 --- a/services/ppt_vision_service.py +++ b/services/ppt_vision_service.py @@ -12,7 +12,7 @@ Operation Ollama-First v5.0 / Phase 14 — PPT 視覺自審 2. 文字溢出框 3. 空白區塊(資料未填滿) 4. 配色衝突 -- feature flag PPT_VISION_ENABLED 預設 OFF +- feature flag 由部署環境控制;正式 compose 預設 ON,程式本身仍 fail-safe - 失敗自動 skip(不阻擋 PPT 生成主流程) """ @@ -64,24 +64,24 @@ def get_ppt_vision_runtime_status() -> Dict[str, Any]: readiness_checks = [ { 'key': 'feature_flag', - 'label': 'Feature Flag', + 'label': '功能開關', 'value': f"PPT_VISION_ENABLED={env_value if env_value is not None else '未設定'}", 'status': 'ready' if enabled else 'error', - 'detail': '視覺 QA 背景任務可被排入。' if enabled else '目前會阻擋立即視覺 QA 按鈕。', + 'detail': '已允許背景視覺 QA 排程與手動補跑。' if enabled else '目前會阻擋立即視覺 QA 按鈕。', }, { 'key': 'converter', - 'label': 'LibreOffice', + 'label': '轉檔器', 'value': converter or 'not found', 'status': 'ready' if converter else 'error', 'detail': '可將 PPTX 轉成投影片截圖。' if converter else '缺轉檔器時無法建立視覺模型輸入。', }, { 'key': 'vision_model', - 'label': 'Vision Model', + 'label': '視覺模型', 'value': model, 'status': 'ready' if model else 'planned', - 'detail': '沿用 Ollama-first 三主機路由,不在頁面同步打模型避免拖慢載入。', + 'detail': '推理時走 Ollama-first 三主機 fallback;頁面載入不同步打模型。', }, ] next_actions = [] @@ -102,7 +102,7 @@ def get_ppt_vision_runtime_status() -> Dict[str, Any]: 'ready_count': sum(1 for item in readiness_checks if item['status'] == 'ready'), 'check_count': len(readiness_checks), 'status_label': '可執行' if ready else '環境未就緒', - 'summary': '視覺 QA runtime 已具備 feature flag 與轉檔器。' if ready else '視覺 QA runtime 仍有必要條件未通過。', + 'summary': '視覺 QA runtime 已具備功能開關、轉檔器與模型設定。' if ready else '視覺 QA runtime 仍有必要條件未通過。', 'checked_at': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'readiness_checks': readiness_checks, 'next_actions': next_actions, diff --git a/templates/admin/ppt_audit_history.html b/templates/admin/ppt_audit_history.html index c8b2620..12c54fa 100644 --- a/templates/admin/ppt_audit_history.html +++ b/templates/admin/ppt_audit_history.html @@ -117,11 +117,16 @@
+
+ Runtime + {{ vision_status.status_label }} + {{ vision_status.model }} · {{ vision_status.converter or '無轉檔器' }} +
{% if vision_audit_status.last_run %}
{{ vision_audit_status.last_run.finished_at or vision_audit_status.last_run.started_at or vision_audit_status.last_run.queued_at }} {{ vision_audit_status.last_run.summary.audited_count }} 份 / {{ vision_audit_status.last_run.summary.total_issues }} 問題 - {% if vision_audit_status.last_run.summary.error_count %}錯誤 {{ vision_audit_status.last_run.summary.error_count }}{% else %}無 runtime error{% endif %} + {% if vision_audit_status.last_run.summary.error_count %}執行錯誤 {{ vision_audit_status.last_run.summary.error_count }}{% else %}無執行錯誤{% endif %}
{% else %}
diff --git a/tests/test_admin_observability_routes.py b/tests/test_admin_observability_routes.py index af41c8c..6752901 100644 --- a/tests/test_admin_observability_routes.py +++ b/tests/test_admin_observability_routes.py @@ -194,6 +194,7 @@ def test_ppt_vision_runtime_status_explains_blockers(monkeypatch): assert status['readiness_checks'][0]['status'] == 'error' assert status['readiness_checks'][1]['key'] == 'converter' assert status['readiness_checks'][1]['status'] == 'error' + assert status['readiness_checks'][2]['label'] == '視覺模型' assert status['readiness_checks'][2]['value'] == 'minicpm-v:test' assert any('PPT_VISION_ENABLED=true' in action for action in status['next_actions']) @@ -218,21 +219,21 @@ def test_ppt_audit_history_renders_vision_runtime_checklist(client, monkeypatch) 'readiness_checks': [ { 'key': 'feature_flag', - 'label': 'Feature Flag', + 'label': '功能開關', 'value': 'PPT_VISION_ENABLED=未設定', 'status': 'error', 'detail': '目前會阻擋立即視覺 QA 按鈕。', }, { 'key': 'converter', - 'label': 'LibreOffice', + 'label': '轉檔器', 'value': 'not found', 'status': 'error', 'detail': '缺轉檔器時無法建立視覺模型輸入。', }, { 'key': 'vision_model', - 'label': 'Vision Model', + 'label': '視覺模型', 'value': 'minicpm-v:test', 'status': 'ready', 'detail': '沿用 Ollama-first 三主機路由。', @@ -306,7 +307,7 @@ def test_ppt_audit_history_shows_ppt_schedule_and_db_runs(client, monkeypatch): 'report_label': '每日日報', 'target_label': '2026/05/17', 'status': 'ready', - 'status_label': '已產生', + 'status_label': '已產出', 'file_name': 'ocbot_daily_20260517.pptx', 'file_size_kb': 1024, 'error_msg': '', @@ -419,7 +420,7 @@ def test_ppt_audit_history_coverage_matrix_joins_db_preview_qa(client, monkeypat 'report_label': '每日日報', 'target_label': '2026/05/17', 'status': 'ready', - 'status_label': '已產生', + 'status_label': '已產出', 'file_name': pptx.name, 'file_size_kb': 1024, 'error_msg': '', @@ -909,6 +910,7 @@ def test_ppt_audit_history_renders_last_vision_status(client, monkeypatch): assert 'data-ppt-vision-status-title' in html assert '最近一次視覺 QA 已完成。' in html assert '2 份 / 1 問題' in html + assert 'Runtime' in html def test_ppt_audit_trigger_aider_heal_accepts_issue_summary(client, monkeypatch):