From c7906d5b80a26300ea152a4c4ebc35f2d3b71530 Mon Sep 17 00:00:00 2001 From: ogt Date: Sat, 11 Jul 2026 10:24:59 +0800 Subject: [PATCH] fix(ui): render the exact production version --- app.py | 1 + config.py | 2 +- docs/AI_INTELLIGENCE_MODULE_SOT.md | 2 +- templates/login.html | 4 ++-- tests/test_runtime_role_and_performance.py | 9 +++++++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 926e911..f4e8e4c 100644 --- a/app.py +++ b/app.py @@ -144,6 +144,7 @@ app = Flask(__name__, template_folder=TEMPLATE_DIR, static_folder=STATIC_DIR) app.config['SEND_FILE_MAX_AGE_DEFAULT'] = timedelta(days=7) +app.config['SYSTEM_VERSION'] = SYSTEM_VERSION app.config.update( COMPRESS_ALGORITHM=['br', 'gzip'], COMPRESS_LEVEL=6, diff --git a/config.py b/config.py index 932a7dd..5564c74 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.778" +SYSTEM_VERSION = "V10.779" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/AI_INTELLIGENCE_MODULE_SOT.md b/docs/AI_INTELLIGENCE_MODULE_SOT.md index 210608d..1fc11ea 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -2,7 +2,7 @@ > **最後更新**: 2026-07-11 (台北時間) > **狀態**: 🟠 Partial。四 Agent、PixelRAG、MCP/RAG registry、PChome controlled-preview families 與多項 smoke/readback 已建立;但 access control、database identity/RBAC、full asset reconciliation、software supply chain、same-run controlled apply、restore drill、internal RAG canary 與 MCP/RAG runtime closure 尚未全部完成。任何局部 receipt 不得代表整體閉環完成。 -> **適用版本**: V10.778 +> **適用版本**: V10.779 --- diff --git a/templates/login.html b/templates/login.html index 31cbf47..0374fed 100644 --- a/templates/login.html +++ b/templates/login.html @@ -27,7 +27,7 @@ @@ -71,7 +71,7 @@ diff --git a/tests/test_runtime_role_and_performance.py b/tests/test_runtime_role_and_performance.py index 2eac037..36de488 100644 --- a/tests/test_runtime_role_and_performance.py +++ b/tests/test_runtime_role_and_performance.py @@ -112,3 +112,12 @@ def test_login_first_viewport_has_no_third_party_or_inline_styles(): assert "css/page-login.css" in template assert "gradient(" not in stylesheet assert "font-size: clamp" not in stylesheet + + +def test_login_version_uses_single_app_config_truth(): + app_source = (ROOT / "app.py").read_text(encoding="utf-8") + template = (ROOT / "templates/login.html").read_text(encoding="utf-8") + + assert "app.config['SYSTEM_VERSION'] = SYSTEM_VERSION" in app_source + assert template.count("config.get('SYSTEM_VERSION', '')") == 2 + assert "EwoooC V{{" not in template