合入 nr6/b:评测「期望没有数据」只认数值格和叙述里的数、逐题 E1 比产出答案的那条查询、判错时给配对上的那一格、估不出金额时不写 0、没做完的模型调用也计一次、助手只给思考不给操作时自动重来一次(问数据与评测同一个决定)、目录两种计数照实说、自由形应用入口与岗位显示名;评分规则升到第 2 版

This commit is contained in:
ThearchyHelios
2026-10-17 12:28:04 +08:00
35 changed files with 838 additions and 99 deletions
+49 -1
View File
@@ -29,7 +29,8 @@
// 14. 助手反问(normal-user-apps N11):只问不改的一轮记成「助手反问」,问题作为这一轮的内容、落库进历史,不再一直停在
// 「正在理解需求」;输入框提示回答助手的问题;刷新后照样标「助手反问」,不当成没查库的回答;
// 15. 回答上的「做成应用」带着这次运行进蓝图(建运行起点的蓝图),不再提取工作流、跳画布的发布弹窗;
// 16. 服务端这一轮已经自查修正过(收到 check 的结论)还没过的:不再整轮重新生成一遍,直接说没过、给补救。
// 16. 服务端这一轮已经自查修正过(收到 check 的结论)还没过的:不再整轮重新生成一遍,直接说没过、给补救;助手只写了思考、
// 一个操作都没给(error.next=retry)的照服务端的决定自动重来一次,还不行再照实报。
// 17. 口径账本(next-round 02):交付了的轮次底部写「正在比对口径」,按退避再取到比对出结果、比完不再取;一行摘要
// (几个数来自哪份口径)、按口径正式出具和对账按钮照服务端给的动作摆;出具、对账的写请求在浏览器层拦下并核对请求体,
// 出具过的正式运行挂在轮次下面(档位、打开运行)。
@@ -532,6 +533,26 @@ async function fakeApi(route) {
return route.fulfill({ status: 200, contentType: 'text/event-stream',
body: ops.map((o) => `data: ${JSON.stringify(o)}\n\n`).join('') })
}
if (String(b.instruction ?? '').includes('只写了思考')) {
// 生成过程一个操作都没给(deepseek 偶发只出思考):服务端的 error 带 next=retry(backend/app/chat/turn.py 的 next_step)。
// 重来那一次(指令里缀了「上一次没有成功」)照常直接回答;「两次都」那一问每次都只写思考
const again = String(b.instruction).includes('上一次没有成功') && !String(b.instruction).includes('两次都')
const spent = { by_model: { m: { input_tokens: 500, output_tokens: 40, calls: 1, cost_usd: 0.001, unpriced_calls: 0 } },
input_tokens: 500, output_tokens: 40, calls: 1, cost_usd: 0.001, unpriced_calls: 0 }
const ops = again ? [
{ op: 'heartbeat', phase: 'planning', elapsed_ms: 200 },
{ op: 'reply', text: '已经查过了:一共 3 家门店。' },
{ op: 'usage', ...spent },
] : [
{ op: 'heartbeat', phase: 'planning', elapsed_ms: 200 },
{ op: 'thinking', delta: '先想一想要查哪张表……' },
{ op: 'error', message: '助手本轮未完成:模型没有给出任何修改,也没有说明原因', hint: '画布未修改。可以重试,或把需求描述得更具体',
detail: '', reason: '模型没有给出任何修改,也没有说明原因', code: 'copilot_empty', next: 'retry' },
{ op: 'usage', ...spent },
]
return route.fulfill({ status: 200, contentType: 'text/event-stream',
body: ops.map((o) => `data: ${JSON.stringify(o)}\n\n`).join('') })
}
if (String(b.instruction ?? '').includes('照服务端的决定') || String(b.instruction ?? '').includes(DECIDE_RETRY)) {
// 新服务端:final 带 next(backend/app/chat/turn.py),最后一条是这一轮建图的用量(answer_ops 的 usage)。
// 「只建不跑」那一问:autorun 没写 false,next 却是 ready——前端得照 next 走
@@ -1858,6 +1879,33 @@ for (const theme of THEMES) {
await ctx.close()
})
await section('emptyretry', '助手只写了思考、一个操作都没给:照服务端的 next=retry 自动重来一次,还不行再照实报', async () => {
const { page, ctx, errors } = await open(theme)
await goto(page, 'c0emptg')
let gens = log.gens.length
await send(page, '只写了思考:有几家门店')
const done = await page.waitForFunction(() => window.__chat.getState().byConversation.c0emptg?.at(-1)?.phase === 'done',
null, { timeout: 6000 }).then(() => true, () => false)
await page.waitForTimeout(300)
const turn = (await chatState(page)).byConversation.c0emptg.at(-1)
check('第一次没给操作:自动重来一次,第二次照常回答', done && log.gens.length - gens === 2
&& String(turn.output?.answer ?? '').includes('3 家'), `${log.gens.length - gens} 次生成 · ${JSON.stringify(turn.output)}`)
check('重来时交回去的话带着原因(同服务端 retry_instruction 的从零重建措辞)',
log.gens.at(-1)?.instruction === '只写了思考:有几家门店\n\n(上一次没有成功:模型没有给出任何修改,也没有说明原因。请针对这个原因调整,重新给出完整的工作流。)',
log.gens.at(-1)?.instruction)
check('两次建图的用量都记进这一轮', Math.abs((turn.usage?.copilot?.cost_usd ?? 0) - 0.002) < 1e-9, JSON.stringify(turn.usage))
gens = log.gens.length
await send(page, '两次都只写了思考:有几家门店')
const failed = await page.waitForFunction(() => window.__chat.getState().byConversation.c0emptg?.at(-1)?.phase === 'error',
null, { timeout: 6000 }).then(() => true, () => false)
await page.waitForTimeout(500)
const last = (await chatState(page)).byConversation.c0emptg.at(-1)
check('重来还不行:照实报「助手本轮未完成」,不再试第三次', failed && log.gens.length - gens === 2
&& JSON.stringify(last.failure ?? {}).includes('助手本轮未完成'), `${log.gens.length - gens} 次生成 · ${JSON.stringify(last.failure)}`)
check('没有运行时报错', errors.length === 0, errors[0] ?? '')
await ctx.close()
})
await section('decide', '新服务端:照 final.next 和复核的 retry_instruction 走,这一轮的花费 = 助手 + 运行 + 复核', async () => {
const { page, ctx, errors } = await open(theme)
await goto(page, 'c0emptg')
+36
View File
@@ -9,6 +9,7 @@
// 数值期望不许人填(请求体里不出现 value 这类键);
// - 口径升版待处置:顶部提示、处置三选一(叫法由服务端给,没有缺省);启用开关、导出;
// - 发起评测:估算和发起是同一份请求体,评一次 / A/B 对照 / 目录贡献对照(预设)各自的请求体;估算的项数、花费、今天已花照服务端写;
// 上一次的调用金额估不出时估算写「估不出花费」、估出一部分的写「至少约」,总览的每题平均不写成 $0;
// - 评测详情:进度、每题正在做什么;停止、只重试没做完的、重评、设为基线——摆不摆按钮照服务端的 actions;总览卡片和各项分布;
// 逐题表(结论、期望和答案里的数、SQL 差在哪、点开去运行详情)、?case= 定位那道题;和上一次比(指纹差异、转移、归因、换基准);
// A/B 配对表(都对、只 A 对、只 B 对、p 值、看不出差别);
@@ -695,6 +696,41 @@ await section('加题:选口径、从运行认定、期望反问', async () =>
// ---------------------------------------------------------------- 发起评测
await section('发起评测:估不出金额时估算和总览不写成 $0', async () => {
// 服务端 eval/runner.estimate:上一次的调用金额都估不出 → total_usd 为空、带次数;估出一部分 → at_least
const shaped = (patch) => ({ ...ESTIMATE(['当前目录']), estimate: { ...ESTIMATE(['当前目录']).estimate, ...patch } })
const none = shaped({ per_item_usd: null, total_usd: null, unpriced_calls: 6,
note: '上一次评测的 6 次模型调用金额都估不出(模型不在价格目录中,或用量没有报全):金额上限只管得住估得出金额的调用' })
const some = shaped({ at_least: true, unpriced_calls: 2,
note: '按这个题集上一次评测的每题平均花费估算,实际至少这么多:上一次另有 2 次调用金额估不出,没有算进去' })
for (const [label, body] of [['都估不出', none], ['估出一部分', some]]) {
const state = freshState({ override: (method, path) => (method === 'POST' && path.endsWith('/evaluations/estimate')
? { json: body } : null) })
const { page, errors } = await open('/evals/suites/suite-a', { state })
await page.locator('[data-eval-suite-start]').click()
await page.locator('[data-eval-estimate-items]').waitFor()
const cost = await text(page, '[data-eval-estimate-cost]')
if (label === '都估不出') {
check('估算:上一次都估不出时写「估不出花费」和原因,不写 $0', cost.includes('估不出花费') && cost.includes('6 次') && !cost.includes('$0'), cost)
} else {
check('估算:估出一部分时写「至少约」', cost.includes('至少约 $0.042') && cost.includes('每项至少约 $0.014') && cost.includes('2 次'), cost)
}
check(`没有页面报错(${label})`, !errors.length, errors.join(' | '))
}
const state = freshState()
state.evaluations['ev-1'].summary = { ...state.evaluations['ev-1'].summary, cost_usd: 0, unpriced_calls: 6, per_case_cost_usd: null }
const { page, errors } = await open('/evals/runs/ev-1', { state })
await page.locator('[data-eval-overview]').waitFor()
const card = await text(page, '[data-eval-card="cost"]')
check('总览:都估不出时花费写「金额无法估算」,不写每题 $0', card.includes('金额无法估算') && !card.includes('每题'), card)
state.evaluations['ev-1'].summary = { ...state.evaluations['ev-1'].summary, cost_usd: 0.042, unpriced_calls: 2, per_case_cost_usd: 0.014 }
await page.reload({ waitUntil: 'networkidle' })
await page.locator('[data-eval-overview]').waitFor()
const partly = await text(page, '[data-eval-card="cost"]')
check('总览:估出一部分时写「≥」和「每题至少约」', partly.includes('≥ $0.042') && partly.includes('每题至少约 $0.014'), partly)
check('没有页面报错(总览)', !errors.length, errors.join(' | '))
})
await section('发起评测:估算和发起同一份请求体;评一次、A/B、目录贡献对照', async () => {
const { page, state, errors } = await open('/evals/suites/suite-a')
await page.locator('[data-eval-suite-start]').click()