# 資安掃描 arc 後續優化 — Runner Loop Log

固定工作清單：① preact 小件 → ② FE Sonar 品質債（CM-874）→ ③ TipTap 收斂 → ④ BE Sonar 品質債。
一輪 5 行內。commit hash 分 repo 標註。

---

## Round 1 — 2026-07-25

- **① preact 小件（FE）**：`package.json` preact `^10.24.3` → `^10.29.7`（npm 解析至 10.29.7 ≥ 10.28.2 修復門檻，HIGH CVE-2026-22028）；`build:DEV` 過。FE commit `2df15a1`。
- **② FE Sonar（CM-874）開工**：狀態改 In progress、作業人員=小弟。修 2 條 CRITICAL bug：`ComplianceFrameworkVersionManage.vue` 兩處 `id="key"`→`id="version"`（S7930 duplicate id，兼修 label 關聯與 focus-on-error）；`AppMenuItem.vue:42` `handleRouteChange(route.path)`→`handleRouteChange()`（S930 多餘引數，no-op）。`build:DEV` 過。FE commit `95fd44c`。
- **跳過項**：無。
- **下一輪**：CM-874 a11y 批次（S6853 label 關聯 182 + InputWithoutLabelCheck 49），按元件群分批，先 grc 元件群一批。

## Round 2 — 2026-07-25

- **② CM-874 a11y 批次 1（grc 元件群，6 檔約 26 條）**：ProjectBasicInfoForm(4)、FlowPhaseBanner(1)、ModuleFrameBasicInfoPanel(7)、ModuleFramePartiesPanel(7)、ModuleFrameSspInfoSystemsPanel(4)、ModuleFrameSspDevicesPanel(3)。label 加 `for` + 控制項加 `id`/`inputId`，只補關聯屬性。`build:DEV` 過。FE commit `9967c77`。
- **跳過項**：無。剩 grc 群大檔 `ComponentsLeveragedInventoryTab.vue`（40 條）留下一輪。
- **下一輪**：CM-874 a11y 批次 2——ComponentsLeveragedInventoryTab.vue（40 條）+ ssp-excel-import 群。

## Round 3 — 2026-07-25

- **② CM-874 a11y 批次 2（ComponentsLeveragedInventoryTab.vue，40 條）**：四個 Dialog（Component/LeveragedAuth/Inventory/SystemAsset）共 35 個控制項補 `for`+`id`/`inputId`（InputText/Textarea 用 id，Dropdown/Calendar/MultiSelect 用 inputId），涵蓋 S6853(35)+InputWithoutLabelCheck(5)。`build:DEV` 過。FE commit `c6c0734`。
- **跳過項**：無。
- **下一輪**：CM-874 a11y 批次 3——`src/views/project` 群（50 條）或 ssp-excel-import 群（31 條）。

## Round 4 — 2026-07-25

- **② CM-874 a11y 批次 3（ssp-excel-import 元件群，5 檔 31 條）**：SheetPreviewSystemCharacteristic(10)、SheetPreviewBasic(7)、InlineCreateDialog(7)、SheetPreviewControls(6)、EntityPickerDialog(1)。label 加 `for`+控制項 `id`/`inputId`；SheetPreviewControls 在 v-for 內用動態綁定 id（依 control_id/objective_id）避免撞號。`build:DEV` 過。FE commit `378a143`。
- **跳過項**：無。
- **下一輪**：CM-874 a11y 批次 4——`src/views/project` 群（50 條，RoundAuditReviewView 17 + RoundApAuthoringView 17 最大宗）。

## Round 5 — 2026-07-25

- **② CM-874 a11y 批次 4（views/project 稽核/AP 兩大檔）**：RoundAuditReviewView.vue(17，觀察卡 v-for 用動態 id 依 o.uid)、RoundApAuthoringView.vue(11 修+6 跳過，task 欄位 v-for 動態 id 依 idx、step-guidance 每方法 label 關聯)。`build:DEV` 過。FE commit `eaa1c7a`。
- **跳過項**：RoundApAuthoringView 唯讀模式 6 個 label（708/712/721/725/729/733）標的是 Tag/純文字摘要非表單控制項，純加關聯屬性無對象、需結構調整，留 backlog。
- **下一輪**：CM-874 a11y 批次 5——views/project 剩餘小檔（ProjectPlanningView 4、RoundPoamView 3 等）+ components/grc/ssp 群（20）。

## Round 6 — 2026-07-25

- **② CM-874 a11y 批次 5（grc/ssp 元件群，3 檔 20 條）**：SspBasicSection.vue(10，基本資訊 8 控制項)、SspLeveragedSection.vue(9，外部服務 Dialog 7 控制項)、SspTabPanel.vue(1，隱藏 file input 補 aria-label)。`build:DEV` 過。FE commit `7155458`。
- **跳過項**：無。
- **下一輪**：CM-874 a11y 批次 6——views/survey-v2(12)+views/survey-v2/components(9) 或 views/project 剩餘小檔（ProjectPlanningView 4、RoundPoamView 3、TaskSetupView 2 等 15 條）。

