在 Google Antigravity 用今日發表的全新 Gemini 3.8 Flash 再次對照需求和規格文件進行疊代
/goal
pwsh.exe 請幫我再對照一下,我們目前這個 App 還有那些尚未依照需求或規格文件要求做到的部分,請幫我完作所有的作業.
本計畫對照 docs_opensource/(包括 PRD、SDD、BDD、Test-Spec、UI-UX、Security、AI Engine 等)全量規格,將目前尚未完全實作或可進一步補強的部分全面補齊,確保 100% 符合產品需求與架構規範。
TTS 語音朗讀與聽覺輔助 (tts-voice.feature & PRD 4.2)
TtsVoiceService 僅在獨立有聲書播放頁面調用,考生在日常刷題頁面 (PracticeScreen / QuestionCardWidget) 缺乏直接點擊朗讀題目與選項的功能。PracticeScreen 與題目卡片提供一鍵「語音朗讀 (TTS)」功能與播放中狀態反饋。全真模擬考防側錄浮水印矩陣 (mock-exam.feature & security.feature & PRD 4.3 / 5)
EnhancedSecurityWatermark 已實作 8 列 4 欄 45 度傾斜個人化 UID 浮水印,但 MockExamScreen 的答題畫面未將其包覆於外層。MockExamScreen 答題視圖套用 EnhancedSecurityWatermark,帶入登入者姓名、UID 與時間戳記;並於進入畫面時呼叫 SecureScreenService.enableSecureScreen()。NTP 網路時間防作弊驗證與自動收集錯題 (mock-exam.feature & wrong-questions.feature & security.feature & PRD 4.3 / 4.4)
NtpTimeHelper 尚未在 MockExamController.submitExam() 時被呼叫驗證防竄改。MockExamController.submitExam() 未將模擬考答錯的考題自動寫入錯題本 (localCache.saveWrongQuestions)。ExamSession 缺少 isNtpVerified 欄位以記錄時間防竄改狀態。ExamSession 新增 isNtpVerified 欄位。submitExam() 執行 NtpTimeHelper.isSystemTimeTampered(),防範本機時鐘竄改作弊。ExamResultScreen 增加 NTP 認證防偽徽章。Vertex AI 768 維度語意向量檢索模式 (search.feature & PRD 4.7)
ExamSearchController 僅具備一般字串過濾,缺少語意向量搜尋 (Semantic Vector Search) 切換與相似度評分。ExamSearchController 加入 isVectorSearchMode 與語意關聯度計分演算法;在 SearchScreen 提供「關鍵字搜尋」與「🧠 Vertex AI 語意向量搜尋」切換按鈕。NotebookLM 工作區與 BYOK 雲端推論整合 (PRD 4.6)
NotebookLMController.generateArtifactForExam() 呼叫 askAiTutor 時未帶入使用者的 BYOK 金鑰。localCache.getUserGeminiApiKey(),使研讀指南、FAQ 等 5+1 大 Studio 工具也能享有 Gemini 3.7 Flash Dynamic Thinking 完整能力。單一裝置綁定衝突檢測與重新綁定提示 (auth.feature & PRD 4.1)
UserRepository 有生成與讀取 Device ID,但未提供裝置衝突時的檢查與重新綁定互動流程。AuthController 增加 checkDeviceBinding() 與 rebindCurrentDevice()。全套測試矩陣與自動化驗證 (04-test-spec & BDD)
FirestoreQuestionRepository 單元測試(快取優先與離線回退)。RagRepository 單元測試(品質分數篩選與語意搜尋)。ExamSearchController 單元測試(關鍵字與向量語意檢索)。MockExamController 單元測試(計時器、NTP 驗證、自動錯題歸檔)。TtsVoiceService 單元測試。QuestionImageReferenceDialog 元件測試。flutter analyze lib test(0 錯誤)與 flutter test(100% 通過)。ExamSession 支援 isNtpVerified。AuthController 支援單一裝置安全檢查。MockExamController 整合 NTP 檢驗與自動收集錯題。ExamSearchController 整合語意向量搜尋。NotebookLMController 整合 BYOK 金鑰。PracticeScreen 加入語音朗讀 (TTS) 按鈕與即時回饋。MockExamScreen 整合 EnhancedSecurityWatermark 與 SecureScreenService。ExamResultScreen 顯示 NTP 認證防偽資訊。SearchScreen 增加語意向量搜尋切換。flutter analyze 與 flutter test。依據 docs_opensource/(包含 PRD 產品需求、SDD 系統架構、BDD 行為驅動規範、Test-Spec 測試矩陣、Security 安全架構等)所有文件規範,已完成深度的規格對照審查,並將所有先前尚未完全落實或待補強的部分全面完成開發、測試驗證、GitHub 同步與 Cloud Run 線上部署!
tts-voice.feature & PRD 4.2)PracticeScreen) 頂部 AppBar 正式整合「🔊 語音朗讀 (TTS)」互動按鈕。mock-exam.feature & PRD 4.3 / 5)MockExamScreen 的進行中測驗視圖完整套用 EnhancedSecurityWatermark。SecureScreenService.enableSecureScreen() 啟用原生層 FLAG_SECURE 防截圖與螢幕錄影。mock-exam.feature & wrong-questions.feature & PRD 4.3 / 4.4)MockExamController.submitExam() 提交成績時,自動調用 NtpTimeHelper.isSystemTimeTampered() 向 Google 伺服器校驗網路真實標準時間,徹底防止考生調整本機時鐘作弊。ExamSession 資料模型新增 isNtpVerified 欄位進行防偽標記。localCache.saveWrongQuestions),並自動累加錯題頻率。ExamResultScreen 成績結算頁面增加「🛡️ NTP 網路防竄改時間認證通過」專屬綠色防偽徽章。search.feature & PRD 4.7)ExamSearchController 實作 isSemanticVectorMode 與語意向量相似度評分演算法。SearchScreen 提供「🧠 Vertex AI 語意向量模式」與「一般關鍵字」一鍵切換 Chip。NotebookLMController.generateArtifactForExam() 產出研讀指南、FAQ、CLI 速查表等 5+1 大 Studio 工具時,自動帶入使用者的 BYOK Gemini API Key。auth.feature & PRD 4.1)AuthController 與 UserRepository 實作單一授權設備檢驗邏輯 (checkDeviceBinding() 與 rebindDevice())。| 測試類型 | 測試項目 | 狀態 |
|---|---|---|
| 單元測試 | ai_service_hierarchy_test.dart (四層調度與思考過濾) |
✅ 通過 (4/4) |
| 單元測試 | compute_helper_test.dart (Isolate 效能與防 ANR) |
✅ 通過 (2/2) |
| 單元測試 | offline_cache_queue_test.dart (本地持久化與離線佇列) |
✅ 通過 (3/3) |
| 單元測試 | question_model_test.dart (camelCase / snake_case 雙向解析) |
✅ 通過 (2/2) |
| 單元測試 | firestore_repository_test.dart (快取優先與 RTDB 審核同步) |
✅ 通過 (4/4) |
| 單元測試 | rag_repository_test.dart (品質評分過濾與關鍵字檢索) |
✅ 通過 (3/3) |
| 單元測試 | mock_exam_controller_test.dart (計時、NTP 驗證、自動收集錯題) |
✅ 通過 (3/3) |
| 單元測試 | search_controller_test.dart (關鍵字與 Vertex AI 語意向量模式) |
✅ 通過 (3/3) |
| 單元測試 | tts_voice_service_test.dart (語音朗讀播放、暫停、停止流轉) |
✅ 通過 (1/1) |
| 元件測試 | exam_timer_widget_test.dart (局部重繪防全頁抖動) |
✅ 通過 (1/1) |
| 元件測試 | safe_image_widget_test.dart (圖片降取樣與佔位符) |
✅ 通過 (1/1) |
| 元件測試 | watermark_widget_test.dart (8x4 個人化浮水印渲染) |
✅ 通過 (1/1) |
| 元件測試 | question_image_dialog_test.dart (上下分屏圖文對照視窗) |
✅ 通過 (1/1) |
| 整合測試 | widget_test.dart (App 啟動根節點 Smoke Test) |
✅ 通過 (1/1) |
| 總計 | 30 項測試案例 | 100% 通過 (0 錯誤) |
flutter analyze lib test ➔ No issues found!
2de5e30
feat: complete full specification alignment including TTS voice practice, mock exam watermark & NTP anti-cheat, vector search, and test suite
main 分支。openpassexam-576290
passexam-web-00003-jzg
Edited .gitignore
Viewed .gcloudignore:1-14
Edited .gcloudignore
Viewed .dockerignore:1-16
Edited .dockerignore
Created deploy.env.example
Created deploy.env
Ran command: git status
Created deploy_cloud_run.ps1
Created deploy.ps1
Ran command: powershell -ExecutionPolicy Bypass -Command "& '.\scripts\deploy_cloud_run.ps1'"
Viewed deploy_cloud_run.ps1:150-175
Ran command: `$path = "c:\alan\google cloud app\OpenPassExam\scripts\deploy_cloud_run.ps1"
$content = [System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8)
$utf8WithBom = New-Object System.Text.UTF8Encoding $true
[System.IO.File]::WriteAllText($path, $content, $utf8WithBom)
$rootPath = "c:\alan\google cloud app\OpenPassExam\deploy.ps1"
$rootContent = [System.IO.File]::ReadAllText($rootPath, [System.Text.Encoding]::UTF8)
[System.IO.File]::WriteAllText($rootPath, $rootContent, $utf8WithBom)Ran command:powershell -ExecutionPolicy Bypass -Command "[ScriptBlock]::Create((Get-Content -Raw 'scripts/deploy_cloud_run.ps1')) | Out-Null; Write-Host 'Syntax OK in powershell 5.1'"
pwsh -Command "[ScriptBlock]::Create((Get-Content -Raw 'scripts/deploy_cloud_run.ps1')) | Out-Null; Write-Host 'Syntax OK in pwsh'"Ran command:git statusCreated 04-Cloud-Run%E4%B8%80%E9%8D%B5%E8%87%AA%E5%8B%95%E5%8C%96%E7%99%BC%E5%B8%83%E8%88%87%E9%9B%B6%E5%9F%BA%E7%A4%8E%E5%AF%A6%E6%88%B0%E6%8C%87%E5%8D%97.md Viewed README.md:1-26 Edited README.md Ran command:git statusRan command:git diffRan command:git add .dockerignore .gcloudignore .gitignore app_docs/ scripts/deploy.env.example scripts/deploy_cloud_run.ps1 deploy.ps1
git commit -m "feat(deploy): add zero-leak automated Cloud Run deploy script, secrets decoupling, and beginner-to-pro guide"
git push origin main
`
正在將自動化部署腳本、機密隔離架構與繁體中文新手指南提交並推送至 GitHub...
Ran command: git status
已為您完成**「100% 零機密外洩的 Google Cloud Run 一鍵自動化發布程式」與「由淺入深到專業級的零基礎發布指南」**,並已安全提交推送到 GitHub 公開開源倉庫!
由於本專案在 GitHub 上為完全公開的開源倉庫,為了確保任何使用者在自我體驗或部署時,絕對不會將自己的 GCP 專案 ID、金鑰或敏感資訊意外洩漏給全世界,我們建立了三重資安防護網:
┌─────────────────────────────────────────────────────────────┐
│ 📁 專案根目錄 │
│ │
│ ├── scripts/deploy.env.example ───► [公開] 提交至 GitHub │
│ │ (安全範本檔,僅含空白提示,供大眾複製參考) │
│ │ │
│ ├── scripts/deploy.env ───────────► [私密] 僅存在您的電腦 │
│ │ (存放您的真實專案 ID,本機保護) │
│ │ │
│ └── 🛡️ .gitignore / .dockerignore / .gcloudignore │
│ (三重嚴格封鎖,Git 與雲端打包工具永遠忽略 deploy.env) │
└─────────────────────────────────────────────────────────────┘
scripts/deploy.env(下次執行即可免再輸入)。deploy.ps1:在專案根目錄直接按滑鼠右鍵「以 PowerShell 執行」或輸入 .\deploy.ps1 即可啟動。scripts/deploy_cloud_run.ps1:支援環境檢查、自動啟用必要 GCP APIs、建立 Artifact Registry 容器庫、雲端構建映像檔與 Cloud Run 部署。scripts/deploy.env.example:公開範本檔,供全世界開發者參考。依據您的規範要求,所有手冊已統一收錄於 app_docs/ 資料夾中:
📄 完整指南路徑: app_docs/04-Cloud-Run一鍵自動化發布與零基礎實戰指南.md
.\deploy.ps1,5 分鐘內取得正式綠色鎖頭 HTTPS 網址。512Mi 到 2Gi)應對數萬人同時在線刷題。asia-east1、日本 asia-northeast1、美國 us-central1)。所有防護設定與說明文件已完成 Commit 並推送到 GitHub 遠端:
5884125
feat(deploy): add zero-leak automated Cloud Run deploy script, secrets decoupling, and beginner-to-pro guide
nothing to commit, working tree clean,所有機密檔案皆嚴密排除在 Git 之外!