Repository navigation
Ruby files are indexed with symbols, calls and inheritance - #2157
VanshajPoonia wants to merge 31 commits into
Conversation
The Ruby lane parses with tree-sitter-ruby. Every parse runs in the bounded child first, so the child has to load the grammar as well. uv.lock is regenerated with uv 0.13.12 and keeps lock revision 5. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
A Ruby class holds its methods. Cut on every top-level symbol, a class would be one chunk however many methods it has. With unit_kinds only symbols of those kinds are units and the class lines stay leftovers. Lanes that pass none keep the chunks they had. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
A .rb file was chunked as text, so code.symbol, code.callers and code.impact had nothing to return for it. The lane reads classes, modules, methods, requires, call sites, superclasses and mixins, and the SQL handed to ActiveRecord. Its chunks and edges come from lane_units because the shared chunker and edge walker are in the extractor stamp. lane_units counts lines on LF as the parser does, keeps every Ruby line that holds text in a chunk, and binds a call inside a SQL string from the method around it. Its unit and caller lookups take one sweep each, so a class of many methods stays linear. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The language table, the lane guide, the architecture page and the plugin's place rule still described Ruby as text. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
The focused Ruby and extractor-stamp suites passed 64 cases. A separate probe reproduces three open findings. The second method loses its function chunk when it starts on the preceding method’s last line, a method installed on an instance is indexed on its class, and a SQL statement in a root-level Ruby file gets a native scope. Chunk · Method owner · SQL scope
…ll site
The tree hangs those words under node types `_VALUE_PARENTS` did not list, so
`in x if allowed`, `rescue retryable => e`, `class A < base`, `lookup::Entry`,
`class << target` and `END { flush }` recorded no site. A pinned `^(expr)` is
read, not bound. Words after `return`, `break`, `next` and `yield` sit in an
argument list and were already sites; the test keeps them.
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
In an instance method or a `define_method` block `self` is an instance, so
`def self.x` and `class << self` there define on one object and name no class
method. An eval block defines on its receiver: `Store.class_eval { def x }` is
`Store#x`, `Store.instance_eval { def x }` is `Store.x`, and an eval on a
variable names nothing, as `class << obj` already did.
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`_top_level` read a unit starting on the previous unit's last line as nested, so `end; def second` folded `second` into the first chunk and left its other lines as an `other` chunk. Such a unit now has its own chunk, sharing that one line, and a comment above it belongs to the earlier unit. A unit wholly on the shared line still rides the earlier chunk. The other lane_units lanes cut the same chunks as before over the 21 lane fixtures and about 3,800 proto, thrift, gotemplate, hcl, k8s, jsonnet, lua and graphql files. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`code_sql_units` qualified statements and created objects with `module_scope`, which leaves a root file's scope undotted, so the name gate read them as native while the file's methods stayed script. The island grammar names the scope (`ruby_scope` for Ruby) and the units carry it, so the edge stage and the lane corpus name each statement as the parse did. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`test_no_new_tunable_constant` failed CI on `lang_ruby._MAX_DOC`. Like the other lanes' cuts it shapes every stored doc_comment, so it carries the `# not a setting:` reason instead of joining the shrinking list. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…rows The committed translations check matches table cells by position. Ruby above the Protocol Buffers row moved that row, so the zh-CN page failed on its protected names. Below Lua it shifts no row that holds one. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…y it `_scope_dialects_for` keyed each defining file's dialect by `module_scope`, and `narrow_by_dialect` looks a candidate up by the scope in its qualified name. A root Ruby file's table is now `root.<name>::t`, so the two never met. The map is keyed by each candidate's own scope. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`Point = Struct.new(:x) do def norm; end end` inside `module Geo` indexed `Geo#norm`, a method Geo does not have. The block's defs are now `Geo::Point`'s, for `Struct.new`, `Class.new`, `Module.new` and `Data.define` assigned to a constant. One no constant names holds nothing the index can name, as an eval on a variable. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…file's other fakes do A type: ignore on the call hid what the fake stands in for. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`_enclosing_by_line` skipped the statement symbol but not the objects it creates, which share its span. An interpolated call in `CREATE TABLE` or `CREATE FUNCTION` bound from the table or the SQL function. The SQL's symbols follow the lane's own in the parse, statements first, so the walk stops at the first statement; a one-line method holding a statement keeps its calls. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
At the repository rung `bind_sites` kept the caller among the candidates, so `class Admin::User < ::User` saw two `User` definitions and bound neither. Nothing inherits from itself, so an `inherits` site drops the caller there, as the same-file rung does. The thrift and GraphQL `inherits` rules lose nothing: a service or interface never names itself. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…ould land The reader's context said where a plain `def` lands but not what `self` is, so `class_eval` in a method of `class << self` defined singleton methods. In that method `self` is the class and Ruby defines instance methods. The context now names `self` as a class, a singleton class or an instance, and an eval with no receiver reads it. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
The builder match read the receiver's text, so `::Struct.new` missed, and it took the name only from a direct `=`. `Frozen = Struct.new do … end.freeze` and `Lazy ||= Class.new do … end` named nothing. The receiver is read as a constant and the name is taken through calls chained on the block and `||=`. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…arget Every word under a `left_assignment_list` became a local, so after `helper.value, rest = 1, 2` the method `helper` was no site anywhere in the method and `value` read as a call. The walk binds only plain names, splats and nested lists, and an attribute or element target is a write whose receiver is read. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
An island took its line from the string node, which for a heredoc is the marker. `execute(<<~A, <<~B)` put both statements and the tables they create on the body of A. The island grammar names the line a string's text runs from, and Ruby reads a heredoc's from its body. Go and Java keep the node's line. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`reference_sites` ran to four lines and `_scope_dialects_for` to five. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
A `CREATE FUNCTION` lifted from a heredoc in a class body is a `function` symbol, so `span_chunks` cut it out as a unit and split the `execute` call around it. Units now come from the lane's own symbols, the same cut the caller sweep makes. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
…hing else The walk up from a builder followed every chained call, so `Origin = Struct.new(:x) do … end.new(0)` gave `Origin#o` though `Origin` holds an instance. It follows only `freeze`, `tap` and `itself`, which return the class. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Its comment narrated the text lane the Ruby lane replaced. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`_string_line` returned the tree's Any, which the gate counts as a new error. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for the probe that reproduced the chunk, method owner and SQL scope findings. Each finding has a test that failed before its fix and passes now. Two review passes over the fixes found the rest of the list below.
3acdaa5 is worth a look on its own. At the repository rung CI on 16ca9ce had two failures of ours. Left as they are:
Tests: |
zlareb1
left a comment
There was a problem hiding this comment.
The shared-line chunk and root SQL scope fixes are present. The relative eval owner finding is reproducible. In Ruby, calling Item.class_eval inside Outer installs the method on Outer::Item. The index currently drops Outer from the owner.
zlareb1
left a comment
There was a problem hiding this comment.
The exception-text gate flags the worker setup preview and register handlers on this run and on its clean base. The same gate passes on current main with the merged fix. Failed job · Fix #2163
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`Item.class_eval`, `def Item.x` and `class << Item` inside `module Outer` read `Item` as a top-level name, so the methods landed on `Item` and not on `Outer::Item`. Ruby looks a constant up from the innermost namespace out. The reader now takes the first namespace whose class this file defined above the reference, else the innermost one. `::Item` stays the top level. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`ActiveRecord::Base.class_eval` inside `module MyGem` gave `MyGem::ActiveRecord::Base#x`. A path whose first name the file does not define names a library class, so it keeps the name as written. A lone name the file never defines still takes the innermost namespace. A path whose first name an enclosing namespace defines resolves from there. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for the re-reviews and for tracing the two red jobs back to their base.
Drafted with AI help and reviewed by me manually. |
zlareb1
left a comment
There was a problem hiding this comment.
The Ruby site walk still puts block parameters in the enclosing method scope and keeps the outer class as the owner inside singleton definitions. Both cases change which call edges the index emits. Block scope · Singleton constructor
Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
A block or lambda parameter, and a name the body assigns, were stored as locals of the enclosing method, so a bare call anywhere in the method was dropped. A rescue variable did the same. Each now lives in a scope of its own that its body reads through to the scope around it. A name a rescue body assigns still belongs to the method. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
`def Const.m` and `class << Const` left the enclosing class as the owner, so a bare `new` or `self.new` bound to the outer class, or was dropped when there was none. The site walk now reads the owner from the definition. An object that is no constant names nothing, and `self` keeps the class around. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
Ruby keeps the name bound in the enclosing scope once the clause has run, and reads it as a method before the clause. The site walk now drops a bare read of it from the clause's line on and keeps one above it. Signed-off-by: Vanshaj Poonia <vanshajtheunique@gmail.com>
|
Thank you for the review and for naming the two Bugbot threads.
Drafted with AI help and reviewed by me manually. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
Reviewed by Cursor Bugbot for commit 3a3ed66. Configure here.
| sig += f" < {_squash(node_text(sup.named_children[0], self.source))}" | ||
| kind = KIND_CLASS if node.type == "class" else KIND_MODULE | ||
| self._add(f"{self.scope}::{'::'.join(inner)}", parts[-1], kind, sig, node, doc) | ||
| return inner, False, _CLASS |
There was a problem hiding this comment.
Qualified class paths ignore lookup
Medium Severity
_namespace always prefixes class and module paths with the current nesting, unless the path is rooted. class A::B inside module M is stored as M::A::B, even when A is an outer class or a library. _owner looks that same path up from the inside out and, when the file never defines it, keeps it as written. Definitions and later class_eval / def owners then disagree with Ruby, so symbols land on a phantom class.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3a3ed66. Configure here.
| self._namespace(node, scope) | ||
| name = node.child_by_field_name("name") | ||
| parts = _const_parts(name, self.source)[0] if name is not None else [] | ||
| return node.id, parts[-1] if t == "class" and parts else "" |
There was a problem hiding this comment.
Class headers use the new scope
Medium Severity
Entering a class or module switches the site scope to that node before its children are walked, and the new scope has no parent link. The superclass expression is evaluated in the enclosing scope in Ruby, but a bare word there is filtered with the class body's locals. An outer local is reported as a call, and a name assigned in the body hides the superclass word.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3a3ed66. Configure here.
| return "mysql" | ||
| if "sqlite" in low: | ||
| return "sqlite" | ||
| return "" |
There was a problem hiding this comment.
Parenthesized requires miss SQL dialect
Medium Severity
ruby_file_dialect scans source with a regex that only matches require plus whitespace plus a quote. require("pg"), require "pg" without a space, and %q forms never match, so the file's SQL islands get no postgres, mysql, sqlite, or clickhouse default. The AST include reader already accepts those call shapes.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3a3ed66. Configure here.
zlareb1
left a comment
There was a problem hiding this comment.
The current extractor gives qualified class declarations a different owner from constant lookup, and its SQL dialect detection misses parenthesized requires. Please address the verified cases in the class owner thread and SQL dialect thread.


