mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-26 03:12:38 +00:00
界面跟上点名接入的新规矩:设置页标出已停用的接入、选不了别的停用接入,接入表变了画布重新校验,问题面板和修复预览不露键名
点名停用的接入以前照常调用,现在运行时照实报错,界面要提前说: - 设置页门控、裁判、核查三格:存着的接入已停用和「不存在」一样在那一格下面写明后果;下拉里别的停用接入列着但选不了(只留已选着的那个);模型一格不再写「留空则使用」一个调不了的接入的默认模型。服务端按项拒收(422 带 field)时整句落到那一格下面、焦点移过去,保存条连同原因一起写,不再截掉「请在……中启用它」。 - 画布校验现在读接入表:编排页记下校验时的接入表签名(id、名称、启用与否),从设置里改完接入回来、或目录刷新后接入表变了,就重新校验一次,不再停着一句过时的「已停用」。 - 问题面板、修复预览里点名接入的字段写「模型接入」「成员「分析师」的模型接入」「工作流默认设置 · 模型」,不露 provider、model 键名;修复预览给列表项写名字。同一节点上自己的接入和成员的接入是两处问题,合并、找修复都连字段一起认,计数不再少算。 检查:check-publish 加点名接入的修复(一处一行、候选、预览、应用、390px 不溢出)、问题面板字段叫法、在设置里删了接入回到画布重新校验;check-manage 加设置页已停用接入的三格说明、选项、按项拒收;check-evidence 里全图默认的 model 改按「模型」核对(不借裁判叫法的原意不变)。
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
* 那一栏,定位落到工具上(见 toolBindingOf)。
|
||||
*/
|
||||
import { ApiError } from '../api/client'
|
||||
import { APPROVAL_POLICY_LABEL, JUDGE_FIELD_LABEL, JUDGE_ON_UNSUPPORTED_LABEL, UPGRADE_TEXT, nodeTypeLabel } from '../lib/terms'
|
||||
import {
|
||||
APPROVAL_POLICY_LABEL, JUDGE_FIELD_LABEL, JUDGE_ON_UNSUPPORTED_LABEL, PROVIDER_REF_TEXT, UPGRADE_TEXT, nodeTypeLabel,
|
||||
} from '../lib/terms'
|
||||
import { NODE_DEFS } from './nodeDefs'
|
||||
import type { FlowNode } from '../store/studio'
|
||||
import type {
|
||||
@@ -244,6 +246,12 @@ function normalizeIssue(raw: any): ValidationIssue | null {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 点名的模型接入不存在或已停用(后端 engine/provider_refs.py)。一处一条问题、一条修复:同一个协作节点上自己的接入和
|
||||
* 成员的接入是两处,合并、找修复都要连字段一起认
|
||||
*/
|
||||
export const isProviderRefCode = (code?: string | null): boolean => code === 'provider.missing' || code === 'provider.disabled'
|
||||
|
||||
function normalizeFix(raw: any): PublishFix | null {
|
||||
if (!raw || typeof raw !== 'object' || typeof raw.id !== 'string' || !raw.id) return null
|
||||
const kind = raw.kind === 'choice' || raw.kind === 'assist' ? raw.kind : raw.kind === 'auto' ? 'auto' : null
|
||||
@@ -259,6 +267,7 @@ function normalizeFix(raw: any): PublishFix | null {
|
||||
code: asText(raw.code),
|
||||
kind,
|
||||
node_id: raw.node_id ?? null,
|
||||
...(typeof raw.field === 'string' && raw.field ? { field: raw.field } : {}),
|
||||
label: asText(raw.label) || raw.id,
|
||||
preview: raw.preview && typeof raw.preview === 'object' ? raw.preview : null,
|
||||
options,
|
||||
@@ -318,7 +327,10 @@ export function fixFor(issue: ValidationIssue, fixes: PublishFix[]): PublishFix
|
||||
if (issue.fix) return fixes.find((f) => f.id === issue.fix)
|
||||
if (!issue.code) return undefined
|
||||
const same = fixes.filter((f) => f.code === issue.code)
|
||||
const exact = same.find((f) => (f.node_id ?? null) === (issue.node_id ?? null))
|
||||
// 点名的接入一处一条修复:同一节点上的几处按字段认
|
||||
const exact = (isProviderRefCode(issue.code)
|
||||
? same.find((f) => (f.node_id ?? null) === (issue.node_id ?? null) && (f.field ?? null) === (issue.field ?? null))
|
||||
: undefined) ?? same.find((f) => (f.node_id ?? null) === (issue.node_id ?? null))
|
||||
if (exact) return exact
|
||||
return issue.node_id == null ? same[0] : same.find((f) => f.node_id == null)
|
||||
}
|
||||
@@ -326,13 +338,16 @@ export function fixFor(issue: ValidationIssue, fixes: PublishFix[]): PublishFix
|
||||
/**
|
||||
* 同一处问题只列一行:validate 和门禁常对同一处各报一条(同 code、同节点,说法不同),
|
||||
* 列两行就是两组一样的修复控件、「会被拦下 2 处」。合成的那一行取最重的级别、第一条 error 的说法,
|
||||
* 其余说法收进 others(悬停可见)。没有 code 的认不出是不是同一处,照原样各列一行
|
||||
* 其余说法收进 others(悬停可见)。没有 code 的认不出是不是同一处,照原样各列一行。
|
||||
* 点名的模型接入连字段一起认:协作节点自己的接入和成员的接入是两处问题、各有各的修复,不合成一行
|
||||
*/
|
||||
export function mergeIssues(issues: ValidationIssue[]): { issue: ValidationIssue; others: string[] }[] {
|
||||
const out: { issue: ValidationIssue; others: string[] }[] = []
|
||||
const at = new Map<string, number>()
|
||||
for (const issue of issues) {
|
||||
const key = issue.code ? `${issue.code}\u0000${issue.node_id ?? ''}` : null
|
||||
const key = issue.code
|
||||
? `${issue.code}\u0000${issue.node_id ?? ''}${isProviderRefCode(issue.code) ? `\u0000${issue.field ?? ''}` : ''}`
|
||||
: null
|
||||
const i = key != null ? at.get(key) : undefined
|
||||
if (i == null) {
|
||||
if (key != null) at.set(key, out.length)
|
||||
@@ -382,11 +397,15 @@ const CONTRACT_KEYS: Record<string, string> = {
|
||||
/** 不在节点定义的字段表里、由检查器自己画的几项(子工作流钉的版本、升版处置),以及图级的全图默认 */
|
||||
const EXTRA_FIELDS: Record<string, string> = {
|
||||
workflow_version: '固定版本', upgrade_policy: '上游发布新版本时', defaults: '工作流默认设置',
|
||||
// 多数节点的检查器里没有接入这一栏(只有双盲复算、反方审稿有),修复点名接入时照样要写得出叫法
|
||||
provider: PROVIDER_REF_TEXT.field,
|
||||
}
|
||||
/** 点号后面那一段的叫法:契约里的键,全图默认里的审批策略,列表项里的名称、取值、表达式 */
|
||||
const SUB_KEYS: Record<string, string> = {
|
||||
...CONTRACT_KEYS, approval: '审批策略', claims: '未附依据的结论句', on_uncited: '未附依据时',
|
||||
name: '名称', value: '取值', expression: '表达式',
|
||||
// 点名的接入:成员的、全图默认里的(连同全图默认里结论句裁判的那一份)
|
||||
provider: PROVIDER_REF_TEXT.field, model: PROVIDER_REF_TEXT.model, judge: PROVIDER_REF_TEXT.judge,
|
||||
}
|
||||
/** 契约 claims 的 on_uncited:没挂依据的结论句怎么算 */
|
||||
const ON_UNCITED_LABEL: Record<string, string> = {
|
||||
|
||||
Reference in New Issue
Block a user