Files
aigc-home/docs/hel-892/director-project-document-evidence/setup-director-project.py.txt
T

22 lines
2.7 KiB
Plaintext

from pathlib import Path
import json,os,hashlib,datetime,subprocess,concurrent.futures
R=Path.cwd();D=R/'docs/hel-892/director-project-document-evidence';D.mkdir(exist_ok=True);REF=D.parent/'director-project-reference';REF.mkdir(exist_ok=True);rows=[];now=datetime.datetime.now(datetime.timezone.utc).isoformat()
wanted={'core0330':('v0.33.0',{'nodes.py','comfy_extras/nodes_attention.py','comfy_extras/nodes_custom_sampler.py','comfy/samplers.py','LICENSE','requirements.txt','comfy_api/latest/_io.py','comfy_api/latest/_io_public.py','comfy_api/latest/__init__.py'}),'core0320':('v0.32.0',{'nodes.py','LICENSE','requirements.txt'}),'core0290':('v0.29.0',{'nodes.py','LICENSE','requirements.txt'}),'kj':('3f20054214fec9f9234fd3841ae6f1e4287948f6',None),'frontend':('v1.51.9',None),'litegraph':('1.51.9',None),'mediaeditor':('1254e0e0afa9afee268027b9540fdc91c888ebc5',None)}
# Exact manifest reuse only. Prefer audited near neighbours; no upstream cross-path searches.
for folder in ['director-pv-reference','director-multi-reference','director-audio-reference','director-two-reference','director-one-reference','t8-av-reference']:
F=D.parent/folder
for e in json.loads((F/'sources.json').read_bytes())['sources']:
for key,(ver,files)in wanted.items():
if e['id']!=key or e.get('tag')!=ver or (files is not None and e['file']not in files):continue
if any(x['id']==key and x['file']==e['file']for x in rows):continue
x=dict(e,reverified_at=now,applicability='第147批独立逐实例复核,保留首次获取历史;不执行或认证目标安装')
for k in ['local_file','license_file','identity_root','canonical_identity_record','registry_record','package_record']:
if x.get(k)and not x[k].startswith('未知'):x[k]=os.path.relpath((F/x[k]).resolve(),REF)
rows.append(x)
for key in wanted:print('REUSE',key,len([e for e in rows if e['id']==key]),flush=True)
fragment=Path('.local-evidence/setup-anima.py').read_text();fragment=fragment[fragment.index('def fetch(spec):'):fragment.index('with concurrent.futures.ThreadPoolExecutor')].replace('anima-','director-project-');exec(fragment)
specs=[('project','yolain/ComfyUI-Easy-Media','5739638c646a66a93d60c51714593b2b96a2a3b6',['__init__.py','LICENSE','pyproject.toml','requirements.txt']),('pack','yolain/ComfyUI-Easy-Media','e1893122c0e5a26d3544e99e4b35124d64901e66',['__init__.py','LICENSE','pyproject.toml','requirements.txt']),('hybrid','scottmudge/ComfyUI_MinimaxH3HybridLoader','a44c69b02242e41fbd01e22abe2a492adc853038',['__init__.py','LICENSE','pyproject.toml','requirements.txt'])]
with concurrent.futures.ThreadPoolExecutor(max_workers=3)as pool:
for rr in pool.map(fetch,specs):rows.extend(rr)
(REF/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('ROWS',len(rows))