From a6efd4ee5edd12a59d2af6d8e0a38721a65a3722 Mon Sep 17 00:00:00 2001 From: byrongamatos Date: Sun, 6 Sep 2026 07:57:08 +0200 Subject: [PATCH] =?UTF-8?q?refactor(h3d-carve-17):=20cut-17=20=E2=80=94=20?= =?UTF-8?q?alias=20removal=20+=20stale=20doc=20comment=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleanups: - scene-init.js: remove dead DI alias getHighwayCanvas:_getHighwayCanvasAlias (Creed note) setHighwayCanvas now correctly gains its own line in the DI block - note-renderer.js: two stale line-number refs → module-relative refs (Toby r4 LOW) - arp.js: stale 'at line 4025' doc comment → 'factory-scope fn in screen.js' Gates: - ESLint: 0 errors on scene-init.js - plugin.json: 3.52.0 → 3.53.0 - Tests: 448/448 (alias kill test added; DI count repinned 178→179; version test updated) Note: DI count is 179 post-edit (setHighwayCanvas promoted to line-first position) CAF sweep: waived (no setter-arg changes in scope) Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_014uZ169yfoFYArXz962g7KW --- plugins/highway_3d/plugin.json | 2 +- plugins/highway_3d/src/arp.js | 2 +- plugins/highway_3d/src/note-renderer.js | 8 ++++---- plugins/highway_3d/src/scene-init.js | 2 +- tests/js/highway_3d_scene_init.test.js | 19 +++++++++++++------ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/plugins/highway_3d/plugin.json b/plugins/highway_3d/plugin.json index 96b9d0f..707955e 100644 --- a/plugins/highway_3d/plugin.json +++ b/plugins/highway_3d/plugin.json @@ -1,7 +1,7 @@ { "id": "highway_3d", "name": "3D Highway", - "version": "3.52.0", + "version": "3.53.0", "type": "visualization", "scriptType": "module", "bundled": true, diff --git a/plugins/highway_3d/src/arp.js b/plugins/highway_3d/src/arp.js index f09cd0f..52eaca5 100644 --- a/plugins/highway_3d/src/arp.js +++ b/plugins/highway_3d/src/arp.js @@ -21,7 +21,7 @@ export function createArp({ // ── plain const shorthand (fn refs or number consts, never reassigned) ── validString, // IIFE fn decl ~line 3736 filterValidNotes, // IIFE fn decl ~line 3767 — used by arpeggioLaneDividerFrameAccentMul - sY, // const fn at line 4025: s => S_BASE + (...) * S_GAP (captures live vars) + sY, // factory-scope fn: s => S_BASE + (...) * S_GAP (captures live vars) K, // module-level const line 124 S_GAP, // module-level const line 203 BEHIND, // module-level const line 206 diff --git a/plugins/highway_3d/src/note-renderer.js b/plugins/highway_3d/src/note-renderer.js index 7027830..ee3a594 100644 --- a/plugins/highway_3d/src/note-renderer.js +++ b/plugins/highway_3d/src/note-renderer.js @@ -1,7 +1,7 @@ // h3d-carve-14: V-section (note renderer) → src/note-renderer.js // Source: plugins/highway_3d/screen.js lines 10172–11604 (pre-cut). // Factory pattern: createNoteRenderer({DI}) → { drawNote, drawArpBrackets, drawNotedetectLabels, chordHarmonyLabels } -// chordHarmonyLabels is also called from update() (U-section) at line 9016. +// chordHarmonyLabels is also called from update() (U-section) in src/renderer.js. // // DI surface: 130 params // - 27 constants (shorthand) @@ -928,14 +928,14 @@ export function createNoteRenderer({ // open-note body. Fretted notes keep the // single-trail path. Offsets are scaled by // `openWScale` (the same body-width scale - // computed at line 7367) so the trails stay - // underneath the body's edges no matter how wide + // computed above via openChordBoxWidth) so the trails + // stay underneath the body's edges no matter how wide // the anchor lane is. Chord-member open strings // can't reach here (guarded at the `hasSus` // check above). // // openTrailOff is always > 0 because openWScale - // is clamped >= 0.22 at line 7368 (or defaults + // is clamped >= 0.22 above (or defaults // to 1 when there's no openChordBoxWidth), so // openTrailOff >= NW * 3 * 0.22 = 3.3 * K. // No degenerate-small-offset fallback needed. diff --git a/plugins/highway_3d/src/scene-init.js b/plugins/highway_3d/src/scene-init.js index b9400d4..6e997f1 100644 --- a/plugins/highway_3d/src/scene-init.js +++ b/plugins/highway_3d/src/scene-init.js @@ -84,7 +84,7 @@ export function createSceneInit({ getBeatG, setBeatG, getLblG, setLblG, getLyricsCanvas, setLyricsCanvas, setLyricsCtx, - getHighwayCanvas: _getHighwayCanvasAlias, setHighwayCanvas, + setHighwayCanvas, getVisibilityHandler, setVisibilityHandler, getCanvasReplacedHandler, setCanvasReplacedHandler, getOnCtxLost, setOnCtxLost, diff --git a/tests/js/highway_3d_scene_init.test.js b/tests/js/highway_3d_scene_init.test.js index 3b4fc70..012bfab 100644 --- a/tests/js/highway_3d_scene_init.test.js +++ b/tests/js/highway_3d_scene_init.test.js @@ -96,9 +96,10 @@ test('createSceneInit receives ≥150 DI parameters (anti-vacuity floor)', () => // Anti-vacuity floor — if regex changes and extracts 0, this fails loudly assert.ok(names.size >= 150, `anti-vacuity: expected ≥150 DI params, got ${names.size}`); // Exact pinned count — update this if DI surface intentionally changes - // Cut-16 tip: 183. After F2 (remove 5 dead-param lines): 178. - assert.strictEqual(names.size, 178, - `exact DI param count must be 178 (got ${names.size}) — update if DI surface changes`); + // Cut-16 tip: 183. After F2 (remove 5 dead-param lines): 178. Cut-17 alias removal: 179. + // (removing the alias moved setHighwayCanvas to line-start, adding it to the line-first count) + assert.strictEqual(names.size, 179, + `exact DI param count must be 179 (got ${names.size}) — update if DI surface changes`); }); // ── §5 Import correctness ───────────────────────────────────────────────────── @@ -177,10 +178,10 @@ test('_bcSyncMode no longer defined in screen.js (moved to scene-init.js)', () = // ── §8 plugin.json version bump ─────────────────────────────────────────────── -test('plugin.json version is 3.52.0 (bumped for cut-16)', () => { +test('plugin.json version is 3.53.0 (bumped for cut-17)', () => { const pkg = JSON.parse(fs.readFileSync(pluginJson, 'utf8')); - assert.equal(pkg.version, '3.52.0', - 'plugin.json must be bumped to 3.52.0 for cut-16'); + assert.equal(pkg.version, '3.53.0', + 'plugin.json must be bumped to 3.53.0 for cut-17'); }); // ── §9 Setter-call kill tests (§10 of contract) ─────────────────────────────── @@ -456,3 +457,9 @@ test('smoke: new-Function harness — factory construction + null-canvas early g // paths that require WebGL. ESLint no-undef is the compensating layer for // WRITE paths in sloppy-mode new-Function. }); + +test('_getHighwayCanvasAlias does not appear in scene-init.js (dead alias removed in cut-17)', () => { + const src = fs.readFileSync(sceneInitJs, 'utf8'); + assert.ok(!src.includes('_getHighwayCanvasAlias'), + '_getHighwayCanvasAlias must not appear in scene-init.js — dead alias was removed in cut-17'); +});