## Round 7 — 2026-07-25

- **② CM-874 a11y 批次 6（survey-v2 群，4 檔 18 修 3 跳過）**：SurveyDesigner(8 修，InputSwitch 用 inputId)、AddQuestionDialog(4 修)、AddPageDialog(2 修)、SurveyPreview(3 修，隱藏 file input aria-label + feedback Textarea v-for 動態 id)。`build:DEV` 過。FE commit `3c4a0ed`。
- **跳過項**：SurveyDesigner folder(唯讀路徑 div)、AddQuestionDialog display_condition/wizard 2 個區段標題 label、AddPageDialog display_condition 區段標題 — 皆非單一表單控制項對象，需結構調整故留 backlog。
- **下一輪**：CM-874 a11y 批次 7——views/project 小檔（ProjectPlanningView 4 等 16 條）或 grc/ssp-docx-import-v2/sections(11)+grc/ap-docx-import(8)。

## Round 8 — 2026-07-25

- **② CM-874 a11y 批次 7（views/project 小檔群，7 檔 16 條，全清 views/project 群）**：RoundPoamView(2)、ProjectListView(2)、ProjectCreateView(2)、ProjectApListView(2)、MyTasksView(1)、ProjectPlanningView(4，含 task v-for 動態 id)、TaskSetupView(2，chip-field-label div→label CSS 為 flex 視覺不變)。`build:DEV` 過。FE commit `2cbc1b4`。
- **跳過項**：無。
- **下一輪**：CM-874 a11y 批次 8——grc/ssp-docx-import-v2/sections(11)+grc/ap-docx-import(8) 或 views/remote-agent(6)+grc/project(5)+其餘小群。

## Round 9 — 2026-07-25

- **② CM-874 a11y 批次 8（ssp-docx/ap-docx 匯入群，3 檔 18 修 1 跳過）**：PartiesSection(6，org/person 兩 loop 各 3 控制項用 block 前綴+idx)、SystemCharacteristicSection(4，單例)、ApDocxImportDialog(8 修，task 欄位 v-for 動態 id 依 i、guidance span→label)。`build:DEV` 過。FE commit `0b17245`。
- **跳過項**：ApDocxImportDialog task_guidance 群組標題 label(631)——群組標頭非單一控制項，其下 per-method textarea 已各自 label 關聯。
- **下一輪**：CM-874 a11y 批次 9——views/remote-agent(6)+grc/project(5)+grc/ar-import(3)+compliance-framework/article(3)+views/flow-template(2)+views/user-manage(1) 收尾小群，及 S6819(9)+FrameWithoutTitle(3)。

## Round 10 — 2026-07-25

- **② CM-874 a11y 批次 9（收尾小群，8 檔 18 修 2 跳過，S6853/InputWithoutLabel 全清）**：RemoteAgentManage(6)、AIEvidenceClassificationDialog(3，Slider/SelectButton aria-labelledby)、ArImportDialog(2)、FrameworkArticleContent(3，inline editor aria-label)、UserManageUpload(1)、FlowTemplateManage/Editor(各1)。`build:DEV` 過。FE commit `dfcb10b`。
- **跳過項**：ProjectBasicInfoPanel 120/128（label 標唯讀 framework/module_frame 顯示 div）、ArImportDialog 564（evidence 清單群 label）。累積跳過 ~13 條。
- **下一輪**：CM-874 剩 S6819(9，div 語意標籤—拿不準跳過)+FrameWithoutTitle(3，iframe 補 title)，之後進 S2486 吃例外 73 條。

## Round 11 — 2026-07-25

- **② CM-874 FrameWithoutTitle(3) + S2486 批次 1(2 檔 13 條)**：iframe 補 title（EvidencePreviewDialog/FrameworkArticlePane/EvidenceFilePreviewDialog）FE commit `98fe54e`；S2486 靜默吞例外補 console.error——ComponentsLeveragedInventoryTab(8)+FrameworkImportPage(5)，保留 interceptor 行為不加 toast，FE commit `3808220`。`build:DEV` 均過。
- **跳過項**：S6819(9) 全跳——皆自訂樣式互動 widget（role-tri 三態勾選 / styled 觸發器），已帶 role/aria-checked/title，改 native button/input 需重構 markup+CSS，屬設計層變更留 backlog 待裁決。
- **下一輪**：S2486 批次 2——UserProfileForm(4)+ProjectSummaryReportManage(4)+FrameworkVersionEditView(4)+RemoteAgentManage(3) 等，S2486 剩 ~60 條。

