本卡屬 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,回寫要講「出貨基線待重產」。

reuse/extend/new

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

怎麼做

驗收(首腦照這個驗)

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 綠;回寫「出貨基線待重產」

必讀