#!/usr/bin/env python3 """Regenerate `reference/1.12-globals.tsv` — the 1.12.1 client's global namespace, with each name attributed to whoever provides it. WOW_RE= scripts/gen-reference-globals.py [--wow-re DIR] [--out FILE] **Why this exists** (decision 1189): every wrong number in the addon arc came from remembering a list of WoW functions instead of asking the client. wow-5875-re already ships an addon (`W5875Capture`) that dumps the in-world `_G` of the *running* reference client, and its output is committed there as a fixture. This vendors that capture, attributes every name, and writes the result as the one artifact benilla measures its API surface against. **Three origins**, because "is this in 1.12?" and "whose job is it to provide?" are different questions: lua Lua 5.0's own runtime. We get these from mlua; neither we nor FrameXML write them. engine The C client provides it. **This is the list benilla implements in Rust.** framexml Defined by the shipped UI itself — its Lua, its XML, or a `$parent`-composed child of one. Runs off the player's own patch chain at runtime (1751), never hardcoded in Rust. Attribution is by *definition site*, computed from a complete 1.12 shipped-UI corpus: - a name assigned or `function`-declared in shipped Lua (including a `` # body (Fonts.xml defines CHAT_FONT_HEIGHTS that way), and every handler element under # `` — ``, ``, `` and kin, which is where MainMenuBar.xml # assigns SHOW_KEYRING and PERFORMANCEBAR_LOW_LATENCY. Matched by shape rather than by a list of # handler names so a rarely-used one cannot be forgotten. `