Closes: #2120
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The code index parses Ruby (
.rb,.rake,.gemspec,Gemfile,Rakefile). Classes, modules and methods are symbols, superclasses and mixins areinheritsedges, calls andrequireare edges, and the SQL handed to ActiveRecord is lifted as statements. A namespace gets these rows for files it already holds withloom code backfill --paths-fileover its Ruby files. New and changed files use the parser from the upgrade on.Why
A
.rbfile was indexed as text.code.searchandcode.grepfound it.code.symbol,code.callersandcode.impactreturned nothing for it. The 26 Ruby files undersdk/ruby/had no symbols while the Go, Rust, Java, Python and TypeScript SDKs beside them did.The lane reads Ruby with
tree-sitter-ruby(0.23.1, MIT, abi3 wheels for macOS, Linux and Windows). It is a new entry in thecodeextra and inbounded_parse._LOADERS, so every parse still runs in the bounded child first.Alternatives:
%literals, command calls without parentheses anddo/endblocks that share keywords with modifiers. A scanner would misread all of them.scip-ruby. Out of scope, and it would not replace a fast tier.Scope and risk
lang_ruby.pyis listed inNON_EXTRACTOR_MODULES. Chunks come fromlane_units.span_chunks, one per method, and edges fromlane_units.bind_sites, which is how the tree-less lanes work.span_chunksgains aunit_kindsargument so the units are methods and not the class around them. Other lanes pass none.otherchunk however short: a class line, a lonehas_many :comments, a constant, a Gemfile'sgem "pg". A gap of blank lines is in no chunk, socode.symbolreturns a method's body and answers a class or module with its span to read. The 26 files ofsdk/rubygive 792 chunks where the text windows were 86, and no line with text is left out.<file scope>::A::B#namefor an instance method and<file scope>::A::B.namefor a singleton one (def self.x,class << self, anddef Const.xorclass << ConstasConst.x, withConstread from the innermost namespace out).class A::Band nested blocks give the same name. The file scope is always dotted (root.for a file at the top), because the name gate reads a scope without a.as native. The SQL statements and created objects of a Ruby file take the same scope.class X < Yandinclude,extendandprependof a constant. They bind asinheritsedges to a class or a module, same file at 1.0 and repository-unique at 0.6. At both rungs the caller is no candidate, soclass Admin::User < ::Userbinds to the other file'sUser. This holds for every lane'sinheritsrule.Const.newbinds toConst.newandself.newbind to the class around them, and insidedef Const.xorclass << ConsttoConst.@app.call(env)insideOuter#calldoes not bind to anInner#callof the same file. A name in a list of Ruby core, Rails and RSpec methods (save,update,puts) is a site only when called onselfor on nothing, and then binds only to a method of its own file. A bare word is a site only when no scope around it holds a local variable of that name: parameters and the names a pattern binds count, a block or lambda keeps its own parameters and assignments, a rescue variable counts from its clause on, and a parameter's default value is read. It binds only inside its own file, so the index is not asked for it.lane_units.bind_sitesbinds a site inside a SQL statement's span from the method around it, not from the statement or the table or function it creates. Those symbols follow the lane's own in the parse, statements first, andspan_chunkstakes no unit from them either. A qualified name written twice in one file is one same-file target: a Ruby class reopened, and in the other lanes a repeated definition (a Lua function written twice, a protobuf message declared twice), which recorded no edge before. Statement symbols reachbind_sitesonly from Ruby.lane_unitsand chunk-stage changes reach the other lanes. A unit that starts on the last line of the previous one and runs past it (end; def b) is its own chunk, sharing that line, where it used to fold into the earlier chunk. Compared chunk by chunk, none moved over the 21 lane fixtures and about 3,800 proto, thrift, Go template, HCL, Kubernetes, Jsonnet, Lua and GraphQL files. Lines are counted on\nalone, as the parser andchunker.chunk_filecount them: a form feed or a U+2028 used to start a new line in the chunks only. A lane file whose parse failed is cut into line windows, as any other language's, instead of span chunks with no units. The symbols a unit holds are found by bisection, andbind_sitesfinds the caller of every site in one sweep over the spans. Both grew with units or sites times symbols: a class of 8,000 methods took 4 s to chunk. It now takes 0.08 s to chunk and 0.09 s to bind its 32,000 sites. Over the 39 lane files of the corpus andsdk/rubythe sweep picks the same caller as before for each of 7,401 lines, andexpected.jsondoes not move.attr_*methods,aliasandalias_method,define_method, constants, and the classStruct.new,Class.new,Module.neworData.definebuilds. The methods in that call's block belong to the constant it is assigned to (Point = Struct.new(:x) do … endgivesPoint#norm), and to nothing when no constant holds the class. A method defined on an object names nothing:class << obj, an eval on a variable, anddef self.xorclass << selfinside an instance method or adefine_methodblock, whereselfis an instance.X.class_evaldefines in X,X.instance_evalon X itself, and an eval with no receiver on whatselfis. A relativeXis the class of the innermost namespace around the call whose definition the file holds above it. When the file holds none, a loneXtakes the innermost namespace and a pathA::Bis read as written. A method defined inside any other block is qualified by the class or module around the block. A call outside any method or class (a raketaskbody, a top-level RSpec block) has no caller symbol, so it records no edge.code.callerson a Ruby class folds in none of its methods, and the dispatch walk finds no base for a Ruby method. Both readClass::member, and the method names follow the issue (A::B#x,A::B.x).require "a/b"resolves under the file's directory and each ancestor, and under theirlib/.require_relativeresolves beside the file. A gem or a stdlib name resolves to nothing.find_by_sql,execute,select_all,whereand the other ActiveRecord and pg methods inRUBY_CLIENT_METHODS, with heredocs read.fetch,runandgroupare left out: over the 3,522 Ruby files of a large open-source Ruby code base they readENV.fetch("USER")and a pretty printer'sgroupas SQL. Without them the same files give 1 island, and it is a real query.code_sql_unitsqualifies statements with the scope the island grammar names (ruby_scopefor Ruby,module_scopefor Go and Java), and the edge stage reads it from the units._scope_dialects_forkeys a file's dialect by each candidate's own scope, which TypeScript islands read when a table name has several definitions. A Ruby heredoc's statement starts on its body's line, which for the second heredoc of a call is below the first..rb,GemfileandRakefileleave the text list inlang_text.py, and.rakeand.gemspecare new. A Ruby method is now afunctionchunk, so thefunctions_firstranking applies to Ruby. The architecture page says so.hooks/HOOKS.mdand the plugin page stop calling Ruby text. That is a wording fix with no behaviour change, so the plugin versions stay.ingest_resolvesends a language that is in bothCODE_ISLAND_LANGSandLANE_UNIT_LANGSthrough the lane's resolver. Ruby is the only one.Compatibility, rollout and rollback
Wire: none. No op, setting or migration.
Operator steps: the
codeextra gainstree-sitter-ruby>=0.23, which the image takes fromuv.lock.uv.lockwas regenerated with uv 0.13.12. It keeps lock revision 5, as main's lock has, and CI's uv 0.12.19 passesuv lock --check. After the upgrade a namespace keeps its text chunks for Ruby files that do not change. Re-ingest them:A deployment without the grammar records the parse failure on each Ruby file and indexes it as line windows without symbols.
Rollback: reverting reads Ruby as text again. Rows the lane wrote stay until a file is ingested again or a backfill reads it.
Tests
tests/unit/test_code_lang_ruby.py(51 tests, 61 cases) covers nesting and names, the owner of a method defined in an instance method, an eval block or aStruct.newblock, a relative or qualified constant in an eval,def Const.xandclass << Const, block, lambda and rescue scopes for bare words, andnewin a singleton definition, bare words under guards, rescue lists and superclasses, multiple assignment targets, a method that starts on another's last line, the scope and lines of a root file's SQL, calls inside SQL that creates objects, a subclass named like its base, doc comments (includingprivate defand a trailing comment), requires, call sites by receiver, locals shadowing a bare word (parameters, defaults, patterns), common names called onself, a reopened class, a call inside a SQL string,new, binding at each rung and for ambiguous names, superclass and mixin edges, require resolution, detection and the text list, chunks per method with every line that holds text covered, LF line counting, the line windows of a failed parse, the SQL islands including a heredoc, the ingest reads for chunks, includes and edges, and linear time for parsing, chunking and binding. A test intest_code_proto_gotemplate_lanes.pycoversunit_kinds.tests/fixtures/code_lanes/ruby: a gem with a mixin, a subclass, singleton methods, requires, a rake task, a gemspec and ActiveRecord SQL bound to a table.expected.jsongains 10 files and 33 edges, each row checked.lane_unitslane (proto, thrift, Go templates, HCL, Kubernetes, Jsonnet, Lua, GraphQL), the corpus and its manifest, the extractor stamp, the chunker, ingest errors, lanes and dependents, the Go, Java, Python, shell and host islands,lang_text, the kind prior, the plugin query contract, the name gate, and the doc tests (test_doc_links.py,test_public_copy.py,test_docs_reference.py,test_agent_instructions.py). 1,170 passed and 1 skipped.pytest tests/analyzer/test_corpus.py -k "not live"passes (10 passed, 2 skipped). The plugin'shooks-docandprompt-packnode tests pass (40).ValueError: current limit exceeds maximum limit:test_a_registered_lane_costs_linear_timefor every lane (27, Ruby among them) and 5 memory-limit tests intest_code_parse_deadline.py. The same tests fail the same way onupstream/mainhere. The registry cost walk for Ruby ran in process with the same checks: 82 shapes and none over linear.scripts/gates/mypy_gate.pyreports 0 errors.scripts/gates/function_length_gate.pyis at its baseline.ruff check,ruff format --checkandcheck_no_secrets.pyare clean, and so are all 16scripts/codegen--checksteps ofmake lint. Prettier 3.9.9 is clean on the edited pages. uv 0.12.19 and 0.13.12 both passuv lock --check.sdk/rubygive 28 modules, 259 classes and 640 methods with no parse error. The 3,522 Ruby files of a large open-source Ruby code base parse with no error in 33 seconds, with symbols and SQL islands.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the diff and ran the checks listed under Tests.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
Medium Risk
Large new parser lane plus shared
lane_unitsand edge/chunk ingest behavior affects allLANE_UNIT_LANGSfiles; rollout depends on backfill and the new grammar dependency.Overview
Adds first-class Ruby indexing via a new
lang_ruby.pylane andtree-sitter-ruby(stamped extractors unchanged)..rb,.rake,.gemspec,Gemfile, andRakefileare detected and parsed; Ruby is removed from the text-only fallback inlang_text.py.Ruby uses the
LANE_UNIT_LANGSpath: one method chunk per file (span_chunkswithunit_kinds), call /new/ heritage / bare sites bound bylane_units.bind_sites,requireincludes, and ActiveRecord-style SQL islands joined at ingest like Go/Java. Ingest registers_parse_ruby, extendsCODE_ISLAND_LANGS, and wires lane include resolution separately from tree-sitter import resolution.Shared lane/ingest fixes that land with Ruby:
SiteRule.caller_countsand reopened-class binding;unit_kinds/ keep-all leftovers for method-only chunks; parse failures fall back to line windows for lane-unit langs;_lane_site_edgesonly queries repo-wide names when rules allow;_scope_dialects_forand code-SQL edges use each file’s named scope fromCodeSqlUnits.scope(important for dottedruby_scopeand dialect narrowing).Docs and plugin copy now describe Ruby as a parsed lane (method chunks, inherits, SQL islands). Operators need the updated
codeextra and a targeted backfill on existing Ruby paths to replace old text chunks.Reviewed by Cursor Bugbot for commit 3a3ed66. Bugbot is set up for automated code reviews on this repo. Configure here.