import fs from 'node:fs' import path from 'node:path' import {compilePlanReliable,RELIABLE_PROMPT,RELIABLE_VERSION} from '../server/planner.mjs' const out=path.resolve('../output/kimi-jev-evaluation-20261013') const cases=[ {id:'N01',request:'门口有任何人连续停留两分钟才提醒我,不到两分钟不用。',expected:'duration_120'}, {id:'N02',request:'每天21:10到21:40看猫有没有吃饭,21:40再告诉我,观察期间不要推送。',expected:'summary_2110_2140'}, {id:'N03',request:'人先离开这块画面,两分钟内再次回到画面才提示。直接走过来不算。',expected:'sequence_120'}, {id:'N04',request:'现在画面中有没有猫或狗?把结果给我看,不发提醒。',expected:'snapshot_silent'}, {id:'N05',request:'院子里有狗,并且画面里一个人都没有,才提醒我。',expected:'dog_and_no_person'}, {id:'N06',request:'帮我判断客厅那个老人是不是心脏病发作了。',expected:'diagnosis_not_executable'}, {id:'N07',request:'以我登记的图为准,白色箱子整个被搬走才通知,人在旁边走动不算。',expected:'reference_change'}, {id:'N08',request:'我不在家时,门口有人碰纸箱就提醒。',expected:'interaction_occurrence_away'}, ] const dir=path.join(out,'plans-novel-v1.2');fs.mkdirSync(dir,{recursive:true}) if(!fs.existsSync(path.join(dir,'protocol.json')))fs.writeFileSync(path.join(dir,'protocol.json'),JSON.stringify({frozenAt:new Date().toISOString(),version:RELIABLE_VERSION,purpose:'New wording and parameter checks written after repair prompt freeze; no expected result is sent to the model.',cases},null,2)) fs.writeFileSync(path.join(dir,'prompt.txt'),RELIABLE_PROMPT) for(const c of cases){ const file=path.join(dir,c.id+'.json');if(fs.existsSync(file))continue try{ const result=await compilePlanReliable({root:process.cwd(),request:c.request,context:{camera_selected:true,external_signals:'away/rain/doorbell available as timestamped signals'}}) fs.writeFileSync(file,JSON.stringify({...result,caseId:c.id,request:c.request,expected:c.expected},null,2)) console.log(c.id+' '+result.plan.status+' '+result.latencyMs+'ms') }catch(e){fs.writeFileSync(file,JSON.stringify({caseId:c.id,request:c.request,expected:c.expected,error:e.message,attempts:e.attempts,version:e.version},null,2));console.log(c.id+' ERROR '+e.message.slice(0,200))} } console.log('NOVEL WORDING COMPLETE')