Files
aigc-home/docs/hel-892/singleloop-document-evidence/browser-singleloop.py.txt
T
2026-11-01 17:00:01 +08:00

44 lines
7.7 KiB
Plaintext

from pathlib import Path
p=Path('e2e/singleloop-document.mjs');t=p.read_text();t=t.replace("const names=[","const names=['Wan2.1_infinitetalk_音频驱动视频配音-单人for循环长视频(官流)',",1).replace("'137图8351保存条目'","'138图8480保存条目'").replace("'137图241源注释'","'138图246源注释'")
a=t.index(' check(b.counts.saved_fields===');z=t.index(' const notesBox=',a)
t=t[:a]+''' check(b.counts.saved_fields===129&&b.comments.length===5&&b.boundaries.length===0&&b.zero_saved_nodes.length===8,`${width}129原条目/五注释/无子图/八真实[]`);
check(b.fields.every(f=>f.scope==='root'&&f.named_state==='missing'&&!('named_pointer'in f)&&!('named_value'in f)),`${width}全部无具名/不造双指针`);
check(b.node_bindings.length===90&&b.node_bindings.filter(x=>x.implementation_verified).length===42&&b.node_bindings.filter(x=>x.source_id.startsWith('unresolved-')).map(x=>x.node_id).sort().join(',')==='129,232'&&b.node_bindings.filter(x=>x.source_id==='unknown-no-version').length===46,`${width}42准确/两Wan入口未匹配/46无版本别名`);
check(b.sources.some(x=>x.id==='rgthree'&&x.tag==='1.0.2512112053')&&b.sources.some(x=>x.id==='litegraph'&&x.file==='src/lib/litegraph/LICENSE'),`${width}发布成员与内部LiteGraph独立许可`);
const source=JSON.parse(fs.readFileSync('docs/hel-892/singleloop-document-evidence/source-check.json'));
const node=n=>JSON.parse(b.flow.find(x=>x.startsWith(n+' 原节点完整保存 ')).split(' 原节点完整保存 ')[1]);
const edges=b.flow.filter(x=>x.startsWith('root 物理边 ')).map(x=>JSON.parse(x.slice('root 物理边 '.length)));
const edge=(id,from,to)=>{const e=edges.find(e=>e[0]===id);return e&&e[1]===from&&e[3]===to;};
check(b.counts.physical_edges===90&&edges.length===90,`${width}90物理边完整保留`);
check(b.node_bindings.every(x=>node(Number(x.node_id)).mode===0)&&[17,172,238,25,253,260,266,267].every(id=>node(id).widgets_values.length===0),`${width}全mode0与八真实[]`);
check(node(263).widgets_values.slice(1).every(x=>x===null)&&!('links'in node(253).outputs[1])&&[245,246].every(id=>!('links'in node(id).outputs[0])),`${width}音频两null与未消费缺links分列`);
check(edge(532,129,172)&&edge(636,172,266)&&edge(599,232,238)&&edge(641,238,267)&&node(172).outputs[1].links.length===0&&node(238).outputs[1].links.length===0,`${width}两真LATENT起点/普通output解码/denoised[]`);
check(edge(642,267,259)&&edge(625,232,259)&&field('259','batch_index').value===0&&field('259','length').value===4096,`${width}裁后帧起点覆盖与4096缓存`);
check(edge(616,252,232)&&edge(628,252,260)&&edge(622,259,260)&&edge(626,260,253)&&edge(634,265,246),`${width}前段帧/裁后帧/拼合/别名分隔原边`);
check(edge(621,212,252)&&edge(617,252,254)&&edge(618,254,255)&&edge(635,254,253)&&edge(619,256,257)&&field('252','total').value===1,`${width}total/index/初值原物理边不求值`);
check(field('212','expression').value==='ceil((a*b+1-c)/c)'&&field('254','expression').value==='a+1'&&field('248','value').json_type==='int'&&field('248','value').value===25&&field('256','value').value===121&&field('174','value').value===6,`${width}完整表达式与FloatConstant原JSON int`);
check(edge(629,200,261)&&edge(630,261,25)&&edge(606,191,245)&&edge(609,235,246)&&field('263','audio').value==='冰沙王子.WAV',`${width}音频分叉与正式音轨Get只名称意图`);
check(edge(542,32,183)&&edge(602,32,240)&&edge(601,239,240)&&node(32).outputs[1].links.length===0,`${width}图像直供视觉/Set分叉/MASK[]`);
check(edge(528,129,169)&&edge(529,129,170)&&edge(576,232,230)&&edge(579,232,231)&&field('171','noise_seed').value===460326298055398&&field('229','noise_seed').value===515326640083775,`${width}各Wan输出MODEL供Guider/Scheduler与独立seed`);
for(const [nid,rate] of [['245',16],['246',25]]){
const history=field(nid,'videopreview');const json=JSON.stringify(history.value);const hash=crypto.createHash('sha256').update(json).digest('hex');
check(b.fields.filter(f=>f.node_id===nid).length===11&&history.json_type==='dict'&&history.pointer.endsWith('/widgets_values/videopreview')&&history.value.params.score==='0'&&history.value.params.frame_rate===rate&&field(nid,'frame_rate').value===25,`${width} ${nid}十标量/完整历史/score str0/帧率分列`);
textRenderings.push({viewport:width,kind:'history'+nid,canonical_js_sha256:hash});
}
for(const phrase of ['42准确类/发布成员实例','两个具体unresolved','46个Set/Get只有aux','不宣称全仓不存在','src/lib/litegraph','准确树缺LICENSE','不补成此未核Wan协议'])check(b.steps.some(x=>x.includes(phrase)),`${width}准确来源与具体边界 ${phrase}`);
'''+t[z:]
a=t.index(" for(const [phrase,label]of ");z=t.index(" await dialog.getByText('版本、源图与连线依据'",a)
t=t[:a]+''' for(const [phrase,label]of [['重要准确来源缺口','source-gap'],['首段实际LATENT532','first-latent'],['循环段实际LATENT599','loop-latent'],['252.value1经616','loop-physical'],['200 Get629','audio-fork'],['两VHS保存frame_rate','vhs-history']]){
const line=b.flow.filter(x=>x.includes(phrase)).sort((a,b)=>a.length-b.length)[0];await fixedCard.getByText(line,{exact:true}).first().evaluate(el=>el.scrollIntoView({block:'start'}));await page.screenshot({path:`${out}/${width}-${d.id}-${label}.png`});
}
'''+t[z:]
a=t.index(" if(['307.scale_to_length'");z=t.index('\n await summary.click();',a)
t=t[:a]+''' if(['129.position_0','232.position_3','187.position_0','212.expression','254.expression','248.value','252.total','259.batch_index','261.chunk_overlap','263.audioUI','245.videopreview','246.videopreview','171.noise_seed','239.clip_name'].includes(f.node_id+'.'+f.field)){await summary.evaluate(el=>el.scrollIntoView({block:'start'}));await page.screenshot({path:`${out}/${width}-${d.id}-${f.node_id}-${f.field}.png`});}'''+t[z:]
t=t.replace('// Local GET-only:129 original entries,7 complete Notes,23 exact instances and3 bounded unresolved; no upstream or media execution.','// Local GET-only:129 entries/5 Notes/42 exact/2 bounded unresolved/46 unversioned aliases.')
p.write_text(t)
# Fix metadata-only inherited labels/counts; no product changes.
p=Path('calliope-backend/tests/test_singleloop_fixed_document.py');t=p.read_text().replace('in ["SetNode", "GetNode"]','in ["SetNode", "GetNode", "WanInfiniteTalkToVideo"]');p.write_text(t)
p=Path('docs/hel-892/singleloop-document-evidence/source_closure.py');t=p.read_text().replace('accurate_instances=23','accurate_instances=42').replace('unresolved_instances=3','unresolved_instances=2').replace('unknown_instances=0','unknown_instances=46').replace('KJ1.3.6仅ZIP Range必要成员,LiteGraph只复用锁定成员','rgthree/VHS仅发布成员;LiteGraph为同树内置并另列许可');p.write_text(t)
p=Path('docs/hel-892/singleloop-document-evidence/finalize.py');t=p.read_text();t=t.replace('history = next(f for f in b["fields"] if f["node_id"] == "131" and f["field"] == "videopreview")','history = next(f for f in b["fields"] if f["node_id"] == "245" and f["field"] == "videopreview")');t=t.replace('accurate_nodes=23','accurate_nodes=42').replace('unresolved_implementation_nodes=3','unresolved_implementation_nodes=2').replace('unknown_nodes=0','unknown_nodes=46').replace('notes=7','notes=5').replace('具体三缺口、原图图音分叉/两个mode4、协议差异、长中文/七注释/完整历史','两具体缺口/46无版本别名、两真LATENT/普通output、音频分叉/循环物理边/五完整注释/双历史').replace('and118 per-value','and129 per-value').replace('7 Notes','5 Notes');p.write_text(t)
print('Prepared current browser and metadata; inherited semantic assertions replaced, old137 overviews retained')