diff --git a/docs/AI_INTELLIGENCE_MODULE_SOT.md b/docs/AI_INTELLIGENCE_MODULE_SOT.md index cf98669..5f4bf61 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -103,6 +103,7 @@ - 2026-07-02 起 `/observability/quality_trend` 必須採密集 AI 品質工作台:首屏使用 `data-density-guardrail="compact-quality-workbench"`,以「品質回饋、知識可靠、行動成效」短標籤承接 AI 建議可靠性;hero 說明、KPI 小註與頁尾重複標題不得佔用第一層視覺,畫面先保留反饋總量、最低均分、蒸餾樣本、知識評分、使用情境反饋、根因建議與實際動作成效。 - 2026-07-02 起 `/observability/budget` 必須採密集 AI 成本工作台:首屏使用 `data-density-guardrail="compact-budget-workbench"`,以「成本守門、節流狀態、知識策略」短標籤承接成本治理;hero 說明、按鈕註解、KPI 小註與頁尾重複標題不得佔用第一層視覺,畫面先保留當月花費、預算使用率、預警、已節流、預算線、成本趨勢、成本集中與 AI 價格決策成效。 - 2026-07-02 起 `/observability/business_intel` 必須採密集 AI 商業工作台:首屏使用 `data-density-guardrail="compact-business-workbench"`,以「戰果追蹤、閉環成效、競品訊號」短標籤承接 AI 商業狀態;hero 說明、決策節奏註解、KPI 小註、panel 說明與頁尾資料來源不得佔用第一層視覺,畫面先保留高信心未跟進、平均信心分、有效率、競品監測、外部促銷活動監控、策略族群、最近建議與閉環學習紀錄。 +- 2026-07-02 起 `/observability/host_health` 必須採密集 AI runtime 工作台:首屏使用 `data-density-guardrail="compact-runtime-workbench"`,以「主機級聯、自癒閉環、成本節流」短標籤承接 AI runtime 狀態;hero 說明、KPI 小註與頁尾重複標題不得佔用第一層視覺,畫面先保留建議服務離線、AIOps 未解、自癒成功率、節流供應商、AI 建議服務主機、健康趨勢、自癒閉環、工具層與事件紀錄。 - 2026-07-02 起 `/ai_intelligence` 商品明細與單品作戰詳情的四格價格證據必須可測:PChome 價格、MOMO 參考價、差距、可信度需以 `data-evidence` 固定,並以 `aria-label="價格證據"` 對應可掃描區塊;候選待確認或缺資料只能顯示「候選待確認 / 待補」,不得捏造價格或讓使用者打開 raw payload 才知道判斷依據。 - 2026-07-02 起 `/ai_intelligence` 必須是密集 AI 工作台,不得退回大段文字說明頁:首屏與明細可見內容只保留短狀態、數字、四格證據與下一步按鈕;KPI note、benchmark detail、alert 副句、策略說明、decision copy、來源長句與單品 reason list 不得佔用第一層視覺。`tests/test_ai_intelligence_text_density_guardrails.py` 必須鎖住 `data-density-guardrail="compact-ai-workbench"`、短任務文案、detail meta 與 hidden explanatory copy。 - 2026-07-02 起 `/observability/overview` 也必須採密集 AI 觀測工作台:首屏以 `data-density-guardrail="compact-observability-workbench"`、`AI 觀測 / 風險優先 / 下一步` 與 golden signals 先呈現狀態、數字與操作入口;hero lede、signal note、route desc、host meta 與資料來源長句不得佔用第一層視覺。`tests/test_observability_text_density_guardrails.py` 必須鎖住 compact marker 與 hidden explanatory copy。 diff --git a/docs/guides/external_professional_benchmark.md b/docs/guides/external_professional_benchmark.md index 9c6c850..36c7c55 100644 --- a/docs/guides/external_professional_benchmark.md +++ b/docs/guides/external_professional_benchmark.md @@ -77,6 +77,7 @@ Baymard 的商品頁與比較 UX 研究強調:使用者需要清楚的 product - AI quality surface rollout: `/observability/quality_trend` 已套用 compact AI quality workbench guardrails;`tests/test_quality_trend_text_density_guardrails.py` 鎖住首屏短標籤、品質/知識/行動成效核心訊號與 hidden explanatory copy。 - AI cost surface rollout: `/observability/budget` 已套用 compact AI cost workbench guardrails;`tests/test_budget_text_density_guardrails.py` 鎖住首屏短標籤、成本/預警/節流核心訊號與 hidden explanatory copy。 - AI business surface rollout: `/observability/business_intel` 已套用 compact AI business workbench guardrails;`tests/test_business_intel_text_density_guardrails.py` 鎖住首屏短標籤、商業戰果/閉環/競品核心訊號與 hidden explanatory copy。 +- AI runtime surface rollout: `/observability/host_health` 已套用 compact AI runtime workbench guardrails;`tests/test_host_health_text_density_guardrails.py` 鎖住首屏短標籤、主機級聯/自癒/節流核心訊號與 hidden explanatory copy。 ## 下一步 TODO 候選 @@ -92,6 +93,7 @@ Baymard 的商品頁與比較 UX 研究強調:使用者需要清楚的 product - 已完成: `/observability/quality_trend` 首屏以「品質回饋 / 知識可靠 / 行動成效」短標籤與四個核心數字呈現 AI 建議可靠性。 - 已完成: `/observability/budget` 首屏以「成本守門 / 節流狀態 / 知識策略」短標籤與四個核心數字呈現 AI 成本治理狀態。 - 已完成: `/observability/business_intel` 首屏以「戰果追蹤 / 閉環成效 / 競品訊號」短標籤與四個核心數字呈現 AI 商業轉化狀態。 + - 已完成: `/observability/host_health` 首屏以「主機級聯 / 自癒閉環 / 成本節流」短標籤與四個核心數字呈現 AI runtime 健康狀態。 ## 參考來源 diff --git a/docs/guides/pchome_ai_automation_priority_backlog.md b/docs/guides/pchome_ai_automation_priority_backlog.md index e8d8c2d..04c685a 100644 --- a/docs/guides/pchome_ai_automation_priority_backlog.md +++ b/docs/guides/pchome_ai_automation_priority_backlog.md @@ -152,6 +152,10 @@ - 首屏改成 `data-density-guardrail="compact-business-workbench"`,以「戰果追蹤 / 閉環成效 / 競品訊號」短標籤承接 AI 商業狀態。 - hero 說明、決策節奏註解、KPI 小註、panel 說明與頁尾資料來源從可見 UI 退場,保留高信心未跟進、平均信心分、有效率、競品監測、外部促銷活動監控、策略族群、最近建議與閉環學習紀錄。 - `tests/test_business_intel_text_density_guardrails.py` 已鎖住 compact marker、第一層商業訊號與 explanatory copy hidden contract。 +- `/observability/host_health` 密集 AI runtime 工作台文字密度 guard 已完成: + - 首屏改成 `data-density-guardrail="compact-runtime-workbench"`,以「主機級聯 / 自癒閉環 / 成本節流」短標籤承接 AI runtime 狀態。 + - hero 說明、KPI 小註與頁尾重複標題從可見 UI 退場,保留建議服務離線、AIOps 未解、自癒成功率、節流供應商、AI 建議服務主機、健康趨勢、自癒閉環、工具層與事件紀錄。 + - `tests/test_host_health_text_density_guardrails.py` 已鎖住 compact marker、第一層 runtime 訊號與 explanatory copy hidden contract。 已完成 / 下一步,必須照順序: diff --git a/templates/admin/host_health.html b/templates/admin/host_health.html index 3a64672..93829ca 100644 --- a/templates/admin/host_health.html +++ b/templates/admin/host_health.html @@ -20,6 +20,9 @@ .runtime-kicker { color: var(--obs-accent); font-size: .76rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 800; } .runtime-title { margin: .45rem 0 .25rem; font-family: var(--momo-font-display, "Inter", "Noto Sans TC", system-ui, sans-serif); font-size:var(--obs-title-size); letter-spacing: 0; line-height: .98; } .runtime-subtitle { color: var(--obs-muted); max-width: 820px; line-height: 1.7; } + .runtime-mode-row { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.75rem; } + .runtime-mode { display:inline-flex; align-items:center; min-height:28px; padding:.32rem .65rem; border:1px solid var(--obs-line); border-radius:10px; background:rgba(255,255,255,.62); color:var(--obs-muted); font-size:.74rem; font-weight:850; white-space:nowrap; } + .runtime-subtitle, .runtime-signal small, .runtime-footer-copy { display:none; } .runtime-command { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1.2rem; } .runtime-signal { padding: .95rem; border: 1px solid var(--obs-line); border-radius: 20px; background: rgba(255,255,255,.62); } .runtime-label { color: var(--obs-muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; } @@ -58,9 +61,10 @@ {% for provider, info in throttle_state.items() %}{% if info.throttled %}{% set throttled.count = throttled.count + 1 %}{% endif %}{% endfor %}
先看 AI 建議服務、工具服務與自癒是否正常,避免 AI 建議與比價流程中斷。
AI 基礎設施生命線
+ {% set host_health_payload = { diff --git a/tests/test_host_health_text_density_guardrails.py b/tests/test_host_health_text_density_guardrails.py new file mode 100644 index 0000000..beef8e0 --- /dev/null +++ b/tests/test_host_health_text_density_guardrails.py @@ -0,0 +1,45 @@ +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] + + +def test_host_health_uses_compact_runtime_workbench_contract(): + template = (ROOT / "templates/admin/host_health.html").read_text(encoding="utf-8") + + assert 'data-density-guardrail="compact-runtime-workbench"' in template + assert 'aria-label="AI runtime 狀態模式"' in template + assert "主機級聯" in template + assert "自癒閉環" in template + assert "成本節流" in template + + +def test_host_health_keeps_runtime_signals_and_hides_explanatory_copy(): + template = (ROOT / "templates/admin/host_health.html").read_text(encoding="utf-8") + + for marker in ["建議服務離線", "AIOps 未解", "自癒成功率", "節流供應商"]: + assert marker in template + + assert ".runtime-subtitle, .runtime-signal small, .runtime-footer-copy { display:none; }" in template + assert 'class="runtime-subtitle"' in template + assert "runtime-footer-copy" in template + + +def test_host_health_preserves_ai_runtime_workflows_and_non_raw_wording(): + template = (ROOT / "templates/admin/host_health.html").read_text(encoding="utf-8") + + for marker in [ + "AI 建議服務主機", + "健康趨勢摘要", + "自癒閉環 7 日", + "工具層與節流", + "成本節流狀態", + "工具服務 24h 工作量", + "最近 10 筆事件", + "最近 10 筆自癒", + "啟動自癒", + ]: + assert marker in template + + for forbidden in ["Runtime", "raw payload", "raw endpoint", "manual_required", "candidate queue", "資料表:"]: + assert forbidden not in template