F1: add reusable task backend resources and migrate task tools

This commit is contained in:
Xin Wang
2026-10-23 23:45:50 +08:00
parent e958491201
commit 529250173d
17 changed files with 741 additions and 43 deletions
@@ -21,3 +21,7 @@
| B-016 | MVP执行环境 | 内置Reasoner不提供宿主机Shell/文件沙箱;编码由OpenCode处理,界面明确实际权限由执行端配置 | semantic | default |
| B-017 | F0过渡 | Walking skeleton短暂兼容旧tool提交入口以保持累计检查;迁移阶段移除该过渡入口,不保留为新产品接口 | interface | default |
| B-018 | 回退迁移 | 0027为数据语义迁移,downgrade明确拒绝,需备份恢复;不能把新的Reasoner配置静默回退成旧task工具 | semantic | default |
| B-019 | 切换Realtime | 已绑定任务后端时复用现有配置移除确认交互,确认切换后解除绑定,后端资源保留 | semantic | default |
| B-020 | 配置有效性 | 后端配置拒绝未知字段;资源编辑验证已绑定助手,模型/工具失效时阻止保存和执行,不静默漏掉能力 | semantic | default |
| B-021 | 类型与凭据 | 后端资源可切换类型,但必须提交完整合法配置;OpenCode转Reasoner清除服务凭据,同类型空值/掩码保留原凭据 | interface | default |
| B-022 | 指令模板 | 助手绑定 instructions 的 {{变量}} 使用任务接受时冻结的变量单次渲染;资源 instructions 和技能正文按字面使用,不访问密钥变量 | semantic | default |
+2 -1
View File
@@ -3,13 +3,14 @@
| Rung | Feature | Acceptance command | Tier | Status |
|------|---------|--------------------|------|--------|
| F0 | 新后端输入→原生Job→记录主线 | cd backend && .venv/bin/python -m unittest tests.test_task_backend_spine | MUST | passed |
| F1 | 后端资源、助手配置、旧数据迁移 | cd backend && .venv/bin/python -m unittest tests.test_task_backend_resources | MUST | pending |
| F1 | 后端资源、助手配置、旧数据迁移 | cd backend && .venv/bin/python -m unittest tests.test_task_backend_resources | MUST | passed |
| F2 | 原生Reasoner、OpenCode、委派桥 | cd backend && .venv/bin/python -m unittest tests.test_reasoner_backend tests.test_prompt_background_tasks tests.test_background_tasks | MUST | pending |
| F3 | 任务后端资源页与提示词编辑器 | cd frontend && npx tsc --noEmit | MUST | pending |
| F4 | 全量回归、隔离数据库迁移与审阅 | make test | MUST | pending |
## Run record
- F0:新后端资源输入 + 原生Jobs + 旧生命周期累计测试14项,exit 0。显式模拟执行器;backend-spine-smoke.json 已生成。
- F1:12项资源专项测试通过,连同原生主线、桥接、生命周期累计33项通过,exit 0;真实隔离 PostgreSQL 17 完成0026旧数据→0027迁移及CRUD/助手复制/运行时解析,见database-smoke.json。
## Deferred
- 真实模型/OpenCode联调:尚无服务地址与凭据。
@@ -0,0 +1,19 @@
{
"status": "passed",
"database": "isolated disposable PostgreSQL 17 + pgvector Docker container",
"production_database_touched": false,
"environment_file_modified": false,
"temporary_container_removed": true,
"migration": "empty -> 0026; seeded legacy configurations -> 0027",
"checks": [
"model/literal/variable/template instruction sources preserved",
"backend IDs, connection configuration and service credentials preserved",
"legacy task tool rows and ordinary tool bindings removed",
"history IDs, status, sequence, connection and remote handles unchanged; backend metadata mapped; deadline NULL",
"real PostgreSQL resource create/list/update/duplicate/delete and bound-delete 409",
"real PostgreSQL assistant create/duplicate and runtime model/skill/backend resolution",
"API secrets masked; masked update preserves stored credentials"
],
"live_model_or_opencode_called": false,
"scope": "database persistence/configuration validation only; no claims of external model or OpenCode end-to-end execution"
}