Application Level Scripting Cleanup - #1188
Merged
Merged
Conversation
mfisher31
force-pushed
the
high-level-scripting-cleanup
branch
from
September 23, 2026 01:55
88a3951 to
26d2cd0
Compare
Phase 0 step 1 of docs/plans/session-scripts.md. Fixes what the scripting audit found broken on the app side and removes what was never wired up. Console - Implement the declared-but-missing ScriptingEngine::execute: expression probe, protected call with a debug.traceback handler, UTF-8 byte length, message-thread assert, errors returned as a juce::Result. - Give the engine a persistent console environment and history so state survives closing and reopening the console view. - Load the console prelude from the compiled binary data instead of the filesystem search path, which never resolved in dev builds. el.script.exec now raises on load failure instead of returning the message. - Stop swapping the global print per eval; override os.exit on a console-local os table rather than the global one. - Marshal Log messages to the message thread and guard the print buffer. - Fix the persisted console view name, accept the old misspelling, add F3. Bindings - Add Context:commands() to el.Context, resolved per call through the services, so el.command's existing Context.instance():commands() works. - Fix el.command calling a nonexistent strings.valid. - Make el/session.lua resolve the session per call instead of caching it. - Fix the missing comma in widget.hpp __props. DSP scripts - DSPScript::process now uses lua_pcall. Lua is built as C, so an error in a script's process had no handler and aborted the app. The script is disabled and the message kept instead. Restore the stack top after the call. - init/prepare/release go through the same protected path and return false on error; getLastError() exposes the message. - Make DSPScript::validate functional: instantiate in a scratch state and run init/prepare, four process cycles with audio and MIDI, and release; reject scripts that raise or produce non-finite output. Cleanup - Remove ScriptingEngine::L, State::builtins, EL_LUA_SPATH, Impl::scanDefaultLoctaion, scripts/commands.lua, the #if 0 vector.c, and two orphaned test snippets. addPackage and its searcher stay: both searchers coexist and extensions will register modules through it. - Note ScriptManager as test-only until extensions land; loosen the hard-coded script count in ScriptManagerTest to a lower bound. Docs - CLAUDE.md: add a Lua Bindings section (single entry point via el.Context, bind on the owner and resolve per call, no shortcut globals). - Plans: record the addPackage correction, the View-script compatibility pass, the reordered work list, and keep ScriptInstance/ScriptSource. Tests: new ConsoleTests suite; DSPScriptTest gains validate and process-error coverage.
mfisher31
marked this pull request as ready for review
September 23, 2026 04:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.