30 lines
3.0 KiB
Plaintext
30 lines
3.0 KiB
Plaintext
from pathlib import Path
|
|
import json,hashlib,subprocess,datetime,os
|
|
R=Path.cwd();F=R/'docs/hel-892/singleloop-reference';rows=json.loads((F/'sources.json').read_bytes())['sources'];now=datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
def add(key,files):
|
|
proto=next(e for e in rows if e['id']==key);cache=R/('.local-evidence/singleloop-'+key+'-git');tree=json.loads((F/(key+'-tree.json')).read_bytes())['tree']
|
|
for file in files:
|
|
if any(e['id']==key and e['file']==file for e in rows):continue
|
|
ent=next((x for x in tree if x['path']==file),None)
|
|
if not ent:print('MISSING',key,file);continue
|
|
b=subprocess.check_output(['git','-C',str(cache),'show',proto['commit']+':'+file],timeout=80);assert len(b)<3000000
|
|
name=key+'__'+file.replace('/','__');(F/name).write_bytes(b);e=dict(proto,file=file,local_file=name,git_blob_sha1=ent['sha'],sha256=hashlib.sha256(b).hexdigest(),acquisition_time=now,reverified_at=now,url=f"https://raw.githubusercontent.com/{proto['repo']}/{proto['commit']}/{file}");rows.append(e);print('ADD',key,file)
|
|
add('core051',['comfy_extras/nodes_model_patch.py','comfy_extras/nodes_audio_encoder.py','comfy/ldm/wan/model.py'])
|
|
add('core0367',['comfy/model_patcher.py'])
|
|
add('core0357',['comfy/audio_encoders/wav2vec2.py'])
|
|
add('easy',['web_version/v1/js/easy/easy.js','web_version/v1/js/easy/easyDynamicWidgets.js'])
|
|
# Exact frontend internal LiteGraph licence; own filtered cache.
|
|
proto=next(e for e in rows if e['id']=='frontend');cache=R/'.local-evidence/singleloop-frontend-git';subprocess.run(['git','init','--bare',str(cache)],check=True,capture_output=True);p=subprocess.run(['git','-C',str(cache),'fetch','--filter=blob:none','--depth=1','https://github.com/Comfy-Org/ComfyUI_frontend.git',proto['commit']],capture_output=True,timeout=100);assert p.returncode==0,p.stderr
|
|
for file in ['src/lib/litegraph/LICENSE']:
|
|
b=subprocess.check_output(['git','-C',str(cache),'show',proto['commit']+':'+file],timeout=80);name='frontend__'+file.replace('/','__');(F/name).write_bytes(b);rows.append(dict(proto,id='litegraph',file=file,local_file=name,license_file=name,sha256=hashlib.sha256(b).hexdigest(),git_blob_sha1=hashlib.sha1(b'blob '+str(len(b)).encode()+b'\0'+b).hexdigest(),acquisition_time=now,reverified_at=now,url=f"https://raw.githubusercontent.com/Comfy-Org/ComfyUI_frontend/{proto['commit']}/{file}"))
|
|
# VHS original registry & selected text identity records retained, necessary registration only.
|
|
p=R/'docs/hel-892/avatar-skills-reference/sources.json'
|
|
if p.exists():
|
|
for orig in json.loads(p.read_bytes())['sources']:
|
|
if orig.get('id')in ['vhs','vhs179']and orig['file']in ['__init__.py','pyproject.toml','requirements.txt']and'1.7.9'in str(orig):
|
|
e=dict(orig,id='vhs',reverified_at=now)
|
|
for k in ['local_file','license_file','identity_root']:
|
|
if k in e and (p.parent/e[k]).exists():e[k]=os.path.relpath((p.parent/e[k]).resolve(),F)
|
|
if not any(x['id']=='vhs'and x['file']==e['file']for x in rows):rows.append(e)
|
|
(F/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('ROWS',len(rows))
|