1888 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
30 lines
2.3 KiB
Python
30 lines
2.3 KiB
Python
"""Reproduce the reviewed Strong Alcohol consumable batch; no install/network."""
|
|
import json,sys,hashlib,struct
|
|
from pathlib import Path
|
|
sys.path.insert(0,'ops')
|
|
from item_effect_compat import compose_consumable_links,TABLES,DBD,NATIVE
|
|
from item_sparse_compat import fields,check_db2
|
|
from item_catalog_stage import compose_metadata_batch
|
|
from item_batch_stage import json_bytes
|
|
out=Path('runtime/ale-consumable-links-20261019');cat=Path('runtime/catalog-items-20261018/catalogue-full-curves')
|
|
pins={}
|
|
def read(p):
|
|
raw=p.read_bytes();pins[str(p)]=hashlib.sha256(raw).hexdigest();return json.loads(raw)
|
|
m=read(cat/'manifest.json');items=[]
|
|
for f in m['files']:
|
|
if not f['path'].startswith('items-'):continue
|
|
rows=read(cat/f['path']);assert pins[str(cat/f['path'])]==f['sha256']
|
|
items.extend(r for r in rows if any(r['source']['spellid_'+str(i)]==11009 for i in range(1,6)))
|
|
p=read(Path('runtime/catalog-items-20261018/refreshed-clothing-metadata-20261019/package.json'))
|
|
metadata=compose_metadata_batch(p,items,[dict(entry=i['entry'],selection_reason='same-reviewed-native-spell-definition')for i in items if i['source']['class']==0],fields(DBD/'ItemSparse.dbd'))
|
|
e=read(Path('runtime/octo-forever-item-effects.json'));l=read(Path('runtime/octo-forever-item-effect-links.json'))
|
|
schemas={t:fields(DBD/(t+'.dbd'),layout,n)for t,(_,layout,n)in TABLES.items()};maxima={}
|
|
for t,(table,layout,n)in TABLES.items():
|
|
check_db2(NATIVE/(t+'.db2'),table,layout);maxima[t]=struct.unpack_from('<I',(NATIVE/(t+'.db2')).read_bytes(),164)[0]
|
|
r=compose_consumable_links(metadata['package'],items,{11009},e,l,schemas,maxima,{'slots':{}})
|
|
package=r.pop('package');r.pop('added');r['metadata_added']=[i['entry']for i in metadata['selected']];r['inputs']=pins;r['package_rows']=len(package['rows'])
|
|
r['definition_review']='Source/native11009: attributes671088896, self target1, instant cast index1, duration0, range1, effect100 base20, category59/10000ms. Native extra attribute15 0x2000 retained; server execution authoritative. Other source effect families not approved by this review.'
|
|
for p,pin in pins.items():assert hashlib.sha256(Path(p).read_bytes()).hexdigest()==pin
|
|
(out/'package.json').write_bytes(json_bytes(package));(out/'report.json').write_bytes(json_bytes(r))
|
|
print(json.dumps({k:r[k]for k in ('selected','preserved','blocked','metadata_added','package_rows')}))
|