docs(plan): 標記階段 3 完成,補 4 條 lessons learned

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
2026-07-31 05:57:04 +08:00
parent feac63173b
commit 49653667fb
+4 -1
View File
@@ -205,7 +205,7 @@
| 0 | 回歸網:composer dev 依賴、test bootstrap FSM guard、`failOnWarning=true`、12 個 repo `git init` | ✅ 2026-07-31unit 379 / integration 398 全綠) |
| 1 | 安全與正確性 A1A1413 個 admin GET→POST、REST allowlist、DDL 白名單、Logger 3-arity fatal…) | ✅ 2026-07-31 |
| 2 | DDL 與並發 B1B4warm UNIQUE KEY → Zone_Cold save_patch → Zone_Warm increment | ✅ 2026-07-31 |
| 3 | 架構回填(Zone_Router + Routing_Predicate13 個 Migration Phase 類別) | |
| 3 | 架構回填(Zone_Router + Routing_Predicate13 個 Migration Phase 類別) | ✅ 2026-07-31 |
| 4 | 相容層 E1E7(雙向 hook 橋、67 個 AddOn alias、38 個 CLI 子指令、選單 slug redirect | ⬜ |
| 5 | AddOn 同步 F1F5Standard_Post_Interceptor、HP detector v3.4.5、WC | ⬜ |
| 6 | 功能與診斷 PR-Gcrypto 健檢、doctor_callback ABI、15 個 usermeta 欄位…) | ⬜ |
@@ -223,6 +223,9 @@
2. `A/admin/class-wpdo-dashboard-widget.php:191``wpdo_postmeta_cleanup` 仍是 `wp_nonce_url` GET 連結,但其 handler 已只收 POST → 該按鈕在 A 是壞的。B 改成 form。
- B 有 7 處 `Logger::error( 'event', array(...) )` 兩參數呼叫(4 個 stress tester、auto-promoter、conflict-detector、hook-bus),全部是 array→string 的 TypeError。用 token 掃描器(`scan_logger.php`)找出來的,肉眼與 grep 都容易漏。
- `Zone_Warm::set()` 改 upsert 後,**測試表也要有 `UNIQUE KEY ui_post_meta`**,否則 integration 會出現「set 沒覆蓋舊值」的假失敗。
- **B 的 unit bootstrap 會載入 `Member_Fields` / `Post_Fields`A 的不會**。這使 Entity_Registry 在測試啟動時就有註冊 group,從 A 移植過來、假設「registry 為空」的測試(`MigrationPhaseRemainingTest`)會真的走進 `dbDelta` 而爆掉。修法是在該測試 setUp 以 reflection 清空 registry **並移除 `wpdo_register_entity_fields` listener**phase 內部會再 fire 一次)。
- **快取類重構必定連帶測試隔離工作**:`Routing_Predicate::flush_cache()`SyncBridgeEntityGuardTest)與 `Schema_Manager::flush_table_exists_cache()`PostMigrationTest / PostEntityLifecycleTest)兩處都是 A 事後才補的,移植時要一起帶,否則出現「表被 drop 但快取說還在」的假錯誤。
- **PHP 無法 `class_alias()` 介面**。`WPDO_Migration_Phase_Interface` 沒有雙向 alias 的乾淨解法(單向 `extends` wrapper 無法讓 `instanceof` 成立),該契約是核心內部擴充點,測試改用 `TMDO_` 正式名稱即可。
---