本卡屬 FR-089(母卡 CM-1688),修 arc review CM-1738「守衛有牙齒/沒牙齒」清單裡歸主專案守衛的三項。建議 model:Sonnet 5,effort:medium——每條都要用突變證明新守衛真的會紅。

問題是什麼(白話)

本 arc 的成果靠守衛守住,但 review 抓到三處守衛本身有問題:① 兩條用「目錄存不存在」判的守衛,殘留的空 __pycache__ 目錄就會假紅(首腦驗 CM-1737 與 review runner 都實際撞到);② SOP §4.3 三條版面規則(套件頂層不平鋪、port 只在 domain/ports.pytests/ 在套件根)21 支現在合規但零守衛,第 22 支開始就會漂;③ _PORT_IMPL_ALLOWED_OUTSIDE_PLUGINS 白名單兩列「誰在用它」的理由寫錯——白名單的價值全在那句理由,寫錯會讓下一個人誤判可以搬。

在哪裡

test/test_module_boundaries.py
  :1142 _CONVERGED_PLUGIN_DIRS + test_converged_plugin_adapters_do_not_return_to_infra(path.exists())
  test_extracted_module_shell_dirs_removed(同樣 path.exists(),grep 找行號)
  :1168 _PORT_IMPL_ALLOWED_OUTSIDE_PLUGINS
    「infra/survey/adapters.py」列理由寫 di_containers/survey/ → 實查零 import;真 caller 是 api/survey/__init__.py:26-28 與 di_containers/evidence_classification/
    「common/integrity/adapters.py」列理由寫「app/ 與 api/ 也用 hotpath_verify」→ api/ 零命中,只有 app/oscal/service/export/ssp_export_app_service.py:19;main.py:103 import 的是 common.integrity 不是 .adapters
版面規則規範:docs/features/FR-069-2608-jedi-module-extraction/extraction-sop.md §4.3 三條;現況 jedi-iam 頂層 1 檔、jedi-integrity 頂層 5 檔是有 docstring 的相容殼(review 判合規),三支頂層 ports/ 殼(file-upload/iam/oscal-v2)歸 I-5 另一張卡收

怎麼修

要寫測試

全量:pytest test/test_module_boundaries.py -q 貼 tail -1;新增三條都綠。

手測

紀律