mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-26 11:53:01 +00:00
账本前端:证据「口径」一步、数字上的小标记、问数据轮次摘要与出具 / 对账、可沉淀的问题、设置里的口径账本一组
第 2、3 波只有接口,这一波接上界面(docs/design/next-round/02-口径账本.md 做法 3–6、8 的界面、做法 11;总方案 X3、X10)。
界面层不放逻辑:标签、整题判断、能不能出具、能不能自动、不能的原因、要不要先核对参数都照 GET /api/runs/{id}/ledger 给的画。
- 比对结果不靠实时流(第 2 波遗留):ledger.matched 在封存之后追加、事件总线已经关了,打开着的页面收不到。store/ledger
按退避轮询(1、2、3、5、8、13 秒,之后每 15 秒),服务端答 pending 时写「正在比对口径」,等满 2 分钟还没结论照实说、
给「再取一次」;要自动出具的再等出具的那一次出现,出具、对账的运行没结束的等它们结束。只在有组件看着时轮询,同一次
运行的正文、面板、轮次摘要共用一份
- 证据正文(EvidenceDoc):来自口径的数字后面挂一个小标记,写明受管 / 已发布,悬停写是哪一份口径、怎么认的;相关口径的
数不加标记
- 证据面板出处链最上面加「口径」一步(run/LedgerStep):来自口径——「X」v3(受管)· 参数 · 等价已证明 / 助手选用 ·
按口径正式出具;相关口径——差在哪 + 看差多少;这次的推理——没有相关的已发布口径;没比对的写原因;脚注写「封存后比对,
不在封存范围内」,事后补比的写按哪种口径回看
- 口径对账(run/LedgerReconcile):核对参数(照动作里的入口字段画,推断的参数要先核对,遮罩值不回填)→ 发起(认不出列
怎么配时照 409 带回的选项选对照的指标)→ 结果卡片:每组按你的问法、按口径、差值(附相对差)各自点得开出处链
(apps/EvidenceDrawer,同应用页点数)
- 问数据轮次底部(run/LedgerTurn):一行摘要(几个数来自口径「X」vN、几个是这次的推理、几个没有比对)、整题等价时按口径
正式出具(能自动的写正在自动出具;不能的照写原因,使用者没有应用授权写「请搭建者出具」)、有相关口径时对账;出具过的
正式运行挂在下面,档位写完整出具 / 降档出具 / 不予出具,搭建者点开去运行;回收站里的对话只看不发起
- 可沉淀的问题(pages/ledger/CertifyQueue):工作流列表弹窗里的抽屉,确定性重复、问题聚类、被反复用的答案分开写;
「固化成口径草稿」走 /copilot/from-run 的 freeze 并打开画布,聚类没有共同的 SQL、按人挑的那一轮固化;「不是口径」
要写理由
- 设置(pages/settings/LedgerSettings,照 VerifySettings):自动按口径正式出具、每日上限、比对时限、升版后每次最多重算几组,
和其余偏好共用保存条、整组写 ledger
- 类型 typesLedger.ts、接口 api/caliberLedger.ts(挂 api.caliberLedger)、文案 lib/termsLedger.ts;types.ts 的证据片段
答复加 ledger、rendered 两个键
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Check, Copy, LayoutTemplate, Plus, Search, Trash2, Workflow as WorkflowIcon } from 'lucide-react'
|
||||
import { Check, Copy, Layers, LayoutTemplate, Plus, Search, Trash2, Workflow as WorkflowIcon } from 'lucide-react'
|
||||
import clsx from 'clsx'
|
||||
import { api } from '../api/client'
|
||||
import { useCatalog } from '../store/catalog'
|
||||
@@ -11,6 +11,9 @@ import { formatShortcut } from '../lib/keys'
|
||||
import { leavePass, registerLeaveGuard } from '../lib/leave'
|
||||
import { WORKFLOW_STATUS_LABEL, publishedLevelOf } from '../lib/terms'
|
||||
import type { GraphSpec, Workflow } from '../types'
|
||||
import { useAtLeast } from '../store/auth'
|
||||
import { LEDGER_UI } from '../lib/termsLedger'
|
||||
import { CertifyQueue } from '../pages/ledger/CertifyQueue'
|
||||
|
||||
/** 标签的中文。后端写的是机器标记,和中文界面混排很突兀 */
|
||||
const TAG_LABEL: Record<string, string> = { extracted: '从运行提取', template: '模板' }
|
||||
@@ -192,8 +195,11 @@ export function WorkflowPicker({ open, onClose }: { open: boolean; onClose: () =
|
||||
const [filter, setFilter] = useState<Filter>('all')
|
||||
const [cursor, setCursor] = useState(0)
|
||||
const listRef = useRef<HTMLUListElement>(null)
|
||||
// 「可沉淀的问题」抽屉(口径账本的认证队列,搭建者及以上):盖在列表上,返回回到列表
|
||||
const [queue, setQueue] = useState(false)
|
||||
const builder = useAtLeast('builder')
|
||||
|
||||
useEffect(() => { if (open) { setQuery(''); setCursor(0) } }, [open])
|
||||
useEffect(() => { if (open) { setQuery(''); setCursor(0); setQueue(false) } }, [open])
|
||||
|
||||
const shown = useMemo(() => {
|
||||
const q = query.trim().toLowerCase()
|
||||
@@ -267,13 +273,14 @@ export function WorkflowPicker({ open, onClose }: { open: boolean; onClose: () =
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal open={open} onClose={onClose} title="工作流" width={720}
|
||||
footer={<>
|
||||
<Modal open={open} onClose={onClose} title={queue ? LEDGER_UI.certify.title : '工作流'} width={720}
|
||||
footer={queue ? undefined : <>
|
||||
<span className="mr-auto self-center text-2xs text-faint">↑↓ 选择 · {formatShortcut('Enter')} 打开 · Esc 关闭</span>
|
||||
<button className="btn btn-primary" onClick={async () => { if (await createWorkflow(navigate, refresh)) onClose() }}>
|
||||
<Plus size={12} /> 新建空白工作流
|
||||
</button>
|
||||
</>}>
|
||||
{queue ? <CertifyQueue onBack={() => setQueue(false)} onClose={onClose} beforeLeave={confirmDiscard} /> : <>
|
||||
<div className="mb-2 flex items-center gap-2">
|
||||
<div className="relative flex-1">
|
||||
<Search size={12} className="pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-faint" />
|
||||
@@ -302,6 +309,12 @@ export function WorkflowPicker({ open, onClose }: { open: boolean; onClose: () =
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{builder && (
|
||||
<button type="button" className="btn btn-sm shrink-0" title={LEDGER_UI.certify.openHint}
|
||||
onClick={() => setQueue(true)} data-certify-open="">
|
||||
<Layers size={12} aria-hidden /> {LEDGER_UI.certify.open}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{!shown.length ? (
|
||||
@@ -369,6 +382,7 @@ export function WorkflowPicker({ open, onClose }: { open: boolean; onClose: () =
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
</>}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user