Files
WoW-Hybrid-gateway/ops/spell_timed_buff_compat.py
praxisandClaude Fable 5.2 8a24c445b0 Content pipeline and operator tools
367 files, from working commit b1a079a.

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

289 lines
25 KiB
Python

"""Offline finite self-buff definitions, without applying client-side stat effects.
Initial reviewed family is constant melee-haste aura138. Server aura updates,
attack-time fields and buff removal remain authoritative. Engine stacking parity
is not inferred from these definitions.
"""
from copy import deepcopy
import hashlib
from pathlib import Path
import re
from octo_client_data import canonical_sha256
from spell_definition_common import (checked_constant_source,review_effect_shape,REQUIRED_REFERENCE_TABLES,
NEW_DEFINITION_CHILD_TABLES,review_new_timing,review_duration_reference,new_definition_records)
from spell_family_compat import validate_family
from spell_passive_compat import (BUILD,SCHEMA,TABLES,SUPPLEMENTAL_TABLES,CONDITIONS,
NEW_EFFECT_NEUTRAL,integer,encode,new_registry_values,verified_spell_icon)
from item_batch_stage import available_index
POLICY='new-constant-timed-self-melee-haste-definition-candidate-v1'
EXTRA_DAMAGE_POLICY='new-constant-self-extra-attack-physical-buff-definition-v1'
MAPPED_POLICY='new-self-melee-haste-mapped-hand-visual-definition-v1'
DEFENSIVE_POLICY='new-constant-self-physical-reduction-defense-buff-definition-v1'
EXTRA_DAMAGE_HEADERS=dict(source_defines='fd1c65c0266b77a310c066bc3ccce86fe39f73a6cd10f67192d419009f95ead1',
source_auras='ed7f67babe916cbbf91f7a1f1a9a9af694a2469d2e07eb10e94f0ae883678cb8',
target_defines='9b0e2ad90eea77c961b00f1fc482e9d9e521aa85c58b63863a35d3a338a31799',
target_auras='1784b495ea9704bbe12223c2ad42d9d5fea7d320f0dc6c0055cd090cb7e5498b')
def _defensive_contract():
return dict(policy='named-finite-self-physical-reduction-defense-v1',
header_sha256=dict(EXTRA_DAMAGE_HEADERS,source_shared='635d63c4f0e969cb7029e2989f9861e4b90e9fc444580220025d657c5e1dd8b2'),
mappings=[dict(enum=e,name=n,value=v)for e,n,v in(
('SpellEffects','SPELL_EFFECT_APPLY_AURA',6),('AuraType','SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN',87),
('AuraType','SPELL_AURA_MOD_SKILL',30),('SkillType','SKILL_DEFENSE',95),
('SpellDmgClass','SPELL_DAMAGE_CLASS_MAGIC',1))],physical_school_mask=1)
def defensive_namespace(source_defines,source_auras,source_shared,target_defines,target_auras):
"""Prove finite physical reduction/Defense semantics by named enums."""
from spell_result_profile import enum
proof=_defensive_contract();paths=dict(source_defines=source_defines,source_auras=source_auras,
source_shared=source_shared,target_defines=target_defines,target_auras=target_auras)
for role,path in paths.items():
if hashlib.sha256(Path(path).read_bytes()).hexdigest()!=proof['header_sha256'][role]:raise ValueError('Pinned defensive-buff header changed')
for row in proof['mappings']:
source=source_auras if row['enum']=='AuraType'else source_shared if row['enum']=='SkillType'else source_defines
target=target_auras if row['enum']=='AuraType'else target_defines
if any(enum(Path(p),row['enum'])[0].get(row['name'])!=row['value']for p in(source,target)):raise ValueError('Named defensive-buff enum differs')
for path in(source_defines,target_defines):
text=re.sub(r'/\*.*?\*/|//[^\n]*','',Path(path).read_text(),flags=re.S)
if (not re.search(r'\bSPELL_SCHOOL_NORMAL\s*=\s*0\s*,',text)or
not re.search(r'\bSPELL_SCHOOL_MASK_NORMAL\s*=\s*\(\s*1\s*<<\s*SPELL_SCHOOL_NORMAL\s*\)\s*,',text)):
raise ValueError('Named defensive physical-school mask differs')
return proof
def validate_defensive_namespace(proof):
if (not isinstance(proof,dict)or proof!=_defensive_contract()or
type(proof.get('physical_school_mask'))is not int or any(type(r.get('value'))is not int for r in proof.get('mappings',[]))):
raise ValueError('Verified named finite defensive-buff namespace required')
def _extra_damage_contract():
return dict(policy='named-self-extra-attack-physical-buff-v1',header_sha256=dict(EXTRA_DAMAGE_HEADERS),
effect_name='SPELL_EFFECT_ADD_EXTRA_ATTACKS',source_effect=19,target_effect=19,
aura_name='SPELL_AURA_MOD_DAMAGE_DONE',source_aura=13,target_aura=13,
target_name='TARGET_UNIT_CASTER',source_target=1,target_target=1,
dispel_name='DISPEL_MAGIC',source_dispel=1,target_dispel=1,
school_mask_name='SPELL_SCHOOL_MASK_NORMAL',source_school_mask=1,target_school_mask=1)
def extra_damage_namespace(source_defines,source_auras,target_defines,target_auras):
"""Pin named effects, physical-school mask and magic dispel independently."""
from spell_extra_attack_compat import namespace
namespace(Path(source_defines),Path(target_defines))
for role,path in dict(source_defines=source_defines,source_auras=source_auras,
target_defines=target_defines,target_auras=target_auras).items():
raw=Path(path).read_bytes()
if hashlib.sha256(raw).hexdigest()!=EXTRA_DAMAGE_HEADERS[role]:raise ValueError('Pinned extra-attack physical-buff header changed')
text=re.sub(r'/\*.*?\*/|//[^\n]*','',raw.decode(),flags=re.S)
if role.endswith('auras'):
if not re.search(r'\bSPELL_AURA_MOD_DAMAGE_DONE\s*=\s*13\s*,',text):raise ValueError('Named flat-damage aura differs')
else:
for pattern in (r'\bDISPEL_MAGIC\s*=\s*1\s*,',r'\bSPELL_SCHOOL_NORMAL\s*=\s*0\s*,',
r'\bSPELL_SCHOOL_MASK_NORMAL\s*=\s*\(\s*1\s*<<\s*SPELL_SCHOOL_NORMAL\s*\)\s*,'):
if not re.search(pattern,text):raise ValueError('Named dispel/physical-school semantics differ')
return _extra_damage_contract()
def validate_extra_damage_namespace(proof):
numeric=('source_effect','target_effect','source_aura','target_aura','source_target','target_target','source_dispel','target_dispel','source_school_mask','target_school_mask')
if not isinstance(proof,dict)or proof!=_extra_damage_contract()or any(type(proof.get(k))is not int for k in numeric):
raise ValueError('Verified named extra-attack physical-buff namespace required')
def presentation_namespace(source_defines,target_defines):
"""Review the named no-sheath flag, independently of any spell/item ID."""
values=dict(policy='named-timed-buff-no-sheath-v1',source_name='SPELL_ATTR_DONT_AFFECT_SHEATH_STATE',
target_name='SPELL_ATTR0_DO_NOT_SHEATH',source_value=0x40000,target_value=0x40000,
header_sha256={role:EXTRA_DAMAGE_HEADERS[role+'_defines']for role in('source','target')})
for role,path in(('source',source_defines),('target',target_defines)):
raw=Path(path).read_bytes()
if hashlib.sha256(raw).hexdigest()!=values['header_sha256'][role]:raise ValueError('Timed buff presentation header changed')
text=re.sub(r'/\*.*?\*/|//[^\n]*','',raw.decode(),flags=re.S)
if not re.search(r'\b'+values[role+'_name']+r'\s*=\s*0x00040000\s*,',text):raise ValueError('Named no-sheath flag differs')
return values
def validate_presentation_namespace(proof):
expected=dict(policy='named-timed-buff-no-sheath-v1',source_name='SPELL_ATTR_DONT_AFFECT_SHEATH_STATE',
target_name='SPELL_ATTR0_DO_NOT_SHEATH',source_value=0x40000,target_value=0x40000,
header_sha256={role:EXTRA_DAMAGE_HEADERS[role+'_defines']for role in('source','target')})
if not isinstance(proof,dict)or proof!=expected or any(type(proof.get(role+'_value'))is not int for role in('source','target')):
raise ValueError('Verified named timed-buff presentation namespace required')
def source_spell(dbc,raw,offsets,*,family_namespace,visual_link=None,extra_damage_context=None,presentation_context=None,defensive_context=None,category_context=None):
src=checked_constant_source(dbc,raw,offsets,family_namespace=family_namespace,extra_damage_context=extra_damage_context,category_context=category_context)
if defensive_context is not None:
validate_defensive_namespace(defensive_context);src['defensive_context']=deepcopy(defensive_context)
if presentation_context is not None:
validate_presentation_namespace(presentation_context);src['presentation_context']=deepcopy(presentation_context)
validate_source(src,visual_link=visual_link,extra_damage=extra_damage_context is not None,defensive=defensive_context is not None);return src
def validate_source(src,*,visual_link=None,extra_damage=False,defensive=False):
if type(extra_damage)is not bool or type(defensive)is not bool:raise ValueError('Explicit timed effect policy required')
if defensive:
from spell_definition_common import validate_spell_category_namespace
validate_defensive_namespace(src.get('defensive_context'));validate_spell_category_namespace(src.get('spell_category_context'))
if extra_damage or src.get('presentation_context')is not None:raise ValueError('Separate defensive-buff mechanic required')
if type(src.get('defense_type'))is not int or src['defense_type']!=1 or type(src.get('prevention_type'))is not int or src['prevention_type']!=0:
raise ValueError('Defensive buff requires captured Magic/no-prevention categories')
elif src.get('defensive_context')is not None or src.get('spell_category_context')is not None:raise ValueError('Explicit defensive category policy required')
presentation=src.get('presentation_context')
if presentation is not None:
validate_presentation_namespace(presentation)
if extra_damage:raise ValueError('No-sheath context is reviewed only for the melee-haste family')
if extra_damage:
validate_extra_damage_namespace(src.get('extra_damage_context'))
integer(src.get('dispel_type'),1,1,'source Magic dispel')
chain=src.get('effect_chain_amplitudes')
if not isinstance(chain,list)or len(chain)!=3 or any(type(v)not in(int,float)or v not in(0,1)for v in chain):raise ValueError('Explicit source composite chain amplitudes required')
integer(src.get('entry'),1,0x7fffffff,'timed buff source ID')
for key,count in(('attributes',5),('power',6),('equippedItem',3),('visuals',2)):
values=src.get(key)
if not isinstance(values,list)or len(values)!=count or any(type(v)is not int for v in values):raise ValueError('Typed source definition scalar group required')
integer(src.get('school'),0,6,'source school')
if type(src.get('speed'))not in(int,float):raise ValueError('Typed source speed required')
attrs=[0x40000,0,0,0,0]if presentation is not None else[0]*5
if src.get('attributes')!=attrs or(src.get('school'),src.get('speed'),src.get('castingTimeIndex'),src.get('rangeIndex'))!=(0,0,1,1)or src.get('equippedItem')not in([-1,0,0],[-1,-1,0])or src.get('power')!=[0]*6 :raise ValueError('Unreviewed timed buff metadata')
visuals=src.get('visuals')
if not isinstance(visuals,list)or len(visuals)!=2 or any(type(v)is not int or v<0 for v in visuals)or visuals[1]:raise ValueError('Unreviewed timed buff visuals')
if visuals[0]:
if not isinstance(visual_link,dict)or visual_link.get('kind')!='source-owned-visual-link-candidate'or(visual_link.get('build'),visual_link.get('schema'))!=(BUILD,SCHEMA)or any(visual_link.get(k)is not False for k in('installed','engine_accepted','gameplay_verified')):raise ValueError('Explicit source-owned visual link required')
if visual_link.get('lifecycle_review')is not None:
from aura_visual_profile import review_lifecycle_link
context=visual_link['lifecycle_review']
if not isinstance(context,dict)or not isinstance(context.get('inputs'),dict):raise ValueError('Complete visual lifecycle input review required')
review_lifecycle_link(visual_link,context['inputs'].get('link_schema'))
r=visual_link.get('record',{});value=r.get('record',{});profile=visual_link.get('profile_definition',{});ref=visual_link.get('visual_reference',{});registry=visual_link.get('child_id_registry',{}).get('SpellXSpellVisual',{})
target_visual=visuals[0]
if ref.get('native_visual_id')!=visuals[0]:
from aura_visual_profile import review_mapped_link
link_schema=visual_link.get('mapping_inputs',{}).get('link_schema')
if canonical_sha256(link_schema)!=SUPPLEMENTAL_TABLES['SpellXSpellVisual'][2]:raise ValueError('Mapped buff link schema differs')
reviewed=review_mapped_link(visual_link,link_schema)
if reviewed['visual_reference']['source_visual_id']!=visuals[0]:raise ValueError('Mapped buff source visual differs')
target_visual=reviewed['visual_reference']['native_visual_id']
if r.get('record_status','valid')!='valid'or r.get('baseline_record_sha256')is not None or value.get('ID')!=r.get('id')or r.get('table_name')!='SpellXSpellVisual'or r.get('source_spell_id')!=src['entry']or value.get('SpellID')!=src['entry']or value.get('SpellVisualID')!=target_visual or ref.get('source_visual_id')!=visuals[0]or ref.get('native_visual_id')!=target_visual or profile!={'spell':src['entry'],'spell_x_spell_visual':r.get('id'),'visual':target_visual}or registry.get(str(src['entry']))!=r.get('id'):raise ValueError('Timed buff visual ownership differs')
from aura_visual_profile import generate
if generate([dict(entry=src['entry'],spellVisual1=target_visual,spellVisual2=0)],[value])['definitions']!=[profile]:raise ValueError('Conditional source visual link')
integer(r.get('id'),integer(visual_link.get('native_allocation_floor'),1,0x7ffffffe,'visual floor')+1,0x7fffffff,'new visual link')
elif visual_link is not None:raise ValueError('Unexpected visual link for neutral source')
if not isinstance(src.get('class_family'),dict):raise ValueError('Explicit timed buff family required')
validate_family(src['class_family'],warrior=True)
conditions=src.get('conditions');timing=src.get('timing');levels=src.get('levels')
if not isinstance(conditions,dict)or set(conditions)!=set(CONDITIONS):raise ValueError('Complete timed buff conditions required')
for key,value in conditions.items():integer(value,0,101 if key=='procChance'else 0,'timed buff '+key)
if conditions['procChance']not in(0,101):raise ValueError('Nontriggered buff proc chance differs')
if not isinstance(timing,dict)or set(timing)!={'recoveryTime','categoryRecoveryTime','startRecoveryCategory','startRecoveryTime'}or any(type(v)is not int or v for v in timing.values()):raise ValueError('Unreviewed timed buff cooldown')
if not isinstance(levels,dict)or set(levels)!={'spellLevel','baseLevel','maxLevel'}:raise ValueError('Complete timed buff levels required')
for value in levels.values():integer(value,0,65535,'timed buff level')
for key in('name','nameSubtext','description','auraDescription'):
v=src.get(key)
if not isinstance(v,str)or '\0'in v or len(v.encode())>4096:raise ValueError('Timed buff source text bound')
if not src['name']:raise ValueError('Timed buff source name missing')
integer(src.get('durationIndex'),1,0x7fffffff,'finite duration ID');effects=src.get('effects');indices=[]
if not isinstance(effects,list)or len(effects)!=3:raise ValueError('Complete timed buff effect slots required')
roles=[]
for index,e in enumerate(effects):
review_effect_shape(e)
if not e[0]:
if any(e[:11])or e[11]not in(-1,0):raise ValueError('Nonneutral empty timed buff slot')
continue
if extra_damage:
if e[3:7]!=[1,1,0,0]or e[8:11]!=[1,0,0]or e[11]not in(-1,0):raise ValueError('Unreviewed composite target/scaling/trigger')
if e[:2]==[19,0]and e[7]==0 and chain[index]==1:
integer(e[2]+1,1,5,'constant extra-attack count');roles.append('extra-attack')
elif e[:2]==[6,13]and e[7]==1:
integer(e[2]+1,1,1000,'constant flat physical damage');roles.append('physical-buff')
else:raise ValueError('Unreviewed composite effect or physical school mask')
elif defensive:
if e[3:7]!=[1,1,0,0]or e[8:11]!=[1,0,0]or e[11]not in(-1,0):raise ValueError('Unreviewed defensive buff scaling/target/trigger')
if e[:2]==[6,87]and e[7]==1:
integer(e[2]+1,-100,-1,'physical damage reduction percent');roles.append('physical-reduction')
elif e[:2]==[6,30]and e[7]==95:
integer(e[2]+1,1,300,'finite Defense bonus');roles.append('defense')
else:raise ValueError('Unreviewed defensive buff aura or parameter')
else:
if e[:2]!=[6,138]or e[3:11]!=[1,1,0,0,0,1,0,0]or e[11]not in(-1,0):raise ValueError('Unreviewed timed buff effect')
integer(e[2]+1,1,1000,'constant melee haste percent')
indices.append(index)
if extra_damage and sorted(roles)!=['extra-attack','physical-buff']:raise ValueError('Exactly one extra attack effect and one timed physical buff required')
if defensive and len(roles)!=len(set(roles)):raise ValueError('Duplicate defensive aura role')
if not indices:raise ValueError('Missing timed buff effects')
return indices
def new_component(sources,native,schemas,maxima,registry,*,source_tables,target_icon_names,new_icon_ids,icon_assets,read_icon,visual_links=None,extra_damage=False,client_attribute_context=None,defensive=False):
if type(extra_damage)is not bool or type(defensive)is not bool or extra_damage and defensive:raise ValueError('Explicit distinct timed definition policy required')
if client_attribute_context is not None and not extra_damage:raise ValueError('Target attribute context is verified only for the composite self-buff policy')
if not isinstance(sources,list)or not 1<=len(sources)<=4096 or len({s['entry']for s in sources})!=len(sources):raise ValueError('Bounded unique timed buff sources required')
if any(t not in native for t in(*REQUIRED_REFERENCE_TABLES,'SpellCastTimes','SpellRange','SpellDuration')):raise ValueError('Complete timed buff native references required')
for table in {'Spell','SpellName',*NEW_DEFINITION_CHILD_TABLES}:
if table not in schemas or canonical_sha256(schemas[table])!=(TABLES|SUPPLEMENTAL_TABLES)[table][2]:raise ValueError('Reviewed timed buff schema required')
tables=NEW_DEFINITION_CHILD_TABLES+('SpellCategories',)if extra_damage or defensive else NEW_DEFINITION_CHILD_TABLES
if (extra_damage or defensive)and ('SpellCategories'not in native or 'SpellCategories'not in schemas or canonical_sha256(schemas['SpellCategories'])!=SUPPLEMENTAL_TABLES['SpellCategories'][2]):raise ValueError('Reviewed timed category schema/references required')
if set(new_icon_ids)!={str(s['entry'])for s in sources}:raise ValueError('Explicit timed buff icon identities required')
visual_links={}if visual_links is None else visual_links
if not isinstance(visual_links,dict)or set(visual_links)!={s['entry']for s in sources if s['visuals'][0]}:raise ValueError('Complete source visual links required')
mapped={i:v for i,v in visual_links.items()if v.get('record',{}).get('allocation_policy')=='new-source-owned-mapped-state-visual-link'}
if mapped and (extra_damage or defensive or set(mapped)!=set(visual_links)):raise ValueError('Mapped hand visuals require a separate finite-haste component')
if visual_links:
table='SpellXSpellVisual'
if table not in schemas or canonical_sha256(schemas[table])!=SUPPLEMENTAL_TABLES[table][2]:raise ValueError('Reviewed visual-link schema required')
review_new_timing(source_tables,native,0);available=available_index(icon_assets);registry=deepcopy(registry);occupied={t:{r['ID']for r in native[t]}for t in tables};new_registry_values(registry,maxima,occupied,tables=tables)
categories=registry.pop('SpellCategories',{})if extra_damage else{}
records=[];spells=[]
for src in sorted(sources,key=lambda s:s['entry']):
indices=validate_source(src,visual_link=visual_links.get(src['entry']),extra_damage=extra_damage,defensive=defensive);ident=src['entry'];duration=review_duration_reference(source_tables['SpellDuration'],native['SpellDuration'],src['durationIndex'])
if duration['duration_ms']<=0 or duration['duration_ms']!=duration['max_duration_ms']:raise ValueError('Fixed positive finite buff duration required')
for table in REQUIRED_REFERENCE_TABLES:
if any((r.get('ID')if table in('Spell','SpellName')else r.get('SpellID'))==ident for r in native[table]):raise ValueError('Timed buff has positive native reference')
fid,asset=verified_spell_icon(src,new_icon_ids,source_tables['SpellIcon'],target_icon_names,available,read_icon)
effects={i:dict(deepcopy(NEW_EFFECT_NEUTRAL),EffectAura=138,EffectBasePointsF=src['effects'][i][2]+1,EffectMiscValue=[0,0])for i in indices}
if defensive:
for i in indices:effects[i].update(EffectAura=src['effects'][i][1],EffectMiscValue=[src['effects'][i][7],0])
if extra_damage:
for i in indices:
e=src['effects'][i]
effects[i].update(Effect=e[0],EffectAura=e[1],EffectMiscValue=[e[7],0],EffectChainAmplitude=src['effect_chain_amplitudes'][i])
created=new_definition_records(src,effects,fid,schemas,maxima,registry,occupied,allocation_prefix='new-source-extra-attack-physical-buff-definition'if extra_damage else'new-source-timed-buff-definition')
if client_attribute_context is not None:
from spell_client_attributes import attributes
for record in created:
if record['table_name']=='SpellMisc':
record['record']['Attributes']=attributes(src,client_attribute_context)
raw=encode(record['record'],schemas['SpellMisc']);record.update(wire_hex=raw.hex(),sha256=hashlib.sha256(raw).hexdigest())
records.extend(created)
if extra_damage:
from spell_passive_compat import CHILD_NEUTRAL
key=str(ident)
if key not in categories:categories[key]=max([maxima['SpellCategories'],*categories.values()])+1
row=dict(CHILD_NEUTRAL['SpellCategories'],ID=categories[key],SpellID=ident,DispelType=src['dispel_type']);raw=encode(row,schemas['SpellCategories'])
records.append(dict(table_name='SpellCategories',table_hash=hex(SUPPLEMENTAL_TABLES['SpellCategories'][0]),id=row['ID'],record=row,wire_hex=raw.hex(),sha256=hashlib.sha256(raw).hexdigest(),source_spell_id=ident,baseline_record_sha256=None,allocation_policy='new-source-extra-attack-physical-buff-category'))
visual=visual_links.get(ident)
if visual is not None:
link=visual['record'];wire=encode(link['record'],schemas['SpellXSpellVisual'])
if link.get('table_hash')!=hex(SUPPLEMENTAL_TABLES['SpellXSpellVisual'][0])or link.get('wire_hex')!=wire.hex()or link.get('sha256')!=hashlib.sha256(wire).hexdigest():raise ValueError('Timed buff visual wire differs')
records.append(deepcopy(link))
provenance=dict(source_definition=deepcopy(src))if defensive or extra_damage or mapped or src.get('presentation_context')is not None else{}
spells.append(dict(spell_id=ident,source_record_sha256=canonical_sha256(src),class_family=deepcopy(src['class_family']),levels=deepcopy(src['levels']),effect_indices=indices,visual_link_sha256=canonical_sha256(visual)if visual else None,duration_reference=duration,icon_asset=dict(file_data_id=fid,**asset),known_spells_modified=False,engine_accepted=False,**provenance))
if mapped:spells[-1]['mapped_visual_graph']=ident in mapped
if extra_damage:
registry['SpellCategories']=categories;new_registry_values(registry,maxima,occupied,tables=tables)
mapped_context={}
if mapped:
from aura_visual_profile import review_mapped_link
graphs={}
for link in mapped.values():
reviewed=review_mapped_link(link,schemas['SpellXSpellVisual']);graph=reviewed['visual_candidate'];key=str(graph['source_visual_id'])
if key in graphs and canonical_sha256(graphs[key])!=canonical_sha256(graph):raise ValueError('Conflicting shared visual dependency graph')
graphs[key]=graph
if len(graphs)!=1:raise ValueError('Partition mapped haste components by shared visual graph')
graph=next(iter(graphs.values()));records.extend(deepcopy(graph['records']))
models=sorted({b['native_effect']['ModelFileDataID']for kit in graph['kit_candidates'].values()for b in kit['inputs']['bindings'].values()})
mapped_context=dict(visual_links={str(i):deepcopy(v)for i,v in visual_links.items()},visual_dependencies=deepcopy(graphs),visual_model_file_ids=models)
target_context={}if client_attribute_context is None else dict(client_attribute_context=deepcopy(client_attribute_context))
return dict(kind='source-timed-self-buff-definition-candidates',build=BUILD,schema=SCHEMA,definition_policy=DEFENSIVE_POLICY if defensive else EXTRA_DAMAGE_POLICY if extra_damage else MAPPED_POLICY if mapped else POLICY,records=records,spells=spells,child_id_registry=registry,installable=False,installed=False,dependency_complete=False,engine_accepted=False,gameplay_verified=False,limitations=['Constant finite self physical-reduction/Defense buff only.'if defensive else'Constant finite self extra-attack/flat-physical buff only.'if extra_damage else'Only constant finite self melee haste; no periodic/cost/cooldown/cast/trigger or stance behavior synthesized.','Physical mask1and skill95are retained; no server aura application or proc outcome is synthesized.'if defensive else'Source/target aura13 and effect19 require actual gameplay verification.'if extra_damage else'Source/target aura138 handlers affect attack times; stacking/group/client behavior requires separate runtime verification.','Server remains authoritative. No learned spell or stat change is applied by this offline component.'],**target_context,**mapped_context)