合入瘦身第 2 批:撤掉纯登记工具与文案样式账本(R5-Z51)
This commit is contained in:
commit
a6ecd570af
@ -18,7 +18,7 @@ const labels = Object.freeze({
|
||||
prepare_image_request: '准备生图请求', dispatch_image_request: '生成候选图片',
|
||||
await_image_slots: '等待子代理回执', adopt_production_image: '回填候选图片', reconcile_image_slots: '核查图片原请求',
|
||||
list_project_images: '查找本项目候选', read_archived_images: '查找同款历史候选', stage_archived_image: '加入待验历史候选',
|
||||
read_output_screen: '查看实际画布', check_output_screens: '按屏复核画布', record_screen_check: '记录本屏复核', check_page_copy: '发起文案复核',
|
||||
read_output_screen: '查看实际画布', check_output_screens: '按屏复核画布', check_page_copy: '发起文案复核',
|
||||
video_generate_clip: '生成视频片段', video_compose_timeline: '合成视频成品', video_inspect: '检视视频画面',
|
||||
defer_production_output: '保留当前草稿', check_image_slots: '发起验图', finish_production: '提交成品导出',
|
||||
save_product_strategy: '保存商品策划', review_product_strategy: '核对卖点证据',
|
||||
|
||||
@ -91,6 +91,7 @@ const PRODUCTION_SYSTEM = `你是小壹的制作助手,当前为无人值守
|
||||
本轮没有可询问的人,也没有人工后期;用户启动制作即授权你代为决定。指引中要求用户事先选择、确认或交人工处理的事项,由你依据商品资料和模板自行决定并继续制作,所作选择和确实无法处理的事项在交付回执中如实列出。工作范围内的顺序、并行和返工由你决定。
|
||||
${PRODUCT_VOICE}
|
||||
plan_production(includeKnowledge=true) 返回锁定的知识文件路径,用 read 读取。plan_production 返回制作状态,open_production_output 切换可写画布,list_project_images 查询项目候选。
|
||||
write_copy_fields 的 items 可用 text="" 和 reason 表达刻意留空及依据。check_output_screens 复核并保存整屏意见,read_screen_review 按屏查询。
|
||||
用 tool_search 查找工具,通过 native_catalog 查原生命令与参数,复用已取得的 parameterDocs。企业指引中的命令行编修可用等价的画布命令完成。codemode 可依次 await 工具调用并用真实回执衔接各步。结果未知的付费请求用 reconcile_image_slots 按原编号核查。以文件和版本回执确认交付。`;
|
||||
|
||||
const plain = value => ({ content: [{ type: 'text', text: JSON.stringify(value) }], details: value });
|
||||
@ -104,9 +105,9 @@ const inactiveDocument = error => error?.category === 'scope_changed';
|
||||
const sequentialTools = new Set([
|
||||
'memory_set', 'canvas_edit', 'canvas_preview', 'copywriting_options', 'copywriting_fields',
|
||||
'workflow_navigate', 'workflow_execute', 'workflow_propose',
|
||||
'open_production_output', 'record_field_requirements', 'write_copy_fields', 'use_product_image', 'transform_slot_image', 'prepare_image_request',
|
||||
'open_production_output', 'write_copy_fields', 'use_product_image', 'transform_slot_image', 'prepare_image_request',
|
||||
'dispatch_image_request', 'delegate_image_slots', 'stage_archived_image', 'check_image_slots', 'check_output_screens',
|
||||
'adopt_production_image', 'retire_production_image', 'reconcile_image_slots', 'record_screen_check',
|
||||
'adopt_production_image', 'retire_production_image', 'reconcile_image_slots',
|
||||
'defer_production_output', 'finish_production',
|
||||
]);
|
||||
function toolsFor(host) {
|
||||
@ -152,7 +153,7 @@ function toolsFor(host) {
|
||||
['read_output_screen','read_slot_images'].includes(name)?result=>result:
|
||||
name==='open_production_output'?receipt=>({...plain(describeProductionOutput(receipt)),details:receipt}):
|
||||
name==='write_copy_fields'?({copyUpdates,...receipt})=>({...plain(receipt),details:{...receipt,copyUpdates}}):plain),
|
||||
...(['read_archived_images','stage_archived_image','retire_production_image','read_screen_review','record_screen_check']
|
||||
...(['read_archived_images','stage_archived_image','retire_production_image','read_screen_review']
|
||||
.includes(name)?{exposure:'deferred'}:null),
|
||||
})),
|
||||
...contextTools.map(tool => ({...tool, exposure:'deferred'})), ...projectResources,
|
||||
|
||||
@ -97,11 +97,6 @@ export const productionOperationTools = [
|
||||
['read_copy_fields','省略 pageId 和 fieldId 返回全页字段身份、当前文字、约束及修订号;指定页面或字段可读取图层样式、范围及关联字段。',obj({
|
||||
pageId:optional(Type.String()),fieldId:optional(Type.String()),
|
||||
})],
|
||||
['record_field_requirements','可按字段记录本款填写要求和依据,供后续文案核对。facts 可记录资料中明确的对应值,数字带单位。模板内有多个值时填写确切的 templateValue。',obj({
|
||||
items:Type.Array(obj({layer:Type.Integer({minimum:1}),decision:Type.Union(['保留','改写','待核实'].map(value=>Type.Literal(value))),
|
||||
basis:text,facts:optional(Type.Array(obj({kind:Type.Union(['quantity','material','color','specification'].map(value=>Type.Literal(value))),
|
||||
productValue:text,templateValue:optional(text)})))})),
|
||||
})],
|
||||
['write_copy_fields','按 revision 原位写入指定文字格。可传 expectedText 核对原文,每个 layer 只传一次。原生命令已写过时可用 recordOnly 登记。copyUpdates 返回本次写入的文案事实。retryWrite 表示画布暂不可写,rejected 列出保留原文的格子。可写入空文字并用 reason 记下依据。',obj({
|
||||
revision:rev,recordOnly:optional(Type.Boolean()),items:optional(Type.Array(obj({layer,text:Type.String(),expectedText:optional(Type.String()),sources:ids,pictures:ids,reason:optional(Type.String())}))),
|
||||
})],
|
||||
@ -136,14 +131,11 @@ export const productionOperationTools = [
|
||||
zoom:optional(Type.Number({minimum:1,maximum:4})),
|
||||
includeTemplateImage:optional(Type.Boolean()),templateLayerId:optional(Type.Integer({minimum:1})),templateChangeOffset:optional(Type.Integer({minimum:0})),
|
||||
})],
|
||||
['check_output_screens','按企业 Skill 并行复核整屏合成画面、商品实拍、实时文案与叠加图层。pages 从 1 编号,以当前画布实际屏数为准。默认等待结论,自动登记通过和需要修正的屏。问题按图位、原生图层或文案字段定位。wait=false 可用不带 slotIds 的 await_image_slots 收取摘要。',obj({
|
||||
['check_output_screens','按企业 Skill 并行复核整屏合成画面、商品实拍、实时文案与叠加图层。pages 从 1 编号,以当前画布实际屏数为准。默认等待结论,保存通过和需要修正的屏。问题按图位、原生图层或文案字段定位。wait=false 可用不带 slotIds 的 await_image_slots 收取摘要。',obj({
|
||||
pages:Type.Array(Type.Integer({minimum:1}),{minItems:1}),
|
||||
wait:optional(Type.Boolean({default:true})),
|
||||
})],
|
||||
['read_screen_review','读取指定成品最近一次完整的整屏复核回执。page 从 1 编号。不启动新的复核。',obj({...outputScope,page:Type.Integer({minimum:1})})],
|
||||
['record_screen_check','记录整屏实际画面的复核结论,供进度和交付回执展示。page 和 screenFingerprint 使用同次 read_output_screen 返回的屏号和内容指纹。',obj({
|
||||
page,screenFingerprint:text,issues:Type.Array(obj({field:text,reason:text})),
|
||||
})],
|
||||
['defer_production_output','挂起当前输出并记录需要外部处理的原因和所需动作。可用 await_image_slots 或 reconcile_image_slots 查询在途请求。',obj({
|
||||
blocker:obj({kind:Type.Union([Type.Literal('missing_required_input'),Type.Literal('authorization_required'),
|
||||
Type.Literal('permanent_service_failure')]),reason:text,requiredAction:text}),
|
||||
@ -663,6 +655,19 @@ export async function openProductionOperations(host,{target=host.productionGoal,
|
||||
})).progressSummary;
|
||||
let displayEpoch=0, progressVersion=0, progressSnapshot;
|
||||
const markProgressDirty=()=>{progressVersion++;};
|
||||
function saveOutputScreenReview({page,screenFingerprint,issues},signal,inputSignature,receipt){
|
||||
return serialize(async()=>{
|
||||
signal?.throwIfAborted();
|
||||
const copyInputs=productionInputs(await current(),variantId);
|
||||
if(inputSignature!==copyInputs)throw Error('商品资料已更新,请复查当前屏');
|
||||
const snapshot=await copySnapshot({screenFingerprintPage:page});
|
||||
if(!screenFingerprint||snapshot.screenFingerprint!==screenFingerprint)throw Error('本屏已变化,请读取当前画面');
|
||||
signal?.throwIfAborted();
|
||||
await saveScreenCheck({page,screenFingerprint,issues,copyInputs,receipt});
|
||||
notice('整屏复核已记录');
|
||||
});
|
||||
}
|
||||
|
||||
async function saveScreenCheck(review) {
|
||||
await update(journal=>{
|
||||
const reviews=new Map(journal.screenReviews??[]);
|
||||
@ -1196,25 +1201,6 @@ export async function openProductionOperations(host,{target=host.productionGoal,
|
||||
const fields=snapshot.fields?.map(({nativeFrame,textSafeFrame,styleRoles,relatedFields,...field})=>field);
|
||||
return {...snapshot,outputId,variantId,fields};
|
||||
},
|
||||
record_field_requirements({items}){
|
||||
return serialize(async()=>{
|
||||
const inputPlan=await current();
|
||||
const {fields=[]}=await copySnapshot();
|
||||
const byLayer=new Map(fields.map(field=>[field.layer,field]));
|
||||
for(const {layer} of items){
|
||||
if(!byLayer.has(layer))throw Error(`当前画布没有文字格 ${layer}`);
|
||||
}
|
||||
await update(record=>{
|
||||
syncCopyEvidence(record,inputPlan);
|
||||
record.fieldRequirements??={};
|
||||
for(const row of items){
|
||||
const {field,page}=byLayer.get(row.layer);
|
||||
record.fieldRequirements[row.layer]={...row,field,page};
|
||||
}
|
||||
});
|
||||
return {fieldRequirements:fieldRequirements(inputPlan)};
|
||||
});
|
||||
},
|
||||
write_copy_fields({revision,recordOnly,items=[]},signal){
|
||||
return serialize(async()=>{
|
||||
const noUpdates={total:0,truncated:false,items:[]};
|
||||
@ -1245,10 +1231,6 @@ export async function openProductionOperations(host,{target=host.productionGoal,
|
||||
journal.copyEvidence[layer]={field:after.get(layer).field,text,sources,pictures,
|
||||
...(!text.trim()&&reason?.trim()?{blankReason:reason}:null)};
|
||||
}
|
||||
if(result.styleMappings?.length){
|
||||
journal.copyStyleMappings??={};
|
||||
for(const {layer,mapping} of result.styleMappings)journal.copyStyleMappings[layer]=mapping;
|
||||
}
|
||||
});
|
||||
if(applied.length||result.appliedLayers?.length){
|
||||
markProgressDirty();
|
||||
@ -1850,7 +1832,7 @@ export async function openProductionOperations(host,{target=host.productionGoal,
|
||||
slots:screenSlots,outputId,variantId,signal:activeSignal});
|
||||
const {inputSignature}=await references();
|
||||
const confirmed=screen.details.fieldRequirements?{...receipt,fieldRequirements:screen.details.fieldRequirements}:receipt;
|
||||
await onCanvas(activeSignal,()=>operations.record_screen_check({
|
||||
await onCanvas(activeSignal,()=>saveOutputScreenReview({
|
||||
page:page-1,screenFingerprint:receipt.screenFingerprint,
|
||||
issues:[...receipt.imageIssues,...receipt.overlayFixes,...receipt.copyFixes],
|
||||
},activeSignal,inputSignature,confirmed),permit);
|
||||
@ -1872,19 +1854,6 @@ export async function openProductionOperations(host,{target=host.productionGoal,
|
||||
return screenChecks.get(page)?.receipt ?? recorded?.receipt ?? recorded?.candidateReview ??
|
||||
(recorded?{page,screenFingerprint:recorded.screenFingerprint,issues:recorded.issues}:{page,state:'no_review'});
|
||||
},
|
||||
record_screen_check({page,screenFingerprint,issues},signal,inputSignature=productionInputs(plan,variantId),receipt){
|
||||
return serialize(async()=>{
|
||||
signal?.throwIfAborted();
|
||||
const copyInputs=productionInputs(await current(),variantId);
|
||||
if(inputSignature!==copyInputs)throw Error('商品资料已更新,请复查当前屏');
|
||||
const snapshot=await copySnapshot({screenFingerprintPage:page});
|
||||
if(!screenFingerprint||snapshot.screenFingerprint!==screenFingerprint)throw Error('本屏已变化,请读取当前画面');
|
||||
signal?.throwIfAborted();
|
||||
await saveScreenCheck({page,screenFingerprint,issues,copyInputs,receipt});
|
||||
notice('整屏复核已记录');
|
||||
return {page,screenFingerprint,issues};
|
||||
});
|
||||
},
|
||||
async defer_production_output({blocker}){
|
||||
if(!blocker?.reason?.trim()||!blocker.requiredAction?.trim()){
|
||||
const slotIds=[...new Set(running().map(job=>job.row.slotId))];
|
||||
|
||||
@ -14,6 +14,8 @@ maxGenerationAttempts: 4
|
||||
- `prepare_image_request` 保存生图请求并返回正式提示词、参考顺序、模型参数及候选请求号。`useTemplateBase: true` 将该图位的固定模板原图作为第一张输入,`false` 不发送该底图。`referenceIndexes` 按数组顺序选取本款实拍,编号从 0 开始。`prefer2k: true` 请求 2K。`reworkCandidateId` 标识原候选,`reworkChange` 记录改动。
|
||||
- `dispatch_image_request` 接收准备回执的首个 `requestId` 并派发同批请求。宿主通过该编号读取绑定的版本和哈希。`candidatesPerSlot` 是一批请求的目标候选数,`maxCandidatesPerSlot` 是图位累计派发上限。已派发后失败或结果未知均计入额度。
|
||||
- `transform_slot_image` 可裁切、镜像、旋转、缩放或平移实拍及任一成品的同花色候选。`sourceCandidateId` 指定来源候选。`cropSourcePixels` 是裁切使用的源像素尺寸,`targetFrame` 是目标图框,`resolutionRatio` 是裁切像素相对图框的分辨率比,`resolutionSufficient` 表示源像素是否达到该图框所需分辨率。
|
||||
- `write_copy_fields` 原位写入文案。需要刻意留空时,将该字段的 `text` 设为空字符串,并在 `reason` 说明依据。
|
||||
- `check_output_screens` 按 `pages` 复核并保存整屏意见。`read_screen_review` 按 `page` 查询最近一次整屏意见。屏号从 1 开始。
|
||||
- `review_image_slots` 返回候选、`comparison`、实际像素、画幅、请求和验图回执。`check_image_slots` 委托验图。`adopt_production_image` 用候选号回填,`reason` 记录采用理由。`reconcile_image_slots` 按原编号查询或取回请求结果。
|
||||
|
||||
## 画布回执
|
||||
|
||||
@ -229,7 +229,7 @@ test('switching outputs discards the prior canvas copy reads and uses the new li
|
||||
assert.deepEqual(journal.items[slot.id].review.observation.reviewedCopy,[['title','圆角桌面']]);
|
||||
});
|
||||
|
||||
test('field decisions persist across turns and visible old values are reported through handoff',async t=>{
|
||||
test('legacy field decisions remain readable after reopening and visible old values are reported through handoff',async t=>{
|
||||
const dir=await fs.mkdtemp(path.join(os.tmpdir(),'jiansun-pi-field-requirements-'));
|
||||
t.after(()=>cleanup(dir));
|
||||
const sample='座高62.26cm';
|
||||
@ -247,17 +247,21 @@ test('field decisions persist across turns and visible old values are reported t
|
||||
detailRender:async()=>({revision:1,overlayLayers,images:[]}),
|
||||
}};
|
||||
completeCanvas(host.canvas);
|
||||
let actions=await openProductionOperations(host);
|
||||
const fieldRequirements=[
|
||||
{layer:1,page:'P01',field:'seat',decision:'改写',basis:'本款规格表座高 450 mm'},
|
||||
{layer:2,page:'P01',field:'title',decision:'保留',basis:'标题适用于本款'},
|
||||
{layer:3,page:'P01',field:'material',decision:'待核实',basis:'规格表未列材质'},
|
||||
];
|
||||
await fs.writeFile(path.join(dir,'production-detail-oak.json'),JSON.stringify({
|
||||
binding:JSON.stringify(['fixture','oak']),items:{},
|
||||
copyInputs:JSON.stringify([{dimensions:{座高:'450',unit:'mm'}},null,false,null]),
|
||||
fieldRequirements:Object.fromEntries(fieldRequirements.map(row=>[row.layer,row])),
|
||||
copyStyleMappings:{1:'default'},
|
||||
}));
|
||||
const actions=await openProductionOperations(host);
|
||||
const plan=await actions.plan_production();
|
||||
assert.deepEqual(plan.fieldConflicts.map(({field,templateValue,productValue})=>[field,templateValue,productValue]),
|
||||
[['seat','62.26cm','450 mm']]);
|
||||
const {fieldRequirements}=await actions.record_field_requirements({items:[
|
||||
{layer:1,decision:'改写',basis:'本款规格表座高 450 mm'},
|
||||
{layer:2,decision:'保留',basis:'标题适用于本款'},
|
||||
{layer:3,decision:'待核实',basis:'规格表未列材质'},
|
||||
]});
|
||||
await actions.close();
|
||||
actions=await openProductionOperations(host);
|
||||
t.after(()=>actions.close());
|
||||
assert.deepEqual((await actions.read_output_screen({})).details.fieldRequirements,fieldRequirements);
|
||||
const finish=async()=> (await actions.finish_production({revision:1})).production;
|
||||
|
||||
@ -1558,13 +1558,6 @@ test('a sibling variant edit leaves the current plan usable, and a local edit ca
|
||||
const finish=await actions.finish_production({revision:3,nextOutput});
|
||||
assert.deepEqual(finish.production,{outputId,variantId,complete:true,canvasRevision:3,issues:[],
|
||||
fieldRequirements:[],visibleConflicts:[],visibleConflictCount:0,unverifiedFacts:[]});
|
||||
await actions.record_field_requirements({items:[{layer:5,decision:'待核实',basis:'缺少检测报告',
|
||||
facts:[{kind:'material',productValue:'橡木'}]}]});
|
||||
assert.deepEqual((await actions.finish_production({revision:3})).production.unverifiedFacts,[
|
||||
{fieldId:'hero',pageId:'S01',label:'木纹',productValues:['橡木'],basis:'缺少检测报告'},
|
||||
]);
|
||||
await actions.record_field_requirements({items:[{layer:5,decision:'保留',basis:'本款样品已确认'}]});
|
||||
assert.deepEqual((await actions.finish_production({revision:3})).production.unverifiedFacts,[]);
|
||||
|
||||
const blocker={kind:'missing_required_input',reason:'缺少官方承重参数',requiredAction:'请产品负责人提供官方承重规格'};
|
||||
const defer=await actions.defer_production_output({blocker,nextOutput});
|
||||
@ -2058,7 +2051,7 @@ for(const maxActiveDelegates of [undefined,2]){
|
||||
});
|
||||
}
|
||||
|
||||
test('copy progress verifies each screen fingerprint and clears reviews when product inputs change', {timeout:5000},async t=>{
|
||||
test('copy progress verifies each screen fingerprint and clears reviews when product inputs change', {timeout:15_000},async t=>{
|
||||
const dir=await fs.mkdtemp(path.join(os.tmpdir(),'jiansun-pi-screen-copy-'));
|
||||
t.after(()=>cleanup(dir));
|
||||
const pages=['P01','P02'];
|
||||
@ -2074,8 +2067,9 @@ test('copy progress verifies each screen fingerprint and clears reviews when pro
|
||||
let copyReads=0, slotReads=0;
|
||||
const fingerprint=page=>JSON.stringify([slots[page].selectedCandidateId,
|
||||
fields.filter(field=>(field.page??field.pageId)===pages[page]).map(field=>field.currentText)]);
|
||||
let progress=Promise.withResolvers();
|
||||
let progress, expectedHeading;
|
||||
const store=productionStore(dir);
|
||||
const pixels={type:'image',mimeType:'image/png',data:'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=='};
|
||||
const canvas={
|
||||
workflowRead:async({section})=>{
|
||||
if(section==='slots')slotReads++;
|
||||
@ -2093,7 +2087,8 @@ test('copy progress verifies each screen fingerprint and clears reviews when pro
|
||||
?[]:[{page:index+1,pageId}])}}:null),
|
||||
};
|
||||
},
|
||||
detailRender:async({page})=>({page,revision,screenFingerprint:fingerprint(page)}),
|
||||
detailRender:async({page})=>({page,revision,screenFingerprint:fingerprint(page),images:[pixels],overlayLayers:[]}),
|
||||
detailImages:async()=>({referenceCount:1,images:[pixels]}),
|
||||
read:async()=>({revision}),
|
||||
imageRequest:async command=>command==='pending'?[]:{id:'cropped',status:'complete'},
|
||||
async commitDetailCopy(items){
|
||||
@ -2104,10 +2099,18 @@ test('copy progress verifies each screen fingerprint and clears reviews when pro
|
||||
revision++;
|
||||
return {appliedLayers:items.map(item=>item.layer)};
|
||||
},
|
||||
async delta(_text,_thinking,receipt){progress.resolve(receipt);},
|
||||
async delta(_text,_thinking,receipt){
|
||||
if(receipt.heading===expectedHeading)progress.resolve(receipt);
|
||||
},
|
||||
};
|
||||
const actions=await openProductionOperations({canvas,store,productionGoal:{outputId:'detail',variantId:'oak'}});
|
||||
const observe=async(operation,states)=>{
|
||||
let duringReview;
|
||||
const actions=await openProductionOperations({canvas,store,productionGoal:{outputId:'detail',variantId:'oak'},
|
||||
runDetailAgent:async(_id,_system,_prompt,[tool])=>{
|
||||
duringReview?.();
|
||||
tool.execute('',{verdict:'pass',summary:'已检查整屏',imageIssues:[],overlayFixes:[],copyFixes:[]});
|
||||
}});
|
||||
const observe=async(heading,operation,states)=>{
|
||||
expectedHeading=heading;
|
||||
progress=Promise.withResolvers();
|
||||
const result=await operation();
|
||||
const {copyCells,copy,copyPending}=await progress.promise;
|
||||
@ -2120,35 +2123,43 @@ test('copy progress verifies each screen fingerprint and clears reviews when pro
|
||||
const snapshot=await actions.read_copy_fields({});
|
||||
return actions.write_copy_fields({revision:snapshot.revision,items:values.map(([layer,text])=>({layer,text,sources:[],pictures:[]}))});
|
||||
};
|
||||
const review=(page,issues=[])=>actions.record_screen_check({page,screenFingerprint:fingerprint(page),issues});
|
||||
const review=async page=>(await actions.check_output_screens({pages:[page+1]}))[0];
|
||||
const verify=async(page,states)=>{
|
||||
await observe('按屏复核已有回执',async()=>{
|
||||
const receipt=await review(page);
|
||||
assert.equal(receipt.verdict,'pass',receipt.error);
|
||||
},states);
|
||||
};
|
||||
const allFilled=['filled','filled','filled','empty'];
|
||||
await observe(()=>actions.read_output_screen({}),['empty','empty','empty','empty']);
|
||||
const written=await observe(()=>write([[7,'橡胶木桌面'],[8,'深木色涂装'],[9,'保留自然木纹'],[10,'']]),allFilled);
|
||||
await observe('已读取实际画布',()=>actions.read_output_screen({}),['empty','empty','empty','empty']);
|
||||
const written=await observe('文字已更新',()=>write([[7,'橡胶木桌面'],[8,'深木色涂装'],[9,'保留自然木纹'],[10,'']]),allFilled);
|
||||
assert.deepEqual(written.copyUpdates,{total:4,truncated:false,items:[
|
||||
{field:'P01 · 标题',text:'橡胶木桌面'},{field:'P01 · 副标题',text:'深木色涂装'},
|
||||
{field:'P02 · 材质',text:'保留自然木纹'},{field:'P02 · 规格',text:''},
|
||||
]});
|
||||
await observe(()=>review(0,[{field:'材质',reason:'需交代涂装'}]),allFilled);
|
||||
await assert.rejects(actions.record_screen_check({page:0,screenFingerprint:'stale',issues:[]}),/本屏已变化/);
|
||||
await observe(()=>review(0),['verified','verified','filled','empty']);
|
||||
await observe(()=>review(1),['verified','verified','verified','empty']);
|
||||
duringReview=()=>{fields[0].currentText='改过的标题';};
|
||||
assert.match((await review(0)).error,/本屏已变化/);
|
||||
duringReview=undefined;
|
||||
fields[0].currentText='橡胶木桌面';
|
||||
await verify(0,['verified','verified','filled','empty']);
|
||||
await verify(1,['verified','verified','verified','empty']);
|
||||
const beforeHeartbeat={copyReads,slotReads};
|
||||
await observe(()=>actions.transform_slot_image({slotId:'hero',referenceIndex:0}),['verified','verified','verified','empty']);
|
||||
await observe('画布调整已有候选',()=>actions.transform_slot_image({slotId:'hero',referenceIndex:0}),['verified','verified','verified','empty']);
|
||||
assert.deepEqual({copyReads,slotReads},beforeHeartbeat);
|
||||
const saved=store.ledger('detail','oak').read();
|
||||
const first=new Map(saved.screenReviews).get(0);
|
||||
assert.equal(first.screenFingerprint,fingerprint(0));
|
||||
await observe(()=>write([[9,'浅色自然木纹']]),['verified','verified','filled','empty']);
|
||||
await observe('文字已更新',()=>write([[9,'浅色自然木纹']]),['verified','verified','filled','empty']);
|
||||
assert.equal(slotReads,beforeHeartbeat.slotReads,'the copy receipt does not reload slot readiness');
|
||||
await observe(()=>review(1),['verified','verified','verified','empty']);
|
||||
await verify(1,['verified','verified','verified','empty']);
|
||||
slots[1].selectedCandidateId='replacement';
|
||||
revision++;
|
||||
await observe(()=>actions.read_output_screen({page:1}),['verified','verified','filled','empty']);
|
||||
await observe(()=>review(1),['verified','verified','verified','empty']);
|
||||
await observe('已读取实际画布',()=>actions.read_output_screen({page:1}),['verified','verified','filled','empty']);
|
||||
await verify(1,['verified','verified','verified','empty']);
|
||||
assert.equal((await actions.finish_production({revision})).production.complete,true);
|
||||
creation++;
|
||||
await actions.plan_production({});
|
||||
await observe(()=>actions.read_output_screen({page:1}),allFilled);
|
||||
await observe('已读取实际画布',()=>actions.read_output_screen({page:1}),allFilled);
|
||||
await actions.close();
|
||||
});
|
||||
|
||||
@ -2208,13 +2219,16 @@ test('copy writes forward revisions and optional expected text for the canvas to
|
||||
appliedLayers.push(edit.layer);
|
||||
}
|
||||
if(appliedLayers.length)revision++;
|
||||
return {appliedLayers,rejected,revision};
|
||||
return {appliedLayers,rejected,revision,styleMappings:appliedLayers.map(layer=>({layer,mapping:'default'}))};
|
||||
},
|
||||
};
|
||||
const ops=await openProductionOperations({store:productionStore(dir),canvas,productionGoal:{outputId:'detail',variantId:'oak'}});
|
||||
const store=productionStore(dir);
|
||||
const ops=await openProductionOperations({store,canvas,productionGoal:{outputId:'detail',variantId:'oak'}});
|
||||
const item=(layer,text)=>({layer,text,sources:[],pictures:[]});
|
||||
const write=(revision,items)=>ops.write_copy_fields({revision,items});
|
||||
const first=await write(revision,[item(7,'标题一')]);
|
||||
assert.deepEqual(first.styleMappings,[{layer:7,mapping:'default'}]);
|
||||
assert.equal(store.ledger('detail','oak').read().copyStyleMappings,undefined);
|
||||
await write(first.revision,[item(7,'标题二')]);
|
||||
|
||||
revision++;
|
||||
|
||||
@ -221,7 +221,8 @@ test('多图位屏齐备后在采纳与验图回执提示,当前画面复核
|
||||
const adoption=await current.adopt_production_image({slotId:'slot-2',candidateId:'second'});
|
||||
assert.deepEqual(adoption.screensReadyForReview,ready);
|
||||
assert.deepEqual((await current.review_image_slots({})).screensReadyForReview,ready);
|
||||
await current.record_screen_check({page:0,screenFingerprint:state.fingerprints[0],issues:[]});
|
||||
host.runDetailAgent=async(_id,_system,_prompt,[tool])=>tool.execute('',pass);
|
||||
assert.equal((await current.check_output_screens({pages:[1]}))[0].verdict,'pass');
|
||||
assert.deepEqual((await current.review_image_slots({})).screensReadyForReview,[]);
|
||||
state.fingerprints[0]='updated';
|
||||
assert.deepEqual((await current.review_image_slots({})).screensReadyForReview,ready);
|
||||
@ -393,7 +394,8 @@ test('finish and progress keep screen reviews across unrelated edits and clear t
|
||||
issues:[...needsFix.imageIssues,...needsFix.overlayFixes,...needsFix.copyFixes]}]);
|
||||
return {complete,finalized:false,pendingOutputs:[],progressSummary:summaryFor(screenReviewFingerprints)};
|
||||
};
|
||||
await callProductionTool(host,'record_screen_check',{page:0,screenFingerprint:'screen-P1',issues:[]});
|
||||
host.runDetailAgent=async(_id,_system,_prompt,[tool])=>tool.execute('',pass);
|
||||
await callProductionTool(host,'check_output_screens',{pages:[1]});
|
||||
host.runDetailAgent=async(_id,_system,_prompt,[tool])=>tool.execute('',needsFix);
|
||||
await callProductionTool(host,'check_output_screens',{pages:[2]});
|
||||
const waiting=await actions.await_image_slots({});
|
||||
|
||||
@ -434,7 +434,6 @@ pub(super) fn known_tool_label(tool: &str) -> Option<&'static str> {
|
||||
"read_slot_images" => "查看图位图片",
|
||||
"delegate_image_slots" => "分派图片图位",
|
||||
"check_image_slots" => "发起验图",
|
||||
"record_screen_check" => "记录本屏复核",
|
||||
"await_image_slots" => "等待子代理回执",
|
||||
"review_image_slots" => "查看图位结果",
|
||||
"adopt_production_image" => "回填候选图片",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user