From 07d5633bfafc002ced18f2fee4049c7f2dee04ae Mon Sep 17 00:00:00 2001 From: Nighthawk42 <6307495+Nighthawk42@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:57:24 -0400 Subject: [PATCH] docs: analyze legacy lines 6001-6500 --- README.md | 2 +- docs/analysis/batch-schedule.md | 2 +- docs/analysis/identifier-ledger.md | 109 +++++++++++++++++++++++++---- docs/analysis/lines-6001-6500.md | 54 ++++++++++++++ tools/verify-bootstrap.ps1 | 3 +- 5 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 docs/analysis/lines-6001-6500.md diff --git a/README.md b/README.md index f1e8508..67ef7ff 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This branch is an analysis-only bootstrap for a Mainline-first modernization of The preserved 8,401-line Mainline source must be analyzed sequentially, in evidence-backed batches, before runtime work begins. All behavior-critical shortened symbols must be resolved and all batches must be complete before any public Lua API, runtime module, modern TOC, packaging, or release work is added. -Batches 01–12 (lines 1–6,000) are documented. The remaining batches are scheduled but not analyzed. +Batches 01–13 (lines 1–6,500) are documented. The remaining batches are scheduled but not analyzed. ## Goal diff --git a/docs/analysis/batch-schedule.md b/docs/analysis/batch-schedule.md index 62acc35..9485c43 100644 --- a/docs/analysis/batch-schedule.md +++ b/docs/analysis/batch-schedule.md @@ -16,7 +16,7 @@ The immutable analysis source is `Legacy/Bejeweled_Mainline.lua` from commit `6f | 10 | 4501–5000 | 500 | `lines-4501-5000.md` | complete | | 11 | 5001–5500 | 500 | `lines-5001-5500.md` | complete | | 12 | 5501–6000 | 500 | `lines-5501-6000.md` | complete | -| 13 | 6001–6500 | 500 | `lines-6001-6500.md` | pending | +| 13 | 6001–6500 | 500 | `lines-6001-6500.md` | complete | | 14 | 6501–7000 | 500 | `lines-6501-7000.md` | pending | | 15 | 7001–7500 | 500 | `lines-7001-7500.md` | pending | | 16 | 7501–8000 | 500 | `lines-7501-8000.md` | pending | diff --git a/docs/analysis/identifier-ledger.md b/docs/analysis/identifier-ledger.md index 460183a..d0592e3 100644 --- a/docs/analysis/identifier-ledger.md +++ b/docs/analysis/identifier-ledger.md @@ -17,7 +17,7 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `O` / chunk | 184 | Written at 50 numeric indices using 10×5 normalized UV cells (188–198), consumed as the hyper-effect atlas (4618–4624), then shadowed by the sound factory at 5049. | `hyperFxAtlasRects` | resolved | High. | 01–11 | UI/Animator | None. | | `ie` / chunk | 185 | Written at 16 indices using a 4×4 UV grid (211–217). | `atlas4x4Rects` | working | High for shape, medium for texture. | 01–01 | UI/Animations | Identify owning texture. | | `t` / chunk (second binding) | 186 | Declared nil, then shadowed again at 263; no read. | — | dead | High: no assignment/read before shadow. | 01–01 | Unassigned | Minifier artifact? | -| `i` / chunk | 186 | Atlas scratch indexes `F`,`J`,`ie` (187–216); animator factory later reuses the captured binding for rotation angle radians (4939–4941). | `atlasOrAngleScratch` | resolved | High: both temporal roles explicit. | 01–10 | UI/Animations | Split roles in rewrite. | +| `i` / chunk | 186 | Atlas scratch indexes `F`,`J`,`ie` (187–216), animator construction reuses it for radians (4939–4941), and summary construction reassigns it as the metric Y accumulator (6280–6332) before a local factory shadows it. | `atlasAngleOrLayoutScratch` | resolved | High: all temporal roles explicit. | 01–13 | UI/Animations, UI/Summary | Split roles in rewrite. | | `e` / first atlas loop | 188 | Loop values 0–4; multiplies row offsets and indices (189–203). | `row` | resolved | High: numeric-for and row arithmetic (188–203). | 01–01 | UI/Animations | None for this scope. | | `e` / second atlas loop | 211 | Loop values 0–3; computes vertical quarters (212–215). | `row` | resolved | High: loop and `/4` UV math (211–215). | 01–01 | UI/Animations | None for this scope. | | `e` / third atlas loop | 218 | Loop values 0–2; computes 3×3 indices/UVs (219–221). | `row` | resolved | High: loop and `*3`/`.33` math (218–221). | 01–01 | UI/Animations | Exact `.33` edge behavior later. | @@ -39,7 +39,7 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `Je` / chunk | 242 | Constant `10`; halved into `gt` (290). | unknown dimension | unresolved | Low. | 01–01 | UI | Locate consumers. | | `E` / chunk | 243 | Receives `math.random`, copied to `m`, then nilled; later resets `gem.fxType` (307–308, 1972) before being shadowed by the minimap factory at 5194. | `nilFxType` after temporary alias | resolved | High: temporal value flow is explicit. | 01–11 | UI/Animations | Preserve nil reset without retaining alias indirection. | | `S` / chunk | 244 | Constant `-1`; assigned to hidden hint object's `fxType` during level-up reset (527). | `inactiveHintFxType` | working | Medium: reset/hide sequence (526–527). | 01–02 | UI/Animations | Confirm animator interpretation. | -| `y` / chunk | 245 | Constant `1`; assigned to non-hyper gems' effect type during board transition (1990–1992). | `gameOverGemFxType` | working | Medium: function incomplete. | 01–04 | UI/Animations | Complete `Ke` dispatcher evidence. | +| `y` / chunk | 245 | Effect enum `1`; starts gem-atlas cycling for selected and game-over gems, and animator idle branch advances `F` until `fxEnd` (1990–1992, 3223–3225, 4327–4340), then is shadowed by taxi handler at 6153. | `FX_GEM_ANIMATION` | resolved | High. | 01–13 | UI/Animator, UI/GemPool | Preserve numeric effect value. | | `Lt` / chunk | 246 | Constant `20`; no batch-01 read. | unknown constant | unresolved | Low. | 01–01 | Unassigned | Locate consumers. | | `ye` / chunk | 247 | Constant `3`; no batch-01 read. | unknown enum three | unresolved | Low. | 01–01 | Engine | Locate consumers. | | `ve` / chunk | 248 | Constant `360`; no batch-01 read. | likely angle/full rotation | working | Low: value only. | 01–01 | UI/Animations | Confirm angular use. | @@ -111,7 +111,7 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `P` / chunk (char alias) | 313 | Copies `string.char`; called inside encoder `x` (692, 694, 708), then shadowed by function at 735; `x` retains it. | `stringChar` | resolved | High: direct alias/calls and lexical capture. | 01–02 | Core/SavedVariables | None. | | `d` / chunk | 314 | Copies `math.floor`; called for timer, codec, score popup, and flight-duration values (558, 564, 582, 677, 687, 698, 878–879, 900, 911, 933, 1023, 1366). | `floor` | resolved | High: direct alias and calls. | 01–03 | Core | None. | | `u` / chunk | 315 | Receives `table.insert`; queues animations and event callbacks (457, 1425). | `tableInsert` | resolved | High: direct alias and calls. | 01–03 | Core | None. | -| `B` / chunk | 316 | Receives `table.remove`; consumes three front entries from flight path and removes completed event callbacks (1367–1369, 1413). | `tableRemove` | resolved | High: direct alias and calls. | 01–03 | Core | None. | +| `B` / chunk | 316 | Receives `table.remove`; consumes flight-path triples, event callbacks, animation/effect queues, and network queue heads through line 6167, then is shadowed by summary factory at 6252. Earlier closures retain it. | `tableRemove` | resolved | High. | 01–13 | Core | None. | | `Y` / chunk | 317 | Copies `tostring`; converts decoded checksum/rank values (750, 890, 912). | `toString` | resolved | High: direct alias and calls. | 01–02 | Core | None. | | `G` / chunk | 318 | Copies `string.sub`; slices checksum payloads, decimal digits, and rank prefixes (745–755, 777–778). | `stringSub` | resolved | High: direct alias and calls. | 01–02 | Core/SavedVariables | None. | | `D` / chunk | 319 | Copies `tonumber`; parses checksum digits, rank prefixes, and inbound score fields (751–755, 777, 1520, 3305, 3338), then is shadowed by the flight-option factory at 5895. Earlier closures retain it. | `toNumber` | resolved | High. | 01–12 | Core/SavedVariables | None. | @@ -121,8 +121,8 @@ Each row identifies one declaration, not merely one spelling. `chunk` means the | `o` / chunk | 323 | Eight row tables initialized, exported as `debugArray`, and traversed as `o[row][column]` gem frames (324–326, 442, 1275–1293). | `gemGrid` | resolved | High: explicit 8×8 traversal. | 01–03 | Engine/Grid, UI/GemPool | Debug export naming is incidental. | | `e` / debug-array loop | 324 | Loop 1–8; indexes `o` for writes (325). | `index` | resolved | High: direct loop role. | 01–01 | Core/Init | None. | | `v` / chunk | 327 | Key for authenticated personal-best payloads in current-game/profile classic/timed stats (887, 900, 3490–3491, 3601–3613). | `statEncodedScoreKey` | working | High for role; concrete selected key pending. | 01–08 | Core/SavedVariables | Find mode-specific assignments. | -| `I` / chunk | 327 | Key for decoded numeric personal-best metrics in current-game/profile classic/timed stats (885–886, 898–899, 3603–3612). | `statNumericScoreKey` | working | High for role; concrete selected key pending. | 01–08 | Core/SavedVariables | Find mode-specific assignments. | -| `ge` / chunk | 327 | Forward declaration populated by `ze` with faction-selected four-region coordinate adjacency graphs (1040–1249). | `flightGraph` | resolved | High: complete assignment shape. | 01–03 | Core/SavedVariables | Region meanings/search consumers pending. | +| `I` / chunk | 327 | Key for decoded current/profile numeric bests (885–886, 898–899, 3603–3612); summary construction assigns lowercase suffix of `Final Score`, definitively `score` (6288). | `statScoreKey` | resolved | High. | 01–13 | Core/SavedVariables, UI/Summary | None. | +| `ge` / chunk | 327 | Populated by `ze` with faction-selected four-region coordinate adjacency graphs (1040–1249); disabled taxi estimator compares its candidate timing table with this graph (6213). | `flightGraph` | resolved | High. | 01–13 | Core/SavedVariables, UI/Flight | Disabled estimator conflates graph/timing-table shapes. | | `we` / chunk | 327 | Set when max-score level-up begins (529); during level spawning it counts/removes carried hyper and big-star state for later restoration (3890–3906). | `levelSpawnSpecialRecovery` | working | Medium-high. | 01–08 | Engine/Scoring, Engine/BoardSpawn | Find reset and full restoration completion. | | `r` / chunk | 333 | Six-entry array of four-number direction/offset tuples. | neighbor/offset patterns | working | Medium: signed coordinate-like tuples. | 01–01 | Engine/Matches | Establish tuple field semantics. | | `n` / chunk | 334 | Exported current-game state; drives scoring/pause/events/save metadata and receives erroneous `bgFile` write (443, 464–529, 874–1008, 1274–1407, 1664, 1924–1933). | `currentGame` | resolved | High: explicit debug export and repeated state transitions. | 01–04 | Engine/Grid, Engine/Scoring | Full dynamic table shape still grows later. | @@ -215,7 +215,7 @@ Only direct standard-library aliases, loop counters with complete local bodies, | `e` / `j` duplicate-shift loop | 805 | Shifts rows `e..9` upward after improved duplicate (806–813). | `row` | resolved | High. | 02–02 | Core/SavedVariables | None. | | `e` / `j` rank-search loop | 829 | Scans rows 10..1 to find insertion index (830–839). | `row` | resolved | High. | 02–02 | Core/SavedVariables | None. | | `e` / `j` insertion-shift loop | 841 | Shifts rows 10 down to `insertAt+1` (842–846). | `row` | resolved | High. | 02–02 | Core/SavedVariables | None. | -| `_t` / chunk function | 872 | Finalizes game results, best scores, publishing, result HUD, and first-game popup (873–951). | `finalizeGame` | resolved | High: complete body. | 02–02 | Engine/Scoring, UI/HUD | Method/callback attachment pending. | +| `_t` / chunk function | 872 | Finalizes game results, best scores, publishing, result HUD, and first-game popup (873–951); attached as summary screen `FillData` at 6279. | `finalizeGame` | resolved | High. | 02–13 | Engine/Scoring, UI/Summary | None. | | `t` / `_t` parameter | 872 | Result-window/controller whose captions, values, buttons, and payload are updated. | `resultsFrame` | resolved | High. | 02–02 | UI/HUD | None. | | `r` / `_t` declaration | 873 | Receives elapsed seconds and drives game metrics/time display (877–933). | `elapsed` | resolved | High: complete body. | 02–02 | Engine/Scoring, UI/HUD | None. | | `i`,`S`,`o` / `_t` declaration | 873 | Minute/remainder locals `i`,`S` are computed but unused; `o` is shadowed at 875 before read. | — | dead | High: complete body. | 02–02 | Unassigned | Minifier/removed display logic. | @@ -228,10 +228,10 @@ Only direct standard-library aliases, loop counters with complete local bodies, | `i` / `_t` friend declaration | 923 | Shadowed by the numeric-for variable at 924 before read. | — | dead | High. | 02–02 | Unassigned | Minifier artifact. | | `n` / `_t` friend declaration | 923 | Receives friend name and is used as whisper target (925–927). | `friendName` | resolved | High for legacy call flow. | 02–02 | Core/Init | Current friend API contract must be verified. | | `i` / `_t` friend loop | 924 | Iterates friend-list indices `1..GetNumFriends()` and is passed to `GetFriendInfo` (925). | `friendIndex` | resolved | High. | 02–02 | Core/Init | Current friend API contract must be verified. | -| `_` / implicit chunk global | external; writes 925, 1433 | Receives repeated ignored friend-info returns, then a combat-log positional return; each assignment survives globally. | discarded positional return | unresolved | High for accidental global writes; later reads not yet audited. | 02–03 | Core/Init | Does any later code depend on global `_`? | -| `online` / implicit chunk global | external; write/read 925 | Receives the fifth friend-info return and immediately gates whisper publishing. | `friendOnline` | working | High for legacy intended role; API return contract pending. | 02–02 | Core/Init | Must become local and use current API shape. | +| `_` / implicit chunk global | external; writes 925, 1433, 6345 | Receives repeated ignored friend-info returns and a combat-log positional return; each assignment survives globally, and no read appears through line 6500. | discarded positional return | unresolved | High for accidental global writes. | 02–13 | Core/Init, UI/Summary | Must become local discards after API verification. | +| `online` / implicit chunk global | external; write/read 925, 6345 | Receives the fifth friend-info return and immediately gates friend whisper publishing in automatic and manual paths. | `friendOnline` | working | High for intended role; API return contract pending. | 02–13 | Core/Init, UI/Summary | Must become local and use current API shape. | | `mod` / external function | external; calls 690, 721, 727–731 | Computes remainder for base-70 digits, parity, and checksum decimal digits. | `modulo` | resolved | High: arithmetic operands/results are explicit. | 02–02 | Core/SavedVariables | Choose Lua-5.1-compatible qualified implementation later. | -| `M` / chunk function | 953 | Computes match/combo/special points and skill gains, positions score/rank/skill floating text, and closes at 1037. | `presentMatchScore` | resolved | High: complete body; it presents but does not apply score. | 02–03 | Engine/Matches, Engine/Scoring, UI/Animations | Call sites must establish where score is applied. | +| `M` / chunk function | 953 | Computes match/combo/special points and skill gains and positions score/rank/skill floating text; used through animator/swap processing, then shadowed by event-registration helper at 6149. Earlier closures retain it. | `presentMatchScore` | resolved | High. | 02–13 | Engine/Matches, Engine/Scoring, UI/Animations | Call sites establish score application separately. | | `l` / `M` parameter | 953 | Controls skill/length bonuses and horizontal/vertical midpoint offset (961, 983–986, 1013–1025). | `matchLength` | resolved | High: complete body. | 02–03 | Engine/Matches | None. | | `s` / `M` parameter | 953 | Frame/table anchor supplying `.x` and `.y` for floating-text placement (1010–1018). | `anchor` | resolved | High: direct coordinate reads. | 02–03 | UI/Animations | Concrete object type pending call sites. | | `S` / `M` parameter | 953 | Passed as fourth argument to ordinary score `CreateFloatingText` (1023). | `scoreTextStyle` | working | Medium: direct call role, style domain unknown. | 02–03 | UI/Animations | Identify animator style enum. | @@ -416,7 +416,7 @@ Completed event callbacks and helpers are resolved by full local data flow. Lega | `s`,`c`,`d`,`S`,`e` / `de` locals | 2005 | Match count, safe flag, two scan steps, chosen color (2006–2049). | `matchCount`,`safe`,`xStep`,`yStep`,`color` | resolved | High. | 05–05 | Engine/Grid | None. | | `i`,`l` / `de` loops | 2012, 2014, 2020, 2025 | Attempts, pattern, row offset, column offset. | `attempt/pattern`,`rowOffset`,`columnOffset` | resolved | High. | 05–05 | Engine/Grid | None. | | `t` / `de` gem local | 2049 | Shadows column after indexing and receives rendered gem. | `gem` | resolved | High. | 05–05 | UI/GemPool | None. | -| `R` / chunk renderer | 2059 | Shadows type alias; renders normal/hyper/empty gem (2060–2075). | `renderGem` | resolved | High. | 05–05 | UI/GemPool | Earlier reset closure retains old alias. | +| `R` / chunk renderer | 2059 | Shadows type alias; renders normal/hyper/empty gems and is used by restore/spawn/gravity/animator paths through line 4872, then is shadowed by timed-menu factory at 6019. Earlier closures retain it. | `renderGem` | resolved | High. | 05–13 | UI/GemPool, UI/Animator | Earlier reset closure retains old type alias. | | `t` / renderer parameter | 2059 | Gem/content receiver. | `gem` | resolved | High. | 05–05 | UI/GemPool | None. | | `j` / chunk game function | 2077 | Shadows leaderboard merger; initializes/restores game (2078–2245). | `startGame` | resolved | High. | 05–05 | Engine/Grid | Attachment pending. | | `l`,`s`,`r` / game parameters | 2077 | Mode, duration, resume flag. | `mode`,`duration`,`resume` | resolved | High. | 05–05 | Engine/Grid | None. | @@ -516,7 +516,7 @@ Completed factories are resolved by pool/field contracts. The open match scanner | `h`,`a`,`S`,`d`,`s` / `nt` locals | 3294–3298 | Score list, cyan color, green color, player name, friend count. | `scoreList`,`cyan`,`green`,`playerName`,`friendCount` | resolved | High. | 07–07 | UI/Leaderboard | None. | | `t` / `nt` row loop | 3299 | Display row index 1–10. | `rowIndex` | resolved | High. | 07–07 | UI/Leaderboard | None. | | `e` / `nt` friend loops | 3315, 3348 | Friend-list index in distinct nested loop scopes. | `friendIndex` | resolved | High. | 07–07 | UI/Leaderboard | None. | -| `Ne` / shadow function; `t`,`n` params | 3369 | Throttled timer `OnUpdate`; delta parameter `n` is consumed before a later local shadows it. Shadows direction constant for later code. | `updateTimer`; `frame`,`delta` | resolved | High. | 07–07 | UI/Timer | None. | +| `Ne` / shadow function; `t`,`n` params | 3369 | Throttled timer `OnUpdate`; delta parameter `n` is consumed before a later local shadows it. Attached to `BejeweledFlightTimer` at 6014 after shadowing direction constant for later code. | `updateFlightTimer`; `timer`,`delta` | resolved | High. | 07–13 | UI/Flight | None. | | `n` / `Ne` timed-window local | 3378 | Timed-window object used after delta accumulation. | `timedWindow` | resolved | High. | 07–07 | UI/Timer | None. | | `i`,`a`,`t`,`o` / `UpdateSavedVariablesDatabase` locals | 3463–3466 | Classic stats, timed stats, saved state, and player identity then checksum seed through completed migration (3463–3614). | `classicStats`,`timedStats`,`savedState`,`playerNameOrChecksum` | resolved | High. | 07–08 | Persistence/Migration | Split `o` roles in rewrite. | | `n` / score-migration popup scope | 3494 | Popup frame fully constructed, stored as `Bejeweled.updatePopup`, and shown by upgrade controls (3494–3560). | `migrationPopup` | resolved | High. | 07–08 | UI/Migration | Duplicate global No button is preserved defect evidence. | @@ -744,15 +744,94 @@ Factories `V`, `O`, and `E` close and install their frames in this batch, so the | `t` / classic `OnHide` param | 5861 | Selector frame whose transient `gameMode` flag distinguishes game start from back navigation. | `classicModeWindow` | resolved | High. | 12–12 | UI/Menu | None. | | `n` / classic button locals | 5869, 5880 | Continue-action and new-game-action buttons; global frame names are opposite their text/actions. | `continueButton`,`newGameButton` | resolved | High. | 12–12 | UI/Menu | Preserve frame-name compatibility. | | `t` / classic button callbacks | 5874, 5886 | Distinct clicked-button parameters are never read. | — | dead | High. | 12–12 | UI/Menu | None. | -| `D` / shadow function | 5895 | Begins the Flight Path option factory and shadows `tonumber` retained by earlier closures; remains open after line 6000. | `createFlightOptionWindow` | working | High for ownership. | 12–12 | UI/Flight | Complete in batch 13. | -| `n` / `D` local | 5896 | Top-level flight-option frame with timer/path state, captions, and open Start control; factory remains open. | `flightOptionWindow` | working | High. | 12–12 | UI/Flight | Complete in batch 13. | +| `D` / shadow function | 5895 | Constructs and installs Flight Path option frame, Start action, and `Ne`-driven timer; closes at 6017 after shadowing `tonumber` retained by earlier closures. | `createFlightOptionWindow` | resolved | High. | 12–13 | UI/Flight | None. | +| `n` / `D` local | 5896 | Top-level flight-option frame receives button/timer and is installed as `Bejeweled.flightOptionWindow`. | `flightOptionWindow` | resolved | High. | 12–13 | UI/Flight | None. | | `t` / flight backdrop local | 5905 | Backdrop descriptor populated and applied to flight-option frame. | `backdropInfo` | resolved | High. | 12–12 | UI/Flight | None. | | `t` / flight close-button local | 5915 | Inherited close button configured before shadow. | `closeButton` | resolved | High. | 12–12 | UI/Flight | None. | | `t` / flight informational local | 5920 | Starts as title font string, then is reassigned to remaining-caption, remaining-value, and warning font strings stored where needed. | `infoText` | resolved | High. | 12–12 | UI/Flight | Split temporal roles in rewrite. | | `t` / flight `OnShow` param | 5950 | Flight-option window initializes nested timer state, timed-window flight controls, auto-start policy, and events. | `flightOptionWindow` | resolved | High. | 12–12 | UI/Flight | Fixed 120-second display differs from timer state. | -| `t` / flight Start-button local | 5988 | Start button with custom `OnClickScript`; callback and factory continue after line 6000. | `startButton` | working | High. | 12–12 | UI/Flight | Complete in batch 13. | -| `t` / flight Start callback param | 5992 | Callback parameter has no read through line 6000, but its callback remains open. | unknown/likely button | working | Medium. | 12–12 | UI/Flight | Determine whether later lines consume it. | +| `t` / flight Start-button local | 5988 | Start button's custom method launches flight-learning/timed play, manages screens, then is attached as its `OnClick`. | `startButton` | resolved | High. | 12–13 | UI/Flight | None. | +| `t` / flight Start callback param | 5992 | Callback parameter is never read before closure at 6005. | — | dead | High. | 12–13 | UI/Flight | None. | ## Batch 12 resolution policy Factories `g`, `P`, `N`, `W`, and `F` close in this batch, so their constructed-frame ownership and completed callback roles are resolved. The implicit `obj` read, template-expression result, classic frame-name/label inversion, transition-flag semantics, and fixed flight-duration display are preserved as behavior or defect evidence. Open flight factory `D`, its Start button, and its callback parameter remain working until batch 13. + +## Batch 13 declarations and scopes + +| Legacy identifier / scope | Decl. | Evidence | Proposed name | Status | Confidence | First–last | Target | Question | +| --- | ---: | --- | --- | --- | --- | --- | --- | --- | +| `t` / flight-timer local | 6008 | Hidden one-pixel frame driven by `Ne`, stored as `n.timer`. | `flightTimer` | resolved | High. | 13–13 | UI/Flight | None. | +| `R` / shadow function | 6019 | Constructs and installs timed-mode menu; shadows gem renderer retained by earlier closures. | `createTimedModeWindow` | resolved | High. | 13–13 | UI/Flight, UI/Menu | Factory installs globally rather than returning. | +| `o` / `R` local | 6020 | Timed-mode menu configured and installed as `Bejeweled.timedWindow`. | `timedWindow` | resolved | High. | 13–13 | UI/Flight, UI/Menu | None. | +| `t` / timed backdrop local | 6027 | Backdrop descriptor populated and applied to timed menu. | `backdropInfo` | resolved | High. | 13–13 | UI/Menu | None. | +| `t` / timed close-button local | 6036 | Inherited close button configured before shadow. | `closeButton` | resolved | High. | 13–13 | UI/Menu | None. | +| `t` / timed informational local | 6039 | Starts as title, then is reassigned through Time/value/warning/remaining font strings before line-6133 shadow. | `infoText` | resolved | High. | 13–13 | UI/Flight, UI/Menu | Split temporal roles in rewrite. | +| `t` / timed `OnShow` param | 6045 | Timed menu frame whose checkbox and height/remaining UI are reset from flight-timer visibility. | `timedWindow` | resolved | High. | 13–13 | UI/Flight | None. | +| `t` / timed `OnHide` param | 6063 | Timed menu frame whose `newGame` transition flag selects cleanup versus return navigation. | `timedWindow` | resolved | High. | 13–13 | UI/Flight, UI/Menu | None. | +| `n` / timed-slider local | 6091 | Options-template slider ranging 2–10 minutes; shadowed by checkbox local after configuration. | `timeSlider` | resolved | High. | 13–13 | UI/Flight | None. | +| `objectText` / implicit chunk global | external; read 6093 | Undeclared value assigned to generated slider label; no declaration appears through line 6500. | unknown slider label | unresolved | High that dependency is implicit; value unknown. | 13–13 | UI/Flight | External injection or accidental nil? | +| `e` / slider-value callback param | 6103 | Slider supplies its generated Value font string name and current minute count. | `timeSlider` | resolved | High. | 13–13 | UI/Flight | None. | +| `n` / flight-checkbox local | 6107 | Checkbox returned by `CreateCheckbox`, styled and stored as `o.flightCheckbox`. | `flightCheckbox` | resolved | High. | 13–13 | UI/Flight | Empty click callback is intentional legacy behavior. | +| `t` / timed-Go local | 6133 | Go button that delegates to flight Start or starts fixed-duration timed play. | `goButton` | resolved | High. | 13–13 | UI/Flight | None. | +| `t` / timed-Go callback param | 6137 | Clicked-button parameter is never read. | — | dead | High. | 13–13 | UI/Flight | None. | +| `M` / shadow function | 6149 | Registers `UNIT_FLAGS` on the main window and shadows score presenter retained by earlier closures. | `registerUnitFlagsEvent` | resolved | High. | 13–13 | Core/Events | Callback/call site remains to locate. | +| `t` / `M` param | 6149 | Function parameter is never read. | — | dead | High. | 13–13 | Core/Events | None. | +| `y` / shadow function; `t` param | 6153 | Taxi-node handler derives node ID from passed UI object, clears path state, reads taxi metadata, and contains disabled estimation logic; shadows gem-animation enum captured earlier. | `handleTaxiNode`; `taxiNodeButton` | resolved | High. | 13–13 | UI/Flight | Callback attachment remains to locate. | +| `i`,`h` / taxi locals | 6154–6155 | Taxi node ID and route count from callback object/APIs. | `nodeId`,`routeCount` | resolved | High. | 13–13 | UI/Flight | APIs require replacement/verification. | +| `C`,`w`,`p`,`f` / taxi coordinate locals | 6156 | Disabled route branch assigns source X/Y and destination X/Y in route-map pixels. | `sourceX`,`sourceY`,`destinationX`,`destinationY` | resolved | High for intended arithmetic. | 13–13 | UI/Flight | Branch is forced unreachable. | +| `g`,`c` / taxi map-size locals | 6157–6158 | Live reads of `TaxiRouteMap` width/height scale normalized route coordinates in disabled branch. | `mapWidth`,`mapHeight` | resolved | High. | 13–13 | UI/Flight | Reads occur before forced-false guard. | +| `n`,`o` / taxi key locals | 6159–6160 | Disabled branch formats source/destination coordinate keys. | `sourceKey`,`destinationKey` | resolved | High. | 13–13 | UI/Flight | None. | +| `a`,`s`,`S` / taxi timing locals | 6161–6163 | Total time, per-leg time, and unknown-leg/learning flag in disabled estimator. | `totalTime`,`legTime`,`needsLearning` | resolved | High. | 13–13 | UI/Flight | Branch is forced unreachable. | +| `r` / taxi-path local | 6164 | Alias of `flightOptionWindow.pathArray`, drained live and populated only by disabled estimator. | `pathArray` | resolved | High. | 13–13 | UI/Flight | None. | +| `t` / taxi disabled-table local | 6165 | Nil local whose intended continent graph/timing-table initializer is commented out; all executable reads occur only in forced-false branch. | — | dead | High. | 13–13 | UI/Flight | Removed map API left initializer absent. | +| `e` / path-drain loop | 6166 | Controls one head removal per original path-array entry; value is otherwise unread. | `entryIndex` | resolved | High. | 13–13 | UI/Flight | None. | +| `m` / taxi-node-type local | 6177 | Live `TaxiNodeGetType` result selects forced-disabled reachable or empty current branch. | `nodeType` | resolved | High. | 13–13 | UI/Flight | API requires verification. | +| `l` / disabled route loop | 6185 | Route index 1 through global `NUM_TAXI_ROUTES`; loop is unreachable. | `routeIndex` | resolved | High. | 13–13 | UI/Flight | None. | +| `e` / disabled fallback local | 6214 | Candidate saved flight-time table checked for source/destination keys. | `savedFlightTimes` | resolved | High. | 13–13 | UI/Flight | Branch is forced unreachable. | +| `B` / shadow function | 6252 | Begins summary-screen and brag UI construction, shadowing `table.remove` captured by earlier closures; remains open after line 6500. | `createSummaryScreen` | working | High for ownership. | 13–13 | UI/Summary | Complete in batch 14. | +| `n` / summary-window local | 6253 | Main window used only to derive summary/inner-panel frame levels before line-6281 shadow. | `window` | resolved | High. | 13–13 | UI/Summary | None. | +| `o` / summary-frame local | 6254 | Summary screen receives metrics/actions/brag child and is installed globally; shadowed by dropdown local at 6485 after earlier closures capture it. | `summaryScreen` | working | High. | 13–13 | UI/Summary | Complete factory in batch 14. | +| `a` / summary backdrop local | 6257 | Backdrop descriptor applied to summary, inner panel, and brag screen. | `backdropInfo` | resolved | High. | 13–13 | UI/Summary | None. | +| `t` / summary content local | 6267 | Starts as title/metric captions and values, then is reassigned to brag screen at 6446; factory remains open. | `contentObject` | working | High. | 13–13 | UI/Summary | Split temporal roles in rewrite. | +| `l` / summary inner-panel local | 6271 | Inset panel parents metric captions and action buttons. | `contentPanel` | resolved | High. | 13–13 | UI/Summary | None. | +| `n`,`r` / summary spacing locals | 6281–6282 | Value-row increment 42 and caption-row increment 20 used by layout accumulator `i`. | `valueSpacing`,`captionSpacing` | resolved | High. | 13–13 | UI/Summary | None. | +| `n` / summary-action local | 6334 | Publish button, then reassigned to See High Scores, Brag, and nested brag-submit buttons through line 6487. | `actionButton` | working | High. | 13–13 | UI/Summary | Callback remains open in batch 14. | +| `t` / publish tooltip param | 6338 | Publish button becomes tooltip owner. | `publishButton` | resolved | High. | 13–13 | UI/Summary | None. | +| `t` / publish-click param | 6340 | Publish button supplies `dataDump` for guild/friend network sends. | `publishButton` | resolved | High. | 13–13 | UI/Summary, Network/Publishing | None. | +| `o` / publish friend pre-loop local | 6343 | Nil binding immediately hidden by numeric-for variable. | — | dead | High. | 13–13 | Network/Publishing | None. | +| `n` / publish friend local | 6343 | Friend name used as whisper target when implicit `online` is truthy. | `friendName` | resolved | High. | 13–13 | Network/Publishing | Verify current friend API tuple. | +| `o` / publish friend loop | 6344 | Iterates friend-list indices and shadows pre-loop `o`. | `friendIndex` | resolved | High. | 13–13 | Network/Publishing | None. | +| `t` / See High Scores callback param | 6359 | Clicked-button parameter is never read. | — | dead | High. | 13–13 | UI/Summary | None. | +| `t` / Brag-open callback param | 6369 | Clicked-button parameter is never read. | — | dead | High. | 13–13 | UI/Summary | None. | +| `e` / Brag-open local | 6370 | Summary alias used to show brag screen and disable three action buttons. | `summaryScreen` | resolved | High. | 13–13 | UI/Summary | None. | +| `t` / dropdown-item callback param | 6377 | Selected dropdown item supplies text and value for open menu and profile setting. | `menuItem` | resolved | High. | 13–13 | UI/Summary | None. | +| `e` / dropdown-item local | 6378 | Open dropdown or default-publish dropdown fallback updated by selection. | `dropdown` | resolved | High. | 13–13 | UI/Summary | Legacy global dropdown API requires replacement. | +| `i` / dropdown-factory local | 6383 | Local function constructs, initializes, shows, and returns one legacy dropdown. | `createDropdown` | resolved | High. | 13–13 | UI/Summary | None. | +| `i`,`o`,`r`,`n`,`l`,`a`,`d` / dropdown-factory params | 6383 | X, Y, menu width, name suffix, label, parent, and stored update function. | role-specific names | resolved | High. | 13–13 | UI/Summary | Update function is stored but not invoked here. | +| first `s` / dropdown-factory params | 6383 | Hidden by final same-spelling ninth parameter. | — | shadowed | High. | 13–13 | UI/Summary | None. | +| final `s` / dropdown-factory params | 6383 | Surviving ninth parameter is never read. | — | dead | High. | 13–13 | UI/Summary | None. | +| `n` / dropdown local | 6384 | Dropdown frame; shadows name-suffix parameter after RHS initializer uses it. | `dropdown` | resolved | High. | 13–13 | UI/Summary | Lua 5.1 initializer scope is required. | +| `i` / dropdown initialize param | 6401 | Dropdown frame whose publish choices and parent channel lists are initialized. | `dropdown` | resolved | High. | 13–13 | UI/Summary | None. | +| `t` / first two initialize locals | 6403, 6404 | Each nil declaration is shadowed by the next same-spelling declaration without a read. | — | shadowed | High. | 13–13 | UI/Summary | Minifier artifact. | +| `t` / initialize info local | 6405 | Shared mutable `dropInfo` record repeatedly wiped/populated for each menu item. | `dropInfo` | resolved | High. | 13–13 | UI/Summary | Dropdown API must copy item data. | +| `o` / initialize selected local | 6408 | Selected/fallback distribution value, initialized to first configured channel. | `selectedChannel` | resolved | High. | 13–13 | UI/Summary | None. | +| `n` / configured-channel loop | 6409 | Iterates the three configured channel constants/names. | `channelIndex` | resolved | High. | 13–13 | UI/Summary | None. | +| `l` / default-channel local | 6420 | Lowercase persisted default for case-insensitive custom-channel matching. | `defaultChannelLower` | resolved | High. | 13–13 | UI/Summary | None. | +| `n` / brag-parent local | 6421 | Dropdown parent/brag screen refreshed and read for custom channel names. | `bragScreen` | resolved | High. | 13–13 | UI/Summary | None. | +| `i` / custom-channel loop | 6422 | Iterates rebuilt custom channel names and shadows initialize parameter within loop. | `channelIndex` | resolved | High. | 13–13 | UI/Summary | None. | +| `e` / dropdown `OnShow` param | 6438 | Dropdown frame reanchored, initialized, selected, and resized. | `dropdown` | resolved | High. | 13–13 | UI/Summary | None. | +| `e` / `refreshChannels` param | 6459 | Brag screen whose system/custom channel arrays are rebuilt. | `bragScreen` | resolved | High. | 13–13 | UI/Summary | None. | +| `t` / refresh pre-loop local | 6461 | Nil declaration immediately hidden by numeric-for variable. | — | dead | High. | 13–13 | UI/Summary | None. | +| `t` / vararg loop | 6462 | Iterates 1 through `#(...)` and selects that position into system-channel array. | `argumentIndex` | resolved | High for syntax; bound is defective. | 13–13 | UI/Summary | Replace with explicit vararg count. | +| `t`,`n` / channel-scan locals | 6466 | Channel name and channel ID/index used across scan/filter. | `channelName`,`channelIndex` | resolved | High. | 13–13 | UI/Summary | None. | +| `n` / system-name inner loop | 6470 | Scans stored system channel strings and shadows outer channel ID. | `systemChannelIndex` | resolved | High. | 13–13 | UI/Summary | None. | +| `text` / implicit chunk global | external; write/read 6482–6484 | Undeclared brag prompt caption assigned and immediately configured. | `bragPrompt` | working | High for role; accidental global. | 13–13 | UI/Summary | Must become local. | +| `o` / brag-dropdown local | 6485 | Dropdown returned by local factory and marked `publish`; shadows summary-frame local after all required captures. | `publishDropdown` | resolved | High. | 13–13 | UI/Summary | None. | +| `t` / brag-submit callback param | 6492 | Clicked-button parameter is unused before a local shadows its spelling at 6494. | — | dead | High. | 13–13 | UI/Summary | None. | +| `e` / brag-submit local | 6493 | Summary alias supplying `bragString`; callback remains open after line 6500. | `summaryScreen` | working | High. | 13–13 | UI/Summary | Complete in batch 14. | +| `t` / brag-channel local | 6494 | Numeric result of `GetChannelName(defaultPublish)` selecting channel-ID versus distribution send. | `channelId` | resolved | High. | 13–13 | UI/Summary, Network/Publishing | API accepts configured string input in legacy flow. | + +## Batch 13 resolution policy + +Factories `D` and `R`, helper `M`, and taxi handler `y` close in this batch, supporting resolved ownership even where taxi estimation is deliberately unreachable. Implicit globals, forced-false API code, chunk scratch/key reuse, and the `#(...)` vararg defect are preserved as evidence. Open summary factory `B`, its temporally reused locals, and the Brag callback remain working until batch 14. diff --git a/docs/analysis/lines-6001-6500.md b/docs/analysis/lines-6001-6500.md new file mode 100644 index 0000000..647b131 --- /dev/null +++ b/docs/analysis/lines-6001-6500.md @@ -0,0 +1,54 @@ +# Batch 13: lines 6001–6500 + +Source: `Legacy/Bejeweled_Mainline.lua` at commit `6faec1c` +Coverage: lines 6001–6500 inclusive +Blank: 6018, 6148, 6152, 6251 +Status: complete; flight-option factory `D`, timed-menu factory `R`, event-registration helper `M`, and taxi-node handler `y` close, while summary-screen factory `B` and its Brag callback continue into batch 14 + +## Line-indexed coverage audit + +| Lines | Evidence represented | +| ---: | --- | +| 6001–6017 | Finishes the flight Start callback by hiding mode/menu/skills screens and showing the main window. It installs the custom callback as `OnClick`, creates the hidden one-pixel `BejeweledFlightTimer` driven by `Ne`, attaches button/timer to the flight window, installs `Bejeweled.flightOptionWindow`, and closes `D`. | +| 6018 | Blank. | +| 6019–6044 | New `R` shadows gem renderer `R` and constructs the centered Timed Mode menu with inherited close button, backdrop, and title. Successive `t` declarations configure those objects before shadowing. | +| 6045–6078 | Timed-menu show pauses and resets the flight checkbox, then selects a tall layout with remaining-flight UI when the flight timer is visible or a shorter layout without it. Hide with `newGame` clears the flag/unpauses and stops a timed-mode timer or resets flight-learning countdown/movement; ordinary closing returns to game-type selection. | +| 6079–6106 | Adds Time/value captions and an options-template slider spanning 2–10 in unit steps, initialized to 5. It writes undeclared `objectText` into the generated slider label and updates the generated Value font string to `N Minute(s)` on value changes. | +| 6107–6147 | Adds the flight-time checkbox with an empty callback, too-short warning, remaining-flight caption/value, and Go button. Go delegates to flight Start when a visible checkbox is checked; otherwise it starts timed mode through `j(ae,sliderMinutes×60)`. It marks `newGame`, hides the timed menu, installs it as `Bejeweled.timedWindow`, and closes `R`. | +| 6148 | Blank. | +| 6149–6151 | New `M` shadows the completed match-score presenter, ignores its parameter, registers `UNIT_FLAGS` on the main window, and closes. | +| 6152 | Blank. | +| 6153–6168 | New `y` shadows gem-animation effect enum 1 and begins a taxi-node handler. It derives node ID, route count, route-map dimensions, initializes coordinate/time/key temporaries, aliases and fully drains `flightOptionWindow.pathArray`, and retains a nil flight-table local. | +| 6169–6180 | Comments document removed map APIs and disable flight-time estimation. Live code still reads `TaxiNodeGetType`; the reachable branch is forced false by `and 1 == 0`, leaving all subsequent route estimation unreachable. | +| 6181–6238 | Disabled route estimation would select the taxi node, grow global `NUM_TAXI_ROUTES`, derive pixel source/destination keys from normalized coordinates, initialize/fallback continent flight-time tables, accumulate leg times with a 1.5-second adjustment after route two, flag unknown legs, append key/key/time triples to `pathArray`, and publish total time/learning state. | +| 6239–6250 | Still-disabled tooltip logic would show unknown or formatted travel time according to the learning flag. The `CURRENT` node branch is empty, then taxi handler `y` closes. | +| 6251 | Blank. | +| 6252–6279 | New `B` shadows captured `table.remove` and begins the summary-screen factory. It creates the board-sized hidden Game Over frame, backdrop and inner panel, stores `_t` as `FillData`, and adds the title. | +| 6280–6333 | Reuses chunk scratch `i` as a vertical layout accumulator and assigns chunk `I` from lowercase `Final Score` suffix (`score`). Alternating caption/value increments of 20/42 place Final Score, Time, Level, Largest Cascade, and Largest Combo fields and store each on the summary. | +| 6334–6354 | Creates Publish Scores with tooltip. When `dataDump` exists, click sends guild `HSPub`, enumerates friends and whispers online names, opens Feats of Skill/high-score tab, then hides the popup. Friend-info discard slots write implicit global `_`, and online state uses implicit global `online`. | +| 6355–6382 | See High Scores directly opens the same screen/tab. Brag opens a nested brag screen and disables all three summary actions. Global `Bejeweled.Dropdown_Item_OnClick` updates an open/default dropdown's text, selected value, and persisted `defaultPublish`. | +| 6383–6400 | Defines local dropdown factory `i` with duplicate `s` parameters. It constructs a named dropdown, optionally creates a label (empty string is truthy), stores update/width/selection fields, sets menu mode, and styles generated text from the label font. The first duplicate `s` is inaccessible and the surviving one is unused. | +| 6401–6436 | Dropdown initialization uses shared `dropInfo` to add three configured distribution choices and then custom server channels from the brag-screen parent. It retains whichever configured/custom value case-insensitively matches `defaultPublish`, falling back to the first configured channel, then rewrites the persisted setting. Two preliminary `t` declarations are shadowed before use. | +| 6437–6445 | Anchors the dropdown, initializes/reanchors/sets selection and width on show, stores the current selected value, and returns it from the local factory. | +| 6446–6481 | Reassigns caption local `t` to the nested brag screen, styles it, and initializes system/custom channel arrays. `refreshChannels` rebuilds system names by looping to `#(...)`—the length of the first adjusted vararg value rather than the number of varargs—then scans channel IDs 1–15 and excludes names containing any system-channel string before storing custom names. | +| 6482–6500 | Creates the brag prompt through undeclared global `text`, creates/publishes the dropdown, and reuses `n` for the Brag button. Its callback aliases the summary, shadows its unused button parameter with channel ID, sends `bragString` to a numeric channel or configured distribution, and clears the string at line 6500. The callback and factory remain open. | + +## Findings + +- Flight option startup is now closed: its custom method is also the actual click script, and the separate one-pixel timer delegates all updates to previously resolved `Ne`. +- Timed-menu `newGame` is another transition guard. Cleanup depends on current game mode: ordinary timed mode stops the bar timer, while flight-learning mode resets animator countdown and movement permission. +- Flight estimation is not fully inert. The route-walking/storage branch is forced unreachable, but `GetNumRoutes`, `TaxiRouteMap` dimensions, `TaxiNodeGetType`, and path-array draining execute before that guard. +- Summary construction proves chunk `I` is the literal stats key `score`. Chunk scratch `i` is temporally reused for summary vertical layout before a local dropdown factory shadows it. +- Score publishing repeats the legacy undeclared `_`/`online` friend-return assignments. Dropdown creation adds undeclared `objectText`; brag prompt creation adds undeclared `text`. +- `refreshChannels` uses `#(...)`, which in Lua 5.1 measures the first adjusted vararg value rather than counting arguments. This is behavior-critical defect evidence; a future fix must preserve channel filtering intent without treating it as valid vararg enumeration. + +## API and architecture mapping + +- Legacy slider globals/templates, dropdown APIs, friend-info returns, server-channel enumeration, chat sends, taxi route/map APIs, tooltip APIs, and event registration require authoritative Retail verification before implementation. +- `UI/Flight.lua`: completed flight-option/timer installation, timed-mode selector, transition cleanup, and deliberately disabled taxi estimator. +- `UI/Summary.lua`: open summary factory `B`, metric layout, score publishing, navigation actions, and brag-screen/dropdown construction. +- `Network/Publishing.lua`: manual guild/friend publication and channel-based brag sends, including current implicit-global defects. + +## Forward dependencies + +Batch 14 must resume at line 6501 inside the Brag button callback, close that callback and summary factory `B` only when the source does, and continue sequentially through line 7000 without assuming later factory call order. diff --git a/tools/verify-bootstrap.ps1 b/tools/verify-bootstrap.ps1 index be35290..25c1cea 100644 --- a/tools/verify-bootstrap.ps1 +++ b/tools/verify-bootstrap.ps1 @@ -141,9 +141,10 @@ Assert-ReportCoverage 'docs/analysis/lines-4001-4500.md' 4001 4500 Assert-ReportCoverage 'docs/analysis/lines-4501-5000.md' 4501 5000 Assert-ReportCoverage 'docs/analysis/lines-5001-5500.md' 5001 5500 Assert-ReportCoverage 'docs/analysis/lines-5501-6000.md' 5501 6000 +Assert-ReportCoverage 'docs/analysis/lines-6001-6500.md' 6001 6500 $lineCount = (Get-Content -LiteralPath 'Legacy/Bejeweled_Mainline.lua').Count Assert-True ($lineCount -eq 8401) "Legacy source has $lineCount lines, expected 8401" Write-Output "Verified: forbidden files absent; legacy and $($assetPaths.Count) asset hashes match $SourceCommit." -Write-Output "Verified: strict UTF-8 text, exact 8,401-line schedule, and complete batch-01/02/03/04/05/06/07/08/09/10/11/12 line coverage." +Write-Output "Verified: strict UTF-8 text, exact 8,401-line schedule, and complete batch-01/02/03/04/05/06/07/08/09/10/11/12/13 line coverage."