本卡屬 FR-181(母卡 FR-181 母案(同清單上一張)),卡 C-1,批 7。只改 主 repo。依賴:A-2、B-1、B-2、B-3。
收口:①守衛測試三支——兩個直推開關預設關;開關關的時候把 AgentDataPlaneClient.command 換成會炸的假物件,跑派工/重啟/升級/換證/設定變更五條都要綠(證明沒有任何路徑偷偷直推);agent_requests 預設 5 分鐘過期。②FR-170 design、FR-171 design 與 discussion 檔頭各加一行「本段指令直推已被 FR-181 推翻,改 Agent 長輪詢」指向本案(不改內文,照「定稿後不改 v1.0」規範)。③安裝手冊刪「8443 要對主系統開放」、改成「Agent 只需能連到主系統」;資安報告連線清單 8443 改「預設不提供指令功能,只有健檢」、加三條新出站端點。④FR-181 README 結論與總進度對齊現況。只寫現況不寫沿革。
new:test/test_agent_outbound_only.py——①AGENT_DIRECT_PUSH_ENABLED 預設 False;②開關 False 時 AgentDataPlaneClient.command 被任何 app/core 路徑呼叫 → 測試紅(patch 成 raise 後跑派工/重啟/升級/換證/設定變更五條,全綠);③agent_requests 預設 expires_at = +5 分。extend:FR-170 design §3.x、FR-171 design 與 discussion 檔頭各加一行「本段指令直推已被 FR-181 推翻,改 Agent 長輪詢;詳見 …」(不改內文,D8);docs/user-manual/ 安裝段刪「8443 要對主系統開放」、加「Agent 只需能連到主系統」;docs/security-report/connections/ 8443 條目改「預設不提供指令功能,只有健檢」、新增 /agents/commands/replies/files 三條出站;FR-181 README 結論與總進度
repo:~/Projects/Billows/Audit-Manager/compliance-manager-be
改既有:docs/features/FR-170-2610-agent-architecture/design.md(檔頭一行)
改既有:docs/features/FR-171-2610-agent-command-channel/design.md(檔頭一行)
改既有:docs/features/FR-171-2610-agent-command-channel/discussion.md(檔頭一行)
改既有:docs/user-manual/(安裝段)
改既有:docs/security-report/connections/(8443 與三條新出站)
改既有:docs/features/FR-181-2611-agent-outbound-only-channel/README.md
新開:test/test_agent_outbound_only.py
test/test_agent_outbound_only.py:①Config.AGENT_DIRECT_PUSH_ENABLED is False 且 Agent 側同名設定預設(讀 evidence-agent 的 config/config.py 不方便就只測主系統,回寫說明);②patch("jedi_remote_agent.app.service.agent_data_plane_client.AgentDataPlaneClient.command", side_effect=AssertionError) 後跑派工 insert、push_restart_after、push_update_soon、notify_agent_after_commit、換證 route 五條(既有測試的呼叫方式)全綠;③agent_request_service.ask 寫的列 expires_at - created ≈ 5 分。突變:①翻 True → 紅。design.md 檔頭(front matter 後第一行)、FR-171 design.md 與 discussion.md 檔頭各加一行:「> 🔴 本文指令直推(主系統→Agent 8443)與「落地版直推一定通」前提已被 FR-181 推翻(2026-11-07):主系統不再連 Agent,改 Agent 長輪詢;身分、換證、金鑰登記簿、設定通道、事件通道不受影響。」只加這一行,git diff 每檔只有一行新增。三站 render_index.py 重 build。docs/user-manual/:grep 8443 與「對主系統開放」,安裝前置條件改成「Agent 主機只需能連到主系統(出站 HTTPS);主系統不需連到 Agent」;Agent 主控台 8444 的說明不動。docs/security-report/connections/ 8443 條目改「預設不提供指令功能,只有健檢;指令由 Agent 長輪詢取得」;新增 /agents/commands、/agents/replies、/agents/files 三條(方向 Agent→主系統、通行證+DPoP)。README.md 結論對齊現況、總進度表各卡 ✅;C-1 自己那列由首腦收。grep 原本\|改判\|第 [0-9] 棒\|這次整理 命中 0。守衛三支綠、突變①翻預設 True → 紅;grep -rn '8443' docs/user-manual/ 只剩 Agent 主控台相關;FR-170/171 四處檔頭有指路行且 git diff 只有那一行;FR-181 站 render_index.py 重 build 無錯
~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-181-2611-agent-outbound-only-channel/design.md §3 決策定案(D1~D8)、§4 端到端流程兩張圖、§5 詳細設計本卡那節、§7 拆分表本卡那列;為什麼這樣定看 discussion.mdcore/plugins/_agent_commands.py(檔頭說明三個觸發點)、app/remote_agent/service/agent_command_service.py、core/plugins/_agent_config_notify.py、core/plugins/_agent_keys.py、infra/upload_file/remote_agent_adapter.py、core/plugins/remote_agent.py(plugin mount 與 handle)jedi-remote-agent/jedi_remote_agent/api/routing.py(端點表與 AUTH_AGENT)、api/routes/(心跳 route 範本)、app/service/agent_data_plane_client.py(直推出口,留著)、app/service/heartbeat_vulndb.py(_CORE_KEYS 心跳守衛);契約 jedi-agent-protocol/jedi_agent_protocol/commands.py、heartbeat.py、events.pyguidant_agent/sync/app/config_pull.py(WorkerComponent 拉取範本)、enroll.py(心跳 client 與通行證)、event_sender.py+outbox.py(送不到補送)、task_queue.py、sync/api/data_plane_server.py(8443 與 blueprint 掛點)、sync/api/cmd_*.py(直推 handler,本案改薄)、files/api/blob_route.py、scan/api/routes/、docs/ARCHITECTURE.md