mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-24 06:31:59 +00:00
出具横幅把核查缺口分组,审批卡把运行类别交给反方审稿:IssuanceBanner(运行面板成果区、问数据回答、证据页同一个)把双盲复算、反方审稿报上来的缺口另起「核查未通过」「核查未完成」两组,排在「校验未全部完成」上面,先后同时间线和成果节点印章;证据页去掉另列一遍的 IssuanceWithChecks 包装,直接用横幅。RunPanel 的审批卡把 approval.run_class 传给 ChallengeSummary,运行的 GET 失败也照样写「出具会降档」、不另取。check-stream 补横幅分组的断言(新预览用例 issued-verify),check-verify 的 verify-gaps 改读横幅里的新组,check-challenge 补整张审批卡带运行类别的用例
This commit is contained in:
@@ -31,8 +31,9 @@ import fx from './challenge.json'
|
||||
* 卡上按「无法判断」的句数说,两个数不打架
|
||||
* - ?syn=challenge-approval-offpath:正式运行,按降档处置,但反方审稿不在带出具契约的成果节点上游(degrades 为假)
|
||||
* - ?syn=challenge-summary-given:反方审稿那一块单独画,审批自带的运行类别(正式运行)由调用方传进来;检查脚本让这次运行的
|
||||
* GET 失败,卡上照样写「出具会降档」,也不另发这次请求。审批卡(RunPanel 的 ApprovalCard)把 approval.run_class
|
||||
* 传给它之后,卡上走的就是这条路
|
||||
* GET 失败(500),卡上照样写「出具会降档」,也不另发这次请求
|
||||
* - ?syn=challenge-approval-given:同一次运行(GET 同样 500),整张审批卡(RunPanel 的 ApprovalCard):审批带着
|
||||
* run_class,卡把它传给反方审稿那一块,照它说出具、不另取
|
||||
* - ?syn=challenge-approval-dup:同 many,工件里补出来的一句和条目里的一句原文相同、unit 不同(工件由检查脚本合成)
|
||||
* - ?syn=challenge-approval-norecord:同 many,审稿记录没存上(artifact 为 null)
|
||||
*
|
||||
@@ -68,9 +69,8 @@ function Card({ approval, name, dense = false }: { approval: Approval; name: str
|
||||
}
|
||||
|
||||
const RUNS = fx.runs
|
||||
/** 期 4 起服务端另带的两项:unreviewed(没能反查的句数)、degrades(被推翻的会不会让出具降档) */
|
||||
type Challenge = ApprovalChallenge & { unreviewed?: number; degrades?: boolean }
|
||||
const withChallenge = (c: Partial<Challenge>): ApprovalReport => ({ ...report, challenge: { ...challenge, ...c } as ApprovalChallenge })
|
||||
/** 期 4 起服务端另带的两项(unreviewed 没能反查的句数、degrades 被推翻的会不会让出具降档)类型里都有,按需盖上 */
|
||||
const withChallenge = (c: Partial<ApprovalChallenge>): ApprovalReport => ({ ...report, challenge: { ...challenge, ...c } })
|
||||
const many = fx.many as unknown as ApprovalChallenge
|
||||
/** 没有被推翻的结论:同第一个用例去掉被推翻的那句,计数跟着改 */
|
||||
const clear: Partial<ApprovalChallenge> = {
|
||||
@@ -82,7 +82,7 @@ const clear: Partial<ApprovalChallenge> = {
|
||||
* 记为无法判断,unreviewed 不会多于 inconclusive)。原来无法判断的 u11 是查过了、数据不够,不算未能反查
|
||||
*/
|
||||
const UNREVIEWED_UNITS = ['u5', 'u8']
|
||||
const unreviewed: Partial<Challenge> = {
|
||||
const unreviewed: Partial<ApprovalChallenge> = {
|
||||
counts: { stands: 0, weakened: 0, refuted: 1, inconclusive: 3 },
|
||||
items: challenge.items.map((it) => (UNREVIEWED_UNITS.includes(it.unit) ? { ...it, verdict: 'inconclusive' } : it)),
|
||||
artifact: 'f'.repeat(64),
|
||||
@@ -245,6 +245,10 @@ export const cases: Record<string, () => JSX.Element> = {
|
||||
<ChallengeSummary reports={[withChallenge({ degrades: true })]} runId={RUNS.given} runClass="formal" />
|
||||
</div>
|
||||
),
|
||||
'challenge-approval-given': () => (
|
||||
<Card name="challenge-approval-given"
|
||||
approval={approvalOf('ap-chal-17', RUNS.given, 'formal', withChallenge({ degrades: true }))} />
|
||||
),
|
||||
'challenge-approval-offpath': () => (
|
||||
<Card name="challenge-approval-offpath"
|
||||
approval={approvalOf('ap-chal-15', RUNS.offpath, 'formal', withChallenge({ on_refuted: 'degrade', degrades: false, unreviewed: 0 }))} />
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import type { JSX } from 'react'
|
||||
import { AssistantStream, type StreamTurn } from '../../run/AssistantStream'
|
||||
import { decodeRun } from '../../run/decode'
|
||||
import type { RunEvent } from '../../types'
|
||||
|
||||
/**
|
||||
* 出具横幅里的核查缺口(运行面板成果区、问数据回答用的 run/AssistantStream 的 IssuanceBanner),scripts/check-stream.mjs
|
||||
* 按它检查:
|
||||
* - ?syn=issued-verify:正式运行降档出具。缺口里有一条没通过 SQL 检查的(横幅单列)、双盲复算和反方审稿报上来的几条
|
||||
* (两路结果不一致、结论被推翻、指标无法复算),和一条校验没做完的;先后照服务端(出具契约按上游节点的先后收),核查的和
|
||||
* 别的混在一起。横幅按「核查未通过」「核查未完成」「校验未全部完成」分组,先后同时间线上出具那一行
|
||||
*
|
||||
* 门店、指标、数字都是虚构的。缺口原话照服务端的写法(出具契约给上游节点的缺口加「节点类型「节点名」:」的前缀)
|
||||
*/
|
||||
export const ISSUED_VERIFY = {
|
||||
run: 'syn-issued-verify',
|
||||
sql: '查询「取门店流水」(Q1)未通过 SQL 检查(「门店」关联「流水明细」是一对多,对「门店」的「面积」求和会重复计算),结果不可靠;受影响的引用:指标「坪效」',
|
||||
failed: ['双盲复算「复核月报口径」:指标「客单价」两路结果不一致,审核人选择了盲算结果', '反方审稿:推翻了 1 句结论:「西区客流回升主要来自会员日」'],
|
||||
unfinished: ['双盲复算「复核月报口径」:指标「复购率」无法复算:输入来自合并查询,无法单独复算'],
|
||||
other: ['叙述模板渲染为空(路径可能有误)'],
|
||||
}
|
||||
|
||||
const V = ISSUED_VERIFY
|
||||
const ISSUANCE = {
|
||||
tier: 'degraded', matched_numbers: 4, metrics_checked: 3, missing_required: [], missing_expected: [], unmatched_numbers: [],
|
||||
calibers: [],
|
||||
gaps: [V.failed[0], V.sql, V.other[0], V.unfinished[0], V.failed[1]],
|
||||
sql_checks: [{ query: '查询「取门店流水」(Q1)', node_id: 'fetch', problems: ['「门店」关联「流水明细」是一对多,对「门店」的「面积」求和会重复计算'],
|
||||
refs: ['指标「坪效」'], gap: V.sql }],
|
||||
}
|
||||
const OUTPUT = { 月报: '上月各门店客单价 86.4 元,坪效 1,240 元。', _issuance: ISSUANCE }
|
||||
|
||||
function verifyTurn(): StreamTurn {
|
||||
const at = Date.now() / 1000 - 30
|
||||
const events: RunEvent[] = [
|
||||
{ seq: 1, type: 'run.started', node_id: null, ts: at, data: { nodes: 1 } },
|
||||
{ seq: 2, type: 'node.started', node_id: 'done', ts: at + 1, data: {} },
|
||||
{ seq: 3, type: 'issuance', node_id: 'done', ts: at + 1.2, data: { ...ISSUANCE, unmatched: 0 } },
|
||||
{ seq: 4, type: 'node.finished', node_id: 'done', ts: at + 1.3, data: { duration_ms: 300 } },
|
||||
{ seq: 5, type: 'run.finished', node_id: null, ts: at + 1.4, data: { output: OUTPUT, duration_ms: 1400 } },
|
||||
]
|
||||
return {
|
||||
id: 'issued-verify', question: '上月门店经营月报', phase: 'done', status: '已完成',
|
||||
steps: decodeRun(events, { status: 'succeeded' }), output: OUTPUT, runId: V.run, runClass: 'formal',
|
||||
}
|
||||
}
|
||||
|
||||
export const cases: Record<string, () => JSX.Element> = {
|
||||
'issued-verify': () => (
|
||||
<div className="h-screen" data-fixture="issued-verify"><AssistantStream turns={[verifyTurn()]} /></div>
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user