Imported from asbjornu/org.bitbear.Plup.xrnx (
AGENTS.md). Install upstream withnpx skills add asbjornu/org.bitbear.Plup.xrnx. Copyright stays with the author.
AGENTS.md — org.bitbear.Plup
Renoise Lua tool that inventories outdated/broken plugins and upgrades them.
Environment
- Lua 5.4/5.5 (Renoise embedded). Pure-Lua only — no external or C modules. Vendor pure-Lua if a dependency is needed (xml2lua/LuaExpat won't load in the sandbox).
- Run the suite with
lua tests/run.lua(Homebrewluaat/usr/local/bin;export PATH=/usr/local/bin:$PATH). CI useslua5.1. - The test harness installs a strict metatable on
_G: reading an undeclared global errors. Alwaysrequirelibs; never read bare globals likeutf8— capture viapcall(require,"utf8"). - Lua patterns here have no
|alternation; use character classes ([%s>]).
Workflow
- Work in the
renoise/3.5.4Git worktree, which points to the path within Renoise this tool is installed into. - Before any edit or commit, verify the location. Run
git branch --show-currentand confirm it reportsrenoise/3.5.4, and rungit rev-parse --show-topleveland confirm it equals the Renoise install path (/Users/bitbear/Library/Preferences/Renoise/V3.5.4/Scripts/Tools/org.bitbear.Plup.xrnx). Themaincheckout under/Users/bitbear/Dev/...is the canonical repo mirror only — never edit or commit there. If the session started in themaincheckout, stop and switch to the worktree before touching any file. - Never change existing branches to point to a worktree. If you need a worktree, create a new branch.
mainshould always point to the canonical repository location, not the installation path of the tool or any other worktree directory.- Commit before considering the task done.
- Group commits logically by feature or fix.
- If the a fix applies to code added previously in the same branch, squash the fix into the original commit.
- Add tests for all new features to ensure correctness and high coverage.
- Commit messages: terse, no "the user" references. Keep the header at maximum 50 characters, repeat it in the body if truncation is necessary. Wrap the body at 72 characters.
- Commit with signature (
git commit -S).gpgis installed with Homebrew. - When addressing PR review comments, reply on each thread and then resolve
the thread and hide/minimize the addressed comment (GitHub
resolveReviewThreadandminimizeComment). Leave threads you did not address open for a human. - Keep
luacheckclean with the same command as CI, which lints every file (not justlib/*.lua tests/run.lua):luacheck . --exclude-files '.luarocks' --exclude-files 'lib/LibDeflate.lua' --exclude-files 'lib/slaxml.lua'. - When a spec reads or monkey-patches a global, declare it in
.luacheckrcunderfiles["tests/**"]: modules that are only read go inread_globals; modules whose fields a spec assigns (up_zip,up_song_xml,up_donor,up_midi) plusrenoisego inglobals(read-write), or CI fails with "setting read-only field".
Layout
main.luaentry → loadsup_ui;lib/up_*.luaare modules;tests/run.luais the headless suite (mocked Renoise).- Flow:
up_inventoryscans the song →up_matchingfinds candidates →up_swapswaps + transfers state →up_coreorchestrates →up_uidialog. up_songxml+up_xmlparseSong.xml(the.xrnsis a zip, read byup_zip).up_presetdecodes preset/ensemble names from opaque chunk data (with a base64 "looks-like-binary" guard).up_utilholds name/token analysis.
XML parsing
lib/up_xml.luais a thin pure-Lua tree builder over the vendored SLAXML engine (lib/slaxml.lua, MIT, committed directly intolib/because the LuaRocks rockspec is broken).up_songxml.parse_instrumentsusesfind_all(root,"Instrument")so<InstrumentGroup>nesting and attribute-bearing tags are handled structurally.
