21 lines
2.3 KiB
Plaintext
21 lines
2.3 KiB
Plaintext
from pathlib import Path
|
|
import json,hashlib,datetime,subprocess,concurrent.futures
|
|
R=Path.cwd();D=R/'docs/hel-892/wanplus-reference';rows=json.loads((D/'sources.json').read_bytes())['sources'];now=datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
selected={'kjnodes-e27a505b':['nodes/nodes.py'],'feihou-toolbox-af6df8f0':['js/fast_groups_bypass_switch.js'],'feihou-toolbox-30405fa1':['js/image_batch_multi_v2.js'],'videohelpersuite-8e4d7947':['videohelpersuite/load_video_nodes.py'],'comfyliterals-bdddb08c':['startup_utils.py','operations.py']}
|
|
def fetch(item):
|
|
key,files=item;e=next(e for e in rows if e['id']==key);tree=json.loads((D/(key+'-tree.json')).read_bytes())['tree'];out=[]
|
|
for file in files:
|
|
if any(x['id']==key and x['file']==file for x in rows):continue
|
|
ent=next(x for x in tree if x['path']==file);raw=subprocess.check_output(['git','-C',str(R/('.local-evidence/wanplus-'+key+'-git')),'show',e['commit']+':'+file],timeout=90);name=key+'__'+file.replace('/','__');(D/name).write_bytes(raw)
|
|
out.append(dict(e,file=file,local_file=name,sha256=hashlib.sha256(raw).hexdigest(),git_blob_sha1=ent['sha'],url=f'https://raw.githubusercontent.com/{e["repo"]}/{e["commit"]}/{file}',acquisition_time=now,reverified_at=now,prior_exact_bytes_record=False))
|
|
return out
|
|
with concurrent.futures.ThreadPoolExecutor(max_workers=4)as pool:
|
|
for a in pool.map(fetch,selected.items()):rows+=a
|
|
# Drop the initially requested old WAS alias text: exact canonical source is separately retained.
|
|
rows=[e for e in rows if e['id']!='was-node-suite-comfyui-afeee09b']
|
|
for p in D.glob('was-node-suite-comfyui-afeee09b__*'):p.unlink()
|
|
# Exact failed commit response is evidence of a gap, not an implementation source.
|
|
file='761b-exact-commit-responses.json';raw=(D/file).read_bytes();rows.append(dict(id='missing761',repo='声明cnr/aux冲突,所选三仓准确提交均未取得',file=file,local_file=file,commit='',tag='761b1d191e50d589465e31dc0d40ff7c59b1b7b0',sha256=hashlib.sha256(raw).hexdigest(),acquisition_time=now,reverified_at=now,license_file='未知:未取得准确实现',transport='准确提交HTTP状态原响应',applicability='仅具体身份缺口,不是源码/准确schema'))
|
|
(D/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n')
|
|
print('PASS sources',len(rows))
|