Skip to main content

Crate brokk_bifrost_ruby

Crate brokk_bifrost_ruby 

Source
Expand description

Ruby language knowledge for Bifrost.

Internal implementation detail of brokk-bifrost; no stability guarantees – depend on brokk-bifrost instead.

This crate sits between brokk_bifrost_core and brokk-bifrost-analysis. It holds Ruby language knowledge – the declaration walk, require / autoload / Zeitwerk visibility, mixin and dispatch-mode facts, the structural spec, test detection, semantic diagnostics, and the usage-graph forward and inverted scans – as plain functions and data. It depends on no other Bifrost crate than core, so nothing here may name IAnalyzer, TreeSitterAnalyzer, or RubyAnalyzer.

Where analysis code would reach for an analyzer handle, the functions here take graph_support::RubySource – a core brokk_bifrost_core::analyzer::CodeUnitIndex plus the memoized Ruby products the language logic resolves through. analyzer/ruby/ in brokk-bifrost-analysis keeps the shim: the RubyAnalyzer struct with its three moka caches, nine OnceLock cells and one PoolSafeMemo, the accessors that satisfy those traits, the RubyAdapter forwarding shell, the SPI block, and the downcasts that produce the arguments.

Modules§

adapter
The Ruby answers behind RubyAdapter.
declarations
diagnostics
Ruby’s semantic diagnostics: proof-gated unresolved-constant reporting.
graph
Ruby’s usage-graph scans: the per-symbol forward scan (extractor/hits) and the whole-workspace inverted per-file walk (inverted), both resolving references through resolver – the shared Ruby resolution library the definition route also reads.
graph_support
The analyzer-resident products Ruby’s language logic resolves through.
hierarchy
Ruby’s type-hierarchy resolution.
imports
Ruby’s load-path knowledge: require/require_relative/load/autoload parsing and resolution, the autoload constant edge collector, and the Gemfile-driven Zeitwerk conventions.
mixins
Ruby’s mixin facts: the parser-side extraction of include/prepend/ extend arguments out of a class or module body, and the encode/decode pair that round-trips them (together with the true superclass) through the analyzer’s persisted supertype_lookup_paths column.
queries
Ruby’s bundled tree-sitter query assets.
structural
Ruby structural spec for query_code.
syntax
Pure Ruby node helpers shared by the declaration walk, the structural spec, the import binder and both usage-graph scans.
test_detection
Ruby test-file recognition and test-assertion smell detection.