第三波前两批:六个「看着成功其实没干活」的平台漏洞堵上,记录页能回放,管理页与画布收尾

起因是一次探索运行:Copilot 改节点时把工具绑定整份抹掉,agent 没有工具只能写「假设调用」,
校验节点的自动修复编出 total_count=0 让 schema 通过,协作成员把工具调用标记当文字输出了四轮,
轮数用完后节点把原话当成功结果交出去——运行标成已完成,数据库一次都没查。

平台可信度(先写失败测试)
- Copilot 修改节点改为合并:没写的字段保留,null 才删除;协作成员按名字合并。前后端同一套规则,
  工具集合变小时自查报警、改图回执列出变化
- 新校验规则:提示词点名了某个工具而节点没有绑定它,判错误,Copilot 自查会交回去修
- 校验修复只许改格式:冒出原文没有的值就判修复无效;修复这次模型调用计入用量
- 识别模型把工具调用写成文字的情况(DSML、<tool_call> 等标记):纠正一次,仍然如此就判失败并说明原因
- 协作团队用完轮数不再按成功交付:默认失败,可选降档,点出一次都没派到的成员
- 审批恢复后,同一节点里已经执行过的工具调用复用结果,不再重复执行

后端
- 查询时限交给数据库执行(Oracle call_timeout、PG statement_timeout、MySQL max_execution_time、
  SQLite progress handler),可按数据源配置;超时报错与实际耗时一致
- 等审批的运行可以真正取消;会话列表带最后一轮状态;测连接结果持久化;探查结构可只看不存;
  自定义工具可草稿试跑、写坏的参数定义保存时拒绝;MCP 服务改动后作废旧工具缓存;
  检索命中带贡献分解;重建索引在后台跑并报进度;报错统一收进 core/errors

前端
- 公共层:管理页共用件、失败说明(lib/explain)、健康状态进公共库;目录按表各自加载并有超时,
  一张表卡住不再拖垮整站;上传显示真实字节进度;离线横幅只播报不变的句子
- 画布:卡片只说游标所在的那一次执行;等审批时可放弃运行;团队收尾判定与未完成说清楚;
  回放用量取那一刻的值
- 编排页:Copilot 合并语义与工具变化回执;「用完轮数时」选项;正式运行期间锁住所有改图入口
- 回答流 / 问数据:新失败类型说人话并给下一步;画布与右栏互相定位;数据源范围、回收站、重新核对
- 记录页:「航迹」页签复用画布时间轴,可拖动回放、列出关键时刻;列表行带执行 / 等人 / 失败缩略条
- 外壳:统一的离开前确认(data router),导航、⌘K、快捷键、后退都会先问

验证(沙箱):tsc 干净,pytest 838 passed(两遍),14 个检查脚本中 13 个全绿;
check-ui 余 1 项旧断言(按旧日期格式找运行行),3c 更新。
This commit is contained in:
ThearchyHelios
2026-09-27 10:16:32 +08:00
parent e10c4f23fc
commit 587bf7e27c
134 changed files with 20140 additions and 2709 deletions
+49 -1
View File
@@ -36,6 +36,8 @@ export interface Workflow {
is_template: boolean
status?: 'draft' | 'published' | 'governed'
published_version?: number | null
/** 最近一次发布的署名。发布时没有署名为 null */
published_by?: string | null
run_count?: number
created_at?: string
updated_at?: string
@@ -100,6 +102,9 @@ export interface Run {
/** 失败时能定位到的节点 */
error_node_id?: string | null
started_by?: string | null
/** 发起时实际生效的记忆域和知识库(没指定时取设置里的默认值)。老后端不给 */
memory_scope?: string | null
collection?: string | null
created_at?: string
started_at?: string
finished_at?: string | null
@@ -135,7 +140,19 @@ export interface Approval {
resolved_at?: string | null
}
export interface Provider {
/**
* 后端记着的最近一次测连接(模型接入、数据源、MCP 的列表接口都平铺这四项)。
* 没测过、或者连接配置改过之后全是 null。用 lib/health 的 healthFromServer 转成
* HealthRecord 给 HealthPill
*/
export interface ServerHealth {
last_checked_at?: string | null
last_check_ok?: boolean | null
last_latency_ms?: number | null
last_error?: string | null
}
export interface Provider extends ServerHealth {
id: string
name: string
kind: string
@@ -220,6 +237,8 @@ export interface ValidationIssue {
node_id?: string | null
edge_id?: string | null
message: string
/** 出问题的是节点配置里的哪一项:'prompt'、'tools'、'cases[1].condition'。老后端不给 */
field?: string | null
}
/** 单个节点在一次运行中的实时状态,驱动画布上的高亮。 */
@@ -323,6 +342,13 @@ export interface Conversation {
turn_count: number
/** 列表里的副标题,让人一眼认出是哪次聊天 */
last_question: string
/**
* 最后一轮停在哪。左栏对这次没打开过的会话也能标出运行中、待审批、失败。
* 没有轮次时为 null;老后端不给
*/
last_status?: 'running' | 'waiting' | 'error' | 'cancelled' | 'suspended' | 'done' | null
/** 最后一轮的运行。建图阶段就断了的没有 */
last_run_id?: string | null
}
export interface ConversationDetail extends Conversation {
@@ -342,9 +368,31 @@ export interface ConversationTurn {
error: string
/** 复核结论。null = 这一轮没复核过,和「复核过、没发现问题」不是一回事 */
review?: ReviewResult | null
/**
* 可信度元数据(出具档位、运行类别、耗时、查库次数……),前端整块写、整块读,
* 后端只用它算 last_status。老轮次挂在 review.meta 下,后端读出来时统一放到这里
*/
meta?: Record<string, any> | null
created_at?: string
}
/**
* Copilot 改图前后都在、而绑定的工具变了的节点或协作成员。
* 画布上看不出来(节点还在),跑起来才发现查不了库,所以改图回执要明说
*/
export interface ToolChange {
node_id: string
label: string
/** 协作成员的名字;节点本身的工具为 null */
member: string | null
/** 配置里的哪一项:'tools' 或 'agents[2].tools' */
field: string
before: string[]
after: string[]
added: string[]
removed: string[]
}
/**
* 一次运行跑完之后的复核结论(后端 engine/review.py)。
*