本卡屬 FR-091(母卡 CM-1690),是第一批(CM-1691~1695)與第二批前三張(CM-1697~1699)驗收後留下的三件小尾巴,一張卡一起收。三件彼此獨立,各一個 commit。動兩個 repo:jedi monorepo(三件都有)與主專案 BE(只有第 ② 件一支測試)。

問題是什麼(白話)

① 疆界守衛靜默失效。 每支套件的 tests/.../test_plugin_contract.py 有三支測試,把套件目錄下每個 .py 用語法樹解析,檢查有沒有偷 import 主專案、偷 import 白名單外的 jedi 套件、偷讀環境變數。它們用 PKG_ROOT = Path(<pkg>.plugin.__file__).resolve().parent 決定要掃哪個目錄——plugin.py 在套件根時指得對,但 FR-089/091 把 plugin.py 拆成 plugin/ 子套件後,同一行指到 plugin/ 子目錄,守衛只掃裡面 5 個檔,api/app/domain/infra 全沒掃,而測試照樣全綠。CM-1699 runner 發現並修了自己那支;首腦實查 jedi-asset(範例)與 jedi-bulletin 都中。

② 主專案一支守衛紅。 test/test_module_boundaries.py::test_upload_file_endpoint_paths_unchangedjedi_file_upload.api.__file__ 的原始碼文字找六條 URL 字面值,CM-1698 把 URL 對照表搬到 api/routing.py,它就找不到了。六條 URL 本身零變更(起 app 讀 url_map 驗過),套件側已開 FROZEN_URLS 凍結集合。

③ 第一批三支 harness 沒有 --smoke ai-bot、remote-agent、ai-dashboard 的 harness/dev_app.py 只能 app.run() 綁 port 起服務,首腦並行驗收時撞 port 撞了三次。標準形狀要求 --smoke(用 Flask test client 打一輪端點就結束,不綁 port)。

在哪裡

① jedi-asset/tests/unittest/test_plugin_contract.py:20     PKG_ROOT = Path(asset_plugin.__file__).resolve().parent
   jedi-bulletin/tests/unittest/test_plugin_contract.py:29  PKG_ROOT = Path(bulletin_plugin.__file__).resolve().parent
   正確寫法範本:jedi-system-core/tests/unittest/test_plugin_contract.py:35  PKG_ROOT = Path(jedi_system_core.__file__).resolve().parent
② compliance-manager-be/test/test_module_boundaries.py  def test_upload_file_endpoint_paths_unchanged
   套件側凍結集合:jedi-file-upload/jedi_file_upload/api/routing.py  FROZEN_URLS(api/__init__.py 已 re-export)
③ jedi-ai-bot/harness/dev_app.py(__main__ 只有 create_app().run)
   jedi-remote-agent/harness/dev_app.py(__main__ 有 --migrate/--seed 分支,缺 --smoke)
   jedi-ai-dashboard/harness/dev_app.py:199(app.run(port=5006))
   範本:jedi-system-core/harness/dev_app.py 的 smoke()+argparse --smoke;jedi-bulletin/jedi-notification 也有

怎麼修(三件各一 commit)

要寫測試

手測(驗證等級:輕)

紀律

已完成修正(CM-1702)

三件小尾巴都改完,各自獨立 commit,都在 feature/FR-075