本卡屬 FR-091(母卡開卡後補號)第一批,是五支裡最重的一支:施工日誌 47 處、ctx() 21 處、3 支 migration。仍屬輕量(1 條 route、0 entity)。
jedi-remote-agent 是檢測 agent 的心跳與派工單,FR-069 P4 第一個做 migration 隨包的套件,所以檔頭到處寫「P4 定案」「CM-1440」。plugin.py 362 行、api/init.py 有 21 處 ctx()。主專案 infra/remote_agent/ 有 4 支 adapter(1684 剛搬進去),那些本卡不動,由 CM-1689 收。
首腦核對:plugin.py 362 行 5 dataclass;api/init.py 0 行(守門在別處,先找);route 1;entity 0;migration 3;tests 71 支;harness 有(含 apply_migrations、seed_tenant_token);施工日誌 47 處;ctx() 21 處;logger common.jedi_remote_agent/jedi_remote_agent;不吐 created_user_name;tests/integration 無。主專案 di_containers/remote_agent/、di_containers/agent_task/、api/remote_agent/__init__.py 都 import 它。
套件:/Users/chouraymond/Projects/Jedicogy/module/jedi-python-package/jedi-remote-agent/
範例:jedi-asset/;SOP §4.3
主專案 import 面:grep -rn "from jedi_remote_agent" compliance-manager-be --include='*.py' 排除 .venv(api/remote_agent/__init__.py、di_containers/remote_agent/、di_containers/agent_task/、infra/remote_agent/adapter/、infra/detection_tools/)
plugin.py → 五檔,migrations.py 讀 3 支 SQL(MIGRATIONS_DIR 要 parent.parent);api 層守門先 grep def ctx 找在哪,拆成 guards.py+routing.py。對外 import 不變。common.jedi_remote_agent;屬性名統一。--migrate 套三支 SQL 兩次冪等。BE 重啟後 POST /api/1.0/agents/heartbeat 不帶憑證回 401(不是 500)。jedi-remote-agent/。主專案 infra/remote_agent/ 四支 adapter 不動(CM-1689 收)。絕不發版。契約不改。做完 commit+回寫不等令;push 等令;branch feature/FR-075 不切。