Skip to content

Latest commit

 

History

History
452 lines (327 loc) · 33.5 KB

ROADMAP.md

File metadata and controls

452 lines (327 loc) · 33.5 KB

Scalex — Roadmap

Pending

README refresh

  • Simplify the introduction, installation, and examples; document Codex and Claude Code plugin upgrades and correct outdated capability claims

Release 1.41.0

  • Prepare the dated changelog and application version for the release PR
  • Merge the release PR, then tag and publish native binaries
  • Update plugin versions and checksums from the published release assets
  • Fix combined release checksum generation: the current path-stripping command also removes hashes; individual .sha256 assets are valid

Faster PR checks

  • Cache dependency downloads and Mill build outputs with toolchain-aware keys, preserving all test and native checks
  • Validate cold and restored-cache runs: 4m04s → 1m45s on the same commit, with all 505 tests and native smoke checks passing

Symbol diff correctness (#366)

  • Reproduce line-shift false positives, missed body edits, ignored path filters, and the silent file cap in regression tests; also reproduce collapsed overloads and same-named methods in different owners
  • Compare declaration content independently of source position, preserve owners and overloads, apply file filters before analysis, and limit display rather than examined files
  • Validate nine diff regressions, all 505 tests, native issue reproductions, and performance: unchanged 41,121,631-byte index, cold indexing +2.3% within budget, warm indexing −4.5%, definition −2.1%, references +1.2% within observed run variability

Shared skill redesign

  • Replace the long command tutorial with concise query selection and evidence interpretation; consolidate detailed syntax in the command reference and validate shared packaging (frontmatter, links, 496 tests, and benchmark compilation)

Native parsing parity and measured query performance

  • Reproduce and fix native-only Java parse failures, with a native regression check (492 JVM tests; full-workspace native/JVM parity)
  • Reuse deserialized file paths and avoid full name-map construction for simple isolated lookups; preserve reusable indexes for qualified/composite/batch queries
  • Reuse reference confidence, sort keys, and classification patterns without changing results
  • Measure complete requests and command/render phases without double-counting nested timings
  • Document opt-in native heap tuning; keep portable defaults unchanged
  • Validate native/JVM parity, 496 tests, and separate before/after performance measurements: definition latency −47%, references −46%, unchanged cache size, cold indexing within the 5% budget

Architecture and reliability cleanup

  • Upgrade Scala, Mill, libraries, and formatting tools to the latest stable releases and validate compatibility

  • Preserve valid JSON under output budgets; route summaries and diagnostics through typed command results

  • Propagate Git failures and CLI usage errors with structured diagnostics and nonzero exit codes

  • Construct immutable, ready-to-query workspace index snapshots

  • Separate query filters, output options, and command options; centralize command metadata

  • Organize Git, persistence, scanning, extraction, models, and rendering by responsibility with explicit ownership

  • Strengthen regression and process-level tests; use a standard test-only JSON parser

  • Make temporary test repositories independent of global Git identity and signing settings

  • Run tests, fatal-warning compilation, and shared skill validation in PR CI

  • Consolidate contributor/build documentation and normalize Scala brace/import conventions

  • Validate all 491 tests, fatal-warning compilation, formatting, and native CLI smoke checks

  • Benchmark the latest build separately: cold index, warm index, query latency, cache size, CPU/allocation profiles, and native GC

  • Codex CLI and desktop plugin packaging, marketplace installation, and shared skill validation (local install verified with Codex CLI 0.153.4)

  • Publish Codex marketplace changes and verify installation from GitHub; optionally submit to OpenAI's public plugin directory

  • Publish plugin to Claude Code marketplace

Simplicity review: remove dead code and single-use abstractions (no behavior change except noted)

  • graph module: delete dead library surface (EdgeType/connections, CrossingCalculator, OccupancyGrid, GraphUtils.topologicalSort/hasCycle, six unused Graph methods, QuadTree.collisions, Utils.removeFirst/signum, misc dead members)
  • graph module: collapse single-implementation abstractions (Lens machinery, VertexRenderingStrategy, LayoutPrefs/RendererPrefs trait tower, redundant renderGraph overload); replace the twelve per-character renderer defs with three indexed glyph strings; fix swapped lineHorizontalChar/lineVerticalChar names; Direction as Scala 3 enum
  • Bug fix: Diagram parsing drops sibling nested boxes (boxContains keyed .toMap by outer box keeps only the last pair); each box now links to its smallest container (regression test added)
  • Perf fix: collectText rebuilds the all-edge-labels point set once per scanned character; hoisted to a parser-level lazy val
  • src/: delete parallel types (AstPatternMatch → reuse SymbolInfo; dead CategorizedRef; OverviewData.hubTypes → derive from mostExtended; dead SymbolList.total/StringList.total; dead TestCaseInfo.suiteName/suiteFile; HierarchyNode holds Option[SymbolInfo] instead of four parallel Option fields; explicit CmdResult.Silent replaces the empty-StringList sentinel). Behavior change: ast-pattern --json gains parents/typeParamParents/annotations fields (now shares jsonSymbol)
  • src/: fold duplicated logic (index() cached/uncached parse branches, tier-ranking behind search/searchFiles/owner-scoped suggestions, findImplementations branches, cmdGrep result-building arms, grepInSymbol per-body file re-read, renderOverview concise/full print blocks, renderCategorizedRefs triple confidence resolve, extractRawSymbols type-defn arms, fixPosixRegex fallback, jKindCounts/InheritedGroup shared fragments)
  • Micro-cleanups: identical if branches (requiredWidth), identical catch arms, var→val, pass-through aliases/wrappers, hand-rolled stdlib equivalents
  • Net: −443 lines across 29 files; deferred as not worth the churn: KinkRemover mirror-case helper (delicate choreography), gitShowFile/runGitLines unification (semantic differences in a perf-tuned area), TestCaseResult/TestSuiteResult merge, SymbolKind.id vs ordinal (persisted-format decoupling is deliberate)

Dedup refactor: extract reusable units across src/ (no behavior change except noted)

  • JSON emission helpers (jStr/jArr/jStrArr/jOpt/jsonMemberFields/jsonBodyFields) replacing ~50 hand-rolled jsonEscape interpolation fragments in format.scala
  • Bug fix: grep --json emits invalid JSON when the auto-corrected pattern contains \ or " (unescaped "corrected" hint in cmdGrep)
  • overview --architecture/--concise reads imports from the index (WorkspaceIndex.fileImports) instead of re-parsing every file from disk; reuses parseImportTarget instead of the hand-rolled lastDot package split (~3.7s → warm-query latency on scala3)
  • Deadline-scan chassis (DeadlineScan): one shared parallel file-scan (deadline + result queue + unreadable counter + stderr report) behind grepFiles, findReferences, findImports; behavior fix: per-line deadline expiry now sets timedOut in all three
  • Shared path/test filter predicate (pathPredicate) behind filterSymbols, filterRefs, grepFiles, astPatternSearch, cmdTests
  • requireArg helper for the 21 identical args.headOption match … UsageError command preambles
  • buildMultiIndex helper for the inverted lazy indexes (parentIndex, typeParamParentIndex, annotationIndex); distinctBy for distinctSymbols
  • Shared name-match tier classifier (nameMatchTier) behind search, searchFiles, mkOwnerScopedSuggestions
  • Context-window slicing helper + readSourceLines reuse in format.scala (fixes renderSourceBlocks reading the same file twice)
  • Numbered source-line printer + member-line formatters; behavior change: line numbers uniformly left-aligned (refs -C previously right-aligned)
  • renderShown truncation-footer helper across the render sites
  • Java extraction helpers (javaParams, javaMethodSig, javaFieldInfo, javaLine, addBody) deduplicating symbol vs member vs body extraction
  • findTypeDefs shared type-definition lookup across members/body/def/inherited-member collection
  • Shared constants: refCategoryOrder, Confidence.label/explanation, wildcardImportPkg, SymbolKind.label; one recursive hierarchy printer for both directions
  • Policy/layering: removed return from bench.scala; graph-command flag strip-list derived from scalexFlags registry (fixes graph --render … --limit 5 corrupting the edge list); not-found hint computed in cmdCoverage instead of the renderer
  • Guard tests: structural JSON validator sweep over every --json command; locks on search ranking, overview package deps, Java signature consistency, truncation footers, context rendering

clibase: reusable CLI base module + graph module extraction

  • New clibase Mill module — app-agnostic CLI plumbing: declarative flag registry (declare a flag once: names, value shape, default, help), single-pass lenient parser (unknown --long flags ignored), typed Flags bag, generated options help, Timings, OutputBudget (line-boundary truncation), BatchLoop (stdin REPL)
  • Migrate scalex onto clibase: delete ParsedFlags, the hand-written parser match, and the hand-written options help; each flag declared once in src/flags.scala; CommandContext built in a single place (flagsToContext)
  • Extract the self-contained asciiGraph package (src/graph/) into its own graph Mill module
  • Behavior change: when both -w and --workspace are passed, the last occurrence wins (was: --workspace always won)
  • Behavior fix: --expand without a numeric value no longer consumes a following flag

Maintainability refactor (internal, no behavior change)

  • Unify the duplicated member-extraction traversals (extractScalaMembers / extractMembersWithSpans) behind one origin-tagged core (extractScalaMemberTree)
  • Factor the repeated body-slice blocks in extractScalaBody into a single addBody helper with a TypeDefn extractor
  • Deduplicate the Scala 3 → Scala 2.13 parse fallback into parseSource; add readSource/readSourceLines helpers
  • Rewrite parseFlags as a single position-aware pass — fixes positional args being dropped when they equal a flag value elsewhere in the arg list
  • Return timedOut from findReferences/findImports/categorizeReferences as a value instead of a shared mutable field on WorkspaceIndex
  • Close git subprocess readers (Using.resource); shared runGitLines helper; survive a missing git binary
  • Report the cause when the binary index fails to load (ClassName: message) instead of a generic message
  • Remove all 34 return statements from src/ (boundary/break or restructuring); zero-return policy now holds codebase-wide
  • New tests: cache corruption/truncation/version-mismatch recovery, refs timeout reporting, flag-parser regressions, member-origin extraction

Mill build migration

  • Add Mill build definition for Scalex CLI and tests
  • Move local/native build commands from scala-cli to Mill
  • Update docs and scripts to describe Mill workflows

Community feedback: output budgets & package-scoped refs (#252)

  • --max-output N global output budget — truncate any command's output at N characters with pagination hint; wraps render() centrally via BudgetPrintStream in runCommand; also serves as per-query budget in batch mode
  • --in-package PKG — filter symbols and references to files whose package declaration matches prefix; applied in filterSymbols and filterRefs; cheaper than --path for cross-compiled projects where package != directory
  • Deferred: --format agent compact output — maintenance burden of dual formatters across 25+ renderers; --max-output + existing --brief/--shallow/--no-doc flags cover the same need
  • Discarded: stale symbol hints in explain — false positives (cross-repo impls, macros) waste more agent tokens than they save; agent can run impl + refs directly
  • Deferred: members --diff <ref> — medium effort, niche; diff + git diff already cover this well

Scoped body grep per method (#253)

  • grep --in <Type> --each-method — iterate members of a type, grep each method body for the pattern, report which methods matched with counts; combines extractMembers + extractBody + regex match in a single command

Concise overview mode (#248)

  • overview --concise — fixed-size summary (~60 lines) regardless of codebase size; compact header, inline symbols, top packages, dep stats (not full graph), hub types, drill-down hints; implies --architecture

Bug fix: Owner.Member dotted syntax fails for nested classes (#239)

  • Owner-qualified fallback in findDefinition — resolves Outer.Inner by finding owner type, then filtering symbols by same file; fixes members, hierarchy, def, explain automatically
  • impl Outer.Inner — verify owner exists via findDefinition, then use simple name for parentIndex lookup; return Nil for unknown owners
  • body --in Outer.Inner — extract simple name from dotted --in owner for extractBody
  • Centralize resolveDottedMember() — not needed; findDefinition fallback makes it a dead path for type members; still useful for non-type members (defs/vals inside objects)

Bug fix: explain --related resolves stdlib names to unrelated project types (#228)

  • Hybrid isStdlibType check: minimal predef set (Option, List, Map, etc.) + package-based filtering via index for non-predef names
  • Project-defined types with library names (Task, Stream, IO, etc.) correctly surface; only Scala predef auto-imports and unindexed stdlib types are suppressed

Community feedback: agent exploration improvements (#221)

  • Better hub detection in overview --architecture — deprioritize types not defined in the indexed source (java., scala., scala.collection.*); rank project-defined types higher using index membership check; extends existing isStdlibParent filter
  • explain --related — extract type names from member signatures (param types, return types, field types), cross-reference with index to find definitions, list as "Related types" section; cuts agent exploration round-trips in half
  • package --explain — composite mode: run explain --brief for each definition in the package; batch-style output (definition + top members + impl count per type); single command replaces N sequential explain calls

Graph rendering and parsing

  • Port ascii-graphs library to scalex as graph command
  • graph --render "A->B, B->C" — Sugiyama-style layered ASCII/Unicode graph rendering
  • graph --parse — parse ASCII diagrams from stdin into boxes + edges
  • Flags: --unicode/--no-unicode, --vertical/--horizontal, --rounded, --double, --json
  • Round-trip: render → parse → structured data

Bug fix: body --in owner file search (#197)

  • When --in Owner is specified and the symbol is indexed in a different file, also search the owner's file for nested defs

Community feedback: members pagination (#198)

  • members --limit 0 — show all members without truncation
  • members --offset N — skip first N members for pagination

Community feedback: overview dedup & onboarding flow (#192)

  • overview --architecture dedup — skip "Most extended" section when --architecture is active; "Hub types" already covers the same parentIndex data with identical sorting; applies to both text and JSON output
  • tour composite command — nice idea but hard to get right; auto-selecting which types to explain risks wrong choices and bloated output; coding agents already do selective sequential calls (overview → pick interesting types → explain), which adapts better than a fixed composite

Community feedback: composite output modes to reduce round trips (#180)

  • members --body / explain --body — inline method bodies into member listings; combine existing members extraction with body span extraction in the same file pass; --max-lines N to skip large bodies
  • body -C N — context lines above/below the extracted span (line arithmetic around existing span)
  • body --imports — prepend the file's import block to body output (extract top-level Import nodes from same AST)
  • overrides --body — show each override's body inline; overrides already locates symbols + files, reuse extractBody on each; --max-lines N to cap
  • grep --in <symbol> — scope grep to a specific class/method body; parse AST to find symbol span, restrict grep to those line ranges; supports Owner.member dot syntax
  • Fix explain disambiguation to respect --path — verify --path filters before disambiguation (may already work correctly)
  • explain --near <file> — parse file's import block to rank/resolve ambiguous candidates (nice-to-have)

On-the-fly local definition fallback (#176)

  • When def returns 0 results, use bloom filters to find candidate files, parse them on-the-fly, and search for local defs/vals/vars inside method bodies matching the query name
  • Return results marked as "local" with owner chain (package > class > method > local def)
  • Zero index size growth — pays parse cost only on the miss path
  • Performance safeguards: file count limit, timeout consistent with refs/imports (20s)
  • Consider extending to explain and body commands as well

Community feedback: agent UX improvements (#164)

  • Copy-paste disambiguation commands — when explain hits multiple matches, print ready-to-run scalex explain pkg.Name commands instead of just a count + generic hint. Saves one round-trip per disambiguation.
  • explain --brief — condensed output: definition + top 3 members only. No doc, companion, inherited, impls, imports. Pairs with batch for lightweight multi-explain.

Community feedback: fuzzy not-found suggestions (#156)

  • search reverse-suffix matching — queries like ScalaJSClassEmitter suggest ClassEmitter
  • explain suffix auto-resolve — auto-shows best match when query is a superset
  • Unified not-found suggestions — search, coverage now show "Did you mean?" hints
  • Extracted resolvePackage()/mkPackageNotFound() — deduplicated package resolution from package/api/summary

Community feedback: disambiguation & filtering (#132–#135)

Bugs:

  • explain import refs now filtered by --path/--exclude-path — were unfiltered before
  • isTestFile detects root-level tests/, test/, testing/ — startsWith added alongside contains

Disambiguation & ambiguity (reported in #132, #133, #134):

  • explain disambiguation hints — "(N other matches — use package-qualified name or --path to disambiguate)"
  • explain package fallback — falls back to summary when symbol matches a package
  • explain --shallow — skip implementations and import refs
  • explain --no-doc — suppress Scaladoc section (#157)

Overview quality (#132, #133, #135):

  • Hub type casing — PascalCase preserved via symbolsByName lookup
  • Hub type noise filter — single-char names excluded; sorted by distinct-package count
  • Hub type signatures — one-line signature shown inline
  • overview --path — scopes all overview data to path prefix

Filtering (#133, #135):

  • --exclude-path — negative path filter on all commands via filterSymbols/filterRefs
  • symbols --summary — grouped counts by kind

Output control (#134):

  • Members deduplication — companion members deduplicated against primary in explain
  • explain totalImpls hint — "(showing N of M — use --impl-limit to adjust)"
  • Batch output size estimation — warn or auto-limit when a single query in a batch would produce >100KB output

Community feedback: exploration & impact analysis (#137)

  • explain --inherited — merge parent members into explain output, marking provenance; members --inherited already exists, expose it in the composite view
  • refs --top N — rank files by reference count (descending) instead of flat list; heaviest users surface first for impact analysis
  • Directory-level dependency graph — scalex dir-deps --path src/modules/auth/ aggregates imports by target directory with file counts; more granular than overview --architecture package-level graph (deferred — package→directory mapping adds complexity)

Community feedback: UX & discovery (#141)

  • explain package fallback warning — stderr message when silently falling back to package summary
  • entrypoints command — find @main, def main(, extends App, test suites; small effort, useful for onboarding
  • Override markers in members --inherited — show [override] vs [inherited from Parent] markers

Code quality improvements (#148)

  • Option bloom filters — identifierBloom: Option[BloomFilter] replaces null sentinel; index v8
  • Error handling — narrow Exception catches to IOException for file I/O; stderr logging for parse failures and unreadable files
  • Deduplicate extraction — shared extractRawSymbols used by both extractSymbols and extractSymbolsFromSource; fixes missing Given/Extension/Pkg.Object in diff command

Discarded from #253

  • refs --category CallSite — split Usage into CallSite vs Usage by checking if symbol appears in function position of Term.Apply; text heuristic (name( / name[) is cheap but noisy for common names (get, apply, map); AST-based detection adds parsing cost per file; same reasoning as discarded call-site extraction (#137) and call-site vs override distinction (#103)

Discarded from #141

  • Approximate call graph (calls command) — same reasoning as rejected "Static call graph (#101, #102)"; name-matched call targets produce false positives for common methods (apply, map, get)
  • Pipeline/flow command — same reasoning as rejected in #121, #135; BFS without type resolution is fragile
  • Co-occurrence analysis — pure text co-occurrence is what grep does; unclear value over refs --categorize

Discarded from #137

  • Companion member dedup in explain — already shipped in #136
  • Call-site extraction — without type resolution, method name matching has high false positives for common names (get, apply, map); grep already does \.method\( matching; same reasoning as rejected "Static call graph (#101, #102)" and "Call-site vs override distinction (#103)"

Discarded from #132–#135

  • Java member extraction (#135) [regex-based] — regex-based approach was fragile; replaced with JavaParser AST-based extraction in #167
  • Re-exported type ranking (#132) — detecting alias chains requires type resolution (unavailable without build server); name-based heuristics would produce false positives
  • Module/subproject awareness (#135) — already discarded in #103; build file detection couples to external conventions
  • flow/pipeline command (#135) — already discarded; BFS without type resolution is fragile via name collisions
  • explain --expand-members (#133, #134) — explain --expand N + body member --in Type already covers this workflow; adding selective member expansion has diminishing returns vs composing existing commands
  • Cross-project most-imported ranking (#132) — search already ranks by import count (shipped in #119)

Discarded from #121

  • scalex flow <from> <to> — BFS without type resolution is fragile via name collisions; fails "better than grep" gate (same reasoning as rejected scalex path in #102)
  • scalex sealed <trait> — hierarchy --down --depth 1 already serves this use case; marginal
  • Smarter default limits — auto-summarize is hard to get right universally; better to give users explicit flags (--members-limit, --definitions-only)

Completed

JavaParser-based Java extraction (#167)

  • Replace regex-based Java symbol extraction with JavaParser AST parsing
  • Java symbol extraction (classes, interfaces, enums, records, methods, fields)
  • Java member extraction (constructors, nested types, enum constants, @Override detection)
  • Java body extraction with owner filtering
  • Centralized isJavaFile() routing — eliminates scattered .endsWith(".java") checks

Extraction fixes (#127)

  • Stop indexing local vals/defs inside method bodies — traversal skips Defn.Def/Val/Var/Given/GivenAlias bodies
  • Case class constructor params in extractMembers — case class params are public vals; regular class params only if marked val/var

Signal vs noise (#121)

  • package --definitions-only — filter out vals/defs, show only class/trait/object/enum
  • overview hub types filter stdlib — skip scala/java base types (object, serializable, anyval) to surface real domain hub types
  • explain members sorted by kind — classes before defs before vals; --members-limit N flag (default 10)
  • explain fuzzy fallback — if exact match fails, auto-show best fuzzy match with stderr hint
  • hierarchy truncation count — "... and 87 more children" at depth limit instead of silent cut-off
  • scalex summary <package> — sub-package view with symbol counts; middle ground between overview and package

Reduce round-trips (#119, #120)

  • overview defaults to --no-tests; --include-tests to opt in
  • Owner.member dotted syntax for explain and def — def MyService.findUser resolves directly
  • explain --verbose — show member signatures inline instead of just names
  • explain inlines "Imported by" file list when count ≤ 10, shows count + hint otherwise
  • refs --count summary mode — "12 importers, 4 extensions, 30 usages" without full file lists
  • Companion-aware members — auto-shows companion object/class members
  • api --used-by <package> — coupling analysis: which types from pkg A are used by pkg B
  • search ranks by import count — heavily-imported types surface first
  • search --returns <Type> / --takes <Type> — signature substring filter

Phase 1–5: Foundation

  • Git file listing, Scalameta parsing, in-memory index, find definition, find references, CLI
  • .scalex/index.bin binary persistence with string interning, OID-based skip, auto-reindex
  • Search ranking (exact → prefix → substring), --kind filter, --limit N, quiet indexing
  • Claude Code plugin: plugin.json, SKILL.md, launcher script, install instructions
  • GraalVM native image (28MB standalone binary), build-native.sh
  • Binary format v3, bloom filters (Guava) for refs pre-screening, 20s timeout

Phase 6: CI + Distribution

  • GitHub Actions: native images on tag push (macOS arm64/x64, Linux x64)
  • GitHub Releases, install.sh in plugin

Phase 7: Coding Agent Innovations

  • batch, def --verbose, impl, refs --categorize, imports
  • Fallback hints, Scala 2 dialect fallback

Phase 8: Testing

  • 243 MUnit tests (ExtractionSuite: 50, IndexSuite: 68, AnalysisSuite: 23, CliSuite: 102)
  • Coverage: symbol extraction, persistence roundtrip, OID caching, bloom filters, search ranking, refs categorization, word boundary matching

Benchmarks (native image)

Project Files Symbols Cold Index Warm Index
Production monorepo 13,979 214,301 4.6s 540ms
Scala 3 compiler 18,485 144,211 2.7s 349ms

Post-v1 features

Import confidence & alias tracking

  • Confidence annotation (High/Medium/Low) based on imports; wildcard import resolution
  • Alias tracking (import X as Y, import {X => Y}); [via alias Y] annotation in output

Performance improvements

  • Eliminate double file read, skip save when nothing changed
  • Lazy bloom filter deserialization (~45% off load time)
  • Pre-compute search deduplication, adaptive bloom capacity
  • Single-pass post-index map building (2 passes vs 7)

Parse error diagnostics

  • Track/list files with parse errors via scalex index --verbose

Fuzzy camelCase search

  • "hms" matches HttpMessageService; ranked below exact/prefix/substring

zsh compat + UX (#22)

  • Bash re-exec guard, -w/--workspace flag, path-as-symbol hint

Coding agent ergonomics (#29)

  • --kind filter on def, --no-tests global flag, --path filter
  • refs -C N context lines, smarter def ranking

Annotation search (#32)

  • scalex annotated <annotation> with filters; annotations stored in binary index (v5)

Body search (#32)

  • scalex grep <pattern> — regex search with --path, --no-tests, -C N, 20s timeout, --count
  • Multi-pattern -e flag, POSIX regex auto-correction (\| → |)

Coding agent UX (#43, #46)

  • --prefix/--exact for search, -c alias for --categorize, condensed batch not-found
  • --categorize default on refs, --flat opt-in

Codebase exploration (#48)

  • members, doc, search --definitions-only, refs --category, overview

Codebase comprehension (#53, #54)

  • body, explain, hierarchy (parents up + children down), overrides
  • members --inherited, overview --architecture, deps, context
  • ast-pattern, diff

Test awareness (#56)

  • tests (MUnit, ScalaTest, specs2), body for test cases, coverage
  • tests --count dynamic test site detection — reports non-literal test names separately (#259)

Overview hub type filtering (#64)

  • Exclude stdlib/framework types from hub rankings; surface project-own types

Symbol disambiguation (#80)

  • explain uses def ranking, hierarchy cycle-detection fix

Profiling & benchmarking

  • --timings flag, async-profiler scripts, JFR config, microbenchmark harness, bench.sh/bench-compare.sh

Warm-load optimization

  • Lazy map building — 1.3–2.2x faster on scala3 (17.7k files)

Exploration & UX (#93–#96)

  • Fuzzy "did you mean?" on not-found, package command
  • overview --no-tests, overview --focus-package

API surface (#102, #103)

  • scalex api <package> — show which symbols are imported by other packages (public API surface); cross-reference import data with packageToSymbols; zero index change, pure in-memory query

Community feedback (#101–#103)

  • Package-qualified symbol lookup, type param indexing in extends clauses
  • Companion merging in explain, explain --expand N
  • Smarter refs/search ranking, lightweight Java file awareness
  • deps --depth N, members --verbose default, refs --strict
  • scalex file <query> — fuzzy camelCase-aware file search

Discarded & Dead Ends

Items tried or evaluated and rejected — documented here to avoid re-exploring.

Warm-load optimization attempts

Bottleneck: every query pays ~290ms cache-load + ~230ms build-symbolsByName. Cheapest commands ~361ms, most expensive ~666ms. Root cause is 269K readUTF string constructions — I/O and file size are not the bottleneck.

Round 1 — discarded after benchmarking:

  • Separate bloom storage — only ~38ms difference; skipBytes already efficient
  • Varint encoding — smaller file doesn't help CPU-bound string construction
  • Parallel index-build — ~130ms savings on a phase lazy maps already skip
  • Memory-mapped I/O — bottleneck is string construction; 23MB is OS page-cached

Round 2 — attempted v7 format, reverted (all results within σ):

  • Blooms at end — skip 12MB saves ~67ms, but lowerName strings grew index 22→24MB, net zero
  • 2-byte string indices — actual table has 269K entries (need 4 bytes), dead code on real codebases
  • Pre-interned lowercase names — +80K strings, +2MB; groupBy hash map building is the cost, not toLowerCase

Hyperfine v6 vs v7 (7 runs, warmup 2): file 361→371ms, def 591→580ms, impl 387→395ms, refs 666→646ms. All within σ.

Round 2 — remaining ideas, also discarded:

  • Lazy symbol deserialization — custom lazy format, high complexity for a subset of commands
  • Pre-grouped symbol storage — similar to pre-interned names which already failed in v7

Rejected features

  • Reverse alias lookup — agent can do 2-step lookup; risks worse-than-grep perf
  • Multi-workspace / cross-project awareness (#64) — unnecessary; use -w flag on target workspace
  • scalex pattern <name> (#53) — marginal for coding agents who infer patterns from explain
  • Static call graph (#101, #102) — name-matched call targets produce false positives (apply, map, get); fails "better than grep" gate; AST traversal risks blowing perf budget
  • scalex path <A> <B> (#102) — BFS without type resolution is fragile via name collisions; niche use case vs deps/refs
  • Module/subproject awareness (#103) — detecting build files couples to external conventions that change; directory heuristics unreliable across project layouts
  • Call-site vs override distinction in refs (#103) — refs --categorize already provides ExtendedBy/UsedAsType/Usage categories; marginal improvement for significant complexity
  • Structural pattern detection (#103) — marginal for coding agents who infer patterns from explain output
  • scalex imports <file> — deps already shows symbol-level dependencies; agent can read file top for imports