from pathlib import Path import json,hashlib,os,datetime,subprocess,concurrent.futures R=Path.cwd();REF=R/'docs/hel-892/singleloop-reference';OUT=R/'docs/hel-892/singleloop-document-evidence';REF.mkdir(exist_ok=True);OUT.mkdir(exist_ok=True);now=datetime.datetime.now(datetime.timezone.utc).isoformat();rows=[] def reuse(folder,oldid,newid,files=None): p=R/'docs/hel-892'/folder/'sources.json';xs=json.loads(p.read_bytes())['sources'] for original in xs: if original['id']!=oldid or(files is not None and original['file']not in files):continue if any(x['id']==newid and x['file']==original['file']for x in rows):continue e=dict(original,id=newid,reverified_at=now,applicability='第157批准确节点声明独立静态复核,不执行/认证目标安装或恢复') for k in ['local_file','license_file','identity_root','canonical_identity_record']: if k in e and not e[k].startswith('未知')and(p.parent/e[k]).exists():e[k]=os.path.relpath((p.parent/e[k]).resolve(),REF) e.setdefault('acquisition_time','未知:原始记录没有首次获取时间') assert hashlib.sha256((REF/e['local_file']).read_bytes()).hexdigest()==e['sha256'];rows.append(e) reuse('wantalk-reference','audio','audio');reuse('wantalk-reference','cr','cr') reuse('zimage-qwen-reference','frontend','frontend');reuse('zimage-qwen-reference','litegraph','litegraph') # Reuse only necessary VHS published text; previous whole archive hash is historical, not re-acquired. reuse('frames-reference','vhs179','vhs',['videohelpersuite/nodes.py','videohelpersuite/utils.py','video_formats/h264-mp4.json','web/js/VHS.core.js','LICENSE','__init__.py','pyproject.toml','requirements.txt']) exec((R/'.local-evidence/setup-anima.py').read_text().split('def fetch(spec):')[1].split('with concurrent.futures')[0].join(['def fetch(spec):','']).replace('anima-','singleloop-')) specs=[ ('core0357','Comfy-Org/ComfyUI','v0.3.57',['nodes.py','comfy_extras/nodes_custom_sampler.py','comfy_extras/nodes_audio_encoder.py','comfy/audio_encoders/audio_encoders.py','comfy/samplers.py','folder_paths.py','LICENSE','requirements.txt']), ('core0367','Comfy-Org/ComfyUI','v0.3.67',['nodes.py','comfy_extras/nodes_custom_sampler.py','comfy_extras/nodes_model_patch.py','LICENSE','requirements.txt']), ('core051','Comfy-Org/ComfyUI','v0.5.1',['nodes.py','comfy_extras/nodes_wan.py','comfy_extras/nodes_custom_sampler.py','comfy_extras/nodes_images.py','comfy_extras/nodes_model_patch.py','comfy_api/latest/_io.py','comfy_api/latest/_io_public.py','LICENSE','requirements.txt']), ('core0110','Comfy-Org/ComfyUI','v0.11.0',['nodes.py','LICENSE','requirements.txt']), ('core0150','Comfy-Org/ComfyUI','v0.15.0',['nodes.py','LICENSE','requirements.txt']), ('core0123','Comfy-Org/ComfyUI','v0.12.3',['comfy_extras/nodes_audio.py','comfy_api/latest/_io.py','comfy_api/latest/_io_public.py','LICENSE','requirements.txt']), ('kjint','kijai/ComfyUI-KJNodes','71578cf49e48978cf1c6714494b669b1e571777b',['__init__.py','nodes/nodes.py','LICENSE','requirements.txt','pyproject.toml']), ('kjfloat','kijai/ComfyUI-KJNodes','50a0837f9aea602b184bbf6dbabf66ed2c7a1d22',['__init__.py','nodes/nodes.py','LICENSE','requirements.txt','pyproject.toml']), ('easy','yolain/ComfyUI-Easy-Use','7c470c67d6df44498e52c902173c1ac77cd5bdfd',['__init__.py','py/logic.py','py/nodes/logic.py','py/libs/utils.py','py/libs/any.py','pyproject.toml','requirements.txt','LICENSE','web_version/v2/js/easy/easy.js','web_version/v2/js/easy/logic.js','web/js/easy/easy.js']), ('mathnew','pythongosssss/ComfyUI-Custom-Scripts','26a13291c8081135b9a80794daf818793c37ef24',['__init__.py','py/math_expression.py','web/js/mathExpression.js','LICENSE','pyproject.toml']), ('mathold','pythongosssss/ComfyUI-Custom-Scripts','f2838ed5e59de4d73cde5c98354b87a8d3200190',['__init__.py','py/math_expression.py','web/js/mathExpression.js','LICENSE','pyproject.toml'])] with concurrent.futures.ThreadPoolExecutor(max_workers=4)as pool: for result in pool.map(fetch,specs):rows+=result for e in rows: if not e.get('license_file','').startswith('未知')and not(REF/e.get('license_file','')).is_file():e['license_file']=next((x['local_file']for x in rows if x['id']==e['id']and x['file'].lower()in ['license','license.txt','license.md']),'未知:准确树无LICENSE,保留许可缺口') (REF/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('ROWS',len(rows))