feat: add memindadm runtime policy for agent code runs (Phase 1.5)

Persist code-run gates in admin DB and expose them via /auth/status so H5 can honor runtime policy without VITE rebuilds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-23 21:33:27 +08:00
parent 13f5c740a1
commit 239c41f935
12 changed files with 639 additions and 43 deletions
+8 -7
View File
@@ -339,15 +339,16 @@ node scripts/migrate-agent-code-run-config-from-env.mjs --apply
## 9. 实施清单(Phase 1.5
- [ ] `agent-code-run-admin-config.mjs` + 单测
- [ ] `admin-routes.mjs``/agent-code-run/config``/runtime`
- [ ] `server.mjs``/auth/status` 增加 `agentCodeRun`
- [ ] `agent-run-routes.mjs`:改用 `getEffectivePolicy(userId)`
- [ ] `agentRunMode.ts`runtime policy 优先于 VITE_
- [x] `agent-code-run-admin-config.mjs` + 单测
- [x] `admin-routes.mjs``/agent-code-run/config``/runtime`
- [x] `server.mjs``/auth/status` 增加 `agentCodeRun`
- [x] `agent-run-routes.mjs`:改用 `getEffectivePolicy(userId)`
- [x] `agentRunMode.ts`runtime policy 优先于 VITE_
- [ ] Ops UI 页面(可先做 JSON 编辑,后做表单)
- [ ] `migrate-agent-code-run-config-from-env.mjs`
- [ ] 更新 `docs/agent-run-worker-rollout-runbook.md``.env.example`
- [ ] verify`agent-code-run-admin-config.test.mjs` + 扩展 `chat-agent-run-gate.test.mjs`
- [ ] 更新 `docs/agent-run-worker-rollout-runbook.md`
- [x] `.env.example` 增加 `MEMIND_CODE_RUN_POLICY_SOURCE`
- [x] verify`agent-code-run-admin-config.test.mjs` + 扩展 `chat-agent-run-gate.test.mjs`
---