Files
praxisandClaude Fable 5.2 45ecd73fe0 Evidence records
1888 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

34 lines
3.2 KiB
Python

from pathlib import Path
import json,sys,hashlib
from collections import defaultdict
sys.path.insert(0,'ops')
from turtle_data import DBC,spell_layout,spell_tooltip_graph,inventory_item_snapshot
from spell_definition_common import proc_namespace,review_proc_conditions
W=Path('runtime/praxis-item-effects-20261020');load=lambda p:json.loads(Path(p).read_text())
source=load(W/'source-owned-items.json');roots=sorted({p['spellid_'+str(i)]for p in source for i in range(1,6)if p['spellid_'+str(i)]})
path=Path('runtime/octo-installed-data/patch-O.mpq/Spell.dbc');dbc=DBC(path,173)
graph=spell_tooltip_graph(dbc,roots)
(W/'source-presentation-graph.json').write_text(json.dumps(graph,indent=2)+'\n')
S=Path.home()/'Servers/tortoise-wow/src/game/Spells/SpellDefines.h';T=Path('../servers/trinity-forever/src/server/game/Spells/SpellMgr.h');proof=proc_namespace(S,T,incoming_harmful=True)
pins={};spells={};base=Path('runtime/all-spell-templates-20261018');manifest=load(base/'manifest.json')
for chunk in manifest['chunks']:
p=base/chunk['path'];raw=p.read_bytes();assert len(raw)==chunk['bytes'] and hashlib.sha256(raw).hexdigest()==chunk['sha256']
for r in json.loads(raw):
assert r['entry']not in spells;spells[r['entry']]=r
all_items=inventory_item_snapshot(Path('runtime/all-item-templates-20261017'))['records'];users=defaultdict(list)
for row in all_items:
p=row['raw_fields']
for i in range(1,6):
if p['spellid_'+str(i)]:users[p['spellid_'+str(i)]].append(p['entry'])
reviews=[];off=spell_layout()
for ident,raw in sorted(spells.items()):
if not raw['procFlags'] or not raw['procFlags']&((1<<13)|(1<<17)):continue
record=dbc.by_id.get(ident)
if record is None:continue
try:review=review_proc_conditions(raw,record,off,proof,incoming_harmful=True)
except ValueError:continue
reviews.append(dict(spell_id=ident,name=raw['name'],owned_dependency=ident in graph['records'],source_event_mask=raw['procFlags'],item_users=sorted(set(users.get(ident,[]))),metadata_only=True,complete_definition_converted=False))
result=dict(kind='source-incoming-harmful-item-proc-family-event-review',source_spell_inventory_count=len(spells),source_item_inventory_count=len(all_items),owned_root_spell_count=len(roots),owned_dependency_count=len(graph['records']),owned_missing_source_client_ids=graph['missing'],family_proc_count=len(reviews),item_linked_family_proc_count=sum(bool(r['item_users'])for r in reviews),owned_family_spell_ids=[r['spell_id']for r in reviews if r['owned_dependency']],proof=proof,rows=reviews,spell_dbc_sha256=hashlib.sha256(path.read_bytes()).hexdigest(),spell_snapshot_manifest_sha256=hashlib.sha256((base/'manifest.json').read_bytes()).hexdigest(),installed=False,limits=['Named event eligibility only; block/hit outcome filters, defense class, trigger definitions, assets and server execution remain separate dependencies.','Source snapshot and captured client rows must agree; live Octo equality unverified.','This extends the existing shared proc mapper, not a new spell conversion pipeline.'])
(W/'incoming-event-family.json').write_text(json.dumps(result,indent=2)+'\n')
print({k:result[k]for k in('source_spell_inventory_count','source_item_inventory_count','owned_root_spell_count','owned_dependency_count','family_proc_count','item_linked_family_proc_count','owned_family_spell_ids')})