## Round 12 — 2026-07-25

- **② CM-874 S2486 批次 2（4 檔 15 條）**：UserProfileForm(4，QR/TOTP/MFA)、ProjectSummaryReportManage(4，load/create/delete)、FrameworkVersionEditView(4，tree/save/delete/reupload)、RemoteAgentManage(3，formatTs/healthCheck/clipboard 保留 fallback)。空/回退 catch 補 console.error 保留原行為不加 toast。`build:DEV` 過。FE commit `babd000`。
- **跳過項**：無。
- **下一輪**：S2486 批次 3——剩 45 條分散 ~28 檔（EvidenceClassificationReview 3、OtpVerification 3、GoogleDriveIntegrationCard 3、SspLeveragedSection 3、其餘多 1~2 條）。批次盡量吃多檔（≤15 檔），有機會這輪或下輪清完 S2486 → CM-874 完成定義達成改「修正待驗證」。

## Round 13 — 2026-07-25

- **② CM-874 S2486 批次 3（12 檔 27 修 + OtpVerification 3 跳過）**：EvidenceClassificationReview/GoogleDrive/SspLeveraged 各3、SspBasic/ProjectPlanning/ImportExcelPreview/SystemFeedback/DeviceManage/SyncJobHistory/ArImport/ApDocxImport/EditIncludeControls 各2。空/回退/fail-closed/discard-ignore catch 補 console.error 保留原行為。`build:DEV` 過。FE commit `0b4d128`。
- **跳過項**：OtpVerification 3 條——皆 localStorage 不可用的預期性 noop（原註「localStorage 不可用→退回純記憶體」），屬環境條件非錯誤，補 log 只是噪音。
- **下一輪**：S2486 批次 4（最後一批）——剩 15 檔各 1 條（含 3 個 .js composable + AppMenuItem/AppBreadcrumb layout）。清完 S2486 → CM-874 完成定義達成改「修正待驗證」進 TipTap case。

## Round 14 — 2026-07-25

- **② CM-874 S2486 批次 4 收尾（11 檔 11 修 + 4 跳過）→ CM-874 完成定義全達成，狀態改「修正待驗證」**：UserManageUpload/SystemMenuManage/RoleForm/ProjectAuditorOverview/ProjectApListView/兩 Evidence report/useEvidenceClassificationJobs.js/ProjectCloudIntegrationsPanel/AIEvidenceClassificationDialog/ModuleFrameBasicInfoPanel 補 console.error。`build:DEV` 過。FE commit `c8d787b`。
- **跳過項**：AppMenuItem/AppBreadcrumb router.resolve catch（正常控制流 break/fallback）+ useArImportDraft/useApDocxDraft localStorage // ignore（預期 noop）。S2486 合計 66 補 log + 7 跳過 = 73 全處理。
- **下一輪**：進 case 3 TipTap（先 fetch 動工指引；若超出純補洞或需 user 決策 → append 等待裁決不動手，進 case 4 BE Sonar）。

## Round 15 — 2026-07-25

- **③ CM-876 TipTap 開工**：狀態 In progress。Step1 讀 TipTapEditor.vue 契約（modelValue=HTML string in/out、placeholder/editable/minHeight/scrollHeight props）。確認 3 quill 表單（Bulletin/SystemFeedback/CruisingFeedback）全走 PrimeVue Editor+CkEditorToolBar slot；CkEditorToolBar 另在 2 個 ProjectSummaryReport 檔是死 import（未用 template）。Step2 換第 1 表單 **BulletinForm**：v-model=content 維持 HTML、必填紅框以 .tiptap-invalid wrapper 保留、scrollHeight=320px。`build:DEV` 過。FE commit `25ab632`。
- **跳過項**：無。
- **下一輪**：換 SystemFeedbackForm + CruisingFeedbackForm（各一 commit）→ 再 main.js 移除 Editor 全域註冊 + 刪 CkEditorToolBar + 拔 quill/ckeditor5 依賴。

## Round 16 — 2026-07-25

- **③ CM-876 五步全綠 → 狀態改「修正待驗證」**：Step2 換 SystemFeedbackForm(`c08b9e4`)+CruisingFeedbackForm(`40987cc`)；Step3+4 main.js 移除 PrimeVue Editor 註冊 + 刪 CkEditorToolBar.vue + 清 2 死 import(`fdfc7e1`)；Step5 `npm uninstall quill @ckeditor/ckeditor5-build-classic @ckeditor/ckeditor5-vue ckeditor5`(`1dd0aba`，package.json only)。每步 `build:DEV` 過。
- **跳過項**：無程式跳過。相容性驗證（舊 quill HTML 在 TipTap render/回存）+ 四處手驗屬互動手測，列入 case 手測清單交 user；TipTap StarterKit 涵蓋標準 HTML 標籤，風險低。
- **下一輪**：進 case 4 BE Sonar 品質債 backlog（先 fetch 動工指引）。

