本卡屬 FR-181(母卡 FR-181 母案(同清單上一張)),卡 E-1,批 3。只改 主 repo。依賴:F-1、F-3、P-0。
環境卡:批 2 三張都合回、套件都發到 Nexus 之後,主系統要「接上」——釘兩支套件新版(0.3.0、1.13.0)、poetry update 這兩支;gunicorn 預設從 sync 翻成 gthread 16 執行緒(P-0 已加好設定入口,本卡翻預設;如果 P-0 的結論是退定時輪詢,就不翻、回寫說明);installer 寫 .env 時補這兩個 gunicorn 變數給客戶調;建新表 agent_requests(存「一次性、短命、要麼做完要麼過期」的請求:取消檢測、換證、測試連線、存帳密、證據檔四種、查日誌——工單/重啟/升級不搬進來,它們各有自己的表)。這張卡不寫任何 service 或 route,純環境與 schema。migration 是主線 phase=active,回寫要講「出貨基線待重產」。
extend:pyproject.toml 釘兩支新版(Nexus 已有,不走 path)、poetry update jedi-agent-protocol jedi-remote-agent;main.py GUNICORN_WORKER_CLASS 預設翻成 gthread、GUNICORN_THREADS 預設 16(P-0 加的入口,本卡翻預設;P-0 結論若是退定時輪詢則本卡不翻、回寫說明);install.sh 寫 .env 時補這兩個變數(給客戶調)。new:migration scripts/sql/2026-11-XX-fr181-agent-requests.sql——表 compliance.agent_requests(id/uid/agent_id FK/tenant_id/kind/payload jsonb/status waiting|taken|done|failed|expired/result jsonb/reason/expires_at/taken_at/done_at/created 系列;索引 (agent_id, status, expires_at);GRANT cm_app;RLS 照 agent_tasks;INSERT schema_migrations);主線 phase=active → 回寫「出貨基線待重產」。禁:不寫任何 service/route
repo:~/Projects/Billows/Audit-Manager/compliance-manager-be
改既有:pyproject.toml
改既有:poetry.lock
改既有:main.py 280(預設翻 gthread)
改既有:scripts/installer/install.sh 1490(.env 補兩個 gunicorn 變數)
改既有:docs/claude/deployment-env.md
新開:scripts/sql/2026-11-XX-fr181-agent-requests.sql
pyproject.toml 釘 jedi-agent-protocol = "0.3.0"、jedi-remote-agent = "1.13.0"(Nexus 已有,不走 path);poetry update jedi-agent-protocol jedi-remote-agent(🔴 只指名這兩支);python -c 'import jedi_agent_protocol, jedi_remote_agent; print(...)' 驗版號。main.py:GUNICORN_WORKER_CLASS 預設 sync→gthread、GUNICORN_THREADS 預設 16——先讀 P-0 的 evidence/bench-longpoll.md 結論:寫「退定時輪詢」就不翻、本卡回寫說明並停。scripts/installer/install.sh 1490 行附近寫 .env 的段落加 GUNICORN_WORKER_CLASS=gthread、GUNICORN_THREADS=16 兩行(有註解:吊著的 Agent 長輪詢請求各佔一執行緒);docs/claude/deployment-env.md 補兩列。scripts/sql/2026-11-XX-fr181-agent-requests.sql(照 sql-migration skill):CREATE TABLE compliance.agent_requests(欄位見 design §5.4;status CHECK in waiting/taken/done/failed/expired;agent_id FK compliance.remote_agents;tenant_id);索引 (agent_id, status, expires_at);GRANT SELECT, INSERT, UPDATE, DELETE ON ... TO cm_app+sequence;RLS policy 照 agent_tasks 那支抄;INSERT public.schema_migrations;檔頭 -- Date:。DEV 用 cmmgr psql --single-transaction -v ON_ERROR_STOP=1 -f。🔴 只套 DEV。pytest test/test_module_boundaries.py;USE_GUNICORN=true 起一次看 log worker_class=gthread threads=16;回寫「出貨基線待重產」。python -c 'import jedi_agent_protocol; print(jedi_agent_protocol.__version__)' 0.3.0、jedi_remote_agent 1.13.0;USE_GUNICORN=true 起 log 印 worker_class=gthread threads=16;DEV 套 migration 後 \d compliance.agent_requests 欄位齊、schema_migrations 有列;pytest test/test_module_boundaries.py 綠;回寫「出貨基線待重產」
~/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