本卡屬 FR-090(母卡 CM-1682)第 6 棒 CM-1696 拆出的第 2 子卡,主專案側。前置:第 6-1 棒(套件側取用口)已 commit,且 BE 走 path dependency 吃到那版。 純主專案,不動套件。

這一棒在做什麼(白話)

主專案的 DI container(依賴注入容器,「誰負責建哪個 service」的組裝表)現在替每支套件把它自己的 repo → domain service → app service 整條再建一遍——bulletin 97 行、iam 352 行、license 84 行、asset 89 行。但套件自己的 build_services() 本來就會自組,這層重複是「接一支套件要動第四個檔」的原因。這一棒把重複拆掉:零引用的 container 整個刪;有引用的只留「主專案 adapter 需要的 provider」;48 處直接伸手進套件 container 的寫法,全部改成從套件的取用口 host_services(app) 拿。

首腦核對(2026-09-13,BE HEAD 3bf476a9):

在哪裡

~/Projects/Billows/Audit-Manager/compliance-manager-be/  branch feature/FR-075
整刪(zero refs):di_containers/bulletin/ di_containers/issue/ di_containers/license/ di_containers/asset/ + containers.py 對應宣告
瘦:di_containers/upload_file/ system_core/ survey/ notification/ auth/(iam,只瘦 34 處引用不到的 provider)

48 處改走取用口:
 di_containers/containers.py:178                              detection_tools override
 di_containers/flow_control/flow_control_containers.py:191,222  file_upload_service ×2
 di_containers/flow_control/flow_control_containers.py:264      notification_service
 di_containers/flow_control/flow_control_containers.py:414      survey_snapshot_domain_service
 di_containers/notify_config/containers.py:12                  system_config_service
 di_containers/auth/auth_containers.py:288                     tenant_storage_config_seeder
 di_containers/setup/setup_containers.py:41                    tenant_storage_config_seeder
 di_containers/cloud_integration/cloud_integration_containers.py:206  file_upload_service
 di_containers/feedback/feedback_containers.py:50,63           system_config_service ×2
 di_containers/feedback/feedback_containers.py:56              file_upload_service
 di_containers/task_survey/task_survey_containers.py:42        system_config_service
 di_containers/task_survey/task_survey_containers.py:48,49     survey_domain_service / survey_question_domain_service
 di_containers/oscal/oscal_containers.py:237,359,454,493       file_upload_service ×4
 di_containers/oscal/oscal_containers.py:358,387               upload_file_domain_service ×2
 di_containers/module_frame/module_frame_containers.py:185     upload_file_domain_service
 di_containers/module_frame/module_frame_containers.py:208     file_upload_service
 di_containers/flow_engine/workflow_excution_containers.py:104 system_config_service
 di_containers/flow_engine/job_evidence_containers.py:29,30    file_upload_service / survey_domain_service
 di_containers/detection_tools/detection_orchestration_containers.py:56,79,123,124
 di_containers/detection_tools/detection_tools_containers.py:169,170,191,192
 api/system_config/routes/security_policy_route.py:35          Provide[...security_policy_app_service]
 api/system_config/routes/system_config_route.py:97,108,132,144,158  Provide[...restore / system_config_service]

core/plugins/{file_upload,system_core,survey,notification,bulletin,issue,license,asset,identity}.py  build_adapters() 的 services= 段

怎麼修

要寫測試