## Round 17 — 2026-07-25

- **④ CM-873 BE Sonar 開工**：狀態 In progress。授權範圍＝4 安全桶（S1481/S1172/S125/S1192），禁區＝S3776/BLOCKER S3516/regex/裸except/logging + 任何改邏輯者。第 1 批 **S1481 未用區域變數 app/（16 修 9 檔）**：純死變數直接刪、有副作用呼叫保留只刪接收變數、tuple 未用改 `_`、未用例外變數移除 `as e`。`py_compile` 全過 + `main_app.py` 起服務 login 回 400（DB_SECRET traceback 屬 shell 無 .env 既有問題，edited 檔未出現在 stack）。BE commit `f4312be0`。
- **跳過項**：workflow_execution_service.py ×5 + oscal_audit_service.py:132-133（FR-038 stub 一族，無測試網保守不動）。
- **下一輪**：S1481 剩 api/scripts/其他目錄（~19 條），再進 S125 註解碼 / S1192 重複字面值 / S1172 未用參數（grep 守門）。

## Round 18 — 2026-07-25

- **④ CM-873 S1481 批次 2（api/common/core/domain/scripts，19 修 14 檔）→ S1481 桶全清（累計 35 修 + 7 跳過）**：route 層純讀 user/locale 直接刪、有副作用呼叫保留只刪接收變數（survey update/task_survey verify/Babel 建構）、純死變數刪、未用例外變數移 `as e`、script tuple 未用改 `_`。BE commit `77aad18e`。
- **驗證**：py_compile + AST parse 全過 + pyflakes 無 undefined-name（確認刪除未破壞引用）。本輪 BE 起服務因 shell `.env` 未載入（JSON 值含 `}` 無法 source）在 config 層即中止，屬上游 import 與本次改動無關；R17 已證有 env 時可 boot。跳過項：無新增。
- **下一輪**：S125 註解掉的碼（66 條）——純死碼直接刪、含 TODO/設計意圖的不刪；按目錄分批。

## Round 19 — 2026-07-25

- **④ CM-873：S125 桶評估後整桶跳過 + S1192 批次 1 開始**。**S125（66 條）跳過**：抽查 pdf_util/event_code/settings/jwt_mw/feedback_route/device_init/review_mark，大宗是「設計意圖/未來用」的註解替代方案（pdf parser 變體、DeviceMonitor 規劃路由、files.get 單數替代），依指引「含設計意圖不刪」須保留；且報告行號因先前編輯 + 掃描後代碼漂移多處對不上（event_code:58 指到 live enum、settings:40 指到 docstring）。無測試網下逐條比對純死碼風險高，整桶跳過留 backlog 較保守。
- **S1192 批次 1（bpmn_topology_validator，3 字面值 13 處）**：BPMN 屬性 key `@name`/`@targetRef`/`@sourceRef` 抽模組常數 ATTR_*。py_compile + pyflakes 淨。BE commit `0c9d3de4`。
- **下一輪**：續 S1192（挑純結構字面值檔：header_i18n/api_registry 等；分類標籤類如 validation_report_builder 要驗 GT 跨檔一致才動，拿不準跳過）。

## Round 20 — 2026-07-25

- **④ CM-873 S1192 批次 2 + S1172 桶評估 → 四桶能安全清的全清完，CM-873 狀態改「修正待驗證」**：S1192 批次 2（bpmn_generator，4 字面值 19 處：BPMN schema URI/Camunda exporter/platform + 重複錯誤訊息抽 `_BPMN_*`/`_MSG_*` 常數）。BE commit `4d6fc3e1`。py_compile+pyflakes 淨。
- **S1192 剩餘跳過**：header_i18n（i18n 資料表的 display value，跨檔出現，非結構重複）、api_registry（`**kwargs` ×17 是宣告式資料表自我說明值，抽常數反降可讀性）、validation_report_builder 分類標籤（GT 跨檔 byte-match 用途）等——皆屬資料/語意類非純結構，保守跳過。
- **S1172 桶整桶跳過**：83 條全為介面/DI/簽名綁定參數（curr_user×14=DI 注入或統一簽名、*_uid/logger/gateways=positional 傳參需連動改 call site 或屬語意可能latent bug），依「拿不準一律跳過」保守留 backlog。
- **CM-873 收尾**：四桶 S1481✅(35修7跳)/S125⏸整桶跳/S1192✅(2檔32處，餘資料類跳)/S1172⏸整桶跳，能安全清的全清完，改「修正待驗證」。runner 四項工作全到位 → 收尾停止。
