Add Lua language and tools support#1894
Open
LK4D4 wants to merge 1 commit into
Open
Conversation
Teach rtk read and smart summaries to recognize Lua source files so comment stripping, function extraction, module shape, and import extraction use Lua syntax. Improve Lua rtk smart output for agent triage: capped function counts are marked explicitly, exported module tables are separated from local implementation tables, public module methods and constructors outrank helper functions, Busted specs summarize describe/it behavior instead of mock helpers, and require dependencies are grouped into internal versus external buckets with stable ordering. Add compact luacheck and busted handlers, wire them through CLI parsing and command discovery, and cover the Lua filters and smart-summary heuristics with focused routing, savings, and summary tests. Deliberately skip a lua or luajit interpreter wrapper because raw program output is arbitrary passthrough and does not provide meaningful token savings.
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.
Summary
This adds Lua support to RTK:
rtk luacheckandrtk bustedcommand proxies, with trailing argument forwarding and compact filtered output.rtk smart/ local LLM code summaries for Lua so agents get useful triage signals: module vs function/spec summaries, exports and locals, Busted spec cues, and dependency classification.Why
Lua-heavy repositories currently fall through more generic handling even though the outputs are very compressible and common in agent workflows. This branch makes the Lua paths explicit so lint/test output and code-summary reads preserve the high-signal parts an agent needs while dropping repetitive noise.
Project-scope RTK evidence from my Lua project:
rtk luacheck --codes ...: 85 runs, 129.2K tokens saved, 99.4% average savingsrtk busted spec: 85 runs, 9.6K tokens saved, 94.4% average savingsI also added some guidance to use
rtk read -l minimalandrtk read -l aggressiveand seeing some good savings too.rtk smartis not as useful for my project but could be useful for other.Validation
rtk cargo fmt --all --checkrtk cargo clippy --all-targetsrtk cargo test lua-> 21 passed, 1876 filtered out$env:PATH='C:\Program Files\Git\usr\bin;' + $env:PATH; rtk cargo test --all-> 1891 passed, 6 ignored