口径召回前端(W4-a):版本用量加问数回答和召回、发布弹窗预告召回规模、版本历史看召回批次、recall 待办卡、时间线认两个新事件

为什么:前三波召回只有接口;这一波收口,口径升版之后谁的答案受影响、重算了几组、数变没变、怎么处置都要在界面上走得通。

- canvas/versionUsage:使用情况那一行加问数回答、导出、定时任务、召回(老服务端不给就不写)
- canvas/RecallPanel(新):发布弹窗「召回」一行——旧版本被谁用过、按参数去重几组、发布后自动重算几组、超出上限几组(可在
  版本历史接着算)、上限为 0 时只列不算、不能重算的原因;版本历史展开一版——每组结论(数变了 / 没变 / 无法重算:原因 /
  重算失败 / 正在重算 / 未重算)、变了的指标、开了几条待办、召回运行链接,「另有 M 组未重算」+ 接着算
- run/RecallTask(新)+ TaskCard:recall 待办卡——旧口径、新口径、两版之差一行一个指标,每个数点得开召回卡的指标链;每个答案
  当时的值点得开(正式运行的口径卡、问数回答的查询快照),问数回答链回对话;「按新版重新出具」(不能时停用并写服务端给的
  原因)、「知道了」;遮罩值写已遮罩、点不开;目录有变、表结构变了两种只有「知道了」
- run/decode:ledger.recalled(已按 vN 核对,不影响;召回核对数变没变;试算结果)、ledger.basis_changed(依据有变、依据的
  表结构已变);缺字段不猜
- 文案进 lib/termsRecall.ts;接口 api/recall.ts、形状 typesRecall.ts;TaskKind 加 recall
- 检查:check-inbox 加 recall 卡两段,check-publish 加召回预告和召回批次两段(版本历史、发布弹窗都在这里测;check-versions
  测的是上传表格的版本页,和召回无关),check-decode 加两个新事件的夹具,check-capabilities 的可订阅事件跟上 ledger.recall
This commit is contained in:
ThearchyHelios
2026-10-16 20:05:24 +08:00
parent 77fc0efa10
commit 35583ba1d8
18 changed files with 1236 additions and 16 deletions
+7 -2
View File
@@ -10,6 +10,7 @@ import type {
ViewShareRow,
} from '../typesApp'
import type { ConversationDetail, EvidenceSegmentDetail } from '../types'
import type { VersionRecallCounts } from '../typesRecall'
import { del, get, patch, post, put, qs, request, type RequestOptions } from './http'
const at = (id: string) => `/apps/${encodeURIComponent(id)}`
@@ -105,8 +106,12 @@ type AssistantConversation =
const assistantInflight = new Map<string, Promise<AssistantConversation>>()
export const ledger = {
/** 一个工作流版本被哪些应用钉住、生效记录数、正式运行数 */
/**
* 一个工作流版本被哪些应用固定、生效记录数、正式运行数;口径账本另加的(第 4 波,老服务端不给):被几次问数回答用过、
* 导出过几次、定时任务几个、召回(以这一版为新版本召回过几组、其中数变了几组,作为旧版本被召回过几组)
*/
version: (workflowId: string, version: number) =>
get<{ apps: { app_id: string; name: string; app_version: number }[]; effects: number; formal_runs: number }>(
get<{ apps: { app_id: string; name: string; app_version: number }[]; effects: number; formal_runs: number
answers?: number; exports?: number; schedules?: number; recall?: VersionRecallCounts }>(
`/ledger/workflow-versions/${encodeURIComponent(workflowId)}/${version}`),
}
+3
View File
@@ -27,6 +27,7 @@ import { whatif } from './whatif'
import { reportExport } from './reportExport'
// 应用平台:各自的接口文件,这里只挂上去
import { apps, ledger } from './apps'
import { recall } from './recall'
import { actions, tasks } from './tasks'
import { auth, identity } from './auth'
import { accessKeys } from './accessKeys'
@@ -957,6 +958,8 @@ export const api = {
// ---- 应用平台(typesApp.ts 是接口约定) ----
apps,
ledger,
// 口径召回(下一轮第 4 波)
recall,
tasks,
actions,
auth,
+23
View File
@@ -0,0 +1,23 @@
/**
* 口径召回的接口(docs/design/next-round/02-口径账本.md 做法 7、8),挂在 api.recall 上。形状见 typesRecall.ts。
*
* - preview:发布弹窗的召回预告(把这一版发布成新版本之后,旧版本被谁用过、预计重算几组、超出上限几组);
* - batches:版本历史里口径升到这一版之后的召回批次(每组的结论、「另有 M 组未重算」);
* - continueBatch:手动接着算下一批(都算过了回 409)。
* 待办里的「按新版重新出具」「知道了」走待办接口(api.tasks.respond,decision=reissue / ack)。
*
* 请求函数从 ./http 导入,不要从 ./client 导入(循环导入,见 http.ts 开头)。
*/
import type { RecallBatches, RecallPreview } from '../typesRecall'
import { get, post, qs, type RequestOptions } from './http'
const wf = (id: string) => encodeURIComponent(id)
export const recall = {
preview: (workflowId: string, version: number, opts?: RequestOptions) =>
get<RecallPreview>(`/workflows/${wf(workflowId)}/recall-preview${qs({ version })}`, opts),
batches: (workflowId: string, version: number, opts?: RequestOptions) =>
get<RecallBatches>(`/ledger/recall/${wf(workflowId)}/${version}`, opts),
continueBatch: (workflowId: string, version: number) =>
post<RecallBatches>(`/ledger/recall/${wf(workflowId)}/${version}/continue`),
}