feat: type_events in diff and tracker, joined with emulator signal literals

Diff gains a type_events axis keyed by (script type, event). The tracker
lists each type's original events (vftable list, or the nearest class
list up the constructor chain for Piklib 6.1) and where the emulator names
them: the type's class, Variable.java or other engine code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Patryk Gensch
2026-10-24 19:49:26 +02:00
co-authored by Claude Opus 5.5
parent cb03de47ac
commit 597733d8d7
9 changed files with 135 additions and 7 deletions
+11
View File
@@ -128,3 +128,14 @@ def test_golden_pair_piklib_to_bloomoo():
disp_new = {(r["owner"], r["id"]): r for r in new.method_dispatch}
assert disp_old[("CMC_Animo", 1)]["calls"][-1] == "vtbl+0xa0"
assert disp_new[("CMC_Animo", 1)]["calls"][-1] == "vtbl+0xa0"
def test_type_events_diff_by_script_type():
from ams.diff import compute_diff, filter_by_owner
from ams.snapshot import Snapshot
old = Snapshot({"type_events": [{"type": "MOVIE", "name": "ONSTARTED", "order": 3}]})
new = Snapshot({"type_events": [{"type": "MOVIE", "name": "ONSTARTED", "order": 3},
{"type": "MOVIE", "name": "ONFRAMEUPDATED", "order": 5}]})
block = compute_diff(old, new)["type_events"]
assert [e["name"] for e in block["added"]] == ["ONFRAMEUPDATED"] and not block["removed"]
assert filter_by_owner(compute_diff(old, new), "MOVIE")["type_events"]